@useinsider/guido 3.17.0-beta.a18fbda → 3.17.0-beta.a2334c9

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 (102) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +85 -81
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +131 -0
  7. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  11. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  12. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  13. package/dist/components/organisms/header/EditorActions.vue.js +1 -1
  14. package/dist/components/organisms/header/EditorActions.vue2.js +41 -54
  15. package/dist/composables/useActionsApi.js +67 -82
  16. package/dist/composables/useAutoSave.js +26 -31
  17. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  18. package/dist/composables/useGuidoStateBridge.js +31 -37
  19. package/dist/composables/useLegacyStrategyConversion.js +52 -0
  20. package/dist/composables/useRecommendation.js +41 -34
  21. package/dist/composables/useSave.js +36 -39
  22. package/dist/composables/useStripo.js +14 -14
  23. package/dist/config/i18n/en/labels.json.js +1 -1
  24. package/dist/config/migrator/index.js +9 -8
  25. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  26. package/dist/config/migrator/recommendation/extractors.js +29 -24
  27. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  28. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  29. package/dist/config/migrator/recommendationMigrator.js +31 -25
  30. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  31. package/dist/enums/academy.js +2 -1
  32. package/dist/enums/date.js +5 -3
  33. package/dist/enums/extensions/recommendationBlock.js +4 -1
  34. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  35. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  36. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  37. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  38. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  39. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  40. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +242 -180
  41. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +158 -0
  42. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  43. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  44. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  45. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  46. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  47. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +217 -80
  48. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  49. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  50. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  51. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +58 -0
  52. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  53. package/dist/extensions/Blocks/common-control.js +22 -19
  54. package/dist/guido.css +1 -1
  55. package/dist/services/recommendationApi.js +81 -33
  56. package/dist/src/@types/config/schemas.d.ts +2 -0
  57. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  58. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  59. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  60. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  61. package/dist/src/composables/useConfig.d.ts +2 -0
  62. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  63. package/dist/src/composables/useRecommendation.d.ts +1 -0
  64. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  65. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  66. package/dist/src/enums/academy.d.ts +1 -0
  67. package/dist/src/enums/date.d.ts +1 -0
  68. package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
  69. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  70. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  71. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  72. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  73. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  74. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  75. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  76. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  77. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +17 -0
  78. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  79. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  80. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  81. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +229 -10
  82. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  83. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  84. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +39 -0
  85. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  86. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  87. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  88. package/dist/src/services/recommendationApi.d.ts +5 -1
  89. package/dist/src/stores/config.d.ts +18 -0
  90. package/dist/src/stores/save-as-template.d.ts +4 -3
  91. package/dist/src/utils/genericUtil.d.ts +5 -0
  92. package/dist/static/assets/icons/line-change.svg.js +5 -0
  93. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  94. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  95. package/dist/static/styles/components/recommendation-strategy.css.js +185 -0
  96. package/dist/static/styles/customEditorStyle.css.js +3 -1
  97. package/dist/utils/dateUtil.js +23 -10
  98. package/dist/utils/genericUtil.js +28 -27
  99. package/dist/utils/templatePreparation.js +35 -34
  100. package/package.json +2 -1
  101. package/dist/composables/useEditorLock.js +0 -20
  102. package/dist/src/composables/useEditorLock.d.ts +0 -10
package/README.md CHANGED
@@ -162,6 +162,7 @@ const config: GuidoConfigInput = {
162
162
  liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
163
163
  autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
164
164
  allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
165
+ reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
165
166
  },
166
167
 
167
168
  // Optional: Callbacks
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as k, boolean as o, array as c, transform as C, record as y, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as y, boolean as o, array as c, transform as C, record as k, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
3
3
  const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -76,7 +76,7 @@ const p = {
76
76
  children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
78
  select_items: e(c(S))
79
- })), N = y(
79
+ })), N = k(
80
80
  t(),
81
81
  R(c(S), [])
82
82
  ), P = g({
@@ -132,7 +132,7 @@ const p = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- y(t(), P),
135
+ k(t(), P),
136
136
  {}
137
137
  )
138
138
  }), x = a({
@@ -219,7 +219,8 @@ const p = {
219
219
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
220
220
  allowlistEnabled: e(o(), !1),
221
221
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
- linkTrackingIds: e(o(), !1)
222
+ linkTrackingIds: e(o(), !1),
223
+ reusableRecommendationStrategy: e(o(), !1)
223
224
  }), B = i([
224
225
  "amp-accordion",
225
226
  "amp-carousel",
@@ -287,7 +288,7 @@ const p = {
287
288
  ...d.entries,
288
289
  type: u("custom"),
289
290
  /** Custom processor function */
290
- processor: k(
291
+ processor: y(
291
292
  (s) => typeof s == "function",
292
293
  "processor must be a function"
293
294
  )
@@ -307,7 +308,7 @@ const p = {
307
308
  * Return false to cancel the save operation.
308
309
  */
309
310
  externalValidation: e(
310
- k(
311
+ y(
311
312
  (s) => typeof s == "function",
312
313
  "externalValidation must be a function"
313
314
  )
@@ -1,20 +1,20 @@
1
- import i from "./Guido.vue2.js";
1
+ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
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.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
5
+ var a = this, r = a._self._c, e = a._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) : a._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), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], s = /* @__PURE__ */ a(
10
- i,
9
+ }, s = [], n = /* @__PURE__ */ i(
10
+ o,
11
11
  t,
12
- n,
12
+ s,
13
13
  !1,
14
14
  null,
15
- "1f2703e5"
15
+ "d1f80922"
16
16
  );
17
- const l = s.exports;
17
+ const f = n.exports;
18
18
  export {
19
- l as default
19
+ f as default
20
20
  };
@@ -1,68 +1,73 @@
1
- import { defineComponent as Y, defineAsyncComponent as N, ref as O, computed as P, watch as x, onMounted as Z, onUnmounted as ee } from "vue";
2
- import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as oe } from "../composables/useEditorLock.js";
4
- import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
5
- import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
6
- import { usePartner as se } from "../composables/usePartner.js";
1
+ import { defineComponent as ee, defineAsyncComponent as m, ref as U, computed as u, watch as A, onMounted as te, onUnmounted as oe } from "vue";
2
+ import { useCortexBlueprintBridge as ne } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as se } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ae } from "../composables/usePartner.js";
7
6
  import { useStripo as ie } from "../composables/useStripo.js";
8
- import { useTimerClone as ae } from "../composables/useTimerClone.js";
9
- import { migrate as A } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as W } from "../enums/defaults.js";
11
- import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as de } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { useTimerClone as ce } from "../composables/useTimerClone.js";
8
+ import { migrate as _ } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
+ import { RIBBON_SELECTOR as de } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
12
  import me from "./organisms/AutoSaveController.vue.js";
14
13
  import le from "./organisms/base/Toaster.vue.js";
15
14
  import ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
16
15
  import pe from "./organisms/header/HeaderWrapper.vue.js";
17
16
  import fe from "./organisms/LoadingWrapper.vue.js";
18
- import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
- import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
- import { useStripoApi as ge } from "../services/stripoApi.js";
21
- import { useConfigStore as he } from "../stores/config.js";
22
- import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
23
- import { useEditorStore as G } from "../stores/editor.js";
17
+ import ye from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as ve } from "../services/stripoApi.js";
20
+ import { useConfigStore as Se } from "../stores/config.js";
21
+ import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
22
+ import { useEditorStore as P } from "../stores/editor.js";
24
23
  import { usePreviewStore as be } from "../stores/preview.js";
25
24
  import { useTemplateStore as Ee } from "../stores/template.js";
26
25
  import { useUnsubscribeStore as we } from "../stores/unsubscribe.js";
27
- import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
28
- const Qe = /* @__PURE__ */ Y({
26
+ import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
27
+ const Je = /* @__PURE__ */ ee({
29
28
  __name: "Guido",
30
29
  props: {
31
30
  config: null,
32
31
  ready: { type: Boolean, default: !0 }
33
32
  },
34
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
35
- setup($, { expose: z, emit: r }) {
36
- const i = $, q = N(
34
+ setup(x, { expose: G, emit: r }) {
35
+ const a = x, H = m(
37
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
38
- ), K = N(
37
+ ), $ = m(
39
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
40
- ), h = O(), l = O(), u = Se(), S = we(), o = he();
41
- i.ready && o.init(i.config);
42
- const c = G(), V = be(), m = P(() => c.hasChanges), { isTestPartner: j } = se(), b = () => {
39
+ ), z = m(
40
+ () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
+ ), q = m(
42
+ () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
43
+ ), K = m(
44
+ () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
45
+ ), h = U(), p = U(), f = he(), b = we(), o = Se();
46
+ a.ready && o.init(a.config);
47
+ const c = P(), V = be(), l = u(() => c.hasChanges), { isTestPartner: j } = ae(), E = () => {
43
48
  var t;
44
49
  return (t = h.value) == null ? void 0 : t.handleSave(!0);
45
- }, E = (t) => {
50
+ }, w = (t) => {
46
51
  c.loadingStatus = t;
47
52
  };
48
- te(), re();
49
- const p = () => {
53
+ ne(), se();
54
+ const y = () => {
50
55
  var t, e;
51
56
  return {
52
57
  emailId: o.templateId,
53
58
  userId: o.userId,
54
59
  username: o.username,
55
60
  partnerName: o.partnerName,
56
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
57
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
61
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
62
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
58
63
  };
59
- }, { initPlugin: w, preloadRuntime: C } = ie(), { runExclusive: k, beginMount: D, isCurrentMount: T } = oe();
60
- let f = 0;
61
- const { getDefaultTemplate: F } = ge(), { cloneTimersOnSave: I, hasTimerBlocks: L } = ae(), J = P(() => {
64
+ }, { initPlugin: C, preloadRuntime: D } = ie(), { getDefaultTemplate: k } = ve(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ce(), J = u(() => {
62
65
  var t;
63
66
  return !((t = o.ui) != null && t.showHeader);
64
- });
65
- ne({
67
+ }), Q = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), X = u(
68
+ () => !!O().recommendationConfigs.strategyId
69
+ );
70
+ re({
66
71
  onBack: () => {
67
72
  console.debug("guido:back"), r("back");
68
73
  },
@@ -70,87 +75,86 @@ const Qe = /* @__PURE__ */ Y({
70
75
  console.debug("guido:save:start"), r("save:start");
71
76
  },
72
77
  onSaveComplete: (t) => {
73
- const e = { ...t, metadata: p() };
78
+ const e = { ...t, metadata: y() };
74
79
  console.debug("guido:save:complete", e), r("save:complete", e);
75
80
  },
76
81
  onTestEmailClick: () => {
77
82
  console.debug("guido:test-email:click"), r("test-email:click");
78
83
  }
79
84
  });
80
- const M = (t) => {
81
- console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
85
+ const I = (t) => {
86
+ console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
82
87
  }, R = () => {
83
88
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
84
89
  };
85
- x(() => m.value, () => {
86
- r("on-change", m.value);
90
+ A(() => l.value, () => {
91
+ r("on-change", l.value);
87
92
  });
88
- const v = (t) => {
93
+ const g = (t) => {
89
94
  const e = t, { attribute: s, position: d } = e.detail;
90
95
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
91
96
  };
92
- let a = null;
93
- const y = () => {
97
+ let i = null;
98
+ const v = () => {
94
99
  var e;
95
- const t = document.querySelector(ce);
96
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
97
- }, g = async () => {
100
+ const t = document.querySelector(de);
101
+ (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
102
+ }, S = async () => {
98
103
  var t;
99
104
  try {
100
- o.initialized || o.init(i.config), c.templateId = o.templateId;
101
- const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
102
- S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
103
- const U = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds");
105
+ o.initialized || o.init(a.config), c.templateId = o.templateId;
106
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
107
+ b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
108
+ const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
104
109
  let n = {
105
- html: s && await A(s, U),
110
+ html: s && await _(s, M),
106
111
  css: d
107
112
  };
108
- n.html || (n = await F(), n.html = await A(n.html, U));
109
- const Q = _ ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
110
- L(n.html) && (n.html = await I(n.html)), _ && (c.trackIdSessionFloor = Math.max(Q, H(n.html)));
111
- const X = {
112
- preselectedDynamicContentList: B,
113
+ n.html || (n = await k(), n.html = await _(n.html, M));
114
+ const Y = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
115
+ F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(Y, W(n.html)));
116
+ const Z = {
117
+ preselectedDynamicContentList: L,
113
118
  onReady: () => {
114
119
  console.debug("guido:ready"), r("ready");
115
120
  }
116
121
  };
117
- f = D(), await w(n, p(), X), u.selectedDynamicContentList = B;
122
+ await C(n, y(), Z), f.selectedDynamicContentList = L;
118
123
  } catch (e) {
119
124
  console.error("Failed to initialize Stripo editor:", e);
120
125
  }
121
126
  };
122
- return Z(async () => {
127
+ return te(async () => {
123
128
  var e;
124
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), de().$reset(), G().$reset(), Ee().$reset(), y();
125
- const t = (e = l.value) == null ? void 0 : e.parentElement;
126
- if (t && (a = new ResizeObserver(y), a.observe(t)), C(), i.ready)
127
- await g();
129
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), Ee().$reset(), v();
130
+ const t = (e = p.value) == null ? void 0 : e.parentElement;
131
+ if (t && (i = new ResizeObserver(v), i.observe(t)), D(), a.ready)
132
+ await S();
128
133
  else {
129
- const s = x(() => i.ready, (d) => {
130
- d && (s(), g());
134
+ const s = A(() => a.ready, (d) => {
135
+ d && (s(), S());
131
136
  });
132
137
  }
133
- document.addEventListener("dynamic-content:open", v);
134
- }), ee(() => {
135
- a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", v), k(async () => {
136
- if (T(f))
137
- try {
138
- window.UIEditor.removeEditor();
139
- } catch {
140
- console.debug("Failed to remove Stripo editor: No editor found");
141
- }
142
- }), o.reset();
143
- }), z({
138
+ document.addEventListener("dynamic-content:open", g);
139
+ }), oe(() => {
140
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
141
+ try {
142
+ window.UIEditor.removeEditor();
143
+ } catch {
144
+ console.debug("Failed to remove Stripo editor: No editor found");
145
+ }
146
+ o.reset();
147
+ }), G({
144
148
  dynamicContent: {
145
- insert: M,
149
+ insert: I,
146
150
  close: R
147
151
  },
148
- hasChanges: m,
149
- saveSilent: b,
150
- setLoading: E
151
- }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: C, runExclusive: k, beginMount: D, isCurrentMount: T, mountGeneration: f, getDefaultTemplate: F, cloneTimersOnSave: I, hasTimerBlocks: L, noHeader: J, insertDynamicContent: M, closeDynamicContent: R, handleDynamicContentOpen: v, ribbonObserver: a, updateRibbonOffset: y, startEditor: g, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: ye };
152
+ hasChanges: l,
153
+ saveSilent: E,
154
+ setLoading: w
155
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, RemoveStrategyModal: q, LegacyStrategyUpdatedModal: K, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: V, hasChanges: l, isTestPartner: j, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: J, isRrsEnabled: Q, hasAssignedStrategy: X, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ye, UnsubscribeWrapper: ge };
152
156
  }
153
157
  });
154
158
  export {
155
- Qe as default
159
+ Je as default
156
160
  };
@@ -0,0 +1,21 @@
1
+ import r from "./AssignStrategyDrawer.vue2.js";
2
+ /* empty css */
3
+ /* empty css */
4
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
+ var a = function() {
6
+ var e = this, s = e._self._c, t = e._self._setupProxy;
7
+ return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
8
+ return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading || t.store.legacyConversionLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
9
+ }, proxy: !0 }], null, !1, 239334473) }) : e._e();
10
+ }, n = [], i = /* @__PURE__ */ o(
11
+ r,
12
+ a,
13
+ n,
14
+ !1,
15
+ null,
16
+ "59777460"
17
+ );
18
+ const y = i.exports;
19
+ export {
20
+ y as default
21
+ };
@@ -0,0 +1,131 @@
1
+ import { defineComponent as h, defineAsyncComponent as T, ref as _, computed as o, watch as B } from "vue";
2
+ import "@useinsider/design-system-organisms/style";
3
+ import { useLegacyStrategyConversion as I } from "../../../../composables/useLegacyStrategyConversion.js";
4
+ import { useToaster as N } from "../../../../composables/useToaster.js";
5
+ import { useTranslations as k } from "../../../../composables/useTranslations.js";
6
+ import { DOTTED_DATE_LOCALE as P } from "../../../../enums/date.js";
7
+ import { URLS as U } from "../../../../enums/extensions/recommendationBlock.js";
8
+ import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
9
+ import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
10
+ import G from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as M } from "../../../../utils/dateUtil.js";
12
+ import { asText as D } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as x } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as R } from "@useinsider/design-system-vue";
15
+ const ot = /* @__PURE__ */ h({
16
+ __name: "AssignStrategyDrawer",
17
+ setup(H) {
18
+ const c = () => import("@useinsider/design-system-organisms"), g = (t, a) => ({
19
+ render: (n) => n(R, { props: { sizing: { width: t, height: a } } })
20
+ }), O = T({
21
+ loader: async () => (await c()).OrgStrategyDetailModal,
22
+ loadingComponent: g(480, 240),
23
+ delay: 0
24
+ }), w = T({
25
+ loader: async () => (await c()).OrgStrategyDropdown,
26
+ loadingComponent: g(240, 42),
27
+ delay: 0
28
+ }), r = k(), e = b(), { showToaster: i } = N(), { convertLegacyStrategy: u } = I(), s = _(null), y = "legacy", m = "guido__btn-update-legacy-strategy", l = _(!1), A = o(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: U.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
29
+ B(() => e.assignStrategyDrawerStatus, (t) => {
30
+ if (!t)
31
+ return;
32
+ const { strategyId: a } = e.recommendationConfigs;
33
+ s.value = a || (e.isLegacyStrategyBlock ? y : null), l.value = !1, e.fetchStrategies().catch(() => {
34
+ i({
35
+ type: p.Error,
36
+ message: r("discovery-strategy.error-description")
37
+ });
38
+ });
39
+ });
40
+ const f = (t) => {
41
+ const a = D(t.updated_at || t.created_at);
42
+ if (!a)
43
+ return "";
44
+ const n = M(a, P);
45
+ return r("recommendation-strategy.last-updated-on", { value: n });
46
+ }, S = o(() => ({
47
+ text: r("email-editor.legacy-strategy"),
48
+ value: y,
49
+ infoBoxProps: {
50
+ id: "strategy-info-legacy",
51
+ theme: "light",
52
+ variant: "information",
53
+ className: "assign-strategy-info-box",
54
+ titleText: x(r("email-editor.legacy-strategy")),
55
+ descriptionStatus: !0,
56
+ descriptionText: r("email-editor.legacy-strategy-description"),
57
+ buttonOptions: [{
58
+ id: m,
59
+ type: "primary",
60
+ text: r("email-editor.legacy-strategy-update"),
61
+ loadingStatus: e.legacyConversionLoading,
62
+ disabledStatus: e.legacyConversionLoading
63
+ }]
64
+ }
65
+ })), E = async (t) => {
66
+ if ((t == null ? void 0 : t.id) !== m)
67
+ return;
68
+ const a = await u();
69
+ a && (s.value = a);
70
+ }, d = o(() => e.strategies.map((t) => ({
71
+ text: t.name,
72
+ value: t.strategy_id,
73
+ infoBoxProps: {
74
+ id: `strategy-info-${t.strategy_id}`,
75
+ theme: "light",
76
+ variant: "information",
77
+ className: "assign-strategy-info-box",
78
+ titleText: x(D(t.name)),
79
+ descriptionStatus: !0,
80
+ descriptionText: f(t),
81
+ slot: G,
82
+ slotProps: { strategy: t }
83
+ }
84
+ }))), C = o(() => e.isLegacyStrategyBlock ? [S.value, ...d.value] : d.value), v = o(() => {
85
+ const t = e.strategies.find((a) => String(a.strategy_id) === String(s.value ?? ""));
86
+ return t ? { ...t, fallback_config: null } : null;
87
+ }), L = o(() => ({
88
+ primaryButton: {
89
+ styling: "solid",
90
+ type: "primary",
91
+ labelText: r("products.assign-btn")
92
+ },
93
+ cancelOrBackButton: {
94
+ styling: "ghost",
95
+ type: "secondary",
96
+ labelText: r("products.cancel")
97
+ }
98
+ }));
99
+ return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: O, OrgStrategyDropdown: w, trans: r, store: e, showToaster: i, convertLegacyStrategy: u, selectedStrategyId: s, LEGACY_OPTION_VALUE: y, LEGACY_UPDATE_BUTTON_ID: m, showSelectionError: l, drawerDescription: A, lastUpdatedText: f, legacyStrategyOption: S, onInfoBoxButtonClick: E, remoteStrategyOptions: d, strategyOptions: C, selectedStrategy: v, footerButtonGroupOptions: L, closeDrawer: () => {
100
+ e.closeAssignStrategyDrawer();
101
+ }, assignStrategy: async () => {
102
+ const t = v.value;
103
+ if (!t) {
104
+ l.value = !0;
105
+ return;
106
+ }
107
+ let a = "";
108
+ try {
109
+ a = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
110
+ } catch (n) {
111
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", n);
112
+ }
113
+ if (!a) {
114
+ i({
115
+ type: p.Error,
116
+ message: r("email-editor.strategy-assign-failed", { strategyName: t.name })
117
+ });
118
+ return;
119
+ }
120
+ e.assignStrategy(t), i({
121
+ type: p.Success,
122
+ message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
123
+ }), e.closeAssignStrategyDrawer();
124
+ }, onSelect: (t) => {
125
+ s.value = t.value, l.value = !1;
126
+ } };
127
+ }
128
+ });
129
+ export {
130
+ ot as default
131
+ };
@@ -0,0 +1,18 @@
1
+ import s from "./LegacyStrategyUpdatedModal.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, a = t._self._c, e = t._self._setupProxy;
6
+ return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.legacy-strategy-updated-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
7
+ }, l = [], _ = /* @__PURE__ */ o(
8
+ s,
9
+ r,
10
+ l,
11
+ !1,
12
+ null,
13
+ "13275a66"
14
+ );
15
+ const p = _.exports;
16
+ export {
17
+ p as default
18
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as i, computed as s } from "vue";
2
+ import p from "../../../wrappers/WpModal.vue.js";
3
+ import { useTranslations as d } from "../../../../composables/useTranslations.js";
4
+ import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ const M = /* @__PURE__ */ i({
6
+ __name: "LegacyStrategyUpdatedModal",
7
+ setup(l) {
8
+ const e = d(), t = g(), n = s(() => ({
9
+ primaryButton: {
10
+ type: "primary",
11
+ labelText: e("action-builder.ok")
12
+ }
13
+ })), m = s(() => {
14
+ var r;
15
+ const { strategyId: a } = t.recommendationConfigs;
16
+ return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
17
+ }), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
18
+ return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
19
+ t.closeLegacyStrategyUpdatedModal();
20
+ }, WpModal: p };
21
+ }
22
+ });
23
+ export {
24
+ M as default
25
+ };
@@ -0,0 +1,17 @@
1
+ import s from "./RemoveStrategyModal.vue2.js";
2
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var t = this, o = t._self._c, e = t._self._setupProxy;
5
+ return e.store.removeStrategyModalStatus ? o(e.WpModal, { attrs: { id: "guido__remove-strategy-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.remove-strategy-confirm-title") }, on: { close: e.close, "primary-action": e.handleConfirm, "secondary-action": e.close } }, [o("p", [t._v(t._s(e.messageParts[0])), o("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])]) : t._e();
6
+ }, n = [], _ = /* @__PURE__ */ r(
7
+ s,
8
+ a,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = _.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,57 @@
1
+ import { defineComponent as u, computed as n } from "vue";
2
+ import y from "../../../wrappers/WpModal.vue.js";
3
+ import { useToaster as f } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as v } from "../../../../enums/toaster.js";
6
+ import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { commitBlockChangeOutsidePanel as h } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
8
+ import { escapeHtml as R } from "../../../../utils/htmlEscape.js";
9
+ const P = /* @__PURE__ */ u({
10
+ __name: "RemoveStrategyModal",
11
+ setup(S) {
12
+ const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
13
+ cancelOrBackButton: {
14
+ type: "secondary",
15
+ labelText: t("products.cancel"),
16
+ styling: "ghost"
17
+ },
18
+ primaryButton: {
19
+ type: "danger",
20
+ labelText: t("discovery-strategy.remove")
21
+ }
22
+ })), m = n(() => {
23
+ var o;
24
+ const { strategyId: r } = e.recommendationConfigs;
25
+ return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
26
+ }), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
27
+ e.closeRemoveStrategyModal();
28
+ };
29
+ return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
30
+ const r = m.value, o = e.currentRecommendationId;
31
+ e.removeStrategy(), c();
32
+ const { strategyId: l, size: g } = e.recommendationConfigs;
33
+ if (a({
34
+ type: v.Success,
35
+ // The toast renders through a sanitizing v-html, so the name is escaped first.
36
+ message: t("email-editor.strategy-removed-success", {
37
+ strategyName: `<b>${R(r)}</b>`
38
+ })
39
+ }), o !== null) {
40
+ try {
41
+ await e.fetchRecommendationProducts();
42
+ } catch (p) {
43
+ console.error("[RemoveStrategyModal] product refetch failed", p);
44
+ }
45
+ h(
46
+ o,
47
+ { strategyId: l, size: g },
48
+ e.recommendationProducts,
49
+ "Removed recommendation strategy"
50
+ );
51
+ }
52
+ }, WpModal: y };
53
+ }
54
+ });
55
+ export {
56
+ P as default
57
+ };
@@ -0,0 +1,19 @@
1
+ import r from "./StrategyInfoBoxContent.vue2.js";
2
+ import _ from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var c = function() {
4
+ var t = this, s = t._self._c, n = t._self._setupProxy;
5
+ return s("div", { staticClass: "d-f f-d-c mt-3" }, t._l(n.details, function(e, a) {
6
+ return s("div", { key: e.title, staticClass: "d-f f-d-c", class: { "mt-2": a > 0 } }, [s("span", { staticClass: "f-s-1 f-w-600 l-h-1 t-c-52 mb-12" }, [t._v(t._s(e.title))]), s("span", { staticClass: "f-s-1 l-h-6 t-c-55 w-b-b-w" }, [t._v(t._s(e.value))])]);
7
+ }), 0);
8
+ }, f = [], l = /* @__PURE__ */ _(
9
+ r,
10
+ c,
11
+ f,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const p = l.exports;
17
+ export {
18
+ p as default
19
+ };