@useinsider/guido 1.0.3-beta.ce4cdcb → 1.0.3-beta.cedc8cb

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 (115) hide show
  1. package/dist/@types/generic.d.ts +13 -0
  2. package/dist/components/Guido.vue.d.ts +3 -2
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +99 -70
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
  7. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +2 -0
  9. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +2 -0
  12. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
  13. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
  14. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
  15. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
  16. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
  17. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
  18. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
  19. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
  20. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
  21. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
  22. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
  23. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
  24. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
  25. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
  26. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
  27. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
  28. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
  29. package/dist/components/wrappers/WpDrawer.vue.d.ts +6 -4
  30. package/dist/components/wrappers/WpDrawer.vue.js +6 -4
  31. package/dist/composables/useApiErrorTracking.d.ts +26 -0
  32. package/dist/composables/useApiErrorTracking.js +120 -0
  33. package/dist/composables/useErrorTracking.d.ts +30 -0
  34. package/dist/composables/useErrorTracking.js +98 -0
  35. package/dist/composables/useHttp.js +89 -52
  36. package/dist/composables/useStripo.js +160 -61
  37. package/dist/composables/useStripoErrorCategory.d.ts +26 -0
  38. package/dist/composables/useStripoErrorCategory.js +86 -0
  39. package/dist/composables/useStripoSlackNotifier.d.ts +8 -0
  40. package/dist/composables/useStripoSlackNotifier.js +47 -0
  41. package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
  42. package/dist/config/migrator/index.d.ts +1 -1
  43. package/dist/config/migrator/index.js +7 -6
  44. package/dist/config/migrator/unsubscribeMigrator.d.ts +1 -0
  45. package/dist/config/migrator/unsubscribeMigrator.js +124 -0
  46. package/dist/enums/defaults.js +6 -3
  47. package/dist/enums/extensions/recommendationBlock.d.ts +16 -0
  48. package/dist/enums/extensions/recommendationBlock.js +80 -0
  49. package/dist/enums/unsubscribe.d.ts +19 -0
  50. package/dist/enums/unsubscribe.js +39 -6
  51. package/dist/extensions/Blocks/Checkbox/control.js +35 -39
  52. package/dist/extensions/Blocks/RadioButton/control.js +33 -37
  53. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  54. package/dist/extensions/Blocks/Recommendation/block.d.ts +10 -0
  55. package/dist/extensions/Blocks/Recommendation/block.js +27 -0
  56. package/dist/extensions/Blocks/Recommendation/control.d.ts +29 -0
  57. package/dist/extensions/Blocks/Recommendation/control.js +277 -0
  58. package/dist/extensions/Blocks/Recommendation/extension.d.ts +2 -0
  59. package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
  60. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
  61. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
  62. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
  63. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +4 -0
  64. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
  65. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
  66. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
  67. package/dist/extensions/Blocks/Recommendation/template.d.ts +6 -0
  68. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  69. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
  70. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
  71. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
  72. package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
  73. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
  74. package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
  75. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
  76. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
  77. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +2 -0
  78. package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
  79. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
  80. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
  81. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
  82. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
  83. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
  84. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
  85. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
  86. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
  87. package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
  88. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
  89. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
  90. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
  91. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
  92. package/dist/extensions/Blocks/common-control.d.ts +66 -0
  93. package/dist/extensions/Blocks/common-control.js +102 -0
  94. package/dist/guido.css +1 -1
  95. package/dist/mock/api/recommendation.d.ts +2 -0
  96. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +83 -71
  97. package/dist/services/recommendationApi.d.ts +6 -0
  98. package/dist/services/recommendationApi.js +43 -0
  99. package/dist/services/slackNotificationService.d.ts +110 -0
  100. package/dist/services/slackNotificationService.js +167 -0
  101. package/dist/services/stripoApi.js +49 -19
  102. package/dist/services/stripoErrorDeduplicationService.d.ts +75 -0
  103. package/dist/services/stripoErrorDeduplicationService.js +91 -0
  104. package/dist/services/unsubscribeApi.d.ts +4 -0
  105. package/dist/services/unsubscribeApi.js +16 -0
  106. package/dist/stores/config.d.ts +96 -0
  107. package/dist/stores/config.js +17 -0
  108. package/dist/stores/editor.d.ts +21 -0
  109. package/dist/stores/editor.js +2 -1
  110. package/dist/stores/unsubscribe.d.ts +253 -5
  111. package/dist/stores/unsubscribe.js +126 -6
  112. package/dist/utils/genericUtil.d.ts +1 -0
  113. package/dist/utils/genericUtil.js +8 -7
  114. package/dist/utils/templatePreparation.js +17 -16
  115. package/package.json +2 -2
@@ -1,4 +1,7 @@
1
1
  import type { CompilerRule } from './html-compiler';
2
+ type Extensions = {
3
+ unsubscribe?: boolean;
4
+ };
2
5
  type Features = {
3
6
  dynamicContent?: boolean;
4
7
  saveAsTemplate?: boolean;
@@ -16,8 +19,14 @@ export type GuidoConfig = {
16
19
  useHeader?: boolean;
17
20
  emailHeader: EmailHeader;
18
21
  partner?: Partner;
22
+ extensions?: Extensions;
19
23
  features?: Features;
20
24
  };
25
+ export type TemplateConfig = {
26
+ preselectedDynamicContentList?: DynamicContent[];
27
+ selectedUnsubscribePages?: number[];
28
+ variationId?: string;
29
+ };
21
30
  export type DynamicContent = {
22
31
  value: string;
23
32
  text: string;
@@ -46,4 +55,8 @@ export type MergeTag = {
46
55
  label: string;
47
56
  value: string;
48
57
  };
58
+ export type TextValueObject = {
59
+ text: string;
60
+ value: string;
61
+ };
49
62
  export {};
@@ -1,4 +1,4 @@
1
- import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
1
+ import type { DynamicContent, GuidoConfig, TemplateConfig } from '@@/Types/generic';
2
2
  import type { SavedTemplateDetails } from '@@/Types/stripo';
3
3
  type __VLS_Props = {
4
4
  templateId: string;
@@ -9,8 +9,9 @@ type __VLS_Props = {
9
9
  username?: string;
10
10
  html?: string;
11
11
  css?: string;
12
- preselectedDynamicContentList: DynamicContent[];
13
12
  guidoConfig: GuidoConfig;
13
+ templateConfig?: TemplateConfig;
14
+ traceId?: string;
14
15
  };
15
16
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
16
17
  dynamicContent: {
@@ -3,16 +3,16 @@ import o from "./Guido.vue2.js";
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var a = this, r = a._self._c, e = a._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), 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.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper), r(e.LoadingWrapper)], 1);
6
+ return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), 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), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
7
7
  }, s = [], d = /* @__PURE__ */ i(
8
8
  o,
9
9
  t,
10
10
  s,
11
11
  !1,
12
12
  null,
13
- "aca05338"
13
+ "5a4aa0bc"
14
14
  );
15
- const v = d.exports;
15
+ const l = d.exports;
16
16
  export {
17
- v as default
17
+ l as default
18
18
  };
@@ -1,19 +1,23 @@
1
- import { defineComponent as H, defineAsyncComponent as E, ref as R, computed as G, watch as U, onMounted as x, onUnmounted as F } from "vue";
2
- import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
3
- import { usePartner as z } from "../composables/usePartner.js";
4
- import { useStripo as B } from "../composables/useStripo.js";
5
- import { migrate as P } from "../config/migrator/index.js";
6
- import { DefaultUsername as K, DefaultMessageType as O, DefaultGuidoConfig as j } from "../enums/defaults.js";
7
- import q from "./organisms/base/Toaster.vue.js";
8
- import J from "./organisms/header/HeaderWrapper.vue.js";
9
- import Q from "./organisms/LoadingWrapper.vue.js";
10
- import V from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
11
- import { useStripoApi as X } from "../services/stripoApi.js";
12
- import { useDynamicContentStore as Y } from "../stores/dynamic-content.js";
13
- import { useEditorStore as Z } from "../stores/editor.js";
14
- import { usePreviewStore as $ } from "../stores/preview.js";
15
- import ee from "../node_modules/lodash-es/merge.js";
16
- const ye = /* @__PURE__ */ H({
1
+ import { defineComponent as M, defineAsyncComponent as G, ref as R, computed as U, watch as z, onMounted as B, onUnmounted as K } from "vue";
2
+ import { provideGuidoActions as O } from "../composables/useGuidoActions.js";
3
+ import { usePartner as j } from "../composables/usePartner.js";
4
+ import { useStripo as q } from "../composables/useStripo.js";
5
+ import { migrate as W } from "../config/migrator/index.js";
6
+ import { DefaultMessageType as J, DefaultUsername as Q, DefaultGuidoConfig as V } from "../enums/defaults.js";
7
+ import X from "./organisms/base/Toaster.vue.js";
8
+ import Y from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
9
+ import Z from "./organisms/header/HeaderWrapper.vue.js";
10
+ import $ from "./organisms/LoadingWrapper.vue.js";
11
+ import ee from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
12
+ import oe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
13
+ import { useStripoApi as te } from "../services/stripoApi.js";
14
+ import { useConfigStore as ne } from "../stores/config.js";
15
+ import { useDynamicContentStore as re } from "../stores/dynamic-content.js";
16
+ import { useEditorStore as ie } from "../stores/editor.js";
17
+ import { usePreviewStore as se } from "../stores/preview.js";
18
+ import { useUnsubscribeStore as ae } from "../stores/unsubscribe.js";
19
+ import ce from "../node_modules/lodash-es/merge.js";
20
+ const Pe = /* @__PURE__ */ M({
17
21
  __name: "Guido",
18
22
  props: {
19
23
  templateId: null,
@@ -24,84 +28,109 @@ const ye = /* @__PURE__ */ H({
24
28
  username: null,
25
29
  html: null,
26
30
  css: null,
27
- preselectedDynamicContentList: null,
28
- guidoConfig: null
31
+ guidoConfig: null,
32
+ templateConfig: null,
33
+ traceId: null
29
34
  },
30
35
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready"],
31
- setup(I, { expose: L, emit: o }) {
32
- const r = I, _ = E(
36
+ setup(F, { expose: L, emit: t }) {
37
+ const p = F, k = G(
33
38
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
34
- ), W = E(
39
+ ), x = G(
35
40
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
36
- ), d = R(), a = Y(), m = Z(), k = $(), t = G(() => m.hasChanges), i = r.preselectedDynamicContentList || [], { getPartnerName: l, getProductType: u, isTestPartner: A } = z(), p = () => {
41
+ ), g = R(), c = re(), f = ae(), y = ne(), d = ie(), A = se(), i = U(() => d.hasChanges), { getPartnerName: w, getProductType: v, isTestPartner: N } = j(), S = () => {
37
42
  var e;
38
- return (e = d.value) == null ? void 0 : e.handleSave(!0);
43
+ return (e = g.value) == null ? void 0 : e.handleSave(!0);
39
44
  }, {
40
- templateId: g,
41
- userId: f,
42
- guidoConfig: y,
43
- html: n = "",
44
- css: v = "",
45
- partnerName: s = l(),
46
- productType: c = u(),
47
- messageType: C = O,
48
- username: h = K
49
- } = r;
50
- window.GuidoConfig = ee(j, y), window.GuidoConfig.partner = {
51
- partnerName: s,
52
- productType: c,
53
- messageType: C
54
- };
55
- const { initPlugin: w } = B({
56
- emailId: g,
57
- userId: f,
58
- username: h,
59
- partnerName: s,
60
- productType: c,
61
- preselectedDynamicContentList: i,
45
+ templateId: n,
46
+ userId: s,
47
+ guidoConfig: C,
48
+ templateConfig: o,
49
+ html: a = "",
50
+ css: b = "",
51
+ partnerName: m = w(),
52
+ productType: u = v(),
53
+ messageType: h = J,
54
+ username: D = Q,
55
+ traceId: r
56
+ } = p, l = (o == null ? void 0 : o.preselectedDynamicContentList) || [];
57
+ d.templateId = n, window.GuidoConfig = ce(V, C), window.GuidoConfig.partner = {
58
+ partnerName: m,
59
+ productType: u,
60
+ messageType: h
61
+ }, r && (window.GuidoConfig.traceId = r), y.templateConfig = o;
62
+ const { initPlugin: I } = q({
63
+ emailId: n,
64
+ userId: s,
65
+ username: D,
66
+ partnerName: m,
67
+ productType: u,
68
+ preselectedDynamicContentList: l,
62
69
  onReady: () => {
63
- console.debug("guido:ready"), o("ready");
70
+ console.debug("guido:ready"), t("ready");
64
71
  }
65
- }), { getDefaultTemplate: S } = X(), N = G(() => {
72
+ }), { getDefaultTemplate: _ } = te(), H = U(() => {
66
73
  var e;
67
74
  return !((e = window.GuidoConfig) != null && e.useHeader);
68
75
  });
69
- M({
76
+ O({
70
77
  onBack: () => {
71
- console.debug("guido:back"), o("back");
78
+ console.debug("guido:back"), t("back");
72
79
  },
73
80
  onSaveStart: () => {
74
- console.debug("guido:save:start"), o("save:start");
81
+ console.debug("guido:save:start"), t("save:start");
75
82
  },
76
83
  onSaveComplete: (e) => {
77
- console.debug("guido:save:complete", e), o("save:complete", e);
84
+ console.debug("guido:save:complete", e), t("save:complete", e);
78
85
  }
79
86
  });
80
- const b = (e) => {
81
- console.debug("dynamic-content:close", e), a.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
82
- }, D = () => {
87
+ const E = (e) => {
88
+ console.debug("dynamic-content:close", e), c.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
89
+ }, T = () => {
83
90
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
84
91
  };
85
- return U(() => t.value, () => {
86
- o("on-change", t.value);
87
- }), x(async () => {
92
+ return z(() => i.value, () => {
93
+ t("on-change", i.value);
94
+ }), B(async () => {
88
95
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
89
96
  try {
97
+ f.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
90
98
  let e = {
91
- html: n && P(n),
92
- css: v,
99
+ html: a && await W(a),
100
+ css: b,
93
101
  forceRecreate: !0
94
102
  // TODO: It should be false for old templates. We will communicate with Stripo
95
103
  };
96
- e.html || (e = await S(), e.html = P(e.html)), await w(e), a.selectedDynamicContentList = i;
104
+ e.html || (e = await _(), e.html = await W(e.html)), await I(e), c.selectedDynamicContentList = l;
97
105
  } catch (e) {
98
- console.error("Failed to initialize Stripo editor:", e);
106
+ console.error("Failed to initialize Stripo editor:", e), window.Sentry && window.Sentry.captureException(e, {
107
+ tags: {
108
+ component: "guido-component",
109
+ operation: "mount"
110
+ },
111
+ contexts: {
112
+ guido: {
113
+ templateId: n,
114
+ userId: s,
115
+ traceId: r
116
+ }
117
+ }
118
+ }), window.FS && window.FS("event", "guido_mount_error", {
119
+ // eslint-disable-next-line camelcase
120
+ errorMessage_str: e instanceof Error ? e.message : String(e),
121
+ // eslint-disable-next-line camelcase
122
+ templateId_str: n,
123
+ // eslint-disable-next-line camelcase
124
+ userId_str: s,
125
+ // eslint-disable-next-line camelcase
126
+ traceId_str: r || ""
127
+ });
99
128
  }
100
129
  document.addEventListener("dynamic-content:open", (e) => {
101
- const T = e;
102
- console.debug("dynamic-content:open", T.detail), o("dynamic-content:open", T.detail);
130
+ const P = e;
131
+ console.debug("dynamic-content:open", P.detail), t("dynamic-content:open", P.detail);
103
132
  });
104
- }), F(() => {
133
+ }), K(() => {
105
134
  try {
106
135
  window.UIEditor.removeEditor();
107
136
  } catch {
@@ -109,14 +138,14 @@ const ye = /* @__PURE__ */ H({
109
138
  }
110
139
  }), L({
111
140
  dynamicContent: {
112
- insert: b,
113
- close: D
141
+ insert: E,
142
+ close: T
114
143
  },
115
- hasChanges: t,
116
- saveSilent: p
117
- }), { __sfc: !0, PreviewContainer: _, OnboardingWrapper: W, headerWrapperRef: d, dynamicContentStore: a, props: r, editorStore: m, previewStore: k, hasChanges: t, preselectedDynamicContentList: i, getPartnerName: l, getProductType: u, isTestPartner: A, saveSilent: p, templateId: g, userId: f, guidoConfig: y, html: n, css: v, partnerName: s, productType: c, messageType: C, username: h, emit: o, initPlugin: w, getDefaultTemplate: S, noHeader: N, insertDynamicContent: b, closeDynamicContent: D, Toaster: q, HeaderWrapper: J, LoadingWrapper: Q, SaveAsTemplateDrawer: V };
144
+ hasChanges: i,
145
+ saveSilent: S
146
+ }), { __sfc: !0, PreviewContainer: k, OnboardingWrapper: x, headerWrapperRef: g, dynamicContentStore: c, unsubscribeStore: f, props: p, configStore: y, editorStore: d, previewStore: A, hasChanges: i, getPartnerName: w, getProductType: v, isTestPartner: N, saveSilent: S, templateId: n, userId: s, guidoConfig: C, templateConfig: o, html: a, css: b, partnerName: m, productType: u, messageType: h, username: D, traceId: r, preselectedDynamicContentList: l, emit: t, initPlugin: I, getDefaultTemplate: _, noHeader: H, insertDynamicContent: E, closeDynamicContent: T, Toaster: X, FilterSelectionDrawer: Y, HeaderWrapper: Z, LoadingWrapper: $, SaveAsTemplateDrawer: ee, UnsubscribeWrapper: oe };
118
147
  }
119
148
  });
120
149
  export {
121
- ye as default
150
+ Pe as default
122
151
  };
@@ -0,0 +1,19 @@
1
+ import type { Filter } from '@@/Types/recommendation';
2
+ type __VLS_Props = {
3
+ filter: Filter;
4
+ index: number;
5
+ hasLogicAdapter?: boolean;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
8
+ "delete-filter": (filter: Filter) => void;
9
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToOption<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
@@ -0,0 +1,28 @@
1
+ import r from "./FilterItem.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var a = this, e = a._self._c, t = a._self._setupProxy;
6
+ return e("div", { staticClass: "d-f f-d-c w-1 gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
7
+ return t.emit("delete-filter", t.props.filter);
8
+ } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, value: [t.selectedAttributeType] }, on: { select: function(s) {
9
+ return t.updateFilter({ text: "attribute", value: s.value });
10
+ } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), value: [t.selectedOperatorType] }, on: { select: function(s) {
11
+ return t.updateFilter({ text: "operator", value: s.value });
12
+ } } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", type: "text", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "tooltip-status": !1, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
13
+ t.updateFilter({ text: "value", value: encodeURIComponent(s) });
14
+ } } })], 1), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
15
+ return t.updateFilter({ text: "innerGroupOperator", value: s });
16
+ } } })], 1) : a._e()]);
17
+ }, n = [], o = /* @__PURE__ */ i(
18
+ r,
19
+ l,
20
+ n,
21
+ !1,
22
+ null,
23
+ "6562e38c"
24
+ );
25
+ const f = o.exports;
26
+ export {
27
+ f as default
28
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent as f, computed as i } from "vue";
2
+ import { useTranslations as v } from "../../../../composables/useTranslations.js";
3
+ import { getOperatorOptions as a } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { useRecommendationExtensionStore as x } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { InButtonV2 as y, InSelect as F, InBasicTextInput as T } from "@useinsider/design-system-vue";
6
+ import _ from "./LogicAdapter.vue.js";
7
+ import { useDebounceFn as b } from "../../../../node_modules/@vueuse/shared/index.js";
8
+ const h = /* @__PURE__ */ f({
9
+ __name: "FilterItem",
10
+ props: {
11
+ filter: null,
12
+ index: null,
13
+ hasLogicAdapter: { type: Boolean }
14
+ },
15
+ emits: ["delete-filter"],
16
+ setup(p, { emit: u }) {
17
+ const e = p, n = v(), r = x(), m = [
18
+ {
19
+ text: n("email-editor.standard-filter"),
20
+ value: "standardFilter"
21
+ }
22
+ ], s = i(() => e.filter.attribute || ""), l = i(() => r.getFilterList.find((t) => t.value === s.value) || { text: "", value: "", type: "" }), c = i(() => {
23
+ var t;
24
+ return a((t = l.value) == null ? void 0 : t.type).find((o) => o.value === e.filter.operator);
25
+ }), d = b((t) => {
26
+ console.debug("updateFilter: ", t);
27
+ const o = {
28
+ ...e.filter,
29
+ [t.text]: t.value
30
+ };
31
+ r.updateFilter(o);
32
+ }, 500);
33
+ return { __sfc: !0, trans: n, store: r, props: e, filterTypeOptions: m, attributeType: s, selectedAttributeType: l, selectedOperatorType: c, emit: u, updateFilter: d, getOperatorOptions: a, InBasicTextInput: T, InSelect: F, InButtonV2: y, LogicAdapter: _ };
34
+ }
35
+ });
36
+ export {
37
+ h as default
38
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import o from "./FilterSelectionDrawer.vue2.js";
2
+ import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var l = function() {
4
+ var e = this, r = e._self._c, t = e._self._setupProxy;
5
+ return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "title-text": "Filter Selection", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.filterSelectionDrawerStatus }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.applyFilter } }, [r(t.Filters)], 1);
6
+ }, s = [], a = /* @__PURE__ */ n(
7
+ o,
8
+ l,
9
+ s,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const p = a.exports;
15
+ export {
16
+ p as default
17
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as n, ref as a, computed as l } from "vue";
2
+ import i from "../../../wrappers/WpDrawer.vue.js";
3
+ import { useTranslations as p } from "../../../../composables/useTranslations.js";
4
+ import { useRecommendationExtensionStore as c } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import u from "./Filters.vue.js";
6
+ const b = /* @__PURE__ */ n({
7
+ __name: "FilterSelectionDrawer",
8
+ setup(m) {
9
+ const t = p(), o = c(), e = a(!1), s = l(() => ({
10
+ primaryButton: {
11
+ styling: "solid",
12
+ type: "primary",
13
+ labelText: t(
14
+ e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
15
+ ),
16
+ loadingStatus: e.value,
17
+ disabledStatus: !1
18
+ },
19
+ cancelOrBackButton: {
20
+ styling: "ghost",
21
+ type: "secondary",
22
+ labelText: t("products.cancel"),
23
+ disabledStatus: e.value
24
+ }
25
+ })), r = () => {
26
+ o.filterSelectionDrawerStatus = !1;
27
+ };
28
+ return { __sfc: !0, trans: t, store: o, isApplying: e, footerButtonGroupOptions: s, closeModal: r, applyFilter: () => {
29
+ e.value = !0, setTimeout(() => {
30
+ console.debug("Filter applied!"), r(), o.generateFilterQuery();
31
+ }, 2e3);
32
+ }, WpDrawer: i, Filters: u };
33
+ }
34
+ });
35
+ export {
36
+ b as default
37
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import s from "./Filters.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var i = this, e = i._self._c, t = i._self._setupProxy;
6
+ return e("div", { staticClass: "d-f f-d-c gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e(t.InSegments, { staticClass: "f-g-1 w-1", attrs: { id: "guido__filter-group-segments", "segment-list": t.filterGroupList, selected: t.selectedFilterGroup, "with-icon": !1 }, on: { click: t.changeFilterGroup } }), e(t.InButtonV2, { staticClass: "w-20-s f-g-1", attrs: { id: "guido__add-filter-group-button", "left-icon": "line-plus-netural", type: "secondary", "disabled-status": t.isMaxFilterGroupCount, "label-text": t.trans("smart-recommender.add-filter-group"), "tooltip-text": t.isMaxFilterGroupCount ? t.trans("email-editor.add-filter-tooltip") : "" }, on: { click: t.handleAddFilterGroup } })], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e("div", { staticClass: "d-f a-i-c" }, [t.selectedFilterGroup > 1 ? e(t.LogicAdapter, { staticClass: "mr-2" }) : i._e(), e("p", [i._v(" " + i._s(t.trans("email-editor.filter-group")) + " " + i._s(t.selectedFilterGroup) + " ")])], 1), t.hasRemoveFilterButton ? e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: t.handleDeleteFilterGroup } }) : i._e()], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b f-d-c" }, i._l(t.selectedFilterGroupFilters, function(l, r) {
7
+ return e(t.FilterItem, { key: r, attrs: { filter: l, "has-logic-adapter": t.hasLogicAdapter && r !== t.selectedFilterGroupFilters.length - 1, index: r }, on: { "delete-filter": t.handleDeleteFilter } });
8
+ }), 1), e("div", { staticClass: "d-f a-i-c j-c-c mt-3" }, [e(t.InButtonV2, { staticClass: "w-11-s", attrs: { id: "filter-group--add-filter-button", "left-icon": "line-plus-netural", type: "subtle-primary", "label-text": t.trans("smart-recommender.add-filter-condition") }, on: { click: t.handleAddFilter } })], 1)]);
9
+ }, d = [], n = /* @__PURE__ */ a(
10
+ s,
11
+ o,
12
+ d,
13
+ !1,
14
+ null,
15
+ "1ccb6d4a"
16
+ );
17
+ const _ = n.exports;
18
+ export {
19
+ _ as default
20
+ };
@@ -0,0 +1,44 @@
1
+ import { defineComponent as m, computed as o, ref as h } from "vue";
2
+ import { useTranslations as G } from "../../../../composables/useTranslations.js";
3
+ import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { InButtonV2 as v, InSegments as f } from "@useinsider/design-system-vue";
5
+ import _ from "./FilterItem.vue.js";
6
+ import A from "./LogicAdapter.vue.js";
7
+ const E = /* @__PURE__ */ m({
8
+ __name: "Filters",
9
+ setup(R) {
10
+ const i = G(), l = g(), u = o(() => l.getFilterGroupCount), t = o(() => Array.from({ length: u.value }, (e, a) => ({
11
+ text: (a + 1).toString(),
12
+ value: a + 1
13
+ }))), r = h(1), s = (e) => {
14
+ r.value = e;
15
+ }, d = () => {
16
+ const e = t.value.length + 1;
17
+ console.debug("handleAddFilterGroup", e), t.value.push({
18
+ text: e.toString(),
19
+ value: e
20
+ }), l.addFilterGroup(e);
21
+ }, p = o(() => t.value.length >= 3), n = o(() => l.getSelectedFilterGroup(r.value)), c = o(() => n.value.length > 1), F = o(() => t.value.length > 1);
22
+ return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, trans: i, store: l, filterGroupCount: u, filterGroupList: t, selectedFilterGroup: r, changeFilterGroup: s, handleAddFilterGroup: d, isMaxFilterGroupCount: p, selectedFilterGroupFilters: n, hasLogicAdapter: c, hasRemoveFilterButton: F, handleAddFilter: () => {
23
+ l.addFilter({
24
+ type: "standardFilter",
25
+ attribute: "",
26
+ operatorReplace: "",
27
+ operator: "",
28
+ innerGroupOperator: "*",
29
+ outerGroupOperator: "*",
30
+ filterNumber: n.value.length + 1,
31
+ filterGroup: r.value,
32
+ isValid: !1,
33
+ value: ""
34
+ }), console.debug("handleAddFilter");
35
+ }, handleDeleteFilter: (e) => {
36
+ console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
37
+ }, handleDeleteFilterGroup: () => {
38
+ t.value.length !== 1 && (console.debug("handleDeleteFilterGroup"), t.value.splice(r.value - 1, 1), r.value > 1 && r.value--);
39
+ }, InSegments: f, InButtonV2: v, FilterItem: _, LogicAdapter: A };
40
+ }
41
+ });
42
+ export {
43
+ E as default
44
+ };
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ logic?: string;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
5
+ change: (value: string) => void;
6
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
7
+ export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -0,0 +1,17 @@
1
+ import s from "./LogicAdapter.vue2.js";
2
+ import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var o = function() {
4
+ var t = this, r = t._self._c, e = t._self._setupProxy;
5
+ return r(e.InSegments, { staticClass: "guido__logic-adapter f-g-1", attrs: { "segment-list": e.logicAdapterList, selected: e.selectedLogicAdapter, "with-icon": !1 }, on: { click: e.changeLogicAdapter } });
6
+ }, a = [], c = /* @__PURE__ */ n(
7
+ s,
8
+ o,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const p = c.exports;
15
+ export {
16
+ p as default
17
+ };
@@ -0,0 +1,27 @@
1
+ import { defineComponent as s, ref as n } from "vue";
2
+ import { InSegments as p } from "@useinsider/design-system-vue";
3
+ const l = /* @__PURE__ */ s({
4
+ __name: "LogicAdapter",
5
+ props: {
6
+ logic: null
7
+ },
8
+ emits: ["change"],
9
+ setup(r, { emit: e }) {
10
+ const t = r, a = n([
11
+ {
12
+ text: "and",
13
+ value: "*"
14
+ },
15
+ {
16
+ text: "or",
17
+ value: "|"
18
+ }
19
+ ]), o = n(t.logic || "*");
20
+ return { __sfc: !0, logicAdapterList: a, emit: e, props: t, selectedLogicAdapter: o, changeLogicAdapter: (c) => {
21
+ o.value = c, e("change", c);
22
+ }, InSegments: p };
23
+ }
24
+ });
25
+ export {
26
+ l as default
27
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import s from "./UnsubscribeBreadcrumb.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var e = this, t = e._self._c, r = e._self._setupProxy;
6
+ return t(r.InBreadcrumb, { staticClass: "c-p", attrs: { "without-router": "", "active-tab": r.unsubscribeStore.activeType, "home-icon": !1, list: r.breadcrumbs, routes: [] }, on: { click: r.navigate } });
7
+ }, c = [], n = /* @__PURE__ */ a(
8
+ s,
9
+ o,
10
+ c,
11
+ !1,
12
+ null,
13
+ "70835920"
14
+ );
15
+ const f = n.exports;
16
+ export {
17
+ f as default
18
+ };
@@ -0,0 +1,16 @@
1
+ import { defineComponent as o, computed as n } from "vue";
2
+ import { TYPE_TRANSLATIONS as s } from "../../../enums/unsubscribe.js";
3
+ import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
4
+ import { InBreadcrumb as m } from "@useinsider/design-system-vue";
5
+ const f = /* @__PURE__ */ o({
6
+ __name: "UnsubscribeBreadcrumb",
7
+ setup(a) {
8
+ const r = c(), t = n(() => r.getSelectedCollection.map((e) => ({ value: e, text: s[e] })));
9
+ return { __sfc: !0, unsubscribeStore: r, breadcrumbs: t, navigate: (e) => {
10
+ r.activeType = e.value;
11
+ }, InBreadcrumb: m };
12
+ }
13
+ });
14
+ export {
15
+ f as default
16
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;