@askdialog/dialog-vue 3.7.0 → 3.9.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.
- package/README.md +4 -6
- package/dist/components/DialogProductBlock/DialogAskSomethingElse.vue.d.ts +11 -0
- package/dist/components/DialogProductBlock/DialogInput.vue.d.ts +1 -0
- package/dist/components/DialogProductBlock/DialogProductBlock.vue.d.ts +1 -0
- package/dist/components/DialogProductBlock/inputMessages.d.ts +7 -0
- package/dist/dialog-vue.css +1 -1
- package/dist/dialog-vue.js +659 -589
- package/dist/dialog-vue.umd.cjs +3 -3
- package/package.json +3 -3
package/dist/dialog-vue.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
const
|
|
6
|
-
var
|
|
1
|
+
var Ee = Object.defineProperty;
|
|
2
|
+
var ye = (t, e, s) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var z = (t, e, s) => ye(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { defineComponent as I, createElementBlock as h, openBlock as u, toDisplayString as y, unref as H, createElementVNode as l, Fragment as N, renderList as W, createVNode as T, createBlock as P, ref as R, computed as S, withDirectives as ie, withKeys as Ie, vModelText as ae, onMounted as K, watch as M, renderSlot as we, withCtx as le, withModifiers as $e, createCommentVNode as L, resolveDynamicComponent as ke, mergeProps as Te, toHandlers as Re, createTextVNode as ce, onUnmounted as ue, Teleport as Ae, normalizeStyle as Le, normalizeClass as Z, shallowRef as xe } from "vue";
|
|
5
|
+
const De = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur"]), Pe = (t) => t !== void 0 && De.has(t.trim().toLowerCase().slice(0, 2)), Oe = (t) => Pe(t) ? "rtl" : "ltr";
|
|
6
|
+
var q;
|
|
7
7
|
(function(t) {
|
|
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";
|
|
9
|
-
})(
|
|
8
|
+
t.OPEN_ASSISTANT = "open_assistant", t.OPEN_WITH_SUGGESTIONS = "OPEN_WITH_SUGGESTIONS", 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";
|
|
9
|
+
})(q || (q = {}));
|
|
10
10
|
var J;
|
|
11
11
|
(function(t) {
|
|
12
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";
|
|
13
13
|
})(J || (J = {}));
|
|
14
|
-
|
|
15
|
-
class
|
|
16
|
-
constructor({ status:
|
|
17
|
-
super(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.name = "DialogSearchError", this.status =
|
|
14
|
+
q.TRACK_ADD_TO_CART, q.TRACK_SUBMIT_CHECKOUT, q.TRACK_VIEW_SEARCH_RESULTS, q.TRACK_SELECT_SEARCH_RESULT;
|
|
15
|
+
class Ne extends Error {
|
|
16
|
+
constructor({ status: s, code: o, message: n }) {
|
|
17
|
+
super(n);
|
|
18
|
+
z(this, "status");
|
|
19
|
+
z(this, "code");
|
|
20
|
+
this.name = "DialogSearchError", this.status = s, this.code = o;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const X = (t, e,
|
|
23
|
+
const X = (t, e, s) => {
|
|
24
24
|
if (!/^[a-z]{2}$/.test(e))
|
|
25
25
|
throw new Error("Search language must be a lowercase ISO 639-1 code.");
|
|
26
|
-
if (!/^[A-Za-z]{3}$/.test(
|
|
26
|
+
if (!/^[A-Za-z]{3}$/.test(s))
|
|
27
27
|
throw new Error("Search currency must be an ISO 4217 code.");
|
|
28
|
-
return `${t}_${e}_${
|
|
29
|
-
}, ee = "multiple installation methods detected:",
|
|
30
|
-
const t =
|
|
28
|
+
return `${t}_${e}_${s.toLowerCase()}`;
|
|
29
|
+
}, ee = "multiple installation methods detected:", qe = () => typeof window > "u" ? void 0 : window, de = () => {
|
|
30
|
+
const t = qe();
|
|
31
31
|
if (t !== void 0)
|
|
32
32
|
return t.dialog = t.dialog ?? {}, t.dialog.audit = t.dialog.audit ?? {
|
|
33
33
|
methods: [],
|
|
@@ -35,26 +35,26 @@ const X = (t, e, o) => {
|
|
|
35
35
|
capabilities: [],
|
|
36
36
|
warnings: []
|
|
37
37
|
}, t.dialog.audit;
|
|
38
|
-
},
|
|
38
|
+
}, Me = (t) => {
|
|
39
39
|
if (t.warnings = t.warnings.filter((e) => !e.startsWith(ee)), t.methods.length >= 2) {
|
|
40
|
-
const e = t.methods.map((
|
|
40
|
+
const e = t.methods.map((s) => s.method).join(", ");
|
|
41
41
|
t.warnings.push(`${ee} ${e}`);
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, Ue = (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
|
-
},
|
|
47
|
-
const e =
|
|
46
|
+
}, pe = (t) => {
|
|
47
|
+
const e = de();
|
|
48
48
|
if (e === void 0)
|
|
49
49
|
return;
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }),
|
|
50
|
+
const s = e.methods.find((o) => o.method === t.method);
|
|
51
|
+
if (s === void 0) {
|
|
52
|
+
e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }), Me(e);
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
const e =
|
|
55
|
+
s.version = s.version ?? t.version, s.build = Ue(s.build, t.build), s.source = s.source ?? t.source;
|
|
56
|
+
}, He = (t) => {
|
|
57
|
+
const e = de();
|
|
58
58
|
e !== void 0 && (e.capabilities.includes(t) || e.capabilities.push(t));
|
|
59
59
|
}, A = {
|
|
60
60
|
IDLE: "idle",
|
|
@@ -63,61 +63,61 @@ const X = (t, e, o) => {
|
|
|
63
63
|
/** Successful request with zero hits. */
|
|
64
64
|
EMPTY: "empty",
|
|
65
65
|
ERROR: "error"
|
|
66
|
-
},
|
|
67
|
-
function
|
|
68
|
-
let
|
|
69
|
-
const
|
|
70
|
-
let
|
|
71
|
-
const
|
|
72
|
-
clearTimeout(
|
|
73
|
-
},
|
|
74
|
-
if (
|
|
66
|
+
}, Ve = 0.5, Be = 500, Ke = 1500, Fe = 100;
|
|
67
|
+
function ze({ emit: t, visibilityThreshold: e = Ve, dwellMs: s = Be, idleFlushMs: o = Ke, maxItemsPerEvent: n = Fe }) {
|
|
68
|
+
let r, a = [];
|
|
69
|
+
const i = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
70
|
+
let C;
|
|
71
|
+
const c = () => {
|
|
72
|
+
clearTimeout(C), !(r === void 0 || a.length === 0) && (t({ ...r, items: a }), a = []);
|
|
73
|
+
}, f = (b) => {
|
|
74
|
+
if (r === void 0)
|
|
75
75
|
return;
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
78
|
-
if (
|
|
79
|
-
|
|
76
|
+
const m = `${r.query_id}:${b.product_id}`;
|
|
77
|
+
if (!i.has(m)) {
|
|
78
|
+
if (i.add(m), a.push(b), a.length >= n) {
|
|
79
|
+
c();
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
clearTimeout(
|
|
82
|
+
clearTimeout(C), C = setTimeout(c, o);
|
|
83
83
|
}
|
|
84
|
-
},
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
}, g = new IntersectionObserver((
|
|
88
|
-
for (const
|
|
89
|
-
const p = _.get(
|
|
90
|
-
p !== void 0 && (
|
|
91
|
-
|
|
92
|
-
},
|
|
84
|
+
}, v = (b) => {
|
|
85
|
+
const m = d.get(b);
|
|
86
|
+
m !== void 0 && (clearTimeout(m), d.delete(b));
|
|
87
|
+
}, g = new IntersectionObserver((b) => {
|
|
88
|
+
for (const m of b) {
|
|
89
|
+
const p = _.get(m.target);
|
|
90
|
+
p !== void 0 && (m.intersectionRatio >= e ? d.has(m.target) || d.set(m.target, setTimeout(() => {
|
|
91
|
+
d.delete(m.target), f(p);
|
|
92
|
+
}, s)) : v(m.target));
|
|
93
93
|
}
|
|
94
|
-
}, { threshold: e }),
|
|
94
|
+
}, { threshold: e }), w = () => {
|
|
95
95
|
g.disconnect();
|
|
96
|
-
for (const
|
|
97
|
-
clearTimeout(
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
for (const
|
|
105
|
-
|
|
96
|
+
for (const b of d.values())
|
|
97
|
+
clearTimeout(b);
|
|
98
|
+
d.clear(), _.clear();
|
|
99
|
+
}, $ = () => {
|
|
100
|
+
c();
|
|
101
|
+
}, k = (b) => {
|
|
102
|
+
if (b.persisted) {
|
|
103
|
+
i.clear();
|
|
104
|
+
for (const m of _.keys())
|
|
105
|
+
v(m), g.unobserve(m), g.observe(m);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
return window.addEventListener("pagehide",
|
|
109
|
-
setContext(
|
|
110
|
-
|
|
108
|
+
return window.addEventListener("pagehide", $), window.addEventListener("pageshow", k), {
|
|
109
|
+
setContext(b) {
|
|
110
|
+
c(), i.clear(), r = b, w();
|
|
111
111
|
},
|
|
112
|
-
observe(
|
|
113
|
-
_.set(
|
|
112
|
+
observe(b, m) {
|
|
113
|
+
_.set(b, m), g.observe(b);
|
|
114
114
|
},
|
|
115
|
-
forceImpression(
|
|
116
|
-
|
|
115
|
+
forceImpression(b) {
|
|
116
|
+
f(b), c();
|
|
117
117
|
},
|
|
118
|
-
flush:
|
|
118
|
+
flush: c,
|
|
119
119
|
disconnect() {
|
|
120
|
-
|
|
120
|
+
c(), w(), window.removeEventListener("pagehide", $), window.removeEventListener("pageshow", k);
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
}
|
|
@@ -126,65 +126,65 @@ const te = (t, e) => ({
|
|
|
126
126
|
// One-based position across all pages.
|
|
127
127
|
position: t.page * t.hitsPerPage + e + 1
|
|
128
128
|
});
|
|
129
|
-
function
|
|
130
|
-
let e,
|
|
131
|
-
const
|
|
129
|
+
function je(t) {
|
|
130
|
+
let e, s;
|
|
131
|
+
const o = () => (e ?? (e = ze({
|
|
132
132
|
emit: t.trackViewSearchResults
|
|
133
133
|
})), e);
|
|
134
134
|
return {
|
|
135
|
-
onResponse(
|
|
136
|
-
|
|
137
|
-
query_id:
|
|
138
|
-
index:
|
|
135
|
+
onResponse(n) {
|
|
136
|
+
s = {
|
|
137
|
+
query_id: n.queryID,
|
|
138
|
+
index: n.index,
|
|
139
139
|
surface: t.surface,
|
|
140
140
|
search_type: "lexical",
|
|
141
141
|
// Convert the API page to one-based analytics numbering.
|
|
142
|
-
page:
|
|
143
|
-
total_hits:
|
|
144
|
-
query_length: [...
|
|
145
|
-
},
|
|
142
|
+
page: n.page + 1,
|
|
143
|
+
total_hits: n.nbHits,
|
|
144
|
+
query_length: [...n.query].length
|
|
145
|
+
}, o().setContext(s), n.nbHits === 0 && t.trackViewSearchResults({ ...s, items: [] });
|
|
146
146
|
},
|
|
147
|
-
observeResult(
|
|
148
|
-
|
|
147
|
+
observeResult(n, r, a) {
|
|
148
|
+
o().observe(n, te(r, a));
|
|
149
149
|
},
|
|
150
|
-
select(
|
|
151
|
-
if (
|
|
150
|
+
select(n, r) {
|
|
151
|
+
if (s === void 0)
|
|
152
152
|
return;
|
|
153
|
-
const
|
|
154
|
-
|
|
153
|
+
const a = te(n, r);
|
|
154
|
+
o().forceImpression(a), t.trackSelectSearchResult({ ...s, items: [a] });
|
|
155
155
|
},
|
|
156
156
|
dispose() {
|
|
157
157
|
e == null || e.disconnect();
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const Ge = 2, se = (t) => {
|
|
162
162
|
const e = t.trim();
|
|
163
|
-
return [...e].length >=
|
|
164
|
-
},
|
|
163
|
+
return [...e].length >= Ge ? e : void 0;
|
|
164
|
+
}, Qe = (t, e, s, { indexName: o, language: n, currency: r, hitsPerPage: a }) => ({
|
|
165
165
|
requests: [
|
|
166
|
-
{ indexName:
|
|
167
|
-
...
|
|
168
|
-
indexName: X(
|
|
166
|
+
{ indexName: o, query: t, page: e, hitsPerPage: a },
|
|
167
|
+
...s.map((i) => ({
|
|
168
|
+
indexName: X(i.index, n, r),
|
|
169
169
|
query: t,
|
|
170
170
|
page: 0,
|
|
171
|
-
hitsPerPage:
|
|
171
|
+
hitsPerPage: i.hitsPerPage ?? a
|
|
172
172
|
}))
|
|
173
173
|
]
|
|
174
|
-
}),
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
throw new Error(`Dialog search returned no ${
|
|
178
|
-
const
|
|
179
|
-
for (const
|
|
180
|
-
const _ = X(
|
|
181
|
-
|
|
174
|
+
}), We = (t, e, { indexName: s, language: o, currency: n }) => {
|
|
175
|
+
const r = t.results.find((i) => i.index === s);
|
|
176
|
+
if (r === void 0)
|
|
177
|
+
throw new Error(`Dialog search returned no ${s} entry`);
|
|
178
|
+
const a = {};
|
|
179
|
+
for (const i of e) {
|
|
180
|
+
const _ = X(i.index, o, n), d = t.results.find((C) => C.index === _);
|
|
181
|
+
d !== void 0 && (a[i.index] = d);
|
|
182
182
|
}
|
|
183
183
|
return {
|
|
184
|
-
response:
|
|
185
|
-
sections: e.length === 0 ? void 0 :
|
|
184
|
+
response: r,
|
|
185
|
+
sections: e.length === 0 ? void 0 : a
|
|
186
186
|
};
|
|
187
|
-
},
|
|
187
|
+
}, j = {
|
|
188
188
|
status: A.IDLE,
|
|
189
189
|
query: "",
|
|
190
190
|
page: 0,
|
|
@@ -192,44 +192,44 @@ const je = 2, oe = (t) => {
|
|
|
192
192
|
sections: void 0,
|
|
193
193
|
error: void 0
|
|
194
194
|
};
|
|
195
|
-
function
|
|
195
|
+
function Xe({ search: t, language: e, currency: s, analytics: o, navigate: n, debounceMs: r = 250, hitsPerPage: a = 12, sections: i = [] }) {
|
|
196
196
|
const _ = {
|
|
197
|
-
indexName: X("products", e,
|
|
197
|
+
indexName: X("products", e, s),
|
|
198
198
|
language: e,
|
|
199
|
-
currency:
|
|
200
|
-
hitsPerPage:
|
|
199
|
+
currency: s,
|
|
200
|
+
hitsPerPage: a
|
|
201
201
|
};
|
|
202
|
-
let
|
|
203
|
-
const
|
|
204
|
-
let
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
for (const
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
clearTimeout(
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
202
|
+
let d = j;
|
|
203
|
+
const C = /* @__PURE__ */ new Set(), c = je(o);
|
|
204
|
+
let f, v, g, w = 0, $ = !1;
|
|
205
|
+
const k = (p) => {
|
|
206
|
+
d = { ...d, ...p };
|
|
207
|
+
for (const E of C)
|
|
208
|
+
E(d);
|
|
209
|
+
}, b = () => {
|
|
210
|
+
clearTimeout(f), v = void 0, w += 1, g == null || g.abort(), g = void 0;
|
|
211
|
+
}, m = async (p, E) => {
|
|
212
|
+
b(), g = new AbortController();
|
|
213
|
+
const O = w;
|
|
214
|
+
k({ status: A.LOADING, query: p, page: E });
|
|
215
215
|
try {
|
|
216
|
-
const
|
|
216
|
+
const D = typeof i == "function" ? i() : i, Y = Qe(p, E, D, _), Ce = await t(Y, {
|
|
217
217
|
signal: g.signal
|
|
218
218
|
});
|
|
219
|
-
if (
|
|
219
|
+
if (O !== w)
|
|
220
220
|
return;
|
|
221
|
-
const F =
|
|
222
|
-
|
|
221
|
+
const F = We(Ce, D, _);
|
|
222
|
+
c.onResponse(F.response), k({
|
|
223
223
|
...F,
|
|
224
224
|
status: F.response.nbHits === 0 ? A.EMPTY : A.SUCCESS,
|
|
225
225
|
error: void 0
|
|
226
226
|
});
|
|
227
|
-
} catch (
|
|
228
|
-
if (
|
|
227
|
+
} catch (D) {
|
|
228
|
+
if (D instanceof DOMException && D.name === "AbortError" || O !== w)
|
|
229
229
|
return;
|
|
230
|
-
|
|
230
|
+
k({
|
|
231
231
|
status: A.ERROR,
|
|
232
|
-
error:
|
|
232
|
+
error: D,
|
|
233
233
|
response: void 0,
|
|
234
234
|
sections: void 0
|
|
235
235
|
});
|
|
@@ -237,62 +237,115 @@ function Qe({ search: t, language: e, currency: o, analytics: s, navigate: r, de
|
|
|
237
237
|
};
|
|
238
238
|
return {
|
|
239
239
|
setQuery(p) {
|
|
240
|
-
if (
|
|
240
|
+
if ($)
|
|
241
241
|
return;
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
|
|
242
|
+
b();
|
|
243
|
+
const E = se(p);
|
|
244
|
+
if (E === void 0) {
|
|
245
|
+
k(j);
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
|
|
248
|
+
v = E, f = setTimeout(() => void m(E, 0), r);
|
|
249
249
|
},
|
|
250
250
|
submit(p) {
|
|
251
|
-
if (
|
|
251
|
+
if ($)
|
|
252
252
|
return;
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
|
|
253
|
+
b();
|
|
254
|
+
const E = se(p);
|
|
255
|
+
if (E === void 0) {
|
|
256
|
+
k(j);
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
|
|
259
|
+
m(E, 0);
|
|
260
260
|
},
|
|
261
261
|
setPage(p) {
|
|
262
|
-
if (
|
|
263
|
-
if (
|
|
264
|
-
v
|
|
262
|
+
if (!$) {
|
|
263
|
+
if (v !== void 0) {
|
|
264
|
+
m(v, 0);
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
|
|
267
|
+
d.query !== "" && m(d.query, p);
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
270
|
retry() {
|
|
271
|
-
|
|
271
|
+
$ || d.status !== A.ERROR || m(d.query, d.page);
|
|
272
272
|
},
|
|
273
|
-
observeResult(p,
|
|
274
|
-
|
|
273
|
+
observeResult(p, E) {
|
|
274
|
+
d.response !== void 0 && c.observeResult(p, d.response, E);
|
|
275
275
|
},
|
|
276
|
-
selectResult(p,
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
276
|
+
selectResult(p, E) {
|
|
277
|
+
const O = d.response;
|
|
278
|
+
if (O === void 0)
|
|
279
279
|
return !1;
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
return ((
|
|
280
|
+
c.select(O, p);
|
|
281
|
+
const D = O.hits[p].url;
|
|
282
|
+
return ((E == null ? void 0 : E.navigate) ?? !0) && n !== void 0 && D !== void 0 ? (n(D, O.hits[p]), !0) : !1;
|
|
283
283
|
},
|
|
284
284
|
subscribe(p) {
|
|
285
|
-
return
|
|
286
|
-
|
|
285
|
+
return C.add(p), () => {
|
|
286
|
+
C.delete(p);
|
|
287
287
|
};
|
|
288
288
|
},
|
|
289
|
-
getState: () =>
|
|
289
|
+
getState: () => d,
|
|
290
290
|
dispose() {
|
|
291
|
-
|
|
291
|
+
$ = !0, b(), C.clear(), c.dispose();
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
const
|
|
295
|
+
const oe = {
|
|
296
|
+
en: {
|
|
297
|
+
placeholder: "Ask the AI a question",
|
|
298
|
+
aiDisclosure: "You're chatting with an AI assistant. It can make mistakes, so please double-check important information",
|
|
299
|
+
askSomethingElse: "Ask something else"
|
|
300
|
+
},
|
|
301
|
+
fr: {
|
|
302
|
+
placeholder: "Posez une question à l'IA",
|
|
303
|
+
aiDisclosure: "Vous discutez avec un assistant IA. Il peut se tromper, pensez à vérifier les informations importantes",
|
|
304
|
+
askSomethingElse: "Posez une autre question"
|
|
305
|
+
},
|
|
306
|
+
es: {
|
|
307
|
+
placeholder: "Haz una pregunta a la IA",
|
|
308
|
+
aiDisclosure: "Estás chateando con un asistente de IA. Puede cometer errores, así que verifica la información importante",
|
|
309
|
+
askSomethingElse: "Pregunta otra cosa"
|
|
310
|
+
}
|
|
311
|
+
}, he = (t) => {
|
|
312
|
+
var s;
|
|
313
|
+
const e = ((s = t == null ? void 0 : t.split("-")[0]) == null ? void 0 : s.toLowerCase()) ?? "en";
|
|
314
|
+
return oe[e] ?? oe.en;
|
|
315
|
+
}, Ye = ["disabled"], Ze = /* @__PURE__ */ I({
|
|
316
|
+
__name: "DialogAskSomethingElse",
|
|
317
|
+
props: {
|
|
318
|
+
client: {},
|
|
319
|
+
questions: {},
|
|
320
|
+
disabled: { type: Boolean },
|
|
321
|
+
productId: {},
|
|
322
|
+
productTitle: {},
|
|
323
|
+
selectedVariantId: {}
|
|
324
|
+
},
|
|
325
|
+
setup(t) {
|
|
326
|
+
const e = t, s = () => {
|
|
327
|
+
e.client.openAssistantWithSuggestions({
|
|
328
|
+
questions: e.questions ?? [],
|
|
329
|
+
product: {
|
|
330
|
+
id: e.productId,
|
|
331
|
+
title: e.productTitle,
|
|
332
|
+
selectedVariantId: e.selectedVariantId
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
return (o, n) => (u(), h("button", {
|
|
337
|
+
type: "button",
|
|
338
|
+
class: "dialog-ask-something-else",
|
|
339
|
+
disabled: e.disabled,
|
|
340
|
+
onClick: s
|
|
341
|
+
}, y(H(he)(e.client.locale).askSomethingElse), 9, Ye));
|
|
342
|
+
}
|
|
343
|
+
}), x = (t, e) => {
|
|
344
|
+
const s = t.__vccOpts || t;
|
|
345
|
+
for (const [o, n] of e)
|
|
346
|
+
s[o] = n;
|
|
347
|
+
return s;
|
|
348
|
+
}, Je = /* @__PURE__ */ x(Ze, [["__scopeId", "data-v-d0e272a0"]]), et = { class: "dialog-block-header-container" }, tt = { class: "dialog-block-title" }, st = { class: "dialog-block-description" }, ot = /* @__PURE__ */ I({
|
|
296
349
|
__name: "DialogBlockHeader",
|
|
297
350
|
props: {
|
|
298
351
|
title: {},
|
|
@@ -300,31 +353,26 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
|
|
|
300
353
|
},
|
|
301
354
|
setup(t) {
|
|
302
355
|
const e = t;
|
|
303
|
-
return (
|
|
304
|
-
l("div",
|
|
305
|
-
l("div",
|
|
356
|
+
return (s, o) => (u(), h("div", et, [
|
|
357
|
+
l("div", tt, y(e.title ?? "Your expert"), 1),
|
|
358
|
+
l("div", st, y(e.description ?? "A question about this product?"), 1)
|
|
306
359
|
]));
|
|
307
360
|
}
|
|
308
|
-
}),
|
|
309
|
-
const o = t.__vccOpts || t;
|
|
310
|
-
for (const [s, r] of e)
|
|
311
|
-
o[s] = r;
|
|
312
|
-
return o;
|
|
313
|
-
}, Je = /* @__PURE__ */ D(Ye, [["__scopeId", "data-v-28e6dda7"]]), et = {
|
|
361
|
+
}), nt = /* @__PURE__ */ x(ot, [["__scopeId", "data-v-28e6dda7"]]), rt = {
|
|
314
362
|
width: "20",
|
|
315
363
|
height: "20",
|
|
316
364
|
viewBox: "0 0 20 20",
|
|
317
365
|
fill: "none",
|
|
318
366
|
xmlns: "http://www.w3.org/2000/svg"
|
|
319
|
-
},
|
|
367
|
+
}, it = { "clip-path": "url(#clip0_466_934)" }, at = ["stroke"], lt = ["stroke"], ct = /* @__PURE__ */ I({
|
|
320
368
|
__name: "AiStarsIcon",
|
|
321
369
|
props: {
|
|
322
370
|
color: {}
|
|
323
371
|
},
|
|
324
372
|
setup(t) {
|
|
325
373
|
const e = t;
|
|
326
|
-
return (
|
|
327
|
-
l("g",
|
|
374
|
+
return (s, o) => (u(), h("svg", rt, [
|
|
375
|
+
l("g", it, [
|
|
328
376
|
l("path", {
|
|
329
377
|
d: `M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
|
|
330
378
|
12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684
|
|
@@ -340,7 +388,7 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
|
|
|
340
388
|
"stroke-width": "1.5",
|
|
341
389
|
"stroke-linecap": "round",
|
|
342
390
|
"stroke-linejoin": "round"
|
|
343
|
-
}, null, 8,
|
|
391
|
+
}, null, 8, at),
|
|
344
392
|
l("path", {
|
|
345
393
|
d: `M12.5001 1.66666L13.4823 4.22034C13.7173 4.83136 13.8348 5.13688 14.0175
|
|
346
394
|
5.39386C14.1795 5.62162 14.3785 5.82061 14.6062 5.98256C14.8632 6.16529 15.1687
|
|
@@ -356,9 +404,9 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
|
|
|
356
404
|
"stroke-width": "1.5",
|
|
357
405
|
"stroke-linecap": "round",
|
|
358
406
|
"stroke-linejoin": "round"
|
|
359
|
-
}, null, 8,
|
|
407
|
+
}, null, 8, lt)
|
|
360
408
|
]),
|
|
361
|
-
|
|
409
|
+
o[0] || (o[0] = l("defs", null, [
|
|
362
410
|
l("clipPath", { id: "clip0_466_934" }, [
|
|
363
411
|
l("rect", {
|
|
364
412
|
width: "20",
|
|
@@ -369,7 +417,7 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
|
|
|
369
417
|
], -1))
|
|
370
418
|
]));
|
|
371
419
|
}
|
|
372
|
-
}),
|
|
420
|
+
}), ut = ["onClick"], dt = { class: "dialog-block-suggestions-item-label" }, pt = /* @__PURE__ */ I({
|
|
373
421
|
__name: "DialogBlockSuggestions",
|
|
374
422
|
props: {
|
|
375
423
|
client: {},
|
|
@@ -379,36 +427,36 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
|
|
|
379
427
|
selectedVariantId: {}
|
|
380
428
|
},
|
|
381
429
|
setup(t) {
|
|
382
|
-
const e = t,
|
|
430
|
+
const e = t, s = (o) => {
|
|
383
431
|
e.client.sendProductMessage({
|
|
384
432
|
productId: e.productId,
|
|
385
433
|
productTitle: e.productTitle,
|
|
386
434
|
selectedVariantId: e.selectedVariantId,
|
|
387
|
-
question:
|
|
435
|
+
question: o,
|
|
388
436
|
fromQuestionSuggestion: !0
|
|
389
437
|
});
|
|
390
438
|
};
|
|
391
|
-
return (
|
|
392
|
-
key:
|
|
439
|
+
return (o, n) => (u(!0), h(N, null, W(e.questions, (r) => (u(), h("button", {
|
|
440
|
+
key: r.question,
|
|
393
441
|
class: "dialog-block-suggestions-item",
|
|
394
|
-
onClick: (
|
|
442
|
+
onClick: (a) => s(r.question)
|
|
395
443
|
}, [
|
|
396
|
-
|
|
444
|
+
T(ct, {
|
|
397
445
|
class: "dialog-block-suggestions-item-icon",
|
|
398
446
|
color: e.client.theme.primaryColor
|
|
399
447
|
}, null, 8, ["color"]),
|
|
400
|
-
l("span",
|
|
401
|
-
], 8,
|
|
448
|
+
l("span", dt, y(r.question), 1)
|
|
449
|
+
], 8, ut))), 128));
|
|
402
450
|
}
|
|
403
|
-
}),
|
|
404
|
-
function
|
|
405
|
-
return
|
|
451
|
+
}), ht = /* @__PURE__ */ x(pt, [["__scopeId", "data-v-db34d4b4"]]), _t = {};
|
|
452
|
+
function gt(t, e) {
|
|
453
|
+
return u(), h(N, null, [
|
|
406
454
|
e[0] || (e[0] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
|
|
407
455
|
e[1] || (e[1] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
|
|
408
456
|
e[2] || (e[2] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1))
|
|
409
457
|
], 64);
|
|
410
458
|
}
|
|
411
|
-
const
|
|
459
|
+
const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58"]]), vt = { class: "dialog-block-suggestions-container" }, mt = /* @__PURE__ */ I({
|
|
412
460
|
__name: "DialogBlockSuggestionsContainer",
|
|
413
461
|
props: {
|
|
414
462
|
client: {},
|
|
@@ -420,8 +468,8 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
|
|
|
420
468
|
},
|
|
421
469
|
setup(t) {
|
|
422
470
|
const e = t;
|
|
423
|
-
return (
|
|
424
|
-
e.isLoading || !e.questions ? (
|
|
471
|
+
return (s, o) => (u(), h("div", vt, [
|
|
472
|
+
e.isLoading || !e.questions ? (u(), P(ft, { key: 0 })) : (u(), P(ht, {
|
|
425
473
|
key: 1,
|
|
426
474
|
client: e.client,
|
|
427
475
|
questions: e.questions,
|
|
@@ -431,30 +479,33 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
|
|
|
431
479
|
}, null, 8, ["client", "questions", "product-id", "product-title", "selected-variant-id"]))
|
|
432
480
|
]));
|
|
433
481
|
}
|
|
434
|
-
}),
|
|
482
|
+
}), bt = /* @__PURE__ */ x(mt, [["__scopeId", "data-v-18c9e78b"]]), St = {
|
|
435
483
|
width: "20",
|
|
436
484
|
height: "20",
|
|
437
485
|
viewBox: "0 0 20 20",
|
|
438
486
|
fill: "none",
|
|
439
487
|
xmlns: "http://www.w3.org/2000/svg"
|
|
440
|
-
},
|
|
488
|
+
}, Ct = ["stroke"], Et = /* @__PURE__ */ I({
|
|
441
489
|
__name: "ArrowIcon",
|
|
442
490
|
props: {
|
|
443
491
|
color: {}
|
|
444
492
|
},
|
|
445
493
|
setup(t) {
|
|
446
494
|
const e = t;
|
|
447
|
-
return (
|
|
495
|
+
return (s, o) => (u(), h("svg", St, [
|
|
448
496
|
l("path", {
|
|
449
497
|
d: "M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",
|
|
450
498
|
stroke: e.color || "#ffffff",
|
|
451
499
|
"stroke-width": "1.5",
|
|
452
500
|
"stroke-linecap": "round",
|
|
453
501
|
"stroke-linejoin": "round"
|
|
454
|
-
}, null, 8,
|
|
502
|
+
}, null, 8, Ct)
|
|
455
503
|
]));
|
|
456
504
|
}
|
|
457
|
-
}),
|
|
505
|
+
}), yt = { class: "dialog-input-container" }, It = ["placeholder"], wt = ["disabled"], $t = {
|
|
506
|
+
id: "dialog-input-ai-disclosure",
|
|
507
|
+
class: "dialog-input-ai-disclosure"
|
|
508
|
+
}, kt = /* @__PURE__ */ I({
|
|
458
509
|
__name: "DialogInput",
|
|
459
510
|
props: {
|
|
460
511
|
client: {},
|
|
@@ -464,181 +515,200 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
|
|
|
464
515
|
selectedVariantId: {}
|
|
465
516
|
},
|
|
466
517
|
setup(t) {
|
|
467
|
-
const e = t,
|
|
518
|
+
const e = t, s = R(), o = R(""), n = S(() => he(e.client.locale)), r = () => {
|
|
468
519
|
var i;
|
|
469
|
-
(i =
|
|
470
|
-
},
|
|
471
|
-
const i =
|
|
520
|
+
(i = s.value) == null || i.focus();
|
|
521
|
+
}, a = () => {
|
|
522
|
+
const i = o.value;
|
|
472
523
|
i.trim() && (e.client.sendProductMessage({
|
|
473
524
|
productId: e.productId,
|
|
474
525
|
productTitle: e.productTitle,
|
|
475
526
|
selectedVariantId: e.selectedVariantId,
|
|
476
527
|
question: i,
|
|
477
528
|
fromQuestionSuggestion: !0
|
|
478
|
-
}),
|
|
529
|
+
}), o.value = "");
|
|
479
530
|
};
|
|
480
|
-
return (i,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
re(l("input", {
|
|
485
|
-
id: "dialog-ask-anything-input-ai-input",
|
|
486
|
-
ref_key: "inputRef",
|
|
487
|
-
ref: o,
|
|
488
|
-
"onUpdate:modelValue": a[0] || (a[0] = (_) => s.value = _),
|
|
489
|
-
class: "dialog-ask-anything-input-ai-input",
|
|
490
|
-
placeholder: e.placeholder ?? "Ask anything...",
|
|
491
|
-
onKeydown: ye(n, ["enter"])
|
|
492
|
-
}, null, 40, mt), [
|
|
493
|
-
[ae, s.value]
|
|
494
|
-
]),
|
|
495
|
-
l("button", {
|
|
496
|
-
id: "send-message-button-ai-input",
|
|
497
|
-
class: "dialog-input-submit",
|
|
498
|
-
disabled: !s.value.trim(),
|
|
499
|
-
onClick: n
|
|
531
|
+
return (i, _) => (u(), h("div", yt, [
|
|
532
|
+
l("div", {
|
|
533
|
+
class: "dialog-input-wrapper",
|
|
534
|
+
onClick: r
|
|
500
535
|
}, [
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
536
|
+
ie(l("input", {
|
|
537
|
+
id: "dialog-ask-anything-input-ai-input",
|
|
538
|
+
ref_key: "inputRef",
|
|
539
|
+
ref: s,
|
|
540
|
+
"onUpdate:modelValue": _[0] || (_[0] = (d) => o.value = d),
|
|
541
|
+
class: "dialog-ask-anything-input-ai-input",
|
|
542
|
+
placeholder: n.value.placeholder,
|
|
543
|
+
"aria-describedby": "dialog-input-ai-disclosure",
|
|
544
|
+
onKeydown: Ie(a, ["enter"])
|
|
545
|
+
}, null, 40, It), [
|
|
546
|
+
[ae, o.value]
|
|
547
|
+
]),
|
|
548
|
+
l("button", {
|
|
549
|
+
id: "send-message-button-ai-input",
|
|
550
|
+
class: "dialog-input-submit",
|
|
551
|
+
disabled: !o.value.trim(),
|
|
552
|
+
onClick: a
|
|
553
|
+
}, [
|
|
554
|
+
T(Et, {
|
|
555
|
+
color: e.client.theme.ctaTextColor
|
|
556
|
+
}, null, 8, ["color"])
|
|
557
|
+
], 8, wt)
|
|
558
|
+
]),
|
|
559
|
+
l("p", $t, y(n.value.aiDisclosure), 1)
|
|
505
560
|
]));
|
|
506
561
|
}
|
|
507
|
-
}),
|
|
562
|
+
}), Tt = /* @__PURE__ */ x(kt, [["__scopeId", "data-v-87013888"]]), Rt = /* @__PURE__ */ I({
|
|
508
563
|
__name: "ThemeProvider",
|
|
509
564
|
props: {
|
|
510
565
|
theme: {}
|
|
511
566
|
},
|
|
512
567
|
setup(t) {
|
|
513
|
-
const e = t,
|
|
514
|
-
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
517
|
-
if (typeof
|
|
518
|
-
Object.keys(
|
|
519
|
-
var
|
|
520
|
-
const
|
|
521
|
-
if (
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
`--dialog-theme-${_}-${
|
|
525
|
-
(
|
|
568
|
+
const e = t, s = document.body, o = (r) => r.replace(/([A-Z])/g, "-$1").toLowerCase(), n = (r) => {
|
|
569
|
+
r && Object.keys(r).forEach((a) => {
|
|
570
|
+
const i = a, _ = o(a);
|
|
571
|
+
if (r[i] !== void 0) {
|
|
572
|
+
if (typeof r[i] == "object") {
|
|
573
|
+
Object.keys(r[i]).forEach((d) => {
|
|
574
|
+
var c;
|
|
575
|
+
const C = d;
|
|
576
|
+
if (C !== void 0) {
|
|
577
|
+
const f = o(d), v = r[i];
|
|
578
|
+
s.style.setProperty(
|
|
579
|
+
`--dialog-theme-${_}-${f}`,
|
|
580
|
+
(c = v[C]) == null ? void 0 : c.toString()
|
|
526
581
|
);
|
|
527
582
|
}
|
|
528
583
|
});
|
|
529
584
|
return;
|
|
530
585
|
}
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
|
|
586
|
+
if (i === "ctaBorderType") {
|
|
587
|
+
const d = r[i] === "rounded" ? "24px" : "0";
|
|
588
|
+
s.style.setProperty(`--dialog-theme-${_}`, d);
|
|
534
589
|
return;
|
|
535
590
|
}
|
|
536
|
-
|
|
591
|
+
s.style.setProperty(
|
|
537
592
|
`--dialog-theme-${_}`,
|
|
538
|
-
|
|
593
|
+
r[i].toString()
|
|
539
594
|
);
|
|
540
595
|
}
|
|
541
596
|
});
|
|
542
597
|
};
|
|
543
|
-
return
|
|
544
|
-
e.theme &&
|
|
545
|
-
}),
|
|
598
|
+
return K(() => {
|
|
599
|
+
e.theme && n(e.theme);
|
|
600
|
+
}), M(
|
|
546
601
|
() => e.theme,
|
|
547
|
-
(
|
|
548
|
-
|
|
602
|
+
(r) => {
|
|
603
|
+
r && n(r);
|
|
549
604
|
},
|
|
550
605
|
{ deep: !0 }
|
|
551
|
-
), (
|
|
606
|
+
), (r, a) => we(r.$slots, "default");
|
|
552
607
|
}
|
|
553
|
-
}),
|
|
608
|
+
}), At = ["dir"], Lt = 2, xt = 5, Dt = /* @__PURE__ */ I({
|
|
554
609
|
__name: "DialogProductBlock",
|
|
555
610
|
props: {
|
|
556
611
|
client: {},
|
|
557
612
|
productId: {},
|
|
558
613
|
productTitle: {},
|
|
559
614
|
selectedVariantId: { default: void 0 },
|
|
560
|
-
enableInput: { type: Boolean, default: !
|
|
615
|
+
enableInput: { type: Boolean, default: !1 }
|
|
561
616
|
},
|
|
562
617
|
setup(t) {
|
|
563
618
|
const e = t;
|
|
564
|
-
|
|
565
|
-
|
|
619
|
+
K(() => {
|
|
620
|
+
pe({
|
|
566
621
|
method: "vue",
|
|
567
|
-
version: "3.
|
|
568
|
-
}),
|
|
622
|
+
version: "3.9.0"
|
|
623
|
+
}), He("pdp-block");
|
|
569
624
|
});
|
|
570
|
-
const
|
|
571
|
-
var
|
|
572
|
-
return
|
|
573
|
-
}),
|
|
574
|
-
var
|
|
575
|
-
return
|
|
576
|
-
}),
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
625
|
+
const s = R(!0), o = R(void 0), n = R(0), r = S(() => {
|
|
626
|
+
var c;
|
|
627
|
+
return s.value ? "" : (c = o.value) == null ? void 0 : c.assistantName;
|
|
628
|
+
}), a = S(() => {
|
|
629
|
+
var c;
|
|
630
|
+
return s.value ? "" : (c = o.value) == null ? void 0 : c.description;
|
|
631
|
+
}), i = S(
|
|
632
|
+
() => {
|
|
633
|
+
var c, f;
|
|
634
|
+
return (f = (c = o.value) == null ? void 0 : c.questions) == null ? void 0 : f.slice(0, Lt);
|
|
635
|
+
}
|
|
636
|
+
), _ = S(() => {
|
|
637
|
+
var c;
|
|
638
|
+
return s.value ? "" : (c = o.value) == null ? void 0 : c.inputPlaceholder;
|
|
639
|
+
}), d = S(
|
|
580
640
|
() => {
|
|
581
|
-
var
|
|
582
|
-
return
|
|
583
|
-
(
|
|
641
|
+
var c;
|
|
642
|
+
return Oe(
|
|
643
|
+
(c = e.client.getLocalizationInformations()) == null ? void 0 : c.languageCode
|
|
584
644
|
);
|
|
585
645
|
}
|
|
586
|
-
),
|
|
587
|
-
const
|
|
588
|
-
|
|
646
|
+
), C = async () => {
|
|
647
|
+
const c = ++n.value;
|
|
648
|
+
s.value = !0, o.value = void 0;
|
|
589
649
|
try {
|
|
590
|
-
const f = await e.client.getSuggestions(e.productId
|
|
591
|
-
|
|
650
|
+
const f = await e.client.getSuggestions(e.productId, {
|
|
651
|
+
limit: xt
|
|
652
|
+
});
|
|
653
|
+
c === n.value && (o.value = f);
|
|
592
654
|
} catch (f) {
|
|
593
655
|
console.error("error", f);
|
|
594
656
|
} finally {
|
|
595
|
-
|
|
657
|
+
c === n.value && (s.value = !1);
|
|
596
658
|
}
|
|
597
659
|
};
|
|
598
|
-
return
|
|
660
|
+
return M(
|
|
599
661
|
() => [e.client, e.productId],
|
|
600
662
|
() => {
|
|
601
|
-
|
|
663
|
+
C();
|
|
602
664
|
},
|
|
603
665
|
{ immediate: !0 }
|
|
604
|
-
), (
|
|
666
|
+
), (c, f) => (u(), P(Rt, {
|
|
605
667
|
theme: e.client.theme
|
|
606
668
|
}, {
|
|
607
|
-
default:
|
|
608
|
-
var
|
|
669
|
+
default: le(() => {
|
|
670
|
+
var v;
|
|
609
671
|
return [
|
|
610
672
|
l("div", {
|
|
611
673
|
id: "dialog-instant",
|
|
612
674
|
class: "dialog-block-container",
|
|
613
|
-
dir:
|
|
675
|
+
dir: d.value
|
|
614
676
|
}, [
|
|
615
|
-
|
|
616
|
-
title:
|
|
617
|
-
description:
|
|
677
|
+
T(nt, {
|
|
678
|
+
title: r.value,
|
|
679
|
+
description: a.value
|
|
618
680
|
}, null, 8, ["title", "description"]),
|
|
619
|
-
|
|
681
|
+
T(bt, {
|
|
620
682
|
client: e.client,
|
|
621
|
-
questions:
|
|
622
|
-
"is-loading":
|
|
683
|
+
questions: i.value,
|
|
684
|
+
"is-loading": s.value,
|
|
623
685
|
"product-id": e.productId,
|
|
624
686
|
"product-title": e.productTitle,
|
|
625
687
|
"selected-variant-id": e == null ? void 0 : e.selectedVariantId
|
|
626
688
|
}, null, 8, ["client", "questions", "is-loading", "product-id", "product-title", "selected-variant-id"]),
|
|
627
|
-
e.enableInput ? (
|
|
689
|
+
e.enableInput ? (u(), P(Tt, {
|
|
628
690
|
key: 0,
|
|
629
691
|
client: e.client,
|
|
630
|
-
placeholder:
|
|
692
|
+
placeholder: _.value,
|
|
631
693
|
"product-id": e.productId,
|
|
632
694
|
"product-title": e.productTitle,
|
|
633
695
|
"selected-variant-id": e == null ? void 0 : e.selectedVariantId
|
|
634
|
-
}, null, 8, ["client", "placeholder", "product-id", "product-title", "selected-variant-id"])) :
|
|
635
|
-
|
|
696
|
+
}, null, 8, ["client", "placeholder", "product-id", "product-title", "selected-variant-id"])) : (u(), P(Je, {
|
|
697
|
+
key: 1,
|
|
698
|
+
client: e.client,
|
|
699
|
+
questions: (v = o.value) == null ? void 0 : v.questions,
|
|
700
|
+
disabled: s.value,
|
|
701
|
+
"product-id": e.productId,
|
|
702
|
+
"product-title": e.productTitle,
|
|
703
|
+
"selected-variant-id": e.selectedVariantId
|
|
704
|
+
}, null, 8, ["client", "questions", "disabled", "product-id", "product-title", "selected-variant-id"]))
|
|
705
|
+
], 8, At)
|
|
636
706
|
];
|
|
637
707
|
}),
|
|
638
708
|
_: 1
|
|
639
709
|
}, 8, ["theme"]));
|
|
640
710
|
}
|
|
641
|
-
}),
|
|
711
|
+
}), ao = /* @__PURE__ */ x(Dt, [["__scopeId", "data-v-0c307e5f"]]), Pt = {}, Ot = {
|
|
642
712
|
width: "16",
|
|
643
713
|
height: "16",
|
|
644
714
|
viewBox: "0 0 16 16",
|
|
@@ -646,8 +716,8 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
|
|
|
646
716
|
xmlns: "http://www.w3.org/2000/svg",
|
|
647
717
|
"aria-hidden": "true"
|
|
648
718
|
};
|
|
649
|
-
function
|
|
650
|
-
return
|
|
719
|
+
function Nt(t, e) {
|
|
720
|
+
return u(), h("svg", Ot, e[0] || (e[0] = [
|
|
651
721
|
l("path", {
|
|
652
722
|
d: "M8 13V3M8 3L3 8M8 3L13 8",
|
|
653
723
|
stroke: "currentColor",
|
|
@@ -657,28 +727,28 @@ function Tt(t, e) {
|
|
|
657
727
|
}, null, -1)
|
|
658
728
|
]));
|
|
659
729
|
}
|
|
660
|
-
const
|
|
730
|
+
const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
|
|
661
731
|
width: "16",
|
|
662
732
|
height: "16",
|
|
663
733
|
viewBox: "0 0 12 12",
|
|
664
734
|
fill: "none",
|
|
665
735
|
xmlns: "http://www.w3.org/2000/svg",
|
|
666
736
|
"aria-hidden": "true"
|
|
667
|
-
},
|
|
737
|
+
}, Ut = ["fill"], Ht = "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__ */ I({
|
|
668
738
|
__name: "ShurikenIcon",
|
|
669
739
|
props: {
|
|
670
740
|
color: {}
|
|
671
741
|
},
|
|
672
742
|
setup(t) {
|
|
673
743
|
const e = t;
|
|
674
|
-
return (
|
|
744
|
+
return (s, o) => (u(), h("svg", Mt, [
|
|
675
745
|
l("path", {
|
|
676
|
-
d:
|
|
746
|
+
d: Ht,
|
|
677
747
|
fill: e.color || "currentColor"
|
|
678
|
-
}, null, 8,
|
|
748
|
+
}, null, 8, Ut)
|
|
679
749
|
]));
|
|
680
750
|
}
|
|
681
|
-
}),
|
|
751
|
+
}), Bt = { class: "dialog-search-bar-field" }, Kt = { class: "dialog-search-bar-icon" }, Ft = ["aria-label", "placeholder", "autofocus"], zt = ["aria-label"], lo = /* @__PURE__ */ I({
|
|
682
752
|
__name: "DialogSearchBar",
|
|
683
753
|
props: {
|
|
684
754
|
controller: {},
|
|
@@ -687,31 +757,31 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
687
757
|
submitAriaLabel: { default: "Search" }
|
|
688
758
|
},
|
|
689
759
|
setup(t) {
|
|
690
|
-
const e = t,
|
|
691
|
-
e.controller.setQuery(
|
|
692
|
-
},
|
|
693
|
-
e.controller.submit(
|
|
760
|
+
const e = t, s = R(""), o = () => {
|
|
761
|
+
e.controller.setQuery(s.value);
|
|
762
|
+
}, n = () => {
|
|
763
|
+
e.controller.submit(s.value);
|
|
694
764
|
};
|
|
695
|
-
return (
|
|
765
|
+
return (r, a) => (u(), h("form", {
|
|
696
766
|
class: "dialog-search-bar",
|
|
697
767
|
role: "search",
|
|
698
|
-
onSubmit:
|
|
768
|
+
onSubmit: $e(n, ["prevent"])
|
|
699
769
|
}, [
|
|
700
|
-
l("div",
|
|
701
|
-
l("span",
|
|
702
|
-
|
|
770
|
+
l("div", Bt, [
|
|
771
|
+
l("span", Kt, [
|
|
772
|
+
T(Vt)
|
|
703
773
|
]),
|
|
704
|
-
|
|
705
|
-
"onUpdate:modelValue":
|
|
774
|
+
ie(l("input", {
|
|
775
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => s.value = i),
|
|
706
776
|
type: "text",
|
|
707
777
|
name: "dialog-search-query",
|
|
708
778
|
class: "dialog-search-bar-input",
|
|
709
779
|
"aria-label": e.placeholder,
|
|
710
780
|
placeholder: e.placeholder,
|
|
711
781
|
autofocus: e.autoFocus,
|
|
712
|
-
onInput:
|
|
713
|
-
}, null, 40,
|
|
714
|
-
[ae,
|
|
782
|
+
onInput: o
|
|
783
|
+
}, null, 40, Ft), [
|
|
784
|
+
[ae, s.value]
|
|
715
785
|
])
|
|
716
786
|
]),
|
|
717
787
|
l("button", {
|
|
@@ -719,17 +789,17 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
719
789
|
class: "dialog-search-bar-submit",
|
|
720
790
|
"aria-label": e.submitAriaLabel
|
|
721
791
|
}, [
|
|
722
|
-
|
|
723
|
-
], 8,
|
|
792
|
+
T(qt)
|
|
793
|
+
], 8, zt)
|
|
724
794
|
], 32));
|
|
725
795
|
}
|
|
726
|
-
}),
|
|
796
|
+
}), jt = (t, e) => {
|
|
727
797
|
try {
|
|
728
798
|
return new Intl.NumberFormat(e).format(t);
|
|
729
799
|
} catch {
|
|
730
800
|
return String(t);
|
|
731
801
|
}
|
|
732
|
-
},
|
|
802
|
+
}, ne = {
|
|
733
803
|
en: (t) => ({
|
|
734
804
|
searching: (e) => `Searching “${e}”…`,
|
|
735
805
|
noResults: "No matching products",
|
|
@@ -741,7 +811,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
741
811
|
seeAllLabel: (e) => e === 1 ? "See the result" : `See all ${t(e)} results`,
|
|
742
812
|
previous: "Previous",
|
|
743
813
|
next: "Next",
|
|
744
|
-
pageOf: (e,
|
|
814
|
+
pageOf: (e, s) => `Page ${t(e)} / ${t(s)}`
|
|
745
815
|
}),
|
|
746
816
|
fr: (t) => ({
|
|
747
817
|
searching: (e) => `Recherche de « ${e} »…`,
|
|
@@ -754,7 +824,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
754
824
|
seeAllLabel: (e) => e === 1 ? "Voir le résultat" : `Voir les ${t(e)} résultats`,
|
|
755
825
|
previous: "Précédent",
|
|
756
826
|
next: "Suivant",
|
|
757
|
-
pageOf: (e,
|
|
827
|
+
pageOf: (e, s) => `Page ${t(e)} / ${t(s)}`
|
|
758
828
|
}),
|
|
759
829
|
de: (t) => ({
|
|
760
830
|
searching: (e) => `Suche nach „${e}“…`,
|
|
@@ -767,7 +837,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
767
837
|
seeAllLabel: (e) => e === 1 ? "Das Ergebnis anzeigen" : `Alle ${t(e)} Ergebnisse anzeigen`,
|
|
768
838
|
previous: "Zurück",
|
|
769
839
|
next: "Weiter",
|
|
770
|
-
pageOf: (e,
|
|
840
|
+
pageOf: (e, s) => `Seite ${t(e)} / ${t(s)}`
|
|
771
841
|
}),
|
|
772
842
|
es: (t) => ({
|
|
773
843
|
searching: (e) => `Buscando «${e}»…`,
|
|
@@ -780,7 +850,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
780
850
|
seeAllLabel: (e) => e === 1 ? "Ver el resultado" : `Ver los ${t(e)} resultados`,
|
|
781
851
|
previous: "Anterior",
|
|
782
852
|
next: "Siguiente",
|
|
783
|
-
pageOf: (e,
|
|
853
|
+
pageOf: (e, s) => `Página ${t(e)} / ${t(s)}`
|
|
784
854
|
}),
|
|
785
855
|
it: (t) => ({
|
|
786
856
|
searching: (e) => `Ricerca di “${e}”…`,
|
|
@@ -793,17 +863,17 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
793
863
|
seeAllLabel: (e) => e === 1 ? "Vedi il risultato" : `Vedi tutti i ${t(e)} risultati`,
|
|
794
864
|
previous: "Precedente",
|
|
795
865
|
next: "Successivo",
|
|
796
|
-
pageOf: (e,
|
|
866
|
+
pageOf: (e, s) => `Pagina ${t(e)} / ${t(s)}`
|
|
797
867
|
})
|
|
798
|
-
},
|
|
799
|
-
var
|
|
800
|
-
const e = ((
|
|
801
|
-
return (
|
|
802
|
-
},
|
|
868
|
+
}, _e = (t) => {
|
|
869
|
+
var o;
|
|
870
|
+
const e = ((o = t == null ? void 0 : t.split("-")[0]) == null ? void 0 : o.toLowerCase()) ?? "en";
|
|
871
|
+
return (ne[e] ?? ne.en)((n) => jt(n, t));
|
|
872
|
+
}, ge = (t) => t.status !== A.LOADING && t.response !== void 0 && t.response.nbPages > 1, Gt = {
|
|
803
873
|
key: 0,
|
|
804
874
|
"aria-label": "Search results pages",
|
|
805
875
|
class: "dialog-search-pagination"
|
|
806
|
-
},
|
|
876
|
+
}, Qt = ["disabled"], Wt = ["disabled"], Xt = /* @__PURE__ */ I({
|
|
807
877
|
__name: "DialogSearchPagination",
|
|
808
878
|
props: {
|
|
809
879
|
controller: {},
|
|
@@ -811,87 +881,87 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
811
881
|
locale: {}
|
|
812
882
|
},
|
|
813
883
|
setup(t) {
|
|
814
|
-
const e = t,
|
|
815
|
-
return (
|
|
884
|
+
const e = t, s = S(() => e.state.response), o = S(() => _e(e.locale));
|
|
885
|
+
return (n, r) => s.value !== void 0 && H(ge)(e.state) ? (u(), h("nav", Gt, [
|
|
816
886
|
l("button", {
|
|
817
887
|
type: "button",
|
|
818
|
-
disabled:
|
|
819
|
-
onClick:
|
|
820
|
-
},
|
|
821
|
-
l("span", null,
|
|
888
|
+
disabled: s.value.page === 0,
|
|
889
|
+
onClick: r[0] || (r[0] = (a) => e.controller.setPage(s.value.page - 1))
|
|
890
|
+
}, y(o.value.previous), 9, Qt),
|
|
891
|
+
l("span", null, y(o.value.pageOf(s.value.page + 1, s.value.nbPages)), 1),
|
|
822
892
|
l("button", {
|
|
823
893
|
type: "button",
|
|
824
|
-
disabled:
|
|
825
|
-
onClick:
|
|
826
|
-
},
|
|
894
|
+
disabled: s.value.page >= s.value.nbPages - 1,
|
|
895
|
+
onClick: r[1] || (r[1] = (a) => e.controller.setPage(s.value.page + 1))
|
|
896
|
+
}, y(o.value.next), 9, Wt)
|
|
827
897
|
])) : L("", !0);
|
|
828
898
|
}
|
|
829
|
-
}),
|
|
830
|
-
const
|
|
831
|
-
if (
|
|
832
|
-
return
|
|
833
|
-
const
|
|
834
|
-
let
|
|
835
|
-
|
|
836
|
-
const
|
|
837
|
-
for (let
|
|
838
|
-
|
|
839
|
-
|
|
899
|
+
}), re = (t) => t.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/ẞ/gu, "ß").toUpperCase().toLowerCase().replace(/ς/g, "σ"), Yt = (t, e) => {
|
|
900
|
+
const s = { before: "", match: t, after: "" }, o = re(e.trim());
|
|
901
|
+
if (o === "")
|
|
902
|
+
return s;
|
|
903
|
+
const n = [...t], r = [];
|
|
904
|
+
let a = "";
|
|
905
|
+
n.forEach((C, c) => {
|
|
906
|
+
const f = re(C);
|
|
907
|
+
for (let v = 0; v < f.length; v += 1)
|
|
908
|
+
r.push(c);
|
|
909
|
+
a += f;
|
|
840
910
|
});
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
843
|
-
return
|
|
844
|
-
const _ =
|
|
911
|
+
const i = a.indexOf(o);
|
|
912
|
+
if (i === -1)
|
|
913
|
+
return s;
|
|
914
|
+
const _ = r[i], d = r[i + o.length - 1] + 1;
|
|
845
915
|
return {
|
|
846
|
-
before:
|
|
847
|
-
match:
|
|
848
|
-
after:
|
|
916
|
+
before: n.slice(0, _).join(""),
|
|
917
|
+
match: n.slice(_, d).join(""),
|
|
918
|
+
after: n.slice(d).join("")
|
|
849
919
|
};
|
|
850
|
-
},
|
|
920
|
+
}, Zt = {
|
|
851
921
|
key: 0,
|
|
852
922
|
class: "dialog-search-muted"
|
|
853
|
-
},
|
|
923
|
+
}, Jt = { class: "dialog-search-match" }, es = {
|
|
854
924
|
key: 1,
|
|
855
925
|
class: "dialog-search-muted"
|
|
856
|
-
},
|
|
926
|
+
}, fe = /* @__PURE__ */ I({
|
|
857
927
|
__name: "HighlightedTitle",
|
|
858
928
|
props: {
|
|
859
929
|
title: {},
|
|
860
930
|
query: {}
|
|
861
931
|
},
|
|
862
932
|
setup(t) {
|
|
863
|
-
const e = t,
|
|
864
|
-
return (
|
|
865
|
-
|
|
866
|
-
l("span",
|
|
867
|
-
|
|
933
|
+
const e = t, s = S(() => Yt(e.title, e.query));
|
|
934
|
+
return (o, n) => (u(), h(N, null, [
|
|
935
|
+
s.value.before !== "" ? (u(), h("span", Zt, y(s.value.before), 1)) : L("", !0),
|
|
936
|
+
l("span", Jt, y(s.value.match), 1),
|
|
937
|
+
s.value.after !== "" ? (u(), h("span", es, y(s.value.after), 1)) : L("", !0)
|
|
868
938
|
], 64));
|
|
869
939
|
}
|
|
870
|
-
}),
|
|
940
|
+
}), ts = ({ amount: t, currencyCode: e }, s) => e === void 0 ? new Intl.NumberFormat(s).format(Number(t)) : new Intl.NumberFormat(s, {
|
|
871
941
|
style: "currency",
|
|
872
942
|
currency: e
|
|
873
|
-
}).format(Number(t)),
|
|
943
|
+
}).format(Number(t)), ss = (t, e) => {
|
|
874
944
|
if (t === void 0)
|
|
875
945
|
return "";
|
|
876
946
|
try {
|
|
877
|
-
return
|
|
947
|
+
return ts(t.min, e);
|
|
878
948
|
} catch {
|
|
879
949
|
return "";
|
|
880
950
|
}
|
|
881
|
-
},
|
|
951
|
+
}, os = (t) => {
|
|
882
952
|
try {
|
|
883
953
|
const { protocol: e } = new URL(t, window.location.href);
|
|
884
954
|
return e === "http:" || e === "https:" ? t : void 0;
|
|
885
955
|
} catch {
|
|
886
956
|
return;
|
|
887
957
|
}
|
|
888
|
-
},
|
|
958
|
+
}, ve = (t) => t.url === void 0 || t.url === "" ? void 0 : os(t.url), me = (t) => t.title ?? t.handle ?? t.objectID, ns = {
|
|
889
959
|
class: "dialog-search-product-thumb",
|
|
890
960
|
"aria-hidden": "true"
|
|
891
|
-
},
|
|
961
|
+
}, rs = ["src"], is = { class: "dialog-search-product-title" }, as = {
|
|
892
962
|
key: 0,
|
|
893
963
|
class: "dialog-search-product-price"
|
|
894
|
-
},
|
|
964
|
+
}, ls = /* @__PURE__ */ I({
|
|
895
965
|
__name: "DialogSearchProductCard",
|
|
896
966
|
props: {
|
|
897
967
|
controller: {},
|
|
@@ -901,55 +971,55 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
901
971
|
query: { default: "" }
|
|
902
972
|
},
|
|
903
973
|
setup(t) {
|
|
904
|
-
const e = t,
|
|
905
|
-
|
|
974
|
+
const e = t, s = R();
|
|
975
|
+
M(
|
|
906
976
|
() => e.hit,
|
|
907
977
|
() => {
|
|
908
|
-
|
|
978
|
+
s.value !== void 0 && e.controller.observeResult(s.value, e.index);
|
|
909
979
|
},
|
|
910
980
|
{ immediate: !0, flush: "post" }
|
|
911
981
|
);
|
|
912
|
-
const
|
|
913
|
-
() =>
|
|
914
|
-
),
|
|
915
|
-
const _ =
|
|
916
|
-
e.controller.selectResult(e.index, { navigate: !_ }) &&
|
|
917
|
-
},
|
|
918
|
-
|
|
982
|
+
const o = S(() => ve(e.hit)), n = S(
|
|
983
|
+
() => ss(e.hit.priceRange, e.locale)
|
|
984
|
+
), r = (i) => {
|
|
985
|
+
const _ = i.metaKey || i.ctrlKey || i.shiftKey || i.altKey;
|
|
986
|
+
e.controller.selectResult(e.index, { navigate: !_ }) && i.preventDefault();
|
|
987
|
+
}, a = (i) => {
|
|
988
|
+
i.button === 1 && e.controller.selectResult(e.index, { navigate: !1 });
|
|
919
989
|
};
|
|
920
|
-
return (
|
|
990
|
+
return (i, _) => (u(), h("li", {
|
|
921
991
|
ref_key: "cardRef",
|
|
922
|
-
ref:
|
|
992
|
+
ref: s,
|
|
923
993
|
class: "dialog-search-card"
|
|
924
994
|
}, [
|
|
925
|
-
(
|
|
995
|
+
(u(), P(ke(o.value === void 0 ? "div" : "a"), Te({
|
|
926
996
|
class: "dialog-search-product",
|
|
927
|
-
href:
|
|
928
|
-
},
|
|
929
|
-
|
|
997
|
+
href: o.value
|
|
998
|
+
}, Re(
|
|
999
|
+
o.value === void 0 ? {} : { click: r, auxclick: a }
|
|
930
1000
|
)), {
|
|
931
|
-
default:
|
|
932
|
-
l("span",
|
|
933
|
-
e.hit.imageUrl !== void 0 && e.hit.imageUrl !== "" ? (
|
|
1001
|
+
default: le(() => [
|
|
1002
|
+
l("span", ns, [
|
|
1003
|
+
e.hit.imageUrl !== void 0 && e.hit.imageUrl !== "" ? (u(), h("img", {
|
|
934
1004
|
key: 0,
|
|
935
1005
|
src: e.hit.imageUrl,
|
|
936
1006
|
alt: "",
|
|
937
1007
|
loading: "lazy"
|
|
938
|
-
}, null, 8,
|
|
1008
|
+
}, null, 8, rs)) : L("", !0)
|
|
939
1009
|
]),
|
|
940
|
-
l("span",
|
|
941
|
-
|
|
942
|
-
title:
|
|
1010
|
+
l("span", is, [
|
|
1011
|
+
T(fe, {
|
|
1012
|
+
title: H(me)(e.hit),
|
|
943
1013
|
query: e.query
|
|
944
1014
|
}, null, 8, ["title", "query"])
|
|
945
1015
|
]),
|
|
946
|
-
|
|
1016
|
+
n.value !== "" ? (u(), h("span", as, y(n.value), 1)) : L("", !0)
|
|
947
1017
|
]),
|
|
948
1018
|
_: 1
|
|
949
1019
|
}, 16, ["href"]))
|
|
950
1020
|
], 512));
|
|
951
1021
|
}
|
|
952
|
-
}),
|
|
1022
|
+
}), cs = {}, us = {
|
|
953
1023
|
width: "16",
|
|
954
1024
|
height: "16",
|
|
955
1025
|
viewBox: "0 0 256 256",
|
|
@@ -957,12 +1027,12 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
|
|
|
957
1027
|
xmlns: "http://www.w3.org/2000/svg",
|
|
958
1028
|
"aria-hidden": "true"
|
|
959
1029
|
};
|
|
960
|
-
function
|
|
961
|
-
return
|
|
1030
|
+
function ds(t, e) {
|
|
1031
|
+
return u(), h("svg", us, e[0] || (e[0] = [
|
|
962
1032
|
l("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" }, null, -1)
|
|
963
1033
|
]));
|
|
964
1034
|
}
|
|
965
|
-
const
|
|
1035
|
+
const ps = /* @__PURE__ */ x(cs, [["render", ds]]), hs = {}, _s = {
|
|
966
1036
|
width: "12",
|
|
967
1037
|
height: "12",
|
|
968
1038
|
viewBox: "0 0 256 256",
|
|
@@ -970,21 +1040,21 @@ const so = /* @__PURE__ */ D(eo, [["render", oo]]), no = {}, ro = {
|
|
|
970
1040
|
xmlns: "http://www.w3.org/2000/svg",
|
|
971
1041
|
"aria-hidden": "true"
|
|
972
1042
|
};
|
|
973
|
-
function
|
|
974
|
-
return
|
|
1043
|
+
function gs(t, e) {
|
|
1044
|
+
return u(), h("svg", _s, e[0] || (e[0] = [
|
|
975
1045
|
l("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" }, null, -1)
|
|
976
1046
|
]));
|
|
977
1047
|
}
|
|
978
|
-
const
|
|
979
|
-
const
|
|
980
|
-
return
|
|
981
|
-
}),
|
|
1048
|
+
const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMap((e) => {
|
|
1049
|
+
const s = ve(e);
|
|
1050
|
+
return s === void 0 ? [] : [{ collection: e, href: s }];
|
|
1051
|
+
}), vs = {
|
|
982
1052
|
key: 0,
|
|
983
1053
|
class: "dialog-search-collections"
|
|
984
|
-
},
|
|
1054
|
+
}, ms = { class: "dialog-search-section-head" }, bs = { class: "dialog-search-label" }, Ss = { class: "dialog-search-count" }, Cs = { class: "dialog-search-collection-list" }, Es = ["href"], ys = {
|
|
985
1055
|
class: "dialog-search-collection-thumb",
|
|
986
1056
|
"aria-hidden": "true"
|
|
987
|
-
},
|
|
1057
|
+
}, Is = ["src"], ws = { class: "dialog-search-collection-title" }, $s = { class: "dialog-search-caret" }, ks = /* @__PURE__ */ I({
|
|
988
1058
|
__name: "DialogSearchCollections",
|
|
989
1059
|
props: {
|
|
990
1060
|
collections: {},
|
|
@@ -992,50 +1062,50 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
|
|
|
992
1062
|
messages: {}
|
|
993
1063
|
},
|
|
994
1064
|
setup(t) {
|
|
995
|
-
const e = t,
|
|
996
|
-
return (
|
|
997
|
-
l("div",
|
|
998
|
-
l("p",
|
|
999
|
-
l("span",
|
|
1065
|
+
const e = t, s = S(() => be(e.collections));
|
|
1066
|
+
return (o, n) => s.value.length > 0 ? (u(), h("aside", vs, [
|
|
1067
|
+
l("div", ms, [
|
|
1068
|
+
l("p", bs, y(e.messages.collectionsLabel), 1),
|
|
1069
|
+
l("span", Ss, y(e.messages.collectionsCount(s.value.length)), 1)
|
|
1000
1070
|
]),
|
|
1001
|
-
l("ul",
|
|
1002
|
-
(
|
|
1003
|
-
key:
|
|
1071
|
+
l("ul", Cs, [
|
|
1072
|
+
(u(!0), h(N, null, W(s.value, ({ collection: r, href: a }) => (u(), h("li", {
|
|
1073
|
+
key: r.objectID
|
|
1004
1074
|
}, [
|
|
1005
1075
|
l("a", {
|
|
1006
1076
|
class: "dialog-search-collection",
|
|
1007
|
-
href:
|
|
1077
|
+
href: a
|
|
1008
1078
|
}, [
|
|
1009
|
-
l("span",
|
|
1010
|
-
|
|
1079
|
+
l("span", ys, [
|
|
1080
|
+
r.imageUrl !== void 0 && r.imageUrl !== "" ? (u(), h("img", {
|
|
1011
1081
|
key: 0,
|
|
1012
|
-
src:
|
|
1082
|
+
src: r.imageUrl,
|
|
1013
1083
|
alt: "",
|
|
1014
1084
|
loading: "lazy"
|
|
1015
|
-
}, null, 8,
|
|
1085
|
+
}, null, 8, Is)) : L("", !0)
|
|
1016
1086
|
]),
|
|
1017
|
-
l("span",
|
|
1018
|
-
|
|
1019
|
-
title:
|
|
1087
|
+
l("span", ws, [
|
|
1088
|
+
T(fe, {
|
|
1089
|
+
title: H(me)(r),
|
|
1020
1090
|
query: e.query
|
|
1021
1091
|
}, null, 8, ["title", "query"])
|
|
1022
1092
|
]),
|
|
1023
|
-
l("span",
|
|
1024
|
-
|
|
1093
|
+
l("span", $s, [
|
|
1094
|
+
T(fs)
|
|
1025
1095
|
])
|
|
1026
|
-
], 8,
|
|
1096
|
+
], 8, Es)
|
|
1027
1097
|
]))), 128))
|
|
1028
1098
|
])
|
|
1029
1099
|
])) : L("", !0);
|
|
1030
1100
|
}
|
|
1031
|
-
}),
|
|
1101
|
+
}), Ts = { class: "dialog-search-products" }, Rs = { class: "dialog-search-section-head" }, As = { class: "dialog-search-label" }, Ls = {
|
|
1032
1102
|
key: 0,
|
|
1033
1103
|
class: "dialog-search-label-count"
|
|
1034
|
-
},
|
|
1104
|
+
}, xs = { class: "dialog-search-results" }, Ds = {
|
|
1035
1105
|
key: 0,
|
|
1036
1106
|
class: "dialog-search-empty",
|
|
1037
1107
|
role: "status"
|
|
1038
|
-
},
|
|
1108
|
+
}, Ps = /* @__PURE__ */ I({
|
|
1039
1109
|
__name: "DialogSearchProducts",
|
|
1040
1110
|
props: {
|
|
1041
1111
|
controller: {},
|
|
@@ -1045,76 +1115,76 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
|
|
|
1045
1115
|
},
|
|
1046
1116
|
setup(t) {
|
|
1047
1117
|
const e = t;
|
|
1048
|
-
return (
|
|
1049
|
-
l("div",
|
|
1050
|
-
l("p",
|
|
1051
|
-
|
|
1052
|
-
e.response.nbHits > 0 ? (
|
|
1118
|
+
return (s, o) => (u(), h("section", Ts, [
|
|
1119
|
+
l("div", Rs, [
|
|
1120
|
+
l("p", As, [
|
|
1121
|
+
ce(y(e.messages.productsLabel), 1),
|
|
1122
|
+
e.response.nbHits > 0 ? (u(), h("span", Ls, " · " + y(e.messages.resultsCount(e.response.nbHits)), 1)) : L("", !0)
|
|
1053
1123
|
])
|
|
1054
1124
|
]),
|
|
1055
|
-
l("ul",
|
|
1056
|
-
e.response.hits.length === 0 ? (
|
|
1057
|
-
key:
|
|
1125
|
+
l("ul", xs, [
|
|
1126
|
+
e.response.hits.length === 0 ? (u(), h("li", Ds, y(e.messages.noResults), 1)) : (u(!0), h(N, { key: 1 }, W(e.response.hits, (n, r) => (u(), P(ls, {
|
|
1127
|
+
key: n.objectID,
|
|
1058
1128
|
controller: e.controller,
|
|
1059
|
-
hit:
|
|
1060
|
-
index:
|
|
1129
|
+
hit: n,
|
|
1130
|
+
index: r,
|
|
1061
1131
|
locale: e.locale,
|
|
1062
1132
|
query: e.response.query
|
|
1063
1133
|
}, null, 8, ["controller", "hit", "index", "locale", "query"]))), 128))
|
|
1064
1134
|
])
|
|
1065
1135
|
]));
|
|
1066
1136
|
}
|
|
1067
|
-
}),
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1137
|
+
}), V = 8, U = 16, Os = 200, Ns = 1440, qs = (t, e) => t.bottom > 0 && t.top < e, Ms = (t, e) => {
|
|
1138
|
+
const s = Math.min(
|
|
1139
|
+
Ns,
|
|
1070
1140
|
e - 2 * U
|
|
1071
|
-
),
|
|
1141
|
+
), o = t.left + t.width / 2 - s / 2;
|
|
1072
1142
|
return { left: `${Math.min(
|
|
1073
|
-
Math.max(
|
|
1074
|
-
e - U -
|
|
1075
|
-
)}px`, width: `${
|
|
1076
|
-
},
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1079
|
-
...
|
|
1080
|
-
bottom: `${
|
|
1081
|
-
maxHeight: `${Math.max(
|
|
1143
|
+
Math.max(o, U),
|
|
1144
|
+
e - U - s
|
|
1145
|
+
)}px`, width: `${s}px` };
|
|
1146
|
+
}, Us = (t, e, s) => {
|
|
1147
|
+
const o = s - t.bottom - V - U, n = t.top - V - U, r = Ms(t, e);
|
|
1148
|
+
return o < Os && n > o ? {
|
|
1149
|
+
...r,
|
|
1150
|
+
bottom: `${s - t.top + V}px`,
|
|
1151
|
+
maxHeight: `${Math.max(n, 0)}px`
|
|
1082
1152
|
} : {
|
|
1083
|
-
...
|
|
1084
|
-
top: `${t.bottom +
|
|
1085
|
-
maxHeight: `${Math.max(
|
|
1153
|
+
...r,
|
|
1154
|
+
top: `${t.bottom + V}px`,
|
|
1155
|
+
maxHeight: `${Math.max(o, 0)}px`
|
|
1086
1156
|
};
|
|
1087
|
-
},
|
|
1157
|
+
}, Hs = (t) => {
|
|
1088
1158
|
const e = t.trim().replace(/^#/, "");
|
|
1089
1159
|
if (!/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e))
|
|
1090
1160
|
return;
|
|
1091
|
-
const
|
|
1161
|
+
const s = e.length <= 4 ? [...e].map((o) => o + o).join("") : e;
|
|
1092
1162
|
return [0, 2, 4].map(
|
|
1093
|
-
(
|
|
1163
|
+
(o) => Number.parseInt(s.slice(o, o + 2), 16)
|
|
1094
1164
|
);
|
|
1095
|
-
},
|
|
1165
|
+
}, Vs = (t) => {
|
|
1096
1166
|
const e = /^rgba?\((\d+), (\d+), (\d+)(?:, [\d.]+)?\)$/.exec(t);
|
|
1097
1167
|
if (e !== null)
|
|
1098
1168
|
return [e[1], e[2], e[3]].map(Number);
|
|
1099
|
-
},
|
|
1169
|
+
}, Bs = (t) => {
|
|
1100
1170
|
if (typeof document > "u")
|
|
1101
1171
|
return;
|
|
1102
1172
|
const e = document.createElement("span");
|
|
1103
1173
|
if (e.style.color = t, e.style.color === "")
|
|
1104
1174
|
return;
|
|
1105
1175
|
document.body.appendChild(e);
|
|
1106
|
-
const
|
|
1107
|
-
return e.remove(),
|
|
1108
|
-
},
|
|
1176
|
+
const s = Vs(getComputedStyle(e).color);
|
|
1177
|
+
return e.remove(), s;
|
|
1178
|
+
}, Ks = (t) => Hs(t) ?? Bs(t), Fs = (t) => {
|
|
1109
1179
|
const e = t / 255;
|
|
1110
1180
|
return e <= 0.03928 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
1111
|
-
},
|
|
1112
|
-
const e =
|
|
1181
|
+
}, Se = (t) => {
|
|
1182
|
+
const e = Ks(t);
|
|
1113
1183
|
if (e === void 0)
|
|
1114
1184
|
return;
|
|
1115
|
-
const [
|
|
1116
|
-
return 0.2126 *
|
|
1117
|
-
},
|
|
1185
|
+
const [s, o, n] = e.map(Fs);
|
|
1186
|
+
return 0.2126 * s + 0.7152 * o + 0.0722 * n;
|
|
1187
|
+
}, zs = "#181825", js = "#ffffff", Gs = "straight", G = 0.5, Q = {
|
|
1118
1188
|
light: {
|
|
1119
1189
|
panel: "#ffffff",
|
|
1120
1190
|
side: "#fafbfc",
|
|
@@ -1133,7 +1203,7 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
|
|
|
1133
1203
|
hover: "#242830",
|
|
1134
1204
|
thumb: "#2b2f38"
|
|
1135
1205
|
}
|
|
1136
|
-
},
|
|
1206
|
+
}, Qs = {
|
|
1137
1207
|
rectangle: {
|
|
1138
1208
|
"r-panel": "4px",
|
|
1139
1209
|
"r-item": "4px",
|
|
@@ -1146,107 +1216,107 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
|
|
|
1146
1216
|
"r-thumb": "8px",
|
|
1147
1217
|
"r-btn": "10px"
|
|
1148
1218
|
}
|
|
1149
|
-
},
|
|
1150
|
-
const e = t === void 0 ? void 0 :
|
|
1219
|
+
}, B = (t) => t === void 0 || t.trim() === "" ? void 0 : t.trim(), Ws = (t) => {
|
|
1220
|
+
const e = t === void 0 ? void 0 : Se(t);
|
|
1151
1221
|
return e === void 0 ? "light" : e < G ? "dark" : "light";
|
|
1152
|
-
},
|
|
1153
|
-
const
|
|
1154
|
-
return
|
|
1155
|
-
},
|
|
1156
|
-
const e =
|
|
1222
|
+
}, Xs = (t, e) => {
|
|
1223
|
+
const s = Se(t);
|
|
1224
|
+
return s === void 0 ? Q[e].text : (e === "light" ? s < G : s >= G) ? t : Q[e].text;
|
|
1225
|
+
}, Ys = (t) => {
|
|
1226
|
+
const e = Ws(B(t == null ? void 0 : t.backgroundColor)), s = (t == null ? void 0 : t.ctaBorderType) === Gs ? "rectangle" : "rectangle-rounded", o = B(t == null ? void 0 : t.primaryColor) ?? zs, n = B(t == null ? void 0 : t.fontFamily), r = {
|
|
1157
1227
|
...Q[e],
|
|
1158
|
-
...
|
|
1159
|
-
primary:
|
|
1160
|
-
accent:
|
|
1161
|
-
"cta-text":
|
|
1162
|
-
...
|
|
1228
|
+
...Qs[s],
|
|
1229
|
+
primary: o,
|
|
1230
|
+
accent: Xs(o, e),
|
|
1231
|
+
"cta-text": B(t == null ? void 0 : t.ctaTextColor) ?? js,
|
|
1232
|
+
...n === void 0 ? {} : { font: n }
|
|
1163
1233
|
};
|
|
1164
1234
|
return Object.fromEntries(
|
|
1165
|
-
Object.entries(
|
|
1235
|
+
Object.entries(r).map(([a, i]) => [`--dso-${a}`, i])
|
|
1166
1236
|
);
|
|
1167
|
-
},
|
|
1168
|
-
const e =
|
|
1169
|
-
return
|
|
1237
|
+
}, Zs = (t) => {
|
|
1238
|
+
const e = R(), s = R(void 0), o = R({ width: 0, height: 0 });
|
|
1239
|
+
return M(
|
|
1170
1240
|
t,
|
|
1171
|
-
(
|
|
1172
|
-
if (!
|
|
1241
|
+
(n, r, a) => {
|
|
1242
|
+
if (!n)
|
|
1173
1243
|
return;
|
|
1174
|
-
const
|
|
1244
|
+
const i = () => {
|
|
1175
1245
|
const _ = e.value;
|
|
1176
1246
|
if (_ === void 0)
|
|
1177
1247
|
return;
|
|
1178
|
-
const
|
|
1179
|
-
(
|
|
1248
|
+
const d = _.previousElementSibling ?? _, { top: C, bottom: c, left: f, width: v } = d.getBoundingClientRect();
|
|
1249
|
+
(o.value.width !== window.innerWidth || o.value.height !== window.innerHeight) && (o.value = {
|
|
1180
1250
|
width: window.innerWidth,
|
|
1181
1251
|
height: window.innerHeight
|
|
1182
1252
|
});
|
|
1183
|
-
const g =
|
|
1184
|
-
(g === void 0 || g.top !==
|
|
1253
|
+
const g = s.value;
|
|
1254
|
+
(g === void 0 || g.top !== C || g.bottom !== c || g.left !== f || g.width !== v) && (s.value = { top: C, bottom: c, left: f, width: v });
|
|
1185
1255
|
};
|
|
1186
|
-
|
|
1187
|
-
window.removeEventListener("scroll",
|
|
1256
|
+
i(), window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), a(() => {
|
|
1257
|
+
window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
|
|
1188
1258
|
});
|
|
1189
1259
|
},
|
|
1190
1260
|
{ immediate: !0, flush: "post" }
|
|
1191
|
-
), { anchorRef: e, rect:
|
|
1192
|
-
},
|
|
1193
|
-
const
|
|
1194
|
-
() => t.value.status !== A.IDLE && !
|
|
1261
|
+
), { anchorRef: e, rect: s, viewport: o };
|
|
1262
|
+
}, Js = (t, e) => {
|
|
1263
|
+
const s = R(!1), o = R(), n = S(
|
|
1264
|
+
() => t.value.status !== A.IDLE && !s.value
|
|
1195
1265
|
);
|
|
1196
|
-
|
|
1266
|
+
M(
|
|
1197
1267
|
() => t.value.query,
|
|
1198
1268
|
() => {
|
|
1199
|
-
|
|
1269
|
+
s.value = !1;
|
|
1200
1270
|
}
|
|
1201
|
-
),
|
|
1202
|
-
|
|
1203
|
-
(
|
|
1204
|
-
if (!
|
|
1271
|
+
), M(
|
|
1272
|
+
n,
|
|
1273
|
+
(a, i, _) => {
|
|
1274
|
+
if (!a)
|
|
1205
1275
|
return;
|
|
1206
|
-
const
|
|
1207
|
-
var
|
|
1208
|
-
const
|
|
1209
|
-
if (!(
|
|
1276
|
+
const d = (C) => {
|
|
1277
|
+
var w, $;
|
|
1278
|
+
const c = C.target;
|
|
1279
|
+
if (!(c instanceof Node))
|
|
1210
1280
|
return;
|
|
1211
|
-
const
|
|
1212
|
-
!
|
|
1281
|
+
const f = (w = e.value) == null ? void 0 : w.previousElementSibling, v = (($ = o.value) == null ? void 0 : $.contains(c)) ?? !1, g = (f == null ? void 0 : f.contains(c)) ?? !1;
|
|
1282
|
+
!v && !g && (s.value = !0);
|
|
1213
1283
|
};
|
|
1214
|
-
document.addEventListener("pointerdown",
|
|
1215
|
-
() => document.removeEventListener("pointerdown",
|
|
1284
|
+
document.addEventListener("pointerdown", d), _(
|
|
1285
|
+
() => document.removeEventListener("pointerdown", d)
|
|
1216
1286
|
);
|
|
1217
1287
|
},
|
|
1218
1288
|
{ immediate: !0 }
|
|
1219
1289
|
);
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1290
|
+
const r = () => {
|
|
1291
|
+
s.value = !1;
|
|
1222
1292
|
};
|
|
1223
|
-
return
|
|
1224
|
-
var
|
|
1225
|
-
(
|
|
1293
|
+
return K(() => {
|
|
1294
|
+
var a, i;
|
|
1295
|
+
(i = (a = e.value) == null ? void 0 : a.previousElementSibling) == null || i.addEventListener(
|
|
1226
1296
|
"focusin",
|
|
1227
|
-
|
|
1297
|
+
r
|
|
1228
1298
|
);
|
|
1229
|
-
}),
|
|
1230
|
-
var
|
|
1231
|
-
(
|
|
1299
|
+
}), ue(() => {
|
|
1300
|
+
var a, i;
|
|
1301
|
+
(i = (a = e.value) == null ? void 0 : a.previousElementSibling) == null || i.removeEventListener(
|
|
1232
1302
|
"focusin",
|
|
1233
|
-
|
|
1303
|
+
r
|
|
1234
1304
|
);
|
|
1235
|
-
}), { isOpen:
|
|
1236
|
-
},
|
|
1305
|
+
}), { isOpen: n, panelRef: o };
|
|
1306
|
+
}, eo = {
|
|
1237
1307
|
key: 0,
|
|
1238
1308
|
class: "dialog-search-error"
|
|
1239
|
-
},
|
|
1309
|
+
}, to = {
|
|
1240
1310
|
role: "alert",
|
|
1241
1311
|
class: "dialog-search-status dialog-search-status-error"
|
|
1242
|
-
},
|
|
1312
|
+
}, so = {
|
|
1243
1313
|
key: 1,
|
|
1244
1314
|
role: "status",
|
|
1245
1315
|
class: "dialog-search-status"
|
|
1246
|
-
},
|
|
1316
|
+
}, oo = {
|
|
1247
1317
|
key: 0,
|
|
1248
1318
|
class: "dialog-search-footer"
|
|
1249
|
-
},
|
|
1319
|
+
}, no = ["href"], co = /* @__PURE__ */ I({
|
|
1250
1320
|
__name: "DialogSearchResults",
|
|
1251
1321
|
props: {
|
|
1252
1322
|
controller: {},
|
|
@@ -1257,76 +1327,76 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
|
|
|
1257
1327
|
seeAllHref: { type: Function, default: void 0 }
|
|
1258
1328
|
},
|
|
1259
1329
|
setup(t) {
|
|
1260
|
-
const e = t,
|
|
1261
|
-
() => _.value &&
|
|
1262
|
-
),
|
|
1263
|
-
...
|
|
1264
|
-
...
|
|
1265
|
-
})),
|
|
1330
|
+
const e = t, s = (p) => p instanceof Ne ? `Search failed (${p.status}${p.code ? ` ${p.code}` : ""}): ${p.message}` : "Search failed: network error. Check your connection and try again.", o = S(() => e.state), n = S(() => e.state.status !== A.IDLE), { anchorRef: r, rect: a, viewport: i } = Zs(n), { isOpen: _, panelRef: d } = Js(o, r), C = S(
|
|
1331
|
+
() => _.value && a.value !== void 0 && qs(a.value, i.value.height)
|
|
1332
|
+
), c = S(() => Ys(e.theme)), f = S(() => ({
|
|
1333
|
+
...a.value === void 0 ? {} : Us(a.value, i.value.width, i.value.height),
|
|
1334
|
+
...c.value
|
|
1335
|
+
})), v = S(() => _e(e.locale)), g = S(() => e.state.response), w = S(
|
|
1266
1336
|
() => {
|
|
1267
|
-
var p,
|
|
1268
|
-
return ((
|
|
1337
|
+
var p, E;
|
|
1338
|
+
return ((E = (p = e.state.sections) == null ? void 0 : p.collections) == null ? void 0 : E.hits) ?? [];
|
|
1269
1339
|
}
|
|
1270
|
-
),
|
|
1271
|
-
() =>
|
|
1272
|
-
),
|
|
1340
|
+
), $ = S(
|
|
1341
|
+
() => be(w.value).length > 0
|
|
1342
|
+
), k = S(
|
|
1273
1343
|
() => e.seeAllHref !== void 0 && g.value !== void 0 && g.value.nbHits > 0
|
|
1274
|
-
),
|
|
1344
|
+
), b = S(() => !k.value && ge(e.state)), m = S(
|
|
1275
1345
|
() => {
|
|
1276
1346
|
var p;
|
|
1277
1347
|
return g.value === void 0 || (p = e.seeAllHref) == null ? void 0 : p.call(e, g.value.query);
|
|
1278
1348
|
}
|
|
1279
1349
|
);
|
|
1280
|
-
return (p,
|
|
1350
|
+
return (p, E) => (u(), h(N, null, [
|
|
1281
1351
|
l("div", {
|
|
1282
1352
|
ref_key: "anchorRef",
|
|
1283
|
-
ref:
|
|
1353
|
+
ref: r
|
|
1284
1354
|
}, null, 512),
|
|
1285
|
-
|
|
1355
|
+
C.value ? (u(), P(Ae, {
|
|
1286
1356
|
key: 0,
|
|
1287
1357
|
to: "body"
|
|
1288
1358
|
}, [
|
|
1289
1359
|
l("div", {
|
|
1290
1360
|
ref_key: "panelRef",
|
|
1291
|
-
ref:
|
|
1292
|
-
class:
|
|
1293
|
-
style:
|
|
1361
|
+
ref: d,
|
|
1362
|
+
class: Z(["dialog-search-panel", `dialog-search-panel--${e.layout}`]),
|
|
1363
|
+
style: Le(f.value)
|
|
1294
1364
|
}, [
|
|
1295
|
-
e.state.status ===
|
|
1296
|
-
l("p",
|
|
1365
|
+
e.state.status === H(A).ERROR ? (u(), h("div", eo, [
|
|
1366
|
+
l("p", to, y(s(e.state.error)), 1),
|
|
1297
1367
|
l("button", {
|
|
1298
1368
|
type: "button",
|
|
1299
1369
|
class: "dialog-search-retry",
|
|
1300
|
-
onClick:
|
|
1301
|
-
},
|
|
1302
|
-
])) : g.value === void 0 ? (
|
|
1370
|
+
onClick: E[0] || (E[0] = (O) => e.controller.retry())
|
|
1371
|
+
}, y(v.value.retry), 1)
|
|
1372
|
+
])) : g.value === void 0 ? (u(), h("p", so, y(v.value.searching(e.state.query)), 1)) : (u(), h(N, { key: 2 }, [
|
|
1303
1373
|
l("div", {
|
|
1304
|
-
class:
|
|
1374
|
+
class: Z([
|
|
1305
1375
|
"dialog-search-body",
|
|
1306
|
-
{ "dialog-search-body--no-collections":
|
|
1376
|
+
{ "dialog-search-body--no-collections": !$.value }
|
|
1307
1377
|
])
|
|
1308
1378
|
}, [
|
|
1309
|
-
|
|
1310
|
-
collections:
|
|
1379
|
+
T(ks, {
|
|
1380
|
+
collections: w.value,
|
|
1311
1381
|
query: g.value.query,
|
|
1312
|
-
messages:
|
|
1382
|
+
messages: v.value
|
|
1313
1383
|
}, null, 8, ["collections", "query", "messages"]),
|
|
1314
|
-
|
|
1384
|
+
T(Ps, {
|
|
1315
1385
|
controller: e.controller,
|
|
1316
1386
|
response: g.value,
|
|
1317
1387
|
locale: e.locale,
|
|
1318
|
-
messages:
|
|
1388
|
+
messages: v.value
|
|
1319
1389
|
}, null, 8, ["controller", "response", "locale", "messages"])
|
|
1320
1390
|
], 2),
|
|
1321
|
-
|
|
1322
|
-
|
|
1391
|
+
k.value || b.value ? (u(), h("div", oo, [
|
|
1392
|
+
k.value ? (u(), h("a", {
|
|
1323
1393
|
key: 0,
|
|
1324
1394
|
class: "dialog-search-cta",
|
|
1325
|
-
href:
|
|
1395
|
+
href: m.value
|
|
1326
1396
|
}, [
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
], 8,
|
|
1397
|
+
ce(y(v.value.seeAllLabel(g.value.nbHits)) + " ", 1),
|
|
1398
|
+
T(ps)
|
|
1399
|
+
], 8, no)) : (u(), P(Xt, {
|
|
1330
1400
|
key: 1,
|
|
1331
1401
|
controller: e.controller,
|
|
1332
1402
|
state: e.state,
|
|
@@ -1338,33 +1408,33 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
|
|
|
1338
1408
|
])) : L("", !0)
|
|
1339
1409
|
], 64));
|
|
1340
1410
|
}
|
|
1341
|
-
}),
|
|
1342
|
-
const { client: e, surface:
|
|
1343
|
-
search: (
|
|
1411
|
+
}), uo = (t) => {
|
|
1412
|
+
const { client: e, surface: s = "search_page", ...o } = t, n = Xe({
|
|
1413
|
+
search: (i, _) => e.search(i, _),
|
|
1344
1414
|
analytics: {
|
|
1345
|
-
surface:
|
|
1346
|
-
trackViewSearchResults: (
|
|
1347
|
-
trackSelectSearchResult: (
|
|
1415
|
+
surface: s,
|
|
1416
|
+
trackViewSearchResults: (i) => e.trackViewSearchResults(i),
|
|
1417
|
+
trackSelectSearchResult: (i) => e.trackSelectSearchResult(i)
|
|
1348
1418
|
},
|
|
1349
|
-
...
|
|
1350
|
-
}),
|
|
1351
|
-
|
|
1419
|
+
...o
|
|
1420
|
+
}), r = xe(n.getState()), a = n.subscribe(() => {
|
|
1421
|
+
r.value = n.getState();
|
|
1352
1422
|
});
|
|
1353
|
-
return
|
|
1354
|
-
|
|
1423
|
+
return K(() => {
|
|
1424
|
+
pe({
|
|
1355
1425
|
method: "vue",
|
|
1356
|
-
version: "3.
|
|
1426
|
+
version: "3.9.0"
|
|
1357
1427
|
});
|
|
1358
|
-
}),
|
|
1359
|
-
|
|
1360
|
-
}), { controller:
|
|
1428
|
+
}), ue(() => {
|
|
1429
|
+
a(), n.dispose();
|
|
1430
|
+
}), { controller: n, state: r, theme: e.theme };
|
|
1361
1431
|
};
|
|
1362
1432
|
export {
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1433
|
+
Tt as DialogInput,
|
|
1434
|
+
ao as DialogProductBlock,
|
|
1435
|
+
lo as DialogSearchBar,
|
|
1436
|
+
Xt as DialogSearchPagination,
|
|
1437
|
+
ls as DialogSearchProductCard,
|
|
1438
|
+
co as DialogSearchResults,
|
|
1439
|
+
uo as useDialogSearch
|
|
1370
1440
|
};
|