@getlupa/client 1.15.10 → 1.15.13
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 +172 -132
- package/dist/lupaSearch.js +172 -132
- package/dist/lupaSearch.mjs +172 -132
- package/dist/lupaSearch.umd.js +172 -132
- package/dist/src/index.d.ts +2 -1
- package/dist/src/modules/pluginManager/PluginConfigurationManager.d.ts +2 -1
- package/dist/src/types/OptionOverrides.d.ts +7 -0
- package/dist/src/utils/merger.utils.d.ts +1 -0
- package/package.json +2 -2
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -73,9 +73,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
73
73
|
const isFunction$1 = (val) => typeof val === "function";
|
|
74
74
|
const isString = (val) => typeof val === "string";
|
|
75
75
|
const isSymbol = (val) => typeof val === "symbol";
|
|
76
|
-
const isObject$
|
|
76
|
+
const isObject$3 = (val) => val !== null && typeof val === "object";
|
|
77
77
|
const isPromise$1 = (val) => {
|
|
78
|
-
return isObject$
|
|
78
|
+
return isObject$3(val) && isFunction$1(val.then) && isFunction$1(val.catch);
|
|
79
79
|
};
|
|
80
80
|
const objectToString$1 = Object.prototype.toString;
|
|
81
81
|
const toTypeString = (value) => objectToString$1.call(value);
|
|
@@ -149,7 +149,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
149
149
|
return res;
|
|
150
150
|
} else if (isString(value)) {
|
|
151
151
|
return value;
|
|
152
|
-
} else if (isObject$
|
|
152
|
+
} else if (isObject$3(value)) {
|
|
153
153
|
return value;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -177,7 +177,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
177
177
|
res += normalized + " ";
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
} else if (isObject$
|
|
180
|
+
} else if (isObject$3(value)) {
|
|
181
181
|
for (const name in value) {
|
|
182
182
|
if (value[name]) {
|
|
183
183
|
res += name + " ";
|
|
@@ -230,8 +230,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
230
230
|
if (aValidType || bValidType) {
|
|
231
231
|
return aValidType && bValidType ? looseCompareArrays(a, b) : false;
|
|
232
232
|
}
|
|
233
|
-
aValidType = isObject$
|
|
234
|
-
bValidType = isObject$
|
|
233
|
+
aValidType = isObject$3(a);
|
|
234
|
+
bValidType = isObject$3(b);
|
|
235
235
|
if (aValidType || bValidType) {
|
|
236
236
|
if (!aValidType || !bValidType) {
|
|
237
237
|
return false;
|
|
@@ -255,7 +255,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
255
255
|
return arr.findIndex((item) => looseEqual(item, val));
|
|
256
256
|
}
|
|
257
257
|
const toDisplayString = (val) => {
|
|
258
|
-
return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$
|
|
258
|
+
return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$3(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
|
|
259
259
|
};
|
|
260
260
|
const replacer = (_key, val) => {
|
|
261
261
|
if (val && val.__v_isRef) {
|
|
@@ -271,7 +271,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
271
271
|
return {
|
|
272
272
|
[`Set(${val.size})`]: [...val.values()]
|
|
273
273
|
};
|
|
274
|
-
} else if (isObject$
|
|
274
|
+
} else if (isObject$3(val) && !isArray$1(val) && !isPlainObject$4(val)) {
|
|
275
275
|
return String(val);
|
|
276
276
|
}
|
|
277
277
|
return val;
|
|
@@ -664,7 +664,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
664
664
|
if (isRef(res)) {
|
|
665
665
|
return targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
666
666
|
}
|
|
667
|
-
if (isObject$
|
|
667
|
+
if (isObject$3(res)) {
|
|
668
668
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
669
669
|
}
|
|
670
670
|
return res;
|
|
@@ -1058,7 +1058,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1058
1058
|
);
|
|
1059
1059
|
}
|
|
1060
1060
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
1061
|
-
if (!isObject$
|
|
1061
|
+
if (!isObject$3(target)) {
|
|
1062
1062
|
return target;
|
|
1063
1063
|
}
|
|
1064
1064
|
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
@@ -1102,8 +1102,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1102
1102
|
def(value, "__v_skip", true);
|
|
1103
1103
|
return value;
|
|
1104
1104
|
}
|
|
1105
|
-
const toReactive = (value) => isObject$
|
|
1106
|
-
const toReadonly = (value) => isObject$
|
|
1105
|
+
const toReactive = (value) => isObject$3(value) ? reactive(value) : value;
|
|
1106
|
+
const toReadonly = (value) => isObject$3(value) ? readonly(value) : value;
|
|
1107
1107
|
function trackRefValue(ref2) {
|
|
1108
1108
|
if (shouldTrack && activeEffect) {
|
|
1109
1109
|
ref2 = toRaw(ref2);
|
|
@@ -1213,7 +1213,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1213
1213
|
return source;
|
|
1214
1214
|
} else if (isFunction$1(source)) {
|
|
1215
1215
|
return new GetterRefImpl(source);
|
|
1216
|
-
} else if (isObject$
|
|
1216
|
+
} else if (isObject$3(source) && arguments.length > 1) {
|
|
1217
1217
|
return propertyToRef(source, key, defaultValue);
|
|
1218
1218
|
} else {
|
|
1219
1219
|
return ref(source);
|
|
@@ -1533,7 +1533,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1533
1533
|
}
|
|
1534
1534
|
}
|
|
1535
1535
|
if (!raw && !hasExtends) {
|
|
1536
|
-
if (isObject$
|
|
1536
|
+
if (isObject$3(comp)) {
|
|
1537
1537
|
cache.set(comp, null);
|
|
1538
1538
|
}
|
|
1539
1539
|
return null;
|
|
@@ -1543,7 +1543,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1543
1543
|
} else {
|
|
1544
1544
|
extend(normalized, raw);
|
|
1545
1545
|
}
|
|
1546
|
-
if (isObject$
|
|
1546
|
+
if (isObject$3(comp)) {
|
|
1547
1547
|
cache.set(comp, normalized);
|
|
1548
1548
|
}
|
|
1549
1549
|
return normalized;
|
|
@@ -1951,7 +1951,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1951
1951
|
};
|
|
1952
1952
|
}
|
|
1953
1953
|
function traverse(value, seen) {
|
|
1954
|
-
if (!isObject$
|
|
1954
|
+
if (!isObject$3(value) || value["__v_skip"]) {
|
|
1955
1955
|
return value;
|
|
1956
1956
|
}
|
|
1957
1957
|
seen = seen || /* @__PURE__ */ new Set();
|
|
@@ -2486,7 +2486,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2486
2486
|
for (let i = 0; i < source; i++) {
|
|
2487
2487
|
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2488
2488
|
}
|
|
2489
|
-
} else if (isObject$
|
|
2489
|
+
} else if (isObject$3(source)) {
|
|
2490
2490
|
if (source[Symbol.iterator]) {
|
|
2491
2491
|
ret = Array.from(
|
|
2492
2492
|
source,
|
|
@@ -2763,7 +2763,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2763
2763
|
}
|
|
2764
2764
|
if (dataOptions) {
|
|
2765
2765
|
const data = dataOptions.call(publicThis, publicThis);
|
|
2766
|
-
if (!isObject$
|
|
2766
|
+
if (!isObject$3(data))
|
|
2767
2767
|
;
|
|
2768
2768
|
else {
|
|
2769
2769
|
instance.data = reactive(data);
|
|
@@ -2851,7 +2851,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2851
2851
|
for (const key in injectOptions) {
|
|
2852
2852
|
const opt = injectOptions[key];
|
|
2853
2853
|
let injected;
|
|
2854
|
-
if (isObject$
|
|
2854
|
+
if (isObject$3(opt)) {
|
|
2855
2855
|
if ("default" in opt) {
|
|
2856
2856
|
injected = inject(
|
|
2857
2857
|
opt.from || key,
|
|
@@ -2893,7 +2893,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2893
2893
|
}
|
|
2894
2894
|
} else if (isFunction$1(raw)) {
|
|
2895
2895
|
watch(getter, raw.bind(publicThis));
|
|
2896
|
-
} else if (isObject$
|
|
2896
|
+
} else if (isObject$3(raw)) {
|
|
2897
2897
|
if (isArray$1(raw)) {
|
|
2898
2898
|
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2899
2899
|
} else {
|
|
@@ -2930,7 +2930,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2930
2930
|
}
|
|
2931
2931
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2932
2932
|
}
|
|
2933
|
-
if (isObject$
|
|
2933
|
+
if (isObject$3(base)) {
|
|
2934
2934
|
cache.set(base, resolved);
|
|
2935
2935
|
}
|
|
2936
2936
|
return resolved;
|
|
@@ -3071,7 +3071,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3071
3071
|
if (!isFunction$1(rootComponent)) {
|
|
3072
3072
|
rootComponent = extend({}, rootComponent);
|
|
3073
3073
|
}
|
|
3074
|
-
if (rootProps != null && !isObject$
|
|
3074
|
+
if (rootProps != null && !isObject$3(rootProps)) {
|
|
3075
3075
|
rootProps = null;
|
|
3076
3076
|
}
|
|
3077
3077
|
const context = createAppContext();
|
|
@@ -3415,7 +3415,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3415
3415
|
}
|
|
3416
3416
|
}
|
|
3417
3417
|
if (!raw && !hasExtends) {
|
|
3418
|
-
if (isObject$
|
|
3418
|
+
if (isObject$3(comp)) {
|
|
3419
3419
|
cache.set(comp, EMPTY_ARR);
|
|
3420
3420
|
}
|
|
3421
3421
|
return EMPTY_ARR;
|
|
@@ -3452,7 +3452,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3452
3452
|
}
|
|
3453
3453
|
}
|
|
3454
3454
|
const res = [normalized, needCastKeys];
|
|
3455
|
-
if (isObject$
|
|
3455
|
+
if (isObject$3(comp)) {
|
|
3456
3456
|
cache.set(comp, res);
|
|
3457
3457
|
}
|
|
3458
3458
|
return res;
|
|
@@ -5116,14 +5116,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5116
5116
|
if (klass && !isString(klass)) {
|
|
5117
5117
|
props.class = normalizeClass(klass);
|
|
5118
5118
|
}
|
|
5119
|
-
if (isObject$
|
|
5119
|
+
if (isObject$3(style)) {
|
|
5120
5120
|
if (isProxy(style) && !isArray$1(style)) {
|
|
5121
5121
|
style = extend({}, style);
|
|
5122
5122
|
}
|
|
5123
5123
|
props.style = normalizeStyle(style);
|
|
5124
5124
|
}
|
|
5125
5125
|
}
|
|
5126
|
-
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$
|
|
5126
|
+
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$3(type) ? 4 : isFunction$1(type) ? 2 : 0;
|
|
5127
5127
|
return createBaseVNode(
|
|
5128
5128
|
type,
|
|
5129
5129
|
props,
|
|
@@ -5460,7 +5460,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5460
5460
|
} else {
|
|
5461
5461
|
instance.render = setupResult;
|
|
5462
5462
|
}
|
|
5463
|
-
} else if (isObject$
|
|
5463
|
+
} else if (isObject$3(setupResult)) {
|
|
5464
5464
|
instance.setupState = proxyRefs(setupResult);
|
|
5465
5465
|
} else
|
|
5466
5466
|
;
|
|
@@ -5552,7 +5552,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5552
5552
|
function h$1(type, propsOrChildren, children) {
|
|
5553
5553
|
const l = arguments.length;
|
|
5554
5554
|
if (l === 2) {
|
|
5555
|
-
if (isObject$
|
|
5555
|
+
if (isObject$3(propsOrChildren) && !isArray$1(propsOrChildren)) {
|
|
5556
5556
|
if (isVNode(propsOrChildren)) {
|
|
5557
5557
|
return createVNode(type, null, [propsOrChildren]);
|
|
5558
5558
|
}
|
|
@@ -6058,7 +6058,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
6058
6058
|
function normalizeDuration(duration) {
|
|
6059
6059
|
if (duration == null) {
|
|
6060
6060
|
return null;
|
|
6061
|
-
} else if (isObject$
|
|
6061
|
+
} else if (isObject$3(duration)) {
|
|
6062
6062
|
return [NumberOf(duration.enter), NumberOf(duration.leave)];
|
|
6063
6063
|
} else {
|
|
6064
6064
|
const n = NumberOf(duration);
|
|
@@ -12904,18 +12904,18 @@ var __async = (__this, __arguments, generator) => {
|
|
|
12904
12904
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
12905
12905
|
* Released under the MIT License.
|
|
12906
12906
|
*/
|
|
12907
|
-
function isObject(o) {
|
|
12907
|
+
function isObject$2(o) {
|
|
12908
12908
|
return Object.prototype.toString.call(o) === "[object Object]";
|
|
12909
12909
|
}
|
|
12910
12910
|
function isPlainObject$1(o) {
|
|
12911
12911
|
var ctor, prot;
|
|
12912
|
-
if (isObject(o) === false)
|
|
12912
|
+
if (isObject$2(o) === false)
|
|
12913
12913
|
return false;
|
|
12914
12914
|
ctor = o.constructor;
|
|
12915
12915
|
if (ctor === void 0)
|
|
12916
12916
|
return true;
|
|
12917
12917
|
prot = ctor.prototype;
|
|
12918
|
-
if (isObject(prot) === false)
|
|
12918
|
+
if (isObject$2(prot) === false)
|
|
12919
12919
|
return false;
|
|
12920
12920
|
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
12921
12921
|
return false;
|
|
@@ -17701,12 +17701,12 @@ and ensure you are accounting for this risk.
|
|
|
17701
17701
|
enforceHtmlBoundary: false,
|
|
17702
17702
|
parseStyleAttributes: true
|
|
17703
17703
|
};
|
|
17704
|
-
sanitizeHtml.simpleTransform = function(newTagName, newAttribs,
|
|
17705
|
-
|
|
17704
|
+
sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge2) {
|
|
17705
|
+
merge2 = merge2 === void 0 ? true : merge2;
|
|
17706
17706
|
newAttribs = newAttribs || {};
|
|
17707
17707
|
return function(tagName, attribs) {
|
|
17708
17708
|
let attrib;
|
|
17709
|
-
if (
|
|
17709
|
+
if (merge2) {
|
|
17710
17710
|
for (attrib in newAttribs) {
|
|
17711
17711
|
attribs[attrib] = newAttribs[attrib];
|
|
17712
17712
|
}
|
|
@@ -19704,6 +19704,74 @@ and ensure you are accounting for this risk.
|
|
|
19704
19704
|
};
|
|
19705
19705
|
}
|
|
19706
19706
|
});
|
|
19707
|
+
const extractValue = (options) => {
|
|
19708
|
+
switch (options.extractFrom) {
|
|
19709
|
+
case "url":
|
|
19710
|
+
return extractFromUrl(options);
|
|
19711
|
+
case "localStorage":
|
|
19712
|
+
case "sessionStorage":
|
|
19713
|
+
return extractFromStorage(options);
|
|
19714
|
+
case "htmlElementText":
|
|
19715
|
+
return extractFromHtmlElementText(options);
|
|
19716
|
+
case "cookie":
|
|
19717
|
+
return extractFromCookie(options);
|
|
19718
|
+
default:
|
|
19719
|
+
return options.default;
|
|
19720
|
+
}
|
|
19721
|
+
};
|
|
19722
|
+
const extractFromCookie = (options) => {
|
|
19723
|
+
var _a, _b;
|
|
19724
|
+
try {
|
|
19725
|
+
const cookieValue = (_b = (_a = document.cookie) == null ? void 0 : _a.split("; ")) == null ? void 0 : _b.find((row) => row == null ? void 0 : row.startsWith(`${options.cookieName}=`));
|
|
19726
|
+
return cookieValue ? cookieValue.split("=")[1] : options.default;
|
|
19727
|
+
} catch (e2) {
|
|
19728
|
+
return options.default;
|
|
19729
|
+
}
|
|
19730
|
+
};
|
|
19731
|
+
const extractFromUrl = (options) => {
|
|
19732
|
+
const regex = new RegExp(options.regex);
|
|
19733
|
+
const match = window.location.href.match(regex);
|
|
19734
|
+
return match ? match[1] : options.default;
|
|
19735
|
+
};
|
|
19736
|
+
const extractFromStorage = (options) => {
|
|
19737
|
+
const storage = options.extractFrom === "localStorage" ? localStorage : sessionStorage;
|
|
19738
|
+
let rawValue2 = "";
|
|
19739
|
+
try {
|
|
19740
|
+
rawValue2 = storage.getItem(options.key);
|
|
19741
|
+
} catch (e2) {
|
|
19742
|
+
return options.default;
|
|
19743
|
+
}
|
|
19744
|
+
if (rawValue2) {
|
|
19745
|
+
try {
|
|
19746
|
+
const parsedValue = JSON.parse(rawValue2);
|
|
19747
|
+
return options.path ? getValueFromPath(parsedValue, options.path) : parsedValue;
|
|
19748
|
+
} catch (e2) {
|
|
19749
|
+
return rawValue2;
|
|
19750
|
+
}
|
|
19751
|
+
}
|
|
19752
|
+
return options.default;
|
|
19753
|
+
};
|
|
19754
|
+
const extractFromHtmlElementText = (options) => {
|
|
19755
|
+
var _a;
|
|
19756
|
+
const element = document.querySelector(options.querySelector);
|
|
19757
|
+
return element ? ((_a = element.textContent) == null ? void 0 : _a.trim()) || options.default : options.default;
|
|
19758
|
+
};
|
|
19759
|
+
const getValueFromPath = (obj, path) => {
|
|
19760
|
+
return path.split(".").reduce((value, key) => value && value[key] || null, obj);
|
|
19761
|
+
};
|
|
19762
|
+
const processExtractionObject = (value = {}) => {
|
|
19763
|
+
var _a;
|
|
19764
|
+
const parsedObject = {};
|
|
19765
|
+
for (const key in value) {
|
|
19766
|
+
if (isObject$1(value[key]) && ((_a = value[key]) == null ? void 0 : _a.extractFrom)) {
|
|
19767
|
+
const extractedValue = extractValue(value[key]);
|
|
19768
|
+
parsedObject[key] = Array.isArray(extractedValue) ? extractedValue : [extractedValue];
|
|
19769
|
+
} else {
|
|
19770
|
+
parsedObject[key] = value[key];
|
|
19771
|
+
}
|
|
19772
|
+
}
|
|
19773
|
+
return parsedObject;
|
|
19774
|
+
};
|
|
19707
19775
|
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
19708
19776
|
__name: "SearchBoxProductsWrapper",
|
|
19709
19777
|
props: {
|
|
@@ -19727,6 +19795,10 @@ and ensure you are accounting for this risk.
|
|
|
19727
19795
|
const showGoToResultsButton = computed(() => {
|
|
19728
19796
|
return props.panel.showGoToResults;
|
|
19729
19797
|
});
|
|
19798
|
+
const extractedInitialFilters = computed(() => {
|
|
19799
|
+
var _a;
|
|
19800
|
+
return __spreadValues2({}, processExtractionObject((_a = props.panel) == null ? void 0 : _a.initialFilters));
|
|
19801
|
+
});
|
|
19730
19802
|
const inputValueProp = computed(() => props.inputValue);
|
|
19731
19803
|
onMounted(() => {
|
|
19732
19804
|
getItemsDebounced();
|
|
@@ -19744,7 +19816,11 @@ and ensure you are accounting for this risk.
|
|
|
19744
19816
|
const getItems = () => {
|
|
19745
19817
|
searchBoxStore.queryDocuments({
|
|
19746
19818
|
queryKey: props.panel.queryKey,
|
|
19747
|
-
publicQuery: {
|
|
19819
|
+
publicQuery: {
|
|
19820
|
+
searchText: props.inputValue,
|
|
19821
|
+
limit: props.panel.limit,
|
|
19822
|
+
filters: extractedInitialFilters.value
|
|
19823
|
+
},
|
|
19748
19824
|
options: props.options
|
|
19749
19825
|
}).then(({ result: result2 }) => {
|
|
19750
19826
|
if (!(result2 == null ? void 0 : result2.items.length)) {
|
|
@@ -25099,12 +25175,12 @@ and ensure you are accounting for this risk.
|
|
|
25099
25175
|
"data-cy": "lupa-no-results-in-page"
|
|
25100
25176
|
};
|
|
25101
25177
|
const _hoisted_4$4 = {
|
|
25102
|
-
key:
|
|
25178
|
+
key: 4,
|
|
25103
25179
|
class: "lupa-empty-results",
|
|
25104
25180
|
"data-cy": "lupa-no-results"
|
|
25105
25181
|
};
|
|
25106
|
-
const _hoisted_5$1 = { key:
|
|
25107
|
-
const _hoisted_6$1 = { key:
|
|
25182
|
+
const _hoisted_5$1 = { key: 5 };
|
|
25183
|
+
const _hoisted_6$1 = { key: 6 };
|
|
25108
25184
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
25109
25185
|
__name: "SearchResultsProducts",
|
|
25110
25186
|
props: {
|
|
@@ -25225,10 +25301,11 @@ and ensure you are accounting for this risk.
|
|
|
25225
25301
|
location: "top",
|
|
25226
25302
|
sdkOptions: _ctx.options.options
|
|
25227
25303
|
}, null, 8, ["options", "sdkOptions"]),
|
|
25228
|
-
|
|
25304
|
+
_ctx.options.relatedQueries ? (openBlock(), createBlock(_sfc_main$i, {
|
|
25305
|
+
key: 1,
|
|
25229
25306
|
options: _ctx.options.relatedQueries
|
|
25230
|
-
}, null, 8, ["options"]),
|
|
25231
|
-
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key:
|
|
25307
|
+
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
25308
|
+
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
25232
25309
|
showTopFilters.value ? (openBlock(), createBlock(_sfc_main$H, {
|
|
25233
25310
|
key: 0,
|
|
25234
25311
|
options: (_a = _ctx.options.filters) != null ? _a : {}
|
|
@@ -25248,7 +25325,7 @@ and ensure you are accounting for this risk.
|
|
|
25248
25325
|
expandable: !desktopFiltersExpanded.value
|
|
25249
25326
|
}, null, 8, ["class", "options", "expandable"])) : createCommentVNode("", true)
|
|
25250
25327
|
], 64)) : createCommentVNode("", true),
|
|
25251
|
-
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key:
|
|
25328
|
+
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
25252
25329
|
createVNode(_sfc_main$B, {
|
|
25253
25330
|
class: "lupa-toolbar-top",
|
|
25254
25331
|
options: _ctx.options,
|
|
@@ -25433,9 +25510,12 @@ and ensure you are accounting for this risk.
|
|
|
25433
25510
|
const dynamicDataStore = useDynamicDataStore();
|
|
25434
25511
|
const screenStore = useScreenStore();
|
|
25435
25512
|
const redirectionStore = useRedirectionStore();
|
|
25513
|
+
const extractedInitialFilters = computed(() => {
|
|
25514
|
+
return __spreadValues2({}, processExtractionObject(props.options.initialFilters));
|
|
25515
|
+
});
|
|
25436
25516
|
const initialFilters = computed(() => {
|
|
25437
|
-
var _a;
|
|
25438
|
-
return (_a = props.initialFilters) != null ? _a : {};
|
|
25517
|
+
var _a, _b;
|
|
25518
|
+
return (_b = (_a = props.initialFilters) != null ? _a : extractedInitialFilters.value) != null ? _b : {};
|
|
25439
25519
|
});
|
|
25440
25520
|
const { currentQueryText, hasResults, currentFilterCount } = storeToRefs(searchResultStore);
|
|
25441
25521
|
const { searchString, sortParams } = storeToRefs(paramStore);
|
|
@@ -25741,62 +25821,6 @@ and ensure you are accounting for this risk.
|
|
|
25741
25821
|
};
|
|
25742
25822
|
}
|
|
25743
25823
|
});
|
|
25744
|
-
const extractValue = (options) => {
|
|
25745
|
-
switch (options.extractFrom) {
|
|
25746
|
-
case "url":
|
|
25747
|
-
return extractFromUrl(options);
|
|
25748
|
-
case "localStorage":
|
|
25749
|
-
case "sessionStorage":
|
|
25750
|
-
return extractFromStorage(options);
|
|
25751
|
-
case "htmlElementText":
|
|
25752
|
-
return extractFromHtmlElementText(options);
|
|
25753
|
-
default:
|
|
25754
|
-
return options.default;
|
|
25755
|
-
}
|
|
25756
|
-
};
|
|
25757
|
-
const extractFromUrl = (options) => {
|
|
25758
|
-
const regex = new RegExp(options.regex);
|
|
25759
|
-
const match = window.location.href.match(regex);
|
|
25760
|
-
return match ? match[1] : options.default;
|
|
25761
|
-
};
|
|
25762
|
-
const extractFromStorage = (options) => {
|
|
25763
|
-
const storage = options.extractFrom === "localStorage" ? localStorage : sessionStorage;
|
|
25764
|
-
let rawValue2 = "";
|
|
25765
|
-
try {
|
|
25766
|
-
rawValue2 = storage.getItem(options.key);
|
|
25767
|
-
} catch (e2) {
|
|
25768
|
-
return options.default;
|
|
25769
|
-
}
|
|
25770
|
-
if (rawValue2) {
|
|
25771
|
-
try {
|
|
25772
|
-
const parsedValue = JSON.parse(rawValue2);
|
|
25773
|
-
return options.path ? getValueFromPath(parsedValue, options.path) : parsedValue;
|
|
25774
|
-
} catch (e2) {
|
|
25775
|
-
return rawValue2;
|
|
25776
|
-
}
|
|
25777
|
-
}
|
|
25778
|
-
return options.default;
|
|
25779
|
-
};
|
|
25780
|
-
const extractFromHtmlElementText = (options) => {
|
|
25781
|
-
var _a;
|
|
25782
|
-
const element = document.querySelector(options.querySelector);
|
|
25783
|
-
return element ? ((_a = element.textContent) == null ? void 0 : _a.trim()) || options.default : options.default;
|
|
25784
|
-
};
|
|
25785
|
-
const getValueFromPath = (obj, path) => {
|
|
25786
|
-
return path.split(".").reduce((value, key) => value && value[key] || null, obj);
|
|
25787
|
-
};
|
|
25788
|
-
const processExtractionObject = (value = {}) => {
|
|
25789
|
-
var _a;
|
|
25790
|
-
const parsedObject = {};
|
|
25791
|
-
for (const key in value) {
|
|
25792
|
-
if (isObject$1(value[key]) && ((_a = value[key]) == null ? void 0 : _a.extractFrom)) {
|
|
25793
|
-
parsedObject[key] = extractValue(value[key]);
|
|
25794
|
-
} else {
|
|
25795
|
-
parsedObject[key] = value[key];
|
|
25796
|
-
}
|
|
25797
|
-
}
|
|
25798
|
-
return parsedObject;
|
|
25799
|
-
};
|
|
25800
25824
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
25801
25825
|
__name: "ProductList",
|
|
25802
25826
|
props: {
|
|
@@ -25816,7 +25840,7 @@ and ensure you are accounting for this risk.
|
|
|
25816
25840
|
var _a;
|
|
25817
25841
|
(_a = searchResults2.value) == null ? void 0 : _a.handleMounted();
|
|
25818
25842
|
};
|
|
25819
|
-
computed(() => {
|
|
25843
|
+
const initialFilters = computed(() => {
|
|
25820
25844
|
return __spreadValues2({}, processExtractionObject(props.options.initialFilters));
|
|
25821
25845
|
});
|
|
25822
25846
|
__expose({ fetch: fetch2 });
|
|
@@ -25824,7 +25848,7 @@ and ensure you are accounting for this risk.
|
|
|
25824
25848
|
return openBlock(), createElementBlock("div", null, [
|
|
25825
25849
|
createVNode(_sfc_main$e, {
|
|
25826
25850
|
options: componentOptions.value,
|
|
25827
|
-
"initial-filters":
|
|
25851
|
+
"initial-filters": initialFilters.value,
|
|
25828
25852
|
"is-product-list": true,
|
|
25829
25853
|
ref_key: "searchResults",
|
|
25830
25854
|
ref: searchResults2
|
|
@@ -30212,7 +30236,7 @@ and ensure you are accounting for this risk.
|
|
|
30212
30236
|
});
|
|
30213
30237
|
return result3;
|
|
30214
30238
|
}
|
|
30215
|
-
var
|
|
30239
|
+
var merge2 = createAssigner(function(object, source, srcIndex) {
|
|
30216
30240
|
baseMerge(object, source, srcIndex);
|
|
30217
30241
|
});
|
|
30218
30242
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
@@ -30902,7 +30926,7 @@ and ensure you are accounting for this risk.
|
|
|
30902
30926
|
lodash2.matches = matches;
|
|
30903
30927
|
lodash2.matchesProperty = matchesProperty;
|
|
30904
30928
|
lodash2.memoize = memoize;
|
|
30905
|
-
lodash2.merge =
|
|
30929
|
+
lodash2.merge = merge2;
|
|
30906
30930
|
lodash2.mergeWith = mergeWith;
|
|
30907
30931
|
lodash2.method = method;
|
|
30908
30932
|
lodash2.methodOf = methodOf;
|
|
@@ -37738,7 +37762,7 @@ and ensure you are accounting for this risk.
|
|
|
37738
37762
|
});
|
|
37739
37763
|
return result3;
|
|
37740
37764
|
}
|
|
37741
|
-
var
|
|
37765
|
+
var merge2 = createAssigner(function(object, source, srcIndex) {
|
|
37742
37766
|
baseMerge(object, source, srcIndex);
|
|
37743
37767
|
});
|
|
37744
37768
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
@@ -38428,7 +38452,7 @@ and ensure you are accounting for this risk.
|
|
|
38428
38452
|
lodash2.matches = matches;
|
|
38429
38453
|
lodash2.matchesProperty = matchesProperty;
|
|
38430
38454
|
lodash2.memoize = memoize;
|
|
38431
|
-
lodash2.merge =
|
|
38455
|
+
lodash2.merge = merge2;
|
|
38432
38456
|
lodash2.mergeWith = mergeWith;
|
|
38433
38457
|
lodash2.method = method;
|
|
38434
38458
|
lodash2.methodOf = methodOf;
|
|
@@ -39585,6 +39609,14 @@ and ensure you are accounting for this risk.
|
|
|
39585
39609
|
}, interval);
|
|
39586
39610
|
});
|
|
39587
39611
|
});
|
|
39612
|
+
const isObject = (item) => typeof item === "object" && !Array.isArray(item);
|
|
39613
|
+
const merge = (target, source) => {
|
|
39614
|
+
const isDeep = (prop) => isObject(source[prop]) && Object.prototype.hasOwnProperty.call(target, prop) && isObject(target[prop]);
|
|
39615
|
+
const replaced = Object.getOwnPropertyNames(source).map((prop) => ({
|
|
39616
|
+
[prop]: isDeep(prop) ? merge(target[prop], source[prop]) : source[prop]
|
|
39617
|
+
})).reduce((a, b) => __spreadValues(__spreadValues({}, a), b), {});
|
|
39618
|
+
return __spreadValues(__spreadValues({}, target), replaced);
|
|
39619
|
+
};
|
|
39588
39620
|
const saveToLocalStorage = (key, value) => {
|
|
39589
39621
|
try {
|
|
39590
39622
|
localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -39636,7 +39668,7 @@ and ensure you are accounting for this risk.
|
|
|
39636
39668
|
const PREVIEW_PARAMETER = "lupaSearchPreview";
|
|
39637
39669
|
const MAX_ELEMENT_MOUNT_RETRIES = 25;
|
|
39638
39670
|
let styleElement = null;
|
|
39639
|
-
const loadAndSaveConfigurationFromServer = (
|
|
39671
|
+
const loadAndSaveConfigurationFromServer = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }) {
|
|
39640
39672
|
const configuration = yield fetchPluginConfiguration(
|
|
39641
39673
|
options,
|
|
39642
39674
|
configurationKey
|
|
@@ -39661,7 +39693,7 @@ and ensure you are accounting for this risk.
|
|
|
39661
39693
|
}
|
|
39662
39694
|
return isPreviewMode;
|
|
39663
39695
|
};
|
|
39664
|
-
const loadConfigurations = (configurationKey, isPreviewMode, options) => __async(this, null, function* () {
|
|
39696
|
+
const loadConfigurations = (configurationKey, isPreviewMode, options, optionOverrides) => __async(this, null, function* () {
|
|
39665
39697
|
if (isPreviewMode) {
|
|
39666
39698
|
return loadAndSaveConfigurationFromServer(configurationKey, options);
|
|
39667
39699
|
}
|
|
@@ -39679,7 +39711,7 @@ and ensure you are accounting for this risk.
|
|
|
39679
39711
|
const isPreviewMode2 = checkIsPreviewMode();
|
|
39680
39712
|
const configuration = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
|
|
39681
39713
|
if (configuration) {
|
|
39682
|
-
yield mount(configuration, options, false, true);
|
|
39714
|
+
yield mount(configuration, options, optionOverrides, false, true);
|
|
39683
39715
|
} else {
|
|
39684
39716
|
removeFromLocalStorage(configurationKey);
|
|
39685
39717
|
window.location.reload();
|
|
@@ -39710,7 +39742,8 @@ and ensure you are accounting for this risk.
|
|
|
39710
39742
|
}
|
|
39711
39743
|
document.head.appendChild(styleElement);
|
|
39712
39744
|
});
|
|
39713
|
-
const mountSearchBox = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39745
|
+
const mountSearchBox = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39746
|
+
var _a;
|
|
39714
39747
|
if (!configuration.searchBox) {
|
|
39715
39748
|
return;
|
|
39716
39749
|
}
|
|
@@ -39727,9 +39760,11 @@ and ensure you are accounting for this risk.
|
|
|
39727
39760
|
);
|
|
39728
39761
|
return;
|
|
39729
39762
|
}
|
|
39730
|
-
|
|
39763
|
+
const mergedOptions = merge(resolvedConfiguration, (_a = optionOverrides == null ? void 0 : optionOverrides.searchBox) != null ? _a : {});
|
|
39764
|
+
searchBox(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39731
39765
|
});
|
|
39732
|
-
const mountSearchResults = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39766
|
+
const mountSearchResults = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39767
|
+
var _a;
|
|
39733
39768
|
if (!configuration.searchResults) {
|
|
39734
39769
|
return;
|
|
39735
39770
|
}
|
|
@@ -39746,9 +39781,11 @@ and ensure you are accounting for this risk.
|
|
|
39746
39781
|
);
|
|
39747
39782
|
return;
|
|
39748
39783
|
}
|
|
39749
|
-
|
|
39784
|
+
const mergedOptions = merge(resolvedConfiguration, (_a = optionOverrides == null ? void 0 : optionOverrides.searchResults) != null ? _a : {});
|
|
39785
|
+
searchResults(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39750
39786
|
});
|
|
39751
|
-
const mountProductList = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39787
|
+
const mountProductList = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39788
|
+
var _a;
|
|
39752
39789
|
if (!configuration.productList) {
|
|
39753
39790
|
return;
|
|
39754
39791
|
}
|
|
@@ -39768,12 +39805,14 @@ and ensure you are accounting for this risk.
|
|
|
39768
39805
|
);
|
|
39769
39806
|
return;
|
|
39770
39807
|
}
|
|
39771
|
-
|
|
39772
|
-
|
|
39773
|
-
|
|
39808
|
+
const mergedOptions = merge(
|
|
39809
|
+
__spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration),
|
|
39810
|
+
(_a = optionOverrides == null ? void 0 : optionOverrides.productList) != null ? _a : {}
|
|
39774
39811
|
);
|
|
39812
|
+
productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39775
39813
|
});
|
|
39776
|
-
const mountRecommendations = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39814
|
+
const mountRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39815
|
+
var _a;
|
|
39777
39816
|
if (!configuration.recommendations) {
|
|
39778
39817
|
return;
|
|
39779
39818
|
}
|
|
@@ -39795,10 +39834,11 @@ and ensure you are accounting for this risk.
|
|
|
39795
39834
|
);
|
|
39796
39835
|
return;
|
|
39797
39836
|
}
|
|
39798
|
-
|
|
39799
|
-
|
|
39800
|
-
|
|
39837
|
+
const mergedOptions = merge(
|
|
39838
|
+
__spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration),
|
|
39839
|
+
(_a = optionOverrides == null ? void 0 : optionOverrides.recommendations) != null ? _a : {}
|
|
39801
39840
|
);
|
|
39841
|
+
recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39802
39842
|
});
|
|
39803
39843
|
const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39804
39844
|
if (!configuration.genAiChat) {
|
|
@@ -39825,24 +39865,24 @@ and ensure you are accounting for this risk.
|
|
|
39825
39865
|
{ fetch: fetch2, allowedMountUrls }
|
|
39826
39866
|
);
|
|
39827
39867
|
});
|
|
39828
|
-
const mount = (configuration, options, fetch2 = true, remount = false)
|
|
39868
|
+
const mount = (_0, ..._1) => __async(this, [_0, ..._1], function* (configuration, options = { environment: "production" }, optionOverrides = {}, fetch2 = true, remount = false) {
|
|
39829
39869
|
yield applyStyles(configuration);
|
|
39830
39870
|
const mountPromises = [
|
|
39831
|
-
mountSearchBox(configuration, options, fetch2, remount),
|
|
39832
|
-
mountSearchResults(configuration, options, fetch2, remount),
|
|
39833
|
-
mountProductList(configuration, options, fetch2, remount),
|
|
39834
|
-
mountRecommendations(configuration, options, fetch2, remount),
|
|
39871
|
+
mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
|
|
39872
|
+
mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
|
|
39873
|
+
mountProductList(configuration, options, optionOverrides, fetch2, remount),
|
|
39874
|
+
mountRecommendations(configuration, options, optionOverrides, fetch2, remount),
|
|
39835
39875
|
mountChat(configuration, options, fetch2, remount)
|
|
39836
39876
|
];
|
|
39837
39877
|
yield Promise.all(mountPromises);
|
|
39838
39878
|
});
|
|
39839
|
-
const init$1 = (
|
|
39879
|
+
const init$1 = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }, optionOverrides = {}) {
|
|
39840
39880
|
var _a;
|
|
39841
39881
|
const isPreviewMode = checkIsPreviewMode();
|
|
39842
|
-
const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
|
|
39882
|
+
const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options, optionOverrides);
|
|
39843
39883
|
const configuration = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
|
|
39844
39884
|
if (configuration) {
|
|
39845
|
-
yield mount(configuration, options);
|
|
39885
|
+
yield mount(configuration, options, optionOverrides);
|
|
39846
39886
|
}
|
|
39847
39887
|
});
|
|
39848
39888
|
const PluginConfigurationManager = {
|
|
@@ -39851,8 +39891,8 @@ and ensure you are accounting for this risk.
|
|
|
39851
39891
|
const tracking = (options) => {
|
|
39852
39892
|
setupTracking(options);
|
|
39853
39893
|
};
|
|
39854
|
-
const init = (configurationKey, options) => {
|
|
39855
|
-
return PluginConfigurationManager.init(configurationKey, options);
|
|
39894
|
+
const init = (configurationKey, options, optionOverrides) => {
|
|
39895
|
+
return PluginConfigurationManager.init(configurationKey, options, optionOverrides);
|
|
39856
39896
|
};
|
|
39857
39897
|
const lupaSearch = {
|
|
39858
39898
|
init,
|