@getlupa/vue 0.23.1 → 0.24.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/dist/components/search-box/SearchBoxNoResults.vue.d.ts +3 -3
- package/dist/composables/useSorting.d.ts +3 -0
- package/dist/lupaContainerStyle.css +1 -1
- package/dist/lupaSearch.js +368 -171
- package/dist/lupaSearch.mjs +368 -171
- package/dist/style.css +1 -1
- package/dist/types/General.d.ts +2 -1
- package/dist/types/search-box/SearchBoxOptions.d.ts +4 -0
- package/dist/types/search-box/SearchBoxPanel.d.ts +3 -0
- package/dist/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/utils/query.utils.d.ts +1 -1
- package/package.json +2 -2
package/dist/lupaSearch.mjs
CHANGED
|
@@ -3738,11 +3738,11 @@ var parsePath = (string) => {
|
|
|
3738
3738
|
return result2;
|
|
3739
3739
|
};
|
|
3740
3740
|
init_esm_shims();
|
|
3741
|
-
function simpleTransformation(isApplicable, annotation,
|
|
3741
|
+
function simpleTransformation(isApplicable, annotation, transform2, untransform) {
|
|
3742
3742
|
return {
|
|
3743
3743
|
isApplicable,
|
|
3744
3744
|
annotation,
|
|
3745
|
-
transform,
|
|
3745
|
+
transform: transform2,
|
|
3746
3746
|
untransform
|
|
3747
3747
|
};
|
|
3748
3748
|
}
|
|
@@ -3803,11 +3803,11 @@ var simpleRules = [
|
|
|
3803
3803
|
}, Number),
|
|
3804
3804
|
simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
|
|
3805
3805
|
];
|
|
3806
|
-
function compositeTransformation(isApplicable, annotation,
|
|
3806
|
+
function compositeTransformation(isApplicable, annotation, transform2, untransform) {
|
|
3807
3807
|
return {
|
|
3808
3808
|
isApplicable,
|
|
3809
3809
|
annotation,
|
|
3810
|
-
transform,
|
|
3810
|
+
transform: transform2,
|
|
3811
3811
|
untransform
|
|
3812
3812
|
};
|
|
3813
3813
|
}
|
|
@@ -5720,33 +5720,6 @@ const addCustomParams = (url, customParams) => {
|
|
|
5720
5720
|
const separator = url.includes("?") ? "&" : "?";
|
|
5721
5721
|
return url + separator + e(customParams);
|
|
5722
5722
|
};
|
|
5723
|
-
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
5724
|
-
function adopt(value) {
|
|
5725
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
5726
|
-
resolve(value);
|
|
5727
|
-
});
|
|
5728
|
-
}
|
|
5729
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
5730
|
-
function fulfilled(value) {
|
|
5731
|
-
try {
|
|
5732
|
-
step(generator.next(value));
|
|
5733
|
-
} catch (e2) {
|
|
5734
|
-
reject(e2);
|
|
5735
|
-
}
|
|
5736
|
-
}
|
|
5737
|
-
function rejected(value) {
|
|
5738
|
-
try {
|
|
5739
|
-
step(generator["throw"](value));
|
|
5740
|
-
} catch (e2) {
|
|
5741
|
-
reject(e2);
|
|
5742
|
-
}
|
|
5743
|
-
}
|
|
5744
|
-
function step(result2) {
|
|
5745
|
-
result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected);
|
|
5746
|
-
}
|
|
5747
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5748
|
-
});
|
|
5749
|
-
};
|
|
5750
5723
|
const defaultConfig = {
|
|
5751
5724
|
method: "POST",
|
|
5752
5725
|
headers: { "Content-Type": "application/json" }
|
|
@@ -5757,7 +5730,7 @@ const customRequestConfig = ({ customHeaders }) => {
|
|
|
5757
5730
|
headers: Object.assign(Object.assign({}, defaultConfig.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
|
|
5758
5731
|
};
|
|
5759
5732
|
};
|
|
5760
|
-
const searchCustom = (query, options) =>
|
|
5733
|
+
const searchCustom = (query, options) => __async(null, null, function* () {
|
|
5761
5734
|
var _a25;
|
|
5762
5735
|
const res = yield fetch(options.customUrl, Object.assign(Object.assign({}, customRequestConfig({ customHeaders: options.customHeaders })), { body: JSON.stringify(Object.assign({ publicQuery: query }, (_a25 = options.customPayload) !== null && _a25 !== void 0 ? _a25 : {})) }));
|
|
5763
5736
|
if (res.status < 400) {
|
|
@@ -5767,9 +5740,9 @@ const searchCustom = (query, options) => __awaiter(void 0, void 0, void 0, funct
|
|
|
5767
5740
|
const errors = yield res.json();
|
|
5768
5741
|
return { success: false, errors };
|
|
5769
5742
|
});
|
|
5770
|
-
const suggestCustom = (query, options) =>
|
|
5771
|
-
var
|
|
5772
|
-
const res = yield fetch(options.customUrl, Object.assign(Object.assign({}, customRequestConfig({ customHeaders: options.customHeaders })), { body: JSON.stringify(Object.assign({ publicQuery: query }, (
|
|
5743
|
+
const suggestCustom = (query, options) => __async(null, null, function* () {
|
|
5744
|
+
var _a25;
|
|
5745
|
+
const res = yield fetch(options.customUrl, Object.assign(Object.assign({}, customRequestConfig({ customHeaders: options.customHeaders })), { body: JSON.stringify(Object.assign({ publicQuery: query }, (_a25 = options.customPayload) !== null && _a25 !== void 0 ? _a25 : {})) }));
|
|
5773
5746
|
if (res.status < 400) {
|
|
5774
5747
|
const items = yield res.json();
|
|
5775
5748
|
return { items, success: true };
|
|
@@ -5777,7 +5750,7 @@ const suggestCustom = (query, options) => __awaiter(void 0, void 0, void 0, func
|
|
|
5777
5750
|
const errors = yield res.json();
|
|
5778
5751
|
return { success: false, errors };
|
|
5779
5752
|
});
|
|
5780
|
-
const search = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5753
|
+
const search = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5781
5754
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`;
|
|
5782
5755
|
const url = addCustomParams(endpoint, customParams);
|
|
5783
5756
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5788,7 +5761,7 @@ const search = (queryKey, query, environment, customBaseUrl, customParams) => __
|
|
|
5788
5761
|
const errors = yield res.json();
|
|
5789
5762
|
return { success: false, errors };
|
|
5790
5763
|
});
|
|
5791
|
-
const facets = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5764
|
+
const facets = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5792
5765
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/facets`;
|
|
5793
5766
|
const url = addCustomParams(endpoint, customParams);
|
|
5794
5767
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5799,7 +5772,7 @@ const facets = (queryKey, query, environment, customBaseUrl, customParams) => __
|
|
|
5799
5772
|
const errors = yield res.json();
|
|
5800
5773
|
return { success: false, errors };
|
|
5801
5774
|
});
|
|
5802
|
-
const refiners = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5775
|
+
const refiners = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5803
5776
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/refiners`;
|
|
5804
5777
|
const url = addCustomParams(endpoint, customParams);
|
|
5805
5778
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5810,7 +5783,7 @@ const refiners = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
|
5810
5783
|
const errors = yield res.json();
|
|
5811
5784
|
return { success: false, errors };
|
|
5812
5785
|
});
|
|
5813
|
-
const relatedQueries = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5786
|
+
const relatedQueries = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5814
5787
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/related`;
|
|
5815
5788
|
const url = addCustomParams(endpoint, customParams);
|
|
5816
5789
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5821,7 +5794,7 @@ const relatedQueries = (queryKey, query, environment, customBaseUrl, customParam
|
|
|
5821
5794
|
const errors = yield res.json();
|
|
5822
5795
|
return { success: false, errors };
|
|
5823
5796
|
});
|
|
5824
|
-
const queryByIds = (queryKey, ids, environment, customBaseUrl, customParams) =>
|
|
5797
|
+
const queryByIds = (queryKey, ids, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5825
5798
|
const idParam = ids.map((id) => `ids=${id}`).join("&");
|
|
5826
5799
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`;
|
|
5827
5800
|
const url = addCustomParams(endpoint, customParams);
|
|
@@ -5833,7 +5806,7 @@ const queryByIds = (queryKey, ids, environment, customBaseUrl, customParams) =>
|
|
|
5833
5806
|
const errors = yield res.json();
|
|
5834
5807
|
return { success: false, errors };
|
|
5835
5808
|
});
|
|
5836
|
-
const recommendForSingleId = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) =>
|
|
5809
|
+
const recommendForSingleId = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5837
5810
|
let endpoint = `${getApiUrl$1(environment, customBaseUrl)}recommendations/document/${recommendForId}?recommendationQueryKey=${queryKey}`;
|
|
5838
5811
|
if (filters) {
|
|
5839
5812
|
endpoint += `&${e({ filters })}`;
|
|
@@ -5847,7 +5820,7 @@ const recommendForSingleId = (queryKey, recommendForId, filters, environment, cu
|
|
|
5847
5820
|
const errors = yield res.json();
|
|
5848
5821
|
return { success: false, errors };
|
|
5849
5822
|
});
|
|
5850
|
-
const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment, customBaseUrl, customParams) =>
|
|
5823
|
+
const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5851
5824
|
const limitedRecommendForIds = recommendForIds.slice(0, 20);
|
|
5852
5825
|
let endpoint = `${getApiUrl$1(environment, customBaseUrl)}recommendations/documentsByMultipleIds?recommendationQueryKey=${queryKey}&itemId[]=${limitedRecommendForIds.join("&itemId[]=")}`;
|
|
5853
5826
|
if (filters) {
|
|
@@ -5862,10 +5835,10 @@ const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment
|
|
|
5862
5835
|
const errors = yield res.json();
|
|
5863
5836
|
return { success: false, errors };
|
|
5864
5837
|
});
|
|
5865
|
-
const recommend = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) =>
|
|
5838
|
+
const recommend = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5866
5839
|
return Array.isArray(recommendForId) ? yield recommendForMultipleIds(queryKey, recommendForId, filters, environment, customBaseUrl, customParams) : yield recommendForSingleId(queryKey, recommendForId, filters, environment, customBaseUrl, customParams);
|
|
5867
5840
|
});
|
|
5868
|
-
const suggest = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5841
|
+
const suggest = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5869
5842
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`;
|
|
5870
5843
|
const url = addCustomParams(endpoint, customParams);
|
|
5871
5844
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5876,18 +5849,18 @@ const suggest = (queryKey, query, environment, customBaseUrl, customParams) => _
|
|
|
5876
5849
|
const errors = yield res.json();
|
|
5877
5850
|
return { success: false, errors };
|
|
5878
5851
|
});
|
|
5879
|
-
const track$1 = (queryKey, event, environment, customBaseUrl) =>
|
|
5852
|
+
const track$1 = (queryKey, event, environment, customBaseUrl) => __async(null, null, function* () {
|
|
5880
5853
|
try {
|
|
5881
5854
|
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
|
|
5882
5855
|
if (res.status < 400) {
|
|
5883
5856
|
return { success: false };
|
|
5884
5857
|
}
|
|
5885
5858
|
return res.json();
|
|
5886
|
-
} catch (
|
|
5859
|
+
} catch (_a25) {
|
|
5887
5860
|
return { success: false };
|
|
5888
5861
|
}
|
|
5889
5862
|
});
|
|
5890
|
-
const loadRedirectionRules = (queryKey, environment, customBaseUrl) =>
|
|
5863
|
+
const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __async(null, null, function* () {
|
|
5891
5864
|
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
|
|
5892
5865
|
if (res.status < 400) {
|
|
5893
5866
|
return res.json();
|
|
@@ -5895,27 +5868,164 @@ const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __awaiter
|
|
|
5895
5868
|
const errors = yield res.json();
|
|
5896
5869
|
return { success: false, errors };
|
|
5897
5870
|
});
|
|
5871
|
+
const FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
5872
|
+
const isSafeKey = (key) => !FORBIDDEN_KEYS.has(key);
|
|
5873
|
+
const toPath = (key) => key.split(".").filter(Boolean);
|
|
5874
|
+
const isObjectLike = (v) => typeof v === "object" && v !== null;
|
|
5875
|
+
const hasByPath = (obj, path) => {
|
|
5876
|
+
let cur = obj;
|
|
5877
|
+
for (let i = 0; i < path.length; i++) {
|
|
5878
|
+
const k = path[i];
|
|
5879
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5880
|
+
return false;
|
|
5881
|
+
}
|
|
5882
|
+
if (!Object.prototype.hasOwnProperty.call(cur, k)) {
|
|
5883
|
+
return false;
|
|
5884
|
+
}
|
|
5885
|
+
cur = cur[k];
|
|
5886
|
+
}
|
|
5887
|
+
return true;
|
|
5888
|
+
};
|
|
5889
|
+
const getByPath = (obj, path) => {
|
|
5890
|
+
let cur = obj;
|
|
5891
|
+
for (const k of path) {
|
|
5892
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5893
|
+
return void 0;
|
|
5894
|
+
}
|
|
5895
|
+
cur = cur[k];
|
|
5896
|
+
}
|
|
5897
|
+
return cur;
|
|
5898
|
+
};
|
|
5899
|
+
const setByPath = (obj, path, value) => {
|
|
5900
|
+
if (!path.length) {
|
|
5901
|
+
return;
|
|
5902
|
+
}
|
|
5903
|
+
let cur = obj;
|
|
5904
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
5905
|
+
const k = path[i];
|
|
5906
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5907
|
+
return;
|
|
5908
|
+
}
|
|
5909
|
+
const next = cur[k];
|
|
5910
|
+
if (!isObjectLike(next))
|
|
5911
|
+
cur[k] = {};
|
|
5912
|
+
cur = cur[k];
|
|
5913
|
+
}
|
|
5914
|
+
const lastKey = path[path.length - 1];
|
|
5915
|
+
if (!isSafeKey(lastKey) || !isObjectLike(cur)) {
|
|
5916
|
+
return;
|
|
5917
|
+
}
|
|
5918
|
+
cur[lastKey] = value;
|
|
5919
|
+
};
|
|
5920
|
+
const unsetByPath = (obj, path) => {
|
|
5921
|
+
if (!path.length) {
|
|
5922
|
+
return;
|
|
5923
|
+
}
|
|
5924
|
+
let cur = obj;
|
|
5925
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
5926
|
+
const k = path[i];
|
|
5927
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5928
|
+
return;
|
|
5929
|
+
}
|
|
5930
|
+
if (!Object.prototype.hasOwnProperty.call(cur, k)) {
|
|
5931
|
+
return;
|
|
5932
|
+
}
|
|
5933
|
+
cur = cur[k];
|
|
5934
|
+
}
|
|
5935
|
+
const lastKey = path[path.length - 1];
|
|
5936
|
+
if (!isSafeKey(lastKey) || !isObjectLike(cur)) {
|
|
5937
|
+
return;
|
|
5938
|
+
}
|
|
5939
|
+
delete cur[lastKey];
|
|
5940
|
+
};
|
|
5941
|
+
const transformItems = (items, transformOptions) => {
|
|
5942
|
+
var _a25;
|
|
5943
|
+
const mapping = (_a25 = transformOptions === null || transformOptions === void 0 ? void 0 : transformOptions.transform) === null || _a25 === void 0 ? void 0 : _a25.fieldNames;
|
|
5944
|
+
if (!(items === null || items === void 0 ? void 0 : items.length) || !mapping) {
|
|
5945
|
+
return items;
|
|
5946
|
+
}
|
|
5947
|
+
return items.map((item) => {
|
|
5948
|
+
for (const [originalField, newField] of Object.entries(mapping)) {
|
|
5949
|
+
const fromPath = toPath(originalField);
|
|
5950
|
+
const toPathArr = toPath(newField);
|
|
5951
|
+
if (!fromPath.length || !toPathArr.length) {
|
|
5952
|
+
continue;
|
|
5953
|
+
}
|
|
5954
|
+
if (!hasByPath(item, fromPath)) {
|
|
5955
|
+
continue;
|
|
5956
|
+
}
|
|
5957
|
+
const value = getByPath(item, fromPath);
|
|
5958
|
+
setByPath(item, toPathArr, value);
|
|
5959
|
+
unsetByPath(item, fromPath);
|
|
5960
|
+
}
|
|
5961
|
+
return item;
|
|
5962
|
+
});
|
|
5963
|
+
};
|
|
5964
|
+
const transform = (result2, transformOptions) => {
|
|
5965
|
+
var _a25, _b25, _c, _d, _e, _f, _g;
|
|
5966
|
+
let transformedResult = result2;
|
|
5967
|
+
if (!result2 || !(transformOptions === null || transformOptions === void 0 ? void 0 : transformOptions.transform)) {
|
|
5968
|
+
return result2;
|
|
5969
|
+
}
|
|
5970
|
+
if ((_a25 = result2 === null || result2 === void 0 ? void 0 : result2.items) === null || _a25 === void 0 ? void 0 : _a25.length) {
|
|
5971
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { items: transformItems(transformedResult.items, transformOptions) });
|
|
5972
|
+
}
|
|
5973
|
+
if ((_b25 = result2 === null || result2 === void 0 ? void 0 : result2.similarQueries) === null || _b25 === void 0 ? void 0 : _b25.length) {
|
|
5974
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { similarQueries: (_c = transformedResult.similarQueries) === null || _c === void 0 ? void 0 : _c.map((similarQuery) => Object.assign(Object.assign({}, similarQuery), { items: transformItems(similarQuery.items, transformOptions) })) });
|
|
5975
|
+
}
|
|
5976
|
+
if ((_e = (_d = result2 === null || result2 === void 0 ? void 0 : result2.similarResults) === null || _d === void 0 ? void 0 : _d.items) === null || _e === void 0 ? void 0 : _e.length) {
|
|
5977
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { similarResults: Object.assign(Object.assign({}, transformedResult.similarResults), { items: transformItems(transformedResult.similarResults.items, transformOptions) }) });
|
|
5978
|
+
}
|
|
5979
|
+
if ((_f = result2.relatedQueries) === null || _f === void 0 ? void 0 : _f.length) {
|
|
5980
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { relatedQueries: (_g = transformedResult.relatedQueries) === null || _g === void 0 ? void 0 : _g.map((relatedQuery) => Object.assign(Object.assign({}, relatedQuery), { topItems: transformItems(relatedQuery.topItems, transformOptions) })) });
|
|
5981
|
+
}
|
|
5982
|
+
return transformedResult;
|
|
5983
|
+
};
|
|
5984
|
+
const transformSearchQueryResult = (result2, transformOptions) => {
|
|
5985
|
+
if (result2.success === false) {
|
|
5986
|
+
return result2;
|
|
5987
|
+
}
|
|
5988
|
+
return transform(result2, transformOptions);
|
|
5989
|
+
};
|
|
5990
|
+
const transformSearchQueryRefinersResult = (result2, transformOptions) => {
|
|
5991
|
+
if (result2.success === false) {
|
|
5992
|
+
return result2;
|
|
5993
|
+
}
|
|
5994
|
+
return transform(result2, transformOptions);
|
|
5995
|
+
};
|
|
5996
|
+
const transformRelatedQueries = (result2, transformOptions) => {
|
|
5997
|
+
if (result2.success === false) {
|
|
5998
|
+
return result2;
|
|
5999
|
+
}
|
|
6000
|
+
return transform(result2, transformOptions);
|
|
6001
|
+
};
|
|
5898
6002
|
const LupaSearchSdk = {
|
|
5899
|
-
query: (queryKey, publicQuery, options = null) => {
|
|
6003
|
+
query: (queryKey, publicQuery, options = null) => __async(null, null, function* () {
|
|
5900
6004
|
if (options === null || options === void 0 ? void 0 : options.customUrl) {
|
|
5901
|
-
|
|
6005
|
+
const result3 = yield searchCustom(publicQuery, options);
|
|
6006
|
+
return transformSearchQueryResult(result3, options);
|
|
5902
6007
|
}
|
|
5903
|
-
|
|
5904
|
-
|
|
6008
|
+
const result2 = yield search(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6009
|
+
return transformSearchQueryResult(result2, options);
|
|
6010
|
+
}),
|
|
5905
6011
|
queryFacets: (queryKey, publicQuery, options = null) => {
|
|
5906
6012
|
return facets(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
5907
6013
|
},
|
|
5908
|
-
queryRefiners: (queryKey, publicQuery, options = null) => {
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
6014
|
+
queryRefiners: (queryKey, publicQuery, options = null) => __async(null, null, function* () {
|
|
6015
|
+
const result2 = yield refiners(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6016
|
+
return transformSearchQueryRefinersResult(result2, options);
|
|
6017
|
+
}),
|
|
6018
|
+
queryRelated: (queryKey, publicQuery, options = null) => __async(null, null, function* () {
|
|
6019
|
+
const result2 = yield relatedQueries(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6020
|
+
return transformRelatedQueries(result2, options);
|
|
6021
|
+
}),
|
|
5914
6022
|
suggestions: (queryKey, suggestionQuery, options = null) => {
|
|
5915
6023
|
if (options === null || options === void 0 ? void 0 : options.customUrl) {
|
|
5916
|
-
|
|
6024
|
+
const result3 = suggestCustom(suggestionQuery, options);
|
|
6025
|
+
return result3;
|
|
5917
6026
|
}
|
|
5918
|
-
|
|
6027
|
+
const result2 = suggest(queryKey, suggestionQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6028
|
+
return result2;
|
|
5919
6029
|
},
|
|
5920
6030
|
track: (queryKey, eventData, options = null) => {
|
|
5921
6031
|
return track$1(queryKey, eventData, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl);
|
|
@@ -6590,9 +6700,9 @@ function requireLodash() {
|
|
|
6590
6700
|
});
|
|
6591
6701
|
return result2;
|
|
6592
6702
|
}
|
|
6593
|
-
function overArg(func,
|
|
6703
|
+
function overArg(func, transform2) {
|
|
6594
6704
|
return function(arg) {
|
|
6595
|
-
return func(
|
|
6705
|
+
return func(transform2(arg));
|
|
6596
6706
|
};
|
|
6597
6707
|
}
|
|
6598
6708
|
function replaceHolders(array, placeholder) {
|
|
@@ -6699,7 +6809,7 @@ function requireLodash() {
|
|
|
6699
6809
|
var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
|
|
6700
6810
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
6701
6811
|
function lodash2(value) {
|
|
6702
|
-
if (
|
|
6812
|
+
if (isObjectLike2(value) && !isArray3(value) && !(value instanceof LazyWrapper)) {
|
|
6703
6813
|
if (value instanceof LodashWrapper) {
|
|
6704
6814
|
return value;
|
|
6705
6815
|
}
|
|
@@ -7380,19 +7490,19 @@ function requireLodash() {
|
|
|
7380
7490
|
return func == null ? undefined$1 : apply(func, object, args);
|
|
7381
7491
|
}
|
|
7382
7492
|
function baseIsArguments(value) {
|
|
7383
|
-
return
|
|
7493
|
+
return isObjectLike2(value) && baseGetTag(value) == argsTag;
|
|
7384
7494
|
}
|
|
7385
7495
|
function baseIsArrayBuffer(value) {
|
|
7386
|
-
return
|
|
7496
|
+
return isObjectLike2(value) && baseGetTag(value) == arrayBufferTag;
|
|
7387
7497
|
}
|
|
7388
7498
|
function baseIsDate(value) {
|
|
7389
|
-
return
|
|
7499
|
+
return isObjectLike2(value) && baseGetTag(value) == dateTag;
|
|
7390
7500
|
}
|
|
7391
7501
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
7392
7502
|
if (value === other) {
|
|
7393
7503
|
return true;
|
|
7394
7504
|
}
|
|
7395
|
-
if (value == null || other == null || !
|
|
7505
|
+
if (value == null || other == null || !isObjectLike2(value) && !isObjectLike2(other)) {
|
|
7396
7506
|
return value !== value && other !== other;
|
|
7397
7507
|
}
|
|
7398
7508
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
@@ -7428,7 +7538,7 @@ function requireLodash() {
|
|
|
7428
7538
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
7429
7539
|
}
|
|
7430
7540
|
function baseIsMap(value) {
|
|
7431
|
-
return
|
|
7541
|
+
return isObjectLike2(value) && getTag(value) == mapTag;
|
|
7432
7542
|
}
|
|
7433
7543
|
function baseIsMatch(object, source, matchData, customizer) {
|
|
7434
7544
|
var index = matchData.length, length = index, noCustomizer = !customizer;
|
|
@@ -7469,13 +7579,13 @@ function requireLodash() {
|
|
|
7469
7579
|
return pattern.test(toSource(value));
|
|
7470
7580
|
}
|
|
7471
7581
|
function baseIsRegExp(value) {
|
|
7472
|
-
return
|
|
7582
|
+
return isObjectLike2(value) && baseGetTag(value) == regexpTag;
|
|
7473
7583
|
}
|
|
7474
7584
|
function baseIsSet(value) {
|
|
7475
|
-
return
|
|
7585
|
+
return isObjectLike2(value) && getTag(value) == setTag;
|
|
7476
7586
|
}
|
|
7477
7587
|
function baseIsTypedArray(value) {
|
|
7478
|
-
return
|
|
7588
|
+
return isObjectLike2(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
7479
7589
|
}
|
|
7480
7590
|
function baseIteratee(value) {
|
|
7481
7591
|
if (typeof value == "function") {
|
|
@@ -8985,7 +9095,7 @@ function requireLodash() {
|
|
|
8985
9095
|
function objectToString2(value) {
|
|
8986
9096
|
return nativeObjectToString.call(value);
|
|
8987
9097
|
}
|
|
8988
|
-
function overRest(func, start,
|
|
9098
|
+
function overRest(func, start, transform3) {
|
|
8989
9099
|
start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
|
|
8990
9100
|
return function() {
|
|
8991
9101
|
var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
|
|
@@ -8997,7 +9107,7 @@ function requireLodash() {
|
|
|
8997
9107
|
while (++index < start) {
|
|
8998
9108
|
otherArgs[index] = args[index];
|
|
8999
9109
|
}
|
|
9000
|
-
otherArgs[start] =
|
|
9110
|
+
otherArgs[start] = transform3(array);
|
|
9001
9111
|
return apply(func, this, otherArgs);
|
|
9002
9112
|
};
|
|
9003
9113
|
}
|
|
@@ -10019,7 +10129,7 @@ function requireLodash() {
|
|
|
10019
10129
|
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
10020
10130
|
return arguments;
|
|
10021
10131
|
}()) ? baseIsArguments : function(value) {
|
|
10022
|
-
return
|
|
10132
|
+
return isObjectLike2(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
10023
10133
|
};
|
|
10024
10134
|
var isArray3 = Array2.isArray;
|
|
10025
10135
|
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
|
|
@@ -10027,15 +10137,15 @@ function requireLodash() {
|
|
|
10027
10137
|
return value != null && isLength(value.length) && !isFunction2(value);
|
|
10028
10138
|
}
|
|
10029
10139
|
function isArrayLikeObject(value) {
|
|
10030
|
-
return
|
|
10140
|
+
return isObjectLike2(value) && isArrayLike(value);
|
|
10031
10141
|
}
|
|
10032
10142
|
function isBoolean2(value) {
|
|
10033
|
-
return value === true || value === false ||
|
|
10143
|
+
return value === true || value === false || isObjectLike2(value) && baseGetTag(value) == boolTag;
|
|
10034
10144
|
}
|
|
10035
10145
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
10036
10146
|
var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
10037
10147
|
function isElement(value) {
|
|
10038
|
-
return
|
|
10148
|
+
return isObjectLike2(value) && value.nodeType === 1 && !isPlainObject4(value);
|
|
10039
10149
|
}
|
|
10040
10150
|
function isEmpty(value) {
|
|
10041
10151
|
if (value == null) {
|
|
@@ -10067,7 +10177,7 @@ function requireLodash() {
|
|
|
10067
10177
|
return result3 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result3;
|
|
10068
10178
|
}
|
|
10069
10179
|
function isError2(value) {
|
|
10070
|
-
if (!
|
|
10180
|
+
if (!isObjectLike2(value)) {
|
|
10071
10181
|
return false;
|
|
10072
10182
|
}
|
|
10073
10183
|
var tag = baseGetTag(value);
|
|
@@ -10093,7 +10203,7 @@ function requireLodash() {
|
|
|
10093
10203
|
var type = typeof value;
|
|
10094
10204
|
return value != null && (type == "object" || type == "function");
|
|
10095
10205
|
}
|
|
10096
|
-
function
|
|
10206
|
+
function isObjectLike2(value) {
|
|
10097
10207
|
return value != null && typeof value == "object";
|
|
10098
10208
|
}
|
|
10099
10209
|
var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
|
|
@@ -10120,10 +10230,10 @@ function requireLodash() {
|
|
|
10120
10230
|
return value == null;
|
|
10121
10231
|
}
|
|
10122
10232
|
function isNumber2(value) {
|
|
10123
|
-
return typeof value == "number" ||
|
|
10233
|
+
return typeof value == "number" || isObjectLike2(value) && baseGetTag(value) == numberTag;
|
|
10124
10234
|
}
|
|
10125
10235
|
function isPlainObject4(value) {
|
|
10126
|
-
if (!
|
|
10236
|
+
if (!isObjectLike2(value) || baseGetTag(value) != objectTag) {
|
|
10127
10237
|
return false;
|
|
10128
10238
|
}
|
|
10129
10239
|
var proto = getPrototype(value);
|
|
@@ -10139,20 +10249,20 @@ function requireLodash() {
|
|
|
10139
10249
|
}
|
|
10140
10250
|
var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
10141
10251
|
function isString2(value) {
|
|
10142
|
-
return typeof value == "string" || !isArray3(value) &&
|
|
10252
|
+
return typeof value == "string" || !isArray3(value) && isObjectLike2(value) && baseGetTag(value) == stringTag;
|
|
10143
10253
|
}
|
|
10144
10254
|
function isSymbol2(value) {
|
|
10145
|
-
return typeof value == "symbol" ||
|
|
10255
|
+
return typeof value == "symbol" || isObjectLike2(value) && baseGetTag(value) == symbolTag;
|
|
10146
10256
|
}
|
|
10147
10257
|
var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
10148
10258
|
function isUndefined2(value) {
|
|
10149
10259
|
return value === undefined$1;
|
|
10150
10260
|
}
|
|
10151
10261
|
function isWeakMap(value) {
|
|
10152
|
-
return
|
|
10262
|
+
return isObjectLike2(value) && getTag(value) == weakMapTag;
|
|
10153
10263
|
}
|
|
10154
10264
|
function isWeakSet(value) {
|
|
10155
|
-
return
|
|
10265
|
+
return isObjectLike2(value) && baseGetTag(value) == weakSetTag;
|
|
10156
10266
|
}
|
|
10157
10267
|
var lt = createRelationalOperation(baseLt);
|
|
10158
10268
|
var lte = createRelationalOperation(function(value, other) {
|
|
@@ -10412,7 +10522,7 @@ function requireLodash() {
|
|
|
10412
10522
|
}
|
|
10413
10523
|
var toPairs = createToPairs(keys);
|
|
10414
10524
|
var toPairsIn = createToPairs(keysIn);
|
|
10415
|
-
function
|
|
10525
|
+
function transform2(object, iteratee2, accumulator) {
|
|
10416
10526
|
var isArr = isArray3(object), isArrLike = isArr || isBuffer(object) || isTypedArray2(object);
|
|
10417
10527
|
iteratee2 = getIteratee(iteratee2, 4);
|
|
10418
10528
|
if (accumulator == null) {
|
|
@@ -10915,7 +11025,7 @@ function requireLodash() {
|
|
|
10915
11025
|
}
|
|
10916
11026
|
return result3;
|
|
10917
11027
|
}
|
|
10918
|
-
function
|
|
11028
|
+
function toPath2(value) {
|
|
10919
11029
|
if (isArray3(value)) {
|
|
10920
11030
|
return arrayMap(value, toKey);
|
|
10921
11031
|
}
|
|
@@ -11086,9 +11196,9 @@ function requireLodash() {
|
|
|
11086
11196
|
lodash2.toArray = toArray;
|
|
11087
11197
|
lodash2.toPairs = toPairs;
|
|
11088
11198
|
lodash2.toPairsIn = toPairsIn;
|
|
11089
|
-
lodash2.toPath =
|
|
11199
|
+
lodash2.toPath = toPath2;
|
|
11090
11200
|
lodash2.toPlainObject = toPlainObject;
|
|
11091
|
-
lodash2.transform =
|
|
11201
|
+
lodash2.transform = transform2;
|
|
11092
11202
|
lodash2.unary = unary;
|
|
11093
11203
|
lodash2.union = union;
|
|
11094
11204
|
lodash2.unionBy = unionBy;
|
|
@@ -11187,7 +11297,7 @@ function requireLodash() {
|
|
|
11187
11297
|
lodash2.isNull = isNull2;
|
|
11188
11298
|
lodash2.isNumber = isNumber2;
|
|
11189
11299
|
lodash2.isObject = isObject2;
|
|
11190
|
-
lodash2.isObjectLike =
|
|
11300
|
+
lodash2.isObjectLike = isObjectLike2;
|
|
11191
11301
|
lodash2.isPlainObject = isPlainObject4;
|
|
11192
11302
|
lodash2.isRegExp = isRegExp2;
|
|
11193
11303
|
lodash2.isSafeInteger = isSafeInteger;
|
|
@@ -12882,6 +12992,10 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
12882
12992
|
const page2 = Number(params.value[QUERY_PARAMS_PARSED.PAGE]) || 1;
|
|
12883
12993
|
return page2 <= 0 ? 1 : page2;
|
|
12884
12994
|
});
|
|
12995
|
+
const disableNavigationToSearchResults = computed(() => {
|
|
12996
|
+
var _a25;
|
|
12997
|
+
return ((_a25 = optionsStore.searchBoxOptions) == null ? void 0 : _a25.disableNavigationToSearchResults) || false;
|
|
12998
|
+
});
|
|
12885
12999
|
const limit = computed(() => {
|
|
12886
13000
|
return Number(params.value[QUERY_PARAMS_PARSED.LIMIT]) || optionsStore.defaultSearchResultPageSize || defaultLimit.value;
|
|
12887
13001
|
});
|
|
@@ -12975,6 +13089,9 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
12975
13089
|
if (redirectionApplied) {
|
|
12976
13090
|
return;
|
|
12977
13091
|
}
|
|
13092
|
+
if (disableNavigationToSearchResults.value) {
|
|
13093
|
+
return;
|
|
13094
|
+
}
|
|
12978
13095
|
const forceFullReload = (_a25 = optionsStore.searchBoxOptions.forceFullReloadOnParams) == null ? void 0 : _a25.some(
|
|
12979
13096
|
(p2) => getQueryParam(p2)
|
|
12980
13097
|
);
|
|
@@ -13539,10 +13656,10 @@ const _hoisted_1$1o = {
|
|
|
13539
13656
|
key: 0,
|
|
13540
13657
|
class: "lupa-dialog-overlay"
|
|
13541
13658
|
};
|
|
13542
|
-
const _hoisted_2$
|
|
13659
|
+
const _hoisted_2$Z = { class: "lupa-dialog-content" };
|
|
13543
13660
|
const _hoisted_3$G = { class: "lupa-listening-text" };
|
|
13544
|
-
const _hoisted_4$
|
|
13545
|
-
const _hoisted_5$
|
|
13661
|
+
const _hoisted_4$v = { class: "lupa-mic-button-wrapper" };
|
|
13662
|
+
const _hoisted_5$l = ["aria-label"];
|
|
13546
13663
|
const _sfc_main$1F = /* @__PURE__ */ defineComponent({
|
|
13547
13664
|
__name: "VoiceSearchDialog",
|
|
13548
13665
|
props: {
|
|
@@ -13653,15 +13770,15 @@ const _sfc_main$1F = /* @__PURE__ */ defineComponent({
|
|
|
13653
13770
|
class: "lupa-dialog-box-close-button",
|
|
13654
13771
|
onClick: _cache[0] || (_cache[0] = () => emit("close"))
|
|
13655
13772
|
}),
|
|
13656
|
-
createElementVNode("div", _hoisted_2$
|
|
13773
|
+
createElementVNode("div", _hoisted_2$Z, [
|
|
13657
13774
|
createElementVNode("p", _hoisted_3$G, toDisplayString(description.value), 1),
|
|
13658
|
-
createElementVNode("div", _hoisted_4$
|
|
13775
|
+
createElementVNode("div", _hoisted_4$v, [
|
|
13659
13776
|
createElementVNode("button", {
|
|
13660
13777
|
class: normalizeClass(["lupa-mic-button", { recording: unref(isRecording) }]),
|
|
13661
13778
|
onClick: handleRecordingButtonClick,
|
|
13662
13779
|
"aria-controls": "voice-search-microphone",
|
|
13663
13780
|
"aria-label": ((_b25 = (_a25 = labels.value) == null ? void 0 : _a25.aria) == null ? void 0 : _b25.microphone) || "Toggle microphone"
|
|
13664
|
-
}, null, 10, _hoisted_5$
|
|
13781
|
+
}, null, 10, _hoisted_5$l),
|
|
13665
13782
|
createVNode(_sfc_main$1G, {
|
|
13666
13783
|
ref_key: "voiceSearchProgressBar",
|
|
13667
13784
|
ref: voiceSearchProgressBar,
|
|
@@ -13678,10 +13795,10 @@ const _sfc_main$1F = /* @__PURE__ */ defineComponent({
|
|
|
13678
13795
|
}
|
|
13679
13796
|
});
|
|
13680
13797
|
const _hoisted_1$1n = { id: "lupa-search-box-input-container" };
|
|
13681
|
-
const _hoisted_2$
|
|
13798
|
+
const _hoisted_2$Y = { class: "lupa-input-clear" };
|
|
13682
13799
|
const _hoisted_3$F = { id: "lupa-search-box-input" };
|
|
13683
|
-
const _hoisted_4$
|
|
13684
|
-
const _hoisted_5$
|
|
13800
|
+
const _hoisted_4$u = ["value"];
|
|
13801
|
+
const _hoisted_5$k = ["aria-label", "placeholder"];
|
|
13685
13802
|
const _hoisted_6$7 = {
|
|
13686
13803
|
key: 0,
|
|
13687
13804
|
class: "lupa-close-label"
|
|
@@ -13821,7 +13938,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
|
|
|
13821
13938
|
__expose({ focus });
|
|
13822
13939
|
return (_ctx, _cache) => {
|
|
13823
13940
|
return openBlock(), createElementBlock("div", _hoisted_1$1n, [
|
|
13824
|
-
createElementVNode("div", _hoisted_2$
|
|
13941
|
+
createElementVNode("div", _hoisted_2$Y, [
|
|
13825
13942
|
createElementVNode("div", {
|
|
13826
13943
|
class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
13827
13944
|
onClick: clear
|
|
@@ -13833,7 +13950,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
|
|
|
13833
13950
|
"aria-hidden": "true",
|
|
13834
13951
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
13835
13952
|
disabled: ""
|
|
13836
|
-
}, null, 8, _hoisted_4$
|
|
13953
|
+
}, null, 8, _hoisted_4$u),
|
|
13837
13954
|
withDirectives(createElementVNode("input", mergeProps({
|
|
13838
13955
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
13839
13956
|
}, inputAttributes.value, {
|
|
@@ -13847,7 +13964,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
|
|
|
13847
13964
|
placeholder: labels.value.placeholder,
|
|
13848
13965
|
onInput: handleInput,
|
|
13849
13966
|
onFocus: handleFocus
|
|
13850
|
-
}), null, 16, _hoisted_5$
|
|
13967
|
+
}), null, 16, _hoisted_5$k), [
|
|
13851
13968
|
[vModelText, inputValue.value]
|
|
13852
13969
|
]),
|
|
13853
13970
|
_ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
|
|
@@ -13926,7 +14043,7 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
|
|
|
13926
14043
|
}
|
|
13927
14044
|
});
|
|
13928
14045
|
const _hoisted_1$1m = { class: "lupa-search-box-history-item" };
|
|
13929
|
-
const _hoisted_2$
|
|
14046
|
+
const _hoisted_2$X = { class: "lupa-search-box-history-item-content" };
|
|
13930
14047
|
const _sfc_main$1C = /* @__PURE__ */ defineComponent({
|
|
13931
14048
|
__name: "SearchBoxHistoryItem",
|
|
13932
14049
|
props: {
|
|
@@ -13945,7 +14062,7 @@ const _sfc_main$1C = /* @__PURE__ */ defineComponent({
|
|
|
13945
14062
|
};
|
|
13946
14063
|
return (_ctx, _cache) => {
|
|
13947
14064
|
return openBlock(), createElementBlock("div", _hoisted_1$1m, [
|
|
13948
|
-
createElementVNode("div", _hoisted_2$
|
|
14065
|
+
createElementVNode("div", _hoisted_2$X, [
|
|
13949
14066
|
createElementVNode("div", {
|
|
13950
14067
|
class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
13951
14068
|
onClick: click2
|
|
@@ -14032,15 +14149,31 @@ const _sfc_main$1B = /* @__PURE__ */ defineComponent({
|
|
|
14032
14149
|
};
|
|
14033
14150
|
}
|
|
14034
14151
|
});
|
|
14035
|
-
const _hoisted_1$1k =
|
|
14152
|
+
const _hoisted_1$1k = ["innerHTML"];
|
|
14153
|
+
const _hoisted_2$W = {
|
|
14154
|
+
key: 1,
|
|
14155
|
+
class: "lupa-search-box-no-results"
|
|
14156
|
+
};
|
|
14036
14157
|
const _sfc_main$1A = /* @__PURE__ */ defineComponent({
|
|
14037
14158
|
__name: "SearchBoxNoResults",
|
|
14038
14159
|
props: {
|
|
14039
|
-
|
|
14160
|
+
options: {}
|
|
14040
14161
|
},
|
|
14041
14162
|
setup(__props) {
|
|
14163
|
+
const props = __props;
|
|
14164
|
+
const customHtml = computed(() => {
|
|
14165
|
+
return props.options.noResultsCustomHtml;
|
|
14166
|
+
});
|
|
14167
|
+
const labels = computed(() => {
|
|
14168
|
+
return props.options.labels;
|
|
14169
|
+
});
|
|
14042
14170
|
return (_ctx, _cache) => {
|
|
14043
|
-
|
|
14171
|
+
var _a25;
|
|
14172
|
+
return customHtml.value ? (openBlock(), createElementBlock("div", {
|
|
14173
|
+
key: 0,
|
|
14174
|
+
class: "lupa-search-box-no-results",
|
|
14175
|
+
innerHTML: customHtml.value
|
|
14176
|
+
}, null, 8, _hoisted_1$1k)) : (openBlock(), createElementBlock("p", _hoisted_2$W, toDisplayString((_a25 = labels.value) == null ? void 0 : _a25.noResults), 1));
|
|
14044
14177
|
};
|
|
14045
14178
|
}
|
|
14046
14179
|
});
|
|
@@ -14083,11 +14216,11 @@ const _hoisted_3$E = {
|
|
|
14083
14216
|
class: "lupa-suggestion-facet",
|
|
14084
14217
|
"data-cy": "lupa-suggestion-facet"
|
|
14085
14218
|
};
|
|
14086
|
-
const _hoisted_4$
|
|
14219
|
+
const _hoisted_4$t = {
|
|
14087
14220
|
class: "lupa-suggestion-facet-label",
|
|
14088
14221
|
"data-cy": "lupa-suggestion-facet-label"
|
|
14089
14222
|
};
|
|
14090
|
-
const _hoisted_5$
|
|
14223
|
+
const _hoisted_5$j = {
|
|
14091
14224
|
class: "lupa-suggestion-facet-value",
|
|
14092
14225
|
"data-cy": "lupa-suggestion-facet-value"
|
|
14093
14226
|
};
|
|
@@ -14130,8 +14263,8 @@ const _sfc_main$1z = /* @__PURE__ */ defineComponent({
|
|
|
14130
14263
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
14131
14264
|
}, null, 8, _hoisted_1$1j)) : (openBlock(), createElementBlock("div", _hoisted_2$V, toDisplayString(_ctx.suggestion.display), 1)),
|
|
14132
14265
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$E, [
|
|
14133
|
-
createElementVNode("span", _hoisted_4$
|
|
14134
|
-
createElementVNode("span", _hoisted_5$
|
|
14266
|
+
createElementVNode("span", _hoisted_4$t, toDisplayString(facetLabel.value), 1),
|
|
14267
|
+
createElementVNode("span", _hoisted_5$j, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
14135
14268
|
])) : createCommentVNode("", true)
|
|
14136
14269
|
]);
|
|
14137
14270
|
};
|
|
@@ -22255,12 +22388,12 @@ and ensure you are accounting for this risk.
|
|
|
22255
22388
|
});
|
|
22256
22389
|
const transformTagsMap = {};
|
|
22257
22390
|
let transformTagsAll;
|
|
22258
|
-
each(options.transformTags, function(
|
|
22391
|
+
each(options.transformTags, function(transform2, tag) {
|
|
22259
22392
|
let transFun;
|
|
22260
|
-
if (typeof
|
|
22261
|
-
transFun =
|
|
22262
|
-
} else if (typeof
|
|
22263
|
-
transFun = sanitizeHtml2.simpleTransform(
|
|
22393
|
+
if (typeof transform2 === "function") {
|
|
22394
|
+
transFun = transform2;
|
|
22395
|
+
} else if (typeof transform2 === "string") {
|
|
22396
|
+
transFun = sanitizeHtml2.simpleTransform(transform2);
|
|
22264
22397
|
}
|
|
22265
22398
|
if (tag === "*") {
|
|
22266
22399
|
transformTagsAll = transFun;
|
|
@@ -23928,8 +24061,8 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
23928
24061
|
const _hoisted_1$1d = ["innerHTML"];
|
|
23929
24062
|
const _hoisted_2$R = { key: 0 };
|
|
23930
24063
|
const _hoisted_3$D = { key: 1 };
|
|
23931
|
-
const _hoisted_4$
|
|
23932
|
-
const _hoisted_5$
|
|
24064
|
+
const _hoisted_4$s = { class: "lupa-search-box-custom-label" };
|
|
24065
|
+
const _hoisted_5$i = { class: "lupa-search-box-custom-text" };
|
|
23933
24066
|
const _sfc_main$1q = /* @__PURE__ */ defineComponent({
|
|
23934
24067
|
__name: "SearchBoxProductCustom",
|
|
23935
24068
|
props: {
|
|
@@ -23961,8 +24094,8 @@ const _sfc_main$1q = /* @__PURE__ */ defineComponent({
|
|
|
23961
24094
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
23962
24095
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
23963
24096
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$R, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$D, [
|
|
23964
|
-
createElementVNode("div", _hoisted_4$
|
|
23965
|
-
createElementVNode("div", _hoisted_5$
|
|
24097
|
+
createElementVNode("div", _hoisted_4$s, toDisplayString(label.value), 1),
|
|
24098
|
+
createElementVNode("div", _hoisted_5$i, toDisplayString(text.value), 1)
|
|
23966
24099
|
]))
|
|
23967
24100
|
], 16));
|
|
23968
24101
|
};
|
|
@@ -24352,8 +24485,8 @@ const useSearchResultStore = /* @__PURE__ */ defineStore("searchResult", () => {
|
|
|
24352
24485
|
const _hoisted_1$1b = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
24353
24486
|
const _hoisted_2$Q = { class: "lupa-search-box-product-addtocart" };
|
|
24354
24487
|
const _hoisted_3$C = ["disabled"];
|
|
24355
|
-
const _hoisted_4$
|
|
24356
|
-
const _hoisted_5$
|
|
24488
|
+
const _hoisted_4$r = ["href"];
|
|
24489
|
+
const _hoisted_5$h = ["disabled"];
|
|
24357
24490
|
const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
24358
24491
|
__name: "SearchBoxProductAddToCart",
|
|
24359
24492
|
props: {
|
|
@@ -24408,7 +24541,7 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
|
24408
24541
|
"data-cy": "lupa-add-to-cart",
|
|
24409
24542
|
disabled: !inStockValue.value || loading.value
|
|
24410
24543
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
24411
|
-
createElementVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$
|
|
24544
|
+
createElementVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$r)
|
|
24412
24545
|
], 16, _hoisted_3$C)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
24413
24546
|
key: 1,
|
|
24414
24547
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
@@ -24416,7 +24549,7 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
|
24416
24549
|
"data-cy": "lupa-add-to-cart",
|
|
24417
24550
|
type: "button",
|
|
24418
24551
|
disabled: !inStockValue.value || loading.value
|
|
24419
|
-
}, _ctx.dynamicAttributes), toDisplayString(label.value), 17, _hoisted_5$
|
|
24552
|
+
}, _ctx.dynamicAttributes), toDisplayString(label.value), 17, _hoisted_5$h))
|
|
24420
24553
|
])
|
|
24421
24554
|
]);
|
|
24422
24555
|
};
|
|
@@ -24528,7 +24661,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValue
|
|
|
24528
24661
|
const _hoisted_1$19 = { class: "lupa-badge-title" };
|
|
24529
24662
|
const _hoisted_2$P = ["src"];
|
|
24530
24663
|
const _hoisted_3$B = { key: 1 };
|
|
24531
|
-
const _hoisted_4$
|
|
24664
|
+
const _hoisted_4$q = {
|
|
24532
24665
|
key: 0,
|
|
24533
24666
|
class: "lupa-badge-full-text"
|
|
24534
24667
|
};
|
|
@@ -24572,7 +24705,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
24572
24705
|
}, null, 8, _hoisted_2$P)) : createCommentVNode("", true),
|
|
24573
24706
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$B, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
24574
24707
|
]),
|
|
24575
|
-
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
24708
|
+
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$q, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
24576
24709
|
], 6);
|
|
24577
24710
|
};
|
|
24578
24711
|
}
|
|
@@ -25105,7 +25238,7 @@ const useTrackingStore = /* @__PURE__ */ defineStore("tracking", () => {
|
|
|
25105
25238
|
};
|
|
25106
25239
|
return { trackSearch, trackResults, trackEvent, trackDelayedEvent };
|
|
25107
25240
|
});
|
|
25108
|
-
const _hoisted_1$12 =
|
|
25241
|
+
const _hoisted_1$12 = ["innerHTML"];
|
|
25109
25242
|
const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
25110
25243
|
__name: "SearchBoxProducts",
|
|
25111
25244
|
props: {
|
|
@@ -25131,6 +25264,29 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
25131
25264
|
}
|
|
25132
25265
|
return (_c = (_b25 = highlightedItem.value) == null ? void 0 : _b25.index) != null ? _c : -1;
|
|
25133
25266
|
});
|
|
25267
|
+
const showAll = ref(false);
|
|
25268
|
+
const hasResults = computed(() => {
|
|
25269
|
+
return props.items && props.items.length > 0;
|
|
25270
|
+
});
|
|
25271
|
+
const hasUncollapsedDocumentCountLimit = computed(() => {
|
|
25272
|
+
var _a25;
|
|
25273
|
+
return Boolean((_a25 = props.panelOptions) == null ? void 0 : _a25.uncollapsedDocumentCount);
|
|
25274
|
+
});
|
|
25275
|
+
const showAllItemsToggleButton = computed(() => {
|
|
25276
|
+
var _a25, _b25, _c;
|
|
25277
|
+
if (!hasUncollapsedDocumentCountLimit.value) {
|
|
25278
|
+
return false;
|
|
25279
|
+
}
|
|
25280
|
+
return ((_a25 = props.items) == null ? void 0 : _a25.length) > ((_c = (_b25 = props.panelOptions) == null ? void 0 : _b25.uncollapsedDocumentCount) != null ? _c : 0);
|
|
25281
|
+
});
|
|
25282
|
+
const displayItems = computed(() => {
|
|
25283
|
+
var _a25, _b25;
|
|
25284
|
+
if (showAll.value) {
|
|
25285
|
+
return props.items;
|
|
25286
|
+
}
|
|
25287
|
+
const count = (_b25 = (_a25 = props.panelOptions.uncollapsedDocumentCount) != null ? _a25 : props.panelOptions.limit) != null ? _b25 : props.items.length;
|
|
25288
|
+
return props.items.slice(0, count);
|
|
25289
|
+
});
|
|
25134
25290
|
const handleProductClick = ({
|
|
25135
25291
|
item,
|
|
25136
25292
|
eventType,
|
|
@@ -25178,8 +25334,12 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
25178
25334
|
}
|
|
25179
25335
|
};
|
|
25180
25336
|
return (_ctx, _cache) => {
|
|
25181
|
-
|
|
25182
|
-
|
|
25337
|
+
var _a25, _b25, _c;
|
|
25338
|
+
return openBlock(), createElementBlock("div", {
|
|
25339
|
+
id: "lupa-search-box-products",
|
|
25340
|
+
class: normalizeClass({ "lupa-search-box-products-expanded": showAll.value })
|
|
25341
|
+
}, [
|
|
25342
|
+
_ctx.$slots.productCard ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(displayItems.value, (item, index) => {
|
|
25183
25343
|
return renderSlot(_ctx.$slots, "productCard", {
|
|
25184
25344
|
key: index,
|
|
25185
25345
|
item,
|
|
@@ -25189,7 +25349,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
25189
25349
|
inputValue: _ctx.inputValue,
|
|
25190
25350
|
itemClicked: handleProductClick
|
|
25191
25351
|
});
|
|
25192
|
-
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(
|
|
25352
|
+
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(displayItems.value, (item, index) => {
|
|
25193
25353
|
return openBlock(), createBlock(_sfc_main$1f, {
|
|
25194
25354
|
key: index,
|
|
25195
25355
|
item,
|
|
@@ -25200,8 +25360,17 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
25200
25360
|
onProductClick: handleProductClick
|
|
25201
25361
|
}, null, 8, ["item", "panelOptions", "labels", "highlighted", "inputValue"]);
|
|
25202
25362
|
}), 128)),
|
|
25363
|
+
hasResults.value && ((_a25 = _ctx.panelOptions) == null ? void 0 : _a25.appendCustomHtml) && (showAll.value || !showAllItemsToggleButton.value) ? (openBlock(), createElementBlock("div", {
|
|
25364
|
+
key: 2,
|
|
25365
|
+
innerHTML: _ctx.panelOptions.appendCustomHtml
|
|
25366
|
+
}, null, 8, _hoisted_1$12)) : createCommentVNode("", true),
|
|
25367
|
+
showAllItemsToggleButton.value ? (openBlock(), createElementBlock("a", {
|
|
25368
|
+
key: 3,
|
|
25369
|
+
class: "lupa-search-box-expand",
|
|
25370
|
+
onClick: _cache[0] || (_cache[0] = ($event) => showAll.value = !showAll.value)
|
|
25371
|
+
}, toDisplayString(showAll.value ? (_b25 = _ctx.labels) == null ? void 0 : _b25.showLess : (_c = _ctx.labels) == null ? void 0 : _c.showMore), 1)) : createCommentVNode("", true),
|
|
25203
25372
|
renderSlot(_ctx.$slots, "default")
|
|
25204
|
-
]);
|
|
25373
|
+
], 2);
|
|
25205
25374
|
};
|
|
25206
25375
|
}
|
|
25207
25376
|
});
|
|
@@ -25389,6 +25558,7 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
25389
25558
|
searchText: props.inputValue,
|
|
25390
25559
|
limit: props.panel.limit,
|
|
25391
25560
|
filters: extractedInitialFilters.value,
|
|
25561
|
+
selectFields: props.panel.selectFields,
|
|
25392
25562
|
modifiers: {
|
|
25393
25563
|
facets: false,
|
|
25394
25564
|
refiners: false
|
|
@@ -25531,23 +25701,15 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
25531
25701
|
};
|
|
25532
25702
|
}
|
|
25533
25703
|
});
|
|
25534
|
-
const _hoisted_1$10 =
|
|
25535
|
-
|
|
25536
|
-
id: "lupa-search-box-panel"
|
|
25537
|
-
};
|
|
25538
|
-
const _hoisted_2$L = ["data-cy"];
|
|
25539
|
-
const _hoisted_3$z = {
|
|
25704
|
+
const _hoisted_1$10 = ["data-cy"];
|
|
25705
|
+
const _hoisted_2$L = {
|
|
25540
25706
|
key: 0,
|
|
25541
25707
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
25542
25708
|
};
|
|
25543
|
-
const
|
|
25709
|
+
const _hoisted_3$z = {
|
|
25544
25710
|
key: 1,
|
|
25545
25711
|
class: "lupa-panel-title"
|
|
25546
25712
|
};
|
|
25547
|
-
const _hoisted_5$h = {
|
|
25548
|
-
key: 1,
|
|
25549
|
-
id: "lupa-search-box-panel"
|
|
25550
|
-
};
|
|
25551
25713
|
const __default__$2 = {
|
|
25552
25714
|
components: {
|
|
25553
25715
|
SearchBoxSuggestionsWrapper: _sfc_main$1x,
|
|
@@ -25720,7 +25882,11 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValue
|
|
|
25720
25882
|
ref_key: "panelContainer",
|
|
25721
25883
|
ref: panelContainer
|
|
25722
25884
|
}, [
|
|
25723
|
-
displayResults.value ? (openBlock(), createElementBlock("div",
|
|
25885
|
+
displayResults.value ? (openBlock(), createElementBlock("div", {
|
|
25886
|
+
key: 0,
|
|
25887
|
+
id: "lupa-search-box-panel",
|
|
25888
|
+
class: normalizeClass({ "lupa-search-text-empty": isSearchEmpty.value })
|
|
25889
|
+
}, [
|
|
25724
25890
|
labels.value.closePanel ? (openBlock(), createElementBlock("a", {
|
|
25725
25891
|
key: 0,
|
|
25726
25892
|
class: "lupa-search-box-close-panel",
|
|
@@ -25742,8 +25908,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValue
|
|
|
25742
25908
|
style: normalizeStyle(panel.gridArea ? { gridArea: `${panel.gridArea}${index}` } : {}),
|
|
25743
25909
|
"data-cy": "lupa-panel-" + panel.type + "-index"
|
|
25744
25910
|
}, [
|
|
25745
|
-
((_a25 = panel.labels) == null ? void 0 : _a25.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div",
|
|
25746
|
-
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div",
|
|
25911
|
+
((_a25 = panel.labels) == null ? void 0 : _a25.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_2$L, toDisplayString((_b25 = panel.labels) == null ? void 0 : _b25.topResultsTitle), 1)) : createCommentVNode("", true),
|
|
25912
|
+
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_3$z, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
|
|
25747
25913
|
panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
|
|
25748
25914
|
key: 2,
|
|
25749
25915
|
panel,
|
|
@@ -25765,20 +25931,24 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValue
|
|
|
25765
25931
|
key: "0"
|
|
25766
25932
|
} : void 0
|
|
25767
25933
|
]), 1064, ["panel", "search-box-options", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
|
|
25768
|
-
], 14,
|
|
25934
|
+
], 14, _hoisted_1$10);
|
|
25769
25935
|
}), 128))
|
|
25770
25936
|
], 4),
|
|
25771
25937
|
!unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1A, {
|
|
25772
25938
|
key: 1,
|
|
25773
|
-
|
|
25774
|
-
}, null, 8, ["
|
|
25939
|
+
options: _ctx.options
|
|
25940
|
+
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
25775
25941
|
displayShowMoreResultsButton.value ? (openBlock(), createBlock(_sfc_main$1D, {
|
|
25776
25942
|
key: 2,
|
|
25777
25943
|
labels: labels.value,
|
|
25778
25944
|
options: _ctx.options,
|
|
25779
25945
|
onGoToResults: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("go-to-results"))
|
|
25780
25946
|
}, null, 8, ["labels", "options"])) : createCommentVNode("", true)
|
|
25781
|
-
])) : displayHistory.value ? (openBlock(), createElementBlock("div",
|
|
25947
|
+
], 2)) : displayHistory.value ? (openBlock(), createElementBlock("div", {
|
|
25948
|
+
key: 1,
|
|
25949
|
+
id: "lupa-search-box-panel",
|
|
25950
|
+
class: normalizeClass({ "lupa-search-text-empty": isSearchEmpty.value })
|
|
25951
|
+
}, [
|
|
25782
25952
|
createVNode(_sfc_main$1B, {
|
|
25783
25953
|
options: _ctx.options.history,
|
|
25784
25954
|
history: history.value,
|
|
@@ -25786,7 +25956,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValue
|
|
|
25786
25956
|
onRemove: remove,
|
|
25787
25957
|
onRemoveAll: removeAll
|
|
25788
25958
|
}, null, 8, ["options", "history"])
|
|
25789
|
-
])) : createCommentVNode("", true)
|
|
25959
|
+
], 2)) : createCommentVNode("", true)
|
|
25790
25960
|
], 512);
|
|
25791
25961
|
};
|
|
25792
25962
|
}
|
|
@@ -25859,7 +26029,8 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
25859
26029
|
"hideMoreResultsButtonOnEmptyQuery",
|
|
25860
26030
|
"showNoResultsPanel",
|
|
25861
26031
|
"expandOnSinglePanel",
|
|
25862
|
-
"showMoreResultsButton"
|
|
26032
|
+
"showMoreResultsButton",
|
|
26033
|
+
"noResultsCustomHtml"
|
|
25863
26034
|
])
|
|
25864
26035
|
);
|
|
25865
26036
|
const searchTriggers = computed(() => {
|
|
@@ -25925,22 +26096,31 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
25925
26096
|
(_b25 = props.options.callbacks) == null ? void 0 : _b25.onClosed();
|
|
25926
26097
|
}
|
|
25927
26098
|
};
|
|
25928
|
-
const
|
|
26099
|
+
const fillInputWithSuggestion = () => {
|
|
25929
26100
|
var _a26, _b25;
|
|
26101
|
+
if ((_b25 = (_a26 = suggestedValue == null ? void 0 : suggestedValue.value) == null ? void 0 : _a26.item) == null ? void 0 : _b25.suggestion) {
|
|
26102
|
+
selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
|
|
26103
|
+
}
|
|
26104
|
+
};
|
|
26105
|
+
const goToResults = () => {
|
|
26106
|
+
handleSearch();
|
|
26107
|
+
resetValues();
|
|
26108
|
+
};
|
|
26109
|
+
const handleKeyDown = (e2) => {
|
|
25930
26110
|
if (!focused.value) {
|
|
25931
26111
|
return;
|
|
25932
26112
|
}
|
|
25933
26113
|
switch (e2.key) {
|
|
25934
26114
|
case "Tab":
|
|
25935
|
-
|
|
25936
|
-
e2.preventDefault();
|
|
25937
|
-
selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
|
|
25938
|
-
}
|
|
26115
|
+
fillInputWithSuggestion();
|
|
25939
26116
|
break;
|
|
25940
26117
|
case "Enter":
|
|
25941
26118
|
e2.preventDefault();
|
|
25942
|
-
|
|
25943
|
-
|
|
26119
|
+
if (props.options.disableNavigationToSearchResults) {
|
|
26120
|
+
fillInputWithSuggestion();
|
|
26121
|
+
} else {
|
|
26122
|
+
goToResults();
|
|
26123
|
+
}
|
|
25944
26124
|
break;
|
|
25945
26125
|
case "Escape":
|
|
25946
26126
|
opened.value = false;
|
|
@@ -26001,7 +26181,11 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
26001
26181
|
inputValue.value = inputSuggestion.override ? inputSuggestion.item.suggestion : inputValue.value;
|
|
26002
26182
|
}
|
|
26003
26183
|
if (shouldSearch) {
|
|
26004
|
-
|
|
26184
|
+
if (props.options.disableNavigationToSearchResults) {
|
|
26185
|
+
fillInputWithSuggestion();
|
|
26186
|
+
} else {
|
|
26187
|
+
handleSearch();
|
|
26188
|
+
}
|
|
26005
26189
|
}
|
|
26006
26190
|
};
|
|
26007
26191
|
const handleNavigateDocument = ({ link }) => {
|
|
@@ -26167,7 +26351,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
26167
26351
|
};
|
|
26168
26352
|
}
|
|
26169
26353
|
});
|
|
26170
|
-
const createPublicQuery = (queryParams, sortOptions, defaultPageSize) => {
|
|
26354
|
+
const createPublicQuery = (queryParams, sortOptions, defaultPageSize, selectFields) => {
|
|
26171
26355
|
var _a25;
|
|
26172
26356
|
const publicQuery = {};
|
|
26173
26357
|
for (const param in queryParams) {
|
|
@@ -26201,6 +26385,9 @@ const createPublicQuery = (queryParams, sortOptions, defaultPageSize) => {
|
|
|
26201
26385
|
}
|
|
26202
26386
|
publicQuery.sort = publicQuery.sort || getDefaultSort(sortOptions);
|
|
26203
26387
|
publicQuery.filters = queryParams.filters;
|
|
26388
|
+
if (selectFields) {
|
|
26389
|
+
publicQuery.selectFields = selectFields;
|
|
26390
|
+
}
|
|
26204
26391
|
return publicQuery;
|
|
26205
26392
|
};
|
|
26206
26393
|
const getDefaultSort = (sortOptions) => {
|
|
@@ -26236,7 +26423,8 @@ const getInitialSearchResults = (options, getQueryParamName, defaultData) => __a
|
|
|
26236
26423
|
const publicQuery = createPublicQuery(
|
|
26237
26424
|
parseParams(getQueryParamName, searchParams),
|
|
26238
26425
|
options.sort,
|
|
26239
|
-
defaultData == null ? void 0 : defaultData.pageSize
|
|
26426
|
+
defaultData == null ? void 0 : defaultData.pageSize,
|
|
26427
|
+
options.selectFields
|
|
26240
26428
|
);
|
|
26241
26429
|
const query = getPublicQuery(publicQuery, (_c = defaultData == null ? void 0 : defaultData.filters) != null ? _c : {}, false);
|
|
26242
26430
|
try {
|
|
@@ -27948,7 +28136,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
27948
28136
|
}
|
|
27949
28137
|
);
|
|
27950
28138
|
const facetMin = computed(() => Math.floor(facetValue.value.min * currencyMultiplier.value));
|
|
27951
|
-
const facetMax = computed(() =>
|
|
28139
|
+
const facetMax = computed(() => Number((facetValue.value.max * currencyMultiplier.value).toFixed(2)));
|
|
27952
28140
|
const currentGte = computed(
|
|
27953
28141
|
() => getAdjustedNumber(currentFilters.value.gte, currencyMultiplier.value)
|
|
27954
28142
|
);
|
|
@@ -29418,7 +29606,7 @@ const _hoisted_3$n = {
|
|
|
29418
29606
|
class: "lupa-select-label",
|
|
29419
29607
|
for: "lupa-page-size-select-dropdown"
|
|
29420
29608
|
};
|
|
29421
|
-
const _hoisted_4$g = ["aria-label"];
|
|
29609
|
+
const _hoisted_4$g = ["value", "aria-label"];
|
|
29422
29610
|
const _hoisted_5$b = ["value"];
|
|
29423
29611
|
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
29424
29612
|
__name: "SearchResultsPageSize",
|
|
@@ -29431,6 +29619,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
29431
29619
|
const paramsStore = useParamsStore();
|
|
29432
29620
|
const optionsStore = useOptionsStore();
|
|
29433
29621
|
const { ariaLabels } = storeToRefs(optionsStore);
|
|
29622
|
+
const { limit } = storeToRefs(paramsStore);
|
|
29434
29623
|
const select = ref(null);
|
|
29435
29624
|
const prefixLabel = computed(() => {
|
|
29436
29625
|
var _a25, _b25;
|
|
@@ -29454,6 +29643,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
29454
29643
|
createElementVNode("div", _hoisted_2$v, [
|
|
29455
29644
|
createElementVNode("label", _hoisted_3$n, toDisplayString(label.value), 1),
|
|
29456
29645
|
createElementVNode("select", {
|
|
29646
|
+
value: unref(limit),
|
|
29457
29647
|
id: "lupa-page-size-select-dropdown",
|
|
29458
29648
|
class: "lupa-select-dropdown",
|
|
29459
29649
|
"aria-label": (_c = (_b25 = (_a25 = unref(ariaLabels)) == null ? void 0 : _a25.pageSizeSelect) != null ? _b25 : label.value) != null ? _c : "Select page size",
|
|
@@ -29512,6 +29702,7 @@ const useSorting = () => {
|
|
|
29512
29702
|
previousKey.value = selectedKey.value;
|
|
29513
29703
|
};
|
|
29514
29704
|
watch(sort, () => setSortValue());
|
|
29705
|
+
watch(sortOptions, () => setSortValue());
|
|
29515
29706
|
const handleSelect = () => {
|
|
29516
29707
|
var _a25, _b25, _c;
|
|
29517
29708
|
const value = (_a25 = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a25.key;
|
|
@@ -29527,12 +29718,15 @@ const useSorting = () => {
|
|
|
29527
29718
|
previousKey.value = selectedKey.value;
|
|
29528
29719
|
};
|
|
29529
29720
|
return {
|
|
29721
|
+
sort,
|
|
29530
29722
|
sotyByTitleLabel,
|
|
29531
29723
|
sortItems,
|
|
29532
29724
|
selectedKey,
|
|
29725
|
+
previousKey,
|
|
29533
29726
|
ariaLabels,
|
|
29534
29727
|
sortOptions,
|
|
29535
29728
|
sortStyle,
|
|
29729
|
+
defaultSortValue,
|
|
29536
29730
|
handleSelect,
|
|
29537
29731
|
setSortValue
|
|
29538
29732
|
};
|
|
@@ -30532,6 +30726,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
30532
30726
|
itemId: id.value,
|
|
30533
30727
|
searchQuery: query.value,
|
|
30534
30728
|
type: item.type,
|
|
30729
|
+
options: props.lupaClickTrackingType === "recommendedItemClick" ? { allowEmptySearchQuery: true } : void 0,
|
|
30535
30730
|
analytics: item.type === "addToCart" ? {
|
|
30536
30731
|
type: "search_add_to_cart",
|
|
30537
30732
|
label: title.value || id.value || link.value
|
|
@@ -31084,7 +31279,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
31084
31279
|
} : {};
|
|
31085
31280
|
});
|
|
31086
31281
|
const searchForRelatedQuery = () => __async(null, null, function* () {
|
|
31087
|
-
var _a25, _b25, _c, _d, _e, _f, _g, _h;
|
|
31282
|
+
var _a25, _b25, _c, _d, _e, _f, _g, _h, _i;
|
|
31088
31283
|
if (!props.query) {
|
|
31089
31284
|
return;
|
|
31090
31285
|
}
|
|
@@ -31093,6 +31288,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
31093
31288
|
limit: 3,
|
|
31094
31289
|
filters: relatedQueryFilters.value,
|
|
31095
31290
|
trackTerm: false,
|
|
31291
|
+
selectFields: (_a25 = searchResultOptions.value) == null ? void 0 : _a25.selectFields,
|
|
31096
31292
|
modifiers: {
|
|
31097
31293
|
facets: false,
|
|
31098
31294
|
refiners: false
|
|
@@ -31103,18 +31299,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
31103
31299
|
const result2 = yield LupaSearchSdk.query(
|
|
31104
31300
|
queryKey.value,
|
|
31105
31301
|
lupaQuery,
|
|
31106
|
-
(
|
|
31302
|
+
(_b25 = searchResultOptions.value) == null ? void 0 : _b25.options
|
|
31107
31303
|
);
|
|
31108
31304
|
if (result2.success) {
|
|
31109
31305
|
relatedQueryResult.value = result2;
|
|
31110
31306
|
}
|
|
31111
|
-
const firstItem = (
|
|
31112
|
-
itemToDisplay.value = (
|
|
31307
|
+
const firstItem = (_d = (_c = relatedQueryResult.value) == null ? void 0 : _c.items) == null ? void 0 : _d[0];
|
|
31308
|
+
itemToDisplay.value = (_g = (_f = (_e = relatedQueryResult == null ? void 0 : relatedQueryResult.value) == null ? void 0 : _e.items) == null ? void 0 : _f.find(
|
|
31113
31309
|
(i) => !props.existingItemsFromOtherQueries[`${i.id}`]
|
|
31114
|
-
)) != null ?
|
|
31310
|
+
)) != null ? _g : firstItem;
|
|
31115
31311
|
emit("loaded", itemToDisplay.value);
|
|
31116
31312
|
} catch (error) {
|
|
31117
|
-
(
|
|
31313
|
+
(_i = (_h = searchResultOptions.value) == null ? void 0 : _h.options) == null ? void 0 : _i.onError(error);
|
|
31118
31314
|
} finally {
|
|
31119
31315
|
loading.value = false;
|
|
31120
31316
|
}
|
|
@@ -32245,7 +32441,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
32245
32441
|
const publicQuery = createPublicQuery(
|
|
32246
32442
|
parseParams(optionStore.getQueryParamName, searchParams),
|
|
32247
32443
|
props.options.sort,
|
|
32248
|
-
defaultSearchResultPageSize.value
|
|
32444
|
+
defaultSearchResultPageSize.value,
|
|
32445
|
+
props.options.selectFields
|
|
32249
32446
|
);
|
|
32250
32447
|
searchResultStore.setLoading(true);
|
|
32251
32448
|
const finalPublicQuery = getPublicQuery(publicQuery, initialFilters.value, props.isProductList);
|
|
@@ -32720,8 +32917,8 @@ function getNumberInRange({ val, max, min }) {
|
|
|
32720
32917
|
return Math.min(Math.max(val, isNaN(min) ? val : min), isNaN(max) ? val : max);
|
|
32721
32918
|
}
|
|
32722
32919
|
function getTransformValues(el) {
|
|
32723
|
-
const { transform } = window.getComputedStyle(el);
|
|
32724
|
-
return
|
|
32920
|
+
const { transform: transform2 } = window.getComputedStyle(el);
|
|
32921
|
+
return transform2.split(/[(,)]/).slice(1, -1).map((v) => parseFloat(v));
|
|
32725
32922
|
}
|
|
32726
32923
|
function getScaleMultipliers(transformElements) {
|
|
32727
32924
|
let widthMultiplier = 1;
|