@askdialog/dialog-vue 3.5.0 → 3.6.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,33 +1,33 @@
1
- var re = Object.defineProperty;
2
- var ie = (t, e, o) => e in t ? re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var F = (t, e, o) => ie(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { defineComponent as w, createElementBlock as m, openBlock as _, createElementVNode as d, toDisplayString as R, Fragment as O, renderList as Z, createVNode as A, createBlock as x, ref as y, withDirectives as J, withKeys as ae, vModelText as ee, onMounted as K, watch as U, renderSlot as ce, computed as T, withCtx as le, createCommentVNode as M, withModifiers as de, onUnmounted as te, Teleport as ue, normalizeStyle as pe, unref as V, shallowRef as _e } from "vue";
5
- const he = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur"]), fe = (t) => t !== void 0 && he.has(t.trim().toLowerCase().slice(0, 2)), ge = (t) => fe(t) ? "rtl" : "ltr", ve = (t) => {
6
- try {
7
- return new Intl.Locale(t).language;
8
- } catch {
9
- return t;
10
- }
11
- };
12
- var N;
1
+ var ae = Object.defineProperty;
2
+ var ce = (t, e, o) => e in t ? ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
+ var H = (t, e, o) => ce(t, typeof e != "symbol" ? e + "" : e, o);
4
+ import { defineComponent as R, createElementBlock as v, openBlock as _, createElementVNode as u, toDisplayString as k, Fragment as N, renderList as ee, createVNode as L, createBlock as O, ref as $, withDirectives as te, withKeys as le, vModelText as oe, onMounted as V, watch as U, renderSlot as de, computed as T, withCtx as ue, createCommentVNode as M, withModifiers as pe, onUnmounted as se, Teleport as _e, normalizeStyle as he, unref as q, shallowRef as fe } from "vue";
5
+ const ge = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur"]), ve = (t) => t !== void 0 && ge.has(t.trim().toLowerCase().slice(0, 2)), me = (t) => ve(t) ? "rtl" : "ltr";
6
+ var x;
13
7
  (function(t) {
14
8
  t.OPEN_ASSISTANT = "open_assistant", t.CLOSE_ASSISTANT = "close_assistant", t.SEND_MESSAGE = "PRODUCT_QUESTION", t.SEND_GENERIC_QUESTION = "GENERIC_QUESTION", t.TRACK_ADD_TO_CART = "TRACK_ADD_TO_CART", t.TRACK_SUBMIT_CHECKOUT = "TRACK_SUBMIT_CHECKOUT", t.TRACK_VIEW_SEARCH_RESULTS = "TRACK_VIEW_SEARCH_RESULTS", t.TRACK_SELECT_SEARCH_RESULT = "TRACK_SELECT_SEARCH_RESULT";
15
- })(N || (N = {}));
16
- var j;
9
+ })(x || (x = {}));
10
+ var z;
17
11
  (function(t) {
18
12
  t.USER_OPENED_ASSISTANT = "userOpenedAssistant", t.USER_CLOSED_ASSISTANT = "userClosedAssistant", t.USER_SENT_MESSAGE = "userSentMessage", t.USER_CLICKED_ON_PRODUCT_CARD = "userClickedOnProductCard", t.USER_OPENED_RECOMMENDATION = "userOpenedRecommendation", t.USER_ADDED_TO_CART = "userAddedToCart", t.USER_SEND_POSITIVE_FEEDBACK = "userSendPositiveFeedback", t.USER_SEND_NEGATIVE_FEEDBACK = "userSendNegativeFeedback";
19
- })(j || (j = {}));
20
- N.TRACK_ADD_TO_CART, N.TRACK_SUBMIT_CHECKOUT, N.TRACK_VIEW_SEARCH_RESULTS, N.TRACK_SELECT_SEARCH_RESULT;
21
- class me extends Error {
22
- constructor({ status: o, code: n, message: a }) {
23
- super(a);
24
- F(this, "status");
25
- F(this, "code");
26
- this.name = "DialogSearchError", this.status = o, this.code = n;
13
+ })(z || (z = {}));
14
+ x.TRACK_ADD_TO_CART, x.TRACK_SUBMIT_CHECKOUT, x.TRACK_VIEW_SEARCH_RESULTS, x.TRACK_SELECT_SEARCH_RESULT;
15
+ class Se extends Error {
16
+ constructor({ status: o, code: s, message: i }) {
17
+ super(i);
18
+ H(this, "status");
19
+ H(this, "code");
20
+ this.name = "DialogSearchError", this.status = o, this.code = s;
27
21
  }
28
22
  }
29
- const Se = (t, e) => `${t}_${ve(e)}`, Q = "multiple installation methods detected:", Ce = () => typeof window > "u" ? void 0 : window, oe = () => {
30
- const t = Ce();
23
+ const j = (t, e, o) => {
24
+ if (!/^[a-z]{2}$/.test(e))
25
+ throw new Error("Search language must be a lowercase ISO 639-1 code.");
26
+ if (!/^[A-Za-z]{3}$/.test(o))
27
+ throw new Error("Search currency must be an ISO 4217 code.");
28
+ return `${t}_${e}_${o.toLowerCase()}`;
29
+ }, W = "multiple installation methods detected:", be = () => typeof window > "u" ? void 0 : window, ne = () => {
30
+ const t = be();
31
31
  if (t !== void 0)
32
32
  return t.dialog = t.dialog ?? {}, t.dialog.audit = t.dialog.audit ?? {
33
33
  methods: [],
@@ -35,228 +35,264 @@ const Se = (t, e) => `${t}_${ve(e)}`, Q = "multiple installation methods detecte
35
35
  capabilities: [],
36
36
  warnings: []
37
37
  }, t.dialog.audit;
38
- }, be = (t) => {
39
- if (t.warnings = t.warnings.filter((e) => !e.startsWith(Q)), t.methods.length >= 2) {
38
+ }, Ce = (t) => {
39
+ if (t.warnings = t.warnings.filter((e) => !e.startsWith(W)), t.methods.length >= 2) {
40
40
  const e = t.methods.map((o) => o.method).join(", ");
41
- t.warnings.push(`${Q} ${e}`);
41
+ t.warnings.push(`${W} ${e}`);
42
42
  }
43
43
  }, Ee = (t, e) => e === void 0 ? t : {
44
44
  version: (t == null ? void 0 : t.version) ?? e.version,
45
45
  commit: (t == null ? void 0 : t.commit) ?? e.commit
46
- }, ne = (t) => {
47
- const e = oe();
46
+ }, re = (t) => {
47
+ const e = ne();
48
48
  if (e === void 0)
49
49
  return;
50
- const o = e.methods.find((n) => n.method === t.method);
50
+ const o = e.methods.find((s) => s.method === t.method);
51
51
  if (o === void 0) {
52
- e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }), be(e);
52
+ e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }), Ce(e);
53
53
  return;
54
54
  }
55
55
  o.version = o.version ?? t.version, o.build = Ee(o.build, t.build), o.source = o.source ?? t.source;
56
- }, Ie = (t) => {
57
- const e = oe();
56
+ }, we = (t) => {
57
+ const e = ne();
58
58
  e !== void 0 && (e.capabilities.includes(t) || e.capabilities.push(t));
59
- }, k = {
59
+ }, y = {
60
60
  IDLE: "idle",
61
61
  LOADING: "loading",
62
62
  SUCCESS: "success",
63
- /** The request succeeded with zero hits — distinct from `success` so views render a no-results state. */
63
+ /** Successful request with zero hits. */
64
64
  EMPTY: "empty",
65
65
  ERROR: "error"
66
- }, we = 0.5, Te = 500, Re = 1500, ke = 100;
67
- function ye({ emit: t, visibilityThreshold: e = we, dwellMs: o = Te, idleFlushMs: n = Re, maxItemsPerEvent: a = ke }) {
68
- let s, r = [];
69
- const i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
70
- let u;
71
- const p = () => {
72
- clearTimeout(u), !(s === void 0 || r.length === 0) && (t({ ...s, items: r }), r = []);
66
+ }, Ie = 0.5, Re = 500, Te = 1500, ke = 100;
67
+ function ye({ emit: t, visibilityThreshold: e = Ie, dwellMs: o = Re, idleFlushMs: s = Te, maxItemsPerEvent: i = ke }) {
68
+ let r, n = [];
69
+ const a = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
70
+ let l;
71
+ const h = () => {
72
+ clearTimeout(l), !(r === void 0 || n.length === 0) && (t({ ...r, items: n }), n = []);
73
73
  }, S = (f) => {
74
- if (s === void 0)
74
+ if (r === void 0)
75
75
  return;
76
- const C = `${s.query_id}:${f.product_id}`;
77
- if (!i.has(C)) {
78
- if (i.add(C), r.push(f), r.length >= a) {
79
- p();
76
+ const g = `${r.query_id}:${f.product_id}`;
77
+ if (!a.has(g)) {
78
+ if (a.add(g), n.push(f), n.length >= i) {
79
+ h();
80
80
  return;
81
81
  }
82
- clearTimeout(u), u = setTimeout(p, n);
82
+ clearTimeout(l), l = setTimeout(h, s);
83
83
  }
84
- }, E = (f) => {
85
- const C = h.get(f);
86
- C !== void 0 && (clearTimeout(C), h.delete(f));
87
- }, c = new IntersectionObserver((f) => {
88
- for (const C of f) {
89
- const g = l.get(C.target);
90
- g !== void 0 && (C.intersectionRatio >= e ? h.has(C.target) || h.set(C.target, setTimeout(() => {
91
- h.delete(C.target), S(g);
92
- }, o)) : E(C.target));
84
+ }, w = (f) => {
85
+ const g = c.get(f);
86
+ g !== void 0 && (clearTimeout(g), c.delete(f));
87
+ }, d = new IntersectionObserver((f) => {
88
+ for (const g of f) {
89
+ const m = p.get(g.target);
90
+ m !== void 0 && (g.intersectionRatio >= e ? c.has(g.target) || c.set(g.target, setTimeout(() => {
91
+ c.delete(g.target), S(m);
92
+ }, o)) : w(g.target));
93
93
  }
94
94
  }, { threshold: e }), b = () => {
95
- c.disconnect();
96
- for (const f of h.values())
95
+ d.disconnect();
96
+ for (const f of c.values())
97
97
  clearTimeout(f);
98
- h.clear(), l.clear();
99
- }, I = () => {
100
- p();
101
- }, L = (f) => {
98
+ c.clear(), p.clear();
99
+ }, C = () => {
100
+ h();
101
+ }, I = (f) => {
102
102
  if (f.persisted) {
103
- i.clear();
104
- for (const C of l.keys())
105
- E(C), c.unobserve(C), c.observe(C);
103
+ a.clear();
104
+ for (const g of p.keys())
105
+ w(g), d.unobserve(g), d.observe(g);
106
106
  }
107
107
  };
108
- return window.addEventListener("pagehide", I), window.addEventListener("pageshow", L), {
108
+ return window.addEventListener("pagehide", C), window.addEventListener("pageshow", I), {
109
109
  setContext(f) {
110
- p(), i.clear(), s = f, b();
110
+ h(), a.clear(), r = f, b();
111
111
  },
112
- observe(f, C) {
113
- l.set(f, C), c.observe(f);
112
+ observe(f, g) {
113
+ p.set(f, g), d.observe(f);
114
114
  },
115
115
  forceImpression(f) {
116
- S(f), p();
116
+ S(f), h();
117
117
  },
118
- flush: p,
118
+ flush: h,
119
119
  disconnect() {
120
- p(), b(), window.removeEventListener("pagehide", I), window.removeEventListener("pageshow", L);
120
+ h(), b(), window.removeEventListener("pagehide", C), window.removeEventListener("pageshow", I);
121
121
  }
122
122
  };
123
123
  }
124
- const W = (t, e) => ({
124
+ const Y = (t, e) => ({
125
125
  product_id: t.hits[e].objectID,
126
- // 1-based and absolute across pages (page 2, first item, 20/page → 21).
126
+ // One-based position across all pages.
127
127
  position: t.page * t.hitsPerPage + e + 1
128
128
  });
129
- function Le(t) {
129
+ function $e(t) {
130
130
  let e, o;
131
- const n = () => (e ?? (e = ye({
131
+ const s = () => (e ?? (e = ye({
132
132
  emit: t.trackViewSearchResults
133
133
  })), e);
134
134
  return {
135
- onResponse(a) {
135
+ onResponse(i) {
136
136
  o = {
137
- query_id: a.queryID,
138
- index: a.index,
137
+ query_id: i.queryID,
138
+ index: i.index,
139
139
  surface: t.surface,
140
- // The storefront search API is lexical-only today.
141
140
  search_type: "lexical",
142
- // Analytics pages are 1-based; the wire response is 0-based.
143
- page: a.page + 1,
144
- total_hits: a.nbHits,
145
- query_length: [...a.query].length
146
- }, n().setContext(o), a.nbHits === 0 && t.trackViewSearchResults({ ...o, items: [] });
141
+ // Convert the API page to one-based analytics numbering.
142
+ page: i.page + 1,
143
+ total_hits: i.nbHits,
144
+ query_length: [...i.query].length
145
+ }, s().setContext(o), i.nbHits === 0 && t.trackViewSearchResults({ ...o, items: [] });
147
146
  },
148
- observeResult(a, s, r) {
149
- n().observe(a, W(s, r));
147
+ observeResult(i, r, n) {
148
+ s().observe(i, Y(r, n));
150
149
  },
151
- select(a, s) {
150
+ select(i, r) {
152
151
  if (o === void 0)
153
152
  return;
154
- const r = W(a, s);
155
- n().forceImpression(r), t.trackSelectSearchResult({ ...o, items: [r] });
153
+ const n = Y(i, r);
154
+ s().forceImpression(n), t.trackSelectSearchResult({ ...o, items: [n] });
156
155
  },
157
156
  dispose() {
158
157
  e == null || e.disconnect();
159
158
  }
160
159
  };
161
160
  }
162
- const Ae = 250, $e = 12, De = 2, Y = {
163
- status: k.IDLE,
161
+ const Ae = 2, X = (t) => {
162
+ const e = t.trim();
163
+ return [...e].length >= Ae ? e : void 0;
164
+ }, Le = (t, e, o, { indexName: s, language: i, currency: r, hitsPerPage: n }) => ({
165
+ requests: [
166
+ { indexName: s, query: t, page: e, hitsPerPage: n },
167
+ ...o.map((a) => ({
168
+ indexName: j(a.index, i, r),
169
+ query: t,
170
+ page: 0,
171
+ hitsPerPage: a.hitsPerPage ?? n
172
+ }))
173
+ ]
174
+ }), De = (t, e, { indexName: o, language: s, currency: i }) => {
175
+ const r = t.results.find((a) => a.index === o);
176
+ if (r === void 0)
177
+ throw new Error(`Dialog search returned no ${o} entry`);
178
+ const n = {};
179
+ for (const a of e) {
180
+ const p = j(a.index, s, i), c = t.results.find((l) => l.index === p);
181
+ c !== void 0 && (n[a.index] = c);
182
+ }
183
+ return {
184
+ response: r,
185
+ sections: e.length === 0 ? void 0 : n
186
+ };
187
+ }, F = {
188
+ status: y.IDLE,
164
189
  query: "",
165
190
  page: 0,
166
191
  response: void 0,
192
+ sections: void 0,
167
193
  error: void 0
168
194
  };
169
- function Pe({ search: t, analytics: e, navigate: o, debounceMs: n = Ae, hitsPerPage: a = $e, locale: s }) {
170
- const r = Se("products", s);
171
- let i = Y;
172
- const l = /* @__PURE__ */ new Set(), h = Le(e);
173
- let u, p, S, E = 0, c = !1;
174
- const b = (g) => {
175
- i = { ...i, ...g };
176
- for (const v of l)
177
- v(i);
178
- }, I = () => {
179
- clearTimeout(u), S == null || S.abort(), S = void 0;
180
- }, L = (g, v) => ({
181
- requests: [{ indexName: r, query: g, page: v, hitsPerPage: a }]
182
- }), f = async (g, v) => {
183
- I(), S = new AbortController();
184
- const $ = ++E, q = L(g, v);
185
- b({ status: k.LOADING, query: g, page: v });
195
+ function Pe({ search: t, language: e, currency: o, analytics: s, navigate: i, debounceMs: r = 250, hitsPerPage: n = 12, sections: a = [] }) {
196
+ const p = {
197
+ indexName: j("products", e, o),
198
+ language: e,
199
+ currency: o,
200
+ hitsPerPage: n
201
+ };
202
+ let c = F;
203
+ const l = /* @__PURE__ */ new Set(), h = $e(s);
204
+ let S, w, d, b = 0, C = !1;
205
+ const I = (m) => {
206
+ c = { ...c, ...m };
207
+ for (const E of l)
208
+ E(c);
209
+ }, f = () => {
210
+ clearTimeout(S), w = void 0, b += 1, d == null || d.abort(), d = void 0;
211
+ }, g = async (m, E) => {
212
+ f(), d = new AbortController();
213
+ const D = b;
214
+ I({ status: y.LOADING, query: m, page: E });
186
215
  try {
187
- const P = await t(q, {
188
- signal: S.signal
216
+ const A = typeof a == "function" ? a() : a, Q = Le(m, E, A, p), ie = await t(Q, {
217
+ signal: d.signal
189
218
  });
190
- if ($ !== E)
219
+ if (D !== b)
191
220
  return;
192
- const B = P.results.find((se) => se.index === r);
193
- if (B === void 0)
194
- throw new Error(`Dialog search returned no ${r} entry`);
195
- h.onResponse(B), b({
196
- status: B.nbHits === 0 ? k.EMPTY : k.SUCCESS,
197
- response: B,
221
+ const K = De(ie, A, p);
222
+ h.onResponse(K.response), I({
223
+ ...K,
224
+ status: K.response.nbHits === 0 ? y.EMPTY : y.SUCCESS,
198
225
  error: void 0
199
226
  });
200
- } catch (P) {
201
- if (P instanceof DOMException && P.name === "AbortError" || $ !== E)
227
+ } catch (A) {
228
+ if (A instanceof DOMException && A.name === "AbortError" || D !== b)
202
229
  return;
203
- b({ status: k.ERROR, error: P, response: void 0 });
204
- }
205
- }, C = (g) => {
206
- const v = g.trim();
207
- if (I(), p = void 0, [...v].length < De) {
208
- E += 1, b(Y);
209
- return;
230
+ I({
231
+ status: y.ERROR,
232
+ error: A,
233
+ response: void 0,
234
+ sections: void 0
235
+ });
210
236
  }
211
- return v;
212
237
  };
213
238
  return {
214
- setQuery(g) {
215
- const v = c ? void 0 : C(g);
216
- v !== void 0 && (p = v, u = setTimeout(() => {
217
- p = void 0, f(v, 0);
218
- }, n));
239
+ setQuery(m) {
240
+ if (C)
241
+ return;
242
+ f();
243
+ const E = X(m);
244
+ if (E === void 0) {
245
+ I(F);
246
+ return;
247
+ }
248
+ w = E, S = setTimeout(() => void g(E, 0), r);
219
249
  },
220
- submit(g) {
221
- const v = c ? void 0 : C(g);
222
- v !== void 0 && f(v, 0);
250
+ submit(m) {
251
+ if (C)
252
+ return;
253
+ f();
254
+ const E = X(m);
255
+ if (E === void 0) {
256
+ I(F);
257
+ return;
258
+ }
259
+ g(E, 0);
223
260
  },
224
- setPage(g) {
225
- if (!c) {
226
- if (p !== void 0) {
227
- const v = p;
228
- p = void 0, f(v, 0);
261
+ setPage(m) {
262
+ if (!C) {
263
+ if (w !== void 0) {
264
+ g(w, 0);
229
265
  return;
230
266
  }
231
- i.query !== "" && f(i.query, g);
267
+ c.query !== "" && g(c.query, m);
232
268
  }
233
269
  },
234
270
  retry() {
235
- c || i.status !== k.ERROR || f(i.query, i.page);
271
+ C || c.status !== y.ERROR || g(c.query, c.page);
236
272
  },
237
- observeResult(g, v) {
238
- i.response !== void 0 && h.observeResult(g, i.response, v);
273
+ observeResult(m, E) {
274
+ c.response !== void 0 && h.observeResult(m, c.response, E);
239
275
  },
240
- selectResult(g, v) {
241
- const $ = i.response;
242
- if ($ === void 0)
276
+ selectResult(m, E) {
277
+ const D = c.response;
278
+ if (D === void 0)
243
279
  return !1;
244
- h.select($, g);
245
- const q = $.hits[g].url;
246
- return ((v == null ? void 0 : v.navigate) ?? !0) && o !== void 0 && q !== void 0 ? (o(q, $.hits[g]), !0) : !1;
280
+ h.select(D, m);
281
+ const A = D.hits[m].url;
282
+ return ((E == null ? void 0 : E.navigate) ?? !0) && i !== void 0 && A !== void 0 ? (i(A, D.hits[m]), !0) : !1;
247
283
  },
248
- subscribe(g) {
249
- return l.add(g), () => {
250
- l.delete(g);
284
+ subscribe(m) {
285
+ return l.add(m), () => {
286
+ l.delete(m);
251
287
  };
252
288
  },
253
- getState: () => i,
289
+ getState: () => c,
254
290
  dispose() {
255
- c = !0, I(), E += 1, p = void 0, l.clear(), h.dispose();
291
+ C = !0, f(), l.clear(), h.dispose();
256
292
  }
257
293
  };
258
294
  }
259
- const Ne = { class: "dialog-block-header-container" }, Oe = { class: "dialog-block-title" }, xe = { class: "dialog-block-description" }, Ue = /* @__PURE__ */ w({
295
+ const xe = { class: "dialog-block-header-container" }, Ne = { class: "dialog-block-title" }, Oe = { class: "dialog-block-description" }, Ue = /* @__PURE__ */ R({
260
296
  __name: "DialogBlockHeader",
261
297
  props: {
262
298
  title: {},
@@ -264,32 +300,32 @@ const Ne = { class: "dialog-block-header-container" }, Oe = { class: "dialog-blo
264
300
  },
265
301
  setup(t) {
266
302
  const e = t;
267
- return (o, n) => (_(), m("div", Ne, [
268
- d("div", Oe, R(e.title ?? "Your expert"), 1),
269
- d("div", xe, R(e.description ?? "A question about this product?"), 1)
303
+ return (o, s) => (_(), v("div", xe, [
304
+ u("div", Ne, k(e.title ?? "Your expert"), 1),
305
+ u("div", Oe, k(e.description ?? "A question about this product?"), 1)
270
306
  ]));
271
307
  }
272
- }), D = (t, e) => {
308
+ }), P = (t, e) => {
273
309
  const o = t.__vccOpts || t;
274
- for (const [n, a] of e)
275
- o[n] = a;
310
+ for (const [s, i] of e)
311
+ o[s] = i;
276
312
  return o;
277
- }, Me = /* @__PURE__ */ D(Ue, [["__scopeId", "data-v-28e6dda7"]]), qe = {
313
+ }, Me = /* @__PURE__ */ P(Ue, [["__scopeId", "data-v-28e6dda7"]]), qe = {
278
314
  width: "20",
279
315
  height: "20",
280
316
  viewBox: "0 0 20 20",
281
317
  fill: "none",
282
318
  xmlns: "http://www.w3.org/2000/svg"
283
- }, Be = { "clip-path": "url(#clip0_466_934)" }, Ve = ["stroke"], He = ["stroke"], Ke = /* @__PURE__ */ w({
319
+ }, Be = { "clip-path": "url(#clip0_466_934)" }, Ve = ["stroke"], Ke = ["stroke"], He = /* @__PURE__ */ R({
284
320
  __name: "AiStarsIcon",
285
321
  props: {
286
322
  color: {}
287
323
  },
288
324
  setup(t) {
289
325
  const e = t;
290
- return (o, n) => (_(), m("svg", qe, [
291
- d("g", Be, [
292
- d("path", {
326
+ return (o, s) => (_(), v("svg", qe, [
327
+ u("g", Be, [
328
+ u("path", {
293
329
  d: `M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
294
330
  12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684
295
331
  13.7084 7.85932 13.9296L9.16675 14.5833L7.85932 15.237C7.41684 15.4583 7.19559
@@ -305,7 +341,7 @@ const Ne = { class: "dialog-block-header-container" }, Oe = { class: "dialog-blo
305
341
  "stroke-linecap": "round",
306
342
  "stroke-linejoin": "round"
307
343
  }, null, 8, Ve),
308
- d("path", {
344
+ u("path", {
309
345
  d: `M12.5001 1.66666L13.4823 4.22034C13.7173 4.83136 13.8348 5.13688 14.0175
310
346
  5.39386C14.1795 5.62162 14.3785 5.82061 14.6062 5.98256C14.8632 6.16529 15.1687
311
347
  6.2828 15.7797 6.5178L18.3334 7.49999L15.7797 8.48217C15.1687 8.71718 14.8632
@@ -320,11 +356,11 @@ const Ne = { class: "dialog-block-header-container" }, Oe = { class: "dialog-blo
320
356
  "stroke-width": "1.5",
321
357
  "stroke-linecap": "round",
322
358
  "stroke-linejoin": "round"
323
- }, null, 8, He)
359
+ }, null, 8, Ke)
324
360
  ]),
325
- n[0] || (n[0] = d("defs", null, [
326
- d("clipPath", { id: "clip0_466_934" }, [
327
- d("rect", {
361
+ s[0] || (s[0] = u("defs", null, [
362
+ u("clipPath", { id: "clip0_466_934" }, [
363
+ u("rect", {
328
364
  width: "20",
329
365
  height: "20",
330
366
  fill: "white"
@@ -333,7 +369,7 @@ const Ne = { class: "dialog-block-header-container" }, Oe = { class: "dialog-blo
333
369
  ], -1))
334
370
  ]));
335
371
  }
336
- }), Fe = ["onClick"], Ge = { class: "dialog-block-suggestions-item-label" }, je = /* @__PURE__ */ w({
372
+ }), Fe = ["onClick"], Ge = { class: "dialog-block-suggestions-item-label" }, je = /* @__PURE__ */ R({
337
373
  __name: "DialogBlockSuggestions",
338
374
  props: {
339
375
  client: {},
@@ -343,36 +379,36 @@ const Ne = { class: "dialog-block-header-container" }, Oe = { class: "dialog-blo
343
379
  selectedVariantId: {}
344
380
  },
345
381
  setup(t) {
346
- const e = t, o = (n) => {
382
+ const e = t, o = (s) => {
347
383
  e.client.sendProductMessage({
348
384
  productId: e.productId,
349
385
  productTitle: e.productTitle,
350
386
  selectedVariantId: e.selectedVariantId,
351
- question: n,
387
+ question: s,
352
388
  fromQuestionSuggestion: !0
353
389
  });
354
390
  };
355
- return (n, a) => (_(!0), m(O, null, Z(e.questions, (s) => (_(), m("button", {
356
- key: s.question,
391
+ return (s, i) => (_(!0), v(N, null, ee(e.questions, (r) => (_(), v("button", {
392
+ key: r.question,
357
393
  class: "dialog-block-suggestions-item",
358
- onClick: (r) => o(s.question)
394
+ onClick: (n) => o(r.question)
359
395
  }, [
360
- A(Ke, {
396
+ L(He, {
361
397
  class: "dialog-block-suggestions-item-icon",
362
398
  color: e.client.theme.primaryColor
363
399
  }, null, 8, ["color"]),
364
- d("span", Ge, R(s.question), 1)
400
+ u("span", Ge, k(r.question), 1)
365
401
  ], 8, Fe))), 128));
366
402
  }
367
- }), Qe = /* @__PURE__ */ D(je, [["__scopeId", "data-v-db34d4b4"]]), We = {};
368
- function Ye(t, e) {
369
- return _(), m(O, null, [
370
- e[0] || (e[0] = d("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
371
- e[1] || (e[1] = d("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
372
- e[2] || (e[2] = d("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1))
403
+ }), Qe = /* @__PURE__ */ P(je, [["__scopeId", "data-v-db34d4b4"]]), ze = {};
404
+ function We(t, e) {
405
+ return _(), v(N, null, [
406
+ e[0] || (e[0] = u("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
407
+ e[1] || (e[1] = u("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
408
+ e[2] || (e[2] = u("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1))
373
409
  ], 64);
374
410
  }
375
- const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58"]]), Xe = { class: "dialog-block-suggestions-container" }, Ze = /* @__PURE__ */ w({
411
+ const Ye = /* @__PURE__ */ P(ze, [["render", We], ["__scopeId", "data-v-26a64b58"]]), Xe = { class: "dialog-block-suggestions-container" }, Ze = /* @__PURE__ */ R({
376
412
  __name: "DialogBlockSuggestionsContainer",
377
413
  props: {
378
414
  client: {},
@@ -384,8 +420,8 @@ const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58
384
420
  },
385
421
  setup(t) {
386
422
  const e = t;
387
- return (o, n) => (_(), m("div", Xe, [
388
- e.isLoading || !e.questions ? (_(), x(ze, { key: 0 })) : (_(), x(Qe, {
423
+ return (o, s) => (_(), v("div", Xe, [
424
+ e.isLoading || !e.questions ? (_(), O(Ye, { key: 0 })) : (_(), O(Qe, {
389
425
  key: 1,
390
426
  client: e.client,
391
427
  questions: e.questions,
@@ -395,21 +431,21 @@ const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58
395
431
  }, null, 8, ["client", "questions", "product-id", "product-title", "selected-variant-id"]))
396
432
  ]));
397
433
  }
398
- }), Je = /* @__PURE__ */ D(Ze, [["__scopeId", "data-v-18c9e78b"]]), et = {
434
+ }), Je = /* @__PURE__ */ P(Ze, [["__scopeId", "data-v-18c9e78b"]]), et = {
399
435
  width: "20",
400
436
  height: "20",
401
437
  viewBox: "0 0 20 20",
402
438
  fill: "none",
403
439
  xmlns: "http://www.w3.org/2000/svg"
404
- }, tt = ["stroke"], ot = /* @__PURE__ */ w({
440
+ }, tt = ["stroke"], ot = /* @__PURE__ */ R({
405
441
  __name: "ArrowIcon",
406
442
  props: {
407
443
  color: {}
408
444
  },
409
445
  setup(t) {
410
446
  const e = t;
411
- return (o, n) => (_(), m("svg", et, [
412
- d("path", {
447
+ return (o, s) => (_(), v("svg", et, [
448
+ u("path", {
413
449
  d: "M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",
414
450
  stroke: e.color || "#ffffff",
415
451
  "stroke-width": "1.5",
@@ -418,7 +454,7 @@ const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58
418
454
  }, null, 8, tt)
419
455
  ]));
420
456
  }
421
- }), nt = ["placeholder"], st = ["disabled"], rt = /* @__PURE__ */ w({
457
+ }), st = ["placeholder"], nt = ["disabled"], rt = /* @__PURE__ */ R({
422
458
  __name: "DialogInput",
423
459
  props: {
424
460
  client: {},
@@ -428,93 +464,93 @@ const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58
428
464
  selectedVariantId: {}
429
465
  },
430
466
  setup(t) {
431
- const e = t, o = y(), n = y(""), a = () => {
432
- var r;
433
- (r = o.value) == null || r.focus();
434
- }, s = () => {
435
- const r = n.value;
436
- r.trim() && (e.client.sendProductMessage({
467
+ const e = t, o = $(), s = $(""), i = () => {
468
+ var n;
469
+ (n = o.value) == null || n.focus();
470
+ }, r = () => {
471
+ const n = s.value;
472
+ n.trim() && (e.client.sendProductMessage({
437
473
  productId: e.productId,
438
474
  productTitle: e.productTitle,
439
475
  selectedVariantId: e.selectedVariantId,
440
- question: r,
476
+ question: n,
441
477
  fromQuestionSuggestion: !0
442
- }), n.value = "");
478
+ }), s.value = "");
443
479
  };
444
- return (r, i) => (_(), m("div", {
480
+ return (n, a) => (_(), v("div", {
445
481
  class: "dialog-input-wrapper",
446
- onClick: a
482
+ onClick: i
447
483
  }, [
448
- J(d("input", {
484
+ te(u("input", {
449
485
  id: "dialog-ask-anything-input-ai-input",
450
486
  ref_key: "inputRef",
451
487
  ref: o,
452
- "onUpdate:modelValue": i[0] || (i[0] = (l) => n.value = l),
488
+ "onUpdate:modelValue": a[0] || (a[0] = (p) => s.value = p),
453
489
  class: "dialog-ask-anything-input-ai-input",
454
490
  placeholder: e.placeholder ?? "Ask anything...",
455
- onKeydown: ae(s, ["enter"])
456
- }, null, 40, nt), [
457
- [ee, n.value]
491
+ onKeydown: le(r, ["enter"])
492
+ }, null, 40, st), [
493
+ [oe, s.value]
458
494
  ]),
459
- d("button", {
495
+ u("button", {
460
496
  id: "send-message-button-ai-input",
461
497
  class: "dialog-input-submit",
462
- disabled: !n.value.trim(),
463
- onClick: s
498
+ disabled: !s.value.trim(),
499
+ onClick: r
464
500
  }, [
465
- A(ot, {
501
+ L(ot, {
466
502
  color: e.client.theme.ctaTextColor
467
503
  }, null, 8, ["color"])
468
- ], 8, st)
504
+ ], 8, nt)
469
505
  ]));
470
506
  }
471
- }), it = /* @__PURE__ */ D(rt, [["__scopeId", "data-v-4f5901c9"]]), at = /* @__PURE__ */ w({
507
+ }), it = /* @__PURE__ */ P(rt, [["__scopeId", "data-v-4f5901c9"]]), at = /* @__PURE__ */ R({
472
508
  __name: "ThemeProvider",
473
509
  props: {
474
510
  theme: {}
475
511
  },
476
512
  setup(t) {
477
- const e = t, o = document.body, n = (s) => s.replace(/([A-Z])/g, "-$1").toLowerCase(), a = (s) => {
478
- s && Object.keys(s).forEach((r) => {
479
- const i = r, l = n(r);
480
- if (s[i] !== void 0) {
481
- if (typeof s[i] == "object") {
482
- Object.keys(s[i]).forEach((h) => {
483
- var p;
484
- const u = h;
485
- if (u !== void 0) {
486
- const S = n(h), E = s[i];
513
+ const e = t, o = document.body, s = (r) => r.replace(/([A-Z])/g, "-$1").toLowerCase(), i = (r) => {
514
+ r && Object.keys(r).forEach((n) => {
515
+ const a = n, p = s(n);
516
+ if (r[a] !== void 0) {
517
+ if (typeof r[a] == "object") {
518
+ Object.keys(r[a]).forEach((c) => {
519
+ var h;
520
+ const l = c;
521
+ if (l !== void 0) {
522
+ const S = s(c), w = r[a];
487
523
  o.style.setProperty(
488
- `--dialog-theme-${l}-${S}`,
489
- (p = E[u]) == null ? void 0 : p.toString()
524
+ `--dialog-theme-${p}-${S}`,
525
+ (h = w[l]) == null ? void 0 : h.toString()
490
526
  );
491
527
  }
492
528
  });
493
529
  return;
494
530
  }
495
- if (i === "ctaBorderType") {
496
- const h = s[i] === "rounded" ? "24px" : "0";
497
- o.style.setProperty(`--dialog-theme-${l}`, h);
531
+ if (a === "ctaBorderType") {
532
+ const c = r[a] === "rounded" ? "24px" : "0";
533
+ o.style.setProperty(`--dialog-theme-${p}`, c);
498
534
  return;
499
535
  }
500
536
  o.style.setProperty(
501
- `--dialog-theme-${l}`,
502
- s[i].toString()
537
+ `--dialog-theme-${p}`,
538
+ r[a].toString()
503
539
  );
504
540
  }
505
541
  });
506
542
  };
507
- return K(() => {
508
- e.theme && a(e.theme);
543
+ return V(() => {
544
+ e.theme && i(e.theme);
509
545
  }), U(
510
546
  () => e.theme,
511
- (s) => {
512
- s && a(s);
547
+ (r) => {
548
+ r && i(r);
513
549
  },
514
550
  { deep: !0 }
515
- ), (s, r) => ce(s.$slots, "default");
551
+ ), (r, n) => de(r.$slots, "default");
516
552
  }
517
- }), ct = ["dir"], lt = /* @__PURE__ */ w({
553
+ }), ct = ["dir"], lt = /* @__PURE__ */ R({
518
554
  __name: "DialogProductBlock",
519
555
  props: {
520
556
  client: {},
@@ -525,73 +561,73 @@ const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58
525
561
  },
526
562
  setup(t) {
527
563
  const e = t;
528
- K(() => {
529
- ne({
564
+ V(() => {
565
+ re({
530
566
  method: "vue",
531
- version: "3.5.0"
532
- }), Ie("pdp-block");
567
+ version: "3.6.0"
568
+ }), we("pdp-block");
533
569
  });
534
- const o = y(!0), n = y(void 0), a = y(0), s = T(() => {
535
- var u;
536
- return o.value ? "" : (u = n.value) == null ? void 0 : u.assistantName;
537
- }), r = T(() => {
538
- var u;
539
- return o.value ? "" : (u = n.value) == null ? void 0 : u.description;
540
- }), i = T(() => {
541
- var u;
542
- return o.value ? "" : (u = n.value) == null ? void 0 : u.inputPlaceholder;
543
- }), l = T(
570
+ const o = $(!0), s = $(void 0), i = $(0), r = T(() => {
571
+ var l;
572
+ return o.value ? "" : (l = s.value) == null ? void 0 : l.assistantName;
573
+ }), n = T(() => {
574
+ var l;
575
+ return o.value ? "" : (l = s.value) == null ? void 0 : l.description;
576
+ }), a = T(() => {
577
+ var l;
578
+ return o.value ? "" : (l = s.value) == null ? void 0 : l.inputPlaceholder;
579
+ }), p = T(
544
580
  () => {
545
- var u;
546
- return ge(
547
- (u = e.client.getLocalizationInformations()) == null ? void 0 : u.languageCode
581
+ var l;
582
+ return me(
583
+ (l = e.client.getLocalizationInformations()) == null ? void 0 : l.languageCode
548
584
  );
549
585
  }
550
- ), h = async () => {
551
- const u = ++a.value;
552
- o.value = !0, n.value = void 0;
586
+ ), c = async () => {
587
+ const l = ++i.value;
588
+ o.value = !0, s.value = void 0;
553
589
  try {
554
- const p = await e.client.getSuggestions(e.productId);
555
- u === a.value && (n.value = p);
556
- } catch (p) {
557
- console.error("error", p);
590
+ const h = await e.client.getSuggestions(e.productId);
591
+ l === i.value && (s.value = h);
592
+ } catch (h) {
593
+ console.error("error", h);
558
594
  } finally {
559
- u === a.value && (o.value = !1);
595
+ l === i.value && (o.value = !1);
560
596
  }
561
597
  };
562
598
  return U(
563
599
  () => [e.client, e.productId],
564
600
  () => {
565
- h();
601
+ c();
566
602
  },
567
603
  { immediate: !0 }
568
- ), (u, p) => (_(), x(at, {
604
+ ), (l, h) => (_(), O(at, {
569
605
  theme: e.client.theme
570
606
  }, {
571
- default: le(() => {
607
+ default: ue(() => {
572
608
  var S;
573
609
  return [
574
- d("div", {
610
+ u("div", {
575
611
  id: "dialog-instant",
576
612
  class: "dialog-block-container",
577
- dir: l.value
613
+ dir: p.value
578
614
  }, [
579
- A(Me, {
580
- title: s.value,
581
- description: r.value
615
+ L(Me, {
616
+ title: r.value,
617
+ description: n.value
582
618
  }, null, 8, ["title", "description"]),
583
- A(Je, {
619
+ L(Je, {
584
620
  client: e.client,
585
- questions: (S = n.value) == null ? void 0 : S.questions,
621
+ questions: (S = s.value) == null ? void 0 : S.questions,
586
622
  "is-loading": o.value,
587
623
  "product-id": e.productId,
588
624
  "product-title": e.productTitle,
589
625
  "selected-variant-id": e == null ? void 0 : e.selectedVariantId
590
626
  }, null, 8, ["client", "questions", "is-loading", "product-id", "product-title", "selected-variant-id"]),
591
- e.enableInput ? (_(), x(it, {
627
+ e.enableInput ? (_(), O(it, {
592
628
  key: 0,
593
629
  client: e.client,
594
- placeholder: i.value,
630
+ placeholder: a.value,
595
631
  "product-id": e.productId,
596
632
  "product-title": e.productTitle,
597
633
  "selected-variant-id": e == null ? void 0 : e.selectedVariantId
@@ -602,7 +638,7 @@ const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58
602
638
  _: 1
603
639
  }, 8, ["theme"]));
604
640
  }
605
- }), Wt = /* @__PURE__ */ D(lt, [["__scopeId", "data-v-c57aa677"]]), dt = {}, ut = {
641
+ }), zt = /* @__PURE__ */ P(lt, [["__scopeId", "data-v-c57aa677"]]), dt = {}, ut = {
606
642
  width: "16",
607
643
  height: "16",
608
644
  viewBox: "0 0 16 16",
@@ -611,8 +647,8 @@ const ze = /* @__PURE__ */ D(We, [["render", Ye], ["__scopeId", "data-v-26a64b58
611
647
  "aria-hidden": "true"
612
648
  };
613
649
  function pt(t, e) {
614
- return _(), m("svg", ut, e[0] || (e[0] = [
615
- d("path", {
650
+ return _(), v("svg", ut, e[0] || (e[0] = [
651
+ u("path", {
616
652
  d: "M8 13V3M8 3L3 8M8 3L13 8",
617
653
  stroke: "currentColor",
618
654
  "stroke-width": "1.5",
@@ -621,28 +657,28 @@ function pt(t, e) {
621
657
  }, null, -1)
622
658
  ]));
623
659
  }
624
- const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
660
+ const _t = /* @__PURE__ */ P(dt, [["render", pt]]), ht = {
625
661
  width: "16",
626
662
  height: "16",
627
663
  viewBox: "0 0 12 12",
628
664
  fill: "none",
629
665
  xmlns: "http://www.w3.org/2000/svg",
630
666
  "aria-hidden": "true"
631
- }, ft = ["fill"], gt = "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", vt = /* @__PURE__ */ w({
667
+ }, ft = ["fill"], gt = "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", vt = /* @__PURE__ */ R({
632
668
  __name: "ShurikenIcon",
633
669
  props: {
634
670
  color: {}
635
671
  },
636
672
  setup(t) {
637
673
  const e = t;
638
- return (o, n) => (_(), m("svg", ht, [
639
- d("path", {
674
+ return (o, s) => (_(), v("svg", ht, [
675
+ u("path", {
640
676
  d: gt,
641
677
  fill: e.color || "currentColor"
642
678
  }, null, 8, ft)
643
679
  ]));
644
680
  }
645
- }), mt = { class: "dialog-search-bar-field" }, St = { class: "dialog-search-bar-icon" }, Ct = ["aria-label", "placeholder", "autofocus"], bt = ["aria-label"], Yt = /* @__PURE__ */ w({
681
+ }), mt = { class: "dialog-search-bar-field" }, St = { class: "dialog-search-bar-icon" }, bt = ["aria-label", "placeholder", "autofocus"], Ct = ["aria-label"], Wt = /* @__PURE__ */ R({
646
682
  __name: "DialogSearchBar",
647
683
  props: {
648
684
  controller: {},
@@ -651,47 +687,47 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
651
687
  submitAriaLabel: { default: "Search" }
652
688
  },
653
689
  setup(t) {
654
- const e = t, o = y(""), n = () => {
690
+ const e = t, o = $(""), s = () => {
655
691
  e.controller.setQuery(o.value);
656
- }, a = () => {
692
+ }, i = () => {
657
693
  e.controller.submit(o.value);
658
694
  };
659
- return (s, r) => (_(), m("form", {
695
+ return (r, n) => (_(), v("form", {
660
696
  class: "dialog-search-bar",
661
697
  role: "search",
662
- onSubmit: de(a, ["prevent"])
698
+ onSubmit: pe(i, ["prevent"])
663
699
  }, [
664
- d("div", mt, [
665
- d("span", St, [
666
- A(vt)
700
+ u("div", mt, [
701
+ u("span", St, [
702
+ L(vt)
667
703
  ]),
668
- J(d("input", {
669
- "onUpdate:modelValue": r[0] || (r[0] = (i) => o.value = i),
704
+ te(u("input", {
705
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => o.value = a),
670
706
  type: "text",
671
707
  name: "dialog-search-query",
672
708
  class: "dialog-search-bar-input",
673
709
  "aria-label": e.placeholder,
674
710
  placeholder: e.placeholder,
675
711
  autofocus: e.autoFocus,
676
- onInput: n
677
- }, null, 40, Ct), [
678
- [ee, o.value]
712
+ onInput: s
713
+ }, null, 40, bt), [
714
+ [oe, o.value]
679
715
  ])
680
716
  ]),
681
- d("button", {
717
+ u("button", {
682
718
  type: "submit",
683
719
  class: "dialog-search-bar-submit",
684
720
  "aria-label": e.submitAriaLabel
685
721
  }, [
686
- A(_t)
687
- ], 8, bt)
722
+ L(_t)
723
+ ], 8, Ct)
688
724
  ], 32));
689
725
  }
690
726
  }), Et = {
691
727
  key: 0,
692
728
  "aria-label": "Search results pages",
693
729
  class: "dialog-search-pagination"
694
- }, It = ["disabled"], wt = ["disabled"], Tt = /* @__PURE__ */ w({
730
+ }, wt = ["disabled"], It = ["disabled"], Rt = /* @__PURE__ */ R({
695
731
  __name: "DialogSearchPagination",
696
732
  props: {
697
733
  controller: {},
@@ -699,28 +735,28 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
699
735
  },
700
736
  setup(t) {
701
737
  const e = t, o = T(() => e.state.response);
702
- return (n, a) => o.value !== void 0 && o.value.nbPages > 1 ? (_(), m("nav", Et, [
703
- d("button", {
738
+ return (s, i) => o.value !== void 0 && o.value.nbPages > 1 ? (_(), v("nav", Et, [
739
+ u("button", {
704
740
  type: "button",
705
741
  disabled: o.value.page === 0,
706
- onClick: a[0] || (a[0] = (s) => e.controller.setPage(o.value.page - 1))
707
- }, " Previous ", 8, It),
708
- d("span", null, " Page " + R(o.value.page + 1) + " / " + R(o.value.nbPages), 1),
709
- d("button", {
742
+ onClick: i[0] || (i[0] = (r) => e.controller.setPage(o.value.page - 1))
743
+ }, " Previous ", 8, wt),
744
+ u("span", null, " Page " + k(o.value.page + 1) + " / " + k(o.value.nbPages), 1),
745
+ u("button", {
710
746
  type: "button",
711
747
  disabled: o.value.page >= o.value.nbPages - 1,
712
- onClick: a[1] || (a[1] = (s) => e.controller.setPage(o.value.page + 1))
713
- }, " Next ", 8, wt)
748
+ onClick: i[1] || (i[1] = (r) => e.controller.setPage(o.value.page + 1))
749
+ }, " Next ", 8, It)
714
750
  ])) : M("", !0);
715
751
  }
716
752
  }), G = ({ amount: t, currencyCode: e }, o) => e === void 0 ? new Intl.NumberFormat(o).format(Number(t)) : new Intl.NumberFormat(o, {
717
753
  style: "currency",
718
754
  currency: e
719
- }).format(Number(t)), Rt = ({ min: t, max: e }, o) => t.amount === e.amount ? G(t, o) : `${G(t, o)} – ${G(e, o)}`, kt = (t, e) => {
755
+ }).format(Number(t)), Tt = ({ min: t, max: e }, o) => t.amount === e.amount ? G(t, o) : `${G(t, o)} – ${G(e, o)}`, kt = (t, e) => {
720
756
  if (t === void 0)
721
757
  return "";
722
758
  try {
723
- return Rt(t, e);
759
+ return Tt(t, e);
724
760
  } catch {
725
761
  return "";
726
762
  }
@@ -731,38 +767,38 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
731
767
  } catch {
732
768
  return;
733
769
  }
734
- }, Lt = { class: "dialog-search-card-image" }, At = ["src", "alt"], $t = { class: "dialog-search-card-info" }, Dt = { class: "dialog-search-card-title" }, Pt = {
770
+ }, $t = { class: "dialog-search-card-image" }, At = ["src", "alt"], Lt = { class: "dialog-search-card-info" }, Dt = { class: "dialog-search-card-title" }, Pt = {
735
771
  key: 0,
736
772
  class: "dialog-search-card-price"
737
- }, z = /* @__PURE__ */ w({
773
+ }, Z = /* @__PURE__ */ R({
738
774
  __name: "DialogSearchProductCardContent",
739
775
  props: {
740
776
  hit: {},
741
777
  locale: {}
742
778
  },
743
779
  setup(t) {
744
- const e = t, o = T(() => e.hit.title ?? e.hit.objectID), n = T(
780
+ const e = t, o = T(() => e.hit.title ?? e.hit.objectID), s = T(
745
781
  () => kt(e.hit.priceRange, e.locale)
746
782
  );
747
- return (a, s) => (_(), m(O, null, [
748
- d("div", Lt, [
749
- e.hit.imageUrl !== void 0 ? (_(), m("img", {
783
+ return (i, r) => (_(), v(N, null, [
784
+ u("div", $t, [
785
+ e.hit.imageUrl !== void 0 ? (_(), v("img", {
750
786
  key: 0,
751
787
  src: e.hit.imageUrl,
752
788
  alt: o.value,
753
789
  loading: "lazy"
754
790
  }, null, 8, At)) : M("", !0)
755
791
  ]),
756
- d("div", $t, [
757
- d("p", Dt, R(o.value), 1),
758
- n.value !== "" ? (_(), m("p", Pt, R(n.value), 1)) : M("", !0)
792
+ u("div", Lt, [
793
+ u("p", Dt, k(o.value), 1),
794
+ s.value !== "" ? (_(), v("p", Pt, k(s.value), 1)) : M("", !0)
759
795
  ])
760
796
  ], 64));
761
797
  }
762
- }), Nt = {
798
+ }), xt = {
763
799
  key: 0,
764
800
  class: "dialog-search-card-body"
765
- }, Ot = ["href"], xt = /* @__PURE__ */ w({
801
+ }, Nt = ["href"], Ot = /* @__PURE__ */ R({
766
802
  __name: "DialogSearchProductCard",
767
803
  props: {
768
804
  controller: {},
@@ -771,7 +807,7 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
771
807
  locale: {}
772
808
  },
773
809
  setup(t) {
774
- const e = t, o = y();
810
+ const e = t, o = $();
775
811
  U(
776
812
  () => e.hit,
777
813
  () => {
@@ -779,63 +815,63 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
779
815
  },
780
816
  { immediate: !0, flush: "post" }
781
817
  );
782
- const n = (r) => {
783
- const i = r.metaKey || r.ctrlKey || r.shiftKey || r.altKey;
784
- e.controller.selectResult(e.index, { navigate: !i }) && r.preventDefault();
785
- }, a = (r) => {
786
- r.button === 1 && e.controller.selectResult(e.index, { navigate: !1 });
787
- }, s = T(
818
+ const s = (n) => {
819
+ const a = n.metaKey || n.ctrlKey || n.shiftKey || n.altKey;
820
+ e.controller.selectResult(e.index, { navigate: !a }) && n.preventDefault();
821
+ }, i = (n) => {
822
+ n.button === 1 && e.controller.selectResult(e.index, { navigate: !1 });
823
+ }, r = T(
788
824
  () => e.hit.url === void 0 ? void 0 : yt(e.hit.url)
789
825
  );
790
- return (r, i) => (_(), m("li", {
826
+ return (n, a) => (_(), v("li", {
791
827
  ref_key: "cardRef",
792
828
  ref: o,
793
829
  class: "dialog-search-card"
794
830
  }, [
795
- s.value === void 0 ? (_(), m("div", Nt, [
796
- A(z, {
831
+ r.value === void 0 ? (_(), v("div", xt, [
832
+ L(Z, {
797
833
  hit: e.hit,
798
834
  locale: e.locale
799
835
  }, null, 8, ["hit", "locale"])
800
- ])) : (_(), m("a", {
836
+ ])) : (_(), v("a", {
801
837
  key: 1,
802
838
  class: "dialog-search-card-body",
803
- href: s.value,
804
- onClick: n,
805
- onAuxclick: a
839
+ href: r.value,
840
+ onClick: s,
841
+ onAuxclick: i
806
842
  }, [
807
- A(z, {
843
+ L(Z, {
808
844
  hit: e.hit,
809
845
  locale: e.locale
810
846
  }, null, 8, ["hit", "locale"])
811
- ], 40, Ot))
847
+ ], 40, Nt))
812
848
  ], 512));
813
849
  }
814
850
  }), Ut = (t) => {
815
- const e = y(), o = y(void 0), n = y(0);
851
+ const e = $(), o = $(void 0), s = $(0);
816
852
  return U(
817
853
  t,
818
- (a, s, r) => {
819
- if (!a)
854
+ (i, r, n) => {
855
+ if (!i)
820
856
  return;
821
- const i = () => {
822
- const l = e.value;
823
- if (l === void 0)
857
+ const a = () => {
858
+ const p = e.value;
859
+ if (p === void 0)
824
860
  return;
825
- const h = l.previousElementSibling ?? l, { top: u, bottom: p, left: S, width: E } = h.getBoundingClientRect();
826
- n.value = window.innerHeight;
827
- const c = o.value;
828
- (c === void 0 || c.top !== u || c.bottom !== p || c.left !== S || c.width !== E) && (o.value = { top: u, bottom: p, left: S, width: E });
861
+ const c = p.previousElementSibling ?? p, { top: l, bottom: h, left: S, width: w } = c.getBoundingClientRect();
862
+ s.value = window.innerHeight;
863
+ const d = o.value;
864
+ (d === void 0 || d.top !== l || d.bottom !== h || d.left !== S || d.width !== w) && (o.value = { top: l, bottom: h, left: S, width: w });
829
865
  };
830
- i(), window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), r(() => {
831
- window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
866
+ a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), n(() => {
867
+ window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
832
868
  });
833
869
  },
834
870
  { immediate: !0, flush: "post" }
835
- ), { anchorRef: e, rect: o, viewportHeight: n };
871
+ ), { anchorRef: e, rect: o, viewportHeight: s };
836
872
  }, Mt = (t, e) => {
837
- const o = y(!1), n = y(), a = T(
838
- () => t.value.status !== k.IDLE && !o.value
873
+ const o = $(!1), s = $(), i = T(
874
+ () => t.value.status !== y.IDLE && !o.value
839
875
  );
840
876
  U(
841
877
  () => t.value.query,
@@ -843,40 +879,40 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
843
879
  o.value = !1;
844
880
  }
845
881
  ), U(
846
- a,
847
- (r, i, l) => {
848
- if (!r)
882
+ i,
883
+ (n, a, p) => {
884
+ if (!n)
849
885
  return;
850
- const h = (u) => {
851
- var b, I;
852
- const p = u.target;
853
- if (!(p instanceof Node))
886
+ const c = (l) => {
887
+ var b, C;
888
+ const h = l.target;
889
+ if (!(h instanceof Node))
854
890
  return;
855
- const S = (b = e.value) == null ? void 0 : b.previousElementSibling, E = ((I = n.value) == null ? void 0 : I.contains(p)) ?? !1, c = (S == null ? void 0 : S.contains(p)) ?? !1;
856
- !E && !c && (o.value = !0);
891
+ const S = (b = e.value) == null ? void 0 : b.previousElementSibling, w = ((C = s.value) == null ? void 0 : C.contains(h)) ?? !1, d = (S == null ? void 0 : S.contains(h)) ?? !1;
892
+ !w && !d && (o.value = !0);
857
893
  };
858
- document.addEventListener("pointerdown", h), l(
859
- () => document.removeEventListener("pointerdown", h)
894
+ document.addEventListener("pointerdown", c), p(
895
+ () => document.removeEventListener("pointerdown", c)
860
896
  );
861
897
  },
862
898
  { immediate: !0 }
863
899
  );
864
- const s = () => {
900
+ const r = () => {
865
901
  o.value = !1;
866
902
  };
867
- return K(() => {
868
- var r, i;
869
- (i = (r = e.value) == null ? void 0 : r.previousElementSibling) == null || i.addEventListener(
903
+ return V(() => {
904
+ var n, a;
905
+ (a = (n = e.value) == null ? void 0 : n.previousElementSibling) == null || a.addEventListener(
870
906
  "focusin",
871
- s
907
+ r
872
908
  );
873
- }), te(() => {
874
- var r, i;
875
- (i = (r = e.value) == null ? void 0 : r.previousElementSibling) == null || i.removeEventListener(
909
+ }), se(() => {
910
+ var n, a;
911
+ (a = (n = e.value) == null ? void 0 : n.previousElementSibling) == null || a.removeEventListener(
876
912
  "focusin",
877
- s
913
+ r
878
914
  );
879
- }), { isOpen: a, panelRef: n };
915
+ }), { isOpen: i, panelRef: s };
880
916
  }, qt = {
881
917
  key: 0,
882
918
  role: "status",
@@ -887,14 +923,14 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
887
923
  }, Vt = {
888
924
  role: "alert",
889
925
  class: "dialog-search-status dialog-search-status-error"
890
- }, Ht = {
926
+ }, Kt = {
891
927
  key: 2,
892
928
  role: "status",
893
929
  class: "dialog-search-status"
894
- }, Kt = {
930
+ }, Ht = {
895
931
  role: "status",
896
932
  class: "dialog-search-status"
897
- }, Ft = { class: "dialog-search-results" }, H = 8, X = 16, Gt = 200, zt = /* @__PURE__ */ w({
933
+ }, Ft = { class: "dialog-search-results" }, B = 8, J = 16, Gt = 200, Yt = /* @__PURE__ */ R({
898
934
  __name: "DialogSearchResults",
899
935
  props: {
900
936
  controller: {},
@@ -902,58 +938,58 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
902
938
  locale: {}
903
939
  },
904
940
  setup(t) {
905
- const e = t, o = (c) => c instanceof me ? `Search failed (${c.status}${c.code ? ` ${c.code}` : ""}): ${c.message}` : "Search failed: network error. Check your connection and try again.", n = (c, b) => c.bottom > 0 && c.top < b, a = (c, b) => {
906
- const I = b - c.bottom - H - X, L = c.top - H - X, f = { left: `${c.left}px`, width: `${c.width}px` };
907
- return I < Gt && L > I ? {
941
+ const e = t, o = (d) => d instanceof Se ? `Search failed (${d.status}${d.code ? ` ${d.code}` : ""}): ${d.message}` : "Search failed: network error. Check your connection and try again.", s = (d, b) => d.bottom > 0 && d.top < b, i = (d, b) => {
942
+ const C = b - d.bottom - B - J, I = d.top - B - J, f = { left: `${d.left}px`, width: `${d.width}px` };
943
+ return C < Gt && I > C ? {
908
944
  ...f,
909
- bottom: `${b - c.top + H}px`,
910
- maxHeight: `${Math.max(L, 0)}px`
945
+ bottom: `${b - d.top + B}px`,
946
+ maxHeight: `${Math.max(I, 0)}px`
911
947
  } : {
912
948
  ...f,
913
- top: `${c.bottom + H}px`,
914
- maxHeight: `${Math.max(I, 0)}px`
949
+ top: `${d.bottom + B}px`,
950
+ maxHeight: `${Math.max(C, 0)}px`
915
951
  };
916
- }, s = T(() => e.state), r = T(() => e.state.status !== k.IDLE), { anchorRef: i, rect: l, viewportHeight: h } = Ut(r), { isOpen: u, panelRef: p } = Mt(s, i), S = T(
917
- () => u.value && l.value !== void 0 && n(l.value, h.value)
918
- ), E = T(
919
- () => l.value === void 0 ? void 0 : a(l.value, h.value)
952
+ }, r = T(() => e.state), n = T(() => e.state.status !== y.IDLE), { anchorRef: a, rect: p, viewportHeight: c } = Ut(n), { isOpen: l, panelRef: h } = Mt(r, a), S = T(
953
+ () => l.value && p.value !== void 0 && s(p.value, c.value)
954
+ ), w = T(
955
+ () => p.value === void 0 ? void 0 : i(p.value, c.value)
920
956
  );
921
- return (c, b) => {
922
- var I;
923
- return _(), m(O, null, [
924
- d("div", {
957
+ return (d, b) => {
958
+ var C;
959
+ return _(), v(N, null, [
960
+ u("div", {
925
961
  ref_key: "anchorRef",
926
- ref: i
962
+ ref: a
927
963
  }, null, 512),
928
- S.value ? (_(), x(ue, {
964
+ S.value ? (_(), O(_e, {
929
965
  key: 0,
930
966
  to: "body"
931
967
  }, [
932
- d("div", {
968
+ u("div", {
933
969
  ref_key: "panelRef",
934
- ref: p,
970
+ ref: h,
935
971
  class: "dialog-search-panel",
936
- style: pe(E.value)
972
+ style: he(w.value)
937
973
  }, [
938
- e.state.status === V(k).LOADING ? (_(), m("p", qt, " Searching “" + R(e.state.query) + "”… ", 1)) : e.state.status === V(k).ERROR ? (_(), m("div", Bt, [
939
- d("p", Vt, R(o(e.state.error)), 1),
940
- d("button", {
974
+ e.state.status === q(y).LOADING ? (_(), v("p", qt, " Searching “" + k(e.state.query) + "”… ", 1)) : e.state.status === q(y).ERROR ? (_(), v("div", Bt, [
975
+ u("p", Vt, k(o(e.state.error)), 1),
976
+ u("button", {
941
977
  type: "button",
942
978
  class: "dialog-search-retry",
943
- onClick: b[0] || (b[0] = (L) => e.controller.retry())
979
+ onClick: b[0] || (b[0] = (I) => e.controller.retry())
944
980
  }, " Retry ")
945
- ])) : e.state.status === V(k).EMPTY ? (_(), m("p", Ht, " No products match “" + R((I = e.state.response) == null ? void 0 : I.query) + "”. ", 1)) : e.state.status === V(k).SUCCESS && e.state.response !== void 0 ? (_(), m(O, { key: 3 }, [
946
- d("p", Kt, R(e.state.response.nbHits) + " result" + R(e.state.response.nbHits > 1 ? "s" : ""), 1),
947
- d("ul", Ft, [
948
- (_(!0), m(O, null, Z(e.state.response.hits, (L, f) => (_(), x(xt, {
949
- key: L.objectID,
981
+ ])) : e.state.status === q(y).EMPTY ? (_(), v("p", Kt, " No products match “" + k((C = e.state.response) == null ? void 0 : C.query) + "”. ", 1)) : e.state.status === q(y).SUCCESS && e.state.response !== void 0 ? (_(), v(N, { key: 3 }, [
982
+ u("p", Ht, k(e.state.response.nbHits) + " result" + k(e.state.response.nbHits > 1 ? "s" : ""), 1),
983
+ u("ul", Ft, [
984
+ (_(!0), v(N, null, ee(e.state.response.hits, (I, f) => (_(), O(Ot, {
985
+ key: I.objectID,
950
986
  controller: e.controller,
951
- hit: L,
987
+ hit: I,
952
988
  index: f,
953
989
  locale: e.locale
954
990
  }, null, 8, ["controller", "hit", "index", "locale"]))), 128))
955
991
  ]),
956
- A(Tt, {
992
+ L(Rt, {
957
993
  controller: e.controller,
958
994
  state: e.state
959
995
  }, null, 8, ["controller", "state"])
@@ -964,38 +1000,32 @@ const _t = /* @__PURE__ */ D(dt, [["render", pt]]), ht = {
964
1000
  };
965
1001
  }
966
1002
  }), Xt = (t) => {
967
- const {
968
- client: e,
969
- surface: o = "search_page",
970
- locale: n = e.locale,
971
- ...a
972
- } = t, s = Pe({
973
- search: (l, h) => e.search(l, h),
974
- locale: n,
1003
+ const { client: e, surface: o = "search_page", ...s } = t, i = Pe({
1004
+ search: (a, p) => e.search(a, p),
975
1005
  analytics: {
976
1006
  surface: o,
977
- trackViewSearchResults: (l) => e.trackViewSearchResults(l),
978
- trackSelectSearchResult: (l) => e.trackSelectSearchResult(l)
1007
+ trackViewSearchResults: (a) => e.trackViewSearchResults(a),
1008
+ trackSelectSearchResult: (a) => e.trackSelectSearchResult(a)
979
1009
  },
980
- ...a
981
- }), r = _e(s.getState()), i = s.subscribe(() => {
982
- r.value = s.getState();
1010
+ ...s
1011
+ }), r = fe(i.getState()), n = i.subscribe(() => {
1012
+ r.value = i.getState();
983
1013
  });
984
- return K(() => {
985
- ne({
1014
+ return V(() => {
1015
+ re({
986
1016
  method: "vue",
987
- version: "3.5.0"
1017
+ version: "3.6.0"
988
1018
  });
989
- }), te(() => {
990
- i(), s.dispose();
991
- }), { controller: s, state: r };
1019
+ }), se(() => {
1020
+ n(), i.dispose();
1021
+ }), { controller: i, state: r };
992
1022
  };
993
1023
  export {
994
1024
  it as DialogInput,
995
- Wt as DialogProductBlock,
996
- Yt as DialogSearchBar,
997
- Tt as DialogSearchPagination,
998
- xt as DialogSearchProductCard,
999
- zt as DialogSearchResults,
1025
+ zt as DialogProductBlock,
1026
+ Wt as DialogSearchBar,
1027
+ Rt as DialogSearchPagination,
1028
+ Ot as DialogSearchProductCard,
1029
+ Yt as DialogSearchResults,
1000
1030
  Xt as useDialogSearch
1001
1031
  };