@cartbot/vehicle-search-beta 3.0.42 → 3.0.44
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-search.es.js +611 -595
- package/dist/js/vehicle-search.js +18 -18
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as a, jsxs as P, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useEffect as B, useRef as J, useMemo as We, useCallback as D } from "react";
|
|
3
3
|
import Pt from "react-dom";
|
|
4
4
|
import It from "js-cookie";
|
|
5
5
|
import { Combobox as Lt, ComboboxInput as Vt, ComboboxButton as Dt, ComboboxOptions as Ft, ComboboxOption as Ot } from "@headlessui/react";
|
|
6
6
|
import Ut from "fuzzysearch";
|
|
7
7
|
import ft from "pluralize";
|
|
8
|
-
import
|
|
8
|
+
import ge from "clsx";
|
|
9
9
|
import { MeiliSearch as mt } from "meilisearch";
|
|
10
10
|
import Tt from "lodash/debounce.js";
|
|
11
11
|
import Rt from "tinycolor2";
|
|
12
|
-
import
|
|
12
|
+
import Je from "posthog-js";
|
|
13
13
|
const Yt = `@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap";/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{*,:before,:after,::backdrop{--tw-space-x-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-border-style:solid}vehicle-search,vehicle-search *,vehicle-search:before,vehicle-search:after,vehicle-search::backdrop{--tw-space-x-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-border-style:solid}:host,:host *,:host:before,:host:after,:host::backdrop{--tw-space-x-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-border-style:solid}}@layer theme{:root,:host{--vs-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--vs-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--vs-color-red-300:oklch(80.8% .114 19.571);--vs-color-red-500:oklch(63.7% .237 25.331);--vs-color-stone-200:oklch(92.3% .003 48.717);--vs-color-stone-400:oklch(70.9% .01 56.259);--vs-color-stone-600:oklch(44.4% .011 73.639);--vs-color-stone-900:oklch(21.6% .006 56.043);--vs-color-black:#000;--vs-color-white:#fff;--vs-spacing:.25rem;--vs-text-base:1rem;--vs-text-base--line-height: 1.5 ;--vs-font-weight-normal:400;--vs-font-weight-medium:500;--vs-font-weight-semibold:600;--vs-font-weight-bold:700;--vs-leading-normal:1.5;--vs-animate-spin:spin 1s linear infinite;--vs-default-transition-duration:.15s;--vs-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--vs-default-font-family:var(--vs-font-sans);--vs-default-mono-font-family:var(--vs-font-mono)}vehicle-search,:host{--vs-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--vs-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--vs-color-red-300:oklch(80.8% .114 19.571);--vs-color-red-500:oklch(63.7% .237 25.331);--vs-color-stone-200:oklch(92.3% .003 48.717);--vs-color-stone-400:oklch(70.9% .01 56.259);--vs-color-stone-600:oklch(44.4% .011 73.639);--vs-color-stone-900:oklch(21.6% .006 56.043);--vs-color-black:#000;--vs-color-white:#fff;--vs-spacing:.25rem;--vs-text-base:1rem;--vs-text-base--line-height: 1.5 ;--vs-font-weight-normal:400;--vs-font-weight-medium:500;--vs-font-weight-semibold:600;--vs-font-weight-bold:700;--vs-leading-normal:1.5;--vs-animate-spin:spin 1s linear infinite;--vs-default-transition-duration:.15s;--vs-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--vs-default-font-family:var(--vs-font-sans);--vs-default-mono-font-family:var(--vs-font-mono)}:host{--vs-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--vs-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--vs-color-red-300:oklch(80.8% .114 19.571);--vs-color-red-500:oklch(63.7% .237 25.331);--vs-color-stone-200:oklch(92.3% .003 48.717);--vs-color-stone-400:oklch(70.9% .01 56.259);--vs-color-stone-600:oklch(44.4% .011 73.639);--vs-color-stone-900:oklch(21.6% .006 56.043);--vs-color-black:#000;--vs-color-white:#fff;--vs-spacing:.25rem;--vs-text-base:1rem;--vs-text-base--line-height: 1.5 ;--vs-font-weight-normal:400;--vs-font-weight-medium:500;--vs-font-weight-semibold:600;--vs-font-weight-bold:700;--vs-leading-normal:1.5;--vs-animate-spin:spin 1s linear infinite;--vs-default-transition-duration:.15s;--vs-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--vs-default-font-family:var(--vs-font-sans);--vs-default-mono-font-family:var(--vs-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--vs-default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--vs-default-font-feature-settings,normal);font-variation-settings:var(--vs-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--vs-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--vs-default-mono-font-feature-settings,normal);font-variation-settings:var(--vs-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.partbot-mmyvs-container{--partbot-theme:0 188 125;--partbot-button-color:0 153 102;--partbot-button-hover-color:0 188 125;--partbot-button-label-color:255 255 255;--partbot-button-hover-label-color:255 255 255;--partbot-mobile-background-color:12 24 39;--partbot-button-border-radius:.375rem;--partbot-font-size:.875rem;--partbot-font-family:"Partbot","Inter",Helvetica,sans-serif;--partbot-padding:.5rem;--partbot-input-shadow:0 1px 2px 0 #0000000d;--partbot-input-border-color:229 231 235;--partbot-input-border-width:1px}[class*="vs:"]:before,[class*="vs:"]:after,[class^=vehicle-search-]:before,[class^=vehicle-search-]:after{box-sizing:border-box;--tw-content:"";border:0 solid}[class*="vs:"],[class^=vehicle-search-]{box-sizing:border-box;border:0 solid}.vehicle-search-select{text-transform:none;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}.partbot-mmyvs-container{top:calc(var(--vs-spacing)*0);right:calc(var(--vs-spacing)*0);left:calc(var(--vs-spacing)*0);z-index:10000;background-color:rgb(var(--partbot-mobile-background-color));padding:calc(var(--vs-spacing)*8);--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--vs-default-transition-timing-function));transition-duration:var(--tw-duration,var(--vs-default-transition-duration));--tw-duration:.5s;transition-duration:.5s;position:fixed}@media (min-width:48rem){.partbot-mmyvs-container{z-index:10;padding:calc(var(--vs-spacing)*0);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;position:relative;top:auto;left:auto;right:auto}}.partbot-mmyvs-container{transform:translateY(-100vh)}@media (min-width:768px){.partbot-mmyvs-container{transform:translateY(0)}}.partbot-mmyvs-container.active{transform:translateY(0)}[type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is([type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}[multiple],[size]:where(select:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media (forced-colors:active){[type=checkbox]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media (forced-colors:active){[type=radio]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{background-color:currentColor;border-color:#0000}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media (forced-colors:active){[type=checkbox]:indeterminate{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{background-color:currentColor;border-color:#0000}[type=file]{background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}[type=file]:focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.vs\\:pointer-events-auto{pointer-events:auto}.vs\\:pointer-events-none{pointer-events:none}.vs\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.vs\\:absolute{position:absolute}.vs\\:fixed{position:fixed}.vs\\:relative{position:relative}.vs\\:inset-0{inset:calc(var(--vs-spacing)*0)}.vs\\:inset-y-0{inset-block:calc(var(--vs-spacing)*0)}.vs\\:right-0{right:calc(var(--vs-spacing)*0)}.vs\\:right-\\[calc\\(var\\(--partbot-font-size\\)\\*1\\.95\\)\\]{right:calc(var(--partbot-font-size)*1.95)}.vs\\:z-10{z-index:10}.vs\\:z-99999\\!{z-index:99999!important}.vs\\:m-0{margin:calc(var(--vs-spacing)*0)}.vs\\:mt-2{margin-top:calc(var(--vs-spacing)*2)}.vs\\:mt-4{margin-top:calc(var(--vs-spacing)*4)}.vs\\:mb-1{margin-bottom:calc(var(--vs-spacing)*1)}.vs\\:block{display:block}.vs\\:flex{display:flex}.vs\\:flex\\!{display:flex!important}.vs\\:grid{display:grid}.vs\\:inline-flex{display:inline-flex}.vs\\:inline-flex\\!{display:inline-flex!important}.vs\\:h-5{height:calc(var(--vs-spacing)*5)}.vs\\:h-\\[13px\\]{height:13px}.vs\\:h-\\[calc\\(var\\(--partbot-font-size\\)\\*0\\.9\\)\\]\\!{height:calc(var(--partbot-font-size)*.9)!important}.vs\\:h-full{height:100%}.vs\\:max-h-60\\!{max-height:calc(var(--vs-spacing)*60)!important}.vs\\:w-\\(--input-width\\){width:var(--input-width)}.vs\\:w-5{width:calc(var(--vs-spacing)*5)}.vs\\:w-\\[calc\\(var\\(--partbot-font-size\\)\\*0\\.9\\)\\]\\!{width:calc(var(--partbot-font-size)*.9)!important}.vs\\:w-auto\\!{width:auto!important}.vs\\:w-full{width:100%}.vs\\:w-full\\!{width:100%!important}.vs\\:shrink\\!{flex-shrink:1!important}.vs\\:shrink-0\\!{flex-shrink:0!important}.vs\\:animate-spin{animation:var(--vs-animate-spin)}.vs\\:cursor-default{cursor:default}.vs\\:cursor-pointer{cursor:pointer}.vs\\:appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.vs\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.vs\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.vs\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.vs\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.vs\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.vs\\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.vs\\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.vs\\:flex-col{flex-direction:column}.vs\\:items-center{align-items:center}.vs\\:justify-between{justify-content:space-between}.vs\\:justify-center{justify-content:center}.vs\\:justify-end{justify-content:flex-end}.vs\\:gap-3{gap:calc(var(--vs-spacing)*3)}:where(.vs\\:space-x-1\\.5>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--vs-spacing)*1.5)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--vs-spacing)*1.5)*calc(1 - var(--tw-space-x-reverse)))}:where(.vs\\:space-x-\\[calc\\(var\\(--partbot-padding\\)\\*0\\.25\\)\\]>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--partbot-padding)*.25)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--partbot-padding)*.25)*calc(1 - var(--tw-space-x-reverse)))}.vs\\:overflow-auto{overflow:auto}.vs\\:overflow-hidden{overflow:hidden}.vs\\:rounded-\\(--partbot-button-border-radius\\){border-radius:var(--partbot-button-border-radius)}.vs\\:rounded-\\[min\\(var\\(--partbot-button-border-radius\\)\\,0\\.89rem\\)\\]{border-radius:min(var(--partbot-button-border-radius),.89rem)}.vs\\:border-none{--tw-border-style:none;border-style:none}.vs\\:bg-\\[rgb\\(var\\(--partbot-theme\\)\\)\\]{background-color:rgb(var(--partbot-theme))}.vs\\:bg-stone-900{background-color:var(--vs-color-stone-900)}.vs\\:bg-transparent{background-color:#0000}.vs\\:bg-white{background-color:var(--vs-color-white)}.vs\\:p-\\(--partbot-padding\\){padding:var(--partbot-padding)}.vs\\:p-2{padding:calc(var(--vs-spacing)*2)}.vs\\:px-1\\.5{padding-inline:calc(var(--vs-spacing)*1.5)}.vs\\:px-\\[calc\\(var\\(--partbot-padding\\)\\*1\\.3\\)\\]{padding-inline:calc(var(--partbot-padding)*1.3)}.vs\\:py-\\(--partbot-padding\\){padding-block:var(--partbot-padding)}.vs\\:py-1{padding-block:calc(var(--vs-spacing)*1)}.vs\\:pr-\\(--partbot-padding\\){padding-right:var(--partbot-padding)}.vs\\:pr-2{padding-right:calc(var(--vs-spacing)*2)}.vs\\:pr-10{padding-right:calc(var(--vs-spacing)*10)}.vs\\:pr-\\[calc\\(var\\(--partbot-padding\\)\\*1\\.3\\)\\]{padding-right:calc(var(--partbot-padding)*1.3)}.vs\\:pb-4{padding-bottom:calc(var(--vs-spacing)*4)}.vs\\:pl-\\[calc\\(var\\(--partbot-padding\\)\\*1\\.3\\)\\]{padding-left:calc(var(--partbot-padding)*1.3)}.vs\\:text-center{text-align:center}.vs\\:text-left{text-align:left}.vs\\:font-\\(family-name\\:--partbot-font-family\\){font-family:var(--partbot-font-family)}.vs\\:font-sans{font-family:var(--vs-font-sans)}.vs\\:text-base{font-size:var(--vs-text-base);line-height:var(--tw-leading,var(--vs-text-base--line-height))}.vs\\:text-\\(length\\:--partbot-font-size\\){font-size:var(--partbot-font-size)}.vs\\:text-\\[10px\\]{font-size:10px}.vs\\:leading-\\[calc\\(var\\(--partbot-font-size\\)\\*1\\.5\\)\\]{--tw-leading:calc(var(--partbot-font-size)*1.5);line-height:calc(var(--partbot-font-size)*1.5)}.vs\\:leading-none{--tw-leading:1;line-height:1}.vs\\:leading-normal{--tw-leading:var(--vs-leading-normal);line-height:var(--vs-leading-normal)}.vs\\:font-bold{--tw-font-weight:var(--vs-font-weight-bold);font-weight:var(--vs-font-weight-bold)}.vs\\:font-bold\\!{--tw-font-weight:var(--vs-font-weight-bold)!important;font-weight:var(--vs-font-weight-bold)!important}.vs\\:font-medium{--tw-font-weight:var(--vs-font-weight-medium);font-weight:var(--vs-font-weight-medium)}.vs\\:font-normal{--tw-font-weight:var(--vs-font-weight-normal);font-weight:var(--vs-font-weight-normal)}.vs\\:font-semibold{--tw-font-weight:var(--vs-font-weight-semibold);font-weight:var(--vs-font-weight-semibold)}.vs\\:whitespace-pre-wrap{white-space:pre-wrap}.vs\\:text-\\[rgb\\(var\\(--partbot-button-label-color\\)\\)\\]{color:rgb(var(--partbot-button-label-color))}.vs\\:text-\\[rgb\\(var\\(--partbot-theme\\)\\)\\]{color:rgb(var(--partbot-theme))}.vs\\:text-\\[rgb\\(var\\(--partbot-theme\\)\\)\\]\\!{color:rgb(var(--partbot-theme))!important}.vs\\:text-black{color:var(--vs-color-black)}.vs\\:text-red-300{color:var(--vs-color-red-300)}.vs\\:text-red-300\\!{color:var(--vs-color-red-300)!important}.vs\\:text-stone-400{color:var(--vs-color-stone-400)}.vs\\:text-stone-900{color:var(--vs-color-stone-900)}.vs\\:text-white{color:var(--vs-color-white)}.vs\\:no-underline{text-decoration-line:none}.vs\\:opacity-0{opacity:0}.vs\\:opacity-75{opacity:.75}.vs\\:shadow-\\(--partbot-input-shadow\\){--tw-shadow:var(--partbot-input-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.vs\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.vs\\:ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.vs\\:ring-stone-200{--tw-ring-color:var(--vs-color-stone-200)}.vs\\:transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--vs-default-transition-timing-function));transition-duration:var(--tw-duration,var(--vs-default-transition-duration))}.vs\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--vs-default-transition-timing-function));transition-duration:var(--tw-duration,var(--vs-default-transition-duration))}.vs\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.vs\\:outline-none{--tw-outline-style:none;outline-style:none}.vs\\:placeholder\\:text-stone-600::placeholder{color:var(--vs-color-stone-600)}@media (hover:hover){.vs\\:hover\\:border-none:hover{--tw-border-style:none;border-style:none}.vs\\:hover\\:bg-theme:hover{background-color:rgb(var(--partbot-theme))}.vs\\:hover\\:text-button-label:hover{color:rgb(var(--partbot-button-label-color))}.vs\\:hover\\:text-red-500:hover{color:var(--vs-color-red-500)}.vs\\:hover\\:opacity-100:hover{opacity:1}.vs\\:hover\\:outline-none:hover{--tw-outline-style:none;outline-style:none}}.vs\\:focus\\:border-\\[rgb\\(var\\(--partbot-theme\\)\\)\\]:focus{border-color:rgb(var(--partbot-theme))}.vs\\:focus\\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.vs\\:focus\\:ring-\\[rgb\\(var\\(--partbot-theme\\)\\)\\]:focus{--tw-ring-color:rgb(var(--partbot-theme))}.vs\\:focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.vs\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.vs\\:disabled\\:text-stone-400\\!:disabled{color:var(--vs-color-stone-400)!important}.vs\\:disabled\\:opacity-100\\!:disabled{opacity:1!important}.vs\\:disabled\\:placeholder\\:text-stone-400:disabled::placeholder{color:var(--vs-color-stone-400)}@media (min-width:40rem){.vs\\:sm\\:text-\\(length\\:--partbot-font-size\\){font-size:var(--partbot-font-size)}}@media (min-width:48rem){.vs\\:md\\:col-span-3{grid-column:span 3/span 3}.vs\\:md\\:mt-3{margin-top:calc(var(--vs-spacing)*3)}.vs\\:md\\:hidden{display:none}.vs\\:md\\:hidden\\!{display:none!important}.vs\\:md\\:max-w-\\[400px\\]{max-width:400px}.vs\\:md\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.vs\\:md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.vs\\:md\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.vs\\:md\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.vs\\:md\\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.vs\\:md\\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.vs\\:md\\:items-end{align-items:flex-end}.vs\\:md\\:justify-center{justify-content:center}.vs\\:md\\:justify-end{justify-content:flex-end}.vs\\:md\\:gap-5{gap:calc(var(--vs-spacing)*5)}.vs\\:md\\:pr-1\\.5{padding-right:calc(var(--vs-spacing)*1.5)}}@media (min-width:64rem){.vs\\:lg\\:col-span-1{grid-column:span 1/span 1}.vs\\:lg\\:mx-auto{margin-inline:auto}.vs\\:lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.vs\\:lg\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.vs\\:lg\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.vs\\:lg\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.vs\\:lg\\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.vs\\:lg\\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.vehicle-search-btn{cursor:pointer;justify-content:center;align-items:center;display:inline-flex;position:relative!important}:where(.vehicle-search-btn>:not(:last-child)){--tw-space-x-reverse:0!important;margin-inline-start:calc(calc(var(--vs-spacing)*2)*var(--tw-space-x-reverse))!important;margin-inline-end:calc(calc(var(--vs-spacing)*2)*calc(1 - var(--tw-space-x-reverse)))!important}.vehicle-search-btn{border-radius:var(--partbot-button-border-radius);border-style:var(--tw-border-style);background-color:rgb(var(--partbot-button-color));padding-inline:var(--partbot-padding);padding-block:var(--partbot-padding);font-family:var(--partbot-font-family);font-size:var(--partbot-font-size);--tw-leading:calc(var(--partbot-font-size)*1.5);line-height:calc(var(--partbot-font-size)*1.5);--tw-font-weight:var(--vs-font-weight-medium);font-weight:var(--vs-font-weight-medium);white-space:nowrap;color:rgb(var(--partbot-button-label-color));--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--vs-default-transition-timing-function));transition-duration:var(--tw-duration,var(--vs-default-transition-duration));border-width:1px;border-color:#0000;text-decoration-line:none}@media (hover:hover){.vehicle-search-btn:hover{background-color:rgb(var(--partbot-button-hover-color));color:rgb(var(--partbot-button-hover-label-color))}}.vehicle-search-btn:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:rgb(var(--partbot-theme));--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-outline-style:none;outline-style:none}.vehicle-search-btn:disabled{pointer-events:none;opacity:.5}.vehicle-search-btn>*{pointer-events:none}.partbot-input-border{border-width:var(--partbot-input-border-width);border-color:rgb(var(--partbot-input-border-color));border-style:solid}}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}`;
|
|
14
|
-
function Zt({ className:
|
|
15
|
-
return /* @__PURE__ */ a("span", { className:
|
|
14
|
+
function Zt({ className: h }) {
|
|
15
|
+
return /* @__PURE__ */ a("span", { className: h, children: /* @__PURE__ */ a(
|
|
16
16
|
"svg",
|
|
17
17
|
{
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -23,7 +23,7 @@ function Zt({ className: f }) {
|
|
|
23
23
|
width: "auto",
|
|
24
24
|
height: "100%"
|
|
25
25
|
},
|
|
26
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ P("g", { children: [
|
|
27
27
|
/* @__PURE__ */ a(
|
|
28
28
|
"rect",
|
|
29
29
|
{
|
|
@@ -99,11 +99,11 @@ function Zt({ className: f }) {
|
|
|
99
99
|
}
|
|
100
100
|
) });
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Ge({ className: h = "" }) {
|
|
103
103
|
return /* @__PURE__ */ a(
|
|
104
104
|
"svg",
|
|
105
105
|
{
|
|
106
|
-
className:
|
|
106
|
+
className: h,
|
|
107
107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
108
108
|
width: "32",
|
|
109
109
|
height: "32",
|
|
@@ -113,73 +113,73 @@ function Je({ className: f = "" }) {
|
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
label:
|
|
118
|
-
items:
|
|
119
|
-
selected:
|
|
120
|
-
refine:
|
|
121
|
-
showPopular:
|
|
116
|
+
function ne({
|
|
117
|
+
label: h,
|
|
118
|
+
items: f,
|
|
119
|
+
selected: d,
|
|
120
|
+
refine: K,
|
|
121
|
+
showPopular: I,
|
|
122
122
|
bgDark: X,
|
|
123
123
|
sortOptions: Y = !0,
|
|
124
|
-
showLabel:
|
|
125
|
-
isMobile:
|
|
124
|
+
showLabel: U = !1,
|
|
125
|
+
isMobile: q = !1,
|
|
126
126
|
loading: Z = !1,
|
|
127
|
-
shouldBeActive:
|
|
127
|
+
shouldBeActive: N = !1
|
|
128
128
|
// True when parent fields are selected and this field tried to load
|
|
129
129
|
}) {
|
|
130
|
-
const [
|
|
131
|
-
S(s), g(""), !(s && s.value === (
|
|
132
|
-
},
|
|
133
|
-
s.preventDefault(), s.stopPropagation(), g(""), S(null),
|
|
130
|
+
const [he, g] = j(""), [z, S] = j(d || null), fe = (s) => {
|
|
131
|
+
S(s), g(""), !(s && s.value === (d == null ? void 0 : d.value)) && K(s);
|
|
132
|
+
}, le = (s) => {
|
|
133
|
+
s.preventDefault(), s.stopPropagation(), g(""), S(null), K("");
|
|
134
134
|
};
|
|
135
|
-
|
|
136
|
-
g(""), S(
|
|
137
|
-
}, [
|
|
138
|
-
let
|
|
139
|
-
|
|
140
|
-
String(s.value).split(/,(?![^(]*\))/).forEach((
|
|
141
|
-
|
|
135
|
+
B(() => {
|
|
136
|
+
g(""), S(d || null);
|
|
137
|
+
}, [d, f]);
|
|
138
|
+
let ce = /* @__PURE__ */ new Set(), w = [];
|
|
139
|
+
f && (f.forEach((s) => {
|
|
140
|
+
String(s.value).split(/,(?![^(]*\))/).forEach((E) => {
|
|
141
|
+
E = E.trim(), E && Ut(he, E.toLowerCase()) && !ce.has(E.toLowerCase()) && (ce.add(E.toLowerCase()), w.push({
|
|
142
142
|
...s,
|
|
143
|
-
value:
|
|
143
|
+
value: E,
|
|
144
144
|
refinement: s.value
|
|
145
145
|
}));
|
|
146
146
|
});
|
|
147
|
-
}), w.length === 0 && (w =
|
|
148
|
-
const
|
|
147
|
+
}), w.length === 0 && (w = f));
|
|
148
|
+
const L = w.filter((s) => s.popularity > 0).slice(0, 11);
|
|
149
149
|
Y && (w = w.filter(
|
|
150
|
-
(s) => !
|
|
150
|
+
(s) => !L.includes(s)
|
|
151
151
|
), w.sort(
|
|
152
152
|
(s, b) => s.value.localeCompare(b.value, "en", { numeric: !0 })
|
|
153
|
-
), w =
|
|
154
|
-
const
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
|
|
153
|
+
), w = L.concat(w));
|
|
154
|
+
const we = !w || w.length === 0;
|
|
155
|
+
return /* @__PURE__ */ P("div", { className: "vs:relative vs:flex vs:flex-col", children: [
|
|
156
|
+
U && /* @__PURE__ */ a(
|
|
157
157
|
"span",
|
|
158
158
|
{
|
|
159
159
|
className: `${X ? "vs:text-white" : "vs:text-black"} vs:mb-1 vs:block vs:text-(length:--partbot-font-size) vs:leading-[calc(var(--partbot-font-size)*1.5)] vs:font-medium vs:font-(family-name:--partbot-font-family)`,
|
|
160
|
-
children:
|
|
160
|
+
children: h
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */
|
|
163
|
+
q && /* @__PURE__ */ P("div", { className: "vs:relative vs:flex vs:flex-col", children: [
|
|
164
|
+
/* @__PURE__ */ P(
|
|
165
165
|
"select",
|
|
166
166
|
{
|
|
167
167
|
onChange: (s) => {
|
|
168
168
|
const b = w.find(
|
|
169
|
-
(
|
|
169
|
+
(E) => E.value.toString() === s.target.value.toString()
|
|
170
170
|
);
|
|
171
|
-
b &&
|
|
171
|
+
b && fe(b);
|
|
172
172
|
},
|
|
173
173
|
className: "vehicle-search-select vs:relative vs:w-full vs:cursor-default vs:overflow-hidden vs:rounded-(--partbot-button-border-radius) partbot-input-border vs:bg-white vs:py-(--partbot-padding) vs:pl-[calc(var(--partbot-padding)*1.3)] vs:pr-10 vs:text-left vs:shadow-(--partbot-input-shadow) vs:focus:border-[rgb(var(--partbot-theme))] vs:focus:outline-none vs:focus:ring-1 vs:focus:ring-[rgb(var(--partbot-theme))] vs:disabled:opacity-100! vs:disabled:text-stone-400! vs:sm:text-(length:--partbot-font-size) vs:font-(family-name:--partbot-font-family) vs:text-(length:--partbot-font-size) vs:leading-[calc(var(--partbot-font-size)*1.5)]",
|
|
174
174
|
tabIndex: -1,
|
|
175
175
|
disabled: !(w && w.length),
|
|
176
|
-
value:
|
|
176
|
+
value: z ? z.value : "",
|
|
177
177
|
children: [
|
|
178
|
-
/* @__PURE__ */ a("option", { value: "", disabled: !0, children:
|
|
179
|
-
|
|
180
|
-
/* @__PURE__ */ a("optgroup", { label: `Popular ${ft(
|
|
181
|
-
/* @__PURE__ */ a("optgroup", { label: `All ${ft(
|
|
182
|
-
(s) => !
|
|
178
|
+
/* @__PURE__ */ a("option", { value: "", disabled: !0, children: h }),
|
|
179
|
+
L.length > 0 ? /* @__PURE__ */ P(Re, { children: [
|
|
180
|
+
/* @__PURE__ */ a("optgroup", { label: `Popular ${ft(h)}`, children: L.map((s) => /* @__PURE__ */ a("option", { value: s.refinement, children: s.value }, s.value)) }),
|
|
181
|
+
/* @__PURE__ */ a("optgroup", { label: `All ${ft(h)}`, children: w.filter(
|
|
182
|
+
(s) => !L.some(
|
|
183
183
|
(b) => b.value === s.value
|
|
184
184
|
)
|
|
185
185
|
).map((s) => /* @__PURE__ */ a("option", { value: s.refinement, children: s.value }, s.value)) })
|
|
@@ -187,11 +187,11 @@ function oe({
|
|
|
187
187
|
]
|
|
188
188
|
}
|
|
189
189
|
),
|
|
190
|
-
Z && /* @__PURE__ */ a("div", { className: "vs:absolute vs:inset-y-0 vs:right-[calc(var(--partbot-font-size)*1.95)] vs:items-center vs:pr-(--partbot-padding) vs:text-[rgb(var(--partbot-theme))]! vs:pointer-events-none vs:flex vs:justify-center", children: /* @__PURE__ */ a(
|
|
191
|
-
!Z && (
|
|
190
|
+
Z && /* @__PURE__ */ a("div", { className: "vs:absolute vs:inset-y-0 vs:right-[calc(var(--partbot-font-size)*1.95)] vs:items-center vs:pr-(--partbot-padding) vs:text-[rgb(var(--partbot-theme))]! vs:pointer-events-none vs:flex vs:justify-center", children: /* @__PURE__ */ a(Ge, { className: "vs:h-[calc(var(--partbot-font-size)*0.9)]! vs:w-[calc(var(--partbot-font-size)*0.9)]! vs:animate-spin vs:text-[rgb(var(--partbot-theme))]!" }) }),
|
|
191
|
+
!Z && (z == null ? void 0 : z.value) && /* @__PURE__ */ a(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
|
-
onClick:
|
|
194
|
+
onClick: le,
|
|
195
195
|
tabIndex: -1,
|
|
196
196
|
className: "vs:absolute vs:inset-y-0 vs:right-[calc(var(--partbot-font-size)*1.95)] vs:items-center vs:pr-(--partbot-padding) vs:text-red-300 vs:hover:text-red-500 vs:bg-transparent vs:border-none vs:outline-none vs:p-(--partbot-padding) vs:text-(length:--partbot-font-size) vs:leading-[calc(var(--partbot-font-size)*1.5)] vs:font-medium vs:transition vs:pointer-events-auto vs:flex vs:justify-center",
|
|
197
197
|
children: /* @__PURE__ */ a(
|
|
@@ -209,33 +209,33 @@ function oe({
|
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] }),
|
|
212
|
-
!
|
|
212
|
+
!q && /* @__PURE__ */ P(
|
|
213
213
|
Lt,
|
|
214
214
|
{
|
|
215
|
-
value:
|
|
216
|
-
onChange:
|
|
215
|
+
value: z || null,
|
|
216
|
+
onChange: fe,
|
|
217
217
|
virtual: { options: w },
|
|
218
|
-
disabled:
|
|
218
|
+
disabled: we,
|
|
219
219
|
immediate: !0,
|
|
220
220
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ P("div", { className: "vs:flex vs:h-full", children: [
|
|
222
222
|
/* @__PURE__ */ a(
|
|
223
223
|
Vt,
|
|
224
224
|
{
|
|
225
225
|
autoComplete: "off",
|
|
226
226
|
spellCheck: "false",
|
|
227
|
-
placeholder:
|
|
227
|
+
placeholder: we && N && !Z ? "N/A" : h,
|
|
228
228
|
className: "vs:w-full vs:cursor-default vs:rounded-(--partbot-button-border-radius) partbot-input-border vs:bg-white vs:py-(--partbot-padding) vs:pl-[calc(var(--partbot-padding)*1.3)] vs:pr-10 vs:text-left vs:shadow-(--partbot-input-shadow) vs:focus:border-[rgb(var(--partbot-theme))] vs:focus:outline-none vs:focus:ring-1 vs:focus:ring-[rgb(var(--partbot-theme))] vs:text-(length:--partbot-font-size) vs:leading-[calc(var(--partbot-font-size)*1.5)] vs:font-(family-name:--partbot-font-family) vs:text-stone-900 vs:placeholder:text-stone-600 vs:disabled:placeholder:text-stone-400 vs:disabled:cursor-not-allowed",
|
|
229
229
|
displayValue: (s) => (s == null ? void 0 : s.value) || "",
|
|
230
230
|
onChange: (s) => g(s.target.value),
|
|
231
|
-
title:
|
|
231
|
+
title: h
|
|
232
232
|
}
|
|
233
233
|
),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
(
|
|
234
|
+
/* @__PURE__ */ P("div", { className: "vs:absolute vs:pointer-events-none vs:h-full vs:right-0 vs:flex vs:space-x-[calc(var(--partbot-padding)*0.25)] vs:items-center", children: [
|
|
235
|
+
(z == null ? void 0 : z.value) && /* @__PURE__ */ a(
|
|
236
236
|
"button",
|
|
237
237
|
{
|
|
238
|
-
onClick:
|
|
238
|
+
onClick: le,
|
|
239
239
|
tabIndex: -1,
|
|
240
240
|
className: "vs:inset-y-0 vs:pr-2 vs:text-red-300 vs:hover:text-red-500 vs:bg-transparent vs:border-none vs:outline-none vs:p-2 vs:text-(length:--partbot-font-size) vs:leading-[calc(var(--partbot-font-size)*1.5)] vs:font-medium vs:transition vs:pointer-events-auto vs:flex vs:items-center vs:justify-center vs:cursor-pointer",
|
|
241
241
|
children: /* @__PURE__ */ a(
|
|
@@ -252,7 +252,7 @@ function oe({
|
|
|
252
252
|
)
|
|
253
253
|
}
|
|
254
254
|
),
|
|
255
|
-
/* @__PURE__ */ a(Dt, { className: "vs:inset-y-0 vs:flex vs:items-center vs:pr-[calc(var(--partbot-padding)*1.3)] vs:pointer-events-auto vs:bg-transparent vs:border-none vs:outline-none", children: Z ? /* @__PURE__ */ a(
|
|
255
|
+
/* @__PURE__ */ a(Dt, { className: "vs:inset-y-0 vs:flex vs:items-center vs:pr-[calc(var(--partbot-padding)*1.3)] vs:pointer-events-auto vs:bg-transparent vs:border-none vs:outline-none", children: Z ? /* @__PURE__ */ a(Ge, { className: "vs:h-[calc(var(--partbot-font-size)*0.9)]! vs:w-[calc(var(--partbot-font-size)*0.9)]! vs:text-stone-400 vs:animate-spin" }) : /* @__PURE__ */ a(
|
|
256
256
|
"svg",
|
|
257
257
|
{
|
|
258
258
|
className: "vs:h-[calc(var(--partbot-font-size)*0.9)]! vs:w-[calc(var(--partbot-font-size)*0.9)]! vs:text-stone-400",
|
|
@@ -273,33 +273,33 @@ function oe({
|
|
|
273
273
|
anchor: "bottom start",
|
|
274
274
|
className: "vs:w-(--input-width) vs:z-99999! vs:max-h-60! vs:overflow-auto vs:rounded-[min(var(--partbot-button-border-radius),0.89rem)] vs:bg-white vs:py-1 vs:text-base vs:shadow-lg vs:ring-1 vs:ring-stone-200 vs:focus:outline-none vs:sm:text-(length:--partbot-font-size) empty:vs:invisible vs:mt-2",
|
|
275
275
|
children: ({ option: s }) => {
|
|
276
|
-
const b = s &&
|
|
277
|
-
(
|
|
276
|
+
const b = s && L.some(
|
|
277
|
+
(E) => E.value === s.value
|
|
278
278
|
);
|
|
279
279
|
return /* @__PURE__ */ a(
|
|
280
280
|
Ot,
|
|
281
281
|
{
|
|
282
282
|
value: s,
|
|
283
|
-
className: ({ focus:
|
|
283
|
+
className: ({ focus: E }) => ge(
|
|
284
284
|
"vs:group vs:relative vs:w-full vs:cursor-default vs:py-(--partbot-padding) vs:px-[calc(var(--partbot-padding)*1.3)] vs:text-left vs:border-none",
|
|
285
|
-
|
|
285
|
+
E ? "vs:bg-[rgb(var(--partbot-theme))] vs:text-[rgb(var(--partbot-button-label-color))]" : "vs:bg-white vs:text-stone-900 vs:hover:bg-theme vs:hover:text-button-label",
|
|
286
286
|
b && "vs:font-bold!"
|
|
287
287
|
),
|
|
288
|
-
children: ({ selected:
|
|
288
|
+
children: ({ selected: E }) => /* @__PURE__ */ P("div", { className: "vs:flex vs:w-full vs:items-center vs:justify-between", children: [
|
|
289
289
|
/* @__PURE__ */ a(
|
|
290
290
|
"span",
|
|
291
291
|
{
|
|
292
|
-
className:
|
|
293
|
-
s.value === (
|
|
292
|
+
className: ge(
|
|
293
|
+
s.value === (d == null ? void 0 : d.value) ? "vs:font-semibold" : "vs:font-normal",
|
|
294
294
|
"vs:block vs:font-(family-name:--partbot-font-family) vs:whitespace-pre-wrap vs:text-left vs:text-(length:--partbot-font-size) vs:leading-none"
|
|
295
295
|
),
|
|
296
296
|
children: s.value
|
|
297
297
|
}
|
|
298
298
|
),
|
|
299
|
-
s.value === (
|
|
299
|
+
s.value === (d == null ? void 0 : d.value) && /* @__PURE__ */ a(
|
|
300
300
|
"span",
|
|
301
301
|
{
|
|
302
|
-
className:
|
|
302
|
+
className: ge(
|
|
303
303
|
"vs:text-[rgb(var(--partbot-theme))]",
|
|
304
304
|
"vs:flex vs:items-center group-vs:hover:text-white"
|
|
305
305
|
),
|
|
@@ -328,71 +328,75 @@ function oe({
|
|
|
328
328
|
)
|
|
329
329
|
] });
|
|
330
330
|
}
|
|
331
|
-
const Ht = "3.0.
|
|
331
|
+
const Ht = "3.0.44";
|
|
332
332
|
console.info(
|
|
333
333
|
`Vehicle Search v${Ht} powered by Partbot https://mmyvs.partbot.io`
|
|
334
334
|
);
|
|
335
|
-
function
|
|
336
|
-
const
|
|
337
|
-
return
|
|
338
|
-
const [
|
|
335
|
+
function Te(h = [], f = []) {
|
|
336
|
+
const d = [];
|
|
337
|
+
return h.forEach((K) => {
|
|
338
|
+
const [I, ...X] = K.split(":"), Y = X.join(":");
|
|
339
339
|
if (Y.includes(" > ")) {
|
|
340
|
-
const
|
|
341
|
-
if (
|
|
342
|
-
const Z =
|
|
343
|
-
|
|
340
|
+
const U = Y.split(" > "), q = U[U.length - 1].trim();
|
|
341
|
+
if (I !== "make" && U.length >= 2) {
|
|
342
|
+
const Z = U[0].trim();
|
|
343
|
+
d.push(`make = "${Z}"`);
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
d.push(`${I} = "${q}"`);
|
|
346
346
|
} else
|
|
347
|
-
|
|
348
|
-
}),
|
|
349
|
-
|
|
350
|
-
}),
|
|
347
|
+
d.push(`${I} = "${Y}"`);
|
|
348
|
+
}), f.forEach((K) => {
|
|
349
|
+
d.push(K);
|
|
350
|
+
}), d.length > 0 ? d.join(" AND ") : null;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
return String(
|
|
352
|
+
function F(h) {
|
|
353
|
+
return String(h || "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toUpperCase().trim().replace(/\s+/g, " ");
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
return String(
|
|
355
|
+
function ke(h) {
|
|
356
|
+
return String(h || "").split(">").pop().trim();
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
return !
|
|
360
|
-
(
|
|
361
|
-
) ?
|
|
362
|
-
(
|
|
358
|
+
function Xe(h, f, d) {
|
|
359
|
+
return !d || d.size === 0 || !Array.isArray(h) || !h.some(
|
|
360
|
+
(I) => d.has(F(f(I)))
|
|
361
|
+
) ? h : h.filter(
|
|
362
|
+
(I) => d.has(F(f(I)))
|
|
363
363
|
);
|
|
364
364
|
}
|
|
365
|
-
function Kt({
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
365
|
+
function Kt(h, f) {
|
|
366
|
+
const d = String(h || f).trim();
|
|
367
|
+
return d ? (/^https?:\/\//i.test(d) ? d : `https://${d}`).replace(/\/+$/, "") : "";
|
|
368
|
+
}
|
|
369
|
+
function qt({
|
|
370
|
+
apiKey: h,
|
|
371
|
+
makes: f = "",
|
|
372
|
+
models: d = "",
|
|
373
|
+
vehicleScopeTokens: K = "",
|
|
374
|
+
yearTokens: I = "",
|
|
371
375
|
callbackUrl: X = "",
|
|
372
376
|
layout: Y = "row",
|
|
373
|
-
fields:
|
|
374
|
-
fieldPrefix:
|
|
377
|
+
fields: U,
|
|
378
|
+
fieldPrefix: q = "",
|
|
375
379
|
showBranding: Z = !0,
|
|
376
|
-
showLabels:
|
|
377
|
-
mobileFullWidthButton:
|
|
380
|
+
showLabels: N = !1,
|
|
381
|
+
mobileFullWidthButton: he = !0,
|
|
378
382
|
mobileDrawer: g = !0,
|
|
379
|
-
modifyQueryString:
|
|
383
|
+
modifyQueryString: z = !0,
|
|
380
384
|
onChange: S,
|
|
381
|
-
buttonLabel:
|
|
382
|
-
showButton:
|
|
383
|
-
onSubmit:
|
|
385
|
+
buttonLabel: fe = "Search",
|
|
386
|
+
showButton: le = !0,
|
|
387
|
+
onSubmit: ce,
|
|
384
388
|
store: w,
|
|
385
|
-
useStoreVehicles:
|
|
386
|
-
fieldOrder:
|
|
389
|
+
useStoreVehicles: L = !0,
|
|
390
|
+
fieldOrder: we = "MMY",
|
|
387
391
|
// "MMY" (Make→Model→Year) or "YMM" (Year→Make→Model)
|
|
388
392
|
enableFeatureFlags: s = !0,
|
|
389
393
|
// Use api.cartbot.io instead of api.partbot.io
|
|
390
394
|
yearOptional: b = !1,
|
|
391
395
|
// Make year selection optional, only requiring make + model
|
|
392
|
-
mobileButtonLabel:
|
|
396
|
+
mobileButtonLabel: E = "Select Vehicle"
|
|
393
397
|
// Label for mobile drawer trigger button
|
|
394
398
|
}) {
|
|
395
|
-
const
|
|
399
|
+
const Ce = J(null), _e = J(null), ye = J(null), y = J(null), V = J(null), te = J(null), re = J(null), C = J(null), ze = J(null), T = J(!1), M = we === "YMM", [je, Ye] = j([]), [Ne, de] = j([]), [xe, Me] = j([]), [et, Be] = j([]), [tt, Pe] = j([]), [rt, Ie] = j([]), [ot, Le] = j([]), [at, Ve] = j([]), bt = J([]), [be, Se] = j([]), [e, Q] = j({
|
|
396
400
|
make: null,
|
|
397
401
|
model: null,
|
|
398
402
|
year: null,
|
|
@@ -401,43 +405,45 @@ function Kt({
|
|
|
401
405
|
variant: null,
|
|
402
406
|
engine: null,
|
|
403
407
|
engine_capacity: null
|
|
404
|
-
}), [wt,
|
|
408
|
+
}), [wt, Ze] = j(!1), nt = J([
|
|
405
409
|
"body",
|
|
406
410
|
"series",
|
|
407
411
|
"variant",
|
|
408
412
|
"engine",
|
|
409
413
|
"engine_capacity"
|
|
410
|
-
]),
|
|
411
|
-
|
|
414
|
+
]), De = J(
|
|
415
|
+
U && U.length && nt.current ? U.split(",").filter((t) => {
|
|
412
416
|
var r;
|
|
413
|
-
return (r =
|
|
417
|
+
return (r = nt.current) == null ? void 0 : r.includes(t);
|
|
414
418
|
}) : null
|
|
415
|
-
), [
|
|
416
|
-
|
|
417
|
-
), [
|
|
419
|
+
), [it, $e] = j({}), ie = We(() => !f || typeof f != "string" ? /* @__PURE__ */ new Set() : new Set(
|
|
420
|
+
f.trim().split(",").map((t) => F(t)).filter(Boolean)
|
|
421
|
+
), [f]), pe = We(
|
|
418
422
|
() => new Set(
|
|
419
|
-
Object.keys(
|
|
420
|
-
(t) =>
|
|
423
|
+
Object.keys(it || {}).map(
|
|
424
|
+
(t) => F(t)
|
|
421
425
|
)
|
|
422
426
|
),
|
|
423
|
-
[
|
|
424
|
-
), [
|
|
425
|
-
|
|
427
|
+
[it]
|
|
428
|
+
), [oe, yt] = j(!1);
|
|
429
|
+
B(() => {
|
|
426
430
|
const t = navigator.userAgent;
|
|
427
431
|
yt(
|
|
428
432
|
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
429
433
|
t
|
|
430
434
|
)
|
|
431
|
-
),
|
|
432
|
-
api_host: "https://
|
|
435
|
+
), Je.__loaded || Je.init("phc_mLZkVvweXDfwCPYS7kSCxoAxgQUkw8fgyDiplKnleGw", {
|
|
436
|
+
api_host: "https://t.partbot.io",
|
|
437
|
+
ui_host: "https://us.posthog.com",
|
|
438
|
+
defaults: "2026-01-30",
|
|
433
439
|
autocapture: !1,
|
|
434
440
|
capture_pageview: !1,
|
|
435
441
|
capture_pageleave: !1,
|
|
436
442
|
disable_session_recording: !1
|
|
437
443
|
});
|
|
438
444
|
}, []);
|
|
439
|
-
const [
|
|
440
|
-
if (!
|
|
445
|
+
const [ve, xt] = j({}), [Xt, kt] = j(""), st = D(async () => {
|
|
446
|
+
if (!h)
|
|
441
447
|
return;
|
|
442
448
|
const r = `${s ? "https://api.cartbot.io" : "https://api.partbot.io"}/v1/vehicles/auth`;
|
|
443
449
|
try {
|
|
@@ -445,12 +451,12 @@ function Kt({
|
|
|
445
451
|
method: "POST",
|
|
446
452
|
headers: {
|
|
447
453
|
"Content-Type": "application/json",
|
|
448
|
-
Authorization: `Bearer ${
|
|
454
|
+
Authorization: `Bearer ${h}`
|
|
449
455
|
},
|
|
450
456
|
body: JSON.stringify(
|
|
451
457
|
(() => {
|
|
452
|
-
const
|
|
453
|
-
return w && (
|
|
458
|
+
const u = { use_store_vehicles: L };
|
|
459
|
+
return w && (u.store = w), u;
|
|
454
460
|
})()
|
|
455
461
|
)
|
|
456
462
|
});
|
|
@@ -458,73 +464,83 @@ function Kt({
|
|
|
458
464
|
throw new Error(`Error: ${n.status} ${n.statusText}`);
|
|
459
465
|
const {
|
|
460
466
|
merchant: o,
|
|
461
|
-
vehicle_makes:
|
|
467
|
+
vehicle_makes: p,
|
|
462
468
|
vehicle_models: i,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
469
|
+
host: v,
|
|
470
|
+
search_key: l,
|
|
471
|
+
vehicle_index_name: c,
|
|
472
|
+
index_name: $,
|
|
473
|
+
meilisearch_search_key: A,
|
|
474
|
+
meilisearch_index_name: m,
|
|
475
|
+
algolia_search_key: x,
|
|
466
476
|
// Fallback for backward compatibility
|
|
467
|
-
algolia_index_name:
|
|
477
|
+
algolia_index_name: _,
|
|
468
478
|
// Fallback for backward compatibility
|
|
469
|
-
store_index_name:
|
|
470
|
-
store_popular_makes:
|
|
479
|
+
store_index_name: W,
|
|
480
|
+
store_popular_makes: k,
|
|
471
481
|
// Array of popular make values for this store (from PostHog)
|
|
472
|
-
store_popular_models:
|
|
482
|
+
store_popular_models: R
|
|
473
483
|
// Object mapping makes to popular models: { "TOYOTA": ["HILUX", "LANDCRUISER"], ... }
|
|
474
|
-
} = await n.json(),
|
|
475
|
-
|
|
476
|
-
...
|
|
477
|
-
refinement:
|
|
478
|
-
})),
|
|
479
|
-
|
|
480
|
-
|
|
484
|
+
} = await n.json(), ae = p || [], ee = i;
|
|
485
|
+
_e.current = o, ye.current = ae.map((u) => ({
|
|
486
|
+
...u,
|
|
487
|
+
refinement: u.value
|
|
488
|
+
})), L && ee ? typeof ee == "object" && !Array.isArray(ee) ? (y.current = ee, $e(ee)) : Array.isArray(ee) ? (y.current = ee.map((u) => u && u.value ? String(u.value).trim() : "").filter(Boolean), $e({})) : (y.current = [], $e({})) : (y.current = [], $e({})), V.current = Array.isArray(k) ? k.map((u) => String(u).trim().toUpperCase()) : null, te.current = R || null;
|
|
489
|
+
const se = l || A || x || "eeace38b64f52bf56ebb4fe8bd5837b3cd6c0ff9d7e272f76449d94b80cba86b", Oe = c || $ || m || _ || "otto_v1_vehicles_production", Ue = Kt(
|
|
490
|
+
v,
|
|
491
|
+
"https://search.partbot.io"
|
|
492
|
+
);
|
|
493
|
+
xt({
|
|
494
|
+
host: Ue,
|
|
495
|
+
searchKey: se,
|
|
496
|
+
indexName: Oe
|
|
481
497
|
});
|
|
482
498
|
} catch (n) {
|
|
483
|
-
console.error("[VehicleSearch] Auth failed:", n), kt(n),
|
|
499
|
+
console.error("[VehicleSearch] Auth failed:", n), kt(n), $e({});
|
|
484
500
|
}
|
|
485
|
-
}, [
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}, [
|
|
489
|
-
if (
|
|
501
|
+
}, [h, w, L, s]);
|
|
502
|
+
B(() => {
|
|
503
|
+
st();
|
|
504
|
+
}, [st]), B(() => {
|
|
505
|
+
if (ve.searchKey) {
|
|
490
506
|
try {
|
|
491
|
-
|
|
492
|
-
host: "https://search.partbot.io",
|
|
493
|
-
apiKey:
|
|
494
|
-
}), C.current =
|
|
507
|
+
re.current = new mt({
|
|
508
|
+
host: ve.host || "https://search.partbot.io",
|
|
509
|
+
apiKey: ve.searchKey
|
|
510
|
+
}), C.current = re.current.index(ve.indexName);
|
|
495
511
|
const t = new mt({
|
|
496
512
|
host: "https://partbot-meilisearch-cache.partbot.workers.dev",
|
|
497
513
|
// Cloudflare Worker endpoint
|
|
498
|
-
apiKey:
|
|
514
|
+
apiKey: ve.searchKey
|
|
499
515
|
});
|
|
500
|
-
|
|
516
|
+
ze.current = t.index("otto_v1_vehicle_mmy");
|
|
501
517
|
} catch (t) {
|
|
502
518
|
console.error("[VehicleSearch] Failed to initialize Meilisearch:", t);
|
|
503
519
|
}
|
|
504
520
|
return () => {
|
|
505
|
-
|
|
521
|
+
re.current = null;
|
|
506
522
|
};
|
|
507
523
|
}
|
|
508
|
-
}, [
|
|
509
|
-
const [G, Ct] =
|
|
524
|
+
}, [ve.searchKey, h]);
|
|
525
|
+
const [G, Ct] = j(!1), lt = D(() => {
|
|
510
526
|
function t(i) {
|
|
511
527
|
if (!i) return "rgba(0,0,0,1)";
|
|
512
|
-
var
|
|
513
|
-
return l !==
|
|
528
|
+
var v = r(), l = window.getComputedStyle(i).backgroundColor;
|
|
529
|
+
return l !== v ? l : i.parentElement ? t(i.parentElement) : "rgba(255,255,255,1)";
|
|
514
530
|
}
|
|
515
531
|
function r() {
|
|
516
532
|
var i = document.createElement("div");
|
|
517
533
|
document.head.appendChild(i);
|
|
518
|
-
var
|
|
519
|
-
return document.head.removeChild(i),
|
|
534
|
+
var v = window.getComputedStyle(i).backgroundColor;
|
|
535
|
+
return document.head.removeChild(i), v;
|
|
520
536
|
}
|
|
521
537
|
const n = document.querySelector("vehicle-search");
|
|
522
538
|
let o;
|
|
523
|
-
n ? o = t(n) : o = t(
|
|
524
|
-
const
|
|
525
|
-
Ct(
|
|
539
|
+
n ? o = t(n) : o = t(Ce.current);
|
|
540
|
+
const p = Rt(o).isDark();
|
|
541
|
+
Ct(p);
|
|
526
542
|
}, []);
|
|
527
|
-
|
|
543
|
+
B(() => {
|
|
528
544
|
async function t() {
|
|
529
545
|
if (!e.make || !C.current)
|
|
530
546
|
return;
|
|
@@ -539,24 +555,24 @@ function Kt({
|
|
|
539
555
|
), e.series && r.push(`series:${e.series.refinement}`), e.engine && r.push(`engine:${e.engine.refinement}`), e.engine_capacity && r.push(
|
|
540
556
|
`engine_capacity:${e.engine_capacity.refinement}`
|
|
541
557
|
);
|
|
542
|
-
let
|
|
543
|
-
filter:
|
|
558
|
+
let p = (await C.current.search("", {
|
|
559
|
+
filter: Te(r, n),
|
|
544
560
|
attributesToRetrieve: ["otto_id"],
|
|
545
561
|
limit: 500
|
|
546
562
|
// Reduced from 1000 for faster queries
|
|
547
563
|
})).hits.map((l) => l.otto_id);
|
|
548
|
-
|
|
549
|
-
let
|
|
564
|
+
Se(p);
|
|
565
|
+
let v = {
|
|
550
566
|
...Object.fromEntries(
|
|
551
567
|
Object.entries(e || {}).map(([l, c]) => [l, c && c.value || null]).filter(([l, c]) => c !== null)
|
|
552
568
|
),
|
|
553
|
-
merchant:
|
|
569
|
+
merchant: _e.current
|
|
554
570
|
};
|
|
555
|
-
|
|
571
|
+
Je.capture("vehicle select", v);
|
|
556
572
|
}
|
|
557
573
|
t();
|
|
558
574
|
}, [e, C, b]);
|
|
559
|
-
const
|
|
575
|
+
const He = (t) => q ? `${q}${t}` : t, _t = (t) => q ? t.replace(new RegExp(`^${q}`), "") : t, ct = D(() => {
|
|
560
576
|
const t = new URL(window.location.href).searchParams, r = [
|
|
561
577
|
"make",
|
|
562
578
|
"model",
|
|
@@ -565,9 +581,9 @@ function Kt({
|
|
|
565
581
|
"series",
|
|
566
582
|
"engine",
|
|
567
583
|
"engine_capacity"
|
|
568
|
-
], n = r.map(
|
|
584
|
+
], n = r.map(He), o = {}, p = /^filter\.p\.m\.app--\d+--partbot\.vehicle_(\w+)$/;
|
|
569
585
|
for (const [l, c] of t.entries()) {
|
|
570
|
-
const $ = l.match(
|
|
586
|
+
const $ = l.match(p);
|
|
571
587
|
if ($) {
|
|
572
588
|
const A = $[1];
|
|
573
589
|
if (A === "year_tokens" && c) {
|
|
@@ -578,8 +594,8 @@ function Kt({
|
|
|
578
594
|
}
|
|
579
595
|
continue;
|
|
580
596
|
}
|
|
581
|
-
let
|
|
582
|
-
|
|
597
|
+
let m = A.replace(/s$/, "");
|
|
598
|
+
m === "engine_capacitie" && (m = "engine_capacity"), m === "bodie" && (m = "body"), m === "serie" && (m = "series"), r.includes(m) && (o[m] = c);
|
|
583
599
|
}
|
|
584
600
|
}
|
|
585
601
|
const i = Object.fromEntries(
|
|
@@ -607,96 +623,96 @@ function Kt({
|
|
|
607
623
|
if (c != null && c.vehicle) {
|
|
608
624
|
const $ = c.vehicle;
|
|
609
625
|
for (const A of r) {
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
if (A === "year" && /^\d{4}$/.test(
|
|
613
|
-
const x = parseInt(
|
|
626
|
+
const m = $[A];
|
|
627
|
+
if (m && typeof m == "string" && m.trim())
|
|
628
|
+
if (A === "year" && /^\d{4}$/.test(m)) {
|
|
629
|
+
const x = parseInt(m, 10);
|
|
614
630
|
i[A] = {
|
|
615
631
|
value: x,
|
|
616
632
|
refinement: x
|
|
617
633
|
};
|
|
618
634
|
} else
|
|
619
|
-
i[A] = { value:
|
|
620
|
-
else if (
|
|
621
|
-
if (A === "year" && /^\d{4}$/.test(
|
|
622
|
-
const x = parseInt(
|
|
635
|
+
i[A] = { value: m, refinement: m };
|
|
636
|
+
else if (m != null && m.value && typeof m.value == "string")
|
|
637
|
+
if (A === "year" && /^\d{4}$/.test(m.value)) {
|
|
638
|
+
const x = parseInt(m.value, 10);
|
|
623
639
|
i[A] = {
|
|
624
640
|
value: x,
|
|
625
641
|
refinement: x
|
|
626
642
|
};
|
|
627
643
|
} else
|
|
628
644
|
i[A] = {
|
|
629
|
-
value:
|
|
630
|
-
refinement:
|
|
645
|
+
value: m.value,
|
|
646
|
+
refinement: m.value
|
|
631
647
|
};
|
|
632
648
|
}
|
|
633
649
|
}
|
|
634
650
|
}
|
|
635
651
|
} catch {
|
|
636
652
|
}
|
|
637
|
-
|
|
638
|
-
}, []),
|
|
639
|
-
if (
|
|
653
|
+
Q(i);
|
|
654
|
+
}, []), O = D(({ query: t, value: r, remove: n }) => {
|
|
655
|
+
if (z && "URLSearchParams" in window) {
|
|
640
656
|
let o = new URLSearchParams(window.location.search);
|
|
641
|
-
t =
|
|
642
|
-
i =
|
|
657
|
+
t = He(t), t && r && o.set(t, r), t && !r && o.delete(t), n && n.forEach((i) => {
|
|
658
|
+
i = He(i), o.delete(i);
|
|
643
659
|
});
|
|
644
|
-
const
|
|
645
|
-
window.history.pushState(null, "",
|
|
660
|
+
const p = window.location.pathname + "?" + o.toString();
|
|
661
|
+
window.history.pushState(null, "", p);
|
|
646
662
|
}
|
|
647
|
-
}, []),
|
|
663
|
+
}, []), zt = D(() => {
|
|
648
664
|
var n;
|
|
649
665
|
const t = {
|
|
650
|
-
vehicle_ids:
|
|
666
|
+
vehicle_ids: be,
|
|
651
667
|
vehicle: (n = e == null ? void 0 : e.make) != null && n.value ? e : {}
|
|
652
668
|
};
|
|
653
|
-
|
|
669
|
+
ce && ce(t);
|
|
654
670
|
const r = new CustomEvent("vehicle-search-submit", {
|
|
655
671
|
detail: t
|
|
656
672
|
});
|
|
657
673
|
window.dispatchEvent(r), document.dispatchEvent(r), setTimeout(() => {
|
|
658
|
-
|
|
674
|
+
Ze(!1);
|
|
659
675
|
}, 900);
|
|
660
|
-
}, [
|
|
661
|
-
var n, o,
|
|
676
|
+
}, [be, ce]), dt = D(() => {
|
|
677
|
+
var n, o, p, i, v, l, c, $, A;
|
|
662
678
|
const t = {
|
|
663
|
-
vehicle_ids:
|
|
679
|
+
vehicle_ids: be,
|
|
664
680
|
vehicle: (n = e == null ? void 0 : e.make) != null && n.value ? e : {},
|
|
665
|
-
userSelected:
|
|
681
|
+
userSelected: T.current
|
|
666
682
|
// Flag to indicate if user actively selected
|
|
667
683
|
};
|
|
668
684
|
S && S(t);
|
|
669
685
|
const r = new CustomEvent("vehicle-search-change", {
|
|
670
686
|
detail: t
|
|
671
687
|
});
|
|
672
|
-
if (
|
|
688
|
+
if (T.current === !0) {
|
|
673
689
|
localStorage.removeItem("partbot_plate_details");
|
|
674
|
-
const
|
|
675
|
-
description: `${((o = e.make) == null ? void 0 : o.value) || ""} ${((
|
|
676
|
-
vehicle_ids:
|
|
677
|
-
vehicle: e ? Object.entries(e).reduce((x, [_,
|
|
690
|
+
const m = JSON.stringify({
|
|
691
|
+
description: `${((o = e.make) == null ? void 0 : o.value) || ""} ${((p = e.model) == null ? void 0 : p.value) || ""} ${((i = e.year) == null ? void 0 : i.value) || ""} ${((v = e.body) == null ? void 0 : v.value) || ""} ${((l = e.series) == null ? void 0 : l.value) || ""} ${((c = e.variant) == null ? void 0 : c.value) || ""} ${(($ = e.engine) == null ? void 0 : $.value) || ""} ${((A = e.engine_capacity) == null ? void 0 : A.value) || ""}`.trim(),
|
|
692
|
+
vehicle_ids: be,
|
|
693
|
+
vehicle: e ? Object.entries(e).reduce((x, [_, W]) => (x[_] = W != null && W.value ? W.value : {}, x), {}) : {}
|
|
678
694
|
});
|
|
679
695
|
localStorage.setItem(
|
|
680
696
|
"partbot_selected_vehicle",
|
|
681
|
-
|
|
682
|
-
), It.set("partbot_selected_vehicle",
|
|
697
|
+
m
|
|
698
|
+
), It.set("partbot_selected_vehicle", m, {
|
|
683
699
|
secure: !0
|
|
684
700
|
});
|
|
685
701
|
}
|
|
686
|
-
window.dispatchEvent(r),
|
|
687
|
-
|
|
702
|
+
window.dispatchEvent(r), T.current && document.dispatchEvent(r), bt.current = be, setTimeout(() => {
|
|
703
|
+
Ze(!1);
|
|
688
704
|
}, 900);
|
|
689
|
-
}, [
|
|
690
|
-
() => Tt(
|
|
691
|
-
[
|
|
705
|
+
}, [be, S]), me = We(
|
|
706
|
+
() => Tt(dt, 100),
|
|
707
|
+
[dt]
|
|
692
708
|
);
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}, [
|
|
696
|
-
|
|
697
|
-
}, [
|
|
709
|
+
B(() => {
|
|
710
|
+
me();
|
|
711
|
+
}, [be, me]), B(() => () => {
|
|
712
|
+
me.cancel();
|
|
713
|
+
}, [me]), B(() => {
|
|
698
714
|
const t = () => {
|
|
699
|
-
|
|
715
|
+
T.current = !1, me.cancel(), Q({
|
|
700
716
|
make: null,
|
|
701
717
|
model: null,
|
|
702
718
|
year: null,
|
|
@@ -705,7 +721,7 @@ function Kt({
|
|
|
705
721
|
variant: null,
|
|
706
722
|
engine: null,
|
|
707
723
|
engine_capacity: null
|
|
708
|
-
}),
|
|
724
|
+
}), Se([]);
|
|
709
725
|
};
|
|
710
726
|
return window.addEventListener("plate-search-change", t), () => {
|
|
711
727
|
window.removeEventListener(
|
|
@@ -713,9 +729,9 @@ function Kt({
|
|
|
713
729
|
t
|
|
714
730
|
);
|
|
715
731
|
};
|
|
716
|
-
}, [
|
|
732
|
+
}, [me]), B(() => {
|
|
717
733
|
const t = () => {
|
|
718
|
-
|
|
734
|
+
T.current = !1, me.cancel(), Q({
|
|
719
735
|
make: null,
|
|
720
736
|
model: null,
|
|
721
737
|
year: null,
|
|
@@ -724,38 +740,38 @@ function Kt({
|
|
|
724
740
|
variant: null,
|
|
725
741
|
engine: null,
|
|
726
742
|
engine_capacity: null
|
|
727
|
-
}),
|
|
743
|
+
}), Se([]);
|
|
728
744
|
};
|
|
729
745
|
return document.addEventListener("partbot-clear-vehicle", t), () => {
|
|
730
746
|
document.removeEventListener("partbot-clear-vehicle", t);
|
|
731
747
|
};
|
|
732
|
-
}, [
|
|
733
|
-
|
|
734
|
-
}, [
|
|
735
|
-
|
|
748
|
+
}, [me]), B(() => {
|
|
749
|
+
ve.searchKey && (M || jt(), ct());
|
|
750
|
+
}, [ve.searchKey, M, ct]), B(() => {
|
|
751
|
+
M && C.current && xe.length === 0 && !e.year && C.current.search("", {
|
|
736
752
|
attributesToRetrieve: ["year_from", "year_to"],
|
|
737
753
|
limit: 1e4
|
|
738
754
|
}).then(({ hits: t }) => {
|
|
739
|
-
const r = t.map((
|
|
740
|
-
{ length:
|
|
741
|
-
(
|
|
755
|
+
const r = t.map((v) => v.year_from).filter(Boolean), n = t.map((v) => v.year_to).filter(Boolean), o = Math.min(...r), p = Math.max(...n), i = Array.from(
|
|
756
|
+
{ length: p - o + 1 },
|
|
757
|
+
(v, l) => ({ value: o + l, refinement: o + l })
|
|
742
758
|
).reverse();
|
|
743
759
|
Me(i);
|
|
744
760
|
}).catch((t) => {
|
|
745
761
|
console.error("[VehicleSearch] Error loading year range:", t);
|
|
746
762
|
});
|
|
747
|
-
}, [
|
|
748
|
-
typeof document > "u" ||
|
|
749
|
-
}, [
|
|
750
|
-
const
|
|
763
|
+
}, [M, ve.searchKey, xe.length, e.year]), B(() => {
|
|
764
|
+
typeof document > "u" || lt();
|
|
765
|
+
}, [lt]);
|
|
766
|
+
const pt = D(
|
|
751
767
|
(t) => {
|
|
752
|
-
|
|
768
|
+
T.current = !0, de([]), !M && !b && Me([]), Be([]), Pe([]), Ie([]), Ve([]), Le([]), Q((r) => ({
|
|
753
769
|
make: t,
|
|
754
|
-
year:
|
|
755
|
-
})),
|
|
770
|
+
year: M || b ? r.year : null
|
|
771
|
+
})), O({
|
|
756
772
|
query: "make",
|
|
757
773
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
758
|
-
remove:
|
|
774
|
+
remove: M ? ["model", "body", "series", "engine", "variant", "engine_capacity"] : b ? [
|
|
759
775
|
"model",
|
|
760
776
|
"body",
|
|
761
777
|
"series",
|
|
@@ -771,25 +787,25 @@ function Kt({
|
|
|
771
787
|
"variant",
|
|
772
788
|
"engine_capacity"
|
|
773
789
|
]
|
|
774
|
-
}), t ||
|
|
790
|
+
}), t || Se([]);
|
|
775
791
|
},
|
|
776
|
-
[
|
|
777
|
-
),
|
|
792
|
+
[O, M, b]
|
|
793
|
+
), vt = D(
|
|
778
794
|
(t) => {
|
|
779
|
-
|
|
795
|
+
T.current = !0, Q((r) => ({
|
|
780
796
|
...r,
|
|
781
797
|
model: t !== "" ? t : null,
|
|
782
|
-
year:
|
|
798
|
+
year: M || b ? r.year : null,
|
|
783
799
|
// Preserve year in YMM mode or yearOptional mode
|
|
784
800
|
body: null,
|
|
785
801
|
series: null,
|
|
786
802
|
variant: null,
|
|
787
803
|
engine: null,
|
|
788
804
|
engine_capacity: null
|
|
789
|
-
})), !
|
|
805
|
+
})), !M && !b && Me([]), Be([]), Pe([]), Ie([]), Ve([]), Le([]), O({
|
|
790
806
|
query: "model",
|
|
791
807
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
792
|
-
remove:
|
|
808
|
+
remove: M ? ["body", "series", "engine", "variant", "engine_capacity"] : b ? ["body", "series", "engine", "variant", "engine_capacity"] : [
|
|
793
809
|
"year",
|
|
794
810
|
"body",
|
|
795
811
|
"series",
|
|
@@ -799,12 +815,12 @@ function Kt({
|
|
|
799
815
|
]
|
|
800
816
|
});
|
|
801
817
|
},
|
|
802
|
-
[
|
|
803
|
-
),
|
|
818
|
+
[O, M, b]
|
|
819
|
+
), ut = D(
|
|
804
820
|
(t) => {
|
|
805
|
-
|
|
821
|
+
T.current = !0, M ? (Ye([]), de([]), Q({
|
|
806
822
|
year: t !== "" ? t : null
|
|
807
|
-
}), (!t || t === "") && Me([])) :
|
|
823
|
+
}), (!t || t === "") && Me([])) : Q(b ? (r) => ({
|
|
808
824
|
...r,
|
|
809
825
|
year: t !== "" ? t : null
|
|
810
826
|
}) : (r) => ({
|
|
@@ -815,10 +831,10 @@ function Kt({
|
|
|
815
831
|
variant: null,
|
|
816
832
|
engine: null,
|
|
817
833
|
engine_capacity: null
|
|
818
|
-
})), b || (
|
|
834
|
+
})), b || (Be([]), Pe([]), Ie([]), Ve([]), Le([])), O({
|
|
819
835
|
query: "year",
|
|
820
836
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
821
|
-
remove:
|
|
837
|
+
remove: M ? [
|
|
822
838
|
"make",
|
|
823
839
|
"model",
|
|
824
840
|
"body",
|
|
@@ -827,67 +843,67 @@ function Kt({
|
|
|
827
843
|
"engine",
|
|
828
844
|
"engine_capacity"
|
|
829
845
|
] : b ? [] : ["body", "series", "variant", "engine", "engine_capacity"]
|
|
830
|
-
}), !b && (!t || t === "") &&
|
|
846
|
+
}), !b && (!t || t === "") && Se([]);
|
|
831
847
|
},
|
|
832
|
-
[
|
|
833
|
-
),
|
|
848
|
+
[O, M, b]
|
|
849
|
+
), Mt = D(
|
|
834
850
|
(t) => {
|
|
835
|
-
|
|
851
|
+
T.current = !0, Q((r) => ({
|
|
836
852
|
...r,
|
|
837
853
|
body: t !== "" ? t : null
|
|
838
|
-
})),
|
|
854
|
+
})), O({
|
|
839
855
|
query: "body",
|
|
840
856
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
841
857
|
});
|
|
842
858
|
},
|
|
843
|
-
[
|
|
844
|
-
), St =
|
|
859
|
+
[O]
|
|
860
|
+
), St = D(
|
|
845
861
|
(t) => {
|
|
846
|
-
|
|
862
|
+
T.current = !0, Q((r) => ({
|
|
847
863
|
...r,
|
|
848
864
|
series: t !== "" ? t : null
|
|
849
|
-
})),
|
|
865
|
+
})), O({
|
|
850
866
|
query: "series",
|
|
851
867
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
852
868
|
});
|
|
853
869
|
},
|
|
854
|
-
[
|
|
855
|
-
), $t =
|
|
870
|
+
[O]
|
|
871
|
+
), $t = D(
|
|
856
872
|
(t) => {
|
|
857
|
-
|
|
873
|
+
T.current = !0, Q((r) => ({
|
|
858
874
|
...r,
|
|
859
875
|
variant: t !== "" ? t : null
|
|
860
|
-
})),
|
|
876
|
+
})), O({
|
|
861
877
|
query: "variant",
|
|
862
878
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
863
879
|
});
|
|
864
880
|
},
|
|
865
|
-
[
|
|
866
|
-
), At =
|
|
881
|
+
[O]
|
|
882
|
+
), At = D(
|
|
867
883
|
(t) => {
|
|
868
|
-
|
|
884
|
+
T.current = !0, Q((r) => ({
|
|
869
885
|
...r,
|
|
870
886
|
engine: t !== "" ? t : null
|
|
871
|
-
})),
|
|
887
|
+
})), O({
|
|
872
888
|
query: "engine",
|
|
873
889
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
874
890
|
});
|
|
875
891
|
},
|
|
876
|
-
[
|
|
877
|
-
), Et =
|
|
892
|
+
[O]
|
|
893
|
+
), Et = D(
|
|
878
894
|
(t) => {
|
|
879
|
-
|
|
895
|
+
T.current = !0, Q((r) => ({
|
|
880
896
|
...r,
|
|
881
897
|
engine_capacity: t !== "" ? t : null
|
|
882
|
-
})),
|
|
898
|
+
})), O({
|
|
883
899
|
query: "engine_capacity",
|
|
884
900
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
885
901
|
});
|
|
886
902
|
},
|
|
887
|
-
[
|
|
903
|
+
[O]
|
|
888
904
|
);
|
|
889
|
-
|
|
890
|
-
|
|
905
|
+
B(() => {
|
|
906
|
+
M && e.year && C.current && (async () => {
|
|
891
907
|
try {
|
|
892
908
|
const r = await C.current.search("", {
|
|
893
909
|
filter: `year_from <= ${e.year.value} AND year_to >= ${e.year.value}`,
|
|
@@ -902,82 +918,82 @@ function Kt({
|
|
|
902
918
|
});
|
|
903
919
|
});
|
|
904
920
|
let o = Array.from(n.values());
|
|
905
|
-
|
|
906
|
-
(i) =>
|
|
907
|
-
|
|
921
|
+
ie.size > 0 ? o = o.filter(
|
|
922
|
+
(i) => ie.has(
|
|
923
|
+
F(i.value)
|
|
908
924
|
)
|
|
909
|
-
) :
|
|
910
|
-
(i) =>
|
|
911
|
-
|
|
925
|
+
) : pe.size > 0 && (o = o.filter(
|
|
926
|
+
(i) => pe.has(
|
|
927
|
+
F(i.value)
|
|
912
928
|
)
|
|
913
929
|
));
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
const l =
|
|
917
|
-
return l && !c ? -1 : !l && c ? 1 : l && c ?
|
|
930
|
+
const p = new Set(V.current || []);
|
|
931
|
+
p.size > 0 ? o.sort((i, v) => {
|
|
932
|
+
const l = p.has(i.value), c = p.has(v.value);
|
|
933
|
+
return l && !c ? -1 : !l && c ? 1 : l && c ? V.current.indexOf(i.value) - V.current.indexOf(v.value) : i.value.localeCompare(v.value);
|
|
918
934
|
}) : o.sort(
|
|
919
|
-
(i,
|
|
920
|
-
),
|
|
935
|
+
(i, v) => v.popularity === i.popularity ? i.value.localeCompare(v.value) : v.popularity - i.popularity
|
|
936
|
+
), Ye(o);
|
|
921
937
|
} catch (r) {
|
|
922
938
|
console.error("[VehicleSearch] Error loading makes for year:", r);
|
|
923
939
|
}
|
|
924
940
|
})();
|
|
925
|
-
}, [
|
|
926
|
-
const jt =
|
|
941
|
+
}, [M, e.year, ie, pe]);
|
|
942
|
+
const jt = D(() => {
|
|
927
943
|
(async () => {
|
|
928
944
|
let r = [];
|
|
929
|
-
if (
|
|
930
|
-
r =
|
|
945
|
+
if (ye.current && ye.current.length)
|
|
946
|
+
r = ye.current;
|
|
931
947
|
else if (C.current)
|
|
932
948
|
try {
|
|
933
949
|
const n = await C.current.search("", {
|
|
934
950
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
935
951
|
limit: 1e3
|
|
936
952
|
}), o = /* @__PURE__ */ new Map();
|
|
937
|
-
n.hits.forEach((
|
|
938
|
-
|
|
939
|
-
value:
|
|
940
|
-
refinement:
|
|
941
|
-
popularity:
|
|
953
|
+
n.hits.forEach((p) => {
|
|
954
|
+
p.make && !o.has(p.make) && o.set(p.make, {
|
|
955
|
+
value: p.make.toUpperCase(),
|
|
956
|
+
refinement: p.make.toUpperCase(),
|
|
957
|
+
popularity: p.make_popularity || 0
|
|
942
958
|
});
|
|
943
959
|
}), r = Array.from(o.values());
|
|
944
960
|
} catch (n) {
|
|
945
961
|
console.error("[VehicleSearch] Error loading makes:", n);
|
|
946
962
|
}
|
|
947
|
-
if (
|
|
948
|
-
(n) =>
|
|
949
|
-
)),
|
|
950
|
-
(n) =>
|
|
951
|
-
)),
|
|
952
|
-
const n = new Set(
|
|
953
|
-
r.sort((o,
|
|
954
|
-
const i = n.has(o.value),
|
|
955
|
-
return i && !
|
|
963
|
+
if (ie.size > 0 && r.length && (r = r.filter(
|
|
964
|
+
(n) => ie.has(F(n.value))
|
|
965
|
+
)), ie.size === 0 && pe.size > 0 && (r = r.filter(
|
|
966
|
+
(n) => pe.has(F(n.value))
|
|
967
|
+
)), V.current && V.current.length > 0) {
|
|
968
|
+
const n = new Set(V.current);
|
|
969
|
+
r.sort((o, p) => {
|
|
970
|
+
const i = n.has(o.value), v = n.has(p.value);
|
|
971
|
+
return i && !v ? -1 : !i && v ? 1 : i && v ? V.current.indexOf(o.value) - V.current.indexOf(p.value) : o.value.localeCompare(p.value);
|
|
956
972
|
});
|
|
957
973
|
} else
|
|
958
974
|
r.sort((n, o) => n.popularity === o.popularity ? n.value.localeCompare(o.value) : o.popularity - n.popularity);
|
|
959
|
-
|
|
975
|
+
Ye(r);
|
|
960
976
|
})();
|
|
961
|
-
}, [
|
|
962
|
-
|
|
977
|
+
}, [ie, pe]);
|
|
978
|
+
B(() => {
|
|
963
979
|
var t;
|
|
964
980
|
if (e.make && e.make.refinement) {
|
|
965
|
-
const r = e.make.refinement, n =
|
|
966
|
-
if (o && !
|
|
967
|
-
|
|
981
|
+
const r = e.make.refinement, n = F(r), o = ie.size > 0, p = pe.size > 0;
|
|
982
|
+
if (o && !ie.has(n)) {
|
|
983
|
+
de([]);
|
|
968
984
|
return;
|
|
969
985
|
}
|
|
970
|
-
if (!o &&
|
|
971
|
-
|
|
986
|
+
if (!o && p && !pe.has(n)) {
|
|
987
|
+
de([]);
|
|
972
988
|
return;
|
|
973
989
|
}
|
|
974
|
-
const i =
|
|
975
|
-
i.map((x) =>
|
|
990
|
+
const i = d ? d.trim().split(",").map((x) => x.trim()).filter(Boolean) : [], v = new Set(
|
|
991
|
+
i.map((x) => F(x))
|
|
976
992
|
), l = typeof y.current == "object" && !Array.isArray(y.current) && y.current !== null ? y.current : null;
|
|
977
993
|
let c = [];
|
|
978
994
|
if (l && (c = l[r] || [], Array.isArray(c) || (c = []), c.length === 0)) {
|
|
979
995
|
const x = Object.keys(l).find(
|
|
980
|
-
(_) =>
|
|
996
|
+
(_) => F(_) === n
|
|
981
997
|
);
|
|
982
998
|
if (x) {
|
|
983
999
|
const _ = l[x];
|
|
@@ -986,143 +1002,143 @@ function Kt({
|
|
|
986
1002
|
}
|
|
987
1003
|
const $ = new Set(
|
|
988
1004
|
c.map(
|
|
989
|
-
(x) =>
|
|
1005
|
+
(x) => F(x)
|
|
990
1006
|
)
|
|
991
1007
|
), A = $.size > 0 ? $ : null;
|
|
992
|
-
let
|
|
993
|
-
if (
|
|
994
|
-
Array.from(
|
|
1008
|
+
let m = v;
|
|
1009
|
+
if (v.size > 0 && $.size > 0 && (m = new Set(
|
|
1010
|
+
Array.from(v).filter(
|
|
995
1011
|
(x) => $.has(x)
|
|
996
1012
|
)
|
|
997
|
-
)),
|
|
998
|
-
|
|
1013
|
+
)), v.size > 0 && m.size === 0) {
|
|
1014
|
+
de([]);
|
|
999
1015
|
return;
|
|
1000
1016
|
}
|
|
1001
|
-
if (
|
|
1002
|
-
let _ = c.map((
|
|
1003
|
-
value:
|
|
1004
|
-
refinement:
|
|
1017
|
+
if (L && c.length > 0) {
|
|
1018
|
+
let _ = c.map((k) => ({
|
|
1019
|
+
value: k,
|
|
1020
|
+
refinement: k,
|
|
1005
1021
|
popularity: 0
|
|
1006
1022
|
// Popularity will be used from PostHog for sorting
|
|
1007
1023
|
}));
|
|
1008
|
-
_ =
|
|
1024
|
+
_ = Xe(
|
|
1009
1025
|
_,
|
|
1010
|
-
(
|
|
1011
|
-
|
|
1012
|
-
), _ =
|
|
1026
|
+
(k) => k.value,
|
|
1027
|
+
m
|
|
1028
|
+
), _ = Xe(
|
|
1013
1029
|
_,
|
|
1014
|
-
(
|
|
1030
|
+
(k) => k.value,
|
|
1015
1031
|
A
|
|
1016
1032
|
);
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1033
|
+
const W = (t = te.current) == null ? void 0 : t[r];
|
|
1034
|
+
if (W && Array.isArray(W)) {
|
|
1035
|
+
const k = new Map(
|
|
1036
|
+
W.map((R, ae) => [
|
|
1037
|
+
R.toUpperCase(),
|
|
1038
|
+
W.length - ae
|
|
1023
1039
|
])
|
|
1024
1040
|
);
|
|
1025
|
-
_.sort((
|
|
1026
|
-
const
|
|
1027
|
-
return
|
|
1041
|
+
_.sort((R, ae) => {
|
|
1042
|
+
const ee = k.get(R.value.toUpperCase()) || 0, se = k.get(ae.value.toUpperCase()) || 0;
|
|
1043
|
+
return ee !== se ? se - ee : R.value.localeCompare(ae.value);
|
|
1028
1044
|
});
|
|
1029
1045
|
} else
|
|
1030
|
-
_.sort((
|
|
1031
|
-
|
|
1046
|
+
_.sort((k, R) => k.value.localeCompare(R.value));
|
|
1047
|
+
de(_);
|
|
1032
1048
|
return;
|
|
1033
1049
|
}
|
|
1034
|
-
if (!
|
|
1050
|
+
if (!ze.current || !h)
|
|
1035
1051
|
return;
|
|
1036
|
-
|
|
1052
|
+
ze.current.search("", {
|
|
1037
1053
|
filter: `make = "${e.make.refinement}"`,
|
|
1038
1054
|
limit: 1
|
|
1039
1055
|
// Only one document per make
|
|
1040
1056
|
}).then((x) => {
|
|
1041
|
-
var
|
|
1057
|
+
var Oe, Ue;
|
|
1042
1058
|
const { hits: _ } = x;
|
|
1043
|
-
let
|
|
1044
|
-
_.length > 0 && _[0].models && (
|
|
1045
|
-
let
|
|
1046
|
-
model: `${e.make.refinement} > ${
|
|
1047
|
-
model_popularity:
|
|
1048
|
-
})),
|
|
1049
|
-
Array.isArray(y.current) ?
|
|
1050
|
-
let
|
|
1051
|
-
if (
|
|
1052
|
-
(
|
|
1053
|
-
|
|
1059
|
+
let W = [];
|
|
1060
|
+
_.length > 0 && _[0].models && (W = _[0].models);
|
|
1061
|
+
let k = W.map((u) => ({
|
|
1062
|
+
model: `${e.make.refinement} > ${u.name}`,
|
|
1063
|
+
model_popularity: u.popularity || 0
|
|
1064
|
+
})), R = [];
|
|
1065
|
+
Array.isArray(y.current) ? R = y.current : typeof y.current == "object" && y.current !== null ? R = c : typeof y.current == "string" && y.current.length && (R = y.current.split(",").map((u) => u.trim()).filter(Boolean));
|
|
1066
|
+
let ae = R;
|
|
1067
|
+
if (m.size > 0 && (ae = R.length ? R.filter(
|
|
1068
|
+
(u) => m.has(
|
|
1069
|
+
F(u)
|
|
1054
1070
|
)
|
|
1055
|
-
) : i,
|
|
1056
|
-
(
|
|
1057
|
-
|
|
1058
|
-
|
|
1071
|
+
) : i, k = k.filter(
|
|
1072
|
+
(u) => m.has(
|
|
1073
|
+
F(
|
|
1074
|
+
ke(u.model)
|
|
1059
1075
|
)
|
|
1060
1076
|
)
|
|
1061
|
-
)),
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1077
|
+
)), ae && ae.length > 0) {
|
|
1078
|
+
const u = new Set(
|
|
1079
|
+
ae.map((ue) => F(ue))
|
|
1064
1080
|
);
|
|
1065
|
-
|
|
1066
|
-
(
|
|
1067
|
-
|
|
1068
|
-
|
|
1081
|
+
k.some(
|
|
1082
|
+
(ue) => u.has(
|
|
1083
|
+
F(
|
|
1084
|
+
ke(ue.model)
|
|
1069
1085
|
)
|
|
1070
1086
|
)
|
|
1071
|
-
) && (
|
|
1072
|
-
(
|
|
1073
|
-
|
|
1074
|
-
|
|
1087
|
+
) && (k = k.filter(
|
|
1088
|
+
(ue) => u.has(
|
|
1089
|
+
F(
|
|
1090
|
+
ke(ue.model)
|
|
1075
1091
|
)
|
|
1076
1092
|
)
|
|
1077
1093
|
));
|
|
1078
1094
|
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
(
|
|
1095
|
+
k = Xe(
|
|
1096
|
+
k,
|
|
1097
|
+
(u) => ke(u.model),
|
|
1082
1098
|
A
|
|
1083
|
-
),
|
|
1084
|
-
const H =
|
|
1099
|
+
), k = k.filter((u) => ke(u.model) !== "").map((u) => {
|
|
1100
|
+
const H = ke(u.model);
|
|
1085
1101
|
return {
|
|
1086
1102
|
value: H,
|
|
1087
1103
|
refinement: H,
|
|
1088
|
-
popularity:
|
|
1104
|
+
popularity: u.model_popularity
|
|
1089
1105
|
};
|
|
1090
1106
|
});
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1107
|
+
const ee = (Oe = e.make) == null ? void 0 : Oe.refinement, se = (Ue = te.current) == null ? void 0 : Ue[ee];
|
|
1108
|
+
if (se && Array.isArray(se) && se.length > 0) {
|
|
1109
|
+
const u = new Set(
|
|
1110
|
+
se.map((H) => String(H).trim().toUpperCase())
|
|
1095
1111
|
);
|
|
1096
|
-
|
|
1097
|
-
const
|
|
1098
|
-
if (
|
|
1099
|
-
if (!
|
|
1100
|
-
if (
|
|
1101
|
-
const ht =
|
|
1112
|
+
k.sort((H, ue) => {
|
|
1113
|
+
const qe = u.has(H.value), Qe = u.has(ue.value);
|
|
1114
|
+
if (qe && !Qe) return -1;
|
|
1115
|
+
if (!qe && Qe) return 1;
|
|
1116
|
+
if (qe && Qe) {
|
|
1117
|
+
const ht = se.map(
|
|
1102
1118
|
(Bt) => String(Bt).trim().toUpperCase()
|
|
1103
1119
|
);
|
|
1104
|
-
return ht.indexOf(H.value) - ht.indexOf(
|
|
1120
|
+
return ht.indexOf(H.value) - ht.indexOf(ue.value);
|
|
1105
1121
|
}
|
|
1106
|
-
return H.value.localeCompare(
|
|
1122
|
+
return H.value.localeCompare(ue.value);
|
|
1107
1123
|
});
|
|
1108
1124
|
} else
|
|
1109
|
-
|
|
1110
|
-
|
|
1125
|
+
k.sort((u, H) => u.popularity === H.popularity ? u.value.localeCompare(H.value) : H.popularity - u.popularity);
|
|
1126
|
+
de(k);
|
|
1111
1127
|
}).catch((x) => {
|
|
1112
|
-
console.error("[VehicleSearch] Error loading models:", x),
|
|
1128
|
+
console.error("[VehicleSearch] Error loading models:", x), de([]);
|
|
1113
1129
|
});
|
|
1114
1130
|
} else
|
|
1115
|
-
|
|
1131
|
+
de([]);
|
|
1116
1132
|
}, [
|
|
1117
1133
|
e.make,
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1134
|
+
d,
|
|
1135
|
+
h,
|
|
1136
|
+
M,
|
|
1121
1137
|
e.year,
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
]),
|
|
1138
|
+
L,
|
|
1139
|
+
ie,
|
|
1140
|
+
pe
|
|
1141
|
+
]), B(() => {
|
|
1126
1142
|
if (C.current && e.make && e.model) {
|
|
1127
1143
|
let t = [
|
|
1128
1144
|
`model:${e.make.refinement} > ${e.model.refinement}`
|
|
@@ -1132,18 +1148,18 @@ function Kt({
|
|
|
1132
1148
|
), e.series && t.push(`series:${e.series.refinement}`), e.engine && t.push(`engine:${e.engine.refinement}`), e.engine_capacity && t.push(
|
|
1133
1149
|
`engine_capacity:${e.engine_capacity.refinement}`
|
|
1134
1150
|
)), C.current.search("", {
|
|
1135
|
-
filter:
|
|
1151
|
+
filter: Te(t, []),
|
|
1136
1152
|
attributesToRetrieve: ["year_from", "year_to", "otto_id"],
|
|
1137
1153
|
limit: 200
|
|
1138
1154
|
// Reduced from 1000 for faster queries
|
|
1139
1155
|
}).then(({ hits: r }) => {
|
|
1140
|
-
const n = r.map((l) => l.year_from), o = Math.min(...n),
|
|
1141
|
-
let
|
|
1156
|
+
const n = r.map((l) => l.year_from), o = Math.min(...n), p = r.map((l) => l.year_to), i = Math.max(...p);
|
|
1157
|
+
let v = Array.apply(null, {
|
|
1142
1158
|
length: i + 1 - o
|
|
1143
1159
|
}).map(function(l, c) {
|
|
1144
1160
|
return c + o;
|
|
1145
1161
|
});
|
|
1146
|
-
|
|
1162
|
+
v = v.reverse().map((l) => ({ value: l, refinement: l })), Me(v);
|
|
1147
1163
|
}).catch((r) => {
|
|
1148
1164
|
console.error("[VehicleSearch] Error fetching years:", r);
|
|
1149
1165
|
});
|
|
@@ -1151,13 +1167,13 @@ function Kt({
|
|
|
1151
1167
|
}, [
|
|
1152
1168
|
e.model,
|
|
1153
1169
|
e.make,
|
|
1154
|
-
|
|
1170
|
+
M,
|
|
1155
1171
|
b,
|
|
1156
1172
|
e.body,
|
|
1157
1173
|
e.series,
|
|
1158
1174
|
e.engine,
|
|
1159
1175
|
e.engine_capacity
|
|
1160
|
-
]),
|
|
1176
|
+
]), B(() => {
|
|
1161
1177
|
const t = b ? e.make && e.model : e.year && e.make && e.model;
|
|
1162
1178
|
if (C.current && t) {
|
|
1163
1179
|
const r = e.year ? [
|
|
@@ -1165,7 +1181,7 @@ function Kt({
|
|
|
1165
1181
|
`year_to >= ${e.year.value}`
|
|
1166
1182
|
] : [];
|
|
1167
1183
|
C.current.search("", {
|
|
1168
|
-
filter:
|
|
1184
|
+
filter: Te(
|
|
1169
1185
|
[`model:${e.make.refinement} > ${e.model.refinement}`],
|
|
1170
1186
|
r
|
|
1171
1187
|
),
|
|
@@ -1175,23 +1191,23 @@ function Kt({
|
|
|
1175
1191
|
n = [...new Map(n.map((o) => [o.body, o])).values()].map((o) => ({
|
|
1176
1192
|
value: o.body.match(/[^>]*$/)[0].trim(),
|
|
1177
1193
|
refinement: o.body.match(/[^>]*$/)[0].trim()
|
|
1178
|
-
})).filter((o) => o.value),
|
|
1194
|
+
})).filter((o) => o.value), Be(n);
|
|
1179
1195
|
});
|
|
1180
1196
|
}
|
|
1181
1197
|
}, [e.year, e.make, e.model, b]);
|
|
1182
|
-
const
|
|
1198
|
+
const Ae = D(({ hits: t, attribute: r, stateCallback: n }) => {
|
|
1183
1199
|
let o = [
|
|
1184
|
-
...new Map(t.map((
|
|
1185
|
-
].map((
|
|
1186
|
-
value:
|
|
1187
|
-
refinement:
|
|
1188
|
-
})).filter((
|
|
1200
|
+
...new Map(t.map((p) => [p[r], p])).values()
|
|
1201
|
+
].map((p) => ({
|
|
1202
|
+
value: p[r].match(/[^|]*$/)[0].trim(),
|
|
1203
|
+
refinement: p[r].match(/[^|]*$/)[0].trim()
|
|
1204
|
+
})).filter((p) => p.refinement);
|
|
1189
1205
|
n(o);
|
|
1190
|
-
}, []), Nt =
|
|
1191
|
-
const t =
|
|
1206
|
+
}, []), Nt = D(() => {
|
|
1207
|
+
const t = De.current ? De.current.length + 3 : 3, r = le ? t + 1 : t;
|
|
1192
1208
|
return `vs:lg:grid-cols-${r > 8 ? 8 : r}`;
|
|
1193
|
-
}, [
|
|
1194
|
-
|
|
1209
|
+
}, [le]);
|
|
1210
|
+
B(() => {
|
|
1195
1211
|
const t = b ? e.make && e.model : e.make && e.model && e.year;
|
|
1196
1212
|
if (C.current && t) {
|
|
1197
1213
|
let r = [
|
|
@@ -1208,7 +1224,7 @@ function Kt({
|
|
|
1208
1224
|
`year_to >= ${e.year.value}`
|
|
1209
1225
|
] : [];
|
|
1210
1226
|
C.current.search("", {
|
|
1211
|
-
filter:
|
|
1227
|
+
filter: Te(r, n),
|
|
1212
1228
|
attributesToRetrieve: [
|
|
1213
1229
|
"series",
|
|
1214
1230
|
"engine_capacity",
|
|
@@ -1219,22 +1235,22 @@ function Kt({
|
|
|
1219
1235
|
],
|
|
1220
1236
|
limit: 1e3
|
|
1221
1237
|
}).then(({ hits: o }) => {
|
|
1222
|
-
|
|
1238
|
+
Ae({
|
|
1223
1239
|
hits: o,
|
|
1224
1240
|
attribute: "series",
|
|
1225
|
-
stateCallback:
|
|
1226
|
-
}),
|
|
1241
|
+
stateCallback: Pe
|
|
1242
|
+
}), Ae({
|
|
1227
1243
|
hits: o,
|
|
1228
1244
|
attribute: "variant",
|
|
1229
|
-
stateCallback:
|
|
1230
|
-
}),
|
|
1245
|
+
stateCallback: Ie
|
|
1246
|
+
}), Ae({
|
|
1231
1247
|
hits: o,
|
|
1232
1248
|
attribute: "engine",
|
|
1233
|
-
stateCallback:
|
|
1234
|
-
}),
|
|
1249
|
+
stateCallback: Le
|
|
1250
|
+
}), Ae({
|
|
1235
1251
|
hits: o,
|
|
1236
1252
|
attribute: "engine_capacity",
|
|
1237
|
-
stateCallback:
|
|
1253
|
+
stateCallback: Ve
|
|
1238
1254
|
});
|
|
1239
1255
|
});
|
|
1240
1256
|
}
|
|
@@ -1244,56 +1260,56 @@ function Kt({
|
|
|
1244
1260
|
e.variant,
|
|
1245
1261
|
e.engine,
|
|
1246
1262
|
e.engine_capacity,
|
|
1247
|
-
|
|
1263
|
+
Ae,
|
|
1248
1264
|
e.make,
|
|
1249
1265
|
e.model,
|
|
1250
1266
|
e.year,
|
|
1251
1267
|
b
|
|
1252
1268
|
]);
|
|
1253
|
-
const [
|
|
1254
|
-
return
|
|
1269
|
+
const [Fe, Ke] = j(!1);
|
|
1270
|
+
return B(() => {
|
|
1255
1271
|
if (g)
|
|
1256
|
-
return
|
|
1272
|
+
return Fe ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
1257
1273
|
document.body.style.overflow = "";
|
|
1258
1274
|
};
|
|
1259
|
-
}, [
|
|
1275
|
+
}, [Fe, g]), /* @__PURE__ */ P(Re, { children: [
|
|
1260
1276
|
g && /* @__PURE__ */ a(
|
|
1261
1277
|
"button",
|
|
1262
1278
|
{
|
|
1263
|
-
onClick: () =>
|
|
1279
|
+
onClick: () => Ke(!0),
|
|
1264
1280
|
type: "button",
|
|
1265
|
-
className:
|
|
1281
|
+
className: ge(
|
|
1266
1282
|
"vehicle-search-btn vs:md:hidden!",
|
|
1267
|
-
|
|
1283
|
+
he ? "vs:w-full! vs:flex! vs:shrink-0!" : "vs:w-auto! vs:inline-flex! vs:shrink!"
|
|
1268
1284
|
),
|
|
1269
|
-
children: /* @__PURE__ */ a("span", { children:
|
|
1285
|
+
children: /* @__PURE__ */ a("span", { children: E })
|
|
1270
1286
|
}
|
|
1271
1287
|
),
|
|
1272
1288
|
g && /* @__PURE__ */ a(
|
|
1273
1289
|
"div",
|
|
1274
1290
|
{
|
|
1275
|
-
onClick: () =>
|
|
1276
|
-
className:
|
|
1291
|
+
onClick: () => Ke(!1),
|
|
1292
|
+
className: ge(
|
|
1277
1293
|
"vs:z-10 vs:fixed vs:inset-0 vs:bg-stone-900 vs:transition-all vs:duration-300",
|
|
1278
|
-
|
|
1294
|
+
Fe ? "vs:opacity-75" : "vs:pointer-events-none vs:opacity-0"
|
|
1279
1295
|
)
|
|
1280
1296
|
}
|
|
1281
1297
|
),
|
|
1282
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ P(
|
|
1283
1299
|
"div",
|
|
1284
1300
|
{
|
|
1285
|
-
className:
|
|
1301
|
+
className: ge(
|
|
1286
1302
|
"partbot-mmyvs-container",
|
|
1287
|
-
g &&
|
|
1303
|
+
g && Fe && "active",
|
|
1288
1304
|
"w-full"
|
|
1289
1305
|
),
|
|
1290
1306
|
children: [
|
|
1291
|
-
g && /* @__PURE__ */
|
|
1307
|
+
g && /* @__PURE__ */ P("div", { className: "vs:flex vs:justify-between vs:items-center vs:pb-4 vs:font-bold vs:text-white vs:md:hidden", children: [
|
|
1292
1308
|
/* @__PURE__ */ a("span", { children: "Select Vehicle" }),
|
|
1293
|
-
/* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ P(
|
|
1294
1310
|
"button",
|
|
1295
1311
|
{
|
|
1296
|
-
onClick: () =>
|
|
1312
|
+
onClick: () => Ke(!1),
|
|
1297
1313
|
type: "button",
|
|
1298
1314
|
className: "vs:appearance-none vs:bg-transparent vs:border-none vs:ring-none vs:outline-none vs:hover:border-none vs:hover:ring-none vs:hover:outline-none",
|
|
1299
1315
|
children: [
|
|
@@ -1312,128 +1328,128 @@ function Kt({
|
|
|
1312
1328
|
}
|
|
1313
1329
|
)
|
|
1314
1330
|
] }),
|
|
1315
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ P(
|
|
1316
1332
|
"div",
|
|
1317
1333
|
{
|
|
1318
|
-
ref:
|
|
1319
|
-
className:
|
|
1334
|
+
ref: Ce,
|
|
1335
|
+
className: ge(
|
|
1320
1336
|
"vs:grid vs:gap-3",
|
|
1321
1337
|
Y === "row" ? `${Nt()} vs:grid-cols-1 vs:md:grid-cols-3` : "vs:grid-cols-1 vs:md:max-w-[400px] vs:md:gap-5",
|
|
1322
1338
|
"vs:w-full vs:transition vs:lg:mx-auto"
|
|
1323
1339
|
),
|
|
1324
1340
|
children: [
|
|
1325
|
-
|
|
1341
|
+
M ? /* @__PURE__ */ P(Re, { children: [
|
|
1326
1342
|
/* @__PURE__ */ a(
|
|
1327
|
-
|
|
1343
|
+
ne,
|
|
1328
1344
|
{
|
|
1329
1345
|
label: "Year",
|
|
1330
|
-
items:
|
|
1331
|
-
refine:
|
|
1346
|
+
items: xe,
|
|
1347
|
+
refine: ut,
|
|
1332
1348
|
selected: e.year,
|
|
1333
1349
|
bgDark: G,
|
|
1334
|
-
showLabel:
|
|
1335
|
-
isMobile:
|
|
1350
|
+
showLabel: N,
|
|
1351
|
+
isMobile: oe,
|
|
1336
1352
|
sortOptions: !1,
|
|
1337
|
-
loading:
|
|
1353
|
+
loading: xe.length === 0,
|
|
1338
1354
|
shouldBeActive: !0
|
|
1339
1355
|
}
|
|
1340
1356
|
),
|
|
1341
1357
|
/* @__PURE__ */ a(
|
|
1342
|
-
|
|
1358
|
+
ne,
|
|
1343
1359
|
{
|
|
1344
1360
|
label: "Make",
|
|
1345
|
-
items:
|
|
1346
|
-
refine:
|
|
1361
|
+
items: je,
|
|
1362
|
+
refine: pt,
|
|
1347
1363
|
selected: e.make,
|
|
1348
1364
|
showPopular: !0,
|
|
1349
1365
|
bgDark: G,
|
|
1350
|
-
showLabel:
|
|
1351
|
-
isMobile:
|
|
1366
|
+
showLabel: N,
|
|
1367
|
+
isMobile: oe,
|
|
1352
1368
|
sortOptions: !1,
|
|
1353
|
-
loading: e.year &&
|
|
1369
|
+
loading: e.year && je.length === 0,
|
|
1354
1370
|
shouldBeActive: !!e.year
|
|
1355
1371
|
}
|
|
1356
1372
|
),
|
|
1357
1373
|
/* @__PURE__ */ a(
|
|
1358
|
-
|
|
1374
|
+
ne,
|
|
1359
1375
|
{
|
|
1360
1376
|
label: "Model",
|
|
1361
|
-
items:
|
|
1362
|
-
refine:
|
|
1377
|
+
items: Ne,
|
|
1378
|
+
refine: vt,
|
|
1363
1379
|
selected: e.model,
|
|
1364
1380
|
showPopular: !0,
|
|
1365
1381
|
bgDark: G,
|
|
1366
|
-
showLabel:
|
|
1367
|
-
isMobile:
|
|
1382
|
+
showLabel: N,
|
|
1383
|
+
isMobile: oe,
|
|
1368
1384
|
sortOptions: !1,
|
|
1369
|
-
loading: e.make &&
|
|
1385
|
+
loading: e.make && Ne.length === 0,
|
|
1370
1386
|
shouldBeActive: !!e.make
|
|
1371
1387
|
}
|
|
1372
1388
|
)
|
|
1373
|
-
] }) : /* @__PURE__ */
|
|
1389
|
+
] }) : /* @__PURE__ */ P(Re, { children: [
|
|
1374
1390
|
/* @__PURE__ */ a(
|
|
1375
|
-
|
|
1391
|
+
ne,
|
|
1376
1392
|
{
|
|
1377
1393
|
label: "Make",
|
|
1378
|
-
items:
|
|
1379
|
-
refine:
|
|
1394
|
+
items: je,
|
|
1395
|
+
refine: pt,
|
|
1380
1396
|
selected: e.make,
|
|
1381
1397
|
showPopular: !0,
|
|
1382
1398
|
bgDark: G,
|
|
1383
|
-
showLabel:
|
|
1384
|
-
isMobile:
|
|
1399
|
+
showLabel: N,
|
|
1400
|
+
isMobile: oe,
|
|
1385
1401
|
sortOptions: !1,
|
|
1386
|
-
loading:
|
|
1402
|
+
loading: je.length === 0,
|
|
1387
1403
|
shouldBeActive: !0
|
|
1388
1404
|
}
|
|
1389
1405
|
),
|
|
1390
1406
|
/* @__PURE__ */ a(
|
|
1391
|
-
|
|
1407
|
+
ne,
|
|
1392
1408
|
{
|
|
1393
1409
|
label: "Model",
|
|
1394
|
-
items:
|
|
1395
|
-
refine:
|
|
1410
|
+
items: Ne,
|
|
1411
|
+
refine: vt,
|
|
1396
1412
|
selected: e.model,
|
|
1397
1413
|
showPopular: !0,
|
|
1398
1414
|
bgDark: G,
|
|
1399
|
-
showLabel:
|
|
1400
|
-
isMobile:
|
|
1415
|
+
showLabel: N,
|
|
1416
|
+
isMobile: oe,
|
|
1401
1417
|
sortOptions: !1,
|
|
1402
|
-
loading: e.make &&
|
|
1418
|
+
loading: e.make && Ne.length === 0,
|
|
1403
1419
|
shouldBeActive: !!e.make
|
|
1404
1420
|
}
|
|
1405
1421
|
),
|
|
1406
1422
|
/* @__PURE__ */ a(
|
|
1407
|
-
|
|
1423
|
+
ne,
|
|
1408
1424
|
{
|
|
1409
1425
|
label: "Year",
|
|
1410
|
-
items:
|
|
1411
|
-
refine:
|
|
1426
|
+
items: xe,
|
|
1427
|
+
refine: ut,
|
|
1412
1428
|
selected: e.year,
|
|
1413
1429
|
bgDark: G,
|
|
1414
|
-
showLabel:
|
|
1415
|
-
isMobile:
|
|
1430
|
+
showLabel: N,
|
|
1431
|
+
isMobile: oe,
|
|
1416
1432
|
sortOptions: !1,
|
|
1417
|
-
loading: e.model &&
|
|
1433
|
+
loading: e.model && xe.length === 0,
|
|
1418
1434
|
shouldBeActive: !!e.model
|
|
1419
1435
|
}
|
|
1420
1436
|
)
|
|
1421
1437
|
] }),
|
|
1422
|
-
|
|
1438
|
+
De.current && De.current.map((t) => {
|
|
1423
1439
|
let r = null;
|
|
1424
1440
|
switch (t) {
|
|
1425
1441
|
case "body":
|
|
1426
1442
|
r = /* @__PURE__ */ a(
|
|
1427
|
-
|
|
1443
|
+
ne,
|
|
1428
1444
|
{
|
|
1429
1445
|
label: "Body",
|
|
1430
|
-
items:
|
|
1431
|
-
refine:
|
|
1446
|
+
items: et,
|
|
1447
|
+
refine: Mt,
|
|
1432
1448
|
selected: e.body,
|
|
1433
1449
|
bgDark: G,
|
|
1434
|
-
showLabel:
|
|
1435
|
-
isMobile:
|
|
1436
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1450
|
+
showLabel: N,
|
|
1451
|
+
isMobile: oe,
|
|
1452
|
+
loading: !!(e.make && e.model && e.year) && et.length === 0,
|
|
1437
1453
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1438
1454
|
},
|
|
1439
1455
|
"body"
|
|
@@ -1441,16 +1457,16 @@ function Kt({
|
|
|
1441
1457
|
break;
|
|
1442
1458
|
case "series":
|
|
1443
1459
|
r = /* @__PURE__ */ a(
|
|
1444
|
-
|
|
1460
|
+
ne,
|
|
1445
1461
|
{
|
|
1446
1462
|
label: "Series",
|
|
1447
|
-
items:
|
|
1463
|
+
items: tt,
|
|
1448
1464
|
refine: St,
|
|
1449
1465
|
selected: e.series,
|
|
1450
1466
|
bgDark: G,
|
|
1451
|
-
showLabel:
|
|
1452
|
-
isMobile:
|
|
1453
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1467
|
+
showLabel: N,
|
|
1468
|
+
isMobile: oe,
|
|
1469
|
+
loading: !!(e.make && e.model && e.year) && tt.length === 0,
|
|
1454
1470
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1455
1471
|
},
|
|
1456
1472
|
"series"
|
|
@@ -1458,16 +1474,16 @@ function Kt({
|
|
|
1458
1474
|
break;
|
|
1459
1475
|
case "variant":
|
|
1460
1476
|
r = /* @__PURE__ */ a(
|
|
1461
|
-
|
|
1477
|
+
ne,
|
|
1462
1478
|
{
|
|
1463
1479
|
label: "Variant",
|
|
1464
|
-
items:
|
|
1480
|
+
items: rt,
|
|
1465
1481
|
refine: $t,
|
|
1466
1482
|
selected: e.variant,
|
|
1467
1483
|
bgDark: G,
|
|
1468
|
-
showLabel:
|
|
1469
|
-
isMobile:
|
|
1470
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1484
|
+
showLabel: N,
|
|
1485
|
+
isMobile: oe,
|
|
1486
|
+
loading: !!(e.make && e.model && e.year) && rt.length === 0,
|
|
1471
1487
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1472
1488
|
},
|
|
1473
1489
|
"variant"
|
|
@@ -1475,16 +1491,16 @@ function Kt({
|
|
|
1475
1491
|
break;
|
|
1476
1492
|
case "engine_capacity":
|
|
1477
1493
|
r = /* @__PURE__ */ a(
|
|
1478
|
-
|
|
1494
|
+
ne,
|
|
1479
1495
|
{
|
|
1480
1496
|
label: "Engine Capacity",
|
|
1481
|
-
items:
|
|
1497
|
+
items: at,
|
|
1482
1498
|
refine: Et,
|
|
1483
1499
|
selected: e.engine_capacity,
|
|
1484
1500
|
bgDark: G,
|
|
1485
|
-
showLabel:
|
|
1486
|
-
isMobile:
|
|
1487
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1501
|
+
showLabel: N,
|
|
1502
|
+
isMobile: oe,
|
|
1503
|
+
loading: !!(e.make && e.model && e.year) && at.length === 0,
|
|
1488
1504
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1489
1505
|
},
|
|
1490
1506
|
"engine_capacity"
|
|
@@ -1492,16 +1508,16 @@ function Kt({
|
|
|
1492
1508
|
break;
|
|
1493
1509
|
case "engine":
|
|
1494
1510
|
r = /* @__PURE__ */ a(
|
|
1495
|
-
|
|
1511
|
+
ne,
|
|
1496
1512
|
{
|
|
1497
1513
|
label: "Engine",
|
|
1498
|
-
items:
|
|
1514
|
+
items: ot,
|
|
1499
1515
|
refine: At,
|
|
1500
1516
|
selected: e.engine,
|
|
1501
1517
|
bgDark: G,
|
|
1502
|
-
showLabel:
|
|
1503
|
-
isMobile:
|
|
1504
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1518
|
+
showLabel: N,
|
|
1519
|
+
isMobile: oe,
|
|
1520
|
+
loading: !!(e.make && e.model && e.year) && ot.length === 0,
|
|
1505
1521
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1506
1522
|
},
|
|
1507
1523
|
"engine"
|
|
@@ -1510,16 +1526,16 @@ function Kt({
|
|
|
1510
1526
|
}
|
|
1511
1527
|
return r;
|
|
1512
1528
|
}),
|
|
1513
|
-
|
|
1529
|
+
le && /* @__PURE__ */ a("div", { className: "vs:flex vs:h-full vs:flex-col vs:justify-end vs:md:col-span-3 vs:lg:col-span-1", children: /* @__PURE__ */ P(
|
|
1514
1530
|
"button",
|
|
1515
1531
|
{
|
|
1516
1532
|
className: "vehicle-search-btn",
|
|
1517
1533
|
onClick: () => {
|
|
1518
|
-
|
|
1534
|
+
Ze(!0), X && !ce ? window.location.href = X + window.location.search : zt();
|
|
1519
1535
|
},
|
|
1520
1536
|
children: [
|
|
1521
|
-
/* @__PURE__ */ a("span", { children:
|
|
1522
|
-
wt && /* @__PURE__ */ a(
|
|
1537
|
+
/* @__PURE__ */ a("span", { children: fe }),
|
|
1538
|
+
wt && /* @__PURE__ */ a(Ge, { className: "vs:w-[calc(var(--partbot-font-size)*0.9)]! vs:h-[calc(var(--partbot-font-size)*0.9)]! vs:animate-spin" })
|
|
1523
1539
|
]
|
|
1524
1540
|
}
|
|
1525
1541
|
) })
|
|
@@ -1529,12 +1545,12 @@ function Kt({
|
|
|
1529
1545
|
Z && /* @__PURE__ */ a(
|
|
1530
1546
|
"div",
|
|
1531
1547
|
{
|
|
1532
|
-
className:
|
|
1548
|
+
className: ge(
|
|
1533
1549
|
"vs:flex vs:w-full vs:justify-center vs:items-center",
|
|
1534
1550
|
Y === "row" ? "vs:md:items-end vs:md:justify-end" : "vs:md:justify-center",
|
|
1535
1551
|
"vs:mt-4 vs:md:mt-3 vs:md:pr-1.5"
|
|
1536
1552
|
),
|
|
1537
|
-
children: /* @__PURE__ */
|
|
1553
|
+
children: /* @__PURE__ */ P(
|
|
1538
1554
|
"a",
|
|
1539
1555
|
{
|
|
1540
1556
|
href: `https://use.partbot.io/?ref=${// append referrer to url, just the top level domain
|
|
@@ -1555,74 +1571,74 @@ function Kt({
|
|
|
1555
1571
|
)
|
|
1556
1572
|
] });
|
|
1557
1573
|
}
|
|
1558
|
-
let gt = !1,
|
|
1559
|
-
function
|
|
1560
|
-
var
|
|
1561
|
-
const
|
|
1562
|
-
if (!
|
|
1574
|
+
let gt = !1, Ee = !1;
|
|
1575
|
+
function Qt(h) {
|
|
1576
|
+
var N, he;
|
|
1577
|
+
const f = h.shadowRoot;
|
|
1578
|
+
if (!f) {
|
|
1563
1579
|
console.error("[ShadowDOMPatch] No shadow root found");
|
|
1564
1580
|
return;
|
|
1565
1581
|
}
|
|
1566
|
-
const
|
|
1567
|
-
if (!
|
|
1582
|
+
const d = f.children[1];
|
|
1583
|
+
if (!d) {
|
|
1568
1584
|
console.error("[ShadowDOMPatch] No mount point found in shadow root");
|
|
1569
1585
|
return;
|
|
1570
1586
|
}
|
|
1571
1587
|
if (new MutationObserver((g) => {
|
|
1572
|
-
g.forEach((
|
|
1573
|
-
|
|
1574
|
-
S.nodeType === 1 && S.id === "headlessui-portal-root" && (
|
|
1588
|
+
g.forEach((z) => {
|
|
1589
|
+
z.addedNodes.forEach((S) => {
|
|
1590
|
+
S.nodeType === 1 && S.id === "headlessui-portal-root" && (d.appendChild(S), Ee = !0);
|
|
1575
1591
|
});
|
|
1576
|
-
}), g.forEach((
|
|
1577
|
-
|
|
1578
|
-
S.nodeType === 1 && S.id === "headlessui-portal-root" && (
|
|
1592
|
+
}), g.forEach((z) => {
|
|
1593
|
+
z.removedNodes.forEach((S) => {
|
|
1594
|
+
S.nodeType === 1 && S.id === "headlessui-portal-root" && (d.querySelector(
|
|
1579
1595
|
"#headlessui-portal-root"
|
|
1580
|
-
) || (
|
|
1596
|
+
) || (Ee = !1));
|
|
1581
1597
|
});
|
|
1582
1598
|
});
|
|
1583
1599
|
}).observe(document.body, {
|
|
1584
1600
|
childList: !0
|
|
1585
1601
|
}), new MutationObserver((g) => {
|
|
1586
|
-
g.forEach((
|
|
1587
|
-
|
|
1588
|
-
S.nodeType === 1 && S.id === "headlessui-portal-root" && (
|
|
1602
|
+
g.forEach((z) => {
|
|
1603
|
+
z.removedNodes.forEach((S) => {
|
|
1604
|
+
S.nodeType === 1 && S.id === "headlessui-portal-root" && (Ee = !1);
|
|
1589
1605
|
});
|
|
1590
1606
|
});
|
|
1591
|
-
}).observe(
|
|
1607
|
+
}).observe(d, {
|
|
1592
1608
|
childList: !0,
|
|
1593
1609
|
subtree: !0
|
|
1594
1610
|
}), gt)
|
|
1595
1611
|
return;
|
|
1596
|
-
const X = (
|
|
1612
|
+
const X = (N = Object.getOwnPropertyDescriptor(
|
|
1597
1613
|
Document.prototype,
|
|
1598
1614
|
"activeElement"
|
|
1599
|
-
)) == null ? void 0 :
|
|
1615
|
+
)) == null ? void 0 : N.get;
|
|
1600
1616
|
Object.defineProperty(Document.prototype, "activeElement", {
|
|
1601
1617
|
get: function() {
|
|
1602
1618
|
const g = X == null ? void 0 : X.call(this);
|
|
1603
|
-
return g ===
|
|
1619
|
+
return g === h ? f.activeElement : g;
|
|
1604
1620
|
}
|
|
1605
1621
|
});
|
|
1606
|
-
const Y = (
|
|
1622
|
+
const Y = (he = Object.getOwnPropertyDescriptor(
|
|
1607
1623
|
Event.prototype,
|
|
1608
1624
|
"target"
|
|
1609
|
-
)) == null ? void 0 :
|
|
1625
|
+
)) == null ? void 0 : he.get;
|
|
1610
1626
|
Object.defineProperty(Event.prototype, "target", {
|
|
1611
1627
|
get: function() {
|
|
1612
1628
|
const g = Y == null ? void 0 : Y.call(this);
|
|
1613
|
-
return g ===
|
|
1629
|
+
return g === h ? this.composedPath()[0] : g;
|
|
1614
1630
|
}
|
|
1615
1631
|
});
|
|
1616
|
-
const
|
|
1632
|
+
const U = (g) => {
|
|
1617
1633
|
try {
|
|
1618
1634
|
return document.body && g === document.body.style;
|
|
1619
1635
|
} catch {
|
|
1620
1636
|
return !1;
|
|
1621
1637
|
}
|
|
1622
|
-
},
|
|
1623
|
-
CSSStyleDeclaration.prototype.setProperty = function(g,
|
|
1624
|
-
if (!(
|
|
1625
|
-
return
|
|
1638
|
+
}, q = CSSStyleDeclaration.prototype.setProperty;
|
|
1639
|
+
CSSStyleDeclaration.prototype.setProperty = function(g, z, S) {
|
|
1640
|
+
if (!(U(this) && g === "overflow" && z === "hidden" && Ee))
|
|
1641
|
+
return q.call(this, g, z, S);
|
|
1626
1642
|
};
|
|
1627
1643
|
const Z = Object.getOwnPropertyDescriptor(
|
|
1628
1644
|
CSSStyleDeclaration.prototype,
|
|
@@ -1633,90 +1649,90 @@ function qt(f) {
|
|
|
1633
1649
|
return Z.get.call(this);
|
|
1634
1650
|
},
|
|
1635
1651
|
set: function(g) {
|
|
1636
|
-
if (!(
|
|
1652
|
+
if (!(U(this) && g === "hidden" && Ee))
|
|
1637
1653
|
return Z.set.call(this, g);
|
|
1638
1654
|
}
|
|
1639
1655
|
}), gt = !0;
|
|
1640
1656
|
}
|
|
1641
|
-
const
|
|
1642
|
-
class
|
|
1657
|
+
const Wt = "/css/vehicle-search.css", pr = Wt;
|
|
1658
|
+
class Jt extends HTMLElement {
|
|
1643
1659
|
connectedCallback() {
|
|
1644
1660
|
if (!document.getElementById("vehicle-search-inter-font")) {
|
|
1645
1661
|
const y = document.createElement("link");
|
|
1646
1662
|
y.id = "vehicle-search-inter-font", y.rel = "stylesheet", y.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap", document.head.appendChild(y);
|
|
1647
1663
|
}
|
|
1648
|
-
let
|
|
1649
|
-
|
|
1650
|
-
const
|
|
1651
|
-
let
|
|
1652
|
-
if (this.hasAttribute(
|
|
1653
|
-
const C = this.getAttribute(
|
|
1664
|
+
let f = document.createElement("style");
|
|
1665
|
+
f.textContent = Yt;
|
|
1666
|
+
const d = document.createElement("div"), K = this.attachShadow({ mode: "open" }), I = (y, V, te) => {
|
|
1667
|
+
let re;
|
|
1668
|
+
if (this.hasAttribute(V)) {
|
|
1669
|
+
const C = this.getAttribute(V);
|
|
1654
1670
|
if (/^#[0-9A-F]{6}$/i.test(C)) {
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1671
|
+
const ze = parseInt(C.slice(1, 3), 16), T = parseInt(C.slice(3, 5), 16), M = parseInt(C.slice(5, 7), 16);
|
|
1672
|
+
re = `${ze} ${T} ${M}`;
|
|
1657
1673
|
}
|
|
1658
1674
|
}
|
|
1659
|
-
return
|
|
1675
|
+
return re = re || te, `:host { --${y}: ${re}; } .partbot-mmyvs-container { --${y}: ${re}; }`;
|
|
1660
1676
|
};
|
|
1661
|
-
let X =
|
|
1677
|
+
let X = I(
|
|
1662
1678
|
"partbot-theme",
|
|
1663
1679
|
"data-button-color",
|
|
1664
1680
|
"0 0 0"
|
|
1665
|
-
), Y =
|
|
1681
|
+
), Y = I(
|
|
1666
1682
|
"partbot-button-color",
|
|
1667
1683
|
"data-button-color",
|
|
1668
1684
|
"0 0 0"
|
|
1669
|
-
),
|
|
1685
|
+
), U = I(
|
|
1670
1686
|
"partbot-button-hover-color",
|
|
1671
1687
|
"data-button-hover-color",
|
|
1672
1688
|
"0 0 0"
|
|
1673
|
-
),
|
|
1689
|
+
), q = I(
|
|
1674
1690
|
"partbot-button-label-color",
|
|
1675
1691
|
"data-button-label-color",
|
|
1676
1692
|
"255 255 255"
|
|
1677
|
-
), Z =
|
|
1693
|
+
), Z = I(
|
|
1678
1694
|
"partbot-button-hover-label-color",
|
|
1679
1695
|
"data-button-hover-label-color",
|
|
1680
1696
|
"255 255 255"
|
|
1681
|
-
),
|
|
1697
|
+
), N = I(
|
|
1682
1698
|
"partbot-mobile-background-color",
|
|
1683
1699
|
"data-mobile-background-color",
|
|
1684
1700
|
"0 0 0"
|
|
1685
|
-
),
|
|
1686
|
-
const
|
|
1687
|
-
let
|
|
1701
|
+
), he = `:host { --partbot-button-border-radius: ${this.getAttribute("data-button-border-radius") || "0.375rem"}; } .partbot-mmyvs-container { --partbot-button-border-radius: ${this.getAttribute("data-button-border-radius") || "0.375rem"}; }`, g = `:host { --partbot-font-size: ${this.getAttribute("data-font-size") || "0.875rem"}; } .partbot-mmyvs-container { --partbot-font-size: ${this.getAttribute("data-font-size") || "0.875rem"}; }`, z = `:host { --partbot-font-family: ${(this.getAttribute("data-font-family") || this.getAttribute("data-font")) && (this.getAttribute("data-font-family") || this.getAttribute("data-font")).trim() !== "" ? this.getAttribute("data-font-family") || this.getAttribute("data-font") : '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif'}; } .partbot-mmyvs-container { --partbot-font-family: ${(this.getAttribute("data-font-family") || this.getAttribute("data-font")) && (this.getAttribute("data-font-family") || this.getAttribute("data-font")).trim() !== "" ? this.getAttribute("data-font-family") || this.getAttribute("data-font") : '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif'}; }`, S = `:host { --partbot-padding: ${this.getAttribute("data-padding") || "0.5rem"}; } .partbot-mmyvs-container { --partbot-padding: ${this.getAttribute("data-padding") || "0.5rem"}; }`;
|
|
1702
|
+
const fe = this.getAttribute("data-input-shadow"), le = fe === "none" ? "none" : fe || "0 1px 2px 0 rgb(0 0 0 / 0.05)";
|
|
1703
|
+
let ce = `:host { --partbot-input-shadow: ${le}; } .partbot-mmyvs-container { --partbot-input-shadow: ${le}; }`;
|
|
1688
1704
|
const w = this.getAttribute("data-input-border-color");
|
|
1689
|
-
let
|
|
1705
|
+
let L = "229 231 235";
|
|
1690
1706
|
if (w)
|
|
1691
1707
|
if (/^#[0-9A-F]{6}$/i.test(w)) {
|
|
1692
|
-
const y = parseInt(w.slice(1, 3), 16),
|
|
1693
|
-
|
|
1694
|
-
} else /^\d+\s+\d+\s+\d+$/.test(w) && (
|
|
1695
|
-
let
|
|
1708
|
+
const y = parseInt(w.slice(1, 3), 16), V = parseInt(w.slice(3, 5), 16), te = parseInt(w.slice(5, 7), 16);
|
|
1709
|
+
L = `${y} ${V} ${te}`;
|
|
1710
|
+
} else /^\d+\s+\d+\s+\d+$/.test(w) && (L = w);
|
|
1711
|
+
let we = `:host { --partbot-input-border-color: ${L}; } .partbot-mmyvs-container { --partbot-input-border-color: ${L}; }`;
|
|
1696
1712
|
const s = this.getAttribute("data-input-border-width") || "1px";
|
|
1697
1713
|
let b = `:host { --partbot-input-border-width: ${s}; } .partbot-mmyvs-container { --partbot-input-border-width: ${s}; }`;
|
|
1698
|
-
|
|
1699
|
-
const
|
|
1700
|
-
if (!
|
|
1701
|
-
console.warn("Missing attributes: " + (
|
|
1714
|
+
f.textContent += X, f.textContent += Y, f.textContent += U, f.textContent += q, f.textContent += Z, f.textContent += N, f.textContent += he, f.textContent += g, f.textContent += z, f.textContent += S, f.textContent += ce, f.textContent += we, f.textContent += b, K.appendChild(f), K.appendChild(d);
|
|
1715
|
+
const E = this.getAttribute("data-api-key");
|
|
1716
|
+
if (!E) {
|
|
1717
|
+
console.warn("Missing attributes: " + (E ? "" : "data-api-key "));
|
|
1702
1718
|
return;
|
|
1703
1719
|
}
|
|
1704
|
-
const
|
|
1705
|
-
for (let y = 0; y <
|
|
1706
|
-
const { name:
|
|
1707
|
-
if (
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1720
|
+
const Ce = this.attributes, _e = {};
|
|
1721
|
+
for (let y = 0; y < Ce.length; y++) {
|
|
1722
|
+
const { name: V, value: te } = Ce[y];
|
|
1723
|
+
if (V.startsWith("data-")) {
|
|
1724
|
+
const re = V.slice(5).replace(/-([a-z])/g, (C) => C[1].toUpperCase());
|
|
1725
|
+
_e[re] = te === "true" ? !0 : te === "false" ? !1 : te;
|
|
1710
1726
|
}
|
|
1711
1727
|
}
|
|
1712
|
-
|
|
1713
|
-
const
|
|
1714
|
-
Pt.render(
|
|
1728
|
+
Qt(this);
|
|
1729
|
+
const ye = /* @__PURE__ */ a(qt, { ..._e });
|
|
1730
|
+
Pt.render(ye, d);
|
|
1715
1731
|
}
|
|
1716
1732
|
}
|
|
1717
|
-
customElements.define("vehicle-search",
|
|
1733
|
+
customElements.define("vehicle-search", Jt);
|
|
1718
1734
|
export {
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1735
|
+
qt as VehicleSearch,
|
|
1736
|
+
qt as default,
|
|
1737
|
+
pr as vehicleSearchCssUrl
|
|
1722
1738
|
};
|