@useinsider/guido 3.3.0-beta.a7a5213 → 3.3.0-beta.c1c552a

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 (26) hide show
  1. package/dist/composables/useCustomInterfaceAppearance.js +16 -18
  2. package/dist/composables/useHtmlValidator.js +36 -41
  3. package/dist/composables/useRecommendation.js +2 -2
  4. package/dist/composables/useStripo.js +49 -47
  5. package/dist/composables/useStripoNotifications.js +28 -0
  6. package/dist/enums/extensions/recommendationBlock.js +41 -95
  7. package/dist/enums/toaster.js +1 -1
  8. package/dist/enums/unsubscribe.js +24 -25
  9. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  10. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  11. package/dist/extensions/Blocks/Recommendation/block.js +36 -43
  12. package/dist/extensions/Blocks/Recommendation/services/configService.js +26 -33
  13. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -35
  14. package/dist/package.json.js +1 -1
  15. package/dist/src/composables/useStripoNotifications.d.ts +4 -0
  16. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
  17. package/dist/src/enums/toaster.d.ts +2 -1
  18. package/dist/src/enums/unsubscribe.d.ts +3 -8
  19. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +3 -11
  20. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -7
  21. package/dist/src/stores/toaster.d.ts +2 -1
  22. package/dist/stores/toaster.js +10 -9
  23. package/package.json +2 -2
  24. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +0 -33
  25. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -21
  26. package/dist/static/styles/components/notification.css.js +0 -74
@@ -4,21 +4,20 @@ import e from "../static/styles/components/amp-block.css.js";
4
4
  import i from "../static/styles/components/base-input.css.js";
5
5
  import p from "../static/styles/components/button-group.css.js";
6
6
  import n from "../static/styles/components/button.css.js";
7
- import C from "../static/styles/components/combobox.css.js";
8
- import s from "../static/styles/components/counter.css.js";
7
+ import s from "../static/styles/components/combobox.css.js";
8
+ import C from "../static/styles/components/counter.css.js";
9
9
  import f from "../static/styles/components/dropdown-menu.css.js";
10
10
  import a from "../static/styles/components/loader.css.js";
11
11
  import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/notification.css.js";
13
- import d from "../static/styles/components/popup.css.js";
14
- import l from "../static/styles/components/switcher.css.js";
15
- import h from "../static/styles/components/tabs.css.js";
16
- import w from "../static/styles/components/tools.css.js";
17
- import y from "../static/styles/components/version-history.css.js";
18
- import B from "../static/styles/components/wide-panel.css.js";
19
- import b from "../static/styles/variables.css.js";
20
- const A = [
21
- b,
12
+ import c from "../static/styles/components/popup.css.js";
13
+ import d from "../static/styles/components/switcher.css.js";
14
+ import l from "../static/styles/components/tabs.css.js";
15
+ import h from "../static/styles/components/tools.css.js";
16
+ import w from "../static/styles/components/version-history.css.js";
17
+ import y from "../static/styles/components/wide-panel.css.js";
18
+ import B from "../static/styles/variables.css.js";
19
+ const b = [
20
+ B,
22
21
  // Must be on top
23
22
  S,
24
23
  // Must be on top
@@ -27,8 +26,8 @@ const A = [
27
26
  i,
28
27
  p,
29
28
  n,
30
- C,
31
29
  s,
30
+ C,
32
31
  f,
33
32
  a,
34
33
  u,
@@ -37,13 +36,12 @@ const A = [
37
36
  l,
38
37
  h,
39
38
  w,
40
- y,
41
- B
39
+ y
42
40
  ].join(`
43
41
 
44
- `), F = () => ({ importCss: () => {
42
+ `), v = () => ({ importCss: () => {
45
43
  const o = new CSSStyleSheet();
46
- o.replaceSync(A);
44
+ o.replaceSync(b);
47
45
  const r = document.querySelector("ui-editor");
48
46
  if (!r)
49
47
  return;
@@ -51,5 +49,5 @@ const A = [
51
49
  t && (t.adoptedStyleSheets = [o]);
52
50
  } });
53
51
  export {
54
- F as useCustomInterfaceAppearance
52
+ v as useCustomInterfaceAppearance
55
53
  };
@@ -1,37 +1,35 @@
1
- import { useConfig as _ } from "./useConfig.js";
2
- import { TemplateTypes as H } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
1
+ import { useConfig as L } from "./useConfig.js";
2
+ import { TemplateTypes as V } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as _, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as G } from "../enums/html-validator.js";
4
4
  import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
- import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
8
- import { useRecommendationStore as K } from "../stores/recommendation.js";
9
- import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
10
- import { useHttp as U } from "./useHttp.js";
11
- import { useToaster as Y } from "./useToaster.js";
12
- import { useTranslations as Z } from "./useTranslations.js";
13
- const J = /recommendation-id="(\d+)"/g;
14
- function Q(a) {
15
- return [...a.matchAll(J)].map((u) => u[1]);
5
+ import { itemsBlockDynamicVariables as M } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
+ import { base64EncodeWithSpecialChars as X } from "../utils/base64.js";
8
+ import { useHttp as j } from "./useHttp.js";
9
+ import { useToaster as q } from "./useToaster.js";
10
+ import { useTranslations as z } from "./useTranslations.js";
11
+ const K = /recommendation-id="(\d+)"/g;
12
+ function U(a) {
13
+ return [...a.matchAll(K)].map((u) => u[1]);
16
14
  }
17
- function ee(a, u) {
15
+ function Y(a, u) {
18
16
  return u.some((d) => a.startsWith(`${d}_`));
19
17
  }
20
- const ge = () => {
18
+ const ce = () => {
21
19
  var y, h;
22
- const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
20
+ const { showToaster: a } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, b = async (e) => {
23
21
  const t = await u(
24
22
  "/newsletter/template-library/check-template-html-body",
25
- { html: z(e) }
23
+ { html: X(e) }
26
24
  ), { status: n, message: l } = t.data;
27
25
  return n || a({
28
26
  type: c.Alert,
29
27
  message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
30
- }), r(M), l === r($) && a({
28
+ }), r(P), l === r(G) && a({
31
29
  type: c.Alert,
32
30
  message: r("newsletter.already-in-progress")
33
31
  }), n;
34
- }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
32
+ }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
35
33
  const t = e.match(/({%(.*?)%})/g);
36
34
  let n = !0;
37
35
  return t !== null && !p && t.forEach((l) => {
@@ -44,13 +42,13 @@ const ge = () => {
44
42
  }), n = !1);
45
43
  }
46
44
  }), n;
47
- }, k = async (e, s, t) => {
45
+ }, A = async (e, s, t) => {
48
46
  const n = t ? await b(e) : !0;
49
- return A(e, s) && n;
50
- }, x = (e) => e.length > 0 ? !0 : (a({
47
+ return E(e, s) && n;
48
+ }, I = (e) => e.length > 0 ? !0 : (a({
51
49
  type: c.Warning,
52
50
  message: r("newsletter.html-content-is-empty")
53
- }), !1), I = (e) => {
51
+ }), !1), k = (e) => {
54
52
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
55
53
  return s > t && a({
56
54
  type: c.Warning,
@@ -59,7 +57,7 @@ const ge = () => {
59
57
  type: c.Warning,
60
58
  message: r("custom-fields.missing-opening-braces")
61
59
  }), s === t;
62
- }, F = (e) => {
60
+ }, x = (e) => {
63
61
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
64
62
  return s || a({
65
63
  type: c.Warning,
@@ -68,10 +66,10 @@ const ge = () => {
68
66
  }, T = (e, s) => {
69
67
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
70
68
  if (t && !p) {
71
- const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
69
+ const n = new Set(s.map((i) => i.toLowerCase())), l = U(e), o = [];
72
70
  if (t.forEach((i) => {
73
71
  const m = i.slice(2, -2).trim().toLowerCase();
74
- (!n.has(m) || m === "") && !ee(m, l) && o.push(m);
72
+ (!n.has(m) || m === "") && !Y(m, l) && o.push(m);
75
73
  }), o.length > 0) {
76
74
  const i = `
77
75
  <ul>
@@ -85,11 +83,11 @@ const ge = () => {
85
83
  }
86
84
  }
87
85
  return !0;
88
- }, R = (e) => {
86
+ }, F = (e) => {
89
87
  const s = e.match(/{%(.*?)%}/g), t = [];
90
88
  let n = !0;
91
89
  if (s && s.forEach((l) => {
92
- const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
90
+ const o = l.match(_), i = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
93
91
  (!o || l !== m) && !i && (a({
94
92
  type: c.Alert,
95
93
  message: r("newsletter.display-conditions-invalid-syntax")
@@ -100,7 +98,7 @@ const ge = () => {
100
98
  }), n = !1);
101
99
  const v = f.match(/^[a-zA-Z]*$/g);
102
100
  v && v.forEach((C) => {
103
- E(C) && t.push(C);
101
+ S(C) && t.push(C);
104
102
  });
105
103
  });
106
104
  }), t.length) {
@@ -111,28 +109,25 @@ const ge = () => {
111
109
  }), n = !1);
112
110
  }
113
111
  return n;
114
- }, B = (e) => {
112
+ }, W = (e) => {
115
113
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
116
114
  return n || a({
117
115
  type: c.Warning,
118
116
  message: r("custom-conditions.no-space-after-braces")
119
117
  }), n;
120
- }, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
118
+ }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
121
119
  type: c.Warning,
122
120
  message: r("custom-conditions.no-braces-inside-if-tag")
123
- }), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
124
- type: c.Alert,
125
- message: r(j)
126
121
  }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
127
122
  type: c.Alert,
128
123
  message: r("newsletter.fill-all-necessary-fields")
129
- }), !1) : !0, D = (e) => {
124
+ }), !1) : !0, B = (e) => {
130
125
  const s = /src="[^"]*\.(svg|pst)"/gm;
131
126
  return e.match(s) === null ? !0 : (a({
132
127
  type: c.Alert,
133
128
  message: r("newsletter.invalid-image-type")
134
129
  }), !1);
135
- }, L = (e) => {
130
+ }, R = (e) => {
136
131
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
137
132
  return Array.from(n).find((o) => {
138
133
  var i;
@@ -141,7 +136,7 @@ const ge = () => {
141
136
  type: c.Alert,
142
137
  message: r("unsubscribe-templates.select-checkbox-groups")
143
138
  }), !1) : !0;
144
- }, V = (e) => {
139
+ }, D = (e) => {
145
140
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
146
141
  return Array.from(n).find((o) => {
147
142
  var i;
@@ -155,12 +150,12 @@ const ge = () => {
155
150
  var o, i;
156
151
  const n = [
157
152
  ...s.map((m) => m.value),
158
- ...q,
153
+ ...M,
159
154
  ...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
160
155
  ];
161
- return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
156
+ return await A(e, n, t) && I(e) && k(e) && x(e) && T(e, n) && F(e) && W(e) && N(e) && O() && B(e) && R(e) && D(e);
162
157
  } };
163
158
  };
164
159
  export {
165
- ge as useHtmlValidator
160
+ ce as useHtmlValidator
166
161
  };
@@ -1,4 +1,4 @@
1
- import { getRecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
1
+ import { RecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
2
2
  import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
3
3
  import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
4
  import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
@@ -63,7 +63,7 @@ const w = () => ({
63
63
  shuffleProducts: o.shuffleProducts
64
64
  };
65
65
  }
66
- const f = ((l = I().find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
66
+ const f = ((l = I.find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
67
67
  if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising") {
68
68
  const i = parseInt(e.size) || 6;
69
69
  t.set("productId", e.productIds.slice(0, i).join(","));
@@ -1,27 +1,28 @@
1
- import { useActionsApi as D } from "./useActionsApi.js";
2
- import { useBlocksConfig as I } from "./useBlocksConfig.js";
3
- import { useConfig as P } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
- import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
- import { useToaster as x } from "./useToaster.js";
8
- import { localePatch as H } from "../config/i18n/index.js";
9
- import { useStripoApi as O } from "../services/stripoApi.js";
10
- import j from "../static/styles/customEditorStyle.css.js";
1
+ import { useActionsApi as U } from "./useActionsApi.js";
2
+ import { useBlocksConfig as R } from "./useBlocksConfig.js";
3
+ import { useConfig as q } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as x } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as H } from "./useFullStoryBridge.js";
6
+ import { useStripoEventHandler as N } from "./useStripoEventHandler.js";
7
+ import { useStripoNotifications as O } from "./useStripoNotifications.js";
8
+ import { useToaster as j } from "./useToaster.js";
9
+ import { localePatch as L } from "../config/i18n/index.js";
10
+ import { useStripoApi as $ } from "../services/stripoApi.js";
11
+ import z from "../static/styles/customEditorStyle.css.js";
11
12
  import { useEditorStore as E } from "../stores/editor.js";
12
- import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
13
- import $ from "../package.json.js";
14
- const se = (C, l) => {
15
- const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: B } = q(), { getStripoBlocksConfig: T } = I(), V = async (i, r = [], s = !1) => {
13
+ import { dynamicContentToMergeTags as G } from "../utils/genericUtil.js";
14
+ import J from "../package.json.js";
15
+ const ct = (C, c) => {
16
+ const { features: l, template: h, isFeatureEnabled: u } = q(), { handleError: m } = j(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = $(), { handleEvent: B } = N(), { getStripoNotifications: T } = O(), { getStripoBlocksConfig: V } = R(), _ = async (i, s = [], r = !1) => {
16
17
  var g, S, y;
17
- const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await T(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, F = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
18
+ const t = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(), f = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, v = ((S = l.value) == null ? void 0 : S.modulesDisabled) ?? !1, M = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1, A = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com", D = T();
18
19
  window.UIEditor.initEditor(
19
20
  document.querySelector("#guido-editor"),
20
21
  {
21
22
  metadata: C,
22
23
  html: p,
23
24
  css: a,
24
- forceRecreate: v,
25
+ forceRecreate: M,
25
26
  locale: "en",
26
27
  undoButtonSelector: "#guido__undo-button",
27
28
  redoButtonSelector: "#guido__redo-button",
@@ -31,96 +32,97 @@ const se = (C, l) => {
31
32
  customAppearanceMergetags: !u("liquidSyntax"),
32
33
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
34
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
- customViewStyles: j,
35
+ customViewStyles: z,
35
36
  conditionsEnabled: f,
36
37
  customConditionsEnabled: f,
37
38
  enableXSSSecurity: !0,
38
- modulesDisabled: F,
39
- syncModulesEnabled: s,
39
+ modulesDisabled: v,
40
+ syncModulesEnabled: r,
40
41
  messageSettingsEnabled: !0,
41
42
  displayGmailAnnotations: !0,
42
43
  displayHiddenPreheader: !1,
43
44
  displayTitle: !1,
44
45
  displayUTM: !1,
45
46
  selectElementAfterDrop: !0,
46
- allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
47
+ allowedScriptSourceDomains: A,
47
48
  ...o ? { baseBlocks: o } : {},
48
49
  editorFonts: {
49
50
  showDefaultStandardFonts: !0,
50
51
  showDefaultNotStandardFonts: !0,
51
- customFonts: r
52
+ customFonts: s
52
53
  },
53
54
  mergeTags: [
54
55
  {
55
- entries: L(
56
- l.preselectedDynamicContentList,
56
+ entries: G(
57
+ c.preselectedDynamicContentList,
57
58
  u("liquidSyntax")
58
59
  )
59
60
  }
60
61
  ],
61
- async onTokenRefreshRequest(t) {
62
+ async onTokenRefreshRequest(e) {
62
63
  try {
63
64
  const n = await w();
64
- t(n);
65
+ e(n);
65
66
  } catch (n) {
66
67
  m(n, "Failed to refresh token");
67
68
  }
68
69
  },
69
70
  onTemplateLoaded() {
70
71
  try {
71
- const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
72
- t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
73
- e.hasChanges = !1;
72
+ const { importCss: e } = x(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: I } = U(), { injectFullStory: P } = H();
73
+ e(), n(), P(), I(), c.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
74
+ t.hasChanges = !1;
74
75
  }, 1e3);
75
- } catch (t) {
76
- m(t, "Failed to load custom interface appearance");
76
+ } catch (e) {
77
+ m(e, "Failed to load custom interface appearance");
77
78
  }
78
79
  },
79
- onCodeEditorVisibilityChanged(t) {
80
- e.isCodeEditorOpen = t;
80
+ onCodeEditorVisibilityChanged(e) {
81
+ t.isCodeEditorOpen = e;
81
82
  },
82
- onEditorVisualModeChanged(t) {
83
- e.editorVisualMode = t.toLowerCase();
83
+ onEditorVisualModeChanged(e) {
84
+ t.editorVisualMode = e.toLowerCase();
84
85
  },
85
- onVersionHistoryVisibilityChanged(t) {
86
- e.isVersionHistoryOpen = t;
86
+ onVersionHistoryVisibilityChanged(e) {
87
+ t.isVersionHistoryOpen = e;
87
88
  },
88
89
  onDataChanged() {
89
- e.hasChanges = !0;
90
+ t.hasChanges = !0;
90
91
  },
91
92
  onEvent: B,
93
+ notifications: D,
92
94
  ignoreClickOutsideSelectors: [
93
95
  "#guido-dynamic-content-modal",
94
96
  ".in-on-board-wrapper",
95
97
  ".in-drawer__container"
96
98
  ],
97
99
  extensions: d,
98
- localePatch: H
100
+ localePatch: L
99
101
  }
100
102
  );
101
- }, _ = (i) => new Promise((r, s) => {
103
+ }, F = (i) => new Promise((s, r) => {
102
104
  var d;
103
105
  if (document.getElementById("UiEditorScript")) {
104
- i(), r();
106
+ i(), s();
105
107
  return;
106
108
  }
107
- const e = $.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
109
+ const t = J.guido, a = `https://email-static.useinsider.com/guido/${(d = t == null ? void 0 : t.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
108
110
  o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
109
- i(), r();
111
+ i(), s();
110
112
  }, o.onerror = () => {
111
- s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
113
+ r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
112
114
  }, document.body.appendChild(o);
113
115
  });
114
116
  return { initPlugin: async (i) => {
115
- await _(async () => {
116
- const r = E(), [s, e] = await Promise.all([
117
+ await F(async () => {
118
+ const s = E(), [r, t] = await Promise.all([
117
119
  b(),
118
120
  k()
119
121
  ]);
120
- r.syncModulesEnabled = e, await V(i, s, e);
122
+ s.syncModulesEnabled = t, await _(i, r, t);
121
123
  });
122
124
  } };
123
125
  };
124
126
  export {
125
- se as useStripo
127
+ ct as useStripo
126
128
  };
@@ -0,0 +1,28 @@
1
+ import { useToaster as d } from "./useToaster.js";
2
+ import { ToasterTypeOptions as c } from "../enums/toaster.js";
3
+ const p = () => {
4
+ const { showToaster: s, hideToaster: u } = d();
5
+ let r = null, l = null;
6
+ const n = (t, o, i, e, f = {}) => {
7
+ if (r === i && l === o)
8
+ return;
9
+ r = i, l = o;
10
+ const a = e != null && e.action ? { text: e.action.label, onClick: e.action.func } : void 0;
11
+ s({ type: t, message: o, actionButton: a, autoHide: f.autoHide });
12
+ };
13
+ return { getStripoNotifications: () => ({
14
+ info: (t, o, i) => n(c.Info, t, o, i),
15
+ success: (t, o, i) => n(c.Success, t, o, i),
16
+ warn: (t, o, i) => n(c.Warning, t, o, i),
17
+ error: (t, o, i) => n(c.Alert, t, o, i),
18
+ // Loader represents an in-progress operation; Stripo dismisses it via hide(id)
19
+ // when the operation finishes, so we disable auto-hide for this variant.
20
+ loader: (t, o, i) => n(c.Info, t, o, i, { autoHide: !1 }),
21
+ hide: (t) => {
22
+ r === t && (u(), r = null, l = null);
23
+ }
24
+ }) };
25
+ };
26
+ export {
27
+ p as useStripoNotifications
28
+ };
@@ -1,98 +1,44 @@
1
- import { useTranslations as a } from "../../composables/useTranslations.js";
2
- const u = {
1
+ const s = {
3
2
  RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
4
- }, l = {
3
+ }, i = {
5
4
  CLIENT_ID: "clientId"
6
- }, c = () => {
7
- const e = a();
8
- return [
9
- {
10
- id: 11,
11
- key: "similarViewed",
12
- name: e("action-builder.similar-viewed"),
13
- path: "viewed-together"
14
- },
15
- {
16
- id: 12,
17
- key: "similarBought",
18
- name: e("action-builder.similar-bought"),
19
- path: "purchased-together"
20
- },
21
- {
22
- id: 13,
23
- key: "userBased",
24
- name: e("action-builder.user-based"),
25
- path: "user-based"
26
- },
27
- {
28
- id: 36,
29
- key: "highestDiscounted",
30
- name: e("journey-builder.highest-discounted-items"),
31
- path: "highest-discounted"
32
- },
33
- {
34
- id: 38,
35
- key: "manualMerchandising",
36
- name: e("action-builder.manual-merchandising"),
37
- path: "manual-merchandising"
38
- },
39
- {
40
- id: 39,
41
- key: "newArrivals",
42
- name: e("action-builder.new-arrivals"),
43
- path: "new-arrivals"
44
- },
45
- {
46
- id: 40,
47
- key: "trendingProducts",
48
- name: e("journey-builder.trending-products"),
49
- path: "trending"
50
- },
51
- {
52
- id: 46,
53
- key: "mostValuableOfPartner",
54
- name: e("journey-builder.most-valuable-products"),
55
- path: "most-valuable"
56
- },
57
- {
58
- id: 61,
59
- key: "mostPopular",
60
- name: e("journey-builder.most-popular-items"),
61
- path: "most-popular"
62
- },
63
- {
64
- id: 62,
65
- key: "mostPurchased",
66
- name: e("action-builder.most-purchased"),
67
- path: "top-sellers"
68
- }
69
- ];
70
- }, d = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], m = [
5
+ }, u = [
6
+ { id: 11, key: "similarViewed", name: "Viewed Together", path: "viewed-together" },
7
+ { id: 12, key: "similarBought", name: "Purchased Together", path: "purchased-together" },
8
+ { id: 13, key: "userBased", name: "User Based", path: "user-based" },
9
+ { id: 36, key: "highestDiscounted", name: "Highest Discounted Items", path: "highest-discounted" },
10
+ { id: 38, key: "manualMerchandising", name: "Manual Merchandising", path: "manual-merchandising" },
11
+ { id: 39, key: "newArrivals", name: "New Arrivals", path: "new-arrivals" },
12
+ { id: 40, key: "trendingProducts", name: "Trending Products", path: "trending" },
13
+ { id: 46, key: "mostValuableOfPartner", name: "Most Valuable Products", path: "most-valuable" },
14
+ { id: 61, key: "mostPopular", name: "Most Popular Items", path: "most-popular" },
15
+ { id: 62, key: "mostPurchased", name: "Top Sellers", path: "top-sellers" }
16
+ ], l = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], c = [
71
17
  { text: "before the amount", value: "0" },
72
18
  { text: "after the amount", value: "1" }
73
- ], p = [
19
+ ], d = [
74
20
  { text: "dot(.)", value: "." },
75
21
  { text: "comma(,)", value: "," },
76
22
  { text: "space( )", value: " " }
77
- ], v = [
23
+ ], p = [
78
24
  { text: "0", value: "0" },
79
25
  { text: "1", value: "1" },
80
26
  { text: "2", value: "2" },
81
27
  { text: "3", value: "3" },
82
28
  { text: "4", value: "4" },
83
29
  { text: "5", value: "5" }
84
- ], t = [
30
+ ], e = [
85
31
  { text: "is exactly", value: "=" },
86
32
  { text: "contains", value: "~" },
87
33
  { text: "does not contain", value: "!~" },
88
34
  { text: "any of", value: "||" }
89
- ], r = [
35
+ ], a = [
90
36
  { text: "is exactly", value: "=" },
91
37
  { text: "is not exactly", value: "!==" },
92
38
  { text: "contains", value: "~" },
93
39
  { text: "does not contain", value: "!~" },
94
40
  { text: "any of", value: "||" }
95
- ], n = [
41
+ ], r = [
96
42
  { text: "is equal to", value: "=" },
97
43
  { text: "is greater than", value: ">" },
98
44
  { text: "is less than", value: "<" }
@@ -100,39 +46,39 @@ const u = {
100
46
  { text: "is equal to", value: "=" },
101
47
  { text: "after", value: ">" },
102
48
  { text: "before", value: "<" }
103
- ], s = [
49
+ ], n = [
104
50
  { text: "true", value: "==" },
105
51
  { text: "false", value: "!=" }
106
- ], h = (e) => {
107
- if (!e)
108
- return t;
109
- switch (e) {
52
+ ], m = (t) => {
53
+ if (!t)
54
+ return e;
55
+ switch (t) {
110
56
  case "Boolean":
111
- return s;
57
+ return n;
112
58
  case "Date":
113
59
  return o;
114
60
  case "Number":
115
- return n;
61
+ return r;
116
62
  case "String":
117
- return t;
63
+ return e;
118
64
  case "Strings":
119
- return r;
65
+ return a;
120
66
  default:
121
- return t;
67
+ return e;
122
68
  }
123
69
  };
124
70
  export {
125
- d as PriceAttributes,
126
- l as QUERY_PARAMS,
127
- u as URLS,
128
- v as currencyDecimalCounts,
129
- m as currencyLocationMaps,
130
- p as currencyOperators,
131
- h as getOperatorOptions,
132
- c as getRecommendationFeedSourceMaps,
133
- r as operatorOptionsForArrayOfStrings,
134
- s as operatorOptionsForBooleans,
71
+ l as PriceAttributes,
72
+ i as QUERY_PARAMS,
73
+ u as RecommendationFeedSourceMaps,
74
+ s as URLS,
75
+ p as currencyDecimalCounts,
76
+ c as currencyLocationMaps,
77
+ d as currencyOperators,
78
+ m as getOperatorOptions,
79
+ a as operatorOptionsForArrayOfStrings,
80
+ n as operatorOptionsForBooleans,
135
81
  o as operatorOptionsForDates,
136
- n as operatorOptionsForNumbers,
137
- t as operatorOptionsForStrings
82
+ r as operatorOptionsForNumbers,
83
+ e as operatorOptionsForStrings
138
84
  };
@@ -1,4 +1,4 @@
1
- var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r))(c || {});
1
+ var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Info = "info", r))(c || {});
2
2
  export {
3
3
  c as ToasterTypeOptions
4
4
  };