@useinsider/guido 3.12.0-beta.840207a → 3.12.0-beta.841bb6a

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 (61) hide show
  1. package/dist/@types/config/schemas.js +8 -13
  2. package/dist/components/Guido.vue.js +6 -6
  3. package/dist/components/Guido.vue2.js +49 -50
  4. package/dist/composables/useRecommendation.js +51 -82
  5. package/dist/config/migrator/recommendationMigrator.js +4 -7
  6. package/dist/enums/date.js +3 -4
  7. package/dist/enums/extensions/recommendationBlock.js +22 -28
  8. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -12
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +109 -123
  10. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
  11. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +102 -256
  12. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -24
  13. package/dist/guido.css +1 -1
  14. package/dist/services/recommendationApi.js +29 -72
  15. package/dist/src/@types/config/schemas.d.ts +0 -10
  16. package/dist/src/composables/useConfig.d.ts +0 -2
  17. package/dist/src/composables/useRecommendation.d.ts +0 -2
  18. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -10
  19. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
  20. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -606
  21. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -7
  22. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +1 -3
  23. package/dist/src/services/recommendationApi.d.ts +1 -7
  24. package/dist/src/stores/config.d.ts +0 -18
  25. package/dist/src/utils/genericUtil.d.ts +0 -9
  26. package/dist/static/styles/base.css.js +0 -15
  27. package/dist/utils/dateUtil.js +10 -23
  28. package/dist/utils/genericUtil.js +1 -10
  29. package/dist/utils/pairProductVariables.js +44 -43
  30. package/dist/utils/templatePreparation.js +58 -62
  31. package/package.json +1 -1
  32. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +0 -36
  33. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +0 -244
  34. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +0 -18
  35. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +0 -42
  36. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +0 -20
  37. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +0 -18
  38. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +0 -20
  39. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +0 -60
  40. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +0 -19
  41. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +0 -19
  42. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +0 -22
  43. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +0 -29
  44. package/dist/composables/useStrategyFilters.js +0 -16
  45. package/dist/enums/extensions/filteringV2.js +0 -8
  46. package/dist/enums/extensions/strategyDetail.js +0 -148
  47. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -146
  48. package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +0 -97
  49. package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +0 -10
  50. package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +0 -2
  51. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +0 -43
  52. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +0 -29
  53. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +0 -40
  54. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +0 -38
  55. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +0 -51
  56. package/dist/src/composables/useStrategyFilters.d.ts +0 -24
  57. package/dist/src/enums/extensions/filteringV2.d.ts +0 -72
  58. package/dist/src/enums/extensions/strategyDetail.d.ts +0 -90
  59. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -61
  60. package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +0 -50
  61. package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +0 -34
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as R, literal as i, looseObject as g, variant as C, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as f, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as h, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -78,12 +78,12 @@ const d = {
78
78
  select_items: e(c(S))
79
79
  })), P = k(
80
80
  t(),
81
- R(c(S), [])
81
+ C(c(S), [])
82
82
  ), D = g({
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
85
85
  /** Decimal places for price display (legacy data may use string or number) */
86
- decimalCount: e(f([t(), n()])),
86
+ decimalCount: e(h([t(), n()])),
87
87
  /** Pinned product IDs (empty array when filter-driven) */
88
88
  productIds: e(c(s())),
89
89
  /** Whether the block requested live products at send time */
@@ -117,7 +117,7 @@ const d = {
117
117
  /** Block type marker used by some legacy variants */
118
118
  blockType: e(t()),
119
119
  /** Size variant marker (legacy data may use string or number) */
120
- size: e(f([t(), n()])),
120
+ size: e(h([t(), n()])),
121
121
  /** Vertical responsiveness flag (legacy size=1 variants) */
122
122
  verticalResponsiveness: e(o()),
123
123
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
@@ -201,12 +201,7 @@ const d = {
201
201
  /** Enable Liquid template syntax */
202
202
  liquidSyntax: e(o(), !1),
203
203
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
204
- autosave: e(o(), !1),
205
- /**
206
- * Select a Reusable Recommendation Strategy (RRS) instead of a per-block algorithm.
207
- * Replaces the algorithm dropdown with a strategy dropdown fed from Smart Recommender.
208
- */
209
- reusableRecommendationStrategy: e(o(), !1)
204
+ autosave: e(o(), !1)
210
205
  }), U = l([
211
206
  "amp-accordion",
212
207
  "amp-carousel",
@@ -274,11 +269,11 @@ const d = {
274
269
  ...m.entries,
275
270
  type: i("custom"),
276
271
  /** Custom processor function */
277
- processor: h(
272
+ processor: f(
278
273
  (u) => typeof u == "function",
279
274
  "processor must be a function"
280
275
  )
281
- }), G = C("type", [
276
+ }), G = R("type", [
282
277
  H,
283
278
  _,
284
279
  j,
@@ -294,7 +289,7 @@ const d = {
294
289
  * Return false to cancel the save operation.
295
290
  */
296
291
  externalValidation: e(
297
- h(
292
+ f(
298
293
  (u) => typeof u == "function",
299
294
  "externalValidation must be a function"
300
295
  )
@@ -1,18 +1,18 @@
1
- import a from "./Guido.vue2.js";
1
+ import i from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import i from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.StrategyDetailDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], s = /* @__PURE__ */ i(
10
- a,
9
+ }, n = [], s = /* @__PURE__ */ a(
10
+ i,
11
11
  t,
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "f96d1003"
15
+ "50dac6de"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,30 +1,29 @@
1
1
  import { defineComponent as X, defineAsyncComponent as I, ref as W, computed as x, watch as Y, onMounted as Z, onUnmounted as ee } from "vue";
2
- import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
2
+ import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as te } from "../composables/useGuidoActions.js";
4
4
  import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
5
5
  import { usePartner as re } from "../composables/usePartner.js";
6
6
  import { useStripo as se } from "../composables/useStripo.js";
7
7
  import { useTimerClone as ae } from "../composables/useTimerClone.js";
8
8
  import { migrate as G } from "../config/migrator/index.js";
9
9
  import { ModuleFolderDefaults as H } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ie } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as ce } from "../extensions/Blocks/Recommendation/store/recommendation.js";
10
+ import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
12
  import me from "./organisms/AutoSaveController.vue.js";
13
13
  import de from "./organisms/base/Toaster.vue.js";
14
14
  import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import ue from "./organisms/extensions/recommendation/StrategyDetailDrawer.vue.js";
16
- import pe from "./organisms/header/HeaderWrapper.vue.js";
17
- import fe from "./organisms/LoadingWrapper.vue.js";
18
- import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import Se from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as ye } from "../services/stripoApi.js";
21
- import { useConfigStore as ge } from "../stores/config.js";
15
+ import ue from "./organisms/header/HeaderWrapper.vue.js";
16
+ import pe from "./organisms/LoadingWrapper.vue.js";
17
+ import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ve from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as Se } from "../services/stripoApi.js";
20
+ import { useConfigStore as ye } from "../stores/config.js";
22
21
  import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
23
22
  import { useEditorStore as $ } from "../stores/editor.js";
24
- import { usePreviewStore as be } from "../stores/preview.js";
25
- import { useTemplateStore as we } from "../stores/template.js";
26
- import { useUnsubscribeStore as De } from "../stores/unsubscribe.js";
27
- const Je = /* @__PURE__ */ X({
23
+ import { usePreviewStore as ge } from "../stores/preview.js";
24
+ import { useTemplateStore as be } from "../stores/template.js";
25
+ import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
26
+ const Ve = /* @__PURE__ */ X({
28
27
  __name: "Guido",
29
28
  props: {
30
29
  config: null
@@ -35,11 +34,11 @@ const Je = /* @__PURE__ */ X({
35
34
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
36
35
  ), V = I(
37
36
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
38
- ), w = W(), p = W(), f = he(), D = De(), c = ge();
39
- c.init(b.config);
40
- const m = $(), j = be(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), E = () => {
37
+ ), E = W(), p = W(), f = he(), w = Ee(), i = ye();
38
+ i.init(b.config);
39
+ const m = $(), j = ge(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), D = () => {
41
40
  var e;
42
- return (e = w.value) == null ? void 0 : e.handleSave(!0);
41
+ return (e = E.value) == null ? void 0 : e.handleSave(!0);
43
42
  }, C = (e) => {
44
43
  m.loadingStatus = e;
45
44
  }, {
@@ -47,10 +46,10 @@ const Je = /* @__PURE__ */ X({
47
46
  userId: T,
48
47
  partnerName: L,
49
48
  username: k,
50
- template: t,
49
+ template: o,
51
50
  editor: s
52
- } = c, l = (t == null ? void 0 : t.html) || "", F = (t == null ? void 0 : t.css) || "", S = (t == null ? void 0 : t.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
53
- te(), ne();
51
+ } = i, l = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
52
+ oe(), ne();
54
53
  const y = {
55
54
  emailId: v,
56
55
  userId: T,
@@ -63,11 +62,11 @@ const Je = /* @__PURE__ */ X({
63
62
  onReady: () => {
64
63
  console.debug("guido:ready"), n("ready");
65
64
  }
66
- }, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = ye(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
65
+ }, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = Se(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
67
66
  var e;
68
- return !((e = c.ui) != null && e.showHeader);
67
+ return !((e = i.ui) != null && e.showHeader);
69
68
  });
70
- oe({
69
+ te({
71
70
  onBack: () => {
72
71
  console.debug("guido:back"), n("back");
73
72
  },
@@ -75,8 +74,8 @@ const Je = /* @__PURE__ */ X({
75
74
  console.debug("guido:save:start"), n("save:start");
76
75
  },
77
76
  onSaveComplete: (e) => {
78
- const o = { ...e, metadata: y };
79
- console.debug("guido:save:complete", o), n("save:complete", o);
77
+ const t = { ...e, metadata: y };
78
+ console.debug("guido:save:complete", t), n("save:complete", t);
80
79
  },
81
80
  onTestEmailClick: () => {
82
81
  console.debug("guido:test-email:click"), n("test-email:click");
@@ -90,52 +89,52 @@ const Je = /* @__PURE__ */ X({
90
89
  Y(() => d.value, () => {
91
90
  n("on-change", d.value);
92
91
  });
93
- const g = (e) => {
94
- const o = e, { attribute: u, position: i } = o.detail;
95
- console.debug("dynamic-content:open", o.detail), n("dynamic-content:open", u, i);
92
+ const h = (e) => {
93
+ const t = e, { attribute: u, position: c } = t.detail;
94
+ console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", u, c);
96
95
  };
97
96
  let a = null;
98
- const h = () => {
99
- var o;
100
- const e = document.querySelector(ie);
101
- (o = p.value) == null || o.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
97
+ const g = () => {
98
+ var t;
99
+ const e = document.querySelector(ce);
100
+ (t = p.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
102
101
  };
103
102
  return Z(async () => {
104
- var o, u;
105
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ce().$reset(), $().$reset(), m.templateId = v, we().$reset(), h();
106
- const e = (o = p.value) == null ? void 0 : o.parentElement;
107
- e && (a = new ResizeObserver(h), a.observe(e));
103
+ var t, u;
104
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), $().$reset(), m.templateId = v, be().$reset(), g();
105
+ const e = (t = p.value) == null ? void 0 : t.parentElement;
106
+ e && (a = new ResizeObserver(g), a.observe(e));
108
107
  try {
109
- D.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
110
- const i = ((u = t == null ? void 0 : t.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
108
+ w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
109
+ const c = ((u = o == null ? void 0 : o.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
111
110
  let r = {
112
- html: l && await G(l, i),
111
+ html: l && await G(l, c),
113
112
  css: F
114
113
  };
115
- r.html || (r = await P(), r.html = await G(r.html, i)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
116
- } catch (i) {
117
- console.error("Failed to initialize Stripo editor:", i);
114
+ r.html || (r = await P(), r.html = await G(r.html, c)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
115
+ } catch (c) {
116
+ console.error("Failed to initialize Stripo editor:", c);
118
117
  }
119
- document.addEventListener("dynamic-content:open", g);
118
+ document.addEventListener("dynamic-content:open", h);
120
119
  }), ee(() => {
121
- a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", g);
120
+ a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", h);
122
121
  try {
123
122
  window.UIEditor.removeEditor();
124
123
  } catch {
125
124
  console.debug("Failed to remove Stripo editor: No editor found");
126
125
  }
127
- c.reset();
126
+ i.reset();
128
127
  }), q({
129
128
  dynamicContent: {
130
129
  insert: B,
131
130
  close: N
132
131
  },
133
132
  hasChanges: d,
134
- saveSilent: E,
133
+ saveSilent: D,
135
134
  setLoading: C
136
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: w, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: D, props: b, configStore: c, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: E, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: t, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: g, ribbonObserver: a, updateRibbonOffset: h, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, StrategyDetailDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: Se };
135
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: b, configStore: i, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: D, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: o, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: h, ribbonObserver: a, updateRibbonOffset: g, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ve };
137
136
  }
138
137
  });
139
138
  export {
140
- Je as default
139
+ Ve as default
141
140
  };
@@ -1,21 +1,22 @@
1
- import { getRecommendationFeedSourceMaps as E, URLS as S } from "../enums/extensions/recommendationBlock.js";
2
- import { MinDeviceViewport as A, DefaultPadding as U } from "../enums/recommendation.js";
3
- import { useRecommendationExtensionStore as g } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { generateCompleteFilterQuery as _ } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
- import { getPartnerRecommendationParams as b } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
6
- import { useConfigStore as D } from "../stores/config.js";
7
- const M = () => {
8
- const f = ({
1
+ import { getRecommendationFeedSourceMaps as I, URLS as R } from "../enums/extensions/recommendationBlock.js";
2
+ import { MinDeviceViewport as C, DefaultPadding as b } from "../enums/recommendation.js";
3
+ import { useRecommendationExtensionStore as l } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
6
+ import { useConfigStore as x } from "../stores/config.js";
7
+ const k = () => ({
8
+ calculateCardWidth: ({
9
9
  mobileLeftPadding: a,
10
- mobileRightPadding: c,
11
- cardsInRow: s,
12
- unresponsive: r
10
+ mobileRightPadding: s,
11
+ cardsInRow: c,
12
+ unresponsive: o
13
13
  }) => {
14
- const n = r ? s : 1, e = a + c + (n - 1) * U;
15
- return (A - e) / n;
16
- }, I = (a) => {
17
- const c = g(), s = Number(a), r = c.blockStates[s];
18
- if (!r)
14
+ const r = o ? c : 1, e = a + s + (r - 1) * b;
15
+ return (C - e) / r;
16
+ },
17
+ getRecommendationCampaignData: (a) => {
18
+ const s = l(), c = Number(a), o = s.blockStates[c];
19
+ if (!o)
19
20
  return {
20
21
  textTrimming: !1,
21
22
  orientation: "vertical",
@@ -28,81 +29,49 @@ const M = () => {
28
29
  discountBeforeTextValue: "",
29
30
  discountAfterTextValue: ""
30
31
  };
31
- const { recommendationConfigs: n } = r, e = n.orientation === "grid" ? "vertical" : "horizontal";
32
+ const { recommendationConfigs: r } = o, e = r.orientation === "grid" ? "vertical" : "horizontal";
32
33
  return {
33
- textTrimming: n.textTrimming,
34
+ textTrimming: r.textTrimming,
34
35
  orientation: e,
35
36
  mobileLeftPadding: 0,
36
37
  mobileRightPadding: 0,
37
- cardsInRow: n.cardsInRow,
38
- unresponsive: n.unresponsive,
38
+ cardsInRow: r.cardsInRow,
39
+ unresponsive: r.unresponsive,
39
40
  priceBeforeTextValue: "",
40
41
  priceAfterTextValue: "",
41
42
  discountBeforeTextValue: "",
42
43
  discountAfterTextValue: ""
43
44
  };
44
- }, p = {
45
- LOCALE: "{locale}",
46
- CURRENCY: "{currency}",
47
- CAMPAIGN_ID: "{campaignId}",
48
- STRATEGY_ID: "{strategyId}",
49
- CLIENT_ID: "{clientId}",
50
- USER_ID: "{userId}",
51
- ITEM_ID: "{itemId}"
52
- }, y = (a, c) => Object.entries(p).reduce(
53
- (s, [r, n]) => s.replaceAll(
54
- n,
55
- c[r]
56
- ),
57
- a
58
- );
59
- return {
60
- calculateCardWidth: f,
61
- getRecommendationCampaignData: I,
62
- buildCampaignUrl: (a, c) => {
63
- var m;
64
- const s = g(), r = D(), n = Number(a);
65
- let e;
66
- if (c)
67
- e = c;
68
- else {
69
- const o = s.blockStates[n];
70
- if (!o)
71
- return "";
72
- const { recommendationConfigs: i } = o;
73
- e = {
74
- strategy: i.strategy,
75
- strategyId: i.strategyId,
76
- language: i.language,
77
- currencyCode: i.currencySettings.value,
78
- size: i.size,
79
- productIds: i.productIds,
80
- filters: i.filters,
81
- shuffleProducts: i.shuffleProducts
82
- };
83
- }
84
- const d = e.strategyId ? s.strategyUrlTemplates[e.strategyId] : "";
85
- if (d) {
86
- const o = y(d, {
87
- LOCALE: e.language,
88
- CURRENCY: e.currencyCode,
89
- CAMPAIGN_ID: r.variationId,
90
- STRATEGY_ID: e.strategyId,
91
- CLIENT_ID: "6KcLM9TwheVB1mgK",
92
- USER_ID: "{user_id}",
93
- ITEM_ID: "{itemId}"
94
- });
95
- return s.recommendationCampaignUrls[a] = o, o;
96
- }
97
- const C = ((m = E().find((o) => o.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
98
- t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", r.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", r.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
99
- const R = e.filters.filter((o) => o.isValid), l = _(R);
100
- l && t.set("filter", l), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(b(r.partnerName, e.strategy)).forEach(([o, i]) => t.set(o, i));
101
- const T = decodeURIComponent(t.toString()), u = `${S.RECOMMENDATION_API_URL}/v2/${C}?${T}`;
102
- return s.recommendationCampaignUrls[a] = u, u;
45
+ },
46
+ buildCampaignUrl: (a, s) => {
47
+ var m;
48
+ const c = l(), o = x(), r = Number(a);
49
+ let e;
50
+ if (s)
51
+ e = s;
52
+ else {
53
+ const i = c.blockStates[r];
54
+ if (!i)
55
+ return "";
56
+ const { recommendationConfigs: n } = i;
57
+ e = {
58
+ strategy: n.strategy,
59
+ language: n.language,
60
+ currencyCode: n.currencySettings.value,
61
+ size: n.size,
62
+ productIds: n.productIds,
63
+ filters: n.filters,
64
+ shuffleProducts: n.shuffleProducts
65
+ };
103
66
  }
104
- };
105
- };
67
+ const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
68
+ t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
69
+ const g = e.filters.filter((i) => i.isValid), d = h(g);
70
+ d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(o.partnerName, e.strategy)).forEach(([i, n]) => t.set(i, n));
71
+ const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
72
+ return c.recommendationCampaignUrls[a] = u, u;
73
+ }
74
+ });
106
75
  export {
107
- M as useRecommendation
76
+ k as useRecommendation
108
77
  };
@@ -1,6 +1,6 @@
1
1
  import { BlockId as f } from "../../enums/block.js";
2
- import { useTemplateStore as y } from "../../stores/template.js";
3
- import { mapComposition as b } from "./recommendation/compositionMapper.js";
2
+ import { useTemplateStore as b } from "../../stores/template.js";
3
+ import { mapComposition as y } from "./recommendation/compositionMapper.js";
4
4
  import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
5
5
  import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
6
6
  import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
@@ -20,11 +20,8 @@ function B(i, t, a) {
20
20
  ), !1;
21
21
  const n = a[String(o)] ?? {
22
22
  currencySettings: v(t)
23
- }, c = T(n, r, o), e = b((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
23
+ }, c = T(n, r, o), e = y((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
24
24
  ...c,
25
- // Legacy blocks predate RRS and carry no strategy reference. Migrated
26
- // blocks keep running on their algorithm until a strategy is assigned.
27
- strategyId: "",
28
25
  composition: e.composition,
29
26
  visibility: e.visibility,
30
27
  textTrimming: e.anyTextTrimming
@@ -59,7 +56,7 @@ function B(i, t, a) {
59
56
  function q(i, t = {}) {
60
57
  const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
61
58
  try {
62
- y().$patch((e) => {
59
+ b().$patch((e) => {
63
60
  e.migrations = {
64
61
  ...e.migrations,
65
62
  [f.Recommendation]: r.length
@@ -1,6 +1,5 @@
1
- const t = "tr-TR", T = "default", L = "UTC";
1
+ const t = "tr-TR", L = "default";
2
2
  export {
3
- T as DEFAULT,
4
- t as DEFAULT_LOCALE,
5
- L as DEFAULT_TZ
3
+ L as DEFAULT,
4
+ t as DEFAULT_LOCALE
6
5
  };
@@ -2,15 +2,10 @@ import { useTranslations as r } from "../../composables/useTranslations.js";
2
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
- PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
6
- // Reusable Recommendation Strategies (RRS), also same-origin on inone.
7
- RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
8
- STRATEGY_RECOMMENDATION_URL_PATH: "/api/recommendation-strategies/strategy-recommendation-url"
5
+ PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
9
6
  }, c = {
10
- CLIENT_ID: "clientId",
11
- STRATEGY_ID: "strategy_id",
12
- FILTERS: "filters"
13
- }, d = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", m = () => {
7
+ CLIENT_ID: "clientId"
8
+ }, d = () => {
14
9
  const e = r();
15
10
  return [
16
11
  {
@@ -74,14 +69,14 @@ const l = {
74
69
  path: "top-sellers"
75
70
  }
76
71
  ];
77
- }, p = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], v = [
72
+ }, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
78
73
  { text: "before the amount", value: "0" },
79
74
  { text: "after the amount", value: "1" }
80
- ], h = [
75
+ ], v = [
81
76
  { text: "dot(.)", value: "." },
82
77
  { text: "comma(,)", value: "," },
83
78
  { text: "space( )", value: " " }
84
- ], x = [
79
+ ], h = [
85
80
  { text: "0", value: "0" },
86
81
  { text: "1", value: "1" },
87
82
  { text: "2", value: "2" },
@@ -93,55 +88,54 @@ const l = {
93
88
  { text: "contains", value: "~" },
94
89
  { text: "does not contain", value: "!~" },
95
90
  { text: "any of", value: a }
96
- ], s = [
91
+ ], n = [
97
92
  { text: "is exactly", value: "=" },
98
93
  { text: "is not exactly", value: "!==" },
99
94
  { text: "contains", value: "~" },
100
95
  { text: "does not contain", value: "!~" },
101
96
  { text: "any of", value: a }
102
- ], n = [
97
+ ], o = [
103
98
  { text: "is equal to", value: "=" },
104
99
  { text: "is greater than", value: ">" },
105
100
  { text: "is less than", value: "<" }
106
- ], o = [
101
+ ], s = [
107
102
  { text: "is equal to", value: "=" },
108
103
  { text: "after", value: ">" },
109
104
  { text: "before", value: "<" }
110
105
  ], i = [
111
106
  { text: "true", value: "==" },
112
107
  { text: "false", value: "!=" }
113
- ], g = (e) => {
108
+ ], x = (e) => {
114
109
  if (!e)
115
110
  return t;
116
111
  switch (e) {
117
112
  case "Boolean":
118
113
  return i;
119
114
  case "Date":
120
- return o;
115
+ return s;
121
116
  case "Number":
122
- return n;
117
+ return o;
123
118
  case "String":
124
119
  return t;
125
120
  case "Strings":
126
- return s;
121
+ return n;
127
122
  default:
128
123
  return t;
129
124
  }
130
125
  };
131
126
  export {
132
127
  a as OP_ANY_OF,
133
- p as PriceAttributes,
128
+ m as PriceAttributes,
134
129
  c as QUERY_PARAMS,
135
- d as RRS_EMAIL_ACTIVE_FILTER,
136
130
  l as URLS,
137
- x as currencyDecimalCounts,
138
- v as currencyLocationMaps,
139
- h as currencyOperators,
140
- g as getOperatorOptions,
141
- m as getRecommendationFeedSourceMaps,
142
- s as operatorOptionsForArrayOfStrings,
131
+ h as currencyDecimalCounts,
132
+ p as currencyLocationMaps,
133
+ v as currencyOperators,
134
+ x as getOperatorOptions,
135
+ d as getRecommendationFeedSourceMaps,
136
+ n as operatorOptionsForArrayOfStrings,
143
137
  i as operatorOptionsForBooleans,
144
- o as operatorOptionsForDates,
145
- n as operatorOptionsForNumbers,
138
+ s as operatorOptionsForDates,
139
+ o as operatorOptionsForNumbers,
146
140
  t as operatorOptionsForStrings
147
141
  };
@@ -1,16 +1,16 @@
1
- import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as a } from "./layout.js";
1
+ import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
2
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 } from "./selectors.js";
3
- const C = {
3
+ const 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
+ }, O = {
11
11
  textBefore: "",
12
12
  textAfter: ""
13
- }, O = {
13
+ }, a = {
14
14
  textBefore: "",
15
15
  textAfter: ""
16
16
  }, A = [
@@ -32,16 +32,15 @@ const C = {
32
32
  }, l = {
33
33
  // Settings
34
34
  strategy: "mostPopular",
35
- strategyId: "",
36
35
  productIds: [],
37
36
  size: "6",
38
37
  shuffleProducts: !1,
39
38
  language: "en_US",
40
- currency: C,
39
+ currency: D,
41
40
  filters: [],
42
41
  // Layout
43
42
  layout: "grid",
44
- cardsInRow: a,
43
+ cardsInRow: C,
45
44
  mobileCardsInRow: e,
46
45
  mobileLayoutEnabled: !1,
47
46
  previousMobileCardsInRow: e,
@@ -53,8 +52,8 @@ const C = {
53
52
  composition: A,
54
53
  visibility: c,
55
54
  // Element settings
56
- omnibusPrice: D,
57
- omnibusDiscount: O,
55
+ omnibusPrice: O,
56
+ omnibusDiscount: a,
58
57
  textTrimming: !1,
59
58
  // Price placement (block-level, affects all cards)
60
59
  // Default ON = current stacked look, so existing templates are unaffected.
@@ -72,10 +71,10 @@ const C = {
72
71
  export {
73
72
  m as CURRENT_CONFIG_VERSION,
74
73
  A as DEFAULT_COMPOSITION,
75
- C as DEFAULT_CURRENCY,
74
+ D as DEFAULT_CURRENCY,
76
75
  l as DEFAULT_NODE_CONFIG,
77
- O as DEFAULT_OMNIBUS_DISCOUNT,
78
- D as DEFAULT_OMNIBUS_PRICE,
76
+ a as DEFAULT_OMNIBUS_DISCOUNT,
77
+ O as DEFAULT_OMNIBUS_PRICE,
79
78
  c as DEFAULT_VISIBILITY,
80
79
  N as EXCLUDED_ALGORITHM_IDS
81
80
  };