@partbot/grid-garage 0.1.13 → 0.1.14
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/js/vehicle-garage.es.js +336 -341
- package/dist/js/vehicle-garage.js +7 -7
- package/package.json +1 -1
|
@@ -375,13 +375,13 @@ function ae(t) {
|
|
|
375
375
|
//#endregion
|
|
376
376
|
//#region node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
377
377
|
var oe = e.createContext(void 0);
|
|
378
|
-
function
|
|
378
|
+
function U(t) {
|
|
379
379
|
let n = e.useContext(oe);
|
|
380
380
|
return t || n || "ltr";
|
|
381
381
|
}
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
384
|
-
function
|
|
384
|
+
function W(t) {
|
|
385
385
|
let n = e.useRef(t);
|
|
386
386
|
return e.useEffect(() => {
|
|
387
387
|
n.current = t;
|
|
@@ -389,8 +389,8 @@ function U(t) {
|
|
|
389
389
|
}
|
|
390
390
|
//#endregion
|
|
391
391
|
//#region node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
392
|
-
function
|
|
393
|
-
let r =
|
|
392
|
+
function se(t, n = globalThis?.document) {
|
|
393
|
+
let r = W(t);
|
|
394
394
|
e.useEffect(() => {
|
|
395
395
|
let e = (e) => {
|
|
396
396
|
e.key === "Escape" && r(e);
|
|
@@ -400,23 +400,23 @@ function W(t, n = globalThis?.document) {
|
|
|
400
400
|
}
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
403
|
-
var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLayer.pointerDownOutside",
|
|
403
|
+
var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLayer.pointerDownOutside", G = "dismissableLayer.focusOutside", de, fe = e.createContext({
|
|
404
404
|
layers: /* @__PURE__ */ new Set(),
|
|
405
405
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
406
406
|
branches: /* @__PURE__ */ new Set()
|
|
407
407
|
}), pe = e.forwardRef((t, n) => {
|
|
408
|
-
let { disableOutsidePointerEvents: r = !1, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: o, onInteractOutside: s, onDismiss: c, ...l } = t, u = e.useContext(
|
|
408
|
+
let { disableOutsidePointerEvents: r = !1, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: o, onInteractOutside: s, onDismiss: c, ...l } = t, u = e.useContext(fe), [d, f] = e.useState(null), p = d?.ownerDocument ?? globalThis?.document, [, m] = e.useState({}), g = x(n, (e) => f(e)), _ = Array.from(u.layers), [v] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), y = _.indexOf(v), b = d ? _.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, C = b >= y, w = he((e) => {
|
|
409
409
|
let t = e.target, n = [...u.branches].some((e) => e.contains(t));
|
|
410
410
|
!C || n || (a?.(e), s?.(e), e.defaultPrevented || c?.());
|
|
411
411
|
}, p), T = ge((e) => {
|
|
412
412
|
let t = e.target;
|
|
413
413
|
[...u.branches].some((e) => e.contains(t)) || (o?.(e), s?.(e), e.defaultPrevented || c?.());
|
|
414
414
|
}, p);
|
|
415
|
-
return
|
|
415
|
+
return se((e) => {
|
|
416
416
|
b === u.layers.size - 1 && (i?.(e), !e.defaultPrevented && c && (e.preventDefault(), c()));
|
|
417
417
|
}, p), e.useEffect(() => {
|
|
418
|
-
if (d) return r && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
419
|
-
r && u.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents =
|
|
418
|
+
if (d) return r && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (de = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), q(), () => {
|
|
419
|
+
r && u.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = de);
|
|
420
420
|
};
|
|
421
421
|
}, [
|
|
422
422
|
d,
|
|
@@ -424,7 +424,7 @@ var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLa
|
|
|
424
424
|
r,
|
|
425
425
|
u
|
|
426
426
|
]), e.useEffect(() => () => {
|
|
427
|
-
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d),
|
|
427
|
+
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), q());
|
|
428
428
|
}, [d, u]), e.useEffect(() => {
|
|
429
429
|
let e = () => m({});
|
|
430
430
|
return document.addEventListener(le, e), () => document.removeEventListener(le, e);
|
|
@@ -442,7 +442,7 @@ var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLa
|
|
|
442
442
|
});
|
|
443
443
|
pe.displayName = ce;
|
|
444
444
|
var me = "DismissableLayerBranch", K = e.forwardRef((t, n) => {
|
|
445
|
-
let r = e.useContext(
|
|
445
|
+
let r = e.useContext(fe), i = e.useRef(null), a = x(n, i);
|
|
446
446
|
return e.useEffect(() => {
|
|
447
447
|
let e = i.current;
|
|
448
448
|
if (e) return r.branches.add(e), () => {
|
|
@@ -455,12 +455,12 @@ var me = "DismissableLayerBranch", K = e.forwardRef((t, n) => {
|
|
|
455
455
|
});
|
|
456
456
|
K.displayName = me;
|
|
457
457
|
function he(t, n = globalThis?.document) {
|
|
458
|
-
let r =
|
|
458
|
+
let r = W(t), i = e.useRef(!1), a = e.useRef(() => {});
|
|
459
459
|
return e.useEffect(() => {
|
|
460
460
|
let e = (e) => {
|
|
461
461
|
if (e.target && !i.current) {
|
|
462
462
|
let t = function() {
|
|
463
|
-
|
|
463
|
+
_e(ue, r, i, { discrete: !0 });
|
|
464
464
|
}, i = { originalEvent: e };
|
|
465
465
|
e.pointerType === "touch" ? (n.removeEventListener("click", a.current), a.current = t, n.addEventListener("click", a.current, { once: !0 })) : t();
|
|
466
466
|
} else n.removeEventListener("click", a.current);
|
|
@@ -474,10 +474,10 @@ function he(t, n = globalThis?.document) {
|
|
|
474
474
|
}, [n, r]), { onPointerDownCapture: () => i.current = !0 };
|
|
475
475
|
}
|
|
476
476
|
function ge(t, n = globalThis?.document) {
|
|
477
|
-
let r =
|
|
477
|
+
let r = W(t), i = e.useRef(!1);
|
|
478
478
|
return e.useEffect(() => {
|
|
479
479
|
let e = (e) => {
|
|
480
|
-
e.target && !i.current &&
|
|
480
|
+
e.target && !i.current && _e(G, r, { originalEvent: e }, { discrete: !1 });
|
|
481
481
|
};
|
|
482
482
|
return n.addEventListener("focusin", e), () => n.removeEventListener("focusin", e);
|
|
483
483
|
}, [n, r]), {
|
|
@@ -485,11 +485,11 @@ function ge(t, n = globalThis?.document) {
|
|
|
485
485
|
onBlurCapture: () => i.current = !1
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function q() {
|
|
489
489
|
let e = new CustomEvent(le);
|
|
490
490
|
document.dispatchEvent(e);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function _e(e, t, n, { discrete: r }) {
|
|
493
493
|
let i = n.originalEvent.target, a = new CustomEvent(e, {
|
|
494
494
|
bubbles: !1,
|
|
495
495
|
cancelable: !0,
|
|
@@ -499,11 +499,11 @@ function ve(e, t, n, { discrete: r }) {
|
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
502
|
-
var
|
|
502
|
+
var ve = "focusScope.autoFocusOnMount", ye = "focusScope.autoFocusOnUnmount", be = {
|
|
503
503
|
bubbles: !1,
|
|
504
504
|
cancelable: !0
|
|
505
505
|
}, xe = "FocusScope", Se = e.forwardRef((t, n) => {
|
|
506
|
-
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...s } = t, [c, l] = e.useState(null), u =
|
|
506
|
+
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...s } = t, [c, l] = e.useState(null), u = W(a), d = W(o), f = e.useRef(null), p = x(n, (e) => l(e)), m = e.useRef({
|
|
507
507
|
paused: !1,
|
|
508
508
|
pause() {
|
|
509
509
|
this.paused = !0;
|
|
@@ -543,11 +543,11 @@ var q = "focusScope.autoFocusOnMount", ye = "focusScope.autoFocusOnUnmount", be
|
|
|
543
543
|
ke.add(m);
|
|
544
544
|
let e = document.activeElement;
|
|
545
545
|
if (!c.contains(e)) {
|
|
546
|
-
let t = new CustomEvent(
|
|
547
|
-
c.addEventListener(
|
|
546
|
+
let t = new CustomEvent(ve, be);
|
|
547
|
+
c.addEventListener(ve, u), c.dispatchEvent(t), t.defaultPrevented || (Ce(Me(we(c)), { select: !0 }), document.activeElement === e && Oe(c));
|
|
548
548
|
}
|
|
549
549
|
return () => {
|
|
550
|
-
c.removeEventListener(
|
|
550
|
+
c.removeEventListener(ve, u), setTimeout(() => {
|
|
551
551
|
let t = new CustomEvent(ye, be);
|
|
552
552
|
c.addEventListener(ye, d), c.dispatchEvent(t), t.defaultPrevented || Oe(e ?? document.body, { select: !0 }), c.removeEventListener(ye, d), ke.remove(m);
|
|
553
553
|
}, 0);
|
|
@@ -2599,7 +2599,7 @@ var ma = "PopperContent", [ha, ga] = sa(ma), _a = e.forwardRef((t, n) => {
|
|
|
2599
2599
|
...N
|
|
2600
2600
|
})
|
|
2601
2601
|
]
|
|
2602
|
-
}), [ee, B] = Ca(L), V =
|
|
2602
|
+
}), [ee, B] = Ca(L), V = W(g);
|
|
2603
2603
|
I(() => {
|
|
2604
2604
|
R && V?.();
|
|
2605
2605
|
}, [R, V]);
|
|
@@ -2718,12 +2718,12 @@ var wa = da, Ta = pa, Ea = _a, Da = ba, Oa = "rovingFocusGroup.onEntryFocus", ka
|
|
|
2718
2718
|
}));
|
|
2719
2719
|
Ra.displayName = Aa;
|
|
2720
2720
|
var za = e.forwardRef((t, n) => {
|
|
2721
|
-
let { __scopeRovingFocusGroup: r, orientation: i, loop: a = !1, dir: o, currentTabStopId: s, defaultCurrentTabStopId: c, onCurrentTabStopIdChange: l, onEntryFocus: u, preventScrollOnEntryFocus: d = !1, ...f } = t, p = e.useRef(null), m = x(n, p), g =
|
|
2721
|
+
let { __scopeRovingFocusGroup: r, orientation: i, loop: a = !1, dir: o, currentTabStopId: s, defaultCurrentTabStopId: c, onCurrentTabStopIdChange: l, onEntryFocus: u, preventScrollOnEntryFocus: d = !1, ...f } = t, p = e.useRef(null), m = x(n, p), g = U(o), [_, v] = R({
|
|
2722
2722
|
prop: s,
|
|
2723
2723
|
defaultProp: c ?? null,
|
|
2724
2724
|
onChange: l,
|
|
2725
2725
|
caller: Aa
|
|
2726
|
-
}), [y, b] = e.useState(!1), S =
|
|
2726
|
+
}), [y, b] = e.useState(!1), S = W(u), C = Ma(r), w = e.useRef(!1), [T, E] = e.useState(0);
|
|
2727
2727
|
return e.useEffect(() => {
|
|
2728
2728
|
let e = p.current;
|
|
2729
2729
|
if (e) return e.addEventListener(Oa, S), () => e.removeEventListener(Oa, S);
|
|
@@ -3041,7 +3041,7 @@ function jo(t, n) {
|
|
|
3041
3041
|
return e.useReducer((e, t) => n[e][t] ?? e, t);
|
|
3042
3042
|
}
|
|
3043
3043
|
var Mo = "ScrollArea", [No, Po] = M(Mo), [Fo, Io] = No(Mo), Lo = e.forwardRef((t, n) => {
|
|
3044
|
-
let { __scopeScrollArea: r, type: i = "hover", dir: a, scrollHideDelay: o = 600, ...s } = t, [c, l] = e.useState(null), [u, d] = e.useState(null), [f, p] = e.useState(null), [m, g] = e.useState(null), [_, v] = e.useState(null), [y, b] = e.useState(0), [S, C] = e.useState(0), [w, T] = e.useState(!1), [E, D] = e.useState(!1), O = x(n, (e) => l(e)), A =
|
|
3044
|
+
let { __scopeScrollArea: r, type: i = "hover", dir: a, scrollHideDelay: o = 600, ...s } = t, [c, l] = e.useState(null), [u, d] = e.useState(null), [f, p] = e.useState(null), [m, g] = e.useState(null), [_, v] = e.useState(null), [y, b] = e.useState(0), [S, C] = e.useState(0), [w, T] = e.useState(!1), [E, D] = e.useState(!1), O = x(n, (e) => l(e)), A = U(a);
|
|
3045
3045
|
return /* @__PURE__ */ h(Fo, {
|
|
3046
3046
|
scope: r,
|
|
3047
3047
|
type: i,
|
|
@@ -3340,7 +3340,7 @@ var Ho = e.forwardRef((t, n) => {
|
|
|
3340
3340
|
}
|
|
3341
3341
|
});
|
|
3342
3342
|
}), [Jo, Yo] = No(Bo), Xo = e.forwardRef((t, n) => {
|
|
3343
|
-
let { __scopeScrollArea: r, sizes: i, hasThumb: a, onThumbChange: o, onThumbPointerUp: s, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: u, onWheelScroll: d, onResize: f, ...p } = t, m = Io(Bo, r), [g, _] = e.useState(null), v = x(n, (e) => _(e)), y = e.useRef(null), b = e.useRef(""), S = m.viewport, C = i.content - i.viewport, w =
|
|
3343
|
+
let { __scopeScrollArea: r, sizes: i, hasThumb: a, onThumbChange: o, onThumbPointerUp: s, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: u, onWheelScroll: d, onResize: f, ...p } = t, m = Io(Bo, r), [g, _] = e.useState(null), v = x(n, (e) => _(e)), y = e.useRef(null), b = e.useRef(""), S = m.viewport, C = i.content - i.viewport, w = W(d), T = W(l), E = ds(f, 10);
|
|
3344
3344
|
function D(e) {
|
|
3345
3345
|
y.current && u({
|
|
3346
3346
|
x: e.clientX - y.current.left,
|
|
@@ -3362,10 +3362,10 @@ var Ho = e.forwardRef((t, n) => {
|
|
|
3362
3362
|
scope: r,
|
|
3363
3363
|
scrollbar: g,
|
|
3364
3364
|
hasThumb: a,
|
|
3365
|
-
onThumbChange:
|
|
3366
|
-
onThumbPointerUp:
|
|
3365
|
+
onThumbChange: W(o),
|
|
3366
|
+
onThumbPointerUp: W(s),
|
|
3367
3367
|
onThumbPositionChange: T,
|
|
3368
|
-
onThumbPointerDown:
|
|
3368
|
+
onThumbPointerDown: W(c),
|
|
3369
3369
|
children: /* @__PURE__ */ h(k.div, {
|
|
3370
3370
|
...p,
|
|
3371
3371
|
ref: v,
|
|
@@ -3501,13 +3501,13 @@ var us = (e, t = () => {}) => {
|
|
|
3501
3501
|
})(), () => window.cancelAnimationFrame(r);
|
|
3502
3502
|
};
|
|
3503
3503
|
function ds(t, n) {
|
|
3504
|
-
let r =
|
|
3504
|
+
let r = W(t), i = e.useRef(0);
|
|
3505
3505
|
return e.useEffect(() => () => window.clearTimeout(i.current), []), e.useCallback(() => {
|
|
3506
3506
|
window.clearTimeout(i.current), i.current = window.setTimeout(r, n);
|
|
3507
3507
|
}, [r, n]);
|
|
3508
3508
|
}
|
|
3509
3509
|
function fs(e, t) {
|
|
3510
|
-
let n =
|
|
3510
|
+
let n = W(t);
|
|
3511
3511
|
I(() => {
|
|
3512
3512
|
let t = 0;
|
|
3513
3513
|
if (e) {
|
|
@@ -3537,7 +3537,7 @@ function bs(e) {
|
|
|
3537
3537
|
return vs.includes(e);
|
|
3538
3538
|
}
|
|
3539
3539
|
var xs = ys, Ss = "Tabs", [Cs, ws] = M(Ss, [Fa]), Ts = Fa(), [Es, Ds] = Cs(Ss), Os = e.forwardRef((e, t) => {
|
|
3540
|
-
let { __scopeTabs: n, value: r, onValueChange: i, defaultValue: a, orientation: o = "horizontal", dir: s, activationMode: c = "automatic", ...l } = e, u =
|
|
3540
|
+
let { __scopeTabs: n, value: r, onValueChange: i, defaultValue: a, orientation: o = "horizontal", dir: s, activationMode: c = "automatic", ...l } = e, u = U(s), [d, f] = R({
|
|
3541
3541
|
prop: r,
|
|
3542
3542
|
onChange: i,
|
|
3543
3543
|
defaultProp: a ?? "",
|
|
@@ -3715,7 +3715,7 @@ var [Js, Ys] = Ws(Us), Xs = t.forwardRef((e, n) => {
|
|
|
3715
3715
|
});
|
|
3716
3716
|
qs.displayName = Us;
|
|
3717
3717
|
var [Qs, $s] = Ws(Us), ec = t.forwardRef((e, t) => {
|
|
3718
|
-
let { __scopeToggleGroup: n, disabled: r = !1, rovingFocus: i = !0, orientation: a, dir: o, loop: s = !0, ...c } = e, l = Ks(n), u =
|
|
3718
|
+
let { __scopeToggleGroup: n, disabled: r = !1, rovingFocus: i = !0, orientation: a, dir: o, loop: s = !0, ...c } = e, l = Ks(n), u = U(o), d = {
|
|
3719
3719
|
role: "group",
|
|
3720
3720
|
dir: u,
|
|
3721
3721
|
...c
|
|
@@ -4963,7 +4963,7 @@ var Ul = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Wl = Hl, Gl
|
|
|
4963
4963
|
Y,
|
|
4964
4964
|
Z,
|
|
4965
4965
|
X
|
|
4966
|
-
],
|
|
4966
|
+
], U = () => [
|
|
4967
4967
|
Nu,
|
|
4968
4968
|
"full",
|
|
4969
4969
|
...w()
|
|
@@ -5868,10 +5868,10 @@ var Ul = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Wl = Hl, Gl
|
|
|
5868
5868
|
] }],
|
|
5869
5869
|
"transform-origin": [{ origin: x() }],
|
|
5870
5870
|
"transform-style": [{ transform: ["3d", "flat"] }],
|
|
5871
|
-
translate: [{ translate:
|
|
5872
|
-
"translate-x": [{ "translate-x":
|
|
5873
|
-
"translate-y": [{ "translate-y":
|
|
5874
|
-
"translate-z": [{ "translate-z":
|
|
5871
|
+
translate: [{ translate: U() }],
|
|
5872
|
+
"translate-x": [{ "translate-x": U() }],
|
|
5873
|
+
"translate-y": [{ "translate-y": U() }],
|
|
5874
|
+
"translate-z": [{ "translate-z": U() }],
|
|
5875
5875
|
"translate-none": ["translate-none"],
|
|
5876
5876
|
accent: [{ accent: I() }],
|
|
5877
5877
|
appearance: [{ appearance: ["none", "auto"] }],
|
|
@@ -6688,7 +6688,7 @@ function Uf() {
|
|
|
6688
6688
|
enumerable: !0,
|
|
6689
6689
|
value: null
|
|
6690
6690
|
}
|
|
6691
|
-
})), H = !0, re = !0, ie = !1, ae = !0, oe = !1,
|
|
6691
|
+
})), H = !0, re = !0, ie = !1, ae = !0, oe = !1, U = !0, W = !1, se = !1, ce = !1, le = !1, ue = !1, G = !1, de = !0, fe = !1, pe = "user-content-", me = !0, K = !1, he = {}, ge = null, q = $({}, [
|
|
6692
6692
|
"annotation-xml",
|
|
6693
6693
|
"audio",
|
|
6694
6694
|
"colgroup",
|
|
@@ -6714,7 +6714,7 @@ function Uf() {
|
|
|
6714
6714
|
"title",
|
|
6715
6715
|
"video",
|
|
6716
6716
|
"xmp"
|
|
6717
|
-
]),
|
|
6717
|
+
]), _e = null, ve = $({}, [
|
|
6718
6718
|
"audio",
|
|
6719
6719
|
"video",
|
|
6720
6720
|
"img",
|
|
@@ -6757,7 +6757,7 @@ function Uf() {
|
|
|
6757
6757
|
}, Ie = function() {
|
|
6758
6758
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
6759
6759
|
if (Ne && Ne === e) return;
|
|
6760
|
-
(!e || typeof e != "object") && (e = {}), e = pf(e), Ae = je.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Me = Ae === "application/xhtml+xml" ? Xd : Yd, L = of(e, "ALLOWED_TAGS") && Jd(e.ALLOWED_TAGS) ? $({}, e.ALLOWED_TAGS, Me) : R, z = of(e, "ALLOWED_ATTR") && Jd(e.ALLOWED_ATTR) ? $({}, e.ALLOWED_ATTR, Me) : ee, Te = of(e, "ALLOWED_NAMESPACES") && Jd(e.ALLOWED_NAMESPACES) ? $({}, e.ALLOWED_NAMESPACES, Xd) : Ee, ye = of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) ? $(pf(be), e.ADD_URI_SAFE_ATTR, Me) : be,
|
|
6760
|
+
(!e || typeof e != "object") && (e = {}), e = pf(e), Ae = je.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Me = Ae === "application/xhtml+xml" ? Xd : Yd, L = of(e, "ALLOWED_TAGS") && Jd(e.ALLOWED_TAGS) ? $({}, e.ALLOWED_TAGS, Me) : R, z = of(e, "ALLOWED_ATTR") && Jd(e.ALLOWED_ATTR) ? $({}, e.ALLOWED_ATTR, Me) : ee, Te = of(e, "ALLOWED_NAMESPACES") && Jd(e.ALLOWED_NAMESPACES) ? $({}, e.ALLOWED_NAMESPACES, Xd) : Ee, ye = of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) ? $(pf(be), e.ADD_URI_SAFE_ATTR, Me) : be, _e = of(e, "ADD_DATA_URI_TAGS") && Jd(e.ADD_DATA_URI_TAGS) ? $(pf(ve), e.ADD_DATA_URI_TAGS, Me) : ve, ge = of(e, "FORBID_CONTENTS") && Jd(e.FORBID_CONTENTS) ? $({}, e.FORBID_CONTENTS, Me) : q, V = of(e, "FORBID_TAGS") && Jd(e.FORBID_TAGS) ? $({}, e.FORBID_TAGS, Me) : pf({}), te = of(e, "FORBID_ATTR") && Jd(e.FORBID_ATTR) ? $({}, e.FORBID_ATTR, Me) : pf({}), he = of(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? pf(e.USE_PROFILES) : e.USE_PROFILES : !1, H = e.ALLOW_ARIA_ATTR !== !1, re = e.ALLOW_DATA_ATTR !== !1, ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ae = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, oe = e.SAFE_FOR_TEMPLATES || !1, U = e.SAFE_FOR_XML !== !1, W = e.WHOLE_DOCUMENT || !1, le = e.RETURN_DOM || !1, ue = e.RETURN_DOM_FRAGMENT || !1, G = e.RETURN_TRUSTED_TYPE || !1, ce = e.FORCE_BODY || !1, de = e.SANITIZE_DOM !== !1, fe = e.SANITIZE_NAMED_PROPS || !1, me = e.KEEP_CONTENT !== !1, K = e.IN_PLACE || !1, I = gf(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Nf, J = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Ce, De = of(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? pf(e.MATHML_TEXT_INTEGRATION_POINTS) : $({}, [
|
|
6761
6761
|
"mi",
|
|
6762
6762
|
"mo",
|
|
6763
6763
|
"mn",
|
|
@@ -6765,7 +6765,7 @@ function Uf() {
|
|
|
6765
6765
|
"mtext"
|
|
6766
6766
|
]), Oe = of(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? pf(e.HTML_INTEGRATION_POINTS) : $({}, ["annotation-xml"]);
|
|
6767
6767
|
let t = of(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? pf(e.CUSTOM_ELEMENT_HANDLING) : Bd(null);
|
|
6768
|
-
if (B = Bd(null), of(t, "tagNameCheck") && Fe(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), of(t, "attributeNameCheck") && Fe(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), of(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), oe && (re = !1), ue && (le = !0), he && (L = $({}, Cf), z = Bd(null), he.html === !0 && ($(L, _f), $(z, wf)), he.svg === !0 && ($(L, vf), $(z, Tf), $(z, Df)), he.svgFilters === !0 && ($(L, yf), $(z, Tf), $(z, Df)), he.mathMl === !0 && ($(L, xf), $(z, Ef), $(z, Df))), ne.tagCheck = null, ne.attributeCheck = null, of(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ne.tagCheck = e.ADD_TAGS : Jd(e.ADD_TAGS) && (L === R && (L = pf(L)), $(L, e.ADD_TAGS, Me))), of(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ne.attributeCheck = e.ADD_ATTR : Jd(e.ADD_ATTR) && (z === ee && (z = pf(z)), $(z, e.ADD_ATTR, Me))), of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) && $(ye, e.ADD_URI_SAFE_ATTR, Me), of(e, "FORBID_CONTENTS") && Jd(e.FORBID_CONTENTS) && (ge ===
|
|
6768
|
+
if (B = Bd(null), of(t, "tagNameCheck") && Fe(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), of(t, "attributeNameCheck") && Fe(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), of(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), oe && (re = !1), ue && (le = !0), he && (L = $({}, Cf), z = Bd(null), he.html === !0 && ($(L, _f), $(z, wf)), he.svg === !0 && ($(L, vf), $(z, Tf), $(z, Df)), he.svgFilters === !0 && ($(L, yf), $(z, Tf), $(z, Df)), he.mathMl === !0 && ($(L, xf), $(z, Ef), $(z, Df))), ne.tagCheck = null, ne.attributeCheck = null, of(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ne.tagCheck = e.ADD_TAGS : Jd(e.ADD_TAGS) && (L === R && (L = pf(L)), $(L, e.ADD_TAGS, Me))), of(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ne.attributeCheck = e.ADD_ATTR : Jd(e.ADD_ATTR) && (z === ee && (z = pf(z)), $(z, e.ADD_ATTR, Me))), of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) && $(ye, e.ADD_URI_SAFE_ATTR, Me), of(e, "FORBID_CONTENTS") && Jd(e.FORBID_CONTENTS) && (ge === q && (ge = pf(ge)), $(ge, e.FORBID_CONTENTS, Me)), of(e, "ADD_FORBID_CONTENTS") && Jd(e.ADD_FORBID_CONTENTS) && (ge === q && (ge = pf(ge)), $(ge, e.ADD_FORBID_CONTENTS, Me)), me && (L["#text"] = !0), W && $(L, [
|
|
6769
6769
|
"html",
|
|
6770
6770
|
"head",
|
|
6771
6771
|
"body"
|
|
@@ -6831,7 +6831,7 @@ function Uf() {
|
|
|
6831
6831
|
} catch {}
|
|
6832
6832
|
}
|
|
6833
6833
|
let a = t.body || t.documentElement;
|
|
6834
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), J === Ce ? T.call(t,
|
|
6834
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), J === Ce ? T.call(t, W ? "html" : "body")[0] : W ? t.documentElement : a;
|
|
6835
6835
|
}, Ue = function(e) {
|
|
6836
6836
|
return C.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
6837
6837
|
}, We = function(e) {
|
|
@@ -6851,7 +6851,7 @@ function Uf() {
|
|
|
6851
6851
|
if (Ke(D.uponSanitizeElement, e, {
|
|
6852
6852
|
tagName: r,
|
|
6853
6853
|
allowedTags: L
|
|
6854
|
-
}),
|
|
6854
|
+
}), U && e.hasChildNodes() && !Ge(e.firstElementChild) && cf(/<[/\w!]/g, e.innerHTML) && cf(/<[/\w!]/g, e.textContent) || U && e.namespaceURI === Ce && r === "style" && Ge(e.firstElementChild) || e.nodeType === zf.progressingInstruction || U && e.nodeType === zf.comment && cf(/<[/\w]/g, e.data)) return Be(e), !0;
|
|
6855
6855
|
if (V[r] || !(ne.tagCheck instanceof Function && ne.tagCheck(r)) && !L[r]) {
|
|
6856
6856
|
if (!V[r] && Xe(r) && (B.tagNameCheck instanceof RegExp && cf(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
|
|
6857
6857
|
if (me && !ge[r]) {
|
|
@@ -6874,11 +6874,11 @@ function Uf() {
|
|
|
6874
6874
|
n = Qd(n, e, " ");
|
|
6875
6875
|
}), e.textContent !== n && (Kd(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ke(D.afterSanitizeElements, e, null), !1);
|
|
6876
6876
|
}, Je = function(e, t, r) {
|
|
6877
|
-
if (te[t] ||
|
|
6877
|
+
if (te[t] || de && (t === "id" || t === "name") && (r in n || r in Pe)) return !1;
|
|
6878
6878
|
if (!(re && !te[t] && cf(j, t)) && !(H && cf(M, t)) && !(ne.attributeCheck instanceof Function && ne.attributeCheck(t, e))) {
|
|
6879
6879
|
if (!z[t] || te[t]) {
|
|
6880
6880
|
if (!(Xe(e) && (B.tagNameCheck instanceof RegExp && cf(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && cf(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && cf(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
|
|
6881
|
-
} else if (!ye[t] && !cf(I, Qd(r, P, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && $d(r, "data:") === 0 &&
|
|
6881
|
+
} else if (!ye[t] && !cf(I, Qd(r, P, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && $d(r, "data:") === 0 && _e[e]) && !(ie && !cf(N, Qd(r, P, ""))) && r) return !1;
|
|
6882
6882
|
}
|
|
6883
6883
|
return !0;
|
|
6884
6884
|
}, Ye = $({}, [
|
|
@@ -6905,7 +6905,7 @@ function Uf() {
|
|
|
6905
6905
|
}, i = n.length;
|
|
6906
6906
|
for (; i--;) {
|
|
6907
6907
|
let { name: a, namespaceURI: o, value: s } = n[i], c = Me(a), l = s, u = a === "value" ? l : ef(l);
|
|
6908
|
-
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, Ke(D.uponSanitizeAttribute, e, r), u = r.attrValue,
|
|
6908
|
+
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, Ke(D.uponSanitizeAttribute, e, r), u = r.attrValue, fe && (c === "id" || c === "name") && $d(u, pe) !== 0 && (Ve(a, e), u = pe + u), U && cf(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
|
|
6909
6909
|
Ve(a, e);
|
|
6910
6910
|
continue;
|
|
6911
6911
|
}
|
|
@@ -6958,7 +6958,7 @@ function Uf() {
|
|
|
6958
6958
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
6959
6959
|
if (we = !e, we && (e = "<!-->"), typeof e != "string" && !Ge(e) && (e = mf(e), typeof e != "string")) throw lf("dirty is not a string, aborting");
|
|
6960
6960
|
if (!t.isSupported) return e;
|
|
6961
|
-
if (
|
|
6961
|
+
if (se || Ie(n), t.removed = [], typeof e == "string" && (K = !1), K) {
|
|
6962
6962
|
let t = e.nodeName;
|
|
6963
6963
|
if (typeof t == "string") {
|
|
6964
6964
|
let e = Me(t);
|
|
@@ -6966,8 +6966,8 @@ function Uf() {
|
|
|
6966
6966
|
}
|
|
6967
6967
|
} else if (e instanceof s) i = He("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === zf.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
|
|
6968
6968
|
else {
|
|
6969
|
-
if (!le && !oe && !
|
|
6970
|
-
if (i = He(e), !i) return le ? null :
|
|
6969
|
+
if (!le && !oe && !W && e.indexOf("<") === -1) return b && G ? b.createHTML(e) : e;
|
|
6970
|
+
if (i = He(e), !i) return le ? null : G ? x : "";
|
|
6971
6971
|
}
|
|
6972
6972
|
i && ce && Be(i.firstChild);
|
|
6973
6973
|
let u = Ue(K ? e : i);
|
|
@@ -6989,18 +6989,18 @@ function Uf() {
|
|
|
6989
6989
|
else l = i;
|
|
6990
6990
|
return (z.shadowroot || z.shadowrootmode) && (l = E.call(r, l, !0)), l;
|
|
6991
6991
|
}
|
|
6992
|
-
let d =
|
|
6993
|
-
return
|
|
6992
|
+
let d = W ? i.outerHTML : i.innerHTML;
|
|
6993
|
+
return W && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && cf(If, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), oe && Ud([
|
|
6994
6994
|
O,
|
|
6995
6995
|
k,
|
|
6996
6996
|
A
|
|
6997
6997
|
], (e) => {
|
|
6998
6998
|
d = Qd(d, e, " ");
|
|
6999
|
-
}), b &&
|
|
6999
|
+
}), b && G ? b.createHTML(d) : d;
|
|
7000
7000
|
}, t.setConfig = function() {
|
|
7001
|
-
Ie(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}),
|
|
7001
|
+
Ie(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), se = !0;
|
|
7002
7002
|
}, t.clearConfig = function() {
|
|
7003
|
-
Ne = null,
|
|
7003
|
+
Ne = null, se = !1;
|
|
7004
7004
|
}, t.isValidAttribute = function(e, t, n) {
|
|
7005
7005
|
return Ne || Ie({}), Je(Me(e), Me(t), n);
|
|
7006
7006
|
}, t.addHook = function(e, t) {
|
|
@@ -7453,13 +7453,13 @@ function Tp({ apiKey: e, geocodeApiKey: t, drawerOpen: n, placeholder: r = "PL8S
|
|
|
7453
7453
|
].filter((e) => e != null && e !== "").map(String).join(" ");
|
|
7454
7454
|
window.open(`mailto:report@partbot.io?subject=Registration%20Search%20Issue&body=${encodeURIComponent(`Incorrect vehicles were shown for ${S} number plate: ${b}, vehicle: ${t}. Please provide details of the correct vehicle below:`)}`);
|
|
7455
7455
|
}
|
|
7456
|
-
function
|
|
7456
|
+
function U() {
|
|
7457
7457
|
x(""), T(null), D(null), j(Lc), bl(), _l(), Il();
|
|
7458
7458
|
}
|
|
7459
|
-
function
|
|
7459
|
+
function W() {
|
|
7460
7460
|
f && Bl(f);
|
|
7461
7461
|
}
|
|
7462
|
-
function
|
|
7462
|
+
function se(e) {
|
|
7463
7463
|
e.preventDefault(), re(Lc);
|
|
7464
7464
|
}
|
|
7465
7465
|
return /* @__PURE__ */ g("div", {
|
|
@@ -7493,13 +7493,13 @@ function Tp({ apiKey: e, geocodeApiKey: t, drawerOpen: n, placeholder: r = "PL8S
|
|
|
7493
7493
|
type: "button",
|
|
7494
7494
|
variant: "outline",
|
|
7495
7495
|
className: "w-full",
|
|
7496
|
-
onClick:
|
|
7496
|
+
onClick: U,
|
|
7497
7497
|
children: "Clear Vehicle"
|
|
7498
7498
|
}), f ? /* @__PURE__ */ g(gd, {
|
|
7499
7499
|
type: "button",
|
|
7500
7500
|
variant: "outline",
|
|
7501
7501
|
className: "w-full",
|
|
7502
|
-
onClick:
|
|
7502
|
+
onClick: W,
|
|
7503
7503
|
children: [/* @__PURE__ */ h(xc, { "data-icon": "inline-start" }), p]
|
|
7504
7504
|
}) : null]
|
|
7505
7505
|
})]
|
|
@@ -7617,14 +7617,14 @@ function Tp({ apiKey: e, geocodeApiKey: t, drawerOpen: n, placeholder: r = "PL8S
|
|
|
7617
7617
|
type: "button",
|
|
7618
7618
|
variant: "ghost",
|
|
7619
7619
|
size: "sm",
|
|
7620
|
-
onClick:
|
|
7620
|
+
onClick: U,
|
|
7621
7621
|
children: [/* @__PURE__ */ h(bc, { "data-icon": "inline-start" }), "Back to search"]
|
|
7622
7622
|
})]
|
|
7623
7623
|
})
|
|
7624
7624
|
]
|
|
7625
7625
|
}) : null,
|
|
7626
7626
|
!E && !w ? /* @__PURE__ */ g("form", {
|
|
7627
|
-
onSubmit:
|
|
7627
|
+
onSubmit: se,
|
|
7628
7628
|
className: "mx-auto flex w-full max-w-xl flex-col items-center gap-5 text-left",
|
|
7629
7629
|
children: [
|
|
7630
7630
|
L ? /* @__PURE__ */ g("div", {
|
|
@@ -9027,28 +9027,17 @@ function Em(e) {
|
|
|
9027
9027
|
function Dm(e) {
|
|
9028
9028
|
return Object.entries(e).reduce((e, [t, n]) => (n && (e[t] = n.value), e), {});
|
|
9029
9029
|
}
|
|
9030
|
-
function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "", fields: s, fieldPrefix: d = "", modifyQueryString: f = !0,
|
|
9031
|
-
let
|
|
9030
|
+
function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "", fields: s, fieldPrefix: d = "", modifyQueryString: f = !0, useStoreVehicles: p = !0, fieldOrder: _ = "MMY", yearOptional: v = !1, enableFeatureFlags: y = !0, portalContainer: b, activeVehicle: x, onVehicleSelected: S }) {
|
|
9031
|
+
let C = l([]), w = l([]), T = l(null), E = l(null), D = l(null), O = l(null), k = l(null), [A, j] = u(Sm), [M, N] = u([]), [P, F] = u([]), [I, L] = u([]), [R, z] = u([]), [ee, B] = u([]), [V, te] = u([]), [ne, H] = u([]), [re, ie] = u([]), [ae, oe] = u([]), [U, W] = u(null), [se, ce] = u({}), [le, ue] = u(null), G = _ === "YMM", de = U?.searchKey ? `${U.host}|${U.indexName}|${U.searchKey}` : "", fe = U?.searchKey ? `${zc}|${U.mmyIndexName}|${U.searchKey}` : "", pe = c(() => s ? s.split(",").map((e) => e.trim()).filter((e) => Cm.includes(e)) : [], [s]), me = c(() => new Set(r.split(",").map((e) => rm(e)).filter(Boolean)), [r]), K = c(() => new Set(Object.keys(se).map((e) => rm(e))), [se]), he = i((e) => d ? `${d}${e}` : e, [d]), ge = i((e) => d ? e.replace(RegExp(`^${d}`), "") : e, [d]), q = i(({ query: e, value: t, remove: n = [] }) => {
|
|
9032
9032
|
if (typeof window > "u" || !f) return;
|
|
9033
|
-
let r = new URLSearchParams(window.location.search), i =
|
|
9033
|
+
let r = new URLSearchParams(window.location.search), i = he(e);
|
|
9034
9034
|
t != null && t !== "" ? r.set(i, String(t)) : r.delete(i), n.forEach((e) => {
|
|
9035
|
-
r.delete(
|
|
9035
|
+
r.delete(he(e));
|
|
9036
9036
|
});
|
|
9037
9037
|
let a = `${window.location.pathname}?${r.toString()}`;
|
|
9038
9038
|
window.history.pushState(null, "", a);
|
|
9039
|
-
}, [f,
|
|
9040
|
-
|
|
9041
|
-
selection: e,
|
|
9042
|
-
modifyQueryString: f,
|
|
9043
|
-
vehicleScopeTokens: p,
|
|
9044
|
-
yearTokens: y
|
|
9045
|
-
});
|
|
9046
|
-
}, [
|
|
9047
|
-
f,
|
|
9048
|
-
p,
|
|
9049
|
-
y
|
|
9050
|
-
]), be = i((e) => {
|
|
9051
|
-
N({
|
|
9039
|
+
}, [f, he]), _e = i((e) => {
|
|
9040
|
+
j({
|
|
9052
9041
|
make: Em(e.make),
|
|
9053
9042
|
model: Em(e.model),
|
|
9054
9043
|
year: Em(e.year),
|
|
@@ -9058,8 +9047,8 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9058
9047
|
engine: Em(e.engine),
|
|
9059
9048
|
engine_capacity: Em(e.engine_capacity)
|
|
9060
9049
|
});
|
|
9061
|
-
}, []),
|
|
9062
|
-
if (typeof window > "u" ||
|
|
9050
|
+
}, []), ve = i(() => {
|
|
9051
|
+
if (typeof window > "u" || x) return;
|
|
9063
9052
|
let e = new URL(window.location.href).searchParams, t = [
|
|
9064
9053
|
"make",
|
|
9065
9054
|
"model",
|
|
@@ -9069,7 +9058,7 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9069
9058
|
"variant",
|
|
9070
9059
|
"engine",
|
|
9071
9060
|
"engine_capacity"
|
|
9072
|
-
], n = t.map(
|
|
9061
|
+
], n = t.map(he), r = {}, i = /^filter\.p\.m\.app--\d+--partbot\.vehicle_(\w+)$/;
|
|
9073
9062
|
for (let [n, a] of e.entries()) {
|
|
9074
9063
|
let e = n.match(i);
|
|
9075
9064
|
if (!e) continue;
|
|
@@ -9083,21 +9072,21 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9083
9072
|
s === "engine_capacitie" && (s = "engine_capacity"), s === "bodie" && (s = "body"), s === "serie" && (s = "series"), t.includes(s) && (r[s] = a);
|
|
9084
9073
|
}
|
|
9085
9074
|
let a = Object.fromEntries(Array.from(e.entries()).filter(([e]) => n.includes(e)).map(([e, t]) => {
|
|
9086
|
-
let n =
|
|
9075
|
+
let n = ge(e);
|
|
9087
9076
|
return n === "year" && /^\d{4}$/.test(t) ? [n, Number.parseInt(t, 10)] : [n, t];
|
|
9088
9077
|
}));
|
|
9089
9078
|
Object.entries(r).forEach(([e, t]) => {
|
|
9090
9079
|
a[e] || (a[e] = e === "year" && /^\d{4}$/.test(t) ? Number.parseInt(t, 10) : t);
|
|
9091
|
-
}), Object.keys(a).length > 0 &&
|
|
9080
|
+
}), Object.keys(a).length > 0 && _e(a);
|
|
9092
9081
|
}, [
|
|
9093
|
-
|
|
9094
|
-
be,
|
|
9082
|
+
x,
|
|
9095
9083
|
_e,
|
|
9096
|
-
|
|
9084
|
+
he,
|
|
9085
|
+
ge
|
|
9097
9086
|
]);
|
|
9098
9087
|
a(() => {
|
|
9099
|
-
!
|
|
9100
|
-
}, [
|
|
9088
|
+
!x?.key || k.current === x.key || (k.current = x.key, _e(x.vehicle));
|
|
9089
|
+
}, [x, _e]), a(() => {
|
|
9101
9090
|
if (!e || e === "demo") return;
|
|
9102
9091
|
async function r() {
|
|
9103
9092
|
try {
|
|
@@ -9108,38 +9097,38 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9108
9097
|
Authorization: `Bearer ${e}`
|
|
9109
9098
|
},
|
|
9110
9099
|
body: JSON.stringify({
|
|
9111
|
-
use_store_vehicles:
|
|
9100
|
+
use_store_vehicles: p,
|
|
9112
9101
|
...n ? { store: n } : {}
|
|
9113
9102
|
})
|
|
9114
9103
|
});
|
|
9115
9104
|
if (!r.ok) throw Error(`Error: ${r.status} ${r.statusText}`);
|
|
9116
9105
|
let i = await r.json();
|
|
9117
|
-
|
|
9106
|
+
C.current = (i.vehicle_makes ?? []).map((e) => ({
|
|
9118
9107
|
...e,
|
|
9119
9108
|
refinement: e.value
|
|
9120
|
-
})),
|
|
9109
|
+
})), p && i.vehicle_models ? typeof i.vehicle_models == "object" && !Array.isArray(i.vehicle_models) ? (w.current = i.vehicle_models, ce(i.vehicle_models)) : Array.isArray(i.vehicle_models) && (w.current = i.vehicle_models.map((e) => String(e?.value ?? "").trim()).filter(Boolean), ce({})) : (w.current = [], ce({})), T.current = Array.isArray(i.store_popular_makes) ? i.store_popular_makes.map((e) => String(e).trim().toUpperCase()) : null, E.current = i.store_popular_models ?? null, W({
|
|
9121
9110
|
host: mm(i.host, "https://search.partbot.io"),
|
|
9122
9111
|
searchKey: i.search_key || i.meilisearch_search_key || i.algolia_search_key || "",
|
|
9123
9112
|
indexName: i.vehicle_index_name || i.index_name || i.meilisearch_index_name || i.algolia_index_name || wm,
|
|
9124
9113
|
mmyIndexName: i.vehicle_mmy_index_name || i.mmy_index_name || i.meilisearch_mmy_index_name || Tm
|
|
9125
9114
|
});
|
|
9126
9115
|
} catch (e) {
|
|
9127
|
-
console.error("[VehicleGarage] MMY auth failed:", e),
|
|
9116
|
+
console.error("[VehicleGarage] MMY auth failed:", e), ue(e instanceof Error ? e.message : "Could not load vehicle search.");
|
|
9128
9117
|
}
|
|
9129
9118
|
}
|
|
9130
9119
|
r();
|
|
9131
9120
|
}, [
|
|
9132
9121
|
t,
|
|
9133
9122
|
e,
|
|
9134
|
-
|
|
9123
|
+
y,
|
|
9135
9124
|
n,
|
|
9136
|
-
|
|
9125
|
+
p
|
|
9137
9126
|
]);
|
|
9138
|
-
let
|
|
9127
|
+
let ye = i(async () => {
|
|
9139
9128
|
let e = [];
|
|
9140
|
-
if (
|
|
9141
|
-
else if (
|
|
9142
|
-
let t = await
|
|
9129
|
+
if (C.current.length > 0) e = [...C.current];
|
|
9130
|
+
else if (D.current) {
|
|
9131
|
+
let t = await D.current.search("", {
|
|
9143
9132
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
9144
9133
|
limit: 1e3
|
|
9145
9134
|
}), n = /* @__PURE__ */ new Map();
|
|
@@ -9152,39 +9141,39 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9152
9141
|
});
|
|
9153
9142
|
}), e = Array.from(n.values());
|
|
9154
9143
|
}
|
|
9155
|
-
if (
|
|
9156
|
-
let t = new Set(
|
|
9144
|
+
if (me.size > 0 ? e = e.filter((e) => me.has(rm(e.value))) : K.size > 0 && (e = e.filter((e) => K.has(rm(e.value)))), T.current?.length) {
|
|
9145
|
+
let t = new Set(T.current);
|
|
9157
9146
|
e.sort((e, n) => {
|
|
9158
9147
|
let r = t.has(String(e.value)), i = t.has(String(n.value));
|
|
9159
|
-
return r && !i ? -1 : !r && i ? 1 : r && i ?
|
|
9148
|
+
return r && !i ? -1 : !r && i ? 1 : r && i ? T.current.indexOf(String(e.value)) - T.current.indexOf(String(n.value)) : String(e.value).localeCompare(String(n.value));
|
|
9160
9149
|
});
|
|
9161
9150
|
} else e.sort((e, t) => (e.popularity ?? 0) === (t.popularity ?? 0) ? String(e.value).localeCompare(String(t.value)) : (t.popularity ?? 0) - (e.popularity ?? 0));
|
|
9162
|
-
|
|
9163
|
-
}, [
|
|
9151
|
+
N(e);
|
|
9152
|
+
}, [K, me]);
|
|
9164
9153
|
a(() => {
|
|
9165
|
-
if (!
|
|
9154
|
+
if (!U?.searchKey) return;
|
|
9166
9155
|
let e = !0;
|
|
9167
|
-
return
|
|
9168
|
-
host:
|
|
9169
|
-
apiKey:
|
|
9170
|
-
}).index(
|
|
9156
|
+
return D.current = new Jp({
|
|
9157
|
+
host: U.host || "https://search.partbot.io",
|
|
9158
|
+
apiKey: U.searchKey
|
|
9159
|
+
}).index(U.indexName), O.current = new Jp({
|
|
9171
9160
|
host: zc,
|
|
9172
|
-
apiKey:
|
|
9173
|
-
}).index(
|
|
9174
|
-
e &&
|
|
9161
|
+
apiKey: U.searchKey
|
|
9162
|
+
}).index(U.mmyIndexName), G || ye(), queueMicrotask(() => {
|
|
9163
|
+
e && ve();
|
|
9175
9164
|
}), () => {
|
|
9176
|
-
e = !1,
|
|
9165
|
+
e = !1, D.current = null, O.current = null;
|
|
9177
9166
|
};
|
|
9178
9167
|
}, [
|
|
9179
|
-
|
|
9168
|
+
U,
|
|
9180
9169
|
G,
|
|
9181
|
-
|
|
9182
|
-
|
|
9170
|
+
ye,
|
|
9171
|
+
ve
|
|
9183
9172
|
]), a(() => {
|
|
9184
9173
|
async function e() {
|
|
9185
|
-
if (!G || !
|
|
9186
|
-
let e = await
|
|
9187
|
-
filter: `year_from <= ${
|
|
9174
|
+
if (!G || !A.year || !D.current) return;
|
|
9175
|
+
let e = await D.current.search("", {
|
|
9176
|
+
filter: `year_from <= ${A.year.value} AND year_to >= ${A.year.value}`,
|
|
9188
9177
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
9189
9178
|
limit: 1e4
|
|
9190
9179
|
}), t = /* @__PURE__ */ new Map();
|
|
@@ -9197,25 +9186,25 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9197
9186
|
});
|
|
9198
9187
|
});
|
|
9199
9188
|
let n = Array.from(t.values());
|
|
9200
|
-
|
|
9189
|
+
me.size > 0 ? n = n.filter((e) => me.has(rm(e.value))) : K.size > 0 && (n = n.filter((e) => K.has(rm(e.value)))), N(n);
|
|
9201
9190
|
}
|
|
9202
9191
|
e();
|
|
9203
9192
|
}, [
|
|
9204
|
-
|
|
9205
|
-
|
|
9193
|
+
K,
|
|
9194
|
+
me,
|
|
9206
9195
|
G,
|
|
9207
|
-
|
|
9208
|
-
|
|
9196
|
+
A.year,
|
|
9197
|
+
de
|
|
9209
9198
|
]), a(() => {
|
|
9210
9199
|
async function e() {
|
|
9211
|
-
if (!G || !
|
|
9212
|
-
let e = await
|
|
9200
|
+
if (!G || !D.current || I.length > 0 || A.year) return;
|
|
9201
|
+
let e = await D.current.search("", {
|
|
9213
9202
|
attributesToRetrieve: ["year_from", "year_to"],
|
|
9214
9203
|
limit: 1e4
|
|
9215
9204
|
}), t = e.hits.map((e) => Number(e.year_from)).filter(Boolean), n = e.hits.map((e) => Number(e.year_to)).filter(Boolean);
|
|
9216
9205
|
if (t.length === 0 || n.length === 0) return;
|
|
9217
9206
|
let r = Math.min(...t), i = Math.max(...n);
|
|
9218
|
-
|
|
9207
|
+
L(Array.from({ length: i - r + 1 }, (e, t) => ({
|
|
9219
9208
|
value: i - t,
|
|
9220
9209
|
refinement: i - t
|
|
9221
9210
|
})));
|
|
@@ -9223,19 +9212,19 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9223
9212
|
e();
|
|
9224
9213
|
}, [
|
|
9225
9214
|
G,
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9215
|
+
I.length,
|
|
9216
|
+
A.year,
|
|
9217
|
+
de
|
|
9229
9218
|
]);
|
|
9230
|
-
let
|
|
9231
|
-
|
|
9219
|
+
let be = i((e) => {
|
|
9220
|
+
F([]), !G && !v && L([]), z([]), B([]), te([]), H([]), ie([]), j((t) => ({
|
|
9232
9221
|
...Sm,
|
|
9233
9222
|
make: e,
|
|
9234
|
-
year: G ||
|
|
9223
|
+
year: G || v ? t.year : null
|
|
9235
9224
|
})), q({
|
|
9236
9225
|
query: "make",
|
|
9237
9226
|
value: e?.value ?? "",
|
|
9238
|
-
remove: G ||
|
|
9227
|
+
remove: G || v ? [
|
|
9239
9228
|
"model",
|
|
9240
9229
|
"body",
|
|
9241
9230
|
"series",
|
|
@@ -9251,16 +9240,16 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9251
9240
|
"variant",
|
|
9252
9241
|
"engine_capacity"
|
|
9253
9242
|
]
|
|
9254
|
-
}), e ||
|
|
9243
|
+
}), e || oe([]);
|
|
9255
9244
|
}, [
|
|
9256
9245
|
G,
|
|
9257
9246
|
q,
|
|
9258
|
-
|
|
9259
|
-
]),
|
|
9260
|
-
!G && !
|
|
9247
|
+
v
|
|
9248
|
+
]), xe = i((e) => {
|
|
9249
|
+
!G && !v && L([]), z([]), B([]), te([]), H([]), ie([]), j((t) => ({
|
|
9261
9250
|
...t,
|
|
9262
9251
|
model: e,
|
|
9263
|
-
year: G ||
|
|
9252
|
+
year: G || v ? t.year : null,
|
|
9264
9253
|
body: null,
|
|
9265
9254
|
series: null,
|
|
9266
9255
|
variant: null,
|
|
@@ -9269,7 +9258,7 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9269
9258
|
})), q({
|
|
9270
9259
|
query: "model",
|
|
9271
9260
|
value: e?.value ?? "",
|
|
9272
|
-
remove: G ||
|
|
9261
|
+
remove: G || v ? [
|
|
9273
9262
|
"body",
|
|
9274
9263
|
"series",
|
|
9275
9264
|
"engine",
|
|
@@ -9283,26 +9272,26 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9283
9272
|
"variant",
|
|
9284
9273
|
"engine_capacity"
|
|
9285
9274
|
]
|
|
9286
|
-
}), e ||
|
|
9275
|
+
}), e || oe([]);
|
|
9287
9276
|
}, [
|
|
9288
9277
|
G,
|
|
9289
9278
|
q,
|
|
9290
|
-
|
|
9291
|
-
]),
|
|
9292
|
-
G ? (
|
|
9279
|
+
v
|
|
9280
|
+
]), Se = i((e) => {
|
|
9281
|
+
G ? (N([]), F([]), j({
|
|
9293
9282
|
...Sm,
|
|
9294
9283
|
year: e
|
|
9295
|
-
}), e ||
|
|
9284
|
+
}), e || L([])) : j((t) => ({
|
|
9296
9285
|
...t,
|
|
9297
9286
|
year: e,
|
|
9298
|
-
...
|
|
9287
|
+
...v ? {} : {
|
|
9299
9288
|
body: null,
|
|
9300
9289
|
series: null,
|
|
9301
9290
|
variant: null,
|
|
9302
9291
|
engine: null,
|
|
9303
9292
|
engine_capacity: null
|
|
9304
9293
|
}
|
|
9305
|
-
})),
|
|
9294
|
+
})), v || (z([]), B([]), te([]), H([]), ie([])), q({
|
|
9306
9295
|
query: "year",
|
|
9307
9296
|
value: e?.value ?? "",
|
|
9308
9297
|
remove: G ? [
|
|
@@ -9313,52 +9302,52 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9313
9302
|
"variant",
|
|
9314
9303
|
"engine",
|
|
9315
9304
|
"engine_capacity"
|
|
9316
|
-
] :
|
|
9305
|
+
] : v ? [] : [
|
|
9317
9306
|
"body",
|
|
9318
9307
|
"series",
|
|
9319
9308
|
"variant",
|
|
9320
9309
|
"engine",
|
|
9321
9310
|
"engine_capacity"
|
|
9322
9311
|
]
|
|
9323
|
-
}), !
|
|
9312
|
+
}), !v && !e && oe([]);
|
|
9324
9313
|
}, [
|
|
9325
9314
|
G,
|
|
9326
9315
|
q,
|
|
9327
|
-
|
|
9328
|
-
]),
|
|
9329
|
-
|
|
9316
|
+
v
|
|
9317
|
+
]), Ce = i((e) => {
|
|
9318
|
+
j((t) => ({
|
|
9330
9319
|
...t,
|
|
9331
9320
|
body: e
|
|
9332
9321
|
})), q({
|
|
9333
9322
|
query: "body",
|
|
9334
9323
|
value: e?.value ?? ""
|
|
9335
9324
|
});
|
|
9336
|
-
}, [q]),
|
|
9337
|
-
|
|
9325
|
+
}, [q]), J = i((e) => {
|
|
9326
|
+
j((t) => ({
|
|
9338
9327
|
...t,
|
|
9339
9328
|
series: e
|
|
9340
9329
|
})), q({
|
|
9341
9330
|
query: "series",
|
|
9342
9331
|
value: e?.value ?? ""
|
|
9343
9332
|
});
|
|
9344
|
-
}, [q]),
|
|
9345
|
-
|
|
9333
|
+
}, [q]), we = i((e) => {
|
|
9334
|
+
j((t) => ({
|
|
9346
9335
|
...t,
|
|
9347
9336
|
variant: e
|
|
9348
9337
|
})), q({
|
|
9349
9338
|
query: "variant",
|
|
9350
9339
|
value: e?.value ?? ""
|
|
9351
9340
|
});
|
|
9352
|
-
}, [q]),
|
|
9353
|
-
|
|
9341
|
+
}, [q]), Te = i((e) => {
|
|
9342
|
+
j((t) => ({
|
|
9354
9343
|
...t,
|
|
9355
9344
|
engine: e
|
|
9356
9345
|
})), q({
|
|
9357
9346
|
query: "engine",
|
|
9358
9347
|
value: e?.value ?? ""
|
|
9359
9348
|
});
|
|
9360
|
-
}, [q]),
|
|
9361
|
-
|
|
9349
|
+
}, [q]), Ee = i((e) => {
|
|
9350
|
+
j((t) => ({
|
|
9362
9351
|
...t,
|
|
9363
9352
|
engine_capacity: e
|
|
9364
9353
|
})), q({
|
|
@@ -9368,30 +9357,30 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9368
9357
|
}, [q]);
|
|
9369
9358
|
a(() => {
|
|
9370
9359
|
async function e() {
|
|
9371
|
-
if (!
|
|
9372
|
-
|
|
9360
|
+
if (!A.make?.refinement) {
|
|
9361
|
+
F([]);
|
|
9373
9362
|
return;
|
|
9374
9363
|
}
|
|
9375
|
-
let e = String(
|
|
9376
|
-
if (
|
|
9377
|
-
|
|
9364
|
+
let e = String(A.make.refinement), t = rm(e);
|
|
9365
|
+
if (me.size > 0 && !me.has(t)) {
|
|
9366
|
+
F([]);
|
|
9378
9367
|
return;
|
|
9379
9368
|
}
|
|
9380
|
-
if (
|
|
9381
|
-
|
|
9369
|
+
if (me.size === 0 && K.size > 0 && !K.has(t)) {
|
|
9370
|
+
F([]);
|
|
9382
9371
|
return;
|
|
9383
9372
|
}
|
|
9384
9373
|
let n = new Set(o.split(",").map((e) => rm(e)).filter(Boolean)), r = [];
|
|
9385
|
-
typeof
|
|
9374
|
+
typeof w.current == "object" && !Array.isArray(w.current) && (r = w.current[e] ?? w.current[Object.keys(w.current).find((e) => rm(e) === t) ?? ""] ?? []);
|
|
9386
9375
|
let i = new Set(r.map((e) => rm(e)));
|
|
9387
|
-
if (
|
|
9376
|
+
if (p && r.length > 0) {
|
|
9388
9377
|
let t = um(r.map((e) => ({
|
|
9389
9378
|
value: e,
|
|
9390
9379
|
refinement: e,
|
|
9391
9380
|
popularity: 0
|
|
9392
9381
|
})));
|
|
9393
9382
|
t = pm(t, n), t = pm(t, i);
|
|
9394
|
-
let a =
|
|
9383
|
+
let a = E.current?.[e];
|
|
9395
9384
|
if (a?.length) {
|
|
9396
9385
|
let e = new Map(a.map((e, t) => [e.toUpperCase(), a.length - t]));
|
|
9397
9386
|
t.sort((t, n) => {
|
|
@@ -9399,28 +9388,28 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9399
9388
|
return r === i ? String(t.value).localeCompare(String(n.value)) : i - r;
|
|
9400
9389
|
});
|
|
9401
9390
|
} else t.sort((e, t) => String(e.value).localeCompare(String(t.value)));
|
|
9402
|
-
|
|
9391
|
+
F(t);
|
|
9403
9392
|
return;
|
|
9404
9393
|
}
|
|
9405
|
-
if (!
|
|
9394
|
+
if (!O.current) return;
|
|
9406
9395
|
let a;
|
|
9407
9396
|
try {
|
|
9408
|
-
a = await
|
|
9397
|
+
a = await O.current.search("", {
|
|
9409
9398
|
filter: em("make", e),
|
|
9410
9399
|
limit: 1
|
|
9411
9400
|
});
|
|
9412
9401
|
} catch (e) {
|
|
9413
|
-
console.error("[VehicleGarage] MMY model search failed:", e),
|
|
9402
|
+
console.error("[VehicleGarage] MMY model search failed:", e), F([]), ue(e instanceof Error ? e.message : "Could not load models for the selected make.");
|
|
9414
9403
|
return;
|
|
9415
9404
|
}
|
|
9416
|
-
|
|
9405
|
+
ue(null);
|
|
9417
9406
|
let s = um((a.hits[0]?.models ?? []).map((e) => ({
|
|
9418
9407
|
value: e.name,
|
|
9419
9408
|
refinement: e.name,
|
|
9420
9409
|
popularity: e.popularity ?? 0
|
|
9421
9410
|
})));
|
|
9422
9411
|
s = pm(s, n), s = pm(s, i);
|
|
9423
|
-
let c =
|
|
9412
|
+
let c = E.current?.[e];
|
|
9424
9413
|
if (c?.length) {
|
|
9425
9414
|
let e = c.map((e) => e.toUpperCase());
|
|
9426
9415
|
s.sort((t, n) => {
|
|
@@ -9428,65 +9417,65 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9428
9417
|
return r >= 0 && i < 0 ? -1 : r < 0 && i >= 0 ? 1 : r >= 0 && i >= 0 ? r - i : String(t.value).localeCompare(String(n.value));
|
|
9429
9418
|
});
|
|
9430
9419
|
} else s.sort((e, t) => (e.popularity ?? 0) === (t.popularity ?? 0) ? String(e.value).localeCompare(String(t.value)) : (t.popularity ?? 0) - (e.popularity ?? 0));
|
|
9431
|
-
|
|
9420
|
+
F(s);
|
|
9432
9421
|
}
|
|
9433
9422
|
e();
|
|
9434
9423
|
}, [
|
|
9435
|
-
|
|
9436
|
-
he,
|
|
9437
|
-
o,
|
|
9424
|
+
K,
|
|
9438
9425
|
me,
|
|
9439
|
-
|
|
9440
|
-
|
|
9426
|
+
o,
|
|
9427
|
+
fe,
|
|
9428
|
+
A.make,
|
|
9429
|
+
p
|
|
9441
9430
|
]), a(() => {
|
|
9442
9431
|
async function e() {
|
|
9443
|
-
if (!
|
|
9432
|
+
if (!D.current || !A.make || !A.model) return;
|
|
9444
9433
|
let e = [
|
|
9445
|
-
dm("model",
|
|
9446
|
-
...
|
|
9447
|
-
...
|
|
9448
|
-
...
|
|
9449
|
-
...
|
|
9450
|
-
...
|
|
9451
|
-
], t = await
|
|
9434
|
+
dm("model", A.model, [A.make]),
|
|
9435
|
+
...v && A.body ? [dm("body", A.body, [A.make, A.model])] : [],
|
|
9436
|
+
...v && A.series ? [dm("series", A.series)] : [],
|
|
9437
|
+
...v && A.variant ? [dm("variant", A.variant)] : [],
|
|
9438
|
+
...v && A.engine ? [dm("engine", A.engine)] : [],
|
|
9439
|
+
...v && A.engine_capacity ? [dm("engine_capacity", A.engine_capacity)] : []
|
|
9440
|
+
], t = await D.current.search("", {
|
|
9452
9441
|
filter: nm(e, []),
|
|
9453
9442
|
attributesToRetrieve: ["year_from", "year_to"],
|
|
9454
9443
|
limit: 200
|
|
9455
9444
|
}), n = t.hits.map((e) => Number(e.year_from)).filter(Boolean), r = t.hits.map((e) => Number(e.year_to)).filter(Boolean);
|
|
9456
9445
|
if (n.length === 0 || r.length === 0) {
|
|
9457
|
-
|
|
9446
|
+
L([]);
|
|
9458
9447
|
return;
|
|
9459
9448
|
}
|
|
9460
9449
|
let i = Math.min(...n), a = Math.max(...r);
|
|
9461
|
-
|
|
9450
|
+
L(Array.from({ length: a - i + 1 }, (e, t) => ({
|
|
9462
9451
|
value: a - t,
|
|
9463
9452
|
refinement: a - t
|
|
9464
9453
|
})));
|
|
9465
9454
|
}
|
|
9466
9455
|
e();
|
|
9467
9456
|
}, [
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9457
|
+
A.make,
|
|
9458
|
+
A.model,
|
|
9459
|
+
A.body,
|
|
9460
|
+
A.series,
|
|
9461
|
+
A.variant,
|
|
9462
|
+
A.engine,
|
|
9463
|
+
A.engine_capacity,
|
|
9464
|
+
v,
|
|
9465
|
+
de
|
|
9477
9466
|
]), a(() => {
|
|
9478
9467
|
async function e() {
|
|
9479
|
-
let e =
|
|
9480
|
-
if (!
|
|
9481
|
-
|
|
9468
|
+
let e = v ? !!(A.make && A.model) : !!(A.make && A.model && A.year);
|
|
9469
|
+
if (!D.current || !e) {
|
|
9470
|
+
z([]);
|
|
9482
9471
|
return;
|
|
9483
9472
|
}
|
|
9484
|
-
let t =
|
|
9485
|
-
filter: nm([dm("model",
|
|
9473
|
+
let t = A.year ? [`year_from <= ${A.year.value}`, `year_to >= ${A.year.value}`] : [], n = await D.current.search("", {
|
|
9474
|
+
filter: nm([dm("model", A.model, [A.make])], t),
|
|
9486
9475
|
attributesToRetrieve: ["body"],
|
|
9487
9476
|
limit: 1e3
|
|
9488
9477
|
});
|
|
9489
|
-
|
|
9478
|
+
z(um([...new Map(n.hits.map((e) => [e.body, e])).values()].map((e) => {
|
|
9490
9479
|
let t = String(e.body ?? "").match(/[^>]*$/)?.[0]?.trim() ?? "";
|
|
9491
9480
|
return {
|
|
9492
9481
|
value: t,
|
|
@@ -9496,13 +9485,13 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9496
9485
|
}
|
|
9497
9486
|
e();
|
|
9498
9487
|
}, [
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9488
|
+
A.year,
|
|
9489
|
+
A.make,
|
|
9490
|
+
A.model,
|
|
9491
|
+
v,
|
|
9492
|
+
de
|
|
9504
9493
|
]);
|
|
9505
|
-
let
|
|
9494
|
+
let De = i(({ hits: e, attribute: t, stateCallback: n }) => {
|
|
9506
9495
|
n(um([...new Map(e.map((e) => [e[t], e])).values()].map((e) => {
|
|
9507
9496
|
let n = String(e[t] ?? "").match(/[^|]*$/)?.[0]?.trim() ?? "";
|
|
9508
9497
|
return {
|
|
@@ -9513,20 +9502,20 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9513
9502
|
}, []);
|
|
9514
9503
|
a(() => {
|
|
9515
9504
|
async function e() {
|
|
9516
|
-
let e =
|
|
9517
|
-
if (!
|
|
9518
|
-
|
|
9505
|
+
let e = v ? !!(A.make && A.model) : !!(A.make && A.model && A.year);
|
|
9506
|
+
if (!D.current || !e) {
|
|
9507
|
+
B([]), te([]), H([]), ie([]);
|
|
9519
9508
|
return;
|
|
9520
9509
|
}
|
|
9521
9510
|
let t = [
|
|
9522
|
-
dm("make",
|
|
9523
|
-
dm("model",
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
].filter((e) => e.length > 0), n =
|
|
9511
|
+
dm("make", A.make),
|
|
9512
|
+
dm("model", A.model, [A.make]),
|
|
9513
|
+
A.body ? dm("body", A.body, [A.make, A.model]) : [],
|
|
9514
|
+
A.series ? dm("series", A.series) : [],
|
|
9515
|
+
A.variant ? dm("variant", A.variant) : [],
|
|
9516
|
+
A.engine ? dm("engine", A.engine) : [],
|
|
9517
|
+
A.engine_capacity ? dm("engine_capacity", A.engine_capacity) : []
|
|
9518
|
+
].filter((e) => e.length > 0), n = A.year ? [`year_from <= ${A.year.value}`, `year_to >= ${A.year.value}`] : [], r = (await D.current.search("", {
|
|
9530
9519
|
filter: nm(t, n),
|
|
9531
9520
|
attributesToRetrieve: [
|
|
9532
9521
|
"series",
|
|
@@ -9536,196 +9525,196 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9536
9525
|
],
|
|
9537
9526
|
limit: 1e3
|
|
9538
9527
|
})).hits;
|
|
9539
|
-
|
|
9528
|
+
De({
|
|
9540
9529
|
hits: r,
|
|
9541
9530
|
attribute: "series",
|
|
9542
|
-
stateCallback:
|
|
9543
|
-
}),
|
|
9531
|
+
stateCallback: B
|
|
9532
|
+
}), De({
|
|
9544
9533
|
hits: r,
|
|
9545
9534
|
attribute: "variant",
|
|
9546
|
-
stateCallback:
|
|
9547
|
-
}),
|
|
9535
|
+
stateCallback: te
|
|
9536
|
+
}), De({
|
|
9548
9537
|
hits: r,
|
|
9549
9538
|
attribute: "engine",
|
|
9550
|
-
stateCallback:
|
|
9551
|
-
}),
|
|
9539
|
+
stateCallback: H
|
|
9540
|
+
}), De({
|
|
9552
9541
|
hits: r,
|
|
9553
9542
|
attribute: "engine_capacity",
|
|
9554
|
-
stateCallback:
|
|
9543
|
+
stateCallback: ie
|
|
9555
9544
|
});
|
|
9556
9545
|
}
|
|
9557
9546
|
e();
|
|
9558
9547
|
}, [
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9548
|
+
De,
|
|
9549
|
+
A.body,
|
|
9550
|
+
A.engine,
|
|
9551
|
+
A.engine_capacity,
|
|
9552
|
+
A.make,
|
|
9553
|
+
A.model,
|
|
9554
|
+
A.series,
|
|
9555
|
+
A.variant,
|
|
9556
|
+
A.year,
|
|
9557
|
+
v,
|
|
9558
|
+
de
|
|
9570
9559
|
]), a(() => {
|
|
9571
9560
|
async function e() {
|
|
9572
|
-
if (!
|
|
9573
|
-
|
|
9561
|
+
if (!A.make || !D.current) {
|
|
9562
|
+
oe([]);
|
|
9574
9563
|
return;
|
|
9575
9564
|
}
|
|
9576
9565
|
let e = [
|
|
9577
|
-
dm("make",
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
].filter((e) => e.length > 0), t =
|
|
9585
|
-
|
|
9566
|
+
dm("make", A.make),
|
|
9567
|
+
A.model ? dm("model", A.model, [A.make]) : [],
|
|
9568
|
+
A.body ? dm("body", A.body, [A.make, A.model]) : [],
|
|
9569
|
+
A.series ? dm("series", A.series) : [],
|
|
9570
|
+
A.variant ? dm("variant", A.variant) : [],
|
|
9571
|
+
A.engine ? dm("engine", A.engine) : [],
|
|
9572
|
+
A.engine_capacity ? dm("engine_capacity", A.engine_capacity) : []
|
|
9573
|
+
].filter((e) => e.length > 0), t = A.year ? [`year_from <= ${A.year.value}`, `year_to >= ${A.year.value}`] : [];
|
|
9574
|
+
oe((await D.current.search("", {
|
|
9586
9575
|
filter: nm(e, t),
|
|
9587
9576
|
attributesToRetrieve: ["otto_id"],
|
|
9588
9577
|
limit: 500
|
|
9589
9578
|
})).hits.map((e) => Number(e.otto_id)).filter(Boolean));
|
|
9590
9579
|
}
|
|
9591
9580
|
e();
|
|
9592
|
-
}, [
|
|
9593
|
-
let
|
|
9581
|
+
}, [A, de]);
|
|
9582
|
+
let Oe = !!(A.make && A.model) && (v || !!A.year), ke = !A.make || !A.model || !v && !A.year, Ae = !!(A.make && A.model), je = {
|
|
9594
9583
|
body: {
|
|
9595
9584
|
label: "Body",
|
|
9596
|
-
value:
|
|
9597
|
-
options:
|
|
9598
|
-
onChange:
|
|
9585
|
+
value: A.body,
|
|
9586
|
+
options: R,
|
|
9587
|
+
onChange: Ce,
|
|
9599
9588
|
placeholder: "Select body",
|
|
9600
|
-
loading:
|
|
9589
|
+
loading: Ae && !A.body && R.length === 0
|
|
9601
9590
|
},
|
|
9602
9591
|
series: {
|
|
9603
9592
|
label: "Series",
|
|
9604
|
-
value:
|
|
9605
|
-
options:
|
|
9606
|
-
onChange:
|
|
9593
|
+
value: A.series,
|
|
9594
|
+
options: ee,
|
|
9595
|
+
onChange: J,
|
|
9607
9596
|
placeholder: "Select series",
|
|
9608
|
-
loading:
|
|
9597
|
+
loading: Ae && !A.series && ee.length === 0
|
|
9609
9598
|
},
|
|
9610
9599
|
variant: {
|
|
9611
9600
|
label: "Variant",
|
|
9612
|
-
value:
|
|
9613
|
-
options:
|
|
9614
|
-
onChange:
|
|
9601
|
+
value: A.variant,
|
|
9602
|
+
options: V,
|
|
9603
|
+
onChange: we,
|
|
9615
9604
|
placeholder: "Select variant",
|
|
9616
|
-
loading:
|
|
9605
|
+
loading: Ae && !A.variant && V.length === 0
|
|
9617
9606
|
},
|
|
9618
9607
|
engine: {
|
|
9619
9608
|
label: "Engine",
|
|
9620
|
-
value:
|
|
9621
|
-
options:
|
|
9622
|
-
onChange:
|
|
9609
|
+
value: A.engine,
|
|
9610
|
+
options: ne,
|
|
9611
|
+
onChange: Te,
|
|
9623
9612
|
placeholder: "Select engine",
|
|
9624
|
-
loading:
|
|
9613
|
+
loading: Ae && !A.engine && ne.length === 0
|
|
9625
9614
|
},
|
|
9626
9615
|
engine_capacity: {
|
|
9627
9616
|
label: "Engine Capacity",
|
|
9628
|
-
value:
|
|
9629
|
-
options:
|
|
9630
|
-
onChange:
|
|
9617
|
+
value: A.engine_capacity,
|
|
9618
|
+
options: re,
|
|
9619
|
+
onChange: Ee,
|
|
9631
9620
|
placeholder: "Select engine capacity",
|
|
9632
|
-
loading:
|
|
9621
|
+
loading: Ae && !A.engine_capacity && re.length === 0
|
|
9633
9622
|
}
|
|
9634
9623
|
};
|
|
9635
9624
|
return /* @__PURE__ */ g("div", {
|
|
9636
9625
|
className: "flex flex-col gap-5",
|
|
9637
|
-
children: [
|
|
9626
|
+
children: [le ? /* @__PURE__ */ g(np, { children: [
|
|
9638
9627
|
/* @__PURE__ */ h(kc, {}),
|
|
9639
9628
|
/* @__PURE__ */ h(rp, { children: "Vehicle search unavailable" }),
|
|
9640
|
-
/* @__PURE__ */ h(ip, { children:
|
|
9629
|
+
/* @__PURE__ */ h(ip, { children: le })
|
|
9641
9630
|
] }) : null, /* @__PURE__ */ g("div", {
|
|
9642
9631
|
className: "flex flex-col gap-4",
|
|
9643
9632
|
children: [
|
|
9644
9633
|
G ? /* @__PURE__ */ g(m, { children: [
|
|
9645
9634
|
/* @__PURE__ */ h(xm, {
|
|
9646
9635
|
label: "Year",
|
|
9647
|
-
value:
|
|
9648
|
-
options:
|
|
9649
|
-
onChange:
|
|
9636
|
+
value: A.year,
|
|
9637
|
+
options: I,
|
|
9638
|
+
onChange: Se,
|
|
9650
9639
|
placeholder: "Select year",
|
|
9651
|
-
loading: !!
|
|
9652
|
-
portalContainer:
|
|
9640
|
+
loading: !!U?.searchKey && !A.year && I.length === 0,
|
|
9641
|
+
portalContainer: b
|
|
9653
9642
|
}),
|
|
9654
9643
|
/* @__PURE__ */ h(xm, {
|
|
9655
9644
|
label: "Make",
|
|
9656
|
-
value:
|
|
9657
|
-
options:
|
|
9658
|
-
onChange:
|
|
9659
|
-
placeholder:
|
|
9660
|
-
disabled: !
|
|
9661
|
-
loading: !!
|
|
9662
|
-
portalContainer:
|
|
9645
|
+
value: A.make,
|
|
9646
|
+
options: M,
|
|
9647
|
+
onChange: be,
|
|
9648
|
+
placeholder: A.year ? "Select make" : "Select a year first",
|
|
9649
|
+
disabled: !A.year,
|
|
9650
|
+
loading: !!A.year && !A.make && M.length === 0,
|
|
9651
|
+
portalContainer: b
|
|
9663
9652
|
}),
|
|
9664
9653
|
/* @__PURE__ */ h(xm, {
|
|
9665
9654
|
label: "Model",
|
|
9666
|
-
value:
|
|
9667
|
-
options:
|
|
9668
|
-
onChange:
|
|
9669
|
-
placeholder:
|
|
9670
|
-
disabled: !
|
|
9671
|
-
loading: !!
|
|
9672
|
-
portalContainer:
|
|
9655
|
+
value: A.model,
|
|
9656
|
+
options: P,
|
|
9657
|
+
onChange: xe,
|
|
9658
|
+
placeholder: A.make ? "Select model" : "Select a make first",
|
|
9659
|
+
disabled: !A.make,
|
|
9660
|
+
loading: !!A.make && !A.model && P.length === 0,
|
|
9661
|
+
portalContainer: b
|
|
9673
9662
|
})
|
|
9674
9663
|
] }) : /* @__PURE__ */ g(m, { children: [
|
|
9675
9664
|
/* @__PURE__ */ h(xm, {
|
|
9676
9665
|
label: "Make",
|
|
9677
|
-
value:
|
|
9678
|
-
options:
|
|
9679
|
-
onChange:
|
|
9666
|
+
value: A.make,
|
|
9667
|
+
options: M,
|
|
9668
|
+
onChange: be,
|
|
9680
9669
|
placeholder: "Select make",
|
|
9681
|
-
loading: !!
|
|
9682
|
-
portalContainer:
|
|
9670
|
+
loading: !!U?.searchKey && !A.make && M.length === 0,
|
|
9671
|
+
portalContainer: b
|
|
9683
9672
|
}),
|
|
9684
9673
|
/* @__PURE__ */ h(xm, {
|
|
9685
9674
|
label: "Model",
|
|
9686
|
-
value:
|
|
9687
|
-
options:
|
|
9688
|
-
onChange:
|
|
9689
|
-
placeholder:
|
|
9690
|
-
disabled: !
|
|
9691
|
-
loading: !!
|
|
9692
|
-
portalContainer:
|
|
9675
|
+
value: A.model,
|
|
9676
|
+
options: P,
|
|
9677
|
+
onChange: xe,
|
|
9678
|
+
placeholder: A.make ? "Select model" : "Select a make first",
|
|
9679
|
+
disabled: !A.make,
|
|
9680
|
+
loading: !!A.make && !A.model && P.length === 0,
|
|
9681
|
+
portalContainer: b
|
|
9693
9682
|
}),
|
|
9694
9683
|
/* @__PURE__ */ h(xm, {
|
|
9695
9684
|
label: "Year",
|
|
9696
|
-
value:
|
|
9697
|
-
options:
|
|
9698
|
-
onChange:
|
|
9699
|
-
placeholder:
|
|
9700
|
-
disabled: !
|
|
9701
|
-
loading: !!
|
|
9702
|
-
portalContainer:
|
|
9685
|
+
value: A.year,
|
|
9686
|
+
options: I,
|
|
9687
|
+
onChange: Se,
|
|
9688
|
+
placeholder: A.model ? "Select year" : v ? "Optional after model" : "Select a model first",
|
|
9689
|
+
disabled: !A.model && !v,
|
|
9690
|
+
loading: !!A.model && !A.year && I.length === 0,
|
|
9691
|
+
portalContainer: b
|
|
9703
9692
|
})
|
|
9704
9693
|
] }),
|
|
9705
|
-
|
|
9706
|
-
let t =
|
|
9694
|
+
pe.map((e) => {
|
|
9695
|
+
let t = je[e];
|
|
9707
9696
|
return /* @__PURE__ */ h(xm, {
|
|
9708
9697
|
label: t.label,
|
|
9709
9698
|
value: t.value,
|
|
9710
9699
|
options: t.options,
|
|
9711
9700
|
onChange: t.onChange,
|
|
9712
9701
|
placeholder: t.placeholder,
|
|
9713
|
-
disabled:
|
|
9702
|
+
disabled: ke,
|
|
9714
9703
|
loading: t.loading,
|
|
9715
|
-
portalContainer:
|
|
9704
|
+
portalContainer: b
|
|
9716
9705
|
}, e);
|
|
9717
9706
|
}),
|
|
9718
9707
|
/* @__PURE__ */ h(gd, {
|
|
9719
9708
|
className: "w-full",
|
|
9720
9709
|
onClick: () => {
|
|
9721
|
-
let e = Dm(
|
|
9722
|
-
|
|
9710
|
+
let e = Dm(A);
|
|
9711
|
+
S({ legacyVehicle: {
|
|
9723
9712
|
description: il(e),
|
|
9724
|
-
vehicle_ids:
|
|
9713
|
+
vehicle_ids: ae,
|
|
9725
9714
|
vehicle: e
|
|
9726
9715
|
} });
|
|
9727
9716
|
},
|
|
9728
|
-
disabled: !
|
|
9717
|
+
disabled: !Oe,
|
|
9729
9718
|
children: "Select vehicle"
|
|
9730
9719
|
})
|
|
9731
9720
|
]
|
|
@@ -10800,8 +10789,8 @@ function bh(e, t, n) {
|
|
|
10800
10789
|
activeVehicle: a
|
|
10801
10790
|
};
|
|
10802
10791
|
}
|
|
10803
|
-
function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonColor: o, buttonHoverColor: s, buttonLabelColor: l, buttonHoverLabelColor: d, themeTextColor: f, mobileBackgroundColor: p, borderColor: _, overlayColor: v, overlayOpacity: y, overlayBlur: b, radius: x, buttonBorderRadius: S, fontFamily: C, fontSize: w, padding: T, inputShadow: E, inputBorderColor: D, inputBorderWidth: O, buttonTheme: k = "light", useGeolocation: A, geocodeApiKey: j, placeholder: M, intro: N, supportMessage: P, actionButtonLabel: F = "Show Products", demoMode: I, modal: L = !0, showOverlay: R = !0, hideOverlay: z = !1, isOpen: ee, onOpenChange: B, hideDefaultButton: V = !1, onModalClose: te, autoCloseOnSelect: ne = !0, closeOnInteractOutside: H = !0, triggerLabel: re = "Garage", showGarageIcon: ie = !0, garageIconUrl: ae, showBranding: oe = !0, hideBranding:
|
|
10804
|
-
let he = uh(ue,
|
|
10792
|
+
function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonColor: o, buttonHoverColor: s, buttonLabelColor: l, buttonHoverLabelColor: d, themeTextColor: f, mobileBackgroundColor: p, borderColor: _, overlayColor: v, overlayOpacity: y, overlayBlur: b, radius: x, buttonBorderRadius: S, fontFamily: C, fontSize: w, padding: T, inputShadow: E, inputBorderColor: D, inputBorderWidth: O, buttonTheme: k = "light", useGeolocation: A, geocodeApiKey: j, placeholder: M, intro: N, supportMessage: P, actionButtonLabel: F = "Show Products", demoMode: I, modal: L = !0, showOverlay: R = !0, hideOverlay: z = !1, isOpen: ee, onOpenChange: B, hideDefaultButton: V = !1, onModalClose: te, autoCloseOnSelect: ne = !0, closeOnInteractOutside: H = !0, triggerLabel: re = "Garage", showGarageIcon: ie = !0, garageIconUrl: ae, showBranding: oe = !0, hideBranding: U = !1, drawerSide: W = "right", defaultTab: se = "plate", apiBaseUrl: ce, wheelTyreFitmentUrl: le, showWheelTyreTab: ue, onWheelTyreFitmentResult: G, garageLimit: de = 4, onVehicleActivate: fe, onGarageChange: pe, portalContainer: me, ...K }) {
|
|
10793
|
+
let he = uh(ue, se), ge = dh(se, he), [q, _e] = u(!1), [ve, ye] = u(ge), [be, xe] = u(null), [Se, Ce] = u(!1), [J, we] = u(() => xl()), Te = c(() => Yc({
|
|
10805
10794
|
themeColor: r,
|
|
10806
10795
|
buttonColor: o,
|
|
10807
10796
|
buttonHoverColor: s,
|
|
@@ -10843,9 +10832,9 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10843
10832
|
r
|
|
10844
10833
|
]), Ee = c(() => ah(), []), De = i((e) => {
|
|
10845
10834
|
xe(e);
|
|
10846
|
-
}, []), Oe = ee !== void 0, ke = Oe ? !!ee :
|
|
10835
|
+
}, []), Oe = ee !== void 0, ke = Oe ? !!ee : q, Ae = W === "left" ? "left" : "right", je = oh(ie), Me = ch({
|
|
10847
10836
|
showBranding: oe,
|
|
10848
|
-
hideBranding:
|
|
10837
|
+
hideBranding: U
|
|
10849
10838
|
}), Ne = lh({
|
|
10850
10839
|
showOverlay: R,
|
|
10851
10840
|
hideOverlay: z
|
|
@@ -10853,7 +10842,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10853
10842
|
let t = vh(e);
|
|
10854
10843
|
Fl(t), pe?.(t);
|
|
10855
10844
|
}, [pe]), Ie = i((e) => {
|
|
10856
|
-
Oe ||
|
|
10845
|
+
Oe || _e(e), B?.(e), e || (Ll(), te?.());
|
|
10857
10846
|
}, [
|
|
10858
10847
|
Oe,
|
|
10859
10848
|
te,
|
|
@@ -10861,7 +10850,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10861
10850
|
]), Le = i((e) => {
|
|
10862
10851
|
H || e.preventDefault();
|
|
10863
10852
|
}, [H]), Re = i(({ source: e, nextState: n, vehicle: r, plateDetails: i, closeAfter: a = ne, emitLegacySelection: o = !0 }) => {
|
|
10864
|
-
if (ml(n), we(n), gl(_h(r)), e === "plate" ? yl(i ?? yh(r) ?? {}) : bl(), o && Pl(e, r), Fe(n),
|
|
10853
|
+
if (ml(n), we(n), gl(_h(r)), e === "plate" ? yl(i ?? yh(r) ?? {}) : bl(), o && Pl(e, r), Fe(n), fe?.({
|
|
10865
10854
|
source: e,
|
|
10866
10855
|
vehicle: r,
|
|
10867
10856
|
vehicles: n.vehicles
|
|
@@ -10876,15 +10865,21 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10876
10865
|
window.location.href = e;
|
|
10877
10866
|
return;
|
|
10878
10867
|
}
|
|
10879
|
-
|
|
10868
|
+
jl({
|
|
10869
|
+
selection: r.vehicle,
|
|
10870
|
+
modifyQueryString: K.modifyQueryString,
|
|
10871
|
+
vehicleScopeTokens: K.vehicleScopeTokens,
|
|
10872
|
+
yearTokens: K.yearTokens
|
|
10873
|
+
}), a && Ie(!1);
|
|
10880
10874
|
}, [
|
|
10881
10875
|
ne,
|
|
10882
10876
|
t,
|
|
10883
10877
|
Fe,
|
|
10884
10878
|
Ie,
|
|
10879
|
+
K.modifyQueryString,
|
|
10885
10880
|
K.vehicleScopeTokens,
|
|
10886
10881
|
K.yearTokens,
|
|
10887
|
-
|
|
10882
|
+
fe
|
|
10888
10883
|
]), ze = i(({ source: e, legacyVehicle: t, plateDetails: n, closeAfter: r }) => {
|
|
10889
10884
|
let i = ll(t);
|
|
10890
10885
|
if (!i) return !1;
|
|
@@ -10892,7 +10887,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10892
10887
|
legacyVehicle: i,
|
|
10893
10888
|
source: e,
|
|
10894
10889
|
plateDetails: n
|
|
10895
|
-
}),
|
|
10890
|
+
}), de);
|
|
10896
10891
|
return Re({
|
|
10897
10892
|
source: e,
|
|
10898
10893
|
nextState: a.state,
|
|
@@ -10902,7 +10897,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10902
10897
|
}), !0;
|
|
10903
10898
|
}, [
|
|
10904
10899
|
Re,
|
|
10905
|
-
|
|
10900
|
+
de,
|
|
10906
10901
|
J
|
|
10907
10902
|
]), Be = i((e) => {
|
|
10908
10903
|
let t = hl();
|
|
@@ -10911,9 +10906,9 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10911
10906
|
legacyVehicle: t,
|
|
10912
10907
|
source: e,
|
|
10913
10908
|
plateDetails: e === "plate" ? vl() : null
|
|
10914
|
-
}),
|
|
10909
|
+
}), de);
|
|
10915
10910
|
ml(n.state), we(n.state);
|
|
10916
|
-
}, [
|
|
10911
|
+
}, [de, J]), Ve = i((e) => {
|
|
10917
10912
|
let t = J.vehicles.find((t) => t.key === e);
|
|
10918
10913
|
t && Re({
|
|
10919
10914
|
source: t.source,
|
|
@@ -11108,7 +11103,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
11108
11103
|
className: "flex flex-1 flex-col gap-5 overflow-hidden px-5 py-4",
|
|
11109
11104
|
children: [
|
|
11110
11105
|
/* @__PURE__ */ g(Dd, {
|
|
11111
|
-
value:
|
|
11106
|
+
value: ve,
|
|
11112
11107
|
onValueChange: (e) => ye(e),
|
|
11113
11108
|
className: "flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
11114
11109
|
children: [
|
|
@@ -11181,12 +11176,12 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
11181
11176
|
wheelTyreFitmentUrl: le,
|
|
11182
11177
|
activeVehicle: Pe,
|
|
11183
11178
|
portalContainer: be ?? me,
|
|
11184
|
-
onWheelTyreFitmentResult:
|
|
11179
|
+
onWheelTyreFitmentResult: G
|
|
11185
11180
|
})
|
|
11186
11181
|
}) : null
|
|
11187
11182
|
]
|
|
11188
11183
|
}),
|
|
11189
|
-
n && Pe && !(
|
|
11184
|
+
n && Pe && !(ve === "plate" && Pe.source === "plate") ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Md, {}), /* @__PURE__ */ h(gd, {
|
|
11190
11185
|
className: "w-full",
|
|
11191
11186
|
onClick: () => Bl(n),
|
|
11192
11187
|
children: F
|
|
@@ -11302,7 +11297,7 @@ var Oh = r(function(e, t) {
|
|
|
11302
11297
|
portalContainer: f
|
|
11303
11298
|
}), s) : null
|
|
11304
11299
|
});
|
|
11305
|
-
}), kh = "0.1.
|
|
11300
|
+
}), kh = "0.1.14", Ah = new Map([
|
|
11306
11301
|
["show-garage-icon", "showGarageIcon"],
|
|
11307
11302
|
["garage-icon-url", "garageIconUrl"],
|
|
11308
11303
|
["show-branding", "showBranding"],
|