@cartbot/vehicle-search-beta 3.0.43 → 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 +608 -594
- 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,34 +405,34 @@ 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
|
-
),
|
|
435
|
+
), Je.__loaded || Je.init("phc_mLZkVvweXDfwCPYS7kSCxoAxgQUkw8fgyDiplKnleGw", {
|
|
432
436
|
api_host: "https://t.partbot.io",
|
|
433
437
|
ui_host: "https://us.posthog.com",
|
|
434
438
|
defaults: "2026-01-30",
|
|
@@ -438,8 +442,8 @@ function Kt({
|
|
|
438
442
|
disable_session_recording: !1
|
|
439
443
|
});
|
|
440
444
|
}, []);
|
|
441
|
-
const [
|
|
442
|
-
if (!
|
|
445
|
+
const [ve, xt] = j({}), [Xt, kt] = j(""), st = D(async () => {
|
|
446
|
+
if (!h)
|
|
443
447
|
return;
|
|
444
448
|
const r = `${s ? "https://api.cartbot.io" : "https://api.partbot.io"}/v1/vehicles/auth`;
|
|
445
449
|
try {
|
|
@@ -447,12 +451,12 @@ function Kt({
|
|
|
447
451
|
method: "POST",
|
|
448
452
|
headers: {
|
|
449
453
|
"Content-Type": "application/json",
|
|
450
|
-
Authorization: `Bearer ${
|
|
454
|
+
Authorization: `Bearer ${h}`
|
|
451
455
|
},
|
|
452
456
|
body: JSON.stringify(
|
|
453
457
|
(() => {
|
|
454
|
-
const
|
|
455
|
-
return w && (
|
|
458
|
+
const u = { use_store_vehicles: L };
|
|
459
|
+
return w && (u.store = w), u;
|
|
456
460
|
})()
|
|
457
461
|
)
|
|
458
462
|
});
|
|
@@ -460,73 +464,83 @@ function Kt({
|
|
|
460
464
|
throw new Error(`Error: ${n.status} ${n.statusText}`);
|
|
461
465
|
const {
|
|
462
466
|
merchant: o,
|
|
463
|
-
vehicle_makes:
|
|
467
|
+
vehicle_makes: p,
|
|
464
468
|
vehicle_models: i,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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,
|
|
468
476
|
// Fallback for backward compatibility
|
|
469
|
-
algolia_index_name:
|
|
477
|
+
algolia_index_name: _,
|
|
470
478
|
// Fallback for backward compatibility
|
|
471
|
-
store_index_name:
|
|
472
|
-
store_popular_makes:
|
|
479
|
+
store_index_name: W,
|
|
480
|
+
store_popular_makes: k,
|
|
473
481
|
// Array of popular make values for this store (from PostHog)
|
|
474
|
-
store_popular_models:
|
|
482
|
+
store_popular_models: R
|
|
475
483
|
// Object mapping makes to popular models: { "TOYOTA": ["HILUX", "LANDCRUISER"], ... }
|
|
476
|
-
} = await n.json(),
|
|
477
|
-
|
|
478
|
-
...
|
|
479
|
-
refinement:
|
|
480
|
-
})),
|
|
481
|
-
|
|
482
|
-
|
|
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
|
|
483
497
|
});
|
|
484
498
|
} catch (n) {
|
|
485
|
-
console.error("[VehicleSearch] Auth failed:", n), kt(n),
|
|
499
|
+
console.error("[VehicleSearch] Auth failed:", n), kt(n), $e({});
|
|
486
500
|
}
|
|
487
|
-
}, [
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}, [
|
|
491
|
-
if (
|
|
501
|
+
}, [h, w, L, s]);
|
|
502
|
+
B(() => {
|
|
503
|
+
st();
|
|
504
|
+
}, [st]), B(() => {
|
|
505
|
+
if (ve.searchKey) {
|
|
492
506
|
try {
|
|
493
|
-
|
|
494
|
-
host: "https://search.partbot.io",
|
|
495
|
-
apiKey:
|
|
496
|
-
}), 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);
|
|
497
511
|
const t = new mt({
|
|
498
512
|
host: "https://partbot-meilisearch-cache.partbot.workers.dev",
|
|
499
513
|
// Cloudflare Worker endpoint
|
|
500
|
-
apiKey:
|
|
514
|
+
apiKey: ve.searchKey
|
|
501
515
|
});
|
|
502
|
-
|
|
516
|
+
ze.current = t.index("otto_v1_vehicle_mmy");
|
|
503
517
|
} catch (t) {
|
|
504
518
|
console.error("[VehicleSearch] Failed to initialize Meilisearch:", t);
|
|
505
519
|
}
|
|
506
520
|
return () => {
|
|
507
|
-
|
|
521
|
+
re.current = null;
|
|
508
522
|
};
|
|
509
523
|
}
|
|
510
|
-
}, [
|
|
511
|
-
const [G, Ct] =
|
|
524
|
+
}, [ve.searchKey, h]);
|
|
525
|
+
const [G, Ct] = j(!1), lt = D(() => {
|
|
512
526
|
function t(i) {
|
|
513
527
|
if (!i) return "rgba(0,0,0,1)";
|
|
514
|
-
var
|
|
515
|
-
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)";
|
|
516
530
|
}
|
|
517
531
|
function r() {
|
|
518
532
|
var i = document.createElement("div");
|
|
519
533
|
document.head.appendChild(i);
|
|
520
|
-
var
|
|
521
|
-
return document.head.removeChild(i),
|
|
534
|
+
var v = window.getComputedStyle(i).backgroundColor;
|
|
535
|
+
return document.head.removeChild(i), v;
|
|
522
536
|
}
|
|
523
537
|
const n = document.querySelector("vehicle-search");
|
|
524
538
|
let o;
|
|
525
|
-
n ? o = t(n) : o = t(
|
|
526
|
-
const
|
|
527
|
-
Ct(
|
|
539
|
+
n ? o = t(n) : o = t(Ce.current);
|
|
540
|
+
const p = Rt(o).isDark();
|
|
541
|
+
Ct(p);
|
|
528
542
|
}, []);
|
|
529
|
-
|
|
543
|
+
B(() => {
|
|
530
544
|
async function t() {
|
|
531
545
|
if (!e.make || !C.current)
|
|
532
546
|
return;
|
|
@@ -541,24 +555,24 @@ function Kt({
|
|
|
541
555
|
), e.series && r.push(`series:${e.series.refinement}`), e.engine && r.push(`engine:${e.engine.refinement}`), e.engine_capacity && r.push(
|
|
542
556
|
`engine_capacity:${e.engine_capacity.refinement}`
|
|
543
557
|
);
|
|
544
|
-
let
|
|
545
|
-
filter:
|
|
558
|
+
let p = (await C.current.search("", {
|
|
559
|
+
filter: Te(r, n),
|
|
546
560
|
attributesToRetrieve: ["otto_id"],
|
|
547
561
|
limit: 500
|
|
548
562
|
// Reduced from 1000 for faster queries
|
|
549
563
|
})).hits.map((l) => l.otto_id);
|
|
550
|
-
|
|
551
|
-
let
|
|
564
|
+
Se(p);
|
|
565
|
+
let v = {
|
|
552
566
|
...Object.fromEntries(
|
|
553
567
|
Object.entries(e || {}).map(([l, c]) => [l, c && c.value || null]).filter(([l, c]) => c !== null)
|
|
554
568
|
),
|
|
555
|
-
merchant:
|
|
569
|
+
merchant: _e.current
|
|
556
570
|
};
|
|
557
|
-
|
|
571
|
+
Je.capture("vehicle select", v);
|
|
558
572
|
}
|
|
559
573
|
t();
|
|
560
574
|
}, [e, C, b]);
|
|
561
|
-
const
|
|
575
|
+
const He = (t) => q ? `${q}${t}` : t, _t = (t) => q ? t.replace(new RegExp(`^${q}`), "") : t, ct = D(() => {
|
|
562
576
|
const t = new URL(window.location.href).searchParams, r = [
|
|
563
577
|
"make",
|
|
564
578
|
"model",
|
|
@@ -567,9 +581,9 @@ function Kt({
|
|
|
567
581
|
"series",
|
|
568
582
|
"engine",
|
|
569
583
|
"engine_capacity"
|
|
570
|
-
], n = r.map(
|
|
584
|
+
], n = r.map(He), o = {}, p = /^filter\.p\.m\.app--\d+--partbot\.vehicle_(\w+)$/;
|
|
571
585
|
for (const [l, c] of t.entries()) {
|
|
572
|
-
const $ = l.match(
|
|
586
|
+
const $ = l.match(p);
|
|
573
587
|
if ($) {
|
|
574
588
|
const A = $[1];
|
|
575
589
|
if (A === "year_tokens" && c) {
|
|
@@ -580,8 +594,8 @@ function Kt({
|
|
|
580
594
|
}
|
|
581
595
|
continue;
|
|
582
596
|
}
|
|
583
|
-
let
|
|
584
|
-
|
|
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);
|
|
585
599
|
}
|
|
586
600
|
}
|
|
587
601
|
const i = Object.fromEntries(
|
|
@@ -609,96 +623,96 @@ function Kt({
|
|
|
609
623
|
if (c != null && c.vehicle) {
|
|
610
624
|
const $ = c.vehicle;
|
|
611
625
|
for (const A of r) {
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
614
|
-
if (A === "year" && /^\d{4}$/.test(
|
|
615
|
-
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);
|
|
616
630
|
i[A] = {
|
|
617
631
|
value: x,
|
|
618
632
|
refinement: x
|
|
619
633
|
};
|
|
620
634
|
} else
|
|
621
|
-
i[A] = { value:
|
|
622
|
-
else if (
|
|
623
|
-
if (A === "year" && /^\d{4}$/.test(
|
|
624
|
-
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);
|
|
625
639
|
i[A] = {
|
|
626
640
|
value: x,
|
|
627
641
|
refinement: x
|
|
628
642
|
};
|
|
629
643
|
} else
|
|
630
644
|
i[A] = {
|
|
631
|
-
value:
|
|
632
|
-
refinement:
|
|
645
|
+
value: m.value,
|
|
646
|
+
refinement: m.value
|
|
633
647
|
};
|
|
634
648
|
}
|
|
635
649
|
}
|
|
636
650
|
}
|
|
637
651
|
} catch {
|
|
638
652
|
}
|
|
639
|
-
|
|
640
|
-
}, []),
|
|
641
|
-
if (
|
|
653
|
+
Q(i);
|
|
654
|
+
}, []), O = D(({ query: t, value: r, remove: n }) => {
|
|
655
|
+
if (z && "URLSearchParams" in window) {
|
|
642
656
|
let o = new URLSearchParams(window.location.search);
|
|
643
|
-
t =
|
|
644
|
-
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);
|
|
645
659
|
});
|
|
646
|
-
const
|
|
647
|
-
window.history.pushState(null, "",
|
|
660
|
+
const p = window.location.pathname + "?" + o.toString();
|
|
661
|
+
window.history.pushState(null, "", p);
|
|
648
662
|
}
|
|
649
|
-
}, []),
|
|
663
|
+
}, []), zt = D(() => {
|
|
650
664
|
var n;
|
|
651
665
|
const t = {
|
|
652
|
-
vehicle_ids:
|
|
666
|
+
vehicle_ids: be,
|
|
653
667
|
vehicle: (n = e == null ? void 0 : e.make) != null && n.value ? e : {}
|
|
654
668
|
};
|
|
655
|
-
|
|
669
|
+
ce && ce(t);
|
|
656
670
|
const r = new CustomEvent("vehicle-search-submit", {
|
|
657
671
|
detail: t
|
|
658
672
|
});
|
|
659
673
|
window.dispatchEvent(r), document.dispatchEvent(r), setTimeout(() => {
|
|
660
|
-
|
|
674
|
+
Ze(!1);
|
|
661
675
|
}, 900);
|
|
662
|
-
}, [
|
|
663
|
-
var n, o,
|
|
676
|
+
}, [be, ce]), dt = D(() => {
|
|
677
|
+
var n, o, p, i, v, l, c, $, A;
|
|
664
678
|
const t = {
|
|
665
|
-
vehicle_ids:
|
|
679
|
+
vehicle_ids: be,
|
|
666
680
|
vehicle: (n = e == null ? void 0 : e.make) != null && n.value ? e : {},
|
|
667
|
-
userSelected:
|
|
681
|
+
userSelected: T.current
|
|
668
682
|
// Flag to indicate if user actively selected
|
|
669
683
|
};
|
|
670
684
|
S && S(t);
|
|
671
685
|
const r = new CustomEvent("vehicle-search-change", {
|
|
672
686
|
detail: t
|
|
673
687
|
});
|
|
674
|
-
if (
|
|
688
|
+
if (T.current === !0) {
|
|
675
689
|
localStorage.removeItem("partbot_plate_details");
|
|
676
|
-
const
|
|
677
|
-
description: `${((o = e.make) == null ? void 0 : o.value) || ""} ${((
|
|
678
|
-
vehicle_ids:
|
|
679
|
-
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), {}) : {}
|
|
680
694
|
});
|
|
681
695
|
localStorage.setItem(
|
|
682
696
|
"partbot_selected_vehicle",
|
|
683
|
-
|
|
684
|
-
), It.set("partbot_selected_vehicle",
|
|
697
|
+
m
|
|
698
|
+
), It.set("partbot_selected_vehicle", m, {
|
|
685
699
|
secure: !0
|
|
686
700
|
});
|
|
687
701
|
}
|
|
688
|
-
window.dispatchEvent(r),
|
|
689
|
-
|
|
702
|
+
window.dispatchEvent(r), T.current && document.dispatchEvent(r), bt.current = be, setTimeout(() => {
|
|
703
|
+
Ze(!1);
|
|
690
704
|
}, 900);
|
|
691
|
-
}, [
|
|
692
|
-
() => Tt(
|
|
693
|
-
[
|
|
705
|
+
}, [be, S]), me = We(
|
|
706
|
+
() => Tt(dt, 100),
|
|
707
|
+
[dt]
|
|
694
708
|
);
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}, [
|
|
698
|
-
|
|
699
|
-
}, [
|
|
709
|
+
B(() => {
|
|
710
|
+
me();
|
|
711
|
+
}, [be, me]), B(() => () => {
|
|
712
|
+
me.cancel();
|
|
713
|
+
}, [me]), B(() => {
|
|
700
714
|
const t = () => {
|
|
701
|
-
|
|
715
|
+
T.current = !1, me.cancel(), Q({
|
|
702
716
|
make: null,
|
|
703
717
|
model: null,
|
|
704
718
|
year: null,
|
|
@@ -707,7 +721,7 @@ function Kt({
|
|
|
707
721
|
variant: null,
|
|
708
722
|
engine: null,
|
|
709
723
|
engine_capacity: null
|
|
710
|
-
}),
|
|
724
|
+
}), Se([]);
|
|
711
725
|
};
|
|
712
726
|
return window.addEventListener("plate-search-change", t), () => {
|
|
713
727
|
window.removeEventListener(
|
|
@@ -715,9 +729,9 @@ function Kt({
|
|
|
715
729
|
t
|
|
716
730
|
);
|
|
717
731
|
};
|
|
718
|
-
}, [
|
|
732
|
+
}, [me]), B(() => {
|
|
719
733
|
const t = () => {
|
|
720
|
-
|
|
734
|
+
T.current = !1, me.cancel(), Q({
|
|
721
735
|
make: null,
|
|
722
736
|
model: null,
|
|
723
737
|
year: null,
|
|
@@ -726,38 +740,38 @@ function Kt({
|
|
|
726
740
|
variant: null,
|
|
727
741
|
engine: null,
|
|
728
742
|
engine_capacity: null
|
|
729
|
-
}),
|
|
743
|
+
}), Se([]);
|
|
730
744
|
};
|
|
731
745
|
return document.addEventListener("partbot-clear-vehicle", t), () => {
|
|
732
746
|
document.removeEventListener("partbot-clear-vehicle", t);
|
|
733
747
|
};
|
|
734
|
-
}, [
|
|
735
|
-
|
|
736
|
-
}, [
|
|
737
|
-
|
|
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("", {
|
|
738
752
|
attributesToRetrieve: ["year_from", "year_to"],
|
|
739
753
|
limit: 1e4
|
|
740
754
|
}).then(({ hits: t }) => {
|
|
741
|
-
const r = t.map((
|
|
742
|
-
{ length:
|
|
743
|
-
(
|
|
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 })
|
|
744
758
|
).reverse();
|
|
745
759
|
Me(i);
|
|
746
760
|
}).catch((t) => {
|
|
747
761
|
console.error("[VehicleSearch] Error loading year range:", t);
|
|
748
762
|
});
|
|
749
|
-
}, [
|
|
750
|
-
typeof document > "u" ||
|
|
751
|
-
}, [
|
|
752
|
-
const
|
|
763
|
+
}, [M, ve.searchKey, xe.length, e.year]), B(() => {
|
|
764
|
+
typeof document > "u" || lt();
|
|
765
|
+
}, [lt]);
|
|
766
|
+
const pt = D(
|
|
753
767
|
(t) => {
|
|
754
|
-
|
|
768
|
+
T.current = !0, de([]), !M && !b && Me([]), Be([]), Pe([]), Ie([]), Ve([]), Le([]), Q((r) => ({
|
|
755
769
|
make: t,
|
|
756
|
-
year:
|
|
757
|
-
})),
|
|
770
|
+
year: M || b ? r.year : null
|
|
771
|
+
})), O({
|
|
758
772
|
query: "make",
|
|
759
773
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
760
|
-
remove:
|
|
774
|
+
remove: M ? ["model", "body", "series", "engine", "variant", "engine_capacity"] : b ? [
|
|
761
775
|
"model",
|
|
762
776
|
"body",
|
|
763
777
|
"series",
|
|
@@ -773,25 +787,25 @@ function Kt({
|
|
|
773
787
|
"variant",
|
|
774
788
|
"engine_capacity"
|
|
775
789
|
]
|
|
776
|
-
}), t ||
|
|
790
|
+
}), t || Se([]);
|
|
777
791
|
},
|
|
778
|
-
[
|
|
779
|
-
),
|
|
792
|
+
[O, M, b]
|
|
793
|
+
), vt = D(
|
|
780
794
|
(t) => {
|
|
781
|
-
|
|
795
|
+
T.current = !0, Q((r) => ({
|
|
782
796
|
...r,
|
|
783
797
|
model: t !== "" ? t : null,
|
|
784
|
-
year:
|
|
798
|
+
year: M || b ? r.year : null,
|
|
785
799
|
// Preserve year in YMM mode or yearOptional mode
|
|
786
800
|
body: null,
|
|
787
801
|
series: null,
|
|
788
802
|
variant: null,
|
|
789
803
|
engine: null,
|
|
790
804
|
engine_capacity: null
|
|
791
|
-
})), !
|
|
805
|
+
})), !M && !b && Me([]), Be([]), Pe([]), Ie([]), Ve([]), Le([]), O({
|
|
792
806
|
query: "model",
|
|
793
807
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
794
|
-
remove:
|
|
808
|
+
remove: M ? ["body", "series", "engine", "variant", "engine_capacity"] : b ? ["body", "series", "engine", "variant", "engine_capacity"] : [
|
|
795
809
|
"year",
|
|
796
810
|
"body",
|
|
797
811
|
"series",
|
|
@@ -801,12 +815,12 @@ function Kt({
|
|
|
801
815
|
]
|
|
802
816
|
});
|
|
803
817
|
},
|
|
804
|
-
[
|
|
805
|
-
),
|
|
818
|
+
[O, M, b]
|
|
819
|
+
), ut = D(
|
|
806
820
|
(t) => {
|
|
807
|
-
|
|
821
|
+
T.current = !0, M ? (Ye([]), de([]), Q({
|
|
808
822
|
year: t !== "" ? t : null
|
|
809
|
-
}), (!t || t === "") && Me([])) :
|
|
823
|
+
}), (!t || t === "") && Me([])) : Q(b ? (r) => ({
|
|
810
824
|
...r,
|
|
811
825
|
year: t !== "" ? t : null
|
|
812
826
|
}) : (r) => ({
|
|
@@ -817,10 +831,10 @@ function Kt({
|
|
|
817
831
|
variant: null,
|
|
818
832
|
engine: null,
|
|
819
833
|
engine_capacity: null
|
|
820
|
-
})), b || (
|
|
834
|
+
})), b || (Be([]), Pe([]), Ie([]), Ve([]), Le([])), O({
|
|
821
835
|
query: "year",
|
|
822
836
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
823
|
-
remove:
|
|
837
|
+
remove: M ? [
|
|
824
838
|
"make",
|
|
825
839
|
"model",
|
|
826
840
|
"body",
|
|
@@ -829,67 +843,67 @@ function Kt({
|
|
|
829
843
|
"engine",
|
|
830
844
|
"engine_capacity"
|
|
831
845
|
] : b ? [] : ["body", "series", "variant", "engine", "engine_capacity"]
|
|
832
|
-
}), !b && (!t || t === "") &&
|
|
846
|
+
}), !b && (!t || t === "") && Se([]);
|
|
833
847
|
},
|
|
834
|
-
[
|
|
835
|
-
),
|
|
848
|
+
[O, M, b]
|
|
849
|
+
), Mt = D(
|
|
836
850
|
(t) => {
|
|
837
|
-
|
|
851
|
+
T.current = !0, Q((r) => ({
|
|
838
852
|
...r,
|
|
839
853
|
body: t !== "" ? t : null
|
|
840
|
-
})),
|
|
854
|
+
})), O({
|
|
841
855
|
query: "body",
|
|
842
856
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
843
857
|
});
|
|
844
858
|
},
|
|
845
|
-
[
|
|
846
|
-
), St =
|
|
859
|
+
[O]
|
|
860
|
+
), St = D(
|
|
847
861
|
(t) => {
|
|
848
|
-
|
|
862
|
+
T.current = !0, Q((r) => ({
|
|
849
863
|
...r,
|
|
850
864
|
series: t !== "" ? t : null
|
|
851
|
-
})),
|
|
865
|
+
})), O({
|
|
852
866
|
query: "series",
|
|
853
867
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
854
868
|
});
|
|
855
869
|
},
|
|
856
|
-
[
|
|
857
|
-
), $t =
|
|
870
|
+
[O]
|
|
871
|
+
), $t = D(
|
|
858
872
|
(t) => {
|
|
859
|
-
|
|
873
|
+
T.current = !0, Q((r) => ({
|
|
860
874
|
...r,
|
|
861
875
|
variant: t !== "" ? t : null
|
|
862
|
-
})),
|
|
876
|
+
})), O({
|
|
863
877
|
query: "variant",
|
|
864
878
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
865
879
|
});
|
|
866
880
|
},
|
|
867
|
-
[
|
|
868
|
-
), At =
|
|
881
|
+
[O]
|
|
882
|
+
), At = D(
|
|
869
883
|
(t) => {
|
|
870
|
-
|
|
884
|
+
T.current = !0, Q((r) => ({
|
|
871
885
|
...r,
|
|
872
886
|
engine: t !== "" ? t : null
|
|
873
|
-
})),
|
|
887
|
+
})), O({
|
|
874
888
|
query: "engine",
|
|
875
889
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
876
890
|
});
|
|
877
891
|
},
|
|
878
|
-
[
|
|
879
|
-
), Et =
|
|
892
|
+
[O]
|
|
893
|
+
), Et = D(
|
|
880
894
|
(t) => {
|
|
881
|
-
|
|
895
|
+
T.current = !0, Q((r) => ({
|
|
882
896
|
...r,
|
|
883
897
|
engine_capacity: t !== "" ? t : null
|
|
884
|
-
})),
|
|
898
|
+
})), O({
|
|
885
899
|
query: "engine_capacity",
|
|
886
900
|
value: (t == null ? void 0 : t.value) ?? ""
|
|
887
901
|
});
|
|
888
902
|
},
|
|
889
|
-
[
|
|
903
|
+
[O]
|
|
890
904
|
);
|
|
891
|
-
|
|
892
|
-
|
|
905
|
+
B(() => {
|
|
906
|
+
M && e.year && C.current && (async () => {
|
|
893
907
|
try {
|
|
894
908
|
const r = await C.current.search("", {
|
|
895
909
|
filter: `year_from <= ${e.year.value} AND year_to >= ${e.year.value}`,
|
|
@@ -904,82 +918,82 @@ function Kt({
|
|
|
904
918
|
});
|
|
905
919
|
});
|
|
906
920
|
let o = Array.from(n.values());
|
|
907
|
-
|
|
908
|
-
(i) =>
|
|
909
|
-
|
|
921
|
+
ie.size > 0 ? o = o.filter(
|
|
922
|
+
(i) => ie.has(
|
|
923
|
+
F(i.value)
|
|
910
924
|
)
|
|
911
|
-
) :
|
|
912
|
-
(i) =>
|
|
913
|
-
|
|
925
|
+
) : pe.size > 0 && (o = o.filter(
|
|
926
|
+
(i) => pe.has(
|
|
927
|
+
F(i.value)
|
|
914
928
|
)
|
|
915
929
|
));
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
const l =
|
|
919
|
-
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);
|
|
920
934
|
}) : o.sort(
|
|
921
|
-
(i,
|
|
922
|
-
),
|
|
935
|
+
(i, v) => v.popularity === i.popularity ? i.value.localeCompare(v.value) : v.popularity - i.popularity
|
|
936
|
+
), Ye(o);
|
|
923
937
|
} catch (r) {
|
|
924
938
|
console.error("[VehicleSearch] Error loading makes for year:", r);
|
|
925
939
|
}
|
|
926
940
|
})();
|
|
927
|
-
}, [
|
|
928
|
-
const jt =
|
|
941
|
+
}, [M, e.year, ie, pe]);
|
|
942
|
+
const jt = D(() => {
|
|
929
943
|
(async () => {
|
|
930
944
|
let r = [];
|
|
931
|
-
if (
|
|
932
|
-
r =
|
|
945
|
+
if (ye.current && ye.current.length)
|
|
946
|
+
r = ye.current;
|
|
933
947
|
else if (C.current)
|
|
934
948
|
try {
|
|
935
949
|
const n = await C.current.search("", {
|
|
936
950
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
937
951
|
limit: 1e3
|
|
938
952
|
}), o = /* @__PURE__ */ new Map();
|
|
939
|
-
n.hits.forEach((
|
|
940
|
-
|
|
941
|
-
value:
|
|
942
|
-
refinement:
|
|
943
|
-
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
|
|
944
958
|
});
|
|
945
959
|
}), r = Array.from(o.values());
|
|
946
960
|
} catch (n) {
|
|
947
961
|
console.error("[VehicleSearch] Error loading makes:", n);
|
|
948
962
|
}
|
|
949
|
-
if (
|
|
950
|
-
(n) =>
|
|
951
|
-
)),
|
|
952
|
-
(n) =>
|
|
953
|
-
)),
|
|
954
|
-
const n = new Set(
|
|
955
|
-
r.sort((o,
|
|
956
|
-
const i = n.has(o.value),
|
|
957
|
-
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);
|
|
958
972
|
});
|
|
959
973
|
} else
|
|
960
974
|
r.sort((n, o) => n.popularity === o.popularity ? n.value.localeCompare(o.value) : o.popularity - n.popularity);
|
|
961
|
-
|
|
975
|
+
Ye(r);
|
|
962
976
|
})();
|
|
963
|
-
}, [
|
|
964
|
-
|
|
977
|
+
}, [ie, pe]);
|
|
978
|
+
B(() => {
|
|
965
979
|
var t;
|
|
966
980
|
if (e.make && e.make.refinement) {
|
|
967
|
-
const r = e.make.refinement, n =
|
|
968
|
-
if (o && !
|
|
969
|
-
|
|
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([]);
|
|
970
984
|
return;
|
|
971
985
|
}
|
|
972
|
-
if (!o &&
|
|
973
|
-
|
|
986
|
+
if (!o && p && !pe.has(n)) {
|
|
987
|
+
de([]);
|
|
974
988
|
return;
|
|
975
989
|
}
|
|
976
|
-
const i =
|
|
977
|
-
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))
|
|
978
992
|
), l = typeof y.current == "object" && !Array.isArray(y.current) && y.current !== null ? y.current : null;
|
|
979
993
|
let c = [];
|
|
980
994
|
if (l && (c = l[r] || [], Array.isArray(c) || (c = []), c.length === 0)) {
|
|
981
995
|
const x = Object.keys(l).find(
|
|
982
|
-
(_) =>
|
|
996
|
+
(_) => F(_) === n
|
|
983
997
|
);
|
|
984
998
|
if (x) {
|
|
985
999
|
const _ = l[x];
|
|
@@ -988,143 +1002,143 @@ function Kt({
|
|
|
988
1002
|
}
|
|
989
1003
|
const $ = new Set(
|
|
990
1004
|
c.map(
|
|
991
|
-
(x) =>
|
|
1005
|
+
(x) => F(x)
|
|
992
1006
|
)
|
|
993
1007
|
), A = $.size > 0 ? $ : null;
|
|
994
|
-
let
|
|
995
|
-
if (
|
|
996
|
-
Array.from(
|
|
1008
|
+
let m = v;
|
|
1009
|
+
if (v.size > 0 && $.size > 0 && (m = new Set(
|
|
1010
|
+
Array.from(v).filter(
|
|
997
1011
|
(x) => $.has(x)
|
|
998
1012
|
)
|
|
999
|
-
)),
|
|
1000
|
-
|
|
1013
|
+
)), v.size > 0 && m.size === 0) {
|
|
1014
|
+
de([]);
|
|
1001
1015
|
return;
|
|
1002
1016
|
}
|
|
1003
|
-
if (
|
|
1004
|
-
let _ = c.map((
|
|
1005
|
-
value:
|
|
1006
|
-
refinement:
|
|
1017
|
+
if (L && c.length > 0) {
|
|
1018
|
+
let _ = c.map((k) => ({
|
|
1019
|
+
value: k,
|
|
1020
|
+
refinement: k,
|
|
1007
1021
|
popularity: 0
|
|
1008
1022
|
// Popularity will be used from PostHog for sorting
|
|
1009
1023
|
}));
|
|
1010
|
-
_ =
|
|
1024
|
+
_ = Xe(
|
|
1011
1025
|
_,
|
|
1012
|
-
(
|
|
1013
|
-
|
|
1014
|
-
), _ =
|
|
1026
|
+
(k) => k.value,
|
|
1027
|
+
m
|
|
1028
|
+
), _ = Xe(
|
|
1015
1029
|
_,
|
|
1016
|
-
(
|
|
1030
|
+
(k) => k.value,
|
|
1017
1031
|
A
|
|
1018
1032
|
);
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
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
|
|
1025
1039
|
])
|
|
1026
1040
|
);
|
|
1027
|
-
_.sort((
|
|
1028
|
-
const
|
|
1029
|
-
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);
|
|
1030
1044
|
});
|
|
1031
1045
|
} else
|
|
1032
|
-
_.sort((
|
|
1033
|
-
|
|
1046
|
+
_.sort((k, R) => k.value.localeCompare(R.value));
|
|
1047
|
+
de(_);
|
|
1034
1048
|
return;
|
|
1035
1049
|
}
|
|
1036
|
-
if (!
|
|
1050
|
+
if (!ze.current || !h)
|
|
1037
1051
|
return;
|
|
1038
|
-
|
|
1052
|
+
ze.current.search("", {
|
|
1039
1053
|
filter: `make = "${e.make.refinement}"`,
|
|
1040
1054
|
limit: 1
|
|
1041
1055
|
// Only one document per make
|
|
1042
1056
|
}).then((x) => {
|
|
1043
|
-
var
|
|
1057
|
+
var Oe, Ue;
|
|
1044
1058
|
const { hits: _ } = x;
|
|
1045
|
-
let
|
|
1046
|
-
_.length > 0 && _[0].models && (
|
|
1047
|
-
let
|
|
1048
|
-
model: `${e.make.refinement} > ${
|
|
1049
|
-
model_popularity:
|
|
1050
|
-
})),
|
|
1051
|
-
Array.isArray(y.current) ?
|
|
1052
|
-
let
|
|
1053
|
-
if (
|
|
1054
|
-
(
|
|
1055
|
-
|
|
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)
|
|
1056
1070
|
)
|
|
1057
|
-
) : i,
|
|
1058
|
-
(
|
|
1059
|
-
|
|
1060
|
-
|
|
1071
|
+
) : i, k = k.filter(
|
|
1072
|
+
(u) => m.has(
|
|
1073
|
+
F(
|
|
1074
|
+
ke(u.model)
|
|
1061
1075
|
)
|
|
1062
1076
|
)
|
|
1063
|
-
)),
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1077
|
+
)), ae && ae.length > 0) {
|
|
1078
|
+
const u = new Set(
|
|
1079
|
+
ae.map((ue) => F(ue))
|
|
1066
1080
|
);
|
|
1067
|
-
|
|
1068
|
-
(
|
|
1069
|
-
|
|
1070
|
-
|
|
1081
|
+
k.some(
|
|
1082
|
+
(ue) => u.has(
|
|
1083
|
+
F(
|
|
1084
|
+
ke(ue.model)
|
|
1071
1085
|
)
|
|
1072
1086
|
)
|
|
1073
|
-
) && (
|
|
1074
|
-
(
|
|
1075
|
-
|
|
1076
|
-
|
|
1087
|
+
) && (k = k.filter(
|
|
1088
|
+
(ue) => u.has(
|
|
1089
|
+
F(
|
|
1090
|
+
ke(ue.model)
|
|
1077
1091
|
)
|
|
1078
1092
|
)
|
|
1079
1093
|
));
|
|
1080
1094
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
(
|
|
1095
|
+
k = Xe(
|
|
1096
|
+
k,
|
|
1097
|
+
(u) => ke(u.model),
|
|
1084
1098
|
A
|
|
1085
|
-
),
|
|
1086
|
-
const H =
|
|
1099
|
+
), k = k.filter((u) => ke(u.model) !== "").map((u) => {
|
|
1100
|
+
const H = ke(u.model);
|
|
1087
1101
|
return {
|
|
1088
1102
|
value: H,
|
|
1089
1103
|
refinement: H,
|
|
1090
|
-
popularity:
|
|
1104
|
+
popularity: u.model_popularity
|
|
1091
1105
|
};
|
|
1092
1106
|
});
|
|
1093
|
-
const
|
|
1094
|
-
if (
|
|
1095
|
-
const
|
|
1096
|
-
|
|
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())
|
|
1097
1111
|
);
|
|
1098
|
-
|
|
1099
|
-
const
|
|
1100
|
-
if (
|
|
1101
|
-
if (!
|
|
1102
|
-
if (
|
|
1103
|
-
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(
|
|
1104
1118
|
(Bt) => String(Bt).trim().toUpperCase()
|
|
1105
1119
|
);
|
|
1106
|
-
return ht.indexOf(H.value) - ht.indexOf(
|
|
1120
|
+
return ht.indexOf(H.value) - ht.indexOf(ue.value);
|
|
1107
1121
|
}
|
|
1108
|
-
return H.value.localeCompare(
|
|
1122
|
+
return H.value.localeCompare(ue.value);
|
|
1109
1123
|
});
|
|
1110
1124
|
} else
|
|
1111
|
-
|
|
1112
|
-
|
|
1125
|
+
k.sort((u, H) => u.popularity === H.popularity ? u.value.localeCompare(H.value) : H.popularity - u.popularity);
|
|
1126
|
+
de(k);
|
|
1113
1127
|
}).catch((x) => {
|
|
1114
|
-
console.error("[VehicleSearch] Error loading models:", x),
|
|
1128
|
+
console.error("[VehicleSearch] Error loading models:", x), de([]);
|
|
1115
1129
|
});
|
|
1116
1130
|
} else
|
|
1117
|
-
|
|
1131
|
+
de([]);
|
|
1118
1132
|
}, [
|
|
1119
1133
|
e.make,
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1134
|
+
d,
|
|
1135
|
+
h,
|
|
1136
|
+
M,
|
|
1123
1137
|
e.year,
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
]),
|
|
1138
|
+
L,
|
|
1139
|
+
ie,
|
|
1140
|
+
pe
|
|
1141
|
+
]), B(() => {
|
|
1128
1142
|
if (C.current && e.make && e.model) {
|
|
1129
1143
|
let t = [
|
|
1130
1144
|
`model:${e.make.refinement} > ${e.model.refinement}`
|
|
@@ -1134,18 +1148,18 @@ function Kt({
|
|
|
1134
1148
|
), e.series && t.push(`series:${e.series.refinement}`), e.engine && t.push(`engine:${e.engine.refinement}`), e.engine_capacity && t.push(
|
|
1135
1149
|
`engine_capacity:${e.engine_capacity.refinement}`
|
|
1136
1150
|
)), C.current.search("", {
|
|
1137
|
-
filter:
|
|
1151
|
+
filter: Te(t, []),
|
|
1138
1152
|
attributesToRetrieve: ["year_from", "year_to", "otto_id"],
|
|
1139
1153
|
limit: 200
|
|
1140
1154
|
// Reduced from 1000 for faster queries
|
|
1141
1155
|
}).then(({ hits: r }) => {
|
|
1142
|
-
const n = r.map((l) => l.year_from), o = Math.min(...n),
|
|
1143
|
-
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, {
|
|
1144
1158
|
length: i + 1 - o
|
|
1145
1159
|
}).map(function(l, c) {
|
|
1146
1160
|
return c + o;
|
|
1147
1161
|
});
|
|
1148
|
-
|
|
1162
|
+
v = v.reverse().map((l) => ({ value: l, refinement: l })), Me(v);
|
|
1149
1163
|
}).catch((r) => {
|
|
1150
1164
|
console.error("[VehicleSearch] Error fetching years:", r);
|
|
1151
1165
|
});
|
|
@@ -1153,13 +1167,13 @@ function Kt({
|
|
|
1153
1167
|
}, [
|
|
1154
1168
|
e.model,
|
|
1155
1169
|
e.make,
|
|
1156
|
-
|
|
1170
|
+
M,
|
|
1157
1171
|
b,
|
|
1158
1172
|
e.body,
|
|
1159
1173
|
e.series,
|
|
1160
1174
|
e.engine,
|
|
1161
1175
|
e.engine_capacity
|
|
1162
|
-
]),
|
|
1176
|
+
]), B(() => {
|
|
1163
1177
|
const t = b ? e.make && e.model : e.year && e.make && e.model;
|
|
1164
1178
|
if (C.current && t) {
|
|
1165
1179
|
const r = e.year ? [
|
|
@@ -1167,7 +1181,7 @@ function Kt({
|
|
|
1167
1181
|
`year_to >= ${e.year.value}`
|
|
1168
1182
|
] : [];
|
|
1169
1183
|
C.current.search("", {
|
|
1170
|
-
filter:
|
|
1184
|
+
filter: Te(
|
|
1171
1185
|
[`model:${e.make.refinement} > ${e.model.refinement}`],
|
|
1172
1186
|
r
|
|
1173
1187
|
),
|
|
@@ -1177,23 +1191,23 @@ function Kt({
|
|
|
1177
1191
|
n = [...new Map(n.map((o) => [o.body, o])).values()].map((o) => ({
|
|
1178
1192
|
value: o.body.match(/[^>]*$/)[0].trim(),
|
|
1179
1193
|
refinement: o.body.match(/[^>]*$/)[0].trim()
|
|
1180
|
-
})).filter((o) => o.value),
|
|
1194
|
+
})).filter((o) => o.value), Be(n);
|
|
1181
1195
|
});
|
|
1182
1196
|
}
|
|
1183
1197
|
}, [e.year, e.make, e.model, b]);
|
|
1184
|
-
const
|
|
1198
|
+
const Ae = D(({ hits: t, attribute: r, stateCallback: n }) => {
|
|
1185
1199
|
let o = [
|
|
1186
|
-
...new Map(t.map((
|
|
1187
|
-
].map((
|
|
1188
|
-
value:
|
|
1189
|
-
refinement:
|
|
1190
|
-
})).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);
|
|
1191
1205
|
n(o);
|
|
1192
|
-
}, []), Nt =
|
|
1193
|
-
const t =
|
|
1206
|
+
}, []), Nt = D(() => {
|
|
1207
|
+
const t = De.current ? De.current.length + 3 : 3, r = le ? t + 1 : t;
|
|
1194
1208
|
return `vs:lg:grid-cols-${r > 8 ? 8 : r}`;
|
|
1195
|
-
}, [
|
|
1196
|
-
|
|
1209
|
+
}, [le]);
|
|
1210
|
+
B(() => {
|
|
1197
1211
|
const t = b ? e.make && e.model : e.make && e.model && e.year;
|
|
1198
1212
|
if (C.current && t) {
|
|
1199
1213
|
let r = [
|
|
@@ -1210,7 +1224,7 @@ function Kt({
|
|
|
1210
1224
|
`year_to >= ${e.year.value}`
|
|
1211
1225
|
] : [];
|
|
1212
1226
|
C.current.search("", {
|
|
1213
|
-
filter:
|
|
1227
|
+
filter: Te(r, n),
|
|
1214
1228
|
attributesToRetrieve: [
|
|
1215
1229
|
"series",
|
|
1216
1230
|
"engine_capacity",
|
|
@@ -1221,22 +1235,22 @@ function Kt({
|
|
|
1221
1235
|
],
|
|
1222
1236
|
limit: 1e3
|
|
1223
1237
|
}).then(({ hits: o }) => {
|
|
1224
|
-
|
|
1238
|
+
Ae({
|
|
1225
1239
|
hits: o,
|
|
1226
1240
|
attribute: "series",
|
|
1227
|
-
stateCallback:
|
|
1228
|
-
}),
|
|
1241
|
+
stateCallback: Pe
|
|
1242
|
+
}), Ae({
|
|
1229
1243
|
hits: o,
|
|
1230
1244
|
attribute: "variant",
|
|
1231
|
-
stateCallback:
|
|
1232
|
-
}),
|
|
1245
|
+
stateCallback: Ie
|
|
1246
|
+
}), Ae({
|
|
1233
1247
|
hits: o,
|
|
1234
1248
|
attribute: "engine",
|
|
1235
|
-
stateCallback:
|
|
1236
|
-
}),
|
|
1249
|
+
stateCallback: Le
|
|
1250
|
+
}), Ae({
|
|
1237
1251
|
hits: o,
|
|
1238
1252
|
attribute: "engine_capacity",
|
|
1239
|
-
stateCallback:
|
|
1253
|
+
stateCallback: Ve
|
|
1240
1254
|
});
|
|
1241
1255
|
});
|
|
1242
1256
|
}
|
|
@@ -1246,56 +1260,56 @@ function Kt({
|
|
|
1246
1260
|
e.variant,
|
|
1247
1261
|
e.engine,
|
|
1248
1262
|
e.engine_capacity,
|
|
1249
|
-
|
|
1263
|
+
Ae,
|
|
1250
1264
|
e.make,
|
|
1251
1265
|
e.model,
|
|
1252
1266
|
e.year,
|
|
1253
1267
|
b
|
|
1254
1268
|
]);
|
|
1255
|
-
const [
|
|
1256
|
-
return
|
|
1269
|
+
const [Fe, Ke] = j(!1);
|
|
1270
|
+
return B(() => {
|
|
1257
1271
|
if (g)
|
|
1258
|
-
return
|
|
1272
|
+
return Fe ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
1259
1273
|
document.body.style.overflow = "";
|
|
1260
1274
|
};
|
|
1261
|
-
}, [
|
|
1275
|
+
}, [Fe, g]), /* @__PURE__ */ P(Re, { children: [
|
|
1262
1276
|
g && /* @__PURE__ */ a(
|
|
1263
1277
|
"button",
|
|
1264
1278
|
{
|
|
1265
|
-
onClick: () =>
|
|
1279
|
+
onClick: () => Ke(!0),
|
|
1266
1280
|
type: "button",
|
|
1267
|
-
className:
|
|
1281
|
+
className: ge(
|
|
1268
1282
|
"vehicle-search-btn vs:md:hidden!",
|
|
1269
|
-
|
|
1283
|
+
he ? "vs:w-full! vs:flex! vs:shrink-0!" : "vs:w-auto! vs:inline-flex! vs:shrink!"
|
|
1270
1284
|
),
|
|
1271
|
-
children: /* @__PURE__ */ a("span", { children:
|
|
1285
|
+
children: /* @__PURE__ */ a("span", { children: E })
|
|
1272
1286
|
}
|
|
1273
1287
|
),
|
|
1274
1288
|
g && /* @__PURE__ */ a(
|
|
1275
1289
|
"div",
|
|
1276
1290
|
{
|
|
1277
|
-
onClick: () =>
|
|
1278
|
-
className:
|
|
1291
|
+
onClick: () => Ke(!1),
|
|
1292
|
+
className: ge(
|
|
1279
1293
|
"vs:z-10 vs:fixed vs:inset-0 vs:bg-stone-900 vs:transition-all vs:duration-300",
|
|
1280
|
-
|
|
1294
|
+
Fe ? "vs:opacity-75" : "vs:pointer-events-none vs:opacity-0"
|
|
1281
1295
|
)
|
|
1282
1296
|
}
|
|
1283
1297
|
),
|
|
1284
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ P(
|
|
1285
1299
|
"div",
|
|
1286
1300
|
{
|
|
1287
|
-
className:
|
|
1301
|
+
className: ge(
|
|
1288
1302
|
"partbot-mmyvs-container",
|
|
1289
|
-
g &&
|
|
1303
|
+
g && Fe && "active",
|
|
1290
1304
|
"w-full"
|
|
1291
1305
|
),
|
|
1292
1306
|
children: [
|
|
1293
|
-
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: [
|
|
1294
1308
|
/* @__PURE__ */ a("span", { children: "Select Vehicle" }),
|
|
1295
|
-
/* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ P(
|
|
1296
1310
|
"button",
|
|
1297
1311
|
{
|
|
1298
|
-
onClick: () =>
|
|
1312
|
+
onClick: () => Ke(!1),
|
|
1299
1313
|
type: "button",
|
|
1300
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",
|
|
1301
1315
|
children: [
|
|
@@ -1314,128 +1328,128 @@ function Kt({
|
|
|
1314
1328
|
}
|
|
1315
1329
|
)
|
|
1316
1330
|
] }),
|
|
1317
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ P(
|
|
1318
1332
|
"div",
|
|
1319
1333
|
{
|
|
1320
|
-
ref:
|
|
1321
|
-
className:
|
|
1334
|
+
ref: Ce,
|
|
1335
|
+
className: ge(
|
|
1322
1336
|
"vs:grid vs:gap-3",
|
|
1323
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",
|
|
1324
1338
|
"vs:w-full vs:transition vs:lg:mx-auto"
|
|
1325
1339
|
),
|
|
1326
1340
|
children: [
|
|
1327
|
-
|
|
1341
|
+
M ? /* @__PURE__ */ P(Re, { children: [
|
|
1328
1342
|
/* @__PURE__ */ a(
|
|
1329
|
-
|
|
1343
|
+
ne,
|
|
1330
1344
|
{
|
|
1331
1345
|
label: "Year",
|
|
1332
|
-
items:
|
|
1333
|
-
refine:
|
|
1346
|
+
items: xe,
|
|
1347
|
+
refine: ut,
|
|
1334
1348
|
selected: e.year,
|
|
1335
1349
|
bgDark: G,
|
|
1336
|
-
showLabel:
|
|
1337
|
-
isMobile:
|
|
1350
|
+
showLabel: N,
|
|
1351
|
+
isMobile: oe,
|
|
1338
1352
|
sortOptions: !1,
|
|
1339
|
-
loading:
|
|
1353
|
+
loading: xe.length === 0,
|
|
1340
1354
|
shouldBeActive: !0
|
|
1341
1355
|
}
|
|
1342
1356
|
),
|
|
1343
1357
|
/* @__PURE__ */ a(
|
|
1344
|
-
|
|
1358
|
+
ne,
|
|
1345
1359
|
{
|
|
1346
1360
|
label: "Make",
|
|
1347
|
-
items:
|
|
1348
|
-
refine:
|
|
1361
|
+
items: je,
|
|
1362
|
+
refine: pt,
|
|
1349
1363
|
selected: e.make,
|
|
1350
1364
|
showPopular: !0,
|
|
1351
1365
|
bgDark: G,
|
|
1352
|
-
showLabel:
|
|
1353
|
-
isMobile:
|
|
1366
|
+
showLabel: N,
|
|
1367
|
+
isMobile: oe,
|
|
1354
1368
|
sortOptions: !1,
|
|
1355
|
-
loading: e.year &&
|
|
1369
|
+
loading: e.year && je.length === 0,
|
|
1356
1370
|
shouldBeActive: !!e.year
|
|
1357
1371
|
}
|
|
1358
1372
|
),
|
|
1359
1373
|
/* @__PURE__ */ a(
|
|
1360
|
-
|
|
1374
|
+
ne,
|
|
1361
1375
|
{
|
|
1362
1376
|
label: "Model",
|
|
1363
|
-
items:
|
|
1364
|
-
refine:
|
|
1377
|
+
items: Ne,
|
|
1378
|
+
refine: vt,
|
|
1365
1379
|
selected: e.model,
|
|
1366
1380
|
showPopular: !0,
|
|
1367
1381
|
bgDark: G,
|
|
1368
|
-
showLabel:
|
|
1369
|
-
isMobile:
|
|
1382
|
+
showLabel: N,
|
|
1383
|
+
isMobile: oe,
|
|
1370
1384
|
sortOptions: !1,
|
|
1371
|
-
loading: e.make &&
|
|
1385
|
+
loading: e.make && Ne.length === 0,
|
|
1372
1386
|
shouldBeActive: !!e.make
|
|
1373
1387
|
}
|
|
1374
1388
|
)
|
|
1375
|
-
] }) : /* @__PURE__ */
|
|
1389
|
+
] }) : /* @__PURE__ */ P(Re, { children: [
|
|
1376
1390
|
/* @__PURE__ */ a(
|
|
1377
|
-
|
|
1391
|
+
ne,
|
|
1378
1392
|
{
|
|
1379
1393
|
label: "Make",
|
|
1380
|
-
items:
|
|
1381
|
-
refine:
|
|
1394
|
+
items: je,
|
|
1395
|
+
refine: pt,
|
|
1382
1396
|
selected: e.make,
|
|
1383
1397
|
showPopular: !0,
|
|
1384
1398
|
bgDark: G,
|
|
1385
|
-
showLabel:
|
|
1386
|
-
isMobile:
|
|
1399
|
+
showLabel: N,
|
|
1400
|
+
isMobile: oe,
|
|
1387
1401
|
sortOptions: !1,
|
|
1388
|
-
loading:
|
|
1402
|
+
loading: je.length === 0,
|
|
1389
1403
|
shouldBeActive: !0
|
|
1390
1404
|
}
|
|
1391
1405
|
),
|
|
1392
1406
|
/* @__PURE__ */ a(
|
|
1393
|
-
|
|
1407
|
+
ne,
|
|
1394
1408
|
{
|
|
1395
1409
|
label: "Model",
|
|
1396
|
-
items:
|
|
1397
|
-
refine:
|
|
1410
|
+
items: Ne,
|
|
1411
|
+
refine: vt,
|
|
1398
1412
|
selected: e.model,
|
|
1399
1413
|
showPopular: !0,
|
|
1400
1414
|
bgDark: G,
|
|
1401
|
-
showLabel:
|
|
1402
|
-
isMobile:
|
|
1415
|
+
showLabel: N,
|
|
1416
|
+
isMobile: oe,
|
|
1403
1417
|
sortOptions: !1,
|
|
1404
|
-
loading: e.make &&
|
|
1418
|
+
loading: e.make && Ne.length === 0,
|
|
1405
1419
|
shouldBeActive: !!e.make
|
|
1406
1420
|
}
|
|
1407
1421
|
),
|
|
1408
1422
|
/* @__PURE__ */ a(
|
|
1409
|
-
|
|
1423
|
+
ne,
|
|
1410
1424
|
{
|
|
1411
1425
|
label: "Year",
|
|
1412
|
-
items:
|
|
1413
|
-
refine:
|
|
1426
|
+
items: xe,
|
|
1427
|
+
refine: ut,
|
|
1414
1428
|
selected: e.year,
|
|
1415
1429
|
bgDark: G,
|
|
1416
|
-
showLabel:
|
|
1417
|
-
isMobile:
|
|
1430
|
+
showLabel: N,
|
|
1431
|
+
isMobile: oe,
|
|
1418
1432
|
sortOptions: !1,
|
|
1419
|
-
loading: e.model &&
|
|
1433
|
+
loading: e.model && xe.length === 0,
|
|
1420
1434
|
shouldBeActive: !!e.model
|
|
1421
1435
|
}
|
|
1422
1436
|
)
|
|
1423
1437
|
] }),
|
|
1424
|
-
|
|
1438
|
+
De.current && De.current.map((t) => {
|
|
1425
1439
|
let r = null;
|
|
1426
1440
|
switch (t) {
|
|
1427
1441
|
case "body":
|
|
1428
1442
|
r = /* @__PURE__ */ a(
|
|
1429
|
-
|
|
1443
|
+
ne,
|
|
1430
1444
|
{
|
|
1431
1445
|
label: "Body",
|
|
1432
|
-
items:
|
|
1433
|
-
refine:
|
|
1446
|
+
items: et,
|
|
1447
|
+
refine: Mt,
|
|
1434
1448
|
selected: e.body,
|
|
1435
1449
|
bgDark: G,
|
|
1436
|
-
showLabel:
|
|
1437
|
-
isMobile:
|
|
1438
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1450
|
+
showLabel: N,
|
|
1451
|
+
isMobile: oe,
|
|
1452
|
+
loading: !!(e.make && e.model && e.year) && et.length === 0,
|
|
1439
1453
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1440
1454
|
},
|
|
1441
1455
|
"body"
|
|
@@ -1443,16 +1457,16 @@ function Kt({
|
|
|
1443
1457
|
break;
|
|
1444
1458
|
case "series":
|
|
1445
1459
|
r = /* @__PURE__ */ a(
|
|
1446
|
-
|
|
1460
|
+
ne,
|
|
1447
1461
|
{
|
|
1448
1462
|
label: "Series",
|
|
1449
|
-
items:
|
|
1463
|
+
items: tt,
|
|
1450
1464
|
refine: St,
|
|
1451
1465
|
selected: e.series,
|
|
1452
1466
|
bgDark: G,
|
|
1453
|
-
showLabel:
|
|
1454
|
-
isMobile:
|
|
1455
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1467
|
+
showLabel: N,
|
|
1468
|
+
isMobile: oe,
|
|
1469
|
+
loading: !!(e.make && e.model && e.year) && tt.length === 0,
|
|
1456
1470
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1457
1471
|
},
|
|
1458
1472
|
"series"
|
|
@@ -1460,16 +1474,16 @@ function Kt({
|
|
|
1460
1474
|
break;
|
|
1461
1475
|
case "variant":
|
|
1462
1476
|
r = /* @__PURE__ */ a(
|
|
1463
|
-
|
|
1477
|
+
ne,
|
|
1464
1478
|
{
|
|
1465
1479
|
label: "Variant",
|
|
1466
|
-
items:
|
|
1480
|
+
items: rt,
|
|
1467
1481
|
refine: $t,
|
|
1468
1482
|
selected: e.variant,
|
|
1469
1483
|
bgDark: G,
|
|
1470
|
-
showLabel:
|
|
1471
|
-
isMobile:
|
|
1472
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1484
|
+
showLabel: N,
|
|
1485
|
+
isMobile: oe,
|
|
1486
|
+
loading: !!(e.make && e.model && e.year) && rt.length === 0,
|
|
1473
1487
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1474
1488
|
},
|
|
1475
1489
|
"variant"
|
|
@@ -1477,16 +1491,16 @@ function Kt({
|
|
|
1477
1491
|
break;
|
|
1478
1492
|
case "engine_capacity":
|
|
1479
1493
|
r = /* @__PURE__ */ a(
|
|
1480
|
-
|
|
1494
|
+
ne,
|
|
1481
1495
|
{
|
|
1482
1496
|
label: "Engine Capacity",
|
|
1483
|
-
items:
|
|
1497
|
+
items: at,
|
|
1484
1498
|
refine: Et,
|
|
1485
1499
|
selected: e.engine_capacity,
|
|
1486
1500
|
bgDark: G,
|
|
1487
|
-
showLabel:
|
|
1488
|
-
isMobile:
|
|
1489
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1501
|
+
showLabel: N,
|
|
1502
|
+
isMobile: oe,
|
|
1503
|
+
loading: !!(e.make && e.model && e.year) && at.length === 0,
|
|
1490
1504
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1491
1505
|
},
|
|
1492
1506
|
"engine_capacity"
|
|
@@ -1494,16 +1508,16 @@ function Kt({
|
|
|
1494
1508
|
break;
|
|
1495
1509
|
case "engine":
|
|
1496
1510
|
r = /* @__PURE__ */ a(
|
|
1497
|
-
|
|
1511
|
+
ne,
|
|
1498
1512
|
{
|
|
1499
1513
|
label: "Engine",
|
|
1500
|
-
items:
|
|
1514
|
+
items: ot,
|
|
1501
1515
|
refine: At,
|
|
1502
1516
|
selected: e.engine,
|
|
1503
1517
|
bgDark: G,
|
|
1504
|
-
showLabel:
|
|
1505
|
-
isMobile:
|
|
1506
|
-
loading: !!(e.make && e.model && e.year) &&
|
|
1518
|
+
showLabel: N,
|
|
1519
|
+
isMobile: oe,
|
|
1520
|
+
loading: !!(e.make && e.model && e.year) && ot.length === 0,
|
|
1507
1521
|
shouldBeActive: !!(e.make && e.model && e.year)
|
|
1508
1522
|
},
|
|
1509
1523
|
"engine"
|
|
@@ -1512,16 +1526,16 @@ function Kt({
|
|
|
1512
1526
|
}
|
|
1513
1527
|
return r;
|
|
1514
1528
|
}),
|
|
1515
|
-
|
|
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(
|
|
1516
1530
|
"button",
|
|
1517
1531
|
{
|
|
1518
1532
|
className: "vehicle-search-btn",
|
|
1519
1533
|
onClick: () => {
|
|
1520
|
-
|
|
1534
|
+
Ze(!0), X && !ce ? window.location.href = X + window.location.search : zt();
|
|
1521
1535
|
},
|
|
1522
1536
|
children: [
|
|
1523
|
-
/* @__PURE__ */ a("span", { children:
|
|
1524
|
-
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" })
|
|
1525
1539
|
]
|
|
1526
1540
|
}
|
|
1527
1541
|
) })
|
|
@@ -1531,12 +1545,12 @@ function Kt({
|
|
|
1531
1545
|
Z && /* @__PURE__ */ a(
|
|
1532
1546
|
"div",
|
|
1533
1547
|
{
|
|
1534
|
-
className:
|
|
1548
|
+
className: ge(
|
|
1535
1549
|
"vs:flex vs:w-full vs:justify-center vs:items-center",
|
|
1536
1550
|
Y === "row" ? "vs:md:items-end vs:md:justify-end" : "vs:md:justify-center",
|
|
1537
1551
|
"vs:mt-4 vs:md:mt-3 vs:md:pr-1.5"
|
|
1538
1552
|
),
|
|
1539
|
-
children: /* @__PURE__ */
|
|
1553
|
+
children: /* @__PURE__ */ P(
|
|
1540
1554
|
"a",
|
|
1541
1555
|
{
|
|
1542
1556
|
href: `https://use.partbot.io/?ref=${// append referrer to url, just the top level domain
|
|
@@ -1557,74 +1571,74 @@ function Kt({
|
|
|
1557
1571
|
)
|
|
1558
1572
|
] });
|
|
1559
1573
|
}
|
|
1560
|
-
let gt = !1,
|
|
1561
|
-
function
|
|
1562
|
-
var
|
|
1563
|
-
const
|
|
1564
|
-
if (!
|
|
1574
|
+
let gt = !1, Ee = !1;
|
|
1575
|
+
function Qt(h) {
|
|
1576
|
+
var N, he;
|
|
1577
|
+
const f = h.shadowRoot;
|
|
1578
|
+
if (!f) {
|
|
1565
1579
|
console.error("[ShadowDOMPatch] No shadow root found");
|
|
1566
1580
|
return;
|
|
1567
1581
|
}
|
|
1568
|
-
const
|
|
1569
|
-
if (!
|
|
1582
|
+
const d = f.children[1];
|
|
1583
|
+
if (!d) {
|
|
1570
1584
|
console.error("[ShadowDOMPatch] No mount point found in shadow root");
|
|
1571
1585
|
return;
|
|
1572
1586
|
}
|
|
1573
1587
|
if (new MutationObserver((g) => {
|
|
1574
|
-
g.forEach((
|
|
1575
|
-
|
|
1576
|
-
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);
|
|
1577
1591
|
});
|
|
1578
|
-
}), g.forEach((
|
|
1579
|
-
|
|
1580
|
-
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(
|
|
1581
1595
|
"#headlessui-portal-root"
|
|
1582
|
-
) || (
|
|
1596
|
+
) || (Ee = !1));
|
|
1583
1597
|
});
|
|
1584
1598
|
});
|
|
1585
1599
|
}).observe(document.body, {
|
|
1586
1600
|
childList: !0
|
|
1587
1601
|
}), new MutationObserver((g) => {
|
|
1588
|
-
g.forEach((
|
|
1589
|
-
|
|
1590
|
-
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);
|
|
1591
1605
|
});
|
|
1592
1606
|
});
|
|
1593
|
-
}).observe(
|
|
1607
|
+
}).observe(d, {
|
|
1594
1608
|
childList: !0,
|
|
1595
1609
|
subtree: !0
|
|
1596
1610
|
}), gt)
|
|
1597
1611
|
return;
|
|
1598
|
-
const X = (
|
|
1612
|
+
const X = (N = Object.getOwnPropertyDescriptor(
|
|
1599
1613
|
Document.prototype,
|
|
1600
1614
|
"activeElement"
|
|
1601
|
-
)) == null ? void 0 :
|
|
1615
|
+
)) == null ? void 0 : N.get;
|
|
1602
1616
|
Object.defineProperty(Document.prototype, "activeElement", {
|
|
1603
1617
|
get: function() {
|
|
1604
1618
|
const g = X == null ? void 0 : X.call(this);
|
|
1605
|
-
return g ===
|
|
1619
|
+
return g === h ? f.activeElement : g;
|
|
1606
1620
|
}
|
|
1607
1621
|
});
|
|
1608
|
-
const Y = (
|
|
1622
|
+
const Y = (he = Object.getOwnPropertyDescriptor(
|
|
1609
1623
|
Event.prototype,
|
|
1610
1624
|
"target"
|
|
1611
|
-
)) == null ? void 0 :
|
|
1625
|
+
)) == null ? void 0 : he.get;
|
|
1612
1626
|
Object.defineProperty(Event.prototype, "target", {
|
|
1613
1627
|
get: function() {
|
|
1614
1628
|
const g = Y == null ? void 0 : Y.call(this);
|
|
1615
|
-
return g ===
|
|
1629
|
+
return g === h ? this.composedPath()[0] : g;
|
|
1616
1630
|
}
|
|
1617
1631
|
});
|
|
1618
|
-
const
|
|
1632
|
+
const U = (g) => {
|
|
1619
1633
|
try {
|
|
1620
1634
|
return document.body && g === document.body.style;
|
|
1621
1635
|
} catch {
|
|
1622
1636
|
return !1;
|
|
1623
1637
|
}
|
|
1624
|
-
},
|
|
1625
|
-
CSSStyleDeclaration.prototype.setProperty = function(g,
|
|
1626
|
-
if (!(
|
|
1627
|
-
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);
|
|
1628
1642
|
};
|
|
1629
1643
|
const Z = Object.getOwnPropertyDescriptor(
|
|
1630
1644
|
CSSStyleDeclaration.prototype,
|
|
@@ -1635,90 +1649,90 @@ function qt(f) {
|
|
|
1635
1649
|
return Z.get.call(this);
|
|
1636
1650
|
},
|
|
1637
1651
|
set: function(g) {
|
|
1638
|
-
if (!(
|
|
1652
|
+
if (!(U(this) && g === "hidden" && Ee))
|
|
1639
1653
|
return Z.set.call(this, g);
|
|
1640
1654
|
}
|
|
1641
1655
|
}), gt = !0;
|
|
1642
1656
|
}
|
|
1643
|
-
const
|
|
1644
|
-
class
|
|
1657
|
+
const Wt = "/css/vehicle-search.css", pr = Wt;
|
|
1658
|
+
class Jt extends HTMLElement {
|
|
1645
1659
|
connectedCallback() {
|
|
1646
1660
|
if (!document.getElementById("vehicle-search-inter-font")) {
|
|
1647
1661
|
const y = document.createElement("link");
|
|
1648
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);
|
|
1649
1663
|
}
|
|
1650
|
-
let
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
let
|
|
1654
|
-
if (this.hasAttribute(
|
|
1655
|
-
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);
|
|
1656
1670
|
if (/^#[0-9A-F]{6}$/i.test(C)) {
|
|
1657
|
-
const
|
|
1658
|
-
|
|
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}`;
|
|
1659
1673
|
}
|
|
1660
1674
|
}
|
|
1661
|
-
return
|
|
1675
|
+
return re = re || te, `:host { --${y}: ${re}; } .partbot-mmyvs-container { --${y}: ${re}; }`;
|
|
1662
1676
|
};
|
|
1663
|
-
let X =
|
|
1677
|
+
let X = I(
|
|
1664
1678
|
"partbot-theme",
|
|
1665
1679
|
"data-button-color",
|
|
1666
1680
|
"0 0 0"
|
|
1667
|
-
), Y =
|
|
1681
|
+
), Y = I(
|
|
1668
1682
|
"partbot-button-color",
|
|
1669
1683
|
"data-button-color",
|
|
1670
1684
|
"0 0 0"
|
|
1671
|
-
),
|
|
1685
|
+
), U = I(
|
|
1672
1686
|
"partbot-button-hover-color",
|
|
1673
1687
|
"data-button-hover-color",
|
|
1674
1688
|
"0 0 0"
|
|
1675
|
-
),
|
|
1689
|
+
), q = I(
|
|
1676
1690
|
"partbot-button-label-color",
|
|
1677
1691
|
"data-button-label-color",
|
|
1678
1692
|
"255 255 255"
|
|
1679
|
-
), Z =
|
|
1693
|
+
), Z = I(
|
|
1680
1694
|
"partbot-button-hover-label-color",
|
|
1681
1695
|
"data-button-hover-label-color",
|
|
1682
1696
|
"255 255 255"
|
|
1683
|
-
),
|
|
1697
|
+
), N = I(
|
|
1684
1698
|
"partbot-mobile-background-color",
|
|
1685
1699
|
"data-mobile-background-color",
|
|
1686
1700
|
"0 0 0"
|
|
1687
|
-
),
|
|
1688
|
-
const
|
|
1689
|
-
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}; }`;
|
|
1690
1704
|
const w = this.getAttribute("data-input-border-color");
|
|
1691
|
-
let
|
|
1705
|
+
let L = "229 231 235";
|
|
1692
1706
|
if (w)
|
|
1693
1707
|
if (/^#[0-9A-F]{6}$/i.test(w)) {
|
|
1694
|
-
const y = parseInt(w.slice(1, 3), 16),
|
|
1695
|
-
|
|
1696
|
-
} else /^\d+\s+\d+\s+\d+$/.test(w) && (
|
|
1697
|
-
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}; }`;
|
|
1698
1712
|
const s = this.getAttribute("data-input-border-width") || "1px";
|
|
1699
1713
|
let b = `:host { --partbot-input-border-width: ${s}; } .partbot-mmyvs-container { --partbot-input-border-width: ${s}; }`;
|
|
1700
|
-
|
|
1701
|
-
const
|
|
1702
|
-
if (!
|
|
1703
|
-
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 "));
|
|
1704
1718
|
return;
|
|
1705
1719
|
}
|
|
1706
|
-
const
|
|
1707
|
-
for (let y = 0; y <
|
|
1708
|
-
const { name:
|
|
1709
|
-
if (
|
|
1710
|
-
const
|
|
1711
|
-
|
|
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;
|
|
1712
1726
|
}
|
|
1713
1727
|
}
|
|
1714
|
-
|
|
1715
|
-
const
|
|
1716
|
-
Pt.render(
|
|
1728
|
+
Qt(this);
|
|
1729
|
+
const ye = /* @__PURE__ */ a(qt, { ..._e });
|
|
1730
|
+
Pt.render(ye, d);
|
|
1717
1731
|
}
|
|
1718
1732
|
}
|
|
1719
|
-
customElements.define("vehicle-search",
|
|
1733
|
+
customElements.define("vehicle-search", Jt);
|
|
1720
1734
|
export {
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1735
|
+
qt as VehicleSearch,
|
|
1736
|
+
qt as default,
|
|
1737
|
+
pr as vehicleSearchCssUrl
|
|
1724
1738
|
};
|