@useinsider/guido 3.20.1 → 3.21.0-beta.0df5409

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 (90) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +65 -64
  3. package/dist/components/organisms/AutoSaveController.vue2.js +10 -9
  4. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  5. package/dist/components/organisms/header/EditorActions.vue2.js +53 -51
  6. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
  7. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +23 -22
  8. package/dist/composables/useActionsApi.js +80 -63
  9. package/dist/composables/useAutoSave.js +46 -44
  10. package/dist/composables/useGuidoStateBridge.js +3 -3
  11. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  12. package/dist/composables/useSave.js +26 -23
  13. package/dist/composables/useSaveValidation.js +113 -114
  14. package/dist/composables/useSaveValidationRollout.js +17 -6
  15. package/dist/composables/useStripo.js +11 -10
  16. package/dist/extensions/Blocks/Items/block.js +43 -42
  17. package/dist/extensions/Blocks/Recommendation/block.js +33 -29
  18. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +78 -83
  19. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +1 -2
  20. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +2 -12
  21. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +104 -86
  22. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +348 -263
  23. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -50
  24. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +16 -21
  25. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +44 -40
  26. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +14 -19
  27. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +104 -102
  28. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +18 -23
  29. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +312 -286
  30. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +24 -20
  31. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -7
  32. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +8 -8
  33. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +113 -151
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +221 -203
  35. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +28 -0
  36. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
  37. package/dist/extensions/Blocks/Recommendation/utils/currencySettings.js +25 -0
  38. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +111 -40
  39. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
  40. package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
  41. package/dist/guido.css +1 -1
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
  43. package/dist/package.json.js +1 -1
  44. package/dist/services/settingsApi.js +11 -0
  45. package/dist/src/components/Guido.vue.d.ts +1 -1
  46. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  47. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  48. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  49. package/dist/src/composables/useActionsApi.d.ts +5 -1
  50. package/dist/src/composables/useAutoSave.d.ts +4 -1
  51. package/dist/src/composables/useSaveValidationRollout.d.ts +1 -0
  52. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
  53. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
  54. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
  55. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
  56. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -6
  60. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
  61. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
  62. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +5 -5
  63. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +21 -12
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +6 -3
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +6 -5
  66. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -3
  67. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +21 -9
  68. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +19 -13
  69. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
  70. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
  71. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
  72. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
  73. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
  74. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +10 -8
  75. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +9 -5
  76. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
  77. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +9 -1
  78. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
  79. package/dist/src/extensions/Blocks/Recommendation/utils/currencySettings.d.ts +6 -0
  80. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +18 -11
  81. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
  82. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
  83. package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
  84. package/dist/src/services/settingsApi.d.ts +6 -0
  85. package/dist/src/stores/editor.d.ts +3 -1
  86. package/dist/src/stores/setup-settings.d.ts +4 -0
  87. package/dist/static/styles/components/button.css.js +5 -0
  88. package/dist/stores/editor.js +5 -0
  89. package/dist/stores/setup-settings.js +10 -0
  90. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  var k = Object.defineProperty;
2
- var S = (d, l, e) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[l] = e;
3
- var g = (d, l, e) => S(d, typeof l != "symbol" ? l + "" : l, e);
2
+ var S = (d, l, t) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[l] = t;
3
+ var g = (d, l, t) => S(d, typeof l != "symbol" ? l + "" : l, t);
4
4
  import { BlockId as D } from "../../../enums/block.js";
5
5
  import { useOnboardingStore as T } from "../../../stores/onboarding.js";
6
6
  import { getMigrationBannerHtml as N } from "../../../utils/migrationBannerHtml.js";
@@ -58,15 +58,15 @@ class $ extends H {
58
58
  canBeSavedAsModule() {
59
59
  return !0;
60
60
  }
61
- onCreated(e) {
62
- const t = this.api.getDocumentModifier(), c = this.api.getDocumentRootCssNode();
63
- c.querySelector('[product-attr="imageSrc"] img') || t.modifyCss(c).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
64
- const r = _(e);
61
+ onCreated(t) {
62
+ const e = this.api.getDocumentModifier(), c = this.api.getDocumentRootCssNode();
63
+ c.querySelector('[product-attr="imageSrc"] img') || e.modifyCss(c).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
64
+ const r = _(t);
65
65
  if (!r)
66
66
  return;
67
- const o = r.getNodeConfig(), s = o && Object.keys(o).length > 0, i = C(e);
67
+ const o = r.getNodeConfig(), n = o && Object.keys(o).length > 0, i = C(t);
68
68
  if (i != null && i.initialized) {
69
- if (!s) {
69
+ if (!n) {
70
70
  const a = this.api.getDocumentModifier();
71
71
  a.modifyHtml(r).setNodeConfig(i), this._stampProductTdDomAttributes(r, i, a), this._healCollapsedWidths(r, a), this._shouldReconcileCurrency(i) && this._reconcileCurrencyDomAttributes(r, i, a), a.apply(new u("Migrate legacy config to nodeConfig")), this._markCurrencyHealed(i.blockInstanceId);
72
72
  return;
@@ -76,9 +76,9 @@ class $ extends H {
76
76
  I.modifyHtml(r).setNodeConfig(a), this._stampProductTdDomAttributes(r, a, I, !0), I.apply(new u("Initialize Items block with default configuration")), T().startOnboarding("itemsOnboarding");
77
77
  return;
78
78
  }
79
- const n = this._resolveInstanceId(i.blockInstanceId), f = this.api.getDocumentModifier();
79
+ const s = this._resolveInstanceId(i.blockInstanceId), f = this.api.getDocumentModifier();
80
80
  let h = !1;
81
- n !== i.blockInstanceId && (f.modifyHtml(r).setNodeConfig({ ...i, blockInstanceId: n }), h = !0), !this._currencyHealed.has(n) && this._reconcileCurrencyDomAttributes(r, i, f) && (h = !0), this._healCollapsedWidths(r, f) && (h = !0), h && f.apply(new u("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(n);
81
+ s !== i.blockInstanceId && (f.modifyHtml(r).setNodeConfig({ ...i, blockInstanceId: s }), h = !0), !this._currencyHealed.has(s) && this._reconcileCurrencyDomAttributes(r, i, f) && (h = !0), this._healCollapsedWidths(r, f) && (h = !0), h && f.apply(new u("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(s);
82
82
  }
83
83
  /**
84
84
  * Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
@@ -86,24 +86,24 @@ class $ extends H {
86
86
  * into nodeConfig, so without this a reused module would reset to defaults.
87
87
  * Guarded to the nodeConfig-empty case so it runs once and never loops.
88
88
  */
89
- onDocumentChanged(e) {
90
- const t = _(e);
91
- if (!t)
89
+ onDocumentChanged(t) {
90
+ const e = _(t);
91
+ if (!e)
92
92
  return;
93
- const c = t.getNodeConfig();
93
+ const c = e.getNodeConfig();
94
94
  if (c && Object.keys(c).length > 0) {
95
- const i = C(e);
95
+ const i = C(t);
96
96
  if (i != null && i.initialized && this._shouldReconcileCurrency(i)) {
97
- const n = this.api.getDocumentModifier();
98
- this._reconcileCurrencyDomAttributes(t, i, n) && n.apply(new u(V)), this._markCurrencyHealed(i.blockInstanceId);
97
+ const s = this.api.getDocumentModifier();
98
+ this._reconcileCurrencyDomAttributes(e, i, s) && s.apply(new u(V)), this._markCurrencyHealed(i.blockInstanceId);
99
99
  }
100
100
  return;
101
101
  }
102
- const o = C(e);
102
+ const o = C(t);
103
103
  if (!(o != null && o.initialized))
104
104
  return;
105
- const s = this.api.getDocumentModifier();
106
- s.modifyHtml(t).setNodeConfig(o), this._stampProductTdDomAttributes(t, o, s), this._healCollapsedWidths(t, s), this._shouldReconcileCurrency(o) && this._reconcileCurrencyDomAttributes(t, o, s), s.apply(new u("Recover Items block config from saved module")), this._markCurrencyHealed(o.blockInstanceId);
105
+ const n = this.api.getDocumentModifier();
106
+ n.modifyHtml(e).setNodeConfig(o), this._stampProductTdDomAttributes(e, o, n), this._healCollapsedWidths(e, n), this._shouldReconcileCurrency(o) && this._reconcileCurrencyDomAttributes(e, o, n), n.apply(new u("Recover Items block config from saved module")), this._markCurrencyHealed(o.blockInstanceId);
107
107
  }
108
108
  /**
109
109
  * Bakes the compiler-read DOM attributes (`data-type`, `data-number`, `data-nodup`) onto the
@@ -113,20 +113,21 @@ class $ extends H {
113
113
  * restored before export. The name `<a>` carries no data-type/data-number of its own and
114
114
  * relies on this td-level fallback in pairProductVariables.
115
115
  */
116
- _stampProductTdDomAttributes(e, t, c, r = !1) {
117
- const o = B(t.itemsSelectValue, t.type), s = (i, n) => {
118
- r && e.getAttribute(i) || c.modifyHtml(e).setAttribute(i, n);
116
+ _stampProductTdDomAttributes(t, e, c, r = !1) {
117
+ const o = B(e.itemsSelectValue, e.type), n = (i, s) => {
118
+ r && t.getAttribute(i) || c.modifyHtml(t).setAttribute(i, s);
119
119
  };
120
- s("data-type", t.type), s("data-number", o), s("data-nodup", String(t.priceHideDiscount));
120
+ n("data-type", e.type), n("data-number", o), n("data-nodup", String(e.priceHideDiscount));
121
121
  }
122
122
  /**
123
123
  * Repairs a saved module's collapsed card into the state the load migrator produces. Acts only
124
124
  * on a zero width, so Stripo's non-zero drop-time width never triggers it and a healed block no-ops.
125
125
  */
126
- _healCollapsedWidths(e, t) {
127
- const r = e.querySelectorAll(M).filter((o) => m(o.getAttribute("width")) || m(o.getStyle("width")));
128
- return !m(e.getAttribute("width")) && !r.length ? !1 : (e.hasClass("esd-container-frame") && t.modifyHtml(e).removeClass("esd-container-frame"), e.getAttribute("width") !== null && t.modifyHtml(e).removeAttribute("width"), r.forEach((o) => {
129
- m(o.getAttribute("width")) && t.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && t.modifyHtml(o).setStyle("width", "100%");
126
+ _healCollapsedWidths(t, e) {
127
+ const r = t.querySelectorAll(M).filter((o) => m(o.getAttribute("width")) || m(o.getStyle("width")));
128
+ return !m(t.getAttribute("width")) && !r.length ? !1 : (t.hasClass("esd-container-frame") && e.modifyHtml(t).removeClass("esd-container-frame"), t.getAttribute("width") !== null && e.modifyHtml(t).removeAttribute("width"), r.forEach((o) => {
129
+ const n = o.getAttribute("width");
130
+ (n === null || m(n)) && e.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && e.modifyHtml(o).setStyle("width", "100%");
130
131
  }), !0);
131
132
  }
132
133
  /**
@@ -137,12 +138,12 @@ class $ extends H {
137
138
  * the symbol write alone is skipped for the 'USD' sentinel — so we must NOT gate the whole pass
138
139
  * on symbol customization here, or a default-symbol block with a toggled location never heals.
139
140
  */
140
- _shouldReconcileCurrency(e) {
141
- return !e.blockInstanceId || !this._currencyHealed.has(e.blockInstanceId);
141
+ _shouldReconcileCurrency(t) {
142
+ return !t.blockInstanceId || !this._currencyHealed.has(t.blockInstanceId);
142
143
  }
143
144
  /** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
144
- _markCurrencyHealed(e) {
145
- e && this._currencyHealed.add(e);
145
+ _markCurrencyHealed(t) {
146
+ t && this._currencyHealed.add(t);
146
147
  }
147
148
  /**
148
149
  * Resolves the id for a just-created block to one that is unique per live instance.
@@ -151,13 +152,13 @@ class $ extends H {
151
152
  * currency heal guard and settings-panel switch detection. Mint a fresh id on absence
152
153
  * or collision, otherwise keep the existing one. Registers the result as claimed.
153
154
  */
154
- _resolveInstanceId(e) {
155
- let t = e;
156
- if (!t || this._seenInstanceIds.has(t))
155
+ _resolveInstanceId(t) {
156
+ let e = t;
157
+ if (!e || this._seenInstanceIds.has(e))
157
158
  do
158
- t = P();
159
- while (this._seenInstanceIds.has(t));
160
- return this._seenInstanceIds.add(t), t;
159
+ e = P();
160
+ while (this._seenInstanceIds.has(e));
161
+ return this._seenInstanceIds.add(e), e;
161
162
  }
162
163
  /**
163
164
  * Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
@@ -170,11 +171,11 @@ class $ extends H {
170
171
  * Returns true only when an attr actually changed, so the caller can skip an empty apply that
171
172
  * would otherwise re-trigger onDocumentChanged and loop.
172
173
  */
173
- _reconcileCurrencyDomAttributes(e, t, c) {
174
- const { position: r, symbol: o } = w(t), s = e.querySelectorAll(`.${E.PRICE} p`);
174
+ _reconcileCurrencyDomAttributes(t, e, c) {
175
+ const { position: r, symbol: o } = w(e), n = t.querySelectorAll(`.${E.PRICE} p`);
175
176
  let i = !1;
176
- return s.forEach((n) => {
177
- r !== void 0 && n.getAttribute(y.POSITION) !== r && (c.modifyHtml(n).setAttribute(y.POSITION, r), i = !0), o !== void 0 && n.getAttribute(y.SYMBOL) !== o && (c.modifyHtml(n).setAttribute(y.SYMBOL, o), i = !0);
177
+ return n.forEach((s) => {
178
+ r !== void 0 && s.getAttribute(y.POSITION) !== r && (c.modifyHtml(s).setAttribute(y.POSITION, r), i = !0), o !== void 0 && s.getAttribute(y.SYMBOL) !== o && (c.modifyHtml(s).setAttribute(y.SYMBOL, o), i = !0);
178
179
  }), i;
179
180
  }
180
181
  }
@@ -1,23 +1,23 @@
1
- var B = Object.defineProperty;
2
- var b = (a, l, t) => l in a ? B(a, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[l] = t;
3
- var d = (a, l, t) => b(a, typeof l != "symbol" ? l + "" : l, t);
1
+ var b = Object.defineProperty;
2
+ var C = (a, l, t) => l in a ? b(a, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[l] = t;
3
+ var d = (a, l, t) => C(a, typeof l != "symbol" ? l + "" : l, t);
4
4
  import { useConfig as g } from "../../../composables/useConfig.js";
5
- import { BlockId as C } from "../../../enums/block.js";
6
- import { getMigrationBannerHtml as A } from "../../../utils/migrationBannerHtml.js";
7
- import { Block as E, BlockCompositionType as S, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { CURRENT_CONFIG_VERSION as N, PRE_RRS_CONFIG_VERSION as w } from "./constants/defaultConfig.js";
5
+ import { BlockId as A } from "../../../enums/block.js";
6
+ import { getMigrationBannerHtml as E } from "../../../utils/migrationBannerHtml.js";
7
+ import { Block as S, BlockCompositionType as N, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
+ import { CURRENT_CONFIG_VERSION as w, PRE_RRS_CONFIG_VERSION as M } from "./constants/defaultConfig.js";
9
9
  import { RECOMMENDATION_ID_ATTR as m } from "./constants/selectors.js";
10
- import { regenerateMobileProductRows as M } from "./controls/main/utils.js";
11
- import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
10
+ import { regenerateMobileProductRows as O } from "./controls/main/utils.js";
11
+ import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as x } from "./controls/mobileLayout/cssRules.js";
12
12
  import { RecommendationConfigService as s } from "./services/configService.js";
13
13
  import { useRecommendationExtensionStore as h } from "./store/recommendation.js";
14
- import { getDefaultTemplate as x } from "./templates/grid/template.js";
15
- import { useRecommendationBlockWarning as T } from "./useRecommendationBlockWarning.js";
16
- import { registerNodeConfigWriter as H } from "./utils/nodeConfigWriter.js";
14
+ import { getDefaultTemplate as T } from "./templates/grid/template.js";
15
+ import { useRecommendationBlockWarning as H } from "./useRecommendationBlockWarning.js";
16
+ import { registerNodeConfigWriter as k } from "./utils/nodeConfigWriter.js";
17
17
  import { refreshDuplicatedStrategyBlocks as $ } from "./utils/strategyCommit.js";
18
- const k = C.Recommendation, u = "recommendation-block-v2", D = "hide-price";
19
- let y = !1;
20
- class Y extends E {
18
+ const D = A.Recommendation, u = "recommendation-block-v2", y = "hide-price";
19
+ let B = !1;
20
+ class Y extends S {
21
21
  constructor() {
22
22
  super();
23
23
  /**
@@ -31,13 +31,13 @@ class Y extends E {
31
31
  d(this, "_unsettledDuplicateIds", /* @__PURE__ */ new Set());
32
32
  }
33
33
  getId() {
34
- return k;
34
+ return D;
35
35
  }
36
36
  getIcon() {
37
37
  return "recommendation-icon";
38
38
  }
39
39
  getBlockCompositionType() {
40
- return S.CONTAINER;
40
+ return N.CONTAINER;
41
41
  }
42
42
  getName() {
43
43
  return this.api.translate("Recommendation Block");
@@ -48,8 +48,8 @@ class Y extends E {
48
48
  );
49
49
  }
50
50
  getSettingsPanelTitleHtml() {
51
- return A(
52
- k,
51
+ return E(
52
+ D,
53
53
  this.api.translate("Recommendation Block"),
54
54
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
55
55
  );
@@ -72,7 +72,11 @@ class Y extends E {
72
72
  */
73
73
  getTemplate() {
74
74
  const t = this._generateNextId();
75
- return this._pendingBlockId = t, x(t);
75
+ return this._pendingBlockId = t, T(t);
76
+ }
77
+ // A restore can redraw blocks before any settings panel registered a document handle this session.
78
+ onDocumentInit() {
79
+ k(this.api);
76
80
  }
77
81
  /**
78
82
  * Called when a new block is dropped into the template
@@ -100,7 +104,7 @@ class Y extends E {
100
104
  t,
101
105
  {
102
106
  recommendationId: i,
103
- configVersion: n ? N : w,
107
+ configVersion: n ? w : M,
104
108
  ...o ? { partnerName: g().partnerName.value } : {},
105
109
  // An RRS block picks a strategy, not an algorithm, and its algorithm control is
106
110
  // hidden. Keeping the `mostPopular` default would bake a most-popular feed URL
@@ -111,7 +115,7 @@ class Y extends E {
111
115
  if (f.setCurrentBlock(i), this._stampHidePrice(t, r.priceHideIfSameAsDiscounted), c) {
112
116
  I(this.api);
113
117
  const _ = this._getBlockElement(t);
114
- _ && (R(this.api, _, !0), M({
118
+ _ && (R(this.api, _, !0), O({
115
119
  currentNode: t,
116
120
  documentModifier: this.api.getDocumentModifier()
117
121
  }));
@@ -138,11 +142,11 @@ class Y extends E {
138
142
  }
139
143
  this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
140
144
  try {
141
- y || (I(this.api), y = !0);
145
+ B || (I(this.api), B = !0);
142
146
  const e = s.getConfig(t), i = this._getBlockElement(t);
143
147
  if (i) {
144
148
  const n = !e.mobileLayoutEnabled;
145
- O(i) !== n && R(this.api, i, n);
149
+ x(i) !== n && R(this.api, i, n);
146
150
  }
147
151
  } catch {
148
152
  }
@@ -172,7 +176,7 @@ class Y extends E {
172
176
  */
173
177
  _warnIfMultipleBlocks() {
174
178
  try {
175
- T().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
179
+ H().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
176
180
  } catch {
177
181
  }
178
182
  }
@@ -264,7 +268,7 @@ class Y extends E {
264
268
  /** Assigns a fresh id to a duplicated block and syncs DOM, node config and store. */
265
269
  _handleDuplicate(t, e) {
266
270
  const i = this._reassignDuplicateId(t, e), n = h();
267
- n.cloneBlockState(e, i), n.setCurrentBlock(i), g().isFeatureEnabled("reusableRecommendationStrategy") && (this._resetSourceIds.add(e), H(this.api), $(e, i, s.getConfig(t)).catch((o) => console.error("[recommendation] refreshing a duplicated strategy failed", o))), this._warnIfMultipleBlocks();
271
+ n.cloneBlockState(e, i), n.setCurrentBlock(i), g().isFeatureEnabled("reusableRecommendationStrategy") && (this._resetSourceIds.add(e), k(this.api), $(e, i, s.getConfig(t)).catch((o) => console.error("[recommendation] refreshing a duplicated strategy failed", o))), this._warnIfMultipleBlocks();
268
272
  }
269
273
  /**
270
274
  * Core id-reassignment for a duplicated block: rewrites the DOM
@@ -320,7 +324,7 @@ class Y extends E {
320
324
  */
321
325
  _stampHidePrice(t, e) {
322
326
  const i = this._getBlockElement(t);
323
- i && this.api.getDocumentModifier().modifyHtml(i).setAttribute(D, String(e)).apply(new p("Stamp hide-price"));
327
+ i && this.api.getDocumentModifier().modifyHtml(i).setAttribute(y, String(e)).apply(new p("Stamp hide-price"));
324
328
  }
325
329
  /**
326
330
  * Stamps `hide-price` from config only when the block lacks the attribute —
@@ -328,7 +332,7 @@ class Y extends E {
328
332
  */
329
333
  _healHidePriceAttr(t) {
330
334
  const e = this._getBlockElement(t);
331
- if (!e || !("getAttribute" in e) || e.getAttribute(D) !== null)
335
+ if (!e || !("getAttribute" in e) || e.getAttribute(y) !== null)
332
336
  return;
333
337
  const { priceHideIfSameAsDiscounted: i } = s.getConfig(t);
334
338
  this._stampHidePrice(t, i);
@@ -365,6 +369,6 @@ class Y extends E {
365
369
  }
366
370
  }
367
371
  export {
368
- k as BLOCK_ID,
372
+ D as BLOCK_ID,
369
373
  Y as RecommendationBlock
370
374
  };