@askdialog/dialog-react 2.8.0 → 2.10.0

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.
@@ -1,7 +1,7 @@
1
- import { jsx as o, jsxs as h, Fragment as C } from "react/jsx-runtime";
2
- import { useRef as b, useState as v, useEffect as f, useMemo as S, useLayoutEffect as V, useCallback as P, useSyncExternalStore as K } from "react";
3
- import { registerDialogInstallation as M, addAuditCapability as F, resolveTextDirection as U, SearchStatus as L, DialogSearchError as Q, createSearchController as W } from "@askdialog/dialog-sdk";
4
- import { createPortal as Z } from "react-dom";
1
+ import { jsx as n, jsxs as g, Fragment as S } from "react/jsx-runtime";
2
+ import { useRef as v, useState as C, useEffect as b, useMemo as y, useLayoutEffect as V, useCallback as P, useSyncExternalStore as K } from "react";
3
+ import { registerDialogInstallation as M, addAuditCapability as F, resolveTextDirection as U, SearchStatus as L, formatSearchPrice as Q, formatSearchCompareAtPrice as W, DialogSearchError as Z, createSearchController as X } from "@askdialog/dialog-sdk";
4
+ import { createPortal as G } from "react-dom";
5
5
  const R = {
6
6
  en: {
7
7
  placeholder: "Ask the AI a question",
@@ -19,22 +19,22 @@ const R = {
19
19
  askSomethingElse: "Pregunta otra cosa"
20
20
  }
21
21
  }, T = (e) => {
22
- var n;
23
- const t = ((n = e == null ? void 0 : e.split("-")[0]) == null ? void 0 : n.toLowerCase()) ?? "en";
22
+ var o;
23
+ const t = ((o = e == null ? void 0 : e.split("-")[0]) == null ? void 0 : o.toLowerCase()) ?? "en";
24
24
  return R[t] ?? R.en;
25
- }, X = ({
25
+ }, Y = ({
26
26
  client: e,
27
27
  questions: t,
28
- disabled: n,
28
+ disabled: o,
29
29
  productId: s,
30
30
  productTitle: r,
31
31
  selectedVariantId: a
32
- }) => /* @__PURE__ */ o(
32
+ }) => /* @__PURE__ */ n(
33
33
  "button",
34
34
  {
35
35
  type: "button",
36
36
  className: "dialog-ask-something-else",
37
- disabled: n,
37
+ disabled: o,
38
38
  onClick: () => {
39
39
  e.openAssistantWithSuggestions({
40
40
  questions: t ?? [],
@@ -47,13 +47,13 @@ const R = {
47
47
  },
48
48
  children: T(e.locale).askSomethingElse
49
49
  }
50
- ), G = ({
50
+ ), J = ({
51
51
  title: e = "Your expert",
52
52
  description: t = "A question about this product?"
53
- }) => /* @__PURE__ */ h("div", { className: "dialog-block-header-container", children: [
54
- /* @__PURE__ */ o("div", { className: "dialog-block-title", children: e }),
55
- /* @__PURE__ */ o("div", { className: "dialog-block-description", children: t })
56
- ] }), Y = ({ color: e = "#181825" }) => /* @__PURE__ */ h(
53
+ }) => /* @__PURE__ */ g("div", { className: "dialog-block-header-container", children: [
54
+ /* @__PURE__ */ n("div", { className: "dialog-block-title", children: e }),
55
+ /* @__PURE__ */ n("div", { className: "dialog-block-description", children: t })
56
+ ] }), ee = ({ color: e = "#181825" }) => /* @__PURE__ */ g(
57
57
  "svg",
58
58
  {
59
59
  width: "20",
@@ -62,8 +62,8 @@ const R = {
62
62
  fill: "none",
63
63
  xmlns: "http://www.w3.org/2000/svg",
64
64
  children: [
65
- /* @__PURE__ */ h("g", { clipPath: "url(#clip0_466_934)", children: [
66
- /* @__PURE__ */ o(
65
+ /* @__PURE__ */ g("g", { clipPath: "url(#clip0_466_934)", children: [
66
+ /* @__PURE__ */ n(
67
67
  "path",
68
68
  {
69
69
  d: "M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011 12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684 13.7084 7.85932 13.9296L9.16675 14.5833L7.85932 15.237C7.41684 15.4583 7.19559 15.5689 7.00388 15.7167C6.83375 15.8478 6.68124 16.0003 6.55011 16.1704C6.40232 16.3622 6.2917 16.5834 6.07046 17.0259L5.41675 18.3333L4.76303 17.0259C4.54179 16.5834 4.43117 16.3622 4.28339 16.1704C4.15225 16.0003 3.99974 15.8478 3.82962 15.7167C3.6379 15.5689 3.41666 15.4583 2.97418 15.237L1.66675 14.5833L2.97418 13.9296C3.41666 13.7084 3.6379 13.5977 3.82962 13.45C3.99974 13.3188 4.15225 13.1663 4.28339 12.9962C4.43117 12.8045 4.54179 12.5832 4.76303 12.1408L5.41675 10.8333Z",
@@ -73,7 +73,7 @@ const R = {
73
73
  strokeLinejoin: "round"
74
74
  }
75
75
  ),
76
- /* @__PURE__ */ o(
76
+ /* @__PURE__ */ n(
77
77
  "path",
78
78
  {
79
79
  d: "M12.5001 1.66666L13.4823 4.22034C13.7173 4.83136 13.8348 5.13688 14.0175 5.39386C14.1795 5.62162 14.3785 5.82061 14.6062 5.98256C14.8632 6.16529 15.1687 6.2828 15.7797 6.5178L18.3334 7.49999L15.7797 8.48217C15.1687 8.71718 14.8632 8.83469 14.6062 9.01742C14.3785 9.17937 14.1795 9.37836 14.0175 9.60612C13.8348 9.8631 13.7173 10.1686 13.4823 10.7796L12.5001 13.3333L11.5179 10.7796C11.2829 10.1686 11.1654 9.8631 10.9827 9.60612C10.8207 9.37836 10.6217 9.17937 10.3939 9.01742C10.137 8.83469 9.83145 8.71718 9.22043 8.48217L6.66675 7.49999L9.22043 6.5178C9.83145 6.28279 10.137 6.16529 10.3939 5.98256C10.6217 5.82061 10.8207 5.62162 10.9827 5.39386C11.1654 5.13688 11.2829 4.83136 11.5179 4.22034L12.5001 1.66666Z",
@@ -84,50 +84,50 @@ const R = {
84
84
  }
85
85
  )
86
86
  ] }),
87
- /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: "clip0_466_934", children: /* @__PURE__ */ o("rect", { width: "20", height: "20", fill: "white" }) }) })
87
+ /* @__PURE__ */ n("defs", { children: /* @__PURE__ */ n("clipPath", { id: "clip0_466_934", children: /* @__PURE__ */ n("rect", { width: "20", height: "20", fill: "white" }) }) })
88
88
  ]
89
89
  }
90
- ), J = ({
90
+ ), te = ({
91
91
  client: e,
92
92
  questions: t,
93
- productId: n,
93
+ productId: o,
94
94
  productTitle: s,
95
95
  selectedVariantId: r
96
96
  }) => {
97
- const a = (c) => {
97
+ const a = (l) => {
98
98
  e.sendProductMessage({
99
- productId: n,
99
+ productId: o,
100
100
  productTitle: s,
101
101
  selectedVariantId: r,
102
- question: c,
102
+ question: l,
103
103
  fromQuestionSuggestion: !0
104
104
  });
105
105
  };
106
- return /* @__PURE__ */ o(C, { children: t.map((c) => /* @__PURE__ */ h(
106
+ return /* @__PURE__ */ n(S, { children: t.map((l) => /* @__PURE__ */ g(
107
107
  "button",
108
108
  {
109
109
  className: "dialog-block-suggestions-item",
110
- onClick: () => a(c.question),
110
+ onClick: () => a(l.question),
111
111
  children: [
112
- /* @__PURE__ */ o(Y, { color: e.theme.primaryColor }),
113
- /* @__PURE__ */ o("span", { className: "dialog-block-suggestions-item-label", children: c.question })
112
+ /* @__PURE__ */ n(ee, { color: e.theme.primaryColor }),
113
+ /* @__PURE__ */ n("span", { className: "dialog-block-suggestions-item-label", children: l.question })
114
114
  ]
115
115
  },
116
- c.question
116
+ l.question
117
117
  )) });
118
- }, ee = () => /* @__PURE__ */ h(C, { children: [
119
- /* @__PURE__ */ o("div", { className: "dialog-block-suggestions-skeleton-item" }),
120
- /* @__PURE__ */ o("div", { className: "dialog-block-suggestions-skeleton-item" }),
121
- /* @__PURE__ */ o("div", { className: "dialog-block-suggestions-skeleton-item" })
122
- ] }), te = ({
118
+ }, se = () => /* @__PURE__ */ g(S, { children: [
119
+ /* @__PURE__ */ n("div", { className: "dialog-block-suggestions-skeleton-item" }),
120
+ /* @__PURE__ */ n("div", { className: "dialog-block-suggestions-skeleton-item" }),
121
+ /* @__PURE__ */ n("div", { className: "dialog-block-suggestions-skeleton-item" })
122
+ ] }), oe = ({
123
123
  client: e,
124
124
  questions: t,
125
- isLoading: n,
125
+ isLoading: o,
126
126
  productId: s,
127
127
  productTitle: r,
128
128
  selectedVariantId: a
129
- }) => /* @__PURE__ */ o("div", { className: "dialog-block-suggestions-container", children: n || !t ? /* @__PURE__ */ o(ee, {}) : /* @__PURE__ */ o(
130
- J,
129
+ }) => /* @__PURE__ */ n("div", { className: "dialog-block-suggestions-container", children: o || !t ? /* @__PURE__ */ n(se, {}) : /* @__PURE__ */ n(
130
+ te,
131
131
  {
132
132
  client: e,
133
133
  questions: t,
@@ -135,7 +135,7 @@ const R = {
135
135
  productTitle: r,
136
136
  selectedVariantId: a
137
137
  }
138
- ) }), se = ({ color: e = "#ffffff" }) => /* @__PURE__ */ o(
138
+ ) }), ne = ({ color: e = "#ffffff" }) => /* @__PURE__ */ n(
139
139
  "svg",
140
140
  {
141
141
  width: "20",
@@ -143,7 +143,7 @@ const R = {
143
143
  viewBox: "0 0 20 20",
144
144
  fill: "none",
145
145
  xmlns: "http://www.w3.org/2000/svg",
146
- children: /* @__PURE__ */ o(
146
+ children: /* @__PURE__ */ n(
147
147
  "path",
148
148
  {
149
149
  d: "M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",
@@ -154,71 +154,71 @@ const R = {
154
154
  }
155
155
  )
156
156
  }
157
- ), ne = ({
157
+ ), re = ({
158
158
  client: e,
159
159
  productId: t,
160
- productTitle: n,
160
+ productTitle: o,
161
161
  selectedVariantId: s
162
162
  }) => {
163
- const r = b(null), [a, c] = v(""), i = T(e.locale), l = () => {
163
+ const r = v(null), [a, l] = C(""), i = T(e.locale), c = () => {
164
164
  var d;
165
165
  (d = r.current) == null || d.focus();
166
- }, u = () => {
166
+ }, h = () => {
167
167
  const d = a;
168
168
  d.trim() && (e.sendProductMessage({
169
169
  productId: t,
170
- productTitle: n,
170
+ productTitle: o,
171
171
  selectedVariantId: s,
172
172
  question: d,
173
173
  fromQuestionSuggestion: !0
174
- }), c(""));
174
+ }), l(""));
175
175
  }, p = (d) => {
176
- d.key === "Enter" && u();
176
+ d.key === "Enter" && h();
177
177
  };
178
- return /* @__PURE__ */ h("div", { className: "dialog-input-container", children: [
179
- /* @__PURE__ */ h("div", { className: "dialog-input-wrapper", onClick: l, children: [
180
- /* @__PURE__ */ o(
178
+ return /* @__PURE__ */ g("div", { className: "dialog-input-container", children: [
179
+ /* @__PURE__ */ g("div", { className: "dialog-input-wrapper", onClick: c, children: [
180
+ /* @__PURE__ */ n(
181
181
  "input",
182
182
  {
183
183
  id: "dialog-ask-anything-input-ai-input",
184
184
  ref: r,
185
185
  value: a,
186
- onChange: (d) => c(d.target.value),
186
+ onChange: (d) => l(d.target.value),
187
187
  className: "dialog-ask-anything-input-ai-input",
188
188
  placeholder: i.placeholder,
189
189
  "aria-describedby": "dialog-input-ai-disclosure",
190
190
  onKeyDown: p
191
191
  }
192
192
  ),
193
- /* @__PURE__ */ o(
193
+ /* @__PURE__ */ n(
194
194
  "button",
195
195
  {
196
196
  id: "send-message-button-ai-input",
197
197
  className: "dialog-input-submit",
198
198
  disabled: !a.trim(),
199
- onClick: u,
200
- children: /* @__PURE__ */ o(se, { color: e.theme.ctaTextColor })
199
+ onClick: h,
200
+ children: /* @__PURE__ */ n(ne, { color: e.theme.ctaTextColor })
201
201
  }
202
202
  )
203
203
  ] }),
204
- /* @__PURE__ */ o("p", { id: "dialog-input-ai-disclosure", className: "dialog-input-ai-disclosure", children: i.aiDisclosure })
204
+ /* @__PURE__ */ n("p", { id: "dialog-input-ai-disclosure", className: "dialog-input-ai-disclosure", children: i.aiDisclosure })
205
205
  ] });
206
- }, I = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), oe = (e) => {
206
+ }, $ = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), ie = (e) => {
207
207
  if (!e) return;
208
208
  const t = document.body;
209
- Object.keys(e).forEach((n) => {
210
- const s = n, r = I(n);
209
+ Object.keys(e).forEach((o) => {
210
+ const s = o, r = $(o);
211
211
  if (e[s] !== void 0) {
212
212
  if (typeof e[s] == "object") {
213
213
  Object.keys(e[s]).forEach(
214
214
  (a) => {
215
215
  var i;
216
- const c = a;
217
- if (c !== void 0) {
218
- const l = I(a), u = e[s];
216
+ const l = a;
217
+ if (l !== void 0) {
218
+ const c = $(a), h = e[s];
219
219
  t.style.setProperty(
220
- `--dialog-theme-${r}-${l}`,
221
- (i = u[c]) == null ? void 0 : i.toString()
220
+ `--dialog-theme-${r}-${c}`,
221
+ (i = h[l]) == null ? void 0 : i.toString()
222
222
  );
223
223
  }
224
224
  }
@@ -236,101 +236,101 @@ const R = {
236
236
  );
237
237
  }
238
238
  });
239
- }, re = ({ theme: e, children: t }) => (f(() => {
240
- e && oe(e);
241
- }, [e]), /* @__PURE__ */ o(C, { children: t })), ie = 2, ae = 5, Ze = ({
239
+ }, ae = ({ theme: e, children: t }) => (b(() => {
240
+ e && ie(e);
241
+ }, [e]), /* @__PURE__ */ n(S, { children: t })), ce = 2, le = 5, Xe = ({
242
242
  client: e,
243
243
  productId: t,
244
- productTitle: n,
244
+ productTitle: o,
245
245
  selectedVariantId: s,
246
246
  enableInput: r = !1
247
247
  }) => {
248
- var g;
249
- const [a, c] = v(!0), [i, l] = v(
248
+ var u;
249
+ const [a, l] = C(!0), [i, c] = C(
250
250
  void 0
251
251
  );
252
- f(() => {
252
+ b(() => {
253
253
  M({
254
254
  method: "react",
255
- version: "2.8.0"
255
+ version: "2.10.0"
256
256
  }), F("pdp-block");
257
257
  }, []);
258
- const u = S(
258
+ const h = y(
259
259
  () => a ? "" : i == null ? void 0 : i.assistantName,
260
260
  [i, a]
261
- ), p = S(
261
+ ), p = y(
262
262
  () => a ? "" : i == null ? void 0 : i.description,
263
263
  [i, a]
264
- ), d = S(
264
+ ), d = y(
265
265
  () => a ? "" : i == null ? void 0 : i.inputPlaceholder,
266
266
  [i, a]
267
- ), m = S(
267
+ ), m = y(
268
268
  () => {
269
- var y;
270
- return U((y = e.getLocalizationInformations()) == null ? void 0 : y.languageCode);
269
+ var f;
270
+ return U((f = e.getLocalizationInformations()) == null ? void 0 : f.languageCode);
271
271
  },
272
272
  [e]
273
273
  );
274
- return f(() => {
275
- let y = !0;
274
+ return b(() => {
275
+ let f = !0;
276
276
  return (async () => {
277
- c(!0), l(void 0);
277
+ l(!0), c(void 0);
278
278
  try {
279
279
  const E = await e.getSuggestions(t, {
280
- limit: ae
280
+ limit: le
281
281
  });
282
- y && l(E);
282
+ f && c(E);
283
283
  } catch (E) {
284
284
  console.error("error", E);
285
285
  } finally {
286
- y && c(!1);
286
+ f && l(!1);
287
287
  }
288
288
  })(), () => {
289
- y = !1;
289
+ f = !1;
290
290
  };
291
- }, [e, t]), /* @__PURE__ */ o(re, { theme: e.theme, children: /* @__PURE__ */ h(
291
+ }, [e, t]), /* @__PURE__ */ n(ae, { theme: e.theme, children: /* @__PURE__ */ g(
292
292
  "div",
293
293
  {
294
294
  id: "dialog-instant",
295
295
  className: "dialog-block-container",
296
296
  dir: m,
297
297
  children: [
298
- /* @__PURE__ */ o(G, { title: u, description: p }),
299
- /* @__PURE__ */ o(
300
- te,
298
+ /* @__PURE__ */ n(J, { title: h, description: p }),
299
+ /* @__PURE__ */ n(
300
+ oe,
301
301
  {
302
302
  client: e,
303
- questions: (g = i == null ? void 0 : i.questions) == null ? void 0 : g.slice(0, ie),
303
+ questions: (u = i == null ? void 0 : i.questions) == null ? void 0 : u.slice(0, ce),
304
304
  isLoading: a,
305
305
  productId: t,
306
- productTitle: n,
306
+ productTitle: o,
307
307
  selectedVariantId: s
308
308
  }
309
309
  ),
310
- r ? /* @__PURE__ */ o(
311
- ne,
310
+ r ? /* @__PURE__ */ n(
311
+ re,
312
312
  {
313
313
  client: e,
314
314
  placeholder: d,
315
315
  productId: t,
316
- productTitle: n,
316
+ productTitle: o,
317
317
  selectedVariantId: s
318
318
  }
319
- ) : /* @__PURE__ */ o(
320
- X,
319
+ ) : /* @__PURE__ */ n(
320
+ Y,
321
321
  {
322
322
  client: e,
323
323
  questions: i == null ? void 0 : i.questions,
324
324
  disabled: a,
325
325
  productId: t,
326
- productTitle: n,
326
+ productTitle: o,
327
327
  selectedVariantId: s
328
328
  }
329
329
  )
330
330
  ]
331
331
  }
332
332
  ) });
333
- }, le = () => /* @__PURE__ */ o(
333
+ }, de = () => /* @__PURE__ */ n(
334
334
  "svg",
335
335
  {
336
336
  width: 16,
@@ -339,7 +339,7 @@ const R = {
339
339
  fill: "none",
340
340
  xmlns: "http://www.w3.org/2000/svg",
341
341
  "aria-hidden": "true",
342
- children: /* @__PURE__ */ o(
342
+ children: /* @__PURE__ */ n(
343
343
  "path",
344
344
  {
345
345
  d: "M8 13V3M8 3L3 8M8 3L13 8",
@@ -350,9 +350,9 @@ const R = {
350
350
  }
351
351
  )
352
352
  }
353
- ), ce = "M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z", de = ({
353
+ ), ue = "M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z", he = ({
354
354
  color: e = "currentColor"
355
- }) => /* @__PURE__ */ o(
355
+ }) => /* @__PURE__ */ n(
356
356
  "svg",
357
357
  {
358
358
  width: 16,
@@ -361,21 +361,21 @@ const R = {
361
361
  fill: "none",
362
362
  xmlns: "http://www.w3.org/2000/svg",
363
363
  "aria-hidden": "true",
364
- children: /* @__PURE__ */ o("path", { d: ce, fill: e })
364
+ children: /* @__PURE__ */ n("path", { d: ue, fill: e })
365
365
  }
366
- ), Xe = ({
366
+ ), Ge = ({
367
367
  controller: e,
368
368
  placeholder: t = "Search products...",
369
- autoFocus: n = !1,
369
+ autoFocus: o = !1,
370
370
  submitAriaLabel: s = "Search"
371
371
  }) => {
372
- const [r, a] = v("");
373
- return /* @__PURE__ */ h("form", { className: "dialog-search-bar", role: "search", onSubmit: (i) => {
372
+ const [r, a] = C("");
373
+ return /* @__PURE__ */ g("form", { className: "dialog-search-bar", role: "search", onSubmit: (i) => {
374
374
  i.preventDefault(), e.submit(r);
375
375
  }, children: [
376
- /* @__PURE__ */ h("div", { className: "dialog-search-bar-field", children: [
377
- /* @__PURE__ */ o("span", { className: "dialog-search-bar-icon", children: /* @__PURE__ */ o(de, {}) }),
378
- /* @__PURE__ */ o(
376
+ /* @__PURE__ */ g("div", { className: "dialog-search-bar-field", children: [
377
+ /* @__PURE__ */ n("span", { className: "dialog-search-bar-icon", children: /* @__PURE__ */ n(he, {}) }),
378
+ /* @__PURE__ */ n(
379
379
  "input",
380
380
  {
381
381
  type: "text",
@@ -384,30 +384,30 @@ const R = {
384
384
  value: r,
385
385
  "aria-label": t,
386
386
  placeholder: t,
387
- autoFocus: n,
387
+ autoFocus: o,
388
388
  onChange: (i) => {
389
389
  a(i.target.value), e.setQuery(i.target.value);
390
390
  }
391
391
  }
392
392
  )
393
393
  ] }),
394
- /* @__PURE__ */ o(
394
+ /* @__PURE__ */ n(
395
395
  "button",
396
396
  {
397
397
  type: "submit",
398
398
  className: "dialog-search-bar-submit",
399
399
  "aria-label": s,
400
- children: /* @__PURE__ */ o(le, {})
400
+ children: /* @__PURE__ */ n(de, {})
401
401
  }
402
402
  )
403
403
  ] });
404
- }, ue = (e, t) => {
404
+ }, ge = (e, t) => {
405
405
  try {
406
406
  return new Intl.NumberFormat(t).format(e);
407
407
  } catch {
408
408
  return String(e);
409
409
  }
410
- }, $ = {
410
+ }, I = {
411
411
  en: (e) => ({
412
412
  searching: (t) => `Searching “${t}”…`,
413
413
  noResults: "No matching products",
@@ -419,7 +419,7 @@ const R = {
419
419
  seeAllLabel: (t) => t === 1 ? "See the result" : `See all ${e(t)} results`,
420
420
  previous: "Previous",
421
421
  next: "Next",
422
- pageOf: (t, n) => `Page ${e(t)} / ${e(n)}`
422
+ pageOf: (t, o) => `Page ${e(t)} / ${e(o)}`
423
423
  }),
424
424
  fr: (e) => ({
425
425
  searching: (t) => `Recherche de « ${t} »…`,
@@ -432,7 +432,7 @@ const R = {
432
432
  seeAllLabel: (t) => t === 1 ? "Voir le résultat" : `Voir les ${e(t)} résultats`,
433
433
  previous: "Précédent",
434
434
  next: "Suivant",
435
- pageOf: (t, n) => `Page ${e(t)} / ${e(n)}`
435
+ pageOf: (t, o) => `Page ${e(t)} / ${e(o)}`
436
436
  }),
437
437
  de: (e) => ({
438
438
  searching: (t) => `Suche nach „${t}“…`,
@@ -445,7 +445,7 @@ const R = {
445
445
  seeAllLabel: (t) => t === 1 ? "Das Ergebnis anzeigen" : `Alle ${e(t)} Ergebnisse anzeigen`,
446
446
  previous: "Zurück",
447
447
  next: "Weiter",
448
- pageOf: (t, n) => `Seite ${e(t)} / ${e(n)}`
448
+ pageOf: (t, o) => `Seite ${e(t)} / ${e(o)}`
449
449
  }),
450
450
  es: (e) => ({
451
451
  searching: (t) => `Buscando «${t}»…`,
@@ -458,7 +458,7 @@ const R = {
458
458
  seeAllLabel: (t) => t === 1 ? "Ver el resultado" : `Ver los ${e(t)} resultados`,
459
459
  previous: "Anterior",
460
460
  next: "Siguiente",
461
- pageOf: (t, n) => `Página ${e(t)} / ${e(n)}`
461
+ pageOf: (t, o) => `Página ${e(t)} / ${e(o)}`
462
462
  }),
463
463
  it: (e) => ({
464
464
  searching: (t) => `Ricerca di “${t}”…`,
@@ -471,23 +471,23 @@ const R = {
471
471
  seeAllLabel: (t) => t === 1 ? "Vedi il risultato" : `Vedi tutti i ${e(t)} risultati`,
472
472
  previous: "Precedente",
473
473
  next: "Successivo",
474
- pageOf: (t, n) => `Pagina ${e(t)} / ${e(n)}`
474
+ pageOf: (t, o) => `Pagina ${e(t)} / ${e(o)}`
475
475
  })
476
- }, O = (e) => {
476
+ }, _ = (e) => {
477
477
  var s;
478
478
  const t = ((s = e == null ? void 0 : e.split("-")[0]) == null ? void 0 : s.toLowerCase()) ?? "en";
479
- return ($[t] ?? $.en)((r) => ue(r, e));
480
- }, _ = (e) => e.status !== L.LOADING && e.response !== void 0 && e.response.nbPages > 1, he = ({
479
+ return (I[t] ?? I.en)((r) => ge(r, e));
480
+ }, O = (e) => e.status !== L.LOADING && e.response !== void 0 && e.response.nbPages > 1, pe = ({
481
481
  controller: e,
482
482
  state: t,
483
- locale: n
483
+ locale: o
484
484
  }) => {
485
485
  const s = t.response;
486
- if (s === void 0 || !_(t))
486
+ if (s === void 0 || !O(t))
487
487
  return null;
488
- const r = O(n);
489
- return /* @__PURE__ */ h("nav", { "aria-label": "Search results pages", className: "dialog-search-pagination", children: [
490
- /* @__PURE__ */ o(
488
+ const r = _(o);
489
+ return /* @__PURE__ */ g("nav", { "aria-label": "Search results pages", className: "dialog-search-pagination", children: [
490
+ /* @__PURE__ */ n(
491
491
  "button",
492
492
  {
493
493
  type: "button",
@@ -496,8 +496,8 @@ const R = {
496
496
  children: r.previous
497
497
  }
498
498
  ),
499
- /* @__PURE__ */ o("span", { children: r.pageOf(s.page + 1, s.nbPages) }),
500
- /* @__PURE__ */ o(
499
+ /* @__PURE__ */ n("span", { children: r.pageOf(s.page + 1, s.nbPages) }),
500
+ /* @__PURE__ */ n(
501
501
  "button",
502
502
  {
503
503
  type: "button",
@@ -507,87 +507,80 @@ const R = {
507
507
  }
508
508
  )
509
509
  ] });
510
- }, D = (e) => e.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/ẞ/gu, "ß").toUpperCase().toLowerCase().replace(/ς/g, "σ"), ge = (e, t) => {
511
- const n = { before: "", match: e, after: "" }, s = D(t.trim());
510
+ }, D = (e) => e.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/ẞ/gu, "ß").toUpperCase().toLowerCase().replace(/ς/g, "σ"), me = (e, t) => {
511
+ const o = { before: "", match: e, after: "" }, s = D(t.trim());
512
512
  if (s === "")
513
- return n;
513
+ return o;
514
514
  const r = [...e], a = [];
515
- let c = "";
515
+ let l = "";
516
516
  r.forEach((p, d) => {
517
517
  const m = D(p);
518
- for (let g = 0; g < m.length; g += 1)
518
+ for (let u = 0; u < m.length; u += 1)
519
519
  a.push(d);
520
- c += m;
520
+ l += m;
521
521
  });
522
- const i = c.indexOf(s);
522
+ const i = l.indexOf(s);
523
523
  if (i === -1)
524
- return n;
525
- const l = a[i], u = a[i + s.length - 1] + 1;
524
+ return o;
525
+ const c = a[i], h = a[i + s.length - 1] + 1;
526
526
  return {
527
- before: r.slice(0, l).join(""),
528
- match: r.slice(l, u).join(""),
529
- after: r.slice(u).join("")
527
+ before: r.slice(0, c).join(""),
528
+ match: r.slice(c, h).join(""),
529
+ after: r.slice(h).join("")
530
530
  };
531
531
  }, H = ({
532
532
  title: e,
533
533
  query: t
534
534
  }) => {
535
- const { before: n, match: s, after: r } = ge(e, t);
536
- return /* @__PURE__ */ h(C, { children: [
537
- n !== "" && /* @__PURE__ */ o("span", { className: "dialog-search-muted", children: n }),
538
- /* @__PURE__ */ o("span", { className: "dialog-search-match", children: s }),
539
- r !== "" && /* @__PURE__ */ o("span", { className: "dialog-search-muted", children: r })
535
+ const { before: o, match: s, after: r } = me(e, t);
536
+ return /* @__PURE__ */ g(S, { children: [
537
+ o !== "" && /* @__PURE__ */ n("span", { className: "dialog-search-muted", children: o }),
538
+ /* @__PURE__ */ n("span", { className: "dialog-search-match", children: s }),
539
+ r !== "" && /* @__PURE__ */ n("span", { className: "dialog-search-muted", children: r })
540
540
  ] });
541
- }, pe = ({ amount: e, currencyCode: t }, n) => t === void 0 ? new Intl.NumberFormat(n).format(Number(e)) : new Intl.NumberFormat(n, {
542
- style: "currency",
543
- currency: t
544
- }).format(Number(e)), me = (e, t) => {
545
- if (e === void 0)
546
- return "";
547
- try {
548
- return pe(e.min, t);
549
- } catch {
550
- return "";
551
- }
552
- }, fe = (e) => {
553
- try {
554
- const { protocol: t } = new URL(e, window.location.href);
555
- return t === "http:" || t === "https:" ? e : void 0;
556
- } catch {
557
- return;
558
- }
559
- }, q = (e) => e.url === void 0 || e.url === "" ? void 0 : fe(e.url), B = (e) => e.title ?? e.handle ?? e.objectID, be = ({
541
+ }, fe = (e) => e.product_image || e.image || void 0, q = (e) => {
542
+ if (!(e === void 0 || e === ""))
543
+ try {
544
+ const { protocol: t } = new URL(e, window.location.href);
545
+ return t === "http:" || t === "https:" ? e : void 0;
546
+ } catch {
547
+ return;
548
+ }
549
+ }, be = (e) => q(e.url), B = (e) => e.title ?? e.handle ?? e.objectID, ve = ({
560
550
  controller: e,
561
551
  hit: t,
562
- index: n,
552
+ index: o,
563
553
  locale: s,
564
554
  query: r = ""
565
555
  }) => {
566
- const a = b(null);
567
- f(() => {
568
- a.current !== null && e.observeResult(a.current, n);
569
- }, [e, t, n]);
570
- const c = (d) => {
571
- const m = d.metaKey || d.ctrlKey || d.shiftKey || d.altKey;
572
- e.selectResult(n, { navigate: !m }) && d.preventDefault();
573
- }, i = (d) => {
574
- d.button === 1 && e.selectResult(n, { navigate: !1 });
575
- }, l = me(t.priceRange, s), u = q(t), p = /* @__PURE__ */ h(C, { children: [
576
- /* @__PURE__ */ o("span", { className: "dialog-search-product-thumb", "aria-hidden": !0, children: t.imageUrl !== void 0 && t.imageUrl !== "" && /* @__PURE__ */ o("img", { src: t.imageUrl, alt: "", loading: "lazy" }) }),
577
- /* @__PURE__ */ o("span", { className: "dialog-search-product-title", children: /* @__PURE__ */ o(H, { title: B(t), query: r }) }),
578
- l !== "" && /* @__PURE__ */ o("span", { className: "dialog-search-product-price", children: l })
556
+ const a = v(null);
557
+ b(() => {
558
+ a.current !== null && e.observeResult(a.current, o);
559
+ }, [e, t, o]);
560
+ const l = (u) => {
561
+ const f = u.metaKey || u.ctrlKey || u.shiftKey || u.altKey;
562
+ e.selectResult(o, { navigate: !f }) && u.preventDefault();
563
+ }, i = (u) => {
564
+ u.button === 1 && e.selectResult(o, { navigate: !1 });
565
+ }, c = Q(t, s), h = W(t, s), p = q(e.productUrl(t)), d = fe(t), m = /* @__PURE__ */ g(S, { children: [
566
+ /* @__PURE__ */ n("span", { className: "dialog-search-product-thumb", "aria-hidden": !0, children: d !== void 0 && /* @__PURE__ */ n("img", { src: d, alt: "", loading: "lazy" }) }),
567
+ /* @__PURE__ */ n("span", { className: "dialog-search-product-title", children: /* @__PURE__ */ n(H, { title: B(t), query: r }) }),
568
+ c !== "" && /* @__PURE__ */ g("span", { className: "dialog-search-product-price", children: [
569
+ h !== "" && /* @__PURE__ */ n("s", { className: "dialog-search-product-compare-at", children: h }),
570
+ c
571
+ ] })
579
572
  ] });
580
- return /* @__PURE__ */ o("li", { ref: a, className: "dialog-search-card", children: u === void 0 ? /* @__PURE__ */ o("div", { className: "dialog-search-product", children: p }) : /* @__PURE__ */ o(
573
+ return /* @__PURE__ */ n("li", { ref: a, className: "dialog-search-card", children: p === void 0 ? /* @__PURE__ */ n("div", { className: "dialog-search-product", children: m }) : /* @__PURE__ */ n(
581
574
  "a",
582
575
  {
583
576
  className: "dialog-search-product",
584
- href: u,
585
- onClick: c,
577
+ href: p,
578
+ onClick: l,
586
579
  onAuxClick: i,
587
- children: p
580
+ children: m
588
581
  }
589
582
  ) });
590
- }, ve = () => /* @__PURE__ */ o(
583
+ }, Ce = () => /* @__PURE__ */ n(
591
584
  "svg",
592
585
  {
593
586
  width: 16,
@@ -596,9 +589,9 @@ const R = {
596
589
  fill: "currentColor",
597
590
  xmlns: "http://www.w3.org/2000/svg",
598
591
  "aria-hidden": "true",
599
- children: /* @__PURE__ */ o("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" })
592
+ children: /* @__PURE__ */ n("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" })
600
593
  }
601
- ), Ce = () => /* @__PURE__ */ o(
594
+ ), Se = () => /* @__PURE__ */ n(
602
595
  "svg",
603
596
  {
604
597
  width: 12,
@@ -607,100 +600,100 @@ const R = {
607
600
  fill: "currentColor",
608
601
  xmlns: "http://www.w3.org/2000/svg",
609
602
  "aria-hidden": "true",
610
- children: /* @__PURE__ */ o("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" })
603
+ children: /* @__PURE__ */ n("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" })
611
604
  }
612
605
  ), j = (e) => (e ?? []).flatMap((t) => {
613
- const n = q(t);
614
- return n === void 0 ? [] : [{ collection: t, href: n }];
606
+ const o = be(t);
607
+ return o === void 0 ? [] : [{ collection: t, href: o }];
615
608
  }), ye = ({
616
609
  collections: e,
617
610
  query: t,
618
- messages: n
611
+ messages: o
619
612
  }) => {
620
613
  const s = j(e);
621
- return s.length === 0 ? null : /* @__PURE__ */ h("aside", { className: "dialog-search-collections", children: [
622
- /* @__PURE__ */ h("div", { className: "dialog-search-section-head", children: [
623
- /* @__PURE__ */ o("p", { className: "dialog-search-label", children: n.collectionsLabel }),
624
- /* @__PURE__ */ o("span", { className: "dialog-search-count", children: n.collectionsCount(s.length) })
614
+ return s.length === 0 ? null : /* @__PURE__ */ g("aside", { className: "dialog-search-collections", children: [
615
+ /* @__PURE__ */ g("div", { className: "dialog-search-section-head", children: [
616
+ /* @__PURE__ */ n("p", { className: "dialog-search-label", children: o.collectionsLabel }),
617
+ /* @__PURE__ */ n("span", { className: "dialog-search-count", children: o.collectionsCount(s.length) })
625
618
  ] }),
626
- /* @__PURE__ */ o("ul", { className: "dialog-search-collection-list", children: s.map(({ collection: r, href: a }) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ h("a", { className: "dialog-search-collection", href: a, children: [
627
- /* @__PURE__ */ o("span", { className: "dialog-search-collection-thumb", "aria-hidden": !0, children: r.imageUrl !== void 0 && r.imageUrl !== "" && /* @__PURE__ */ o("img", { src: r.imageUrl, alt: "", loading: "lazy" }) }),
628
- /* @__PURE__ */ o("span", { className: "dialog-search-collection-title", children: /* @__PURE__ */ o(H, { title: B(r), query: t }) }),
629
- /* @__PURE__ */ o("span", { className: "dialog-search-caret", children: /* @__PURE__ */ o(Ce, {}) })
619
+ /* @__PURE__ */ n("ul", { className: "dialog-search-collection-list", children: s.map(({ collection: r, href: a }) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ g("a", { className: "dialog-search-collection", href: a, children: [
620
+ /* @__PURE__ */ n("span", { className: "dialog-search-collection-thumb", "aria-hidden": !0, children: r.image ? /* @__PURE__ */ n("img", { src: r.image, alt: "", loading: "lazy" }) : null }),
621
+ /* @__PURE__ */ n("span", { className: "dialog-search-collection-title", children: /* @__PURE__ */ n(H, { title: B(r), query: t }) }),
622
+ /* @__PURE__ */ n("span", { className: "dialog-search-caret", children: /* @__PURE__ */ n(Se, {}) })
630
623
  ] }) }, r.objectID)) })
631
624
  ] });
632
- }, Se = ({
625
+ }, we = ({
633
626
  controller: e,
634
627
  response: t,
635
- locale: n,
628
+ locale: o,
636
629
  messages: s
637
- }) => /* @__PURE__ */ h("section", { className: "dialog-search-products", children: [
638
- /* @__PURE__ */ o("div", { className: "dialog-search-section-head", children: /* @__PURE__ */ h("p", { className: "dialog-search-label", children: [
630
+ }) => /* @__PURE__ */ g("section", { className: "dialog-search-products", children: [
631
+ /* @__PURE__ */ n("div", { className: "dialog-search-section-head", children: /* @__PURE__ */ g("p", { className: "dialog-search-label", children: [
639
632
  s.productsLabel,
640
- t.nbHits > 0 && /* @__PURE__ */ o("span", { className: "dialog-search-label-count", children: ` · ${s.resultsCount(t.nbHits)}` })
633
+ t.nbHits > 0 && /* @__PURE__ */ n("span", { className: "dialog-search-label-count", children: ` · ${s.resultsCount(t.nbHits)}` })
641
634
  ] }) }),
642
- /* @__PURE__ */ o("ul", { className: "dialog-search-results", children: t.hits.length === 0 ? /* @__PURE__ */ o("li", { className: "dialog-search-empty", role: "status", children: s.noResults }) : t.hits.map((r, a) => /* @__PURE__ */ o(
643
- be,
635
+ /* @__PURE__ */ n("ul", { className: "dialog-search-results", children: t.hits.length === 0 ? /* @__PURE__ */ n("li", { className: "dialog-search-empty", role: "status", children: s.noResults }) : t.hits.map((r, a) => /* @__PURE__ */ n(
636
+ ve,
644
637
  {
645
638
  controller: e,
646
639
  hit: r,
647
640
  index: a,
648
- locale: n,
641
+ locale: o,
649
642
  query: t.query
650
643
  },
651
644
  r.objectID
652
645
  )) })
653
- ] }), k = 8, w = 16, we = 200, Le = 1440, ke = (e, t) => e.bottom > 0 && e.top < t, Ne = (e, t) => {
654
- const n = Math.min(
655
- Le,
646
+ ] }), k = 8, w = 16, Le = 200, ke = 1440, Ne = (e, t) => e.bottom > 0 && e.top < t, Ee = (e, t) => {
647
+ const o = Math.min(
648
+ ke,
656
649
  t - 2 * w
657
- ), s = e.left + e.width / 2 - n / 2;
650
+ ), s = e.left + e.width / 2 - o / 2;
658
651
  return { left: Math.min(
659
652
  Math.max(s, w),
660
- t - w - n
661
- ), width: n };
662
- }, Ee = (e, t, n) => {
663
- const s = n - e.bottom - k - w, r = e.top - k - w, a = Ne(e, t);
664
- return s < we && r > s ? {
653
+ t - w - o
654
+ ), width: o };
655
+ }, Pe = (e, t, o) => {
656
+ const s = o - e.bottom - k - w, r = e.top - k - w, a = Ee(e, t);
657
+ return s < Le && r > s ? {
665
658
  ...a,
666
- bottom: n - e.top + k,
659
+ bottom: o - e.top + k,
667
660
  maxHeight: Math.max(r, 0)
668
661
  } : {
669
662
  ...a,
670
663
  top: e.bottom + k,
671
664
  maxHeight: Math.max(s, 0)
672
665
  };
673
- }, Pe = (e) => {
666
+ }, Ae = (e) => {
674
667
  const t = e.trim().replace(/^#/, "");
675
668
  if (!/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t))
676
669
  return;
677
- const n = t.length <= 4 ? [...t].map((s) => s + s).join("") : t;
670
+ const o = t.length <= 4 ? [...t].map((s) => s + s).join("") : t;
678
671
  return [0, 2, 4].map(
679
- (s) => Number.parseInt(n.slice(s, s + 2), 16)
672
+ (s) => Number.parseInt(o.slice(s, s + 2), 16)
680
673
  );
681
- }, Ae = (e) => {
674
+ }, xe = (e) => {
682
675
  const t = /^rgba?\((\d+), (\d+), (\d+)(?:, [\d.]+)?\)$/.exec(e);
683
676
  if (t !== null)
684
677
  return [t[1], t[2], t[3]].map(Number);
685
- }, xe = (e) => {
678
+ }, Re = (e) => {
686
679
  if (typeof document > "u")
687
680
  return;
688
681
  const t = document.createElement("span");
689
682
  if (t.style.color = e, t.style.color === "")
690
683
  return;
691
684
  document.body.appendChild(t);
692
- const n = Ae(getComputedStyle(t).color);
693
- return t.remove(), n;
694
- }, Re = (e) => Pe(e) ?? xe(e), Ie = (e) => {
685
+ const o = xe(getComputedStyle(t).color);
686
+ return t.remove(), o;
687
+ }, $e = (e) => Ae(e) ?? Re(e), Ie = (e) => {
695
688
  const t = e / 255;
696
689
  return t <= 0.03928 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
697
690
  }, z = (e) => {
698
- const t = Re(e);
691
+ const t = $e(e);
699
692
  if (t === void 0)
700
693
  return;
701
- const [n, s, r] = t.map(Ie);
702
- return 0.2126 * n + 0.7152 * s + 0.0722 * r;
703
- }, $e = "#181825", De = "#ffffff", Me = "straight", A = 0.5, x = {
694
+ const [o, s, r] = t.map(Ie);
695
+ return 0.2126 * o + 0.7152 * s + 0.0722 * r;
696
+ }, De = "#181825", Me = "#ffffff", Te = "straight", A = 0.5, x = {
704
697
  light: {
705
698
  panel: "#ffffff",
706
699
  side: "#fafbfc",
@@ -719,7 +712,7 @@ const R = {
719
712
  hover: "#242830",
720
713
  thumb: "#2b2f38"
721
714
  }
722
- }, Te = {
715
+ }, _e = {
723
716
  rectangle: {
724
717
  "r-panel": "4px",
725
718
  "r-item": "4px",
@@ -735,109 +728,109 @@ const R = {
735
728
  }, N = (e) => e === void 0 || e.trim() === "" ? void 0 : e.trim(), Oe = (e) => {
736
729
  const t = e === void 0 ? void 0 : z(e);
737
730
  return t === void 0 ? "light" : t < A ? "dark" : "light";
738
- }, _e = (e, t) => {
739
- const n = z(e);
740
- return n === void 0 ? x[t].text : (t === "light" ? n < A : n >= A) ? e : x[t].text;
741
- }, He = (e) => {
742
- const t = Oe(N(e == null ? void 0 : e.backgroundColor)), n = (e == null ? void 0 : e.ctaBorderType) === Me ? "rectangle" : "rectangle-rounded", s = N(e == null ? void 0 : e.primaryColor) ?? $e, r = N(e == null ? void 0 : e.fontFamily), a = {
731
+ }, He = (e, t) => {
732
+ const o = z(e);
733
+ return o === void 0 ? x[t].text : (t === "light" ? o < A : o >= A) ? e : x[t].text;
734
+ }, qe = (e) => {
735
+ const t = Oe(N(e == null ? void 0 : e.backgroundColor)), o = (e == null ? void 0 : e.ctaBorderType) === Te ? "rectangle" : "rectangle-rounded", s = N(e == null ? void 0 : e.primaryColor) ?? De, r = N(e == null ? void 0 : e.fontFamily), a = {
743
736
  ...x[t],
744
- ...Te[n],
737
+ ..._e[o],
745
738
  primary: s,
746
- accent: _e(s, t),
747
- "cta-text": N(e == null ? void 0 : e.ctaTextColor) ?? De,
739
+ accent: He(s, t),
740
+ "cta-text": N(e == null ? void 0 : e.ctaTextColor) ?? Me,
748
741
  ...r === void 0 ? {} : { font: r }
749
742
  };
750
743
  return Object.fromEntries(
751
- Object.entries(a).map(([c, i]) => [`--dso-${c}`, i])
744
+ Object.entries(a).map(([l, i]) => [`--dso-${l}`, i])
752
745
  );
753
- }, qe = (e) => {
754
- const t = b(null), [n, s] = v(void 0), [r, a] = v({ width: 0, height: 0 });
746
+ }, Be = (e) => {
747
+ const t = v(null), [o, s] = C(void 0), [r, a] = C({ width: 0, height: 0 });
755
748
  return V(() => {
756
749
  if (!e)
757
750
  return;
758
- const c = () => {
751
+ const l = () => {
759
752
  const i = t.current;
760
753
  if (i === null)
761
754
  return;
762
- const l = i.previousElementSibling ?? i, { top: u, bottom: p, left: d, width: m } = l.getBoundingClientRect();
755
+ const c = i.previousElementSibling ?? i, { top: h, bottom: p, left: d, width: m } = c.getBoundingClientRect();
763
756
  a(
764
- (g) => g.width === window.innerWidth && g.height === window.innerHeight ? g : { width: window.innerWidth, height: window.innerHeight }
757
+ (u) => u.width === window.innerWidth && u.height === window.innerHeight ? u : { width: window.innerWidth, height: window.innerHeight }
765
758
  ), s(
766
- (g) => g !== void 0 && g.top === u && g.bottom === p && g.left === d && g.width === m ? g : { top: u, bottom: p, left: d, width: m }
759
+ (u) => u !== void 0 && u.top === h && u.bottom === p && u.left === d && u.width === m ? u : { top: h, bottom: p, left: d, width: m }
767
760
  );
768
761
  };
769
- return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
770
- window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
762
+ return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
763
+ window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
771
764
  };
772
- }, [e]), { anchorRef: t, rect: n, viewport: r };
773
- }, Be = (e, t) => {
774
- const [n, s] = v(!1), r = b(null), a = e.status !== L.IDLE && !n;
775
- return f(() => {
765
+ }, [e]), { anchorRef: t, rect: o, viewport: r };
766
+ }, je = (e, t) => {
767
+ const [o, s] = C(!1), r = v(null), a = e.status !== L.IDLE && !o;
768
+ return b(() => {
776
769
  s(!1);
777
- }, [e.query]), f(() => {
770
+ }, [e.query]), b(() => {
778
771
  if (!a)
779
772
  return;
780
- const c = (i) => {
781
- var m, g;
782
- const l = i.target;
783
- if (!(l instanceof Node))
773
+ const l = (i) => {
774
+ var m, u;
775
+ const c = i.target;
776
+ if (!(c instanceof Node))
784
777
  return;
785
- const u = (m = t.current) == null ? void 0 : m.previousElementSibling, p = ((g = r.current) == null ? void 0 : g.contains(l)) ?? !1, d = (u == null ? void 0 : u.contains(l)) ?? !1;
778
+ const h = (m = t.current) == null ? void 0 : m.previousElementSibling, p = ((u = r.current) == null ? void 0 : u.contains(c)) ?? !1, d = (h == null ? void 0 : h.contains(c)) ?? !1;
786
779
  !p && !d && s(!0);
787
780
  };
788
- return document.addEventListener("pointerdown", c), () => document.removeEventListener("pointerdown", c);
789
- }, [a, t]), f(() => {
790
- var l;
791
- const c = (l = t.current) == null ? void 0 : l.previousElementSibling;
792
- if (c == null)
781
+ return document.addEventListener("pointerdown", l), () => document.removeEventListener("pointerdown", l);
782
+ }, [a, t]), b(() => {
783
+ var c;
784
+ const l = (c = t.current) == null ? void 0 : c.previousElementSibling;
785
+ if (l == null)
793
786
  return;
794
787
  const i = () => s(!1);
795
- return c.addEventListener("focusin", i), () => c.removeEventListener("focusin", i);
788
+ return l.addEventListener("focusin", i), () => l.removeEventListener("focusin", i);
796
789
  }, [t]), { isOpen: a, panelRef: r };
797
- }, je = (e) => e instanceof Q ? `Search failed (${e.status}${e.code ? ` ${e.code}` : ""}): ${e.message}` : "Search failed: network error. Check your connection and try again.", ze = (e, t) => {
798
- var m, g;
799
- const { controller: n, state: s, locale: r, seeAllHref: a } = e, { status: c, response: i } = s;
800
- if (c === L.ERROR)
801
- return /* @__PURE__ */ h("div", { className: "dialog-search-error", children: [
802
- /* @__PURE__ */ o(
790
+ }, ze = (e) => e instanceof Z ? `Search failed (${e.status}${e.code ? ` ${e.code}` : ""}): ${e.message}` : "Search failed: network error. Check your connection and try again.", Ve = (e, t) => {
791
+ var m, u;
792
+ const { controller: o, state: s, locale: r, seeAllHref: a } = e, { status: l, response: i } = s;
793
+ if (l === L.ERROR)
794
+ return /* @__PURE__ */ g("div", { className: "dialog-search-error", children: [
795
+ /* @__PURE__ */ n(
803
796
  "p",
804
797
  {
805
798
  role: "alert",
806
799
  className: "dialog-search-status dialog-search-status-error",
807
- children: je(s.error)
800
+ children: ze(s.error)
808
801
  }
809
802
  ),
810
- /* @__PURE__ */ o(
803
+ /* @__PURE__ */ n(
811
804
  "button",
812
805
  {
813
806
  type: "button",
814
807
  className: "dialog-search-retry",
815
- onClick: () => n.retry(),
808
+ onClick: () => o.retry(),
816
809
  children: t.retry
817
810
  }
818
811
  )
819
812
  ] });
820
813
  if (i === void 0)
821
- return /* @__PURE__ */ o("p", { role: "status", className: "dialog-search-status", children: t.searching(s.query) });
822
- const l = ((g = (m = s.sections) == null ? void 0 : m.collections) == null ? void 0 : g.hits) ?? [], u = j(l).length > 0, p = a !== void 0 && i.nbHits > 0, d = !p && _(s);
823
- return /* @__PURE__ */ h(C, { children: [
824
- /* @__PURE__ */ h(
814
+ return /* @__PURE__ */ n("p", { role: "status", className: "dialog-search-status", children: t.searching(s.query) });
815
+ const c = ((u = (m = s.sections) == null ? void 0 : m.collections) == null ? void 0 : u.hits) ?? [], h = j(c).length > 0, p = a !== void 0 && i.nbHits > 0, d = !p && O(s);
816
+ return /* @__PURE__ */ g(S, { children: [
817
+ /* @__PURE__ */ g(
825
818
  "div",
826
819
  {
827
- className: `dialog-search-body${u ? "" : " dialog-search-body--no-collections"}`,
820
+ className: `dialog-search-body${h ? "" : " dialog-search-body--no-collections"}`,
828
821
  children: [
829
- /* @__PURE__ */ o(
822
+ /* @__PURE__ */ n(
830
823
  ye,
831
824
  {
832
- collections: l,
825
+ collections: c,
833
826
  query: i.query,
834
827
  messages: t
835
828
  }
836
829
  ),
837
- /* @__PURE__ */ o(
838
- Se,
830
+ /* @__PURE__ */ n(
831
+ we,
839
832
  {
840
- controller: n,
833
+ controller: o,
841
834
  response: i,
842
835
  locale: r,
843
836
  messages: t
@@ -846,106 +839,107 @@ const R = {
846
839
  ]
847
840
  }
848
841
  ),
849
- (p || d) && /* @__PURE__ */ o("div", { className: "dialog-search-footer", children: p ? /* @__PURE__ */ h("a", { className: "dialog-search-cta", href: a(i.query), children: [
842
+ (p || d) && /* @__PURE__ */ n("div", { className: "dialog-search-footer", children: p ? /* @__PURE__ */ g("a", { className: "dialog-search-cta", href: a(i.query), children: [
850
843
  t.seeAllLabel(i.nbHits),
851
- /* @__PURE__ */ o(ve, {})
852
- ] }) : /* @__PURE__ */ o(
853
- he,
844
+ /* @__PURE__ */ n(Ce, {})
845
+ ] }) : /* @__PURE__ */ n(
846
+ pe,
854
847
  {
855
- controller: n,
848
+ controller: o,
856
849
  state: s,
857
850
  locale: r
858
851
  }
859
852
  ) })
860
853
  ] });
861
- }, Ge = (e) => {
862
- const { state: t, locale: n, theme: s, layout: r = "list" } = e, a = t.status !== L.IDLE, { anchorRef: c, rect: i, viewport: l } = qe(a), { isOpen: u, panelRef: p } = Be(t, c), d = O(n), m = S(
863
- () => He(s),
854
+ }, Ye = (e) => {
855
+ const { state: t, locale: o, theme: s, layout: r = "list" } = e, a = t.status !== L.IDLE, { anchorRef: l, rect: i, viewport: c } = Be(a), { isOpen: h, panelRef: p } = je(t, l), d = _(o), m = y(
856
+ () => qe(s),
864
857
  [s]
865
858
  );
866
- return /* @__PURE__ */ h(C, { children: [
867
- /* @__PURE__ */ o("div", { ref: c }),
868
- u && i !== void 0 && ke(i, l.height) && Z(
869
- /* @__PURE__ */ o(
859
+ return /* @__PURE__ */ g(S, { children: [
860
+ /* @__PURE__ */ n("div", { ref: l }),
861
+ h && i !== void 0 && Ne(i, c.height) && G(
862
+ /* @__PURE__ */ n(
870
863
  "div",
871
864
  {
872
865
  ref: p,
873
866
  className: `dialog-search-panel dialog-search-panel--${r}`,
874
867
  style: {
875
- ...Ee(i, l.width, l.height),
868
+ ...Pe(i, c.width, c.height),
876
869
  ...m
877
870
  },
878
- children: ze(e, d)
871
+ children: Ve(e, d)
879
872
  }
880
873
  ),
881
874
  document.body
882
875
  )
883
876
  ] });
884
- }, Ve = {
877
+ }, Ke = {
885
878
  status: L.IDLE,
886
879
  query: "",
887
880
  page: 0
888
- }, Ye = (e) => {
889
- const t = b(e);
881
+ }, Je = (e) => {
882
+ const t = v(e);
890
883
  t.current = e;
891
- const n = b(void 0), s = P(() => {
892
- if (n.current === void 0) {
893
- const { client: l, surface: u = "search_page", ...p } = t.current;
894
- n.current = W({
895
- search: (d, m) => l.search(d, m),
884
+ const o = v(void 0), s = P(() => {
885
+ if (o.current === void 0) {
886
+ const { client: c, surface: h = "search_page", ...p } = t.current;
887
+ o.current = X({
888
+ search: (d, m) => c.search(d, m),
896
889
  analytics: {
897
- surface: u,
898
- trackViewSearchResults: (d) => l.trackViewSearchResults(d),
899
- trackSelectSearchResult: (d) => l.trackSelectSearchResult(d)
890
+ surface: h,
891
+ trackViewSearchResults: (d) => c.trackViewSearchResults(d),
892
+ trackSelectSearchResult: (d) => c.trackSelectSearchResult(d)
900
893
  },
901
894
  ...p
902
895
  });
903
896
  }
904
- return n.current;
905
- }, []), r = b(void 0);
897
+ return o.current;
898
+ }, []), r = v(void 0);
906
899
  r.current ?? (r.current = {
907
- setQuery: (l) => s().setQuery(l),
908
- submit: (l) => s().submit(l),
909
- setPage: (l) => s().setPage(l),
900
+ setQuery: (c) => s().setQuery(c),
901
+ submit: (c) => s().submit(c),
902
+ setPage: (c) => s().setPage(c),
910
903
  retry: () => s().retry(),
911
- observeResult: (l, u) => s().observeResult(l, u),
912
- selectResult: (l, u) => s().selectResult(l, u),
913
- subscribe: (l) => s().subscribe(l),
904
+ observeResult: (c, h) => s().observeResult(c, h),
905
+ selectResult: (c, h) => s().selectResult(c, h),
906
+ productUrl: (c) => s().productUrl(c),
907
+ subscribe: (c) => s().subscribe(c),
914
908
  getState: () => s().getState(),
915
909
  // Create a replacement on next access after disposal.
916
910
  dispose: () => {
917
- var l;
918
- (l = n.current) == null || l.dispose(), n.current = void 0;
911
+ var c;
912
+ (c = o.current) == null || c.dispose(), o.current = void 0;
919
913
  }
920
- }), f(() => {
914
+ }), b(() => {
921
915
  M({
922
916
  method: "react",
923
- version: "2.8.0"
917
+ version: "2.10.0"
924
918
  });
925
- const l = s();
919
+ const c = s();
926
920
  return () => {
927
- l.dispose(), n.current === l && (n.current = void 0);
921
+ c.dispose(), o.current === c && (o.current = void 0);
928
922
  };
929
923
  }, [s]);
930
924
  const a = P(
931
- (l) => s().subscribe(l),
925
+ (c) => s().subscribe(c),
932
926
  [s]
933
- ), c = P(
927
+ ), l = P(
934
928
  () => s().getState(),
935
929
  [s]
936
930
  ), i = K(
937
931
  a,
938
- c,
939
- () => Ve
932
+ l,
933
+ () => Ke
940
934
  );
941
935
  return { controller: r.current, state: i, theme: e.client.theme };
942
936
  };
943
937
  export {
944
- ne as DialogInput,
945
- Ze as DialogProductBlock,
946
- Xe as DialogSearchBar,
947
- he as DialogSearchPagination,
948
- be as DialogSearchProductCard,
949
- Ge as DialogSearchResults,
950
- Ye as useDialogSearch
938
+ re as DialogInput,
939
+ Xe as DialogProductBlock,
940
+ Ge as DialogSearchBar,
941
+ pe as DialogSearchPagination,
942
+ ve as DialogSearchProductCard,
943
+ Ye as DialogSearchResults,
944
+ Je as useDialogSearch
951
945
  };