@cartbot/vehicle-search-beta 3.0.40 → 3.0.42
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 +334 -334
- package/dist/js/vehicle-search.js +13 -13
- package/package.json +1 -1
|
@@ -11,8 +11,8 @@ import Tt from "lodash/debounce.js";
|
|
|
11
11
|
import Rt from "tinycolor2";
|
|
12
12
|
import Qe 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: f }) {
|
|
15
|
+
return /* @__PURE__ */ a("span", { className: f, children: /* @__PURE__ */ a(
|
|
16
16
|
"svg",
|
|
17
17
|
{
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -99,11 +99,11 @@ function Zt({ className: h }) {
|
|
|
99
99
|
}
|
|
100
100
|
) });
|
|
101
101
|
}
|
|
102
|
-
function Je({ className:
|
|
102
|
+
function Je({ className: f = "" }) {
|
|
103
103
|
return /* @__PURE__ */ a(
|
|
104
104
|
"svg",
|
|
105
105
|
{
|
|
106
|
-
className:
|
|
106
|
+
className: f,
|
|
107
107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
108
108
|
width: "32",
|
|
109
109
|
height: "32",
|
|
@@ -114,9 +114,9 @@ function Je({ className: h = "" }) {
|
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
function oe({
|
|
117
|
-
label:
|
|
118
|
-
items:
|
|
119
|
-
selected:
|
|
117
|
+
label: f,
|
|
118
|
+
items: m,
|
|
119
|
+
selected: v,
|
|
120
120
|
refine: J,
|
|
121
121
|
showPopular: L,
|
|
122
122
|
bgDark: X,
|
|
@@ -127,29 +127,29 @@ function oe({
|
|
|
127
127
|
shouldBeActive: B = !1
|
|
128
128
|
// True when parent fields are selected and this field tried to load
|
|
129
129
|
}) {
|
|
130
|
-
const [pe,
|
|
131
|
-
S(
|
|
132
|
-
}, ne = (
|
|
133
|
-
|
|
130
|
+
const [pe, g] = N(""), [M, S] = N(v || null), ve = (s) => {
|
|
131
|
+
S(s), g(""), !(s && s.value === (v == null ? void 0 : v.value)) && J(s);
|
|
132
|
+
}, ne = (s) => {
|
|
133
|
+
s.preventDefault(), s.stopPropagation(), g(""), S(null), J("");
|
|
134
134
|
};
|
|
135
135
|
P(() => {
|
|
136
|
-
|
|
137
|
-
}, [
|
|
136
|
+
g(""), S(v || null);
|
|
137
|
+
}, [v, m]);
|
|
138
138
|
let ie = /* @__PURE__ */ new Set(), w = [];
|
|
139
|
-
|
|
140
|
-
String(
|
|
139
|
+
m && (m.forEach((s) => {
|
|
140
|
+
String(s.value).split(/,(?![^(]*\))/).forEach((j) => {
|
|
141
141
|
j = j.trim(), j && Ut(pe, j.toLowerCase()) && !ie.has(j.toLowerCase()) && (ie.add(j.toLowerCase()), w.push({
|
|
142
|
-
...
|
|
142
|
+
...s,
|
|
143
143
|
value: j,
|
|
144
|
-
refinement:
|
|
144
|
+
refinement: s.value
|
|
145
145
|
}));
|
|
146
146
|
});
|
|
147
|
-
}), w.length === 0 && (w =
|
|
148
|
-
const V = w.filter((
|
|
147
|
+
}), w.length === 0 && (w = m));
|
|
148
|
+
const V = w.filter((s) => s.popularity > 0).slice(0, 11);
|
|
149
149
|
Y && (w = w.filter(
|
|
150
|
-
(
|
|
150
|
+
(s) => !V.includes(s)
|
|
151
151
|
), w.sort(
|
|
152
|
-
(
|
|
152
|
+
(s, b) => s.value.localeCompare(b.value, "en", { numeric: !0 })
|
|
153
153
|
), w = V.concat(w));
|
|
154
154
|
const be = !w || w.length === 0;
|
|
155
155
|
return /* @__PURE__ */ I("div", { className: "vs:relative vs:flex vs:flex-col", children: [
|
|
@@ -157,38 +157,38 @@ function oe({
|
|
|
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: f
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
163
|
K && /* @__PURE__ */ I("div", { className: "vs:relative vs:flex vs:flex-col", children: [
|
|
164
164
|
/* @__PURE__ */ I(
|
|
165
165
|
"select",
|
|
166
166
|
{
|
|
167
|
-
onChange: (
|
|
168
|
-
const
|
|
169
|
-
(j) => j.value.toString() ===
|
|
167
|
+
onChange: (s) => {
|
|
168
|
+
const b = w.find(
|
|
169
|
+
(j) => j.value.toString() === s.target.value.toString()
|
|
170
170
|
);
|
|
171
|
-
|
|
171
|
+
b && ve(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: M ? M.value : "",
|
|
177
177
|
children: [
|
|
178
|
-
/* @__PURE__ */ a("option", { value: "", disabled: !0, children:
|
|
178
|
+
/* @__PURE__ */ a("option", { value: "", disabled: !0, children: f }),
|
|
179
179
|
V.length > 0 ? /* @__PURE__ */ I(Ue, { children: [
|
|
180
|
-
/* @__PURE__ */ a("optgroup", { label: `Popular ${ft(
|
|
181
|
-
/* @__PURE__ */ a("optgroup", { label: `All ${ft(
|
|
182
|
-
(
|
|
183
|
-
(
|
|
180
|
+
/* @__PURE__ */ a("optgroup", { label: `Popular ${ft(f)}`, children: V.map((s) => /* @__PURE__ */ a("option", { value: s.refinement, children: s.value }, s.value)) }),
|
|
181
|
+
/* @__PURE__ */ a("optgroup", { label: `All ${ft(f)}`, children: w.filter(
|
|
182
|
+
(s) => !V.some(
|
|
183
|
+
(b) => b.value === s.value
|
|
184
184
|
)
|
|
185
|
-
).map((
|
|
186
|
-
] }) : w.map((
|
|
185
|
+
).map((s) => /* @__PURE__ */ a("option", { value: s.refinement, children: s.value }, s.value)) })
|
|
186
|
+
] }) : w.map((s) => /* @__PURE__ */ a("option", { value: s.refinement, children: s.value }, s.value))
|
|
187
187
|
]
|
|
188
188
|
}
|
|
189
189
|
),
|
|
190
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(Je, { 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 && (
|
|
191
|
+
!Z && (M == null ? void 0 : M.value) && /* @__PURE__ */ a(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
194
|
onClick: ne,
|
|
@@ -212,7 +212,7 @@ function oe({
|
|
|
212
212
|
!K && /* @__PURE__ */ I(
|
|
213
213
|
Lt,
|
|
214
214
|
{
|
|
215
|
-
value:
|
|
215
|
+
value: M || null,
|
|
216
216
|
onChange: ve,
|
|
217
217
|
virtual: { options: w },
|
|
218
218
|
disabled: be,
|
|
@@ -224,15 +224,15 @@ function oe({
|
|
|
224
224
|
{
|
|
225
225
|
autoComplete: "off",
|
|
226
226
|
spellCheck: "false",
|
|
227
|
-
placeholder: be && B && !Z ? "N/A" :
|
|
227
|
+
placeholder: be && B && !Z ? "N/A" : f,
|
|
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
|
-
displayValue: (
|
|
230
|
-
onChange: (
|
|
231
|
-
title:
|
|
229
|
+
displayValue: (s) => (s == null ? void 0 : s.value) || "",
|
|
230
|
+
onChange: (s) => g(s.target.value),
|
|
231
|
+
title: f
|
|
232
232
|
}
|
|
233
233
|
),
|
|
234
234
|
/* @__PURE__ */ I("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
|
-
(
|
|
235
|
+
(M == null ? void 0 : M.value) && /* @__PURE__ */ a(
|
|
236
236
|
"button",
|
|
237
237
|
{
|
|
238
238
|
onClick: ne,
|
|
@@ -272,31 +272,31 @@ function oe({
|
|
|
272
272
|
portal: !0,
|
|
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
|
-
children: ({ option:
|
|
276
|
-
const
|
|
277
|
-
(j) => j.value ===
|
|
275
|
+
children: ({ option: s }) => {
|
|
276
|
+
const b = s && V.some(
|
|
277
|
+
(j) => j.value === s.value
|
|
278
278
|
);
|
|
279
279
|
return /* @__PURE__ */ a(
|
|
280
280
|
Ot,
|
|
281
281
|
{
|
|
282
|
-
value:
|
|
282
|
+
value: s,
|
|
283
283
|
className: ({ focus: j }) => me(
|
|
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
|
j ? "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
288
|
children: ({ selected: j }) => /* @__PURE__ */ I("div", { className: "vs:flex vs:w-full vs:items-center vs:justify-between", children: [
|
|
289
289
|
/* @__PURE__ */ a(
|
|
290
290
|
"span",
|
|
291
291
|
{
|
|
292
292
|
className: me(
|
|
293
|
-
|
|
293
|
+
s.value === (v == null ? void 0 : v.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
|
-
children:
|
|
296
|
+
children: s.value
|
|
297
297
|
}
|
|
298
298
|
),
|
|
299
|
-
|
|
299
|
+
s.value === (v == null ? void 0 : v.value) && /* @__PURE__ */ a(
|
|
300
300
|
"span",
|
|
301
301
|
{
|
|
302
302
|
className: me(
|
|
@@ -328,44 +328,44 @@ function oe({
|
|
|
328
328
|
)
|
|
329
329
|
] });
|
|
330
330
|
}
|
|
331
|
-
const Ht = "3.0.
|
|
331
|
+
const Ht = "3.0.42";
|
|
332
332
|
console.info(
|
|
333
333
|
`Vehicle Search v${Ht} powered by Partbot https://mmyvs.partbot.io`
|
|
334
334
|
);
|
|
335
|
-
function Oe(
|
|
336
|
-
const
|
|
337
|
-
return
|
|
335
|
+
function Oe(f = [], m = []) {
|
|
336
|
+
const v = [];
|
|
337
|
+
return f.forEach((J) => {
|
|
338
338
|
const [L, ...X] = J.split(":"), Y = X.join(":");
|
|
339
339
|
if (Y.includes(" > ")) {
|
|
340
340
|
const T = Y.split(" > "), K = T[T.length - 1].trim();
|
|
341
341
|
if (L !== "make" && T.length >= 2) {
|
|
342
342
|
const Z = T[0].trim();
|
|
343
|
-
|
|
343
|
+
v.push(`make = "${Z}"`);
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
v.push(`${L} = "${K}"`);
|
|
346
346
|
} else
|
|
347
|
-
|
|
348
|
-
}),
|
|
349
|
-
|
|
350
|
-
}),
|
|
347
|
+
v.push(`${L} = "${Y}"`);
|
|
348
|
+
}), m.forEach((J) => {
|
|
349
|
+
v.push(J);
|
|
350
|
+
}), v.length > 0 ? v.join(" AND ") : null;
|
|
351
351
|
}
|
|
352
|
-
function O(
|
|
353
|
-
return String(
|
|
352
|
+
function O(f) {
|
|
353
|
+
return String(f || "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toUpperCase().trim().replace(/\s+/g, " ");
|
|
354
354
|
}
|
|
355
|
-
function xe(
|
|
356
|
-
return String(
|
|
355
|
+
function xe(f) {
|
|
356
|
+
return String(f || "").split(">").pop().trim();
|
|
357
357
|
}
|
|
358
|
-
function We(
|
|
359
|
-
return !
|
|
360
|
-
(L) =>
|
|
361
|
-
) ?
|
|
362
|
-
(L) =>
|
|
358
|
+
function We(f, m, v) {
|
|
359
|
+
return !v || v.size === 0 || !Array.isArray(f) || !f.some(
|
|
360
|
+
(L) => v.has(O(m(L)))
|
|
361
|
+
) ? f : f.filter(
|
|
362
|
+
(L) => v.has(O(m(L)))
|
|
363
363
|
);
|
|
364
364
|
}
|
|
365
365
|
function Kt({
|
|
366
|
-
apiKey:
|
|
367
|
-
makes:
|
|
368
|
-
models:
|
|
366
|
+
apiKey: f,
|
|
367
|
+
makes: m = "",
|
|
368
|
+
models: v = "",
|
|
369
369
|
vehicleScopeTokens: J = "",
|
|
370
370
|
yearTokens: L = "",
|
|
371
371
|
callbackUrl: X = "",
|
|
@@ -375,8 +375,8 @@ function Kt({
|
|
|
375
375
|
showBranding: Z = !0,
|
|
376
376
|
showLabels: B = !1,
|
|
377
377
|
mobileFullWidthButton: pe = !0,
|
|
378
|
-
mobileDrawer:
|
|
379
|
-
modifyQueryString:
|
|
378
|
+
mobileDrawer: g = !0,
|
|
379
|
+
modifyQueryString: M = !0,
|
|
380
380
|
onChange: S,
|
|
381
381
|
buttonLabel: ve = "Search",
|
|
382
382
|
showButton: ne = !0,
|
|
@@ -385,14 +385,14 @@ function Kt({
|
|
|
385
385
|
useStoreVehicles: V = !0,
|
|
386
386
|
fieldOrder: be = "MMY",
|
|
387
387
|
// "MMY" (Make→Model→Year) or "YMM" (Year→Make→Model)
|
|
388
|
-
enableFeatureFlags:
|
|
388
|
+
enableFeatureFlags: s = !0,
|
|
389
389
|
// Use api.cartbot.io instead of api.partbot.io
|
|
390
|
-
yearOptional:
|
|
390
|
+
yearOptional: b = !1,
|
|
391
391
|
// Make year selection optional, only requiring make + model
|
|
392
392
|
mobileButtonLabel: j = "Select Vehicle"
|
|
393
393
|
// Label for mobile drawer trigger button
|
|
394
394
|
}) {
|
|
395
|
-
const ke = W(null), Ce = W(null), we = W(null), y = W(null), D = W(null), ee = W(null), te = W(null),
|
|
395
|
+
const ke = W(null), Ce = W(null), we = W(null), y = W(null), D = W(null), ee = W(null), te = W(null), C = W(null), _e = W(null), R = W(!1), z = be === "YMM", [Ee, Te] = N([]), [je, se] = N([]), [ye, Me] = N([]), [Xe, Ne] = N([]), [Ge, Be] = N([]), [et, Pe] = N([]), [tt, Ie] = N([]), [rt, Le] = N([]), bt = W([]), [ge, ze] = N([]), [e, q] = N({
|
|
396
396
|
make: null,
|
|
397
397
|
model: null,
|
|
398
398
|
year: null,
|
|
@@ -412,9 +412,9 @@ function Kt({
|
|
|
412
412
|
var r;
|
|
413
413
|
return (r = ot.current) == null ? void 0 : r.includes(t);
|
|
414
414
|
}) : null
|
|
415
|
-
), [at, Se] = N({}), ae = qe(() => !
|
|
416
|
-
|
|
417
|
-
), [
|
|
415
|
+
), [at, Se] = N({}), ae = qe(() => !m || typeof m != "string" ? /* @__PURE__ */ new Set() : new Set(
|
|
416
|
+
m.trim().split(",").map((t) => O(t)).filter(Boolean)
|
|
417
|
+
), [m]), le = qe(
|
|
418
418
|
() => new Set(
|
|
419
419
|
Object.keys(at || {}).map(
|
|
420
420
|
(t) => O(t)
|
|
@@ -437,20 +437,20 @@ function Kt({
|
|
|
437
437
|
});
|
|
438
438
|
}, []);
|
|
439
439
|
const [ue, xt] = N({}), [Jt, kt] = N(""), nt = F(async () => {
|
|
440
|
-
if (!
|
|
440
|
+
if (!f)
|
|
441
441
|
return;
|
|
442
|
-
const r = `${
|
|
442
|
+
const r = `${s ? "https://api.cartbot.io" : "https://api.partbot.io"}/v1/vehicles/auth`;
|
|
443
443
|
try {
|
|
444
444
|
const n = await fetch(r, {
|
|
445
445
|
method: "POST",
|
|
446
446
|
headers: {
|
|
447
447
|
"Content-Type": "application/json",
|
|
448
|
-
Authorization: `Bearer ${
|
|
448
|
+
Authorization: `Bearer ${f}`
|
|
449
449
|
},
|
|
450
450
|
body: JSON.stringify(
|
|
451
451
|
(() => {
|
|
452
|
-
const
|
|
453
|
-
return w && (
|
|
452
|
+
const h = { use_store_vehicles: V };
|
|
453
|
+
return w && (h.store = w), h;
|
|
454
454
|
})()
|
|
455
455
|
)
|
|
456
456
|
});
|
|
@@ -460,29 +460,29 @@ function Kt({
|
|
|
460
460
|
merchant: o,
|
|
461
461
|
vehicle_makes: d,
|
|
462
462
|
vehicle_models: i,
|
|
463
|
-
meilisearch_search_key:
|
|
464
|
-
meilisearch_index_name:
|
|
465
|
-
algolia_search_key:
|
|
463
|
+
meilisearch_search_key: u,
|
|
464
|
+
meilisearch_index_name: l,
|
|
465
|
+
algolia_search_key: c,
|
|
466
466
|
// Fallback for backward compatibility
|
|
467
|
-
algolia_index_name:
|
|
467
|
+
algolia_index_name: $,
|
|
468
468
|
// Fallback for backward compatibility
|
|
469
|
-
store_index_name:
|
|
470
|
-
store_popular_makes:
|
|
469
|
+
store_index_name: A,
|
|
470
|
+
store_popular_makes: p,
|
|
471
471
|
// Array of popular make values for this store (from PostHog)
|
|
472
|
-
store_popular_models:
|
|
472
|
+
store_popular_models: x
|
|
473
473
|
// Object mapping makes to popular models: { "TOYOTA": ["HILUX", "LANDCRUISER"], ... }
|
|
474
|
-
} = await n.json(),
|
|
475
|
-
Ce.current = o, we.current =
|
|
476
|
-
...
|
|
477
|
-
refinement:
|
|
478
|
-
})), V && E ? typeof E == "object" && !Array.isArray(E) ? (y.current = E, Se(E)) : Array.isArray(E) ? (y.current = E.map((
|
|
474
|
+
} = await n.json(), _ = d || [], E = i;
|
|
475
|
+
Ce.current = o, we.current = _.map((h) => ({
|
|
476
|
+
...h,
|
|
477
|
+
refinement: h.value
|
|
478
|
+
})), V && E ? typeof E == "object" && !Array.isArray(E) ? (y.current = E, Se(E)) : Array.isArray(E) ? (y.current = E.map((h) => h && h.value ? String(h.value).trim() : "").filter(Boolean), Se({})) : (y.current = [], Se({})) : (y.current = [], Se({})), D.current = Array.isArray(p) ? p.map((h) => String(h).trim().toUpperCase()) : null, ee.current = x || null, xt({
|
|
479
479
|
searchKey: "eeace38b64f52bf56ebb4fe8bd5837b3cd6c0ff9d7e272f76449d94b80cba86b",
|
|
480
480
|
indexName: "otto_v1_vehicles_production"
|
|
481
481
|
});
|
|
482
482
|
} catch (n) {
|
|
483
483
|
console.error("[VehicleSearch] Auth failed:", n), kt(n), Se({});
|
|
484
484
|
}
|
|
485
|
-
}, [
|
|
485
|
+
}, [f, w, V, s]);
|
|
486
486
|
P(() => {
|
|
487
487
|
nt();
|
|
488
488
|
}, [nt]), P(() => {
|
|
@@ -491,7 +491,7 @@ function Kt({
|
|
|
491
491
|
te.current = new mt({
|
|
492
492
|
host: "https://search.partbot.io",
|
|
493
493
|
apiKey: ue.searchKey
|
|
494
|
-
}),
|
|
494
|
+
}), C.current = te.current.index(ue.indexName);
|
|
495
495
|
const t = new mt({
|
|
496
496
|
host: "https://partbot-meilisearch-cache.partbot.workers.dev",
|
|
497
497
|
// Cloudflare Worker endpoint
|
|
@@ -505,18 +505,18 @@ function Kt({
|
|
|
505
505
|
te.current = null;
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
}, [ue.searchKey,
|
|
508
|
+
}, [ue.searchKey, f]);
|
|
509
509
|
const [G, Ct] = N(!1), it = F(() => {
|
|
510
510
|
function t(i) {
|
|
511
511
|
if (!i) return "rgba(0,0,0,1)";
|
|
512
|
-
var
|
|
513
|
-
return
|
|
512
|
+
var u = r(), l = window.getComputedStyle(i).backgroundColor;
|
|
513
|
+
return l !== u ? l : i.parentElement ? t(i.parentElement) : "rgba(255,255,255,1)";
|
|
514
514
|
}
|
|
515
515
|
function r() {
|
|
516
516
|
var i = document.createElement("div");
|
|
517
517
|
document.head.appendChild(i);
|
|
518
|
-
var
|
|
519
|
-
return document.head.removeChild(i),
|
|
518
|
+
var u = window.getComputedStyle(i).backgroundColor;
|
|
519
|
+
return document.head.removeChild(i), u;
|
|
520
520
|
}
|
|
521
521
|
const n = document.querySelector("vehicle-search");
|
|
522
522
|
let o;
|
|
@@ -526,7 +526,7 @@ function Kt({
|
|
|
526
526
|
}, []);
|
|
527
527
|
P(() => {
|
|
528
528
|
async function t() {
|
|
529
|
-
if (!e.make || !
|
|
529
|
+
if (!e.make || !C.current)
|
|
530
530
|
return;
|
|
531
531
|
let r = [], n = [];
|
|
532
532
|
e.make && r.push(`make:${e.make.refinement}`), e.model && r.push(
|
|
@@ -539,23 +539,23 @@ function Kt({
|
|
|
539
539
|
), e.series && r.push(`series:${e.series.refinement}`), e.engine && r.push(`engine:${e.engine.refinement}`), e.engine_capacity && r.push(
|
|
540
540
|
`engine_capacity:${e.engine_capacity.refinement}`
|
|
541
541
|
);
|
|
542
|
-
let d = (await
|
|
542
|
+
let d = (await C.current.search("", {
|
|
543
543
|
filter: Oe(r, n),
|
|
544
544
|
attributesToRetrieve: ["otto_id"],
|
|
545
545
|
limit: 500
|
|
546
546
|
// Reduced from 1000 for faster queries
|
|
547
|
-
})).hits.map((
|
|
547
|
+
})).hits.map((l) => l.otto_id);
|
|
548
548
|
ze(d);
|
|
549
|
-
let
|
|
549
|
+
let u = {
|
|
550
550
|
...Object.fromEntries(
|
|
551
|
-
Object.entries(e || {}).map(([
|
|
551
|
+
Object.entries(e || {}).map(([l, c]) => [l, c && c.value || null]).filter(([l, c]) => c !== null)
|
|
552
552
|
),
|
|
553
553
|
merchant: Ce.current
|
|
554
554
|
};
|
|
555
|
-
Qe.capture("vehicle select",
|
|
555
|
+
Qe.capture("vehicle select", u);
|
|
556
556
|
}
|
|
557
557
|
t();
|
|
558
|
-
}, [e,
|
|
558
|
+
}, [e, C, b]);
|
|
559
559
|
const Ye = (t) => K ? `${K}${t}` : t, _t = (t) => K ? t.replace(new RegExp(`^${K}`), "") : t, st = F(() => {
|
|
560
560
|
const t = new URL(window.location.href).searchParams, r = [
|
|
561
561
|
"make",
|
|
@@ -566,68 +566,68 @@ function Kt({
|
|
|
566
566
|
"engine",
|
|
567
567
|
"engine_capacity"
|
|
568
568
|
], n = r.map(Ye), o = {}, d = /^filter\.p\.m\.app--\d+--partbot\.vehicle_(\w+)$/;
|
|
569
|
-
for (const [
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
572
|
-
const
|
|
573
|
-
if (
|
|
574
|
-
const
|
|
575
|
-
if (
|
|
576
|
-
const
|
|
577
|
-
/^\d{4}$/.test(
|
|
569
|
+
for (const [l, c] of t.entries()) {
|
|
570
|
+
const $ = l.match(d);
|
|
571
|
+
if ($) {
|
|
572
|
+
const A = $[1];
|
|
573
|
+
if (A === "year_tokens" && c) {
|
|
574
|
+
const x = c.split("|");
|
|
575
|
+
if (x.length >= 3) {
|
|
576
|
+
const _ = x[2].trim();
|
|
577
|
+
/^\d{4}$/.test(_) && (o.year = _);
|
|
578
578
|
}
|
|
579
579
|
continue;
|
|
580
580
|
}
|
|
581
|
-
let
|
|
582
|
-
|
|
581
|
+
let p = A.replace(/s$/, "");
|
|
582
|
+
p === "engine_capacitie" && (p = "engine_capacity"), p === "bodie" && (p = "body"), p === "serie" && (p = "series"), r.includes(p) && (o[p] = c);
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
const i = Object.fromEntries(
|
|
586
|
-
[...t.entries()].filter(([
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
const
|
|
590
|
-
return [
|
|
586
|
+
[...t.entries()].filter(([l]) => n.includes(l)).map(([l, c]) => {
|
|
587
|
+
const $ = _t(l);
|
|
588
|
+
if ($ === "year" && c && /^\d{4}$/.test(c)) {
|
|
589
|
+
const A = parseInt(c, 10);
|
|
590
|
+
return [$, { value: A, refinement: A }];
|
|
591
591
|
}
|
|
592
|
-
return [
|
|
592
|
+
return [$, { value: c, refinement: c }];
|
|
593
593
|
})
|
|
594
594
|
);
|
|
595
|
-
for (const [
|
|
596
|
-
if (
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
599
|
-
i[
|
|
595
|
+
for (const [l, c] of Object.entries(o))
|
|
596
|
+
if (c && c !== "[object Object]" && !i[l])
|
|
597
|
+
if (l === "year" && /^\d{4}$/.test(c)) {
|
|
598
|
+
const $ = parseInt(c, 10);
|
|
599
|
+
i[l] = { value: $, refinement: $ };
|
|
600
600
|
} else
|
|
601
|
-
i[
|
|
602
|
-
if (Object.keys(i).length
|
|
601
|
+
i[l] = { value: c, refinement: c };
|
|
602
|
+
if (!(Object.keys(i).length > 0))
|
|
603
603
|
try {
|
|
604
|
-
const
|
|
605
|
-
if (
|
|
606
|
-
const
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
609
|
-
for (const
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
if (
|
|
613
|
-
const
|
|
614
|
-
i[
|
|
615
|
-
value:
|
|
616
|
-
refinement:
|
|
604
|
+
const l = localStorage.getItem("partbot_selected_vehicle");
|
|
605
|
+
if (l) {
|
|
606
|
+
const c = JSON.parse(l);
|
|
607
|
+
if (c != null && c.vehicle) {
|
|
608
|
+
const $ = c.vehicle;
|
|
609
|
+
for (const A of r) {
|
|
610
|
+
const p = $[A];
|
|
611
|
+
if (p && typeof p == "string" && p.trim())
|
|
612
|
+
if (A === "year" && /^\d{4}$/.test(p)) {
|
|
613
|
+
const x = parseInt(p, 10);
|
|
614
|
+
i[A] = {
|
|
615
|
+
value: x,
|
|
616
|
+
refinement: x
|
|
617
617
|
};
|
|
618
618
|
} else
|
|
619
|
-
i[
|
|
620
|
-
else if (
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
623
|
-
i[
|
|
624
|
-
value:
|
|
625
|
-
refinement:
|
|
619
|
+
i[A] = { value: p, refinement: p };
|
|
620
|
+
else if (p != null && p.value && typeof p.value == "string")
|
|
621
|
+
if (A === "year" && /^\d{4}$/.test(p.value)) {
|
|
622
|
+
const x = parseInt(p.value, 10);
|
|
623
|
+
i[A] = {
|
|
624
|
+
value: x,
|
|
625
|
+
refinement: x
|
|
626
626
|
};
|
|
627
627
|
} else
|
|
628
|
-
i[
|
|
629
|
-
value:
|
|
630
|
-
refinement:
|
|
628
|
+
i[A] = {
|
|
629
|
+
value: p.value,
|
|
630
|
+
refinement: p.value
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
633
|
}
|
|
@@ -636,7 +636,7 @@ function Kt({
|
|
|
636
636
|
}
|
|
637
637
|
q(i);
|
|
638
638
|
}, []), U = F(({ query: t, value: r, remove: n }) => {
|
|
639
|
-
if (
|
|
639
|
+
if (M && "URLSearchParams" in window) {
|
|
640
640
|
let o = new URLSearchParams(window.location.search);
|
|
641
641
|
t = Ye(t), t && r && o.set(t, r), t && !r && o.delete(t), n && n.forEach((i) => {
|
|
642
642
|
i = Ye(i), o.delete(i);
|
|
@@ -658,7 +658,7 @@ function Kt({
|
|
|
658
658
|
Re(!1);
|
|
659
659
|
}, 900);
|
|
660
660
|
}, [ge, ie]), lt = F(() => {
|
|
661
|
-
var n, o, d, i,
|
|
661
|
+
var n, o, d, i, u, l, c, $, A;
|
|
662
662
|
const t = {
|
|
663
663
|
vehicle_ids: ge,
|
|
664
664
|
vehicle: (n = e == null ? void 0 : e.make) != null && n.value ? e : {},
|
|
@@ -671,15 +671,15 @@ function Kt({
|
|
|
671
671
|
});
|
|
672
672
|
if (R.current === !0) {
|
|
673
673
|
localStorage.removeItem("partbot_plate_details");
|
|
674
|
-
const
|
|
675
|
-
description: `${((o = e.make) == null ? void 0 : o.value) || ""} ${((d = e.model) == null ? void 0 : d.value) || ""} ${((i = e.year) == null ? void 0 : i.value) || ""} ${((
|
|
674
|
+
const p = JSON.stringify({
|
|
675
|
+
description: `${((o = e.make) == null ? void 0 : o.value) || ""} ${((d = e.model) == null ? void 0 : d.value) || ""} ${((i = e.year) == null ? void 0 : i.value) || ""} ${((u = e.body) == null ? void 0 : u.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(),
|
|
676
676
|
vehicle_ids: ge,
|
|
677
|
-
vehicle: e ? Object.entries(e).reduce((
|
|
677
|
+
vehicle: e ? Object.entries(e).reduce((x, [_, E]) => (x[_] = E != null && E.value ? E.value : {}, x), {}) : {}
|
|
678
678
|
});
|
|
679
679
|
localStorage.setItem(
|
|
680
680
|
"partbot_selected_vehicle",
|
|
681
|
-
|
|
682
|
-
), It.set("partbot_selected_vehicle",
|
|
681
|
+
p
|
|
682
|
+
), It.set("partbot_selected_vehicle", p, {
|
|
683
683
|
secure: !0
|
|
684
684
|
});
|
|
685
685
|
}
|
|
@@ -730,32 +730,32 @@ function Kt({
|
|
|
730
730
|
document.removeEventListener("partbot-clear-vehicle", t);
|
|
731
731
|
};
|
|
732
732
|
}, [he]), P(() => {
|
|
733
|
-
ue.searchKey && (
|
|
734
|
-
}, [ue.searchKey,
|
|
735
|
-
|
|
733
|
+
ue.searchKey && (z || jt(), st());
|
|
734
|
+
}, [ue.searchKey, z, st]), P(() => {
|
|
735
|
+
z && C.current && ye.length === 0 && !e.year && C.current.search("", {
|
|
736
736
|
attributesToRetrieve: ["year_from", "year_to"],
|
|
737
737
|
limit: 1e4
|
|
738
738
|
}).then(({ hits: t }) => {
|
|
739
|
-
const r = t.map((
|
|
739
|
+
const r = t.map((u) => u.year_from).filter(Boolean), n = t.map((u) => u.year_to).filter(Boolean), o = Math.min(...r), d = Math.max(...n), i = Array.from(
|
|
740
740
|
{ length: d - o + 1 },
|
|
741
|
-
(
|
|
741
|
+
(u, l) => ({ value: o + l, refinement: o + l })
|
|
742
742
|
).reverse();
|
|
743
743
|
Me(i);
|
|
744
744
|
}).catch((t) => {
|
|
745
745
|
console.error("[VehicleSearch] Error loading year range:", t);
|
|
746
746
|
});
|
|
747
|
-
}, [
|
|
747
|
+
}, [z, ue.searchKey, ye.length, e.year]), P(() => {
|
|
748
748
|
typeof document > "u" || it();
|
|
749
749
|
}, [it]);
|
|
750
750
|
const ct = F(
|
|
751
751
|
(t) => {
|
|
752
|
-
R.current = !0, se([]), !
|
|
752
|
+
R.current = !0, se([]), !z && !b && Me([]), Ne([]), Be([]), Pe([]), Le([]), Ie([]), q((r) => ({
|
|
753
753
|
make: t,
|
|
754
|
-
year:
|
|
754
|
+
year: z || b ? r.year : null
|
|
755
755
|
})), U({
|
|
756
756
|
query: "make",
|
|
757
757
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
758
|
-
remove:
|
|
758
|
+
remove: z ? ["model", "body", "series", "engine", "variant", "engine_capacity"] : b ? [
|
|
759
759
|
"model",
|
|
760
760
|
"body",
|
|
761
761
|
"series",
|
|
@@ -773,23 +773,23 @@ function Kt({
|
|
|
773
773
|
]
|
|
774
774
|
}), t || ze([]);
|
|
775
775
|
},
|
|
776
|
-
[U,
|
|
776
|
+
[U, z, b]
|
|
777
777
|
), dt = F(
|
|
778
778
|
(t) => {
|
|
779
779
|
R.current = !0, q((r) => ({
|
|
780
780
|
...r,
|
|
781
781
|
model: t !== "" ? t : null,
|
|
782
|
-
year:
|
|
782
|
+
year: z || b ? r.year : null,
|
|
783
783
|
// Preserve year in YMM mode or yearOptional mode
|
|
784
784
|
body: null,
|
|
785
785
|
series: null,
|
|
786
786
|
variant: null,
|
|
787
787
|
engine: null,
|
|
788
788
|
engine_capacity: null
|
|
789
|
-
})), !
|
|
789
|
+
})), !z && !b && Me([]), Ne([]), Be([]), Pe([]), Le([]), Ie([]), U({
|
|
790
790
|
query: "model",
|
|
791
791
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
792
|
-
remove:
|
|
792
|
+
remove: z ? ["body", "series", "engine", "variant", "engine_capacity"] : b ? ["body", "series", "engine", "variant", "engine_capacity"] : [
|
|
793
793
|
"year",
|
|
794
794
|
"body",
|
|
795
795
|
"series",
|
|
@@ -799,12 +799,12 @@ function Kt({
|
|
|
799
799
|
]
|
|
800
800
|
});
|
|
801
801
|
},
|
|
802
|
-
[U,
|
|
802
|
+
[U, z, b]
|
|
803
803
|
), pt = F(
|
|
804
804
|
(t) => {
|
|
805
|
-
R.current = !0,
|
|
805
|
+
R.current = !0, z ? (Te([]), se([]), q({
|
|
806
806
|
year: t !== "" ? t : null
|
|
807
|
-
}), (!t || t === "") && Me([])) : q(
|
|
807
|
+
}), (!t || t === "") && Me([])) : q(b ? (r) => ({
|
|
808
808
|
...r,
|
|
809
809
|
year: t !== "" ? t : null
|
|
810
810
|
}) : (r) => ({
|
|
@@ -815,10 +815,10 @@ function Kt({
|
|
|
815
815
|
variant: null,
|
|
816
816
|
engine: null,
|
|
817
817
|
engine_capacity: null
|
|
818
|
-
})),
|
|
818
|
+
})), b || (Ne([]), Be([]), Pe([]), Le([]), Ie([])), U({
|
|
819
819
|
query: "year",
|
|
820
820
|
value: (t == null ? void 0 : t.value) ?? "",
|
|
821
|
-
remove:
|
|
821
|
+
remove: z ? [
|
|
822
822
|
"make",
|
|
823
823
|
"model",
|
|
824
824
|
"body",
|
|
@@ -826,10 +826,10 @@ function Kt({
|
|
|
826
826
|
"variant",
|
|
827
827
|
"engine",
|
|
828
828
|
"engine_capacity"
|
|
829
|
-
] :
|
|
830
|
-
}), !
|
|
829
|
+
] : b ? [] : ["body", "series", "variant", "engine", "engine_capacity"]
|
|
830
|
+
}), !b && (!t || t === "") && ze([]);
|
|
831
831
|
},
|
|
832
|
-
[U,
|
|
832
|
+
[U, z, b]
|
|
833
833
|
), zt = F(
|
|
834
834
|
(t) => {
|
|
835
835
|
R.current = !0, q((r) => ({
|
|
@@ -887,9 +887,9 @@ function Kt({
|
|
|
887
887
|
[U]
|
|
888
888
|
);
|
|
889
889
|
P(() => {
|
|
890
|
-
|
|
890
|
+
z && e.year && C.current && (async () => {
|
|
891
891
|
try {
|
|
892
|
-
const r = await
|
|
892
|
+
const r = await C.current.search("", {
|
|
893
893
|
filter: `year_from <= ${e.year.value} AND year_to >= ${e.year.value}`,
|
|
894
894
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
895
895
|
limit: 1e4
|
|
@@ -912,25 +912,25 @@ function Kt({
|
|
|
912
912
|
)
|
|
913
913
|
));
|
|
914
914
|
const d = new Set(D.current || []);
|
|
915
|
-
d.size > 0 ? o.sort((i,
|
|
916
|
-
const
|
|
917
|
-
return
|
|
915
|
+
d.size > 0 ? o.sort((i, u) => {
|
|
916
|
+
const l = d.has(i.value), c = d.has(u.value);
|
|
917
|
+
return l && !c ? -1 : !l && c ? 1 : l && c ? D.current.indexOf(i.value) - D.current.indexOf(u.value) : i.value.localeCompare(u.value);
|
|
918
918
|
}) : o.sort(
|
|
919
|
-
(i,
|
|
919
|
+
(i, u) => u.popularity === i.popularity ? i.value.localeCompare(u.value) : u.popularity - i.popularity
|
|
920
920
|
), Te(o);
|
|
921
921
|
} catch (r) {
|
|
922
922
|
console.error("[VehicleSearch] Error loading makes for year:", r);
|
|
923
923
|
}
|
|
924
924
|
})();
|
|
925
|
-
}, [
|
|
925
|
+
}, [z, e.year, ae, le]);
|
|
926
926
|
const jt = F(() => {
|
|
927
927
|
(async () => {
|
|
928
928
|
let r = [];
|
|
929
929
|
if (we.current && we.current.length)
|
|
930
930
|
r = we.current;
|
|
931
|
-
else if (
|
|
931
|
+
else if (C.current)
|
|
932
932
|
try {
|
|
933
|
-
const n = await
|
|
933
|
+
const n = await C.current.search("", {
|
|
934
934
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
935
935
|
limit: 1e3
|
|
936
936
|
}), o = /* @__PURE__ */ new Map();
|
|
@@ -951,8 +951,8 @@ function Kt({
|
|
|
951
951
|
)), D.current && D.current.length > 0) {
|
|
952
952
|
const n = new Set(D.current);
|
|
953
953
|
r.sort((o, d) => {
|
|
954
|
-
const i = n.has(o.value),
|
|
955
|
-
return i && !
|
|
954
|
+
const i = n.has(o.value), u = n.has(d.value);
|
|
955
|
+
return i && !u ? -1 : !i && u ? 1 : i && u ? D.current.indexOf(o.value) - D.current.indexOf(d.value) : o.value.localeCompare(d.value);
|
|
956
956
|
});
|
|
957
957
|
} else
|
|
958
958
|
r.sort((n, o) => n.popularity === o.popularity ? n.value.localeCompare(o.value) : o.popularity - n.popularity);
|
|
@@ -971,130 +971,130 @@ function Kt({
|
|
|
971
971
|
se([]);
|
|
972
972
|
return;
|
|
973
973
|
}
|
|
974
|
-
const i =
|
|
975
|
-
i.map((
|
|
976
|
-
),
|
|
977
|
-
let
|
|
978
|
-
if (
|
|
979
|
-
const
|
|
980
|
-
(
|
|
974
|
+
const i = v ? v.trim().split(",").map((x) => x.trim()).filter(Boolean) : [], u = new Set(
|
|
975
|
+
i.map((x) => O(x))
|
|
976
|
+
), l = typeof y.current == "object" && !Array.isArray(y.current) && y.current !== null ? y.current : null;
|
|
977
|
+
let c = [];
|
|
978
|
+
if (l && (c = l[r] || [], Array.isArray(c) || (c = []), c.length === 0)) {
|
|
979
|
+
const x = Object.keys(l).find(
|
|
980
|
+
(_) => O(_) === n
|
|
981
981
|
);
|
|
982
|
-
if (
|
|
983
|
-
const
|
|
984
|
-
|
|
982
|
+
if (x) {
|
|
983
|
+
const _ = l[x];
|
|
984
|
+
c = Array.isArray(_) ? _ : [];
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
const
|
|
988
|
-
|
|
989
|
-
(
|
|
987
|
+
const $ = new Set(
|
|
988
|
+
c.map(
|
|
989
|
+
(x) => O(x)
|
|
990
990
|
)
|
|
991
|
-
),
|
|
992
|
-
let
|
|
993
|
-
if (
|
|
994
|
-
Array.from(
|
|
995
|
-
(
|
|
991
|
+
), A = $.size > 0 ? $ : null;
|
|
992
|
+
let p = u;
|
|
993
|
+
if (u.size > 0 && $.size > 0 && (p = new Set(
|
|
994
|
+
Array.from(u).filter(
|
|
995
|
+
(x) => $.has(x)
|
|
996
996
|
)
|
|
997
|
-
)),
|
|
997
|
+
)), u.size > 0 && p.size === 0) {
|
|
998
998
|
se([]);
|
|
999
999
|
return;
|
|
1000
1000
|
}
|
|
1001
|
-
if (V &&
|
|
1002
|
-
let
|
|
1003
|
-
value:
|
|
1004
|
-
refinement:
|
|
1001
|
+
if (V && c.length > 0) {
|
|
1002
|
+
let _ = c.map((h) => ({
|
|
1003
|
+
value: h,
|
|
1004
|
+
refinement: h,
|
|
1005
1005
|
popularity: 0
|
|
1006
1006
|
// Popularity will be used from PostHog for sorting
|
|
1007
1007
|
}));
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
(
|
|
1011
|
-
|
|
1012
|
-
),
|
|
1013
|
-
|
|
1014
|
-
(
|
|
1015
|
-
|
|
1008
|
+
_ = We(
|
|
1009
|
+
_,
|
|
1010
|
+
(h) => h.value,
|
|
1011
|
+
p
|
|
1012
|
+
), _ = We(
|
|
1013
|
+
_,
|
|
1014
|
+
(h) => h.value,
|
|
1015
|
+
A
|
|
1016
1016
|
);
|
|
1017
1017
|
const E = (t = ee.current) == null ? void 0 : t[r];
|
|
1018
1018
|
if (E && Array.isArray(E)) {
|
|
1019
|
-
const
|
|
1019
|
+
const h = new Map(
|
|
1020
1020
|
E.map((Q, ce) => [
|
|
1021
1021
|
Q.toUpperCase(),
|
|
1022
1022
|
E.length - ce
|
|
1023
1023
|
])
|
|
1024
1024
|
);
|
|
1025
|
-
|
|
1026
|
-
const Fe =
|
|
1025
|
+
_.sort((Q, ce) => {
|
|
1026
|
+
const Fe = h.get(Q.value.toUpperCase()) || 0, fe = h.get(ce.value.toUpperCase()) || 0;
|
|
1027
1027
|
return Fe !== fe ? fe - Fe : Q.value.localeCompare(ce.value);
|
|
1028
1028
|
});
|
|
1029
1029
|
} else
|
|
1030
|
-
|
|
1031
|
-
se(
|
|
1030
|
+
_.sort((h, Q) => h.value.localeCompare(Q.value));
|
|
1031
|
+
se(_);
|
|
1032
1032
|
return;
|
|
1033
1033
|
}
|
|
1034
|
-
if (!_e.current || !
|
|
1034
|
+
if (!_e.current || !f)
|
|
1035
1035
|
return;
|
|
1036
1036
|
_e.current.search("", {
|
|
1037
1037
|
filter: `make = "${e.make.refinement}"`,
|
|
1038
1038
|
limit: 1
|
|
1039
1039
|
// Only one document per make
|
|
1040
|
-
}).then((
|
|
1040
|
+
}).then((x) => {
|
|
1041
1041
|
var vt, ut;
|
|
1042
|
-
const { hits:
|
|
1042
|
+
const { hits: _ } = x;
|
|
1043
1043
|
let E = [];
|
|
1044
|
-
|
|
1045
|
-
let
|
|
1046
|
-
model: `${e.make.refinement} > ${
|
|
1047
|
-
model_popularity:
|
|
1044
|
+
_.length > 0 && _[0].models && (E = _[0].models);
|
|
1045
|
+
let h = E.map((k) => ({
|
|
1046
|
+
model: `${e.make.refinement} > ${k.name}`,
|
|
1047
|
+
model_popularity: k.popularity || 0
|
|
1048
1048
|
})), Q = [];
|
|
1049
|
-
Array.isArray(y.current) ? Q = y.current : typeof y.current == "object" && y.current !== null ? Q =
|
|
1049
|
+
Array.isArray(y.current) ? Q = y.current : typeof y.current == "object" && y.current !== null ? Q = c : typeof y.current == "string" && y.current.length && (Q = y.current.split(",").map((k) => k.trim()).filter(Boolean));
|
|
1050
1050
|
let ce = Q;
|
|
1051
|
-
if (
|
|
1052
|
-
(
|
|
1053
|
-
O(
|
|
1051
|
+
if (p.size > 0 && (ce = Q.length ? Q.filter(
|
|
1052
|
+
(k) => p.has(
|
|
1053
|
+
O(k)
|
|
1054
1054
|
)
|
|
1055
|
-
) : i,
|
|
1056
|
-
(
|
|
1055
|
+
) : i, h = h.filter(
|
|
1056
|
+
(k) => p.has(
|
|
1057
1057
|
O(
|
|
1058
|
-
xe(
|
|
1058
|
+
xe(k.model)
|
|
1059
1059
|
)
|
|
1060
1060
|
)
|
|
1061
1061
|
)), ce && ce.length > 0) {
|
|
1062
|
-
const
|
|
1062
|
+
const k = new Set(
|
|
1063
1063
|
ce.map((de) => O(de))
|
|
1064
1064
|
);
|
|
1065
|
-
|
|
1066
|
-
(de) =>
|
|
1065
|
+
h.some(
|
|
1066
|
+
(de) => k.has(
|
|
1067
1067
|
O(
|
|
1068
1068
|
xe(de.model)
|
|
1069
1069
|
)
|
|
1070
1070
|
)
|
|
1071
|
-
) && (
|
|
1072
|
-
(de) =>
|
|
1071
|
+
) && (h = h.filter(
|
|
1072
|
+
(de) => k.has(
|
|
1073
1073
|
O(
|
|
1074
1074
|
xe(de.model)
|
|
1075
1075
|
)
|
|
1076
1076
|
)
|
|
1077
1077
|
));
|
|
1078
1078
|
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
(
|
|
1082
|
-
|
|
1083
|
-
),
|
|
1084
|
-
const H = xe(
|
|
1079
|
+
h = We(
|
|
1080
|
+
h,
|
|
1081
|
+
(k) => xe(k.model),
|
|
1082
|
+
A
|
|
1083
|
+
), h = h.filter((k) => xe(k.model) !== "").map((k) => {
|
|
1084
|
+
const H = xe(k.model);
|
|
1085
1085
|
return {
|
|
1086
1086
|
value: H,
|
|
1087
1087
|
refinement: H,
|
|
1088
|
-
popularity:
|
|
1088
|
+
popularity: k.model_popularity
|
|
1089
1089
|
};
|
|
1090
1090
|
});
|
|
1091
1091
|
const Fe = (vt = e.make) == null ? void 0 : vt.refinement, fe = (ut = ee.current) == null ? void 0 : ut[Fe];
|
|
1092
1092
|
if (fe && Array.isArray(fe) && fe.length > 0) {
|
|
1093
|
-
const
|
|
1093
|
+
const k = new Set(
|
|
1094
1094
|
fe.map((H) => String(H).trim().toUpperCase())
|
|
1095
1095
|
);
|
|
1096
|
-
|
|
1097
|
-
const He =
|
|
1096
|
+
h.sort((H, de) => {
|
|
1097
|
+
const He = k.has(H.value), Ke = k.has(de.value);
|
|
1098
1098
|
if (He && !Ke) return -1;
|
|
1099
1099
|
if (!He && Ke) return 1;
|
|
1100
1100
|
if (He && Ke) {
|
|
@@ -1106,44 +1106,44 @@ function Kt({
|
|
|
1106
1106
|
return H.value.localeCompare(de.value);
|
|
1107
1107
|
});
|
|
1108
1108
|
} else
|
|
1109
|
-
|
|
1110
|
-
se(
|
|
1111
|
-
}).catch((
|
|
1112
|
-
console.error("[VehicleSearch] Error loading models:",
|
|
1109
|
+
h.sort((k, H) => k.popularity === H.popularity ? k.value.localeCompare(H.value) : H.popularity - k.popularity);
|
|
1110
|
+
se(h);
|
|
1111
|
+
}).catch((x) => {
|
|
1112
|
+
console.error("[VehicleSearch] Error loading models:", x), se([]);
|
|
1113
1113
|
});
|
|
1114
1114
|
} else
|
|
1115
1115
|
se([]);
|
|
1116
1116
|
}, [
|
|
1117
1117
|
e.make,
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1118
|
+
v,
|
|
1119
|
+
f,
|
|
1120
|
+
z,
|
|
1121
1121
|
e.year,
|
|
1122
1122
|
V,
|
|
1123
1123
|
ae,
|
|
1124
1124
|
le
|
|
1125
1125
|
]), P(() => {
|
|
1126
|
-
if (
|
|
1126
|
+
if (C.current && e.make && e.model) {
|
|
1127
1127
|
let t = [
|
|
1128
1128
|
`model:${e.make.refinement} > ${e.model.refinement}`
|
|
1129
1129
|
];
|
|
1130
|
-
|
|
1130
|
+
b && (e.body && t.push(
|
|
1131
1131
|
`body:${e.make.refinement} > ${e.model.refinement} > ${e.body.refinement}`
|
|
1132
1132
|
), e.series && t.push(`series:${e.series.refinement}`), e.engine && t.push(`engine:${e.engine.refinement}`), e.engine_capacity && t.push(
|
|
1133
1133
|
`engine_capacity:${e.engine_capacity.refinement}`
|
|
1134
|
-
)),
|
|
1134
|
+
)), C.current.search("", {
|
|
1135
1135
|
filter: Oe(t, []),
|
|
1136
1136
|
attributesToRetrieve: ["year_from", "year_to", "otto_id"],
|
|
1137
1137
|
limit: 200
|
|
1138
1138
|
// Reduced from 1000 for faster queries
|
|
1139
1139
|
}).then(({ hits: r }) => {
|
|
1140
|
-
const n = r.map((
|
|
1141
|
-
let
|
|
1140
|
+
const n = r.map((l) => l.year_from), o = Math.min(...n), d = r.map((l) => l.year_to), i = Math.max(...d);
|
|
1141
|
+
let u = Array.apply(null, {
|
|
1142
1142
|
length: i + 1 - o
|
|
1143
|
-
}).map(function(
|
|
1144
|
-
return
|
|
1143
|
+
}).map(function(l, c) {
|
|
1144
|
+
return c + o;
|
|
1145
1145
|
});
|
|
1146
|
-
|
|
1146
|
+
u = u.reverse().map((l) => ({ value: l, refinement: l })), Me(u);
|
|
1147
1147
|
}).catch((r) => {
|
|
1148
1148
|
console.error("[VehicleSearch] Error fetching years:", r);
|
|
1149
1149
|
});
|
|
@@ -1151,20 +1151,20 @@ function Kt({
|
|
|
1151
1151
|
}, [
|
|
1152
1152
|
e.model,
|
|
1153
1153
|
e.make,
|
|
1154
|
-
|
|
1155
|
-
|
|
1154
|
+
z,
|
|
1155
|
+
b,
|
|
1156
1156
|
e.body,
|
|
1157
1157
|
e.series,
|
|
1158
1158
|
e.engine,
|
|
1159
1159
|
e.engine_capacity
|
|
1160
1160
|
]), P(() => {
|
|
1161
|
-
const t =
|
|
1162
|
-
if (
|
|
1161
|
+
const t = b ? e.make && e.model : e.year && e.make && e.model;
|
|
1162
|
+
if (C.current && t) {
|
|
1163
1163
|
const r = e.year ? [
|
|
1164
1164
|
`year_from <= ${e.year.value}`,
|
|
1165
1165
|
`year_to >= ${e.year.value}`
|
|
1166
1166
|
] : [];
|
|
1167
|
-
|
|
1167
|
+
C.current.search("", {
|
|
1168
1168
|
filter: Oe(
|
|
1169
1169
|
[`model:${e.make.refinement} > ${e.model.refinement}`],
|
|
1170
1170
|
r
|
|
@@ -1178,7 +1178,7 @@ function Kt({
|
|
|
1178
1178
|
})).filter((o) => o.value), Ne(n);
|
|
1179
1179
|
});
|
|
1180
1180
|
}
|
|
1181
|
-
}, [e.year, e.make, e.model,
|
|
1181
|
+
}, [e.year, e.make, e.model, b]);
|
|
1182
1182
|
const $e = F(({ hits: t, attribute: r, stateCallback: n }) => {
|
|
1183
1183
|
let o = [
|
|
1184
1184
|
...new Map(t.map((d) => [d[r], d])).values()
|
|
@@ -1192,8 +1192,8 @@ function Kt({
|
|
|
1192
1192
|
return `vs:lg:grid-cols-${r > 8 ? 8 : r}`;
|
|
1193
1193
|
}, [ne]);
|
|
1194
1194
|
P(() => {
|
|
1195
|
-
const t =
|
|
1196
|
-
if (
|
|
1195
|
+
const t = b ? e.make && e.model : e.make && e.model && e.year;
|
|
1196
|
+
if (C.current && t) {
|
|
1197
1197
|
let r = [
|
|
1198
1198
|
`make:${e.make.refinement}`,
|
|
1199
1199
|
`model:${e.make.refinement} > ${e.model.refinement}`,
|
|
@@ -1207,7 +1207,7 @@ function Kt({
|
|
|
1207
1207
|
`year_from <= ${e.year.value}`,
|
|
1208
1208
|
`year_to >= ${e.year.value}`
|
|
1209
1209
|
] : [];
|
|
1210
|
-
|
|
1210
|
+
C.current.search("", {
|
|
1211
1211
|
filter: Oe(r, n),
|
|
1212
1212
|
attributesToRetrieve: [
|
|
1213
1213
|
"series",
|
|
@@ -1248,16 +1248,16 @@ function Kt({
|
|
|
1248
1248
|
e.make,
|
|
1249
1249
|
e.model,
|
|
1250
1250
|
e.year,
|
|
1251
|
-
|
|
1251
|
+
b
|
|
1252
1252
|
]);
|
|
1253
1253
|
const [De, Ze] = N(!1);
|
|
1254
1254
|
return P(() => {
|
|
1255
|
-
if (
|
|
1255
|
+
if (g)
|
|
1256
1256
|
return De ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
1257
1257
|
document.body.style.overflow = "";
|
|
1258
1258
|
};
|
|
1259
|
-
}, [De,
|
|
1260
|
-
|
|
1259
|
+
}, [De, g]), /* @__PURE__ */ I(Ue, { children: [
|
|
1260
|
+
g && /* @__PURE__ */ a(
|
|
1261
1261
|
"button",
|
|
1262
1262
|
{
|
|
1263
1263
|
onClick: () => Ze(!0),
|
|
@@ -1269,7 +1269,7 @@ function Kt({
|
|
|
1269
1269
|
children: /* @__PURE__ */ a("span", { children: j })
|
|
1270
1270
|
}
|
|
1271
1271
|
),
|
|
1272
|
-
|
|
1272
|
+
g && /* @__PURE__ */ a(
|
|
1273
1273
|
"div",
|
|
1274
1274
|
{
|
|
1275
1275
|
onClick: () => Ze(!1),
|
|
@@ -1284,11 +1284,11 @@ function Kt({
|
|
|
1284
1284
|
{
|
|
1285
1285
|
className: me(
|
|
1286
1286
|
"partbot-mmyvs-container",
|
|
1287
|
-
|
|
1287
|
+
g && De && "active",
|
|
1288
1288
|
"w-full"
|
|
1289
1289
|
),
|
|
1290
1290
|
children: [
|
|
1291
|
-
|
|
1291
|
+
g && /* @__PURE__ */ I("div", { className: "vs:flex vs:justify-between vs:items-center vs:pb-4 vs:font-bold vs:text-white vs:md:hidden", children: [
|
|
1292
1292
|
/* @__PURE__ */ a("span", { children: "Select Vehicle" }),
|
|
1293
1293
|
/* @__PURE__ */ I(
|
|
1294
1294
|
"button",
|
|
@@ -1322,7 +1322,7 @@ function Kt({
|
|
|
1322
1322
|
"vs:w-full vs:transition vs:lg:mx-auto"
|
|
1323
1323
|
),
|
|
1324
1324
|
children: [
|
|
1325
|
-
|
|
1325
|
+
z ? /* @__PURE__ */ I(Ue, { children: [
|
|
1326
1326
|
/* @__PURE__ */ a(
|
|
1327
1327
|
oe,
|
|
1328
1328
|
{
|
|
@@ -1556,39 +1556,39 @@ function Kt({
|
|
|
1556
1556
|
] });
|
|
1557
1557
|
}
|
|
1558
1558
|
let gt = !1, Ae = !1;
|
|
1559
|
-
function qt(
|
|
1559
|
+
function qt(f) {
|
|
1560
1560
|
var B, pe;
|
|
1561
|
-
const
|
|
1562
|
-
if (!
|
|
1561
|
+
const m = f.shadowRoot;
|
|
1562
|
+
if (!m) {
|
|
1563
1563
|
console.error("[ShadowDOMPatch] No shadow root found");
|
|
1564
1564
|
return;
|
|
1565
1565
|
}
|
|
1566
|
-
const
|
|
1567
|
-
if (!
|
|
1566
|
+
const v = m.children[1];
|
|
1567
|
+
if (!v) {
|
|
1568
1568
|
console.error("[ShadowDOMPatch] No mount point found in shadow root");
|
|
1569
1569
|
return;
|
|
1570
1570
|
}
|
|
1571
|
-
if (new MutationObserver((
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
S.nodeType === 1 && S.id === "headlessui-portal-root" && (
|
|
1571
|
+
if (new MutationObserver((g) => {
|
|
1572
|
+
g.forEach((M) => {
|
|
1573
|
+
M.addedNodes.forEach((S) => {
|
|
1574
|
+
S.nodeType === 1 && S.id === "headlessui-portal-root" && (v.appendChild(S), Ae = !0);
|
|
1575
1575
|
});
|
|
1576
|
-
}),
|
|
1577
|
-
|
|
1578
|
-
S.nodeType === 1 && S.id === "headlessui-portal-root" && (
|
|
1576
|
+
}), g.forEach((M) => {
|
|
1577
|
+
M.removedNodes.forEach((S) => {
|
|
1578
|
+
S.nodeType === 1 && S.id === "headlessui-portal-root" && (v.querySelector(
|
|
1579
1579
|
"#headlessui-portal-root"
|
|
1580
1580
|
) || (Ae = !1));
|
|
1581
1581
|
});
|
|
1582
1582
|
});
|
|
1583
1583
|
}).observe(document.body, {
|
|
1584
1584
|
childList: !0
|
|
1585
|
-
}), new MutationObserver((
|
|
1586
|
-
|
|
1587
|
-
|
|
1585
|
+
}), new MutationObserver((g) => {
|
|
1586
|
+
g.forEach((M) => {
|
|
1587
|
+
M.removedNodes.forEach((S) => {
|
|
1588
1588
|
S.nodeType === 1 && S.id === "headlessui-portal-root" && (Ae = !1);
|
|
1589
1589
|
});
|
|
1590
1590
|
});
|
|
1591
|
-
}).observe(
|
|
1591
|
+
}).observe(v, {
|
|
1592
1592
|
childList: !0,
|
|
1593
1593
|
subtree: !0
|
|
1594
1594
|
}), gt)
|
|
@@ -1599,8 +1599,8 @@ function qt(h) {
|
|
|
1599
1599
|
)) == null ? void 0 : B.get;
|
|
1600
1600
|
Object.defineProperty(Document.prototype, "activeElement", {
|
|
1601
1601
|
get: function() {
|
|
1602
|
-
const
|
|
1603
|
-
return
|
|
1602
|
+
const g = X == null ? void 0 : X.call(this);
|
|
1603
|
+
return g === f ? m.activeElement : g;
|
|
1604
1604
|
}
|
|
1605
1605
|
});
|
|
1606
1606
|
const Y = (pe = Object.getOwnPropertyDescriptor(
|
|
@@ -1609,20 +1609,20 @@ function qt(h) {
|
|
|
1609
1609
|
)) == null ? void 0 : pe.get;
|
|
1610
1610
|
Object.defineProperty(Event.prototype, "target", {
|
|
1611
1611
|
get: function() {
|
|
1612
|
-
const
|
|
1613
|
-
return
|
|
1612
|
+
const g = Y == null ? void 0 : Y.call(this);
|
|
1613
|
+
return g === f ? this.composedPath()[0] : g;
|
|
1614
1614
|
}
|
|
1615
1615
|
});
|
|
1616
|
-
const T = (
|
|
1616
|
+
const T = (g) => {
|
|
1617
1617
|
try {
|
|
1618
|
-
return document.body &&
|
|
1618
|
+
return document.body && g === document.body.style;
|
|
1619
1619
|
} catch {
|
|
1620
1620
|
return !1;
|
|
1621
1621
|
}
|
|
1622
1622
|
}, K = CSSStyleDeclaration.prototype.setProperty;
|
|
1623
|
-
CSSStyleDeclaration.prototype.setProperty = function(
|
|
1624
|
-
if (!(T(this) &&
|
|
1625
|
-
return K.call(this,
|
|
1623
|
+
CSSStyleDeclaration.prototype.setProperty = function(g, M, S) {
|
|
1624
|
+
if (!(T(this) && g === "overflow" && M === "hidden" && Ae))
|
|
1625
|
+
return K.call(this, g, M, S);
|
|
1626
1626
|
};
|
|
1627
1627
|
const Z = Object.getOwnPropertyDescriptor(
|
|
1628
1628
|
CSSStyleDeclaration.prototype,
|
|
@@ -1632,9 +1632,9 @@ function qt(h) {
|
|
|
1632
1632
|
get: function() {
|
|
1633
1633
|
return Z.get.call(this);
|
|
1634
1634
|
},
|
|
1635
|
-
set: function(
|
|
1636
|
-
if (!(T(this) &&
|
|
1637
|
-
return Z.set.call(this,
|
|
1635
|
+
set: function(g) {
|
|
1636
|
+
if (!(T(this) && g === "hidden" && Ae))
|
|
1637
|
+
return Z.set.call(this, g);
|
|
1638
1638
|
}
|
|
1639
1639
|
}), gt = !0;
|
|
1640
1640
|
}
|
|
@@ -1645,15 +1645,15 @@ class Wt extends HTMLElement {
|
|
|
1645
1645
|
const y = document.createElement("link");
|
|
1646
1646
|
y.id = "vehicle-search-inter-font", y.rel = "stylesheet", y.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap", document.head.appendChild(y);
|
|
1647
1647
|
}
|
|
1648
|
-
let
|
|
1649
|
-
|
|
1650
|
-
const
|
|
1648
|
+
let m = document.createElement("style");
|
|
1649
|
+
m.textContent = Yt;
|
|
1650
|
+
const v = document.createElement("div"), J = this.attachShadow({ mode: "open" }), L = (y, D, ee) => {
|
|
1651
1651
|
let te;
|
|
1652
1652
|
if (this.hasAttribute(D)) {
|
|
1653
|
-
const
|
|
1654
|
-
if (/^#[0-9A-F]{6}$/i.test(
|
|
1655
|
-
const _e = parseInt(
|
|
1656
|
-
te = `${_e} ${R} ${
|
|
1653
|
+
const C = this.getAttribute(D);
|
|
1654
|
+
if (/^#[0-9A-F]{6}$/i.test(C)) {
|
|
1655
|
+
const _e = parseInt(C.slice(1, 3), 16), R = parseInt(C.slice(3, 5), 16), z = parseInt(C.slice(5, 7), 16);
|
|
1656
|
+
te = `${_e} ${R} ${z}`;
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
1659
1659
|
return te = te || ee, `:host { --${y}: ${te}; } .partbot-mmyvs-container { --${y}: ${te}; }`;
|
|
@@ -1682,7 +1682,7 @@ class Wt extends HTMLElement {
|
|
|
1682
1682
|
"partbot-mobile-background-color",
|
|
1683
1683
|
"data-mobile-background-color",
|
|
1684
1684
|
"0 0 0"
|
|
1685
|
-
), pe = `: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"}; }`,
|
|
1685
|
+
), pe = `: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"}; }`, M = `: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"}; }`;
|
|
1686
1686
|
const ve = this.getAttribute("data-input-shadow"), ne = ve === "none" ? "none" : ve || "0 1px 2px 0 rgb(0 0 0 / 0.05)";
|
|
1687
1687
|
let ie = `:host { --partbot-input-shadow: ${ne}; } .partbot-mmyvs-container { --partbot-input-shadow: ${ne}; }`;
|
|
1688
1688
|
const w = this.getAttribute("data-input-border-color");
|
|
@@ -1693,9 +1693,9 @@ class Wt extends HTMLElement {
|
|
|
1693
1693
|
V = `${y} ${D} ${ee}`;
|
|
1694
1694
|
} else /^\d+\s+\d+\s+\d+$/.test(w) && (V = w);
|
|
1695
1695
|
let be = `:host { --partbot-input-border-color: ${V}; } .partbot-mmyvs-container { --partbot-input-border-color: ${V}; }`;
|
|
1696
|
-
const
|
|
1697
|
-
let
|
|
1698
|
-
|
|
1696
|
+
const s = this.getAttribute("data-input-border-width") || "1px";
|
|
1697
|
+
let b = `:host { --partbot-input-border-width: ${s}; } .partbot-mmyvs-container { --partbot-input-border-width: ${s}; }`;
|
|
1698
|
+
m.textContent += X, m.textContent += Y, m.textContent += T, m.textContent += K, m.textContent += Z, m.textContent += B, m.textContent += pe, m.textContent += g, m.textContent += M, m.textContent += S, m.textContent += ie, m.textContent += be, m.textContent += b, J.appendChild(m), J.appendChild(v);
|
|
1699
1699
|
const j = this.getAttribute("data-api-key");
|
|
1700
1700
|
if (!j) {
|
|
1701
1701
|
console.warn("Missing attributes: " + (j ? "" : "data-api-key "));
|
|
@@ -1705,13 +1705,13 @@ class Wt extends HTMLElement {
|
|
|
1705
1705
|
for (let y = 0; y < ke.length; y++) {
|
|
1706
1706
|
const { name: D, value: ee } = ke[y];
|
|
1707
1707
|
if (D.startsWith("data-")) {
|
|
1708
|
-
const te = D.slice(5).replace(/-([a-z])/g, (
|
|
1708
|
+
const te = D.slice(5).replace(/-([a-z])/g, (C) => C[1].toUpperCase());
|
|
1709
1709
|
Ce[te] = ee === "true" ? !0 : ee === "false" ? !1 : ee;
|
|
1710
1710
|
}
|
|
1711
1711
|
}
|
|
1712
1712
|
qt(this);
|
|
1713
1713
|
const we = /* @__PURE__ */ a(Kt, { ...Ce });
|
|
1714
|
-
Pt.render(we,
|
|
1714
|
+
Pt.render(we, v);
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
1717
|
customElements.define("vehicle-search", Wt);
|