@getlupa/client 1.18.2 → 1.18.5
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/dist/lupaSearch.iife.js +629 -163
- package/dist/lupaSearch.js +629 -163
- package/dist/lupaSearch.mjs +629 -163
- package/dist/lupaSearch.umd.js +629 -163
- package/dist/src/modules/pluginManager/PluginConfigurationMerger.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -12621,6 +12621,11 @@ var __async = (__this, __arguments, generator) => {
|
|
|
12621
12621
|
}
|
|
12622
12622
|
return result2;
|
|
12623
12623
|
};
|
|
12624
|
+
const getSocketClientId = () => {
|
|
12625
|
+
const timestamp = Date.now().toString(36);
|
|
12626
|
+
const randomString = getRandomString(8);
|
|
12627
|
+
return `${timestamp}-${randomString}`;
|
|
12628
|
+
};
|
|
12624
12629
|
const toFixedIfNecessary = (value, precision = 2) => {
|
|
12625
12630
|
return (+parseFloat(value).toFixed(precision)).toString();
|
|
12626
12631
|
};
|
|
@@ -12735,6 +12740,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
12735
12740
|
links: {
|
|
12736
12741
|
searchResults: "/search"
|
|
12737
12742
|
},
|
|
12743
|
+
voiceSearch: {
|
|
12744
|
+
enabled: false,
|
|
12745
|
+
queryKey: ""
|
|
12746
|
+
},
|
|
12738
12747
|
panels: [
|
|
12739
12748
|
{
|
|
12740
12749
|
type: "suggestion",
|
|
@@ -14316,10 +14325,354 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14316
14325
|
resetHighlightIndex
|
|
14317
14326
|
};
|
|
14318
14327
|
});
|
|
14328
|
+
const Env = {
|
|
14329
|
+
production: "https://api.lupasearch.com/v1/",
|
|
14330
|
+
staging: "https://api.staging.lupasearch.com/v1/"
|
|
14331
|
+
};
|
|
14332
|
+
const VoiceServiceEnv = {
|
|
14333
|
+
production: "ws://voice.lupasearch.com:3001",
|
|
14334
|
+
staging: "ws://voice.lupasearch.dev:3001"
|
|
14335
|
+
};
|
|
14336
|
+
const DEFAULT_REQUEST_CONFIG = {
|
|
14337
|
+
method: "POST",
|
|
14338
|
+
headers: { "Content-Type": "application/json" }
|
|
14339
|
+
};
|
|
14340
|
+
const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
|
|
14341
|
+
const getVoiceServiceApiUrl = (environment, customVoiceServiceUrl) => {
|
|
14342
|
+
if (customVoiceServiceUrl) {
|
|
14343
|
+
return customVoiceServiceUrl;
|
|
14344
|
+
}
|
|
14345
|
+
return VoiceServiceEnv[environment] || VoiceServiceEnv["production"];
|
|
14346
|
+
};
|
|
14347
|
+
const getApiUrl = (environment, customBaseUrl) => {
|
|
14348
|
+
if (customBaseUrl) {
|
|
14349
|
+
return customBaseUrl;
|
|
14350
|
+
}
|
|
14351
|
+
return Env[environment] || Env["production"];
|
|
14352
|
+
};
|
|
14353
|
+
const _sfc_main$1z = /* @__PURE__ */ defineComponent({
|
|
14354
|
+
__name: "VoiceSearchProgressCircle",
|
|
14355
|
+
props: {
|
|
14356
|
+
isRecording: { type: Boolean },
|
|
14357
|
+
timesliceLimit: {},
|
|
14358
|
+
timeSliceLength: {}
|
|
14359
|
+
},
|
|
14360
|
+
setup(__props, { expose: __expose }) {
|
|
14361
|
+
const props = __props;
|
|
14362
|
+
const progressBar = ref(null);
|
|
14363
|
+
const getProgressBarColor = (progressBarStyle) => {
|
|
14364
|
+
if (!progressBarStyle.backgroundImage.startsWith("conic-gradient")) {
|
|
14365
|
+
return progressBarStyle.backgroundColor;
|
|
14366
|
+
}
|
|
14367
|
+
const colorStops = progressBarStyle.backgroundImage.replace(/conic-gradient\(|\)$/g, "").split(")");
|
|
14368
|
+
if (colorStops.length > 1) {
|
|
14369
|
+
return `${colorStops[0]})`;
|
|
14370
|
+
} else {
|
|
14371
|
+
return progressBarStyle.backgroundColor;
|
|
14372
|
+
}
|
|
14373
|
+
};
|
|
14374
|
+
const startProgressBar = () => {
|
|
14375
|
+
if (!progressBar.value || !props.isRecording) {
|
|
14376
|
+
return;
|
|
14377
|
+
}
|
|
14378
|
+
const duration = props.timesliceLimit * props.timeSliceLength;
|
|
14379
|
+
const progressBarStyle = window.getComputedStyle(progressBar.value);
|
|
14380
|
+
const progressBarColor = getProgressBarColor(progressBarStyle);
|
|
14381
|
+
progressBar.value.style.background = `conic-gradient(${progressBarColor} 0%, transparent 0%)`;
|
|
14382
|
+
let startTime = null;
|
|
14383
|
+
function updateProgress(timestamp) {
|
|
14384
|
+
if (!progressBar.value || !props.isRecording) {
|
|
14385
|
+
return;
|
|
14386
|
+
}
|
|
14387
|
+
if (!startTime)
|
|
14388
|
+
startTime = timestamp;
|
|
14389
|
+
const elapsed = timestamp - startTime;
|
|
14390
|
+
const progress = Math.min(elapsed / duration, 1) * 100;
|
|
14391
|
+
progressBar.value.style.background = `conic-gradient(${progressBarColor} ${progress}%, transparent ${progress}%)`;
|
|
14392
|
+
if (elapsed < duration) {
|
|
14393
|
+
requestAnimationFrame(updateProgress);
|
|
14394
|
+
}
|
|
14395
|
+
}
|
|
14396
|
+
requestAnimationFrame(updateProgress);
|
|
14397
|
+
};
|
|
14398
|
+
const stopProgressBar = () => {
|
|
14399
|
+
if (!progressBar.value) {
|
|
14400
|
+
return;
|
|
14401
|
+
}
|
|
14402
|
+
progressBar.value.style.background = "";
|
|
14403
|
+
};
|
|
14404
|
+
__expose({
|
|
14405
|
+
startProgressBar,
|
|
14406
|
+
stopProgressBar
|
|
14407
|
+
});
|
|
14408
|
+
return (_ctx, _cache) => {
|
|
14409
|
+
return openBlock(), createElementBlock("div", {
|
|
14410
|
+
ref_key: "progressBar",
|
|
14411
|
+
ref: progressBar,
|
|
14412
|
+
class: "lupa-progress-circle"
|
|
14413
|
+
}, null, 512);
|
|
14414
|
+
};
|
|
14415
|
+
}
|
|
14416
|
+
});
|
|
14417
|
+
const buildSocketMessageFrameHeader = (event, payloadLength) => {
|
|
14418
|
+
const headerObj = { event, length: payloadLength };
|
|
14419
|
+
const headerJson = JSON.stringify(headerObj);
|
|
14420
|
+
const headerBytes = new TextEncoder().encode(headerJson);
|
|
14421
|
+
const headerLength = new Uint32Array([headerBytes.length]);
|
|
14422
|
+
const headerLengthBytes = new Uint8Array(headerLength.buffer);
|
|
14423
|
+
const result2 = new Uint8Array(4 + headerBytes.length);
|
|
14424
|
+
result2.set(headerLengthBytes, 0);
|
|
14425
|
+
result2.set(headerBytes, 4);
|
|
14426
|
+
return result2;
|
|
14427
|
+
};
|
|
14428
|
+
function useVoiceRecorder(options) {
|
|
14429
|
+
const socket = ref(null);
|
|
14430
|
+
const mediaStream = ref(null);
|
|
14431
|
+
const mediaRecorder = ref(null);
|
|
14432
|
+
const isRecording = ref(false);
|
|
14433
|
+
const errorRef = ref(null);
|
|
14434
|
+
const transcription = ref("");
|
|
14435
|
+
const timeSliceLength = computed(() => {
|
|
14436
|
+
var _a;
|
|
14437
|
+
return (_a = options.timesliceLength) != null ? _a : 1e3;
|
|
14438
|
+
});
|
|
14439
|
+
onBeforeUnmount(() => {
|
|
14440
|
+
closeSocket();
|
|
14441
|
+
stopRecording();
|
|
14442
|
+
});
|
|
14443
|
+
const initSocket = (url, onMessage) => {
|
|
14444
|
+
socket.value = new WebSocket(url);
|
|
14445
|
+
socket.value.onopen = () => __async2(this, null, function* () {
|
|
14446
|
+
var _a;
|
|
14447
|
+
if (((_a = mediaRecorder.value) == null ? void 0 : _a.state) !== "recording") {
|
|
14448
|
+
yield startRecording();
|
|
14449
|
+
}
|
|
14450
|
+
});
|
|
14451
|
+
socket.value.onmessage = (event) => {
|
|
14452
|
+
const msg = JSON.parse(event.data);
|
|
14453
|
+
if (msg.event === "transcription") {
|
|
14454
|
+
transcription.value = msg.transcription;
|
|
14455
|
+
onMessage == null ? void 0 : onMessage(msg.transcription);
|
|
14456
|
+
stopSocketConnection();
|
|
14457
|
+
} else if (msg.event === "error") {
|
|
14458
|
+
errorRef.value = "Server error during transcription";
|
|
14459
|
+
stopRecording();
|
|
14460
|
+
}
|
|
14461
|
+
};
|
|
14462
|
+
socket.value.onclose = () => {
|
|
14463
|
+
stopRecording();
|
|
14464
|
+
};
|
|
14465
|
+
socket.value.onerror = () => {
|
|
14466
|
+
stopRecording();
|
|
14467
|
+
errorRef.value = "Service connection error";
|
|
14468
|
+
};
|
|
14469
|
+
};
|
|
14470
|
+
const onMediaRecorderDataAvailable = (event) => __async2(this, null, function* () {
|
|
14471
|
+
var _a, _b;
|
|
14472
|
+
if (((_a = mediaRecorder.value) == null ? void 0 : _a.state) !== "recording")
|
|
14473
|
+
return;
|
|
14474
|
+
const audioBuffer = yield event.data.arrayBuffer();
|
|
14475
|
+
const header = buildSocketMessageFrameHeader("audio-chunk", audioBuffer.byteLength);
|
|
14476
|
+
const buffer = new Uint8Array(header.length + audioBuffer.byteLength);
|
|
14477
|
+
buffer.set(header, 0);
|
|
14478
|
+
buffer.set(new Uint8Array(audioBuffer), header.length);
|
|
14479
|
+
(_b = socket.value) == null ? void 0 : _b.send(buffer);
|
|
14480
|
+
});
|
|
14481
|
+
const startRecording = () => __async2(this, null, function* () {
|
|
14482
|
+
mediaStream.value = yield navigator.mediaDevices.getUserMedia({
|
|
14483
|
+
video: false,
|
|
14484
|
+
audio: {
|
|
14485
|
+
channelCount: 1,
|
|
14486
|
+
echoCancellation: true,
|
|
14487
|
+
sampleRate: 16e3
|
|
14488
|
+
}
|
|
14489
|
+
});
|
|
14490
|
+
mediaRecorder.value = new MediaRecorder(mediaStream.value, {
|
|
14491
|
+
mimeType: "audio/webm; codecs=opus"
|
|
14492
|
+
});
|
|
14493
|
+
mediaRecorder.value.ondataavailable = onMediaRecorderDataAvailable;
|
|
14494
|
+
mediaRecorder.value.start(timeSliceLength.value);
|
|
14495
|
+
isRecording.value = true;
|
|
14496
|
+
});
|
|
14497
|
+
const stopRecording = () => {
|
|
14498
|
+
var _a, _b;
|
|
14499
|
+
(_a = mediaRecorder.value) == null ? void 0 : _a.stop();
|
|
14500
|
+
(_b = mediaStream.value) == null ? void 0 : _b.getTracks().forEach((track2) => {
|
|
14501
|
+
track2.stop();
|
|
14502
|
+
});
|
|
14503
|
+
isRecording.value = false;
|
|
14504
|
+
};
|
|
14505
|
+
const stopSocketConnection = () => {
|
|
14506
|
+
if (socket.value && socket.value.readyState === WebSocket.OPEN) {
|
|
14507
|
+
const endHeader = buildSocketMessageFrameHeader("audio-chunk-end", 0);
|
|
14508
|
+
socket.value.send(endHeader);
|
|
14509
|
+
setTimeout(() => {
|
|
14510
|
+
closeSocket();
|
|
14511
|
+
}, 1e3);
|
|
14512
|
+
}
|
|
14513
|
+
};
|
|
14514
|
+
const closeSocket = () => {
|
|
14515
|
+
var _a;
|
|
14516
|
+
(_a = socket.value) == null ? void 0 : _a.close();
|
|
14517
|
+
socket.value = null;
|
|
14518
|
+
};
|
|
14519
|
+
const reset = () => {
|
|
14520
|
+
stopRecording();
|
|
14521
|
+
closeSocket();
|
|
14522
|
+
transcription.value = "";
|
|
14523
|
+
errorRef.value = null;
|
|
14524
|
+
isRecording.value = false;
|
|
14525
|
+
};
|
|
14526
|
+
return {
|
|
14527
|
+
isRecording,
|
|
14528
|
+
transcription,
|
|
14529
|
+
errorRef,
|
|
14530
|
+
initSocket,
|
|
14531
|
+
startRecording,
|
|
14532
|
+
stopRecording,
|
|
14533
|
+
stopSocketConnection,
|
|
14534
|
+
reset,
|
|
14535
|
+
closeSocket
|
|
14536
|
+
};
|
|
14537
|
+
}
|
|
14538
|
+
const _hoisted_1$1l = {
|
|
14539
|
+
key: 0,
|
|
14540
|
+
class: "lupa-dialog-overlay"
|
|
14541
|
+
};
|
|
14542
|
+
const _hoisted_2$W = { class: "lupa-dialog-content" };
|
|
14543
|
+
const _hoisted_3$F = { class: "lupa-listening-text" };
|
|
14544
|
+
const _hoisted_4$v = { class: "lupa-mic-button-wrapper" };
|
|
14545
|
+
const _sfc_main$1y = /* @__PURE__ */ defineComponent({
|
|
14546
|
+
__name: "VoiceSearchDialog",
|
|
14547
|
+
props: {
|
|
14548
|
+
isOpen: { type: Boolean },
|
|
14549
|
+
options: {}
|
|
14550
|
+
},
|
|
14551
|
+
emits: [
|
|
14552
|
+
"close",
|
|
14553
|
+
"transcript-update",
|
|
14554
|
+
"stop-recognize"
|
|
14555
|
+
],
|
|
14556
|
+
setup(__props, { expose: __expose, emit: emit2 }) {
|
|
14557
|
+
const props = __props;
|
|
14558
|
+
const optionsStore = useOptionsStore();
|
|
14559
|
+
const {
|
|
14560
|
+
isRecording,
|
|
14561
|
+
transcription,
|
|
14562
|
+
errorRef,
|
|
14563
|
+
initSocket,
|
|
14564
|
+
stopSocketConnection,
|
|
14565
|
+
reset
|
|
14566
|
+
} = useVoiceRecorder(props.options);
|
|
14567
|
+
const clientId = ref(null);
|
|
14568
|
+
const voiceSearchProgressBar = ref(null);
|
|
14569
|
+
const timesliceLimit = computed(() => {
|
|
14570
|
+
var _a;
|
|
14571
|
+
return (_a = props.options.timesliceLimit) != null ? _a : 4;
|
|
14572
|
+
});
|
|
14573
|
+
const timeSliceLength = computed(() => {
|
|
14574
|
+
var _a;
|
|
14575
|
+
return (_a = props.options.timesliceLength) != null ? _a : 1e3;
|
|
14576
|
+
});
|
|
14577
|
+
const stopDelay = computed(() => {
|
|
14578
|
+
var _a;
|
|
14579
|
+
return (_a = props.options.stopDelay) != null ? _a : 700;
|
|
14580
|
+
});
|
|
14581
|
+
const labels = computed(() => {
|
|
14582
|
+
var _a;
|
|
14583
|
+
return (_a = props.options.labels) != null ? _a : {};
|
|
14584
|
+
});
|
|
14585
|
+
const description = computed(() => {
|
|
14586
|
+
var _a, _b, _c;
|
|
14587
|
+
if (errorRef.value) {
|
|
14588
|
+
return (_a = labels.value.serviceError) != null ? _a : errorRef.value;
|
|
14589
|
+
}
|
|
14590
|
+
if (!isRecording.value) {
|
|
14591
|
+
return (_b = labels.value.microphoneOff) != null ? _b : "Microphone is off. Try again.";
|
|
14592
|
+
}
|
|
14593
|
+
return (_c = labels.value.listening) != null ? _c : "Listening...";
|
|
14594
|
+
});
|
|
14595
|
+
watch(transcription, (newValue) => {
|
|
14596
|
+
emit2("transcript-update", newValue);
|
|
14597
|
+
});
|
|
14598
|
+
const handleRecordingButtonClick = () => {
|
|
14599
|
+
var _a, _b;
|
|
14600
|
+
if (isRecording.value) {
|
|
14601
|
+
setTimeout(() => {
|
|
14602
|
+
stopSocketConnection();
|
|
14603
|
+
handleOnStopEvent();
|
|
14604
|
+
}, stopDelay.value);
|
|
14605
|
+
return;
|
|
14606
|
+
}
|
|
14607
|
+
const voiceServiceUrl = getVoiceServiceApiUrl(
|
|
14608
|
+
optionsStore.envOptions.environment,
|
|
14609
|
+
props.options.customVoiceServiceUrl
|
|
14610
|
+
);
|
|
14611
|
+
const socketUrl = `${voiceServiceUrl}?clientId=${clientId.value}&queryKey=${props.options.queryKey}&languageCode=${(_a = props.options.language) != null ? _a : "en-US"}&connectionType=write-first`;
|
|
14612
|
+
initSocket(socketUrl);
|
|
14613
|
+
(_b = voiceSearchProgressBar.value) == null ? void 0 : _b.startProgressBar();
|
|
14614
|
+
setTimeout(() => {
|
|
14615
|
+
stopSocketConnection();
|
|
14616
|
+
handleOnStopEvent();
|
|
14617
|
+
}, timesliceLimit.value * timeSliceLength.value);
|
|
14618
|
+
};
|
|
14619
|
+
const handleOnStopEvent = () => {
|
|
14620
|
+
var _a;
|
|
14621
|
+
setTimeout(() => {
|
|
14622
|
+
if (errorRef.value)
|
|
14623
|
+
return;
|
|
14624
|
+
emit2("stop-recognize", transcription.value);
|
|
14625
|
+
}, 1500);
|
|
14626
|
+
(_a = voiceSearchProgressBar.value) == null ? void 0 : _a.stopProgressBar();
|
|
14627
|
+
};
|
|
14628
|
+
onMounted(() => {
|
|
14629
|
+
clientId.value = getSocketClientId();
|
|
14630
|
+
});
|
|
14631
|
+
onBeforeUnmount(() => {
|
|
14632
|
+
clientId.value = null;
|
|
14633
|
+
});
|
|
14634
|
+
const dialogReset = () => {
|
|
14635
|
+
var _a;
|
|
14636
|
+
reset();
|
|
14637
|
+
(_a = voiceSearchProgressBar.value) == null ? void 0 : _a.stopProgressBar();
|
|
14638
|
+
};
|
|
14639
|
+
__expose({
|
|
14640
|
+
handleRecordingButtonClick,
|
|
14641
|
+
reset: dialogReset
|
|
14642
|
+
});
|
|
14643
|
+
return (_ctx, _cache) => {
|
|
14644
|
+
return openBlock(), createElementBlock("div", null, [
|
|
14645
|
+
props.isOpen ? (openBlock(), createElementBlock("div", _hoisted_1$1l, [
|
|
14646
|
+
createBaseVNode("button", {
|
|
14647
|
+
class: "lupa-dialog-box-close-button",
|
|
14648
|
+
onClick: _cache[0] || (_cache[0] = () => emit2("close"))
|
|
14649
|
+
}),
|
|
14650
|
+
createBaseVNode("div", _hoisted_2$W, [
|
|
14651
|
+
createBaseVNode("p", _hoisted_3$F, toDisplayString(description.value), 1),
|
|
14652
|
+
createBaseVNode("div", _hoisted_4$v, [
|
|
14653
|
+
createBaseVNode("button", {
|
|
14654
|
+
class: normalizeClass(["lupa-mic-button", { recording: unref(isRecording) }]),
|
|
14655
|
+
onClick: handleRecordingButtonClick
|
|
14656
|
+
}, null, 2),
|
|
14657
|
+
createVNode(_sfc_main$1z, {
|
|
14658
|
+
ref_key: "voiceSearchProgressBar",
|
|
14659
|
+
ref: voiceSearchProgressBar,
|
|
14660
|
+
class: "lupa-progress-circle",
|
|
14661
|
+
isRecording: unref(isRecording),
|
|
14662
|
+
timesliceLimit: timesliceLimit.value,
|
|
14663
|
+
timeSliceLength: timeSliceLength.value
|
|
14664
|
+
}, null, 8, ["isRecording", "timesliceLimit", "timeSliceLength"])
|
|
14665
|
+
])
|
|
14666
|
+
])
|
|
14667
|
+
])) : createCommentVNode("", true)
|
|
14668
|
+
]);
|
|
14669
|
+
};
|
|
14670
|
+
}
|
|
14671
|
+
});
|
|
14319
14672
|
const _hoisted_1$1k = { id: "lupa-search-box-input-container" };
|
|
14320
14673
|
const _hoisted_2$V = { class: "lupa-input-clear" };
|
|
14321
14674
|
const _hoisted_3$E = { id: "lupa-search-box-input" };
|
|
14322
|
-
const _hoisted_4$
|
|
14675
|
+
const _hoisted_4$u = ["value"];
|
|
14323
14676
|
const _hoisted_5$l = ["aria-label", "placeholder"];
|
|
14324
14677
|
const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
14325
14678
|
const _hoisted_7$7 = [
|
|
@@ -14329,6 +14682,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14329
14682
|
key: 0,
|
|
14330
14683
|
class: "lupa-close-label"
|
|
14331
14684
|
};
|
|
14685
|
+
const _hoisted_9$3 = { key: 1 };
|
|
14332
14686
|
const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
14333
14687
|
__name: "SearchBoxInput",
|
|
14334
14688
|
props: {
|
|
@@ -14344,6 +14698,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14344
14698
|
const searchBoxStore = useSearchBoxStore();
|
|
14345
14699
|
const { query } = storeToRefs(paramStore);
|
|
14346
14700
|
const mainInput = ref(null);
|
|
14701
|
+
const voiceDialogOverlay = ref(null);
|
|
14702
|
+
const isVoiceDialogOpen = ref(false);
|
|
14347
14703
|
const emitInputOnFocus = computed(() => {
|
|
14348
14704
|
var _a;
|
|
14349
14705
|
return (_a = props.emitInputOnFocus) != null ? _a : true;
|
|
@@ -14354,6 +14710,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14354
14710
|
return (_a = props.suggestedValue) != null ? _a : { value: "", override: false, item: { suggestion: "" } };
|
|
14355
14711
|
}
|
|
14356
14712
|
);
|
|
14713
|
+
const isVoiceSearchEnabled = computed(() => {
|
|
14714
|
+
var _a, _b;
|
|
14715
|
+
return (_b = (_a = props.options.voiceSearch) == null ? void 0 : _a.enabled) != null ? _b : false;
|
|
14716
|
+
});
|
|
14357
14717
|
const labels = computed(() => props.options.labels);
|
|
14358
14718
|
const input2 = ref("");
|
|
14359
14719
|
const inputValue = computed({
|
|
@@ -14377,6 +14737,12 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14377
14737
|
var _a;
|
|
14378
14738
|
return (_a = labels.value.searchInputAriaLabel) != null ? _a : "Search input";
|
|
14379
14739
|
});
|
|
14740
|
+
onMounted(() => {
|
|
14741
|
+
document.addEventListener("click", handleClickOutsideVoiceDialogOverlay);
|
|
14742
|
+
});
|
|
14743
|
+
onBeforeUnmount(() => {
|
|
14744
|
+
document.removeEventListener("click", handleClickOutsideVoiceDialogOverlay);
|
|
14745
|
+
});
|
|
14380
14746
|
watch(suggestedValue, () => {
|
|
14381
14747
|
if (suggestedValue.value.override) {
|
|
14382
14748
|
input2.value = suggestedValue.value.item.suggestion;
|
|
@@ -14411,6 +14777,37 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14411
14777
|
}
|
|
14412
14778
|
(_a = mainInput == null ? void 0 : mainInput.value) == null ? void 0 : _a.focus();
|
|
14413
14779
|
};
|
|
14780
|
+
const openVoiceSearchDialog = () => {
|
|
14781
|
+
var _a;
|
|
14782
|
+
isVoiceDialogOpen.value = true;
|
|
14783
|
+
(_a = voiceDialogOverlay.value) == null ? void 0 : _a.handleRecordingButtonClick();
|
|
14784
|
+
};
|
|
14785
|
+
const closeDialog = () => {
|
|
14786
|
+
var _a;
|
|
14787
|
+
isVoiceDialogOpen.value = false;
|
|
14788
|
+
(_a = voiceDialogOverlay.value) == null ? void 0 : _a.reset();
|
|
14789
|
+
};
|
|
14790
|
+
const handleVoiceSearchOutput = (transcription) => {
|
|
14791
|
+
inputValue.value = transcription;
|
|
14792
|
+
handleSubmit();
|
|
14793
|
+
};
|
|
14794
|
+
const stopRecognition = (trascription) => {
|
|
14795
|
+
setTimeout(() => {
|
|
14796
|
+
isVoiceDialogOpen.value = false;
|
|
14797
|
+
handleVoiceSearchOutput(trascription);
|
|
14798
|
+
}, 500);
|
|
14799
|
+
};
|
|
14800
|
+
const handleClickOutsideVoiceDialogOverlay = (event) => {
|
|
14801
|
+
if (event.target.classList.contains("lupa-voice-search-button")) {
|
|
14802
|
+
return;
|
|
14803
|
+
}
|
|
14804
|
+
if (voiceDialogOverlay.value && voiceDialogOverlay.value.$el.contains(event.target)) {
|
|
14805
|
+
return;
|
|
14806
|
+
}
|
|
14807
|
+
if (isVoiceDialogOpen.value) {
|
|
14808
|
+
closeDialog();
|
|
14809
|
+
}
|
|
14810
|
+
};
|
|
14414
14811
|
__expose({ focus });
|
|
14415
14812
|
return (_ctx, _cache) => {
|
|
14416
14813
|
return openBlock(), createElementBlock("div", _hoisted_1$1k, [
|
|
@@ -14426,7 +14823,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14426
14823
|
"aria-hidden": "true",
|
|
14427
14824
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
14428
14825
|
disabled: ""
|
|
14429
|
-
}, null, 8, _hoisted_4$
|
|
14826
|
+
}, null, 8, _hoisted_4$u),
|
|
14430
14827
|
withDirectives(createBaseVNode("input", mergeProps({
|
|
14431
14828
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
14432
14829
|
}, inputAttributes.value, {
|
|
@@ -14454,7 +14851,23 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14454
14851
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
14455
14852
|
}, [
|
|
14456
14853
|
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
14457
|
-
])) : createCommentVNode("", true)
|
|
14854
|
+
])) : createCommentVNode("", true),
|
|
14855
|
+
isVoiceSearchEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
14856
|
+
createBaseVNode("button", {
|
|
14857
|
+
onClick: openVoiceSearchDialog,
|
|
14858
|
+
class: "lupa-voice-search-button"
|
|
14859
|
+
})
|
|
14860
|
+
])) : createCommentVNode("", true),
|
|
14861
|
+
isVoiceSearchEnabled.value ? (openBlock(), createBlock(_sfc_main$1y, {
|
|
14862
|
+
key: 2,
|
|
14863
|
+
ref_key: "voiceDialogOverlay",
|
|
14864
|
+
ref: voiceDialogOverlay,
|
|
14865
|
+
isOpen: isVoiceDialogOpen.value,
|
|
14866
|
+
options: props.options.voiceSearch,
|
|
14867
|
+
onClose: closeDialog,
|
|
14868
|
+
onTranscriptUpdate: handleVoiceSearchOutput,
|
|
14869
|
+
onStopRecognize: stopRecognition
|
|
14870
|
+
}, null, 8, ["isOpen", "options"])) : createCommentVNode("", true)
|
|
14458
14871
|
]);
|
|
14459
14872
|
};
|
|
14460
14873
|
}
|
|
@@ -14652,7 +15065,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14652
15065
|
class: "lupa-suggestion-facet",
|
|
14653
15066
|
"data-cy": "lupa-suggestion-facet"
|
|
14654
15067
|
};
|
|
14655
|
-
const _hoisted_4$
|
|
15068
|
+
const _hoisted_4$t = {
|
|
14656
15069
|
class: "lupa-suggestion-facet-label",
|
|
14657
15070
|
"data-cy": "lupa-suggestion-facet-label"
|
|
14658
15071
|
};
|
|
@@ -14698,7 +15111,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
14698
15111
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
14699
15112
|
}, null, 8, _hoisted_1$1g)) : (openBlock(), createElementBlock("div", _hoisted_2$T, toDisplayString(_ctx.suggestion.display), 1)),
|
|
14700
15113
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$D, [
|
|
14701
|
-
createBaseVNode("span", _hoisted_4$
|
|
15114
|
+
createBaseVNode("span", _hoisted_4$t, toDisplayString(facetLabel.value), 1),
|
|
14702
15115
|
createBaseVNode("span", _hoisted_5$k, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
14703
15116
|
])) : createCommentVNode("", true)
|
|
14704
15117
|
]);
|
|
@@ -24192,7 +24605,7 @@ and ensure you are accounting for this risk.
|
|
|
24192
24605
|
const _hoisted_1$1a = ["innerHTML"];
|
|
24193
24606
|
const _hoisted_2$P = { key: 0 };
|
|
24194
24607
|
const _hoisted_3$C = { key: 1 };
|
|
24195
|
-
const _hoisted_4$
|
|
24608
|
+
const _hoisted_4$s = { class: "lupa-search-box-custom-label" };
|
|
24196
24609
|
const _hoisted_5$j = { class: "lupa-search-box-custom-text" };
|
|
24197
24610
|
const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
24198
24611
|
__name: "SearchBoxProductCustom",
|
|
@@ -24225,7 +24638,7 @@ and ensure you are accounting for this risk.
|
|
|
24225
24638
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
24226
24639
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
24227
24640
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$C, [
|
|
24228
|
-
createBaseVNode("div", _hoisted_4$
|
|
24641
|
+
createBaseVNode("div", _hoisted_4$s, toDisplayString(label.value), 1),
|
|
24229
24642
|
createBaseVNode("div", _hoisted_5$j, toDisplayString(text.value), 1)
|
|
24230
24643
|
]))
|
|
24231
24644
|
], 16));
|
|
@@ -24575,7 +24988,7 @@ and ensure you are accounting for this risk.
|
|
|
24575
24988
|
const _hoisted_1$18 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
24576
24989
|
const _hoisted_2$O = { class: "lupa-search-box-product-addtocart" };
|
|
24577
24990
|
const _hoisted_3$B = ["disabled"];
|
|
24578
|
-
const _hoisted_4$
|
|
24991
|
+
const _hoisted_4$r = ["href"];
|
|
24579
24992
|
const _hoisted_5$i = ["onClick", "disabled"];
|
|
24580
24993
|
const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
24581
24994
|
__name: "SearchBoxProductAddToCart",
|
|
@@ -24623,7 +25036,7 @@ and ensure you are accounting for this risk.
|
|
|
24623
25036
|
"data-cy": "lupa-add-to-cart",
|
|
24624
25037
|
disabled: !inStockValue.value || loading.value
|
|
24625
25038
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
24626
|
-
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$
|
|
25039
|
+
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$r)
|
|
24627
25040
|
], 16, _hoisted_3$B)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
24628
25041
|
key: 1,
|
|
24629
25042
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
@@ -24743,7 +25156,7 @@ and ensure you are accounting for this risk.
|
|
|
24743
25156
|
const _hoisted_1$16 = { class: "lupa-badge-title" };
|
|
24744
25157
|
const _hoisted_2$N = ["src"];
|
|
24745
25158
|
const _hoisted_3$A = { key: 1 };
|
|
24746
|
-
const _hoisted_4$
|
|
25159
|
+
const _hoisted_4$q = {
|
|
24747
25160
|
key: 0,
|
|
24748
25161
|
class: "lupa-badge-full-text"
|
|
24749
25162
|
};
|
|
@@ -24787,7 +25200,7 @@ and ensure you are accounting for this risk.
|
|
|
24787
25200
|
}, null, 8, _hoisted_2$N)) : createCommentVNode("", true),
|
|
24788
25201
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$A, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
24789
25202
|
]),
|
|
24790
|
-
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
25203
|
+
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$q, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
24791
25204
|
], 6);
|
|
24792
25205
|
};
|
|
24793
25206
|
}
|
|
@@ -25702,7 +26115,7 @@ and ensure you are accounting for this risk.
|
|
|
25702
26115
|
key: 0,
|
|
25703
26116
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
25704
26117
|
};
|
|
25705
|
-
const _hoisted_4$
|
|
26118
|
+
const _hoisted_4$p = {
|
|
25706
26119
|
key: 1,
|
|
25707
26120
|
class: "lupa-panel-title"
|
|
25708
26121
|
};
|
|
@@ -25895,7 +26308,7 @@ and ensure you are accounting for this risk.
|
|
|
25895
26308
|
"data-cy": "lupa-panel-" + panel.type + "-index"
|
|
25896
26309
|
}, [
|
|
25897
26310
|
((_a = panel.labels) == null ? void 0 : _a.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$y, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
|
|
25898
|
-
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
26311
|
+
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$p, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
|
|
25899
26312
|
panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
|
|
25900
26313
|
key: 2,
|
|
25901
26314
|
panel,
|
|
@@ -25993,7 +26406,8 @@ and ensure you are accounting for this risk.
|
|
|
25993
26406
|
"labels",
|
|
25994
26407
|
"links",
|
|
25995
26408
|
"inputAttributes",
|
|
25996
|
-
"showSubmitButton"
|
|
26409
|
+
"showSubmitButton",
|
|
26410
|
+
"voiceSearch"
|
|
25997
26411
|
])
|
|
25998
26412
|
);
|
|
25999
26413
|
const panelOptions = computed(
|
|
@@ -26393,7 +26807,7 @@ and ensure you are accounting for this risk.
|
|
|
26393
26807
|
key: 1,
|
|
26394
26808
|
"data-cy": "did-you-mean-label"
|
|
26395
26809
|
};
|
|
26396
|
-
const _hoisted_4$
|
|
26810
|
+
const _hoisted_4$o = { key: 1 };
|
|
26397
26811
|
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
26398
26812
|
__name: "SearchResultsDidYouMean",
|
|
26399
26813
|
props: {
|
|
@@ -26444,7 +26858,7 @@ and ensure you are accounting for this risk.
|
|
|
26444
26858
|
class: "lupa-did-you-mean lupa-highlighted-search-text",
|
|
26445
26859
|
"data-cy": "did-you-mean-value",
|
|
26446
26860
|
onClick: _cache[0] || (_cache[0] = ($event) => goToResults({ searchText: didYouMeanValue.value }))
|
|
26447
|
-
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
26861
|
+
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$o, toDisplayString(label) + " ", 1))
|
|
26448
26862
|
]);
|
|
26449
26863
|
}), 128))
|
|
26450
26864
|
])) : createCommentVNode("", true)
|
|
@@ -26494,7 +26908,7 @@ and ensure you are accounting for this risk.
|
|
|
26494
26908
|
key: 1,
|
|
26495
26909
|
class: "lupa-results-total-count"
|
|
26496
26910
|
};
|
|
26497
|
-
const _hoisted_4$
|
|
26911
|
+
const _hoisted_4$n = { class: "lupa-results-total-count-number" };
|
|
26498
26912
|
const _hoisted_5$g = ["innerHTML"];
|
|
26499
26913
|
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
26500
26914
|
__name: "SearchResultsTitle",
|
|
@@ -26544,7 +26958,7 @@ and ensure you are accounting for this risk.
|
|
|
26544
26958
|
queryText.value && !searchResultsTitleTemplate.value ? (openBlock(), createElementBlock("span", _hoisted_2$G, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
|
|
26545
26959
|
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$w, [
|
|
26546
26960
|
createTextVNode("(" + toDisplayString(searchResultsCountLabel.value), 1),
|
|
26547
|
-
createBaseVNode("span", _hoisted_4$
|
|
26961
|
+
createBaseVNode("span", _hoisted_4$n, toDisplayString(unref(totalItems)), 1),
|
|
26548
26962
|
createTextVNode(")")
|
|
26549
26963
|
])) : createCommentVNode("", true)
|
|
26550
26964
|
])) : createCommentVNode("", true),
|
|
@@ -26577,22 +26991,42 @@ and ensure you are accounting for this risk.
|
|
|
26577
26991
|
emits: ["remove"],
|
|
26578
26992
|
setup(__props, { emit: emit2 }) {
|
|
26579
26993
|
const props = __props;
|
|
26580
|
-
const facetKeyClass = computed(() => {
|
|
26581
|
-
|
|
26994
|
+
const facetKeyClass = computed(() => `lupa-facet-active-filter-${props.filter.key}`);
|
|
26995
|
+
const { searchResultOptions } = storeToRefs(useOptionsStore());
|
|
26996
|
+
const units = computed(() => {
|
|
26997
|
+
var _a, _b, _c, _d, _e;
|
|
26998
|
+
return (_e = (_d = (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
|
|
26582
26999
|
});
|
|
26583
|
-
|
|
27000
|
+
function handleClick() {
|
|
26584
27001
|
emit2("remove", { filter: props.filter });
|
|
26585
|
-
}
|
|
27002
|
+
}
|
|
27003
|
+
function formatFilterValue(filter2) {
|
|
27004
|
+
const unit = units.value[filter2.key] || "";
|
|
27005
|
+
let min, max;
|
|
27006
|
+
if (Array.isArray(filter2.value)) {
|
|
27007
|
+
[min, max] = filter2.value.map(String);
|
|
27008
|
+
} else if (typeof filter2.value === "string" && filter2.value.includes("-")) {
|
|
27009
|
+
const parts = filter2.value.split("-").map((s) => s.trim());
|
|
27010
|
+
if (parts.length === 2)
|
|
27011
|
+
[min, max] = parts;
|
|
27012
|
+
}
|
|
27013
|
+
if (min != null && max != null) {
|
|
27014
|
+
return `${min} ${unit} – ${max} ${unit}`;
|
|
27015
|
+
}
|
|
27016
|
+
return `${filter2.value} ${unit}`.trim();
|
|
27017
|
+
}
|
|
26586
27018
|
return (_ctx, _cache) => {
|
|
26587
27019
|
return openBlock(), createElementBlock("div", {
|
|
26588
|
-
class: normalizeClass(["lupa-search-result-filter-value",
|
|
27020
|
+
class: normalizeClass(["lupa-search-result-filter-value", [facetKeyClass.value]]),
|
|
27021
|
+
"data-cy": "lupa-current-filter-item"
|
|
26589
27022
|
}, [
|
|
26590
27023
|
createBaseVNode("div", {
|
|
26591
27024
|
class: "lupa-current-filter-action",
|
|
26592
|
-
onClick: handleClick
|
|
26593
|
-
|
|
27025
|
+
onClick: handleClick,
|
|
27026
|
+
"aria-label": "Remove filter"
|
|
27027
|
+
}, " ⨉ "),
|
|
26594
27028
|
createBaseVNode("div", _hoisted_1$U, toDisplayString(_ctx.filter.label) + ": ", 1),
|
|
26595
|
-
createBaseVNode("div", _hoisted_2$F, toDisplayString(
|
|
27029
|
+
createBaseVNode("div", _hoisted_2$F, toDisplayString(formatFilterValue(props.filter)), 1)
|
|
26596
27030
|
], 2);
|
|
26597
27031
|
};
|
|
26598
27032
|
}
|
|
@@ -26606,7 +27040,7 @@ and ensure you are accounting for this risk.
|
|
|
26606
27040
|
key: 0,
|
|
26607
27041
|
class: "filter-values"
|
|
26608
27042
|
};
|
|
26609
|
-
const _hoisted_4$
|
|
27043
|
+
const _hoisted_4$m = { class: "lupa-current-filter-list" };
|
|
26610
27044
|
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
26611
27045
|
__name: "CurrentFilters",
|
|
26612
27046
|
props: {
|
|
@@ -26614,6 +27048,14 @@ and ensure you are accounting for this risk.
|
|
|
26614
27048
|
expandable: { type: Boolean }
|
|
26615
27049
|
},
|
|
26616
27050
|
setup(__props) {
|
|
27051
|
+
const optionsStore = useOptionsStore();
|
|
27052
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
27053
|
+
const units = computed(
|
|
27054
|
+
() => {
|
|
27055
|
+
var _a, _b, _c, _d, _e;
|
|
27056
|
+
return (_e = (_d = (_c = (_b = (_a = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
|
|
27057
|
+
}
|
|
27058
|
+
);
|
|
26617
27059
|
const isOpen = ref(false);
|
|
26618
27060
|
const paramsStore = useParamsStore();
|
|
26619
27061
|
const optionStore = useOptionsStore();
|
|
@@ -26690,13 +27132,14 @@ and ensure you are accounting for this risk.
|
|
|
26690
27132
|
}, null, 2)) : createCommentVNode("", true)
|
|
26691
27133
|
]),
|
|
26692
27134
|
!_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
|
|
26693
|
-
createBaseVNode("div", _hoisted_4$
|
|
27135
|
+
createBaseVNode("div", _hoisted_4$m, [
|
|
26694
27136
|
(openBlock(true), createElementBlock(Fragment, null, renderList(currentDisplayFilters.value, (filter2) => {
|
|
26695
27137
|
return openBlock(), createBlock(_sfc_main$_, {
|
|
26696
27138
|
key: filter2.key + "_" + filter2.value,
|
|
26697
27139
|
filter: filter2,
|
|
27140
|
+
units: units.value,
|
|
26698
27141
|
onRemove: handleRemove
|
|
26699
|
-
}, null, 8, ["filter"]);
|
|
27142
|
+
}, null, 8, ["filter", "units"]);
|
|
26700
27143
|
}), 128))
|
|
26701
27144
|
]),
|
|
26702
27145
|
createBaseVNode("div", {
|
|
@@ -26758,7 +27201,7 @@ and ensure you are accounting for this risk.
|
|
|
26758
27201
|
};
|
|
26759
27202
|
const _hoisted_2$D = { class: "lupa-category-back" };
|
|
26760
27203
|
const _hoisted_3$u = ["href"];
|
|
26761
|
-
const _hoisted_4$
|
|
27204
|
+
const _hoisted_4$l = ["href"];
|
|
26762
27205
|
const _hoisted_5$f = { class: "lupa-child-category-list" };
|
|
26763
27206
|
const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
26764
27207
|
__name: "CategoryFilter",
|
|
@@ -26865,7 +27308,7 @@ and ensure you are accounting for this risk.
|
|
|
26865
27308
|
href: parentUrlLink.value,
|
|
26866
27309
|
class: normalizeClass({ "lupa-title-category": !hasBackButton.value }),
|
|
26867
27310
|
onClick: handleNavigationParent
|
|
26868
|
-
}, toDisplayString(parentTitle.value), 11, _hoisted_4$
|
|
27311
|
+
}, toDisplayString(parentTitle.value), 11, _hoisted_4$l)
|
|
26869
27312
|
], 2),
|
|
26870
27313
|
createBaseVNode("div", _hoisted_5$f, [
|
|
26871
27314
|
(openBlock(true), createElementBlock(Fragment, null, renderList(categoryChildren.value, (child) => {
|
|
@@ -26886,7 +27329,7 @@ and ensure you are accounting for this risk.
|
|
|
26886
27329
|
};
|
|
26887
27330
|
const _hoisted_2$C = ["placeholder"];
|
|
26888
27331
|
const _hoisted_3$t = { class: "lupa-terms-list" };
|
|
26889
|
-
const _hoisted_4$
|
|
27332
|
+
const _hoisted_4$k = ["onClick"];
|
|
26890
27333
|
const _hoisted_5$e = { class: "lupa-term-checkbox-wrapper" };
|
|
26891
27334
|
const _hoisted_6$8 = { class: "lupa-term-label" };
|
|
26892
27335
|
const _hoisted_7$6 = {
|
|
@@ -27013,7 +27456,7 @@ and ensure you are accounting for this risk.
|
|
|
27013
27456
|
createBaseVNode("span", _hoisted_6$8, toDisplayString(getItemLabel(item)), 1),
|
|
27014
27457
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_7$6, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
27015
27458
|
], 2)
|
|
27016
|
-
], 10, _hoisted_4$
|
|
27459
|
+
], 10, _hoisted_4$k);
|
|
27017
27460
|
}), 128))
|
|
27018
27461
|
]),
|
|
27019
27462
|
displayShowMore.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -28013,22 +28456,24 @@ and ensure you are accounting for this risk.
|
|
|
28013
28456
|
key: 1,
|
|
28014
28457
|
class: "lupa-stats-facet-summary-input"
|
|
28015
28458
|
};
|
|
28016
|
-
const _hoisted_4$
|
|
28459
|
+
const _hoisted_4$j = {
|
|
28017
28460
|
key: 0,
|
|
28018
28461
|
class: "lupa-stats-range-label"
|
|
28019
28462
|
};
|
|
28020
28463
|
const _hoisted_5$d = { class: "lupa-stats-from" };
|
|
28021
28464
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
28022
28465
|
const _hoisted_7$5 = { key: 0 };
|
|
28023
|
-
const _hoisted_8$1 =
|
|
28024
|
-
const _hoisted_9$1 = {
|
|
28466
|
+
const _hoisted_8$1 = { key: 1 };
|
|
28467
|
+
const _hoisted_9$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
28468
|
+
const _hoisted_10 = {
|
|
28025
28469
|
key: 0,
|
|
28026
28470
|
class: "lupa-stats-range-label"
|
|
28027
28471
|
};
|
|
28028
|
-
const
|
|
28029
|
-
const
|
|
28030
|
-
const
|
|
28031
|
-
const
|
|
28472
|
+
const _hoisted_11 = { class: "lupa-stats-to" };
|
|
28473
|
+
const _hoisted_12 = ["max", "min", "pattern", "aria-label"];
|
|
28474
|
+
const _hoisted_13 = { key: 0 };
|
|
28475
|
+
const _hoisted_14 = { key: 1 };
|
|
28476
|
+
const _hoisted_15 = {
|
|
28032
28477
|
key: 2,
|
|
28033
28478
|
class: "lupa-stats-slider-wrapper"
|
|
28034
28479
|
};
|
|
@@ -28095,7 +28540,7 @@ and ensure you are accounting for this risk.
|
|
|
28095
28540
|
if (!value || value > facetMax.value) {
|
|
28096
28541
|
return;
|
|
28097
28542
|
}
|
|
28098
|
-
innerSliderRange.value = [
|
|
28543
|
+
innerSliderRange.value = [sliderRange.value[1], value];
|
|
28099
28544
|
handleInputChange();
|
|
28100
28545
|
}
|
|
28101
28546
|
});
|
|
@@ -28151,7 +28596,18 @@ and ensure you are accounting for this risk.
|
|
|
28151
28596
|
});
|
|
28152
28597
|
const statsSummary = computed(() => {
|
|
28153
28598
|
const [min, max] = sliderRange.value;
|
|
28154
|
-
|
|
28599
|
+
if (isPrice.value) {
|
|
28600
|
+
return formatPriceSummary(
|
|
28601
|
+
[min, max],
|
|
28602
|
+
currency.value,
|
|
28603
|
+
separator.value,
|
|
28604
|
+
currencyTemplate.value
|
|
28605
|
+
);
|
|
28606
|
+
}
|
|
28607
|
+
if (unit.value) {
|
|
28608
|
+
return `${min} ${unit.value} - ${max} ${unit.value}`;
|
|
28609
|
+
}
|
|
28610
|
+
return formatRange({ gte: min, lte: max });
|
|
28155
28611
|
});
|
|
28156
28612
|
const separator = computed(() => {
|
|
28157
28613
|
var _a, _b, _c;
|
|
@@ -28212,11 +28668,17 @@ and ensure you are accounting for this risk.
|
|
|
28212
28668
|
const handleDragging = (value) => {
|
|
28213
28669
|
innerSliderRange.value = value;
|
|
28214
28670
|
};
|
|
28671
|
+
const unit = computed(
|
|
28672
|
+
() => {
|
|
28673
|
+
var _a, _b, _c, _d, _e;
|
|
28674
|
+
return (_e = (_d = (_a = props.options.stats) == null ? void 0 : _a.units) == null ? void 0 : _d[(_c = (_b = props.facet) == null ? void 0 : _b.key) != null ? _c : ""]) != null ? _e : "";
|
|
28675
|
+
}
|
|
28676
|
+
);
|
|
28215
28677
|
return (_ctx, _cache) => {
|
|
28216
28678
|
return openBlock(), createElementBlock("div", _hoisted_1$P, [
|
|
28217
28679
|
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$B, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$s, [
|
|
28218
28680
|
createBaseVNode("div", null, [
|
|
28219
|
-
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
28681
|
+
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
|
|
28220
28682
|
createBaseVNode("div", _hoisted_5$d, [
|
|
28221
28683
|
withDirectives(createBaseVNode("input", {
|
|
28222
28684
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
|
|
@@ -28234,13 +28696,14 @@ and ensure you are accounting for this risk.
|
|
|
28234
28696
|
{ lazy: true }
|
|
28235
28697
|
]
|
|
28236
28698
|
]),
|
|
28237
|
-
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
28699
|
+
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true),
|
|
28700
|
+
unit.value ? (openBlock(), createElementBlock("span", _hoisted_8$1, toDisplayString(unit.value), 1)) : createCommentVNode("", true)
|
|
28238
28701
|
])
|
|
28239
28702
|
]),
|
|
28240
|
-
|
|
28703
|
+
_hoisted_9$1,
|
|
28241
28704
|
createBaseVNode("div", null, [
|
|
28242
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div",
|
|
28243
|
-
createBaseVNode("div",
|
|
28705
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
28706
|
+
createBaseVNode("div", _hoisted_11, [
|
|
28244
28707
|
withDirectives(createBaseVNode("input", {
|
|
28245
28708
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
28246
28709
|
type: "text",
|
|
@@ -28249,7 +28712,7 @@ and ensure you are accounting for this risk.
|
|
|
28249
28712
|
min: facetMin.value,
|
|
28250
28713
|
pattern: sliderInputFormat.value,
|
|
28251
28714
|
"aria-label": ariaLabelTo.value
|
|
28252
|
-
}, null, 8,
|
|
28715
|
+
}, null, 8, _hoisted_12), [
|
|
28253
28716
|
[
|
|
28254
28717
|
vModelText,
|
|
28255
28718
|
toValue.value,
|
|
@@ -28257,11 +28720,12 @@ and ensure you are accounting for this risk.
|
|
|
28257
28720
|
{ lazy: true }
|
|
28258
28721
|
]
|
|
28259
28722
|
]),
|
|
28260
|
-
isPrice.value ? (openBlock(), createElementBlock("span",
|
|
28723
|
+
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(currency.value), 1)) : createCommentVNode("", true),
|
|
28724
|
+
unit.value ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(unit.value), 1)) : createCommentVNode("", true)
|
|
28261
28725
|
])
|
|
28262
28726
|
])
|
|
28263
28727
|
])),
|
|
28264
|
-
isSliderVisible.value ? (openBlock(), createElementBlock("div",
|
|
28728
|
+
isSliderVisible.value ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
28265
28729
|
createVNode(unref(m), {
|
|
28266
28730
|
class: "slider",
|
|
28267
28731
|
tooltips: false,
|
|
@@ -28286,7 +28750,7 @@ and ensure you are accounting for this risk.
|
|
|
28286
28750
|
key: 0,
|
|
28287
28751
|
class: "lupa-term-count"
|
|
28288
28752
|
};
|
|
28289
|
-
const _hoisted_4$
|
|
28753
|
+
const _hoisted_4$i = {
|
|
28290
28754
|
key: 0,
|
|
28291
28755
|
class: "lupa-facet-level"
|
|
28292
28756
|
};
|
|
@@ -28355,7 +28819,7 @@ and ensure you are accounting for this risk.
|
|
|
28355
28819
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_3$r, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
|
|
28356
28820
|
], 2)
|
|
28357
28821
|
]),
|
|
28358
|
-
showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
28822
|
+
showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, [
|
|
28359
28823
|
(openBlock(true), createElementBlock(Fragment, null, renderList(treeItem.value.children, (itemChild) => {
|
|
28360
28824
|
return openBlock(), createBlock(_component_HierarchyFacetLevel, {
|
|
28361
28825
|
key: itemChild.title,
|
|
@@ -28888,7 +29352,7 @@ and ensure you are accounting for this risk.
|
|
|
28888
29352
|
};
|
|
28889
29353
|
const _hoisted_2$w = ["onClick"];
|
|
28890
29354
|
const _hoisted_3$p = { class: "lupa-mobile-sidebar-content" };
|
|
28891
|
-
const _hoisted_4$
|
|
29355
|
+
const _hoisted_4$h = { class: "lupa-sidebar-top" };
|
|
28892
29356
|
const _hoisted_5$c = { class: "lupa-sidebar-title" };
|
|
28893
29357
|
const _hoisted_6$6 = {
|
|
28894
29358
|
key: 0,
|
|
@@ -28932,7 +29396,7 @@ and ensure you are accounting for this risk.
|
|
|
28932
29396
|
onClick: withModifiers(handleMobileToggle, ["stop"])
|
|
28933
29397
|
}, null, 8, _hoisted_2$w),
|
|
28934
29398
|
createBaseVNode("div", _hoisted_3$p, [
|
|
28935
|
-
createBaseVNode("div", _hoisted_4$
|
|
29399
|
+
createBaseVNode("div", _hoisted_4$h, [
|
|
28936
29400
|
createBaseVNode("div", _hoisted_5$c, [
|
|
28937
29401
|
createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
|
|
28938
29402
|
isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
|
|
@@ -28960,7 +29424,7 @@ and ensure you are accounting for this risk.
|
|
|
28960
29424
|
key: 1,
|
|
28961
29425
|
class: "lupa-search-results-breadcrumb-text"
|
|
28962
29426
|
};
|
|
28963
|
-
const _hoisted_4$
|
|
29427
|
+
const _hoisted_4$g = { key: 2 };
|
|
28964
29428
|
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
28965
29429
|
__name: "SearchResultsBreadcrumbs",
|
|
28966
29430
|
props: {
|
|
@@ -29002,7 +29466,7 @@ and ensure you are accounting for this risk.
|
|
|
29002
29466
|
return handleNavigation(e2, (_a2 = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a2 : "");
|
|
29003
29467
|
}
|
|
29004
29468
|
}, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$v)) : (openBlock(), createElementBlock("span", _hoisted_3$o, toDisplayString(getLabel(breadcrumb.label)), 1)),
|
|
29005
|
-
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
29469
|
+
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$g, toDisplayString((_a = breadcrumb.separator) != null ? _a : "/"), 1)) : createCommentVNode("", true)
|
|
29006
29470
|
]);
|
|
29007
29471
|
}), 128))
|
|
29008
29472
|
]);
|
|
@@ -29164,7 +29628,7 @@ and ensure you are accounting for this risk.
|
|
|
29164
29628
|
class: "lupa-page-number-separator"
|
|
29165
29629
|
};
|
|
29166
29630
|
const _hoisted_3$n = ["onClick"];
|
|
29167
|
-
const _hoisted_4$
|
|
29631
|
+
const _hoisted_4$f = {
|
|
29168
29632
|
key: 0,
|
|
29169
29633
|
class: "lupa-page-number-separator"
|
|
29170
29634
|
};
|
|
@@ -29270,7 +29734,7 @@ and ensure you are accounting for this risk.
|
|
|
29270
29734
|
}, toDisplayString(page), 11, _hoisted_3$n);
|
|
29271
29735
|
}), 128)),
|
|
29272
29736
|
showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
29273
|
-
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
29737
|
+
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$f, "...")) : createCommentVNode("", true),
|
|
29274
29738
|
createBaseVNode("div", {
|
|
29275
29739
|
class: "lupa-page-number lupa-page-number-last",
|
|
29276
29740
|
onClick: _cache[2] || (_cache[2] = () => {
|
|
@@ -29295,7 +29759,7 @@ and ensure you are accounting for this risk.
|
|
|
29295
29759
|
};
|
|
29296
29760
|
const _hoisted_2$t = { id: "lupa-select" };
|
|
29297
29761
|
const _hoisted_3$m = { class: "lupa-select-label" };
|
|
29298
|
-
const _hoisted_4$
|
|
29762
|
+
const _hoisted_4$e = ["aria-label"];
|
|
29299
29763
|
const _hoisted_5$b = ["value"];
|
|
29300
29764
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
29301
29765
|
__name: "SearchResultsPageSize",
|
|
@@ -29342,7 +29806,7 @@ and ensure you are accounting for this risk.
|
|
|
29342
29806
|
value: option
|
|
29343
29807
|
}, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$b);
|
|
29344
29808
|
}), 128))
|
|
29345
|
-
], 40, _hoisted_4$
|
|
29809
|
+
], 40, _hoisted_4$e)
|
|
29346
29810
|
])
|
|
29347
29811
|
]);
|
|
29348
29812
|
};
|
|
@@ -29354,7 +29818,7 @@ and ensure you are accounting for this risk.
|
|
|
29354
29818
|
};
|
|
29355
29819
|
const _hoisted_2$s = { id: "lupa-select" };
|
|
29356
29820
|
const _hoisted_3$l = { class: "lupa-select-label" };
|
|
29357
|
-
const _hoisted_4$
|
|
29821
|
+
const _hoisted_4$d = ["aria-label"];
|
|
29358
29822
|
const _hoisted_5$a = ["value"];
|
|
29359
29823
|
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
29360
29824
|
__name: "SearchResultsSort",
|
|
@@ -29422,7 +29886,7 @@ and ensure you are accounting for this risk.
|
|
|
29422
29886
|
value: option.key
|
|
29423
29887
|
}, toDisplayString(option.label), 9, _hoisted_5$a);
|
|
29424
29888
|
}), 128))
|
|
29425
|
-
], 40, _hoisted_4$
|
|
29889
|
+
], 40, _hoisted_4$d), [
|
|
29426
29890
|
[vModelSelect, selectedKey.value]
|
|
29427
29891
|
])
|
|
29428
29892
|
])
|
|
@@ -29436,7 +29900,7 @@ and ensure you are accounting for this risk.
|
|
|
29436
29900
|
class: "lupa-toolbar-right-title"
|
|
29437
29901
|
};
|
|
29438
29902
|
const _hoisted_3$k = { key: 2 };
|
|
29439
|
-
const _hoisted_4$
|
|
29903
|
+
const _hoisted_4$c = { key: 4 };
|
|
29440
29904
|
const _hoisted_5$9 = { key: 6 };
|
|
29441
29905
|
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
29442
29906
|
const _hoisted_7$3 = {
|
|
@@ -29564,7 +30028,7 @@ and ensure you are accounting for this risk.
|
|
|
29564
30028
|
label: searchSummaryLabel.value,
|
|
29565
30029
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
29566
30030
|
onClear: handleClearAll
|
|
29567
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$
|
|
30031
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$c)),
|
|
29568
30032
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$H, {
|
|
29569
30033
|
key: 5,
|
|
29570
30034
|
options: paginationOptions.value.pageSelect,
|
|
@@ -29617,7 +30081,7 @@ and ensure you are accounting for this risk.
|
|
|
29617
30081
|
const _hoisted_1$y = ["title", "innerHTML"];
|
|
29618
30082
|
const _hoisted_2$q = ["title"];
|
|
29619
30083
|
const _hoisted_3$j = ["href", "innerHTML"];
|
|
29620
|
-
const _hoisted_4$
|
|
30084
|
+
const _hoisted_4$b = ["title"];
|
|
29621
30085
|
const _hoisted_5$8 = {
|
|
29622
30086
|
key: 0,
|
|
29623
30087
|
class: "lupa-search-results-product-title-text"
|
|
@@ -29685,7 +30149,7 @@ and ensure you are accounting for this risk.
|
|
|
29685
30149
|
class: "lupa-search-results-product-title-text lupa-title-link",
|
|
29686
30150
|
onClick: handleNavigation
|
|
29687
30151
|
}, toDisplayString(title.value), 9, _hoisted_6$4)) : createCommentVNode("", true)
|
|
29688
|
-
], 12, _hoisted_4$
|
|
30152
|
+
], 12, _hoisted_4$b));
|
|
29689
30153
|
};
|
|
29690
30154
|
}
|
|
29691
30155
|
});
|
|
@@ -29728,7 +30192,7 @@ and ensure you are accounting for this risk.
|
|
|
29728
30192
|
const _hoisted_1$w = { id: "lupa-search-results-rating" };
|
|
29729
30193
|
const _hoisted_2$p = { class: "lupa-ratings" };
|
|
29730
30194
|
const _hoisted_3$i = { class: "lupa-ratings-base" };
|
|
29731
|
-
const _hoisted_4$
|
|
30195
|
+
const _hoisted_4$a = ["innerHTML"];
|
|
29732
30196
|
const _hoisted_5$7 = { class: "lupa-rating-wrapper" };
|
|
29733
30197
|
const _hoisted_6$3 = ["innerHTML"];
|
|
29734
30198
|
const _hoisted_7$2 = ["href"];
|
|
@@ -29778,7 +30242,7 @@ and ensure you are accounting for this risk.
|
|
|
29778
30242
|
key: index,
|
|
29779
30243
|
innerHTML: star,
|
|
29780
30244
|
class: "lupa-rating lupa-rating-not-highlighted"
|
|
29781
|
-
}, null, 8, _hoisted_4$
|
|
30245
|
+
}, null, 8, _hoisted_4$a);
|
|
29782
30246
|
}), 128))
|
|
29783
30247
|
]),
|
|
29784
30248
|
createBaseVNode("div", _hoisted_5$7, [
|
|
@@ -29865,7 +30329,7 @@ and ensure you are accounting for this risk.
|
|
|
29865
30329
|
const _hoisted_1$u = { class: "lupa-search-results-add-to-cart-wrapper" };
|
|
29866
30330
|
const _hoisted_2$o = { class: "lupa-search-results-product-addtocart" };
|
|
29867
30331
|
const _hoisted_3$h = ["disabled"];
|
|
29868
|
-
const _hoisted_4$
|
|
30332
|
+
const _hoisted_4$9 = ["href"];
|
|
29869
30333
|
const _hoisted_5$6 = ["id", "disabled", "onClick"];
|
|
29870
30334
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
29871
30335
|
__name: "SearchResultsProductAddToCart",
|
|
@@ -29884,6 +30348,8 @@ and ensure you are accounting for this risk.
|
|
|
29884
30348
|
return (_a = props.inStock) != null ? _a : true;
|
|
29885
30349
|
});
|
|
29886
30350
|
const searchResultStore = useSearchResultStore();
|
|
30351
|
+
const optionsStore = useOptionsStore();
|
|
30352
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
29887
30353
|
const { addToCartAmount } = storeToRefs(searchResultStore);
|
|
29888
30354
|
const loading = ref(false);
|
|
29889
30355
|
const label = computed(() => {
|
|
@@ -29894,7 +30360,16 @@ and ensure you are accounting for this risk.
|
|
|
29894
30360
|
const id2 = (_a = props.item.id) != null ? _a : "";
|
|
29895
30361
|
return `lupa-add-to-cart-${id2}`;
|
|
29896
30362
|
});
|
|
29897
|
-
const
|
|
30363
|
+
const productCardIsClickable = computed(() => {
|
|
30364
|
+
return searchResultOptions.value.isLink;
|
|
30365
|
+
});
|
|
30366
|
+
const hasLink = computed(() => {
|
|
30367
|
+
return Boolean(props.link && props.options.link);
|
|
30368
|
+
});
|
|
30369
|
+
const handleClick = (e2) => __async2(this, null, function* () {
|
|
30370
|
+
if (productCardIsClickable.value && !hasLink.value) {
|
|
30371
|
+
e2.preventDefault();
|
|
30372
|
+
}
|
|
29898
30373
|
loading.value = true;
|
|
29899
30374
|
if (props.options.emitEvent) {
|
|
29900
30375
|
const event = new CustomEvent(props.options.emitEvent, { detail: { item: props.item } });
|
|
@@ -29906,9 +30381,6 @@ and ensure you are accounting for this risk.
|
|
|
29906
30381
|
emit2("productEvent", { type: "addToCart" });
|
|
29907
30382
|
loading.value = false;
|
|
29908
30383
|
});
|
|
29909
|
-
const hasLink = computed(() => {
|
|
29910
|
-
return Boolean(props.link && props.options.link);
|
|
29911
|
-
});
|
|
29912
30384
|
return (_ctx, _cache) => {
|
|
29913
30385
|
return openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
29914
30386
|
createBaseVNode("div", _hoisted_2$o, [
|
|
@@ -29918,7 +30390,7 @@ and ensure you are accounting for this risk.
|
|
|
29918
30390
|
"data-cy": "lupa-add-to-cart",
|
|
29919
30391
|
disabled: !inStockValue.value || loading.value
|
|
29920
30392
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
29921
|
-
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$
|
|
30393
|
+
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$9)
|
|
29922
30394
|
], 16, _hoisted_3$h)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
29923
30395
|
key: 1,
|
|
29924
30396
|
id: id.value,
|
|
@@ -29936,7 +30408,7 @@ and ensure you are accounting for this risk.
|
|
|
29936
30408
|
const _hoisted_1$t = ["innerHTML"];
|
|
29937
30409
|
const _hoisted_2$n = { key: 0 };
|
|
29938
30410
|
const _hoisted_3$g = { key: 1 };
|
|
29939
|
-
const _hoisted_4$
|
|
30411
|
+
const _hoisted_4$8 = { class: "lupa-search-box-custom-label" };
|
|
29940
30412
|
const _hoisted_5$5 = { class: "lupa-search-box-custom-text" };
|
|
29941
30413
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
29942
30414
|
__name: "SearchResultsProductCustom",
|
|
@@ -29981,7 +30453,7 @@ and ensure you are accounting for this risk.
|
|
|
29981
30453
|
class: className.value
|
|
29982
30454
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
29983
30455
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$n, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$g, [
|
|
29984
|
-
createBaseVNode("div", _hoisted_4$
|
|
30456
|
+
createBaseVNode("div", _hoisted_4$8, toDisplayString(label.value), 1),
|
|
29985
30457
|
createBaseVNode("div", _hoisted_5$5, toDisplayString(text.value), 1)
|
|
29986
30458
|
]))
|
|
29987
30459
|
], 16));
|
|
@@ -30027,7 +30499,7 @@ and ensure you are accounting for this risk.
|
|
|
30027
30499
|
const _hoisted_1$r = { id: "lupa-search-results-rating" };
|
|
30028
30500
|
const _hoisted_2$m = ["innerHTML"];
|
|
30029
30501
|
const _hoisted_3$f = { class: "lupa-ratings" };
|
|
30030
|
-
const _hoisted_4$
|
|
30502
|
+
const _hoisted_4$7 = ["href"];
|
|
30031
30503
|
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
30032
30504
|
__name: "SearchResultsProductSingleStarRating",
|
|
30033
30505
|
props: {
|
|
@@ -30065,7 +30537,7 @@ and ensure you are accounting for this risk.
|
|
|
30065
30537
|
createBaseVNode("a", {
|
|
30066
30538
|
href: ratingLink.value,
|
|
30067
30539
|
class: "lupa-total-ratings"
|
|
30068
|
-
}, toDisplayString(totalRatings.value), 9, _hoisted_4$
|
|
30540
|
+
}, toDisplayString(totalRatings.value), 9, _hoisted_4$7)
|
|
30069
30541
|
]);
|
|
30070
30542
|
};
|
|
30071
30543
|
}
|
|
@@ -30166,13 +30638,12 @@ and ensure you are accounting for this risk.
|
|
|
30166
30638
|
};
|
|
30167
30639
|
}
|
|
30168
30640
|
}));
|
|
30169
|
-
const _hoisted_1$q = ["
|
|
30170
|
-
const _hoisted_2$l =
|
|
30171
|
-
const _hoisted_3$e = {
|
|
30641
|
+
const _hoisted_1$q = ["href"];
|
|
30642
|
+
const _hoisted_2$l = {
|
|
30172
30643
|
key: 0,
|
|
30173
30644
|
class: "lupa-out-of-stock"
|
|
30174
30645
|
};
|
|
30175
|
-
const
|
|
30646
|
+
const _hoisted_3$e = { class: "lupa-search-result-product-details-section" };
|
|
30176
30647
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
30177
30648
|
__name: "SearchResultsProductCard",
|
|
30178
30649
|
props: {
|
|
@@ -30201,6 +30672,9 @@ and ensure you are accounting for this risk.
|
|
|
30201
30672
|
const listLayoutClass = computed(() => {
|
|
30202
30673
|
return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
|
|
30203
30674
|
});
|
|
30675
|
+
const useLinkWrapper = computed(() => {
|
|
30676
|
+
return props.options.isLink;
|
|
30677
|
+
});
|
|
30204
30678
|
const badgesOptions = computed(() => {
|
|
30205
30679
|
return __spreadProps2(__spreadValues2({}, props.options.badges), { product: props.product });
|
|
30206
30680
|
});
|
|
@@ -30329,78 +30803,84 @@ and ensure you are accounting for this risk.
|
|
|
30329
30803
|
checkIfIsInStock();
|
|
30330
30804
|
}
|
|
30331
30805
|
return (_ctx, _cache) => {
|
|
30332
|
-
|
|
30333
|
-
|
|
30806
|
+
return openBlock(), createBlock(resolveDynamicComponent(useLinkWrapper.value ? "a" : "div"), mergeProps({
|
|
30807
|
+
href: useLinkWrapper.value ? link.value : null,
|
|
30334
30808
|
id: "lupa-search-result-product-card",
|
|
30335
30809
|
"data-cy": "lupa-search-result-product-card",
|
|
30336
30810
|
class: ["lupa-search-result-product-card", !isInStock.value ? "lupa-out-of-stock" : ""]
|
|
30337
30811
|
}, customDocumentHtmlAttributes.value, {
|
|
30338
30812
|
onClick: handleClick,
|
|
30339
30813
|
onMouseup: withModifiers(handleClick, ["middle", "exact"])
|
|
30340
|
-
}),
|
|
30341
|
-
|
|
30342
|
-
|
|
30343
|
-
|
|
30344
|
-
|
|
30345
|
-
|
|
30346
|
-
|
|
30347
|
-
href: link.value,
|
|
30348
|
-
onClick: handleNavigation
|
|
30349
|
-
}, [
|
|
30350
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
|
|
30351
|
-
return openBlock(), createBlock(_sfc_main$t, {
|
|
30352
|
-
class: "lupa-search-results-product-element",
|
|
30353
|
-
item: _ctx.product,
|
|
30354
|
-
element,
|
|
30355
|
-
key: element.key,
|
|
30356
|
-
labels: labels.value,
|
|
30357
|
-
inStock: isInStock.value,
|
|
30358
|
-
link: link.value,
|
|
30359
|
-
onProductEvent: handleProductEvent
|
|
30360
|
-
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30361
|
-
}), 128)),
|
|
30362
|
-
createVNode(_sfc_main$19, {
|
|
30363
|
-
options: badgesOptions.value,
|
|
30364
|
-
position: "image",
|
|
30365
|
-
class: "lupa-image-badges"
|
|
30366
|
-
}, null, 8, ["options"]),
|
|
30367
|
-
((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_3$e, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
|
|
30368
|
-
], 8, _hoisted_2$l),
|
|
30369
|
-
createBaseVNode("div", _hoisted_4$7, [
|
|
30370
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
30371
|
-
return openBlock(), createBlock(_sfc_main$t, {
|
|
30372
|
-
class: "lupa-search-results-product-element",
|
|
30373
|
-
item: _ctx.product,
|
|
30374
|
-
element,
|
|
30375
|
-
key: element.key,
|
|
30376
|
-
labels: labels.value,
|
|
30377
|
-
inStock: isInStock.value,
|
|
30378
|
-
link: link.value,
|
|
30379
|
-
onProductEvent: handleProductEvent
|
|
30380
|
-
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30381
|
-
}), 128))
|
|
30382
|
-
]),
|
|
30383
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(elementGroups.value, (group) => {
|
|
30384
|
-
return openBlock(), createElementBlock("div", {
|
|
30385
|
-
key: group,
|
|
30386
|
-
class: normalizeClass("lupa-element-group-" + group)
|
|
30814
|
+
}), {
|
|
30815
|
+
default: withCtx(() => {
|
|
30816
|
+
var _a;
|
|
30817
|
+
return [
|
|
30818
|
+
createVNode(_sfc_main$19, { options: badgesOptions.value }, null, 8, ["options"]),
|
|
30819
|
+
createBaseVNode("div", {
|
|
30820
|
+
class: normalizeClass(["lupa-search-result-product-contents", listLayoutClass.value])
|
|
30387
30821
|
}, [
|
|
30388
|
-
(
|
|
30389
|
-
|
|
30390
|
-
|
|
30391
|
-
|
|
30392
|
-
|
|
30393
|
-
|
|
30394
|
-
|
|
30395
|
-
|
|
30396
|
-
|
|
30397
|
-
|
|
30398
|
-
|
|
30822
|
+
createBaseVNode("a", {
|
|
30823
|
+
class: "lupa-search-result-product-image-section",
|
|
30824
|
+
href: link.value,
|
|
30825
|
+
onClick: handleNavigation
|
|
30826
|
+
}, [
|
|
30827
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
|
|
30828
|
+
return openBlock(), createBlock(_sfc_main$t, {
|
|
30829
|
+
class: "lupa-search-results-product-element",
|
|
30830
|
+
item: _ctx.product,
|
|
30831
|
+
element,
|
|
30832
|
+
key: element.key,
|
|
30833
|
+
labels: labels.value,
|
|
30834
|
+
inStock: isInStock.value,
|
|
30835
|
+
link: link.value,
|
|
30836
|
+
onProductEvent: handleProductEvent
|
|
30837
|
+
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30838
|
+
}), 128)),
|
|
30839
|
+
createVNode(_sfc_main$19, {
|
|
30840
|
+
options: badgesOptions.value,
|
|
30841
|
+
position: "image",
|
|
30842
|
+
class: "lupa-image-badges"
|
|
30843
|
+
}, null, 8, ["options"]),
|
|
30844
|
+
((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_2$l, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
|
|
30845
|
+
], 8, _hoisted_1$q),
|
|
30846
|
+
createBaseVNode("div", _hoisted_3$e, [
|
|
30847
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
30848
|
+
return openBlock(), createBlock(_sfc_main$t, {
|
|
30849
|
+
class: "lupa-search-results-product-element",
|
|
30850
|
+
item: _ctx.product,
|
|
30851
|
+
element,
|
|
30852
|
+
key: element.key,
|
|
30853
|
+
labels: labels.value,
|
|
30854
|
+
inStock: isInStock.value,
|
|
30855
|
+
link: link.value,
|
|
30856
|
+
onProductEvent: handleProductEvent
|
|
30857
|
+
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30858
|
+
}), 128))
|
|
30859
|
+
]),
|
|
30860
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(elementGroups.value, (group) => {
|
|
30861
|
+
return openBlock(), createElementBlock("div", {
|
|
30862
|
+
key: group,
|
|
30863
|
+
class: normalizeClass("lupa-element-group-" + group)
|
|
30864
|
+
}, [
|
|
30865
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getGroupElements(group), (element) => {
|
|
30866
|
+
return openBlock(), createBlock(_sfc_main$t, {
|
|
30867
|
+
class: "lupa-search-results-product-element",
|
|
30868
|
+
item: _ctx.product,
|
|
30869
|
+
element,
|
|
30870
|
+
key: element.key,
|
|
30871
|
+
labels: labels.value,
|
|
30872
|
+
inStock: isInStock.value,
|
|
30873
|
+
link: link.value,
|
|
30874
|
+
onProductEvent: handleProductEvent
|
|
30875
|
+
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30876
|
+
}), 128))
|
|
30877
|
+
], 2);
|
|
30399
30878
|
}), 128))
|
|
30400
|
-
], 2)
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30879
|
+
], 2)
|
|
30880
|
+
];
|
|
30881
|
+
}),
|
|
30882
|
+
_: 1
|
|
30883
|
+
}, 16, ["href", "class", "onMouseup"]);
|
|
30404
30884
|
};
|
|
30405
30885
|
}
|
|
30406
30886
|
});
|
|
@@ -31333,6 +31813,7 @@ and ensure you are accounting for this risk.
|
|
|
31333
31813
|
"queryKey",
|
|
31334
31814
|
"idKey",
|
|
31335
31815
|
"titleKey",
|
|
31816
|
+
"isLink",
|
|
31336
31817
|
"routingBehavior",
|
|
31337
31818
|
"customDocumentHtmlAttributes"
|
|
31338
31819
|
]);
|
|
@@ -33147,21 +33628,6 @@ and ensure you are accounting for this risk.
|
|
|
33147
33628
|
};
|
|
33148
33629
|
}
|
|
33149
33630
|
});
|
|
33150
|
-
const Env = {
|
|
33151
|
-
production: "https://api.lupasearch.com/v1/",
|
|
33152
|
-
staging: "https://api.staging.lupasearch.com/v1/"
|
|
33153
|
-
};
|
|
33154
|
-
const DEFAULT_REQUEST_CONFIG = {
|
|
33155
|
-
method: "POST",
|
|
33156
|
-
headers: { "Content-Type": "application/json" }
|
|
33157
|
-
};
|
|
33158
|
-
const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
|
|
33159
|
-
const getApiUrl = (environment, customBaseUrl) => {
|
|
33160
|
-
if (customBaseUrl) {
|
|
33161
|
-
return customBaseUrl;
|
|
33162
|
-
}
|
|
33163
|
-
return Env[environment] || Env["production"];
|
|
33164
|
-
};
|
|
33165
33631
|
const suggestSearchChatPhrases = (options, request, chatSettings) => __async2(void 0, null, function* () {
|
|
33166
33632
|
var _a, _b, _c;
|
|
33167
33633
|
const { environment, customBaseUrl } = options;
|
|
@@ -33668,7 +34134,7 @@ and ensure you are accounting for this risk.
|
|
|
33668
34134
|
key: 0,
|
|
33669
34135
|
class: "lupasearch-chat-content"
|
|
33670
34136
|
};
|
|
33671
|
-
const _sfc_main$
|
|
34137
|
+
const _sfc_main$1A = /* @__PURE__ */ defineComponent({
|
|
33672
34138
|
__name: "ChatContainer",
|
|
33673
34139
|
props: {
|
|
33674
34140
|
options: {}
|
|
@@ -40322,7 +40788,7 @@ and ensure you are accounting for this risk.
|
|
|
40322
40788
|
const instance = createVue(
|
|
40323
40789
|
options.displayOptions.containerSelector,
|
|
40324
40790
|
mountOptions == null ? void 0 : mountOptions.mountingBehavior,
|
|
40325
|
-
_sfc_main$
|
|
40791
|
+
_sfc_main$1A,
|
|
40326
40792
|
{
|
|
40327
40793
|
options
|
|
40328
40794
|
}
|