@getcredify/credify-insurance-widget 1.7.2 → 1.8.2
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/credify-insurance-widget.css +1 -1
- package/dist/iframe/assets/iframe-BX0vtreg.js +50 -0
- package/dist/iframe/assets/iframe-BX0vtreg.js.map +1 -0
- package/dist/iframe/assets/iframe-DKxk2TnK.css +1 -0
- package/dist/iframe/iframe.html +2 -2
- package/dist/index.es.js +2839 -1084
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/iframe/assets/iframe-5Q3mEx6K.js +0 -50
- package/dist/iframe/assets/iframe-5Q3mEx6K.js.map +0 -1
- package/dist/iframe/assets/iframe-CcbXvutI.css +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@import"https://fonts.googleapis.com/css2?family=Spline+Sans:wght@400;500;700&display=swap";/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@layer properties,theme,base,components,utilities;@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-emerald-600:oklch(59.6% .145 163.225);--color-blue-50:oklch(97% .014 254.604);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--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%;tab-size:4;line-height:1.5;font-family:var(--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(--default-font-feature-settings,normal);font-variation-settings:var(--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(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--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{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.z-0{z-index:0}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-4{margin-top:calc(var(--spacing)*-4)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.h-5{height:calc(var(--spacing)*5)}.h-12{height:calc(var(--spacing)*12)}.max-h-60{max-height:calc(var(--spacing)*60)}.max-h-\\[90vh\\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-screen{min-height:100vh}.w-5{width:calc(var(--spacing)*5)}.w-12{width:calc(var(--spacing)*12)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\\[var\\(--accent-color\\)\\]{border-color:var(--accent-color)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-red-500{border-color:var(--color-red-500)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.object-contain{object-fit:contain}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--text-primary\\)\\]{color:var(--text-primary)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.underline{text-decoration-line:underline}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.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)}.shadow-sm{--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{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,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.focus-within\\:border-\\[var\\(--primary-color\\)\\]:focus-within{border-color:var(--primary-color)}@media (hover:hover){.hover\\:bg-blue-600\\/90:hover{background-color:#155dfce6}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/90:hover{background-color:color-mix(in oklab,var(--color-blue-600)90%,transparent)}}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:text-blue-700:hover{color:var(--color-blue-700)}.hover\\:text-slate-600:hover{color:var(--color-slate-600)}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px 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)}}.focus-visible\\:ring-2:focus-visible{--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)}.focus-visible\\:ring-blue-600\\/40:focus-visible{--tw-ring-color:#155dfc66}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-600\\/40:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-600)40%,transparent)}}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-slate-300:disabled{background-color:var(--color-slate-300)}.disabled\\:text-slate-500:disabled{color:var(--color-slate-500)}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:64rem){.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}:root{--primary-color:#006aff;--secondary-color:#f0f4ff;--background-color:#fff;--text-primary:#1a202c;--text-secondary:#718096;--accent-color:#e2e8f0;--radius-sm:.25rem;--radius-md:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-2xl:1.25rem;--radius-3xl:1.75rem;--radius-full:9999px;--radio-dot-svg:url("data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27%23006aff%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%274%27/%3e%3c/svg%3e");--select-button-svg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24px' height='24px' fill='%23718096' viewBox='0 0 256 256'%3e%3cpath d='m215.39 92.94-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 1 1 11.32-11.32L128 154.06l74.07-72.44a8 8 0 0 1 11.32 11.32Z'/%3e%3c/svg%3e")}#insurance-widget-root,#root{color:var(--text-primary);font-family:Spline Sans,ui-sans-serif,system-ui,sans-serif}#insurance-widget-root .backdrop,#root .backdrop{background:#00000080;position:fixed;inset:0}#insurance-widget-root .modal-panel,#root .modal-panel{border-radius:var(--radius-2xl);padding:1.5rem;box-shadow:0 24px 64px -20px #00000059;background:#fff!important}@media (min-width:640px){#insurance-widget-root .modal-panel,#root .modal-panel{padding:2rem}}@media (min-width:768px){#insurance-widget-root .modal-panel,#root .modal-panel{padding:2.5rem}}@media (max-width:767px){#insurance-widget-root .modal-panel,#root .modal-panel{width:100%;max-width:none;height:100%;max-height:none;box-shadow:none;border-radius:0;position:fixed;inset:0}}#insurance-widget-root .h1-title,#root .h1-title{letter-spacing:-.01em;color:var(--text-primary);font-size:1.875rem;font-weight:700;line-height:2.25rem}@media (min-width:640px){#insurance-widget-root .h1-title,#root .h1-title{font-size:2.25rem;line-height:2.5rem}}#insurance-widget-root .p-subtitle,#root .p-subtitle{color:var(--text-secondary);margin-top:.5rem}#insurance-widget-root .form-label,#root .form-label{color:var(--text-secondary);margin-bottom:.5rem;font-size:.875rem;font-weight:500;display:block}#insurance-widget-root .form-input,#root .form-input{border-radius:var(--radius-lg);border:1px solid var(--accent-color);width:100%;color:var(--text-primary);background:#fff;outline:none;padding:.75rem 1rem;font-size:1rem;transition:box-shadow .15s,border-color .15s}#insurance-widget-root .form-input::placeholder,#root .form-input::placeholder{color:#94a3b8}#insurance-widget-root .form-input:focus,#root .form-input:focus{border-color:var(--primary-color);box-shadow:0 0 0 1px var(--primary-color)}#insurance-widget-root .select-caret,#root .select-caret{background-image:var(--select-button-svg);appearance:none;background-position:right .75rem center;background-repeat:no-repeat;background-size:1.25rem 1.25rem;padding-right:2.5rem}#insurance-widget-root .radio-card,#root .radio-card{border-radius:var(--radius-md);border:2px solid var(--accent-color);cursor:pointer;background:#fff;align-items:center;gap:.75rem;padding:1rem;transition:all .15s;display:flex}#insurance-widget-root .radio-card:hover,#root .radio-card:hover{border-color:#cfd8e3}#insurance-widget-root .radio-input,#root .radio-input{border:2px solid var(--accent-color);appearance:none;background:0 0;border-radius:9999px;outline:none;width:1.25rem;height:1.25rem}#insurance-widget-root .radio-input:checked,#root .radio-input:checked{border-color:var(--primary-color);background-image:var(--radio-dot-svg);background-position:50%;background-repeat:no-repeat}#insurance-widget-root .radio-card:has(.radio-input:checked),#root .radio-card:has(.radio-input:checked){border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color)}@supports (color:color-mix(in lab,red,red)){#insurance-widget-root .radio-card:has(.radio-input:checked),#root .radio-card:has(.radio-input:checked){box-shadow:0 0 0 2px color-mix(in oklab,var(--primary-color)20%,transparent)}}#insurance-widget-root .radio-label,#root .radio-label{color:var(--text-primary);font-size:1rem;font-weight:600}#insurance-widget-root .btn-primary,#root .btn-primary{border-radius:var(--radius-full);background:var(--primary-color);color:#fff;letter-spacing:.02em;justify-content:center;align-items:center;width:100%;height:3rem;font-weight:700;transition:opacity .15s;display:flex}#insurance-widget-root .btn-primary:hover,#root .btn-primary:hover{opacity:.9}#insurance-widget-root .btn-outline,#root .btn-outline{border-radius:var(--radius-full);width:100%;height:3rem;color:var(--text-primary);border:1px solid var(--accent-color);letter-spacing:.02em;background:#fff;justify-content:center;align-items:center;font-weight:700;transition:background .15s,color .15s,border-color .15s,opacity .15s;display:flex}#insurance-widget-root .btn-outline:hover,#root .btn-outline:hover{border-color:#cfd8e3}#insurance-widget-root .btn-primary,#root .btn-primary,#insurance-widget-root .btn-outline,#root .btn-outline{cursor:pointer}#insurance-widget-root .btn-primary:disabled,#root .btn-primary:disabled,#insurance-widget-root .btn-outline:disabled,#root .btn-outline:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(20%)}#insurance-widget-root .btn-primary:not(:disabled):hover,#root .btn-primary:not(:disabled):hover{opacity:.95}#insurance-widget-root .btn-outline:not(:disabled):hover,#root .btn-outline:not(:disabled):hover{border-color:#cfd8e3}#insurance-widget-root .quote-btn,#root .quote-btn{background-color:var(--color-blue-600);padding-inline:calc(var(--spacing)*6);padding-block:calc(var(--spacing)*3);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white);--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);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,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-radius:3.40282e38px}@media (hover:hover){:is(#insurance-widget-root .quote-btn,#root .quote-btn):hover{background-color:var(--color-blue-700)}}#insurance-widget-root .input-error,#root .input-error{border-color:#dc2626!important;box-shadow:0 0 0 1px #dc2626!important}#insurance-widget-root .checkbox-card,#root .checkbox-card{border-radius:var(--radius-md);border:2px solid var(--accent-color);cursor:pointer;background:#fff;align-items:center;gap:.75rem;padding:1rem;transition:all .15s;display:flex}#insurance-widget-root .checkbox-card:hover,#root .checkbox-card:hover{border-color:#cfd8e3}#insurance-widget-root .checkbox-input,#root .checkbox-input{border:2px solid var(--accent-color);appearance:none;background:#fff;border-radius:.375rem;outline:none;place-items:center;width:1.25rem;height:1.25rem;display:grid}#insurance-widget-root .checkbox-input:checked,#root .checkbox-input:checked{border-color:var(--primary-color);background-color:var(--primary-color);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 24 24'%3e%3cpath d='M20.285 6.709a1 1 0 0 1 0 1.414l-9.192 9.193a1 1 0 0 1-1.414 0L3.715 11.55a1 1 0 1 1 1.414-1.414l5.05 5.05 8.485-8.478a1 1 0 0 1 1.621.001z'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat}#insurance-widget-root .checkbox-card:has(.checkbox-input:checked),#root .checkbox-card:has(.checkbox-input:checked){border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color)}@supports (color:color-mix(in lab,red,red)){#insurance-widget-root .checkbox-card:has(.checkbox-input:checked),#root .checkbox-card:has(.checkbox-input:checked){box-shadow:0 0 0 2px color-mix(in oklab,var(--primary-color)20%,transparent)}}#insurance-widget-root .checkbox-label,#root .checkbox-label{color:var(--text-primary);font-size:1rem;font-weight:600}#insurance-widget-root .modal-scroll,#root .modal-scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;max-height:min(90dvh,800px);overflow-y:auto}#insurance-widget-root .modal-scroll .h1-title,#root .modal-scroll .h1-title{z-index:1;background:#fff;padding-top:.25rem;padding-bottom:.75rem;position:sticky;top:0}#insurance-widget-root .panel-body,#root .panel-body{padding:4px;scroll-padding:4px}#insurance-widget-root .tel-input-wrapper:focus-within:not(.error),#root .tel-input-wrapper:focus-within:not(.error){outline:1px solid var(--primary-color);outline-offset:0px;z-index:1}#insurance-widget-root .tel-input-wrapper.error,#root .tel-input-wrapper.error{outline-offset:0px;z-index:1;outline:1px solid #ef4444}#insurance-widget-root .tel-input-wrapper:focus-within:after,#root .tel-input-wrapper:focus-within:after{content:"";border:1px solid var(--primary-color);pointer-events:none;z-index:10;border-radius:.75rem;position:absolute;inset:-1px}#insurance-widget-root .tel-input-wrapper.error:after,#root .tel-input-wrapper.error:after{content:"";pointer-events:none;z-index:10;border:1px solid #ef4444;border-radius:.75rem;position:absolute;inset:-1px}#insurance-widget-root .form-label:has(+input[aria-required=true]):after,#root .form-label:has(+input[aria-required=true]):after,#insurance-widget-root .form-label:has(+select[aria-required=true]):after,#root .form-label:has(+select[aria-required=true]):after,#insurance-widget-root .form-label:has(+textarea[aria-required=true]):after,#root .form-label:has(+textarea[aria-required=true]):after,#insurance-widget-root .legend-required:after,#root .legend-required:after{content:" *";color:#dc2626;margin-left:.25rem}#insurance-widget-root .scrollbar-hide,#root .scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}#insurance-widget-root .scrollbar-hide::-webkit-scrollbar{display:none}#root .scrollbar-hide::-webkit-scrollbar{display:none}#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button],#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button],#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled,#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;color:#fff!important;background-color:#2563eb!important;min-height:3rem!important;display:flex!important;position:relative!important;overflow:visible!important}#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled,#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled{opacity:.5!important;background-color:#d1d5db!important}#insurance-widget-root .credify-link-underline,#root .credify-link-underline{color:var(--primary-color);text-decoration:underline}#insurance-widget-root .credify-link-underline:hover,#root .credify-link-underline:hover{color:#0052cc}#insurance-widget-root button.modal-close-btn[type=button],#root button.modal-close-btn[type=button]{appearance:none;background:0 0;border:none;padding:0;visibility:visible!important;opacity:1!important;cursor:pointer!important;clip-path:none!important;pointer-events:auto!important;display:inline-flex!important;overflow:visible!important}@media (max-width:767px){#insurance-widget-root button.modal-close-btn[type=button],#root button.modal-close-btn[type=button]{visibility:hidden!important;pointer-events:none!important;display:none!important}}#insurance-widget-root button.credify-btn-back[type=button],#root button.credify-btn-back[type=button],#insurance-widget-root button.credify-btn-back[type=button]:disabled,#root button.credify-btn-back[type=button]:disabled{transition:border-color .15s,background-color .15s;visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;box-sizing:border-box!important;border-radius:var(--radius-full)!important;color:#1a202c!important;text-align:center!important;cursor:pointer!important;background-color:#fff!important;border:1px solid #e2e8f0!important;place-content:center!important;place-items:center!important;height:3rem!important;min-height:3rem!important;margin:0!important;padding:0!important;font-size:1rem!important;font-weight:600!important;line-height:1!important;display:grid!important;overflow:visible!important}#insurance-widget-root button.credify-btn-back[type=button]:not(:disabled):hover,#root button.credify-btn-back[type=button]:not(:disabled):hover{background-color:#f9fafb!important;border-color:#cbd5e1!important}#insurance-widget-root button.credify-btn-back[type=button]:disabled,#root button.credify-btn-back[type=button]:disabled{opacity:.5!important;cursor:not-allowed!important;background-color:#f3f4f6!important}#insurance-widget-root button.credify-btn-back-rates[type=button],#root button.credify-btn-back-rates[type=button]{margin-top:2rem!important}#insurance-widget-root button.credify-retry-btn[type=button],#root button.credify-retry-btn[type=button]{cursor:pointer;font:inherit;border:none;visibility:visible!important;color:var(--text-primary)!important;clip-path:none!important;pointer-events:auto!important;background:0 0!important;text-decoration:underline!important;display:inline!important;overflow:visible!important}#insurance-widget-root button.rates-bind-btn[type=button],#root button.rates-bind-btn[type=button],#insurance-widget-root button.rates-bind-btn[type=button]:disabled,#root button.rates-bind-btn[type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;box-sizing:border-box!important;text-align:center!important;color:#fff!important;background-color:#2563eb!important;place-content:center!important;place-items:center!important;min-height:2.5rem!important;padding:0 1rem!important;line-height:1!important;display:grid!important;overflow:visible!important}#insurance-widget-root button.rates-bind-btn[type=button]:disabled,#root button.rates-bind-btn[type=button]:disabled{opacity:.5!important;background-color:#cbd5e1!important}#insurance-widget-root button.rates-bind-btn.rates-bind-btn-requested,#root button.rates-bind-btn.rates-bind-btn-requested{color:#fff!important;background-color:#10b981!important}#insurance-widget-root button.quote-btn[type=button],#root button.quote-btn[type=button]{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;color:#fff!important;background-color:#2563eb!important;display:inline-flex!important;overflow:visible!important}#insurance-widget-root a.credify-link-underline[href],#root a.credify-link-underline[href]{color:var(--primary-color);visibility:visible!important;clip-path:none!important;pointer-events:auto!important;text-decoration:underline!important;display:inline!important;overflow:visible!important}#insurance-widget-root input.form-input,#root input.form-input,#insurance-widget-root select.form-input,#root select.form-input,#insurance-widget-root textarea.form-input,#root textarea.form-input{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;display:block!important;overflow:visible!important}#insurance-widget-root button.btn-primary[type=button],#root button.btn-primary[type=button],#insurance-widget-root button.btn-primary[type=submit],#root button.btn-primary[type=submit],#insurance-widget-root button.btn-outline[type=button],#root button.btn-outline[type=button],#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled,#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;min-height:3rem!important;display:flex!important;overflow:visible!important}#insurance-widget-root button.btn-primary[type=button],#root button.btn-primary[type=button],#insurance-widget-root button.btn-primary[type=submit],#root button.btn-primary[type=submit]{color:#fff!important;background-color:#2563eb!important}#insurance-widget-root button.btn-outline[type=button],#root button.btn-outline[type=button]{color:var(--text-primary)!important;border:1px solid var(--accent-color)!important;background-color:#fff!important}#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled,#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{opacity:.5!important}#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled{color:#fff!important;background-color:#d1d5db!important}#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{color:var(--text-primary)!important;background-color:#f1f5f9!important}#insurance-widget-root .form-wizard-steps-header,#root .form-wizard-steps-header{visibility:visible!important;display:flex!important}#insurance-widget-root .form-wizard-steps,#root .form-wizard-steps{flex:1;align-items:center;gap:.5rem;min-width:0;margin:0;padding:0;font-size:.75rem;line-height:1rem;list-style:none;overflow-x:auto;display:flex!important}#insurance-widget-root .form-wizard-step-pill,#root .form-wizard-step-pill{white-space:nowrap;border:1px solid;border-radius:9999px;flex-shrink:0;padding:.25rem .625rem;visibility:visible!important;display:inline-flex!important}#insurance-widget-root .form-wizard-step-arrow,#root .form-wizard-step-arrow{color:#94a3b8;flex-shrink:0;visibility:visible!important;display:inline-flex!important}#insurance-widget-root .form-wizard-step-counter,#root .form-wizard-step-counter{color:#64748b;flex-shrink:0;font-size:.875rem;line-height:1.25rem;visibility:visible!important;display:block!important}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@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}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--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}}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
(function(){if(typeof L>"u")var L={env:{}}})();(function(L,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react"),require("react-dom/client"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom/client","react/jsx-runtime"],u):(L=typeof globalThis<"u"?globalThis:L||self,u(L.CredifyInsuranceWidget={},L.React,L.ReactDOM,L.React))})(this,(function(L,u,Xe,i){"use strict";function O({id:e,label:t,hint:r,error:s,required:n,className:a,children:l}){return i.jsxs("div",{className:a,children:[i.jsxs("label",{htmlFor:e,className:"form-label",children:[t," ",n&&i.jsx("span",{className:"text-red-600",children:"*"})]}),l,r&&!s&&i.jsx("p",{id:`${e}-hint`,className:"mt-1 text-sm text-slate-500",children:r}),s&&i.jsx("p",{id:`${e}-error`,className:"mt-1 text-sm text-red-600",children:s})]})}function Ze({id:e,label:t,hint:r,error:s,required:n,className:a,...l}){return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsx("input",{id:e,className:`form-input ${s?"input-error":""}`,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:n,...l,type:"text"})})}function Re({id:e,label:t,hint:r,error:s,required:n,className:a,...l}){return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsx("input",{id:e,type:"number",className:`form-input ${s?"input-error":""}`,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:n,...l})})}function qe({id:e,label:t,hint:r,error:s,required:n,className:a,...l}){return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsx("input",{id:e,type:"email",className:`form-input ${s?"input-error":""}`,inputMode:"email",autoComplete:"email",required:n,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,...l})})}function ge(e){const t=e.replace(/\D/g,"");if(t.length===10)return`(${t.slice(0,3)}) ${t.slice(3,6)} - ${t.slice(6)}`;if(t.length>10){const r=t.slice(0,10);return`(${r.slice(0,3)}) ${r.slice(3,6)} - ${r.slice(6)}`}return t.length>=6?`(${t.slice(0,3)}) ${t.slice(3,6)} - ${t.slice(6)}`:t.length>=3?`(${t.slice(0,3)}) ${t.slice(3)}`:t.length>0?`(${t}`:t}function he(e){return e.replace(/\D/g,"")}function et({id:e,label:t,hint:r,error:s,required:n,className:a,value:l="",onChange:o,...f}){const[v,S]=u.useState(""),h=u.useRef(null),E=u.useRef(0);u.useEffect(()=>{if(!l){S("");return}let T=he(l);T.length===11&&T.startsWith("1")&&(T=T.slice(1));const M=T.slice(0,10);S(ge(M))},[l]);const C=T=>{const M=T.target,F=M.value;E.current=M.selectionStart||0;const d=he(F).slice(0,10),_=ge(d);S(_);const c=d.length===10?`+1${d}`:d,p={...T,currentTarget:{...T.currentTarget,value:c},target:{...T.target,value:c}};o?.(p),setTimeout(()=>{if(h.current){const w=F.slice(0,E.current),$=he(w),x=ge($),y=Math.min(x.length,_.length);h.current.setSelectionRange(y,y)}},0)};return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsxs("div",{className:`tel-input-wrapper flex items-center border rounded-lg transition-colors w-full relative ${s?"border-red-500 error":"border-[var(--accent-color)] focus-within:border-[var(--primary-color)]"}`,children:[i.jsx("label",{htmlFor:e,className:"px-3 py-3 text-slate-700 font-medium border-r border-[var(--accent-color)] bg-slate-50 flex-shrink-0 relative z-0 rounded-l-lg",children:"+1"}),i.jsx("input",{ref:h,id:e,type:"tel",className:`flex-1 px-4 py-3 border-0 rounded-r-lg outline-none bg-transparent text-[var(--text-primary)] text-base ${s?"input-error":""}`,inputMode:"tel",autoComplete:"tel",required:n,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,value:v,onChange:C,...f})]})})}function tt({id:e,label:t,hint:r,error:s,required:n,className:a,...l}){return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsx("input",{id:e,type:"url",className:`form-input ${s?"input-error":""}`,inputMode:"url",autoComplete:"url",required:n,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,...l})})}function nt({id:e,label:t,hint:r,error:s,required:n,className:a,...l}){return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsx("input",{id:e,type:"password",className:`form-input ${s?"input-error":""}`,autoComplete:"current-password",required:n,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,...l})})}function rt({id:e,label:t,hint:r,error:s,required:n,className:a,rows:l=4,...o}){return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsx("textarea",{id:e,rows:l,className:`form-input ${s?"input-error":""}`,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:n,...o})})}function st({id:e,label:t,hint:r,error:s,required:n,className:a,...l}){return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsx("input",{id:e,type:"date",className:`form-input ${s?"input-error":""}`,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:n,...l})})}function Ce({id:e,label:t,className:r,...s}){return i.jsxs("label",{className:`checkbox-card ${r||""}`,htmlFor:e,children:[i.jsx("input",{id:e,type:"checkbox",className:"checkbox-input",...s}),i.jsx("span",{className:"checkbox-label",children:t})]})}function it({name:e,value:t,checked:r,onChange:s,children:n}){return i.jsxs("label",{className:"radio-card",children:[i.jsx("input",{className:"radio-input",type:"radio",name:e,value:t,checked:r,onChange:s}),i.jsx("span",{className:"radio-label",children:n})]})}function at({legend:e,children:t,className:r,legendClassName:s}){return i.jsxs("fieldset",{className:r,children:[i.jsx("legend",{className:`mb-4 text-base font-medium ${s||""}`,style:{color:"var(--text-primary)"},children:e}),i.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:t})]})}function ot({id:e,label:t,hint:r,error:s,required:n,className:a,placeholder:l,options:o,children:f,...v}){const S=[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,h=!!f;return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsxs("select",{id:e,className:`form-input select-caret ${s?"input-error":""}`,"aria-invalid":!!s,"aria-describedby":S,required:n,...v,children:[l&&i.jsx("option",{value:"",disabled:!0,selected:!("value"in v),children:l}),h?f:o?.map(E=>i.jsx("option",{value:E.value,disabled:E.disabled,children:E.label},E.value))]})})}const lt="AIzaSyDjLdKLxoa-maLNGAyq_I_2r_Fe_TzFikw";function ct(){return new Promise((e,t)=>{if(window.google?.maps?.places){e();return}const r=document.querySelector('script[src*="maps.googleapis.com"]');if(r){r.addEventListener("load",()=>e()),r.addEventListener("error",()=>t(new Error("Failed to load Google Maps script")));return}const s=document.createElement("script");s.src=`https://maps.googleapis.com/maps/api/js?key=${lt}&libraries=places`,s.async=!0,s.defer=!0,s.onload=()=>e(),s.onerror=()=>t(new Error("Failed to load Google Maps script")),document.head.appendChild(s)})}function dt(e){const t={fullAddress:e.formatted_address};return e.address_components&&e.address_components.forEach(r=>{const s=r.types;s.includes("street_number")&&(t.streetNumber=r.long_name),s.includes("route")&&(t.streetName=r.long_name),s.includes("locality")&&(t.city=r.long_name),s.includes("administrative_area_level_1")&&(t.state=r.short_name),s.includes("postal_code")&&(t.zipCode=r.long_name),s.includes("country")&&(t.country=r.short_name)}),t}function ut({id:e,label:t,hint:r,error:s,required:n,className:a,onChange:l,onPlaceSelect:o,value:f,...v}){const S=u.useRef(null),h=u.useRef(null),E=u.useRef(null),C=u.useRef(null),[T,M]=u.useState(!0),[F,Q]=u.useState(f||""),[d,_]=u.useState([]),[c,p]=u.useState(!1),[w,$]=u.useState(-1),x=u.useRef([]),y=u.useRef(!1),b=u.useRef(-1);u.useEffect(()=>{x.current=d},[d]),u.useEffect(()=>{y.current=c},[c]),u.useEffect(()=>{b.current=w},[w]),u.useEffect(()=>{f!==void 0&&Q(String(f))},[f]);const g=u.useRef(null);u.useEffect(()=>{if(!S.current)return;let N=!0;return ct().then(()=>{!N||!S.current||(h.current=new google.maps.places.AutocompleteService,E.current=new google.maps.places.PlacesService(document.createElement("div")),M(!1))}).catch(k=>{console.error("Error loading Google Maps:",k),M(!1)}),()=>{N=!1,g.current&&clearTimeout(g.current)}},[]);const m=N=>{const k=N.target.value;if(Q(k),l?.(k),g.current&&clearTimeout(g.current),k.length<3){_([]),p(!1);return}g.current=setTimeout(()=>{h.current&&h.current.getPlacePredictions({input:k,types:["address"]},(B,D)=>{D===google.maps.places.PlacesServiceStatus.OK&&B?(_(B),p(!0),$(-1)):(_([]),p(!1))})},300)},j=N=>{if(!y.current||x.current.length===0){N.key==="Escape"&&(p(!1),y.current=!1);return}switch(N.key){case"ArrowDown":N.preventDefault(),$(k=>{const B=k<x.current.length-1?k+1:k;return b.current=B,B});break;case"ArrowUp":N.preventDefault(),$(k=>{const B=k>0?k-1:-1;return b.current=B,B});break;case"Enter":N.preventDefault(),b.current>=0&&b.current<x.current.length&&A(x.current[b.current]);break;case"Escape":N.preventDefault(),p(!1),y.current=!1;break}};u.useEffect(()=>{const N=k=>{C.current&&!C.current.contains(k.target)&&S.current&&!S.current.contains(k.target)&&(p(!1),y.current=!1)};if(c)return document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[c]);const A=N=>{E.current&&E.current.getDetails({placeId:N.place_id,fields:["address_components","formatted_address","geometry"]},(k,B)=>{if(B===google.maps.places.PlacesServiceStatus.OK&&k){const D=k.formatted_address||"";Q(D),p(!1),_([]),y.current=!1;const R=dt(k);l?.(D,R),o?.(k)}})};return i.jsx(O,{id:e,label:t,hint:r,error:s,required:n,className:a,children:i.jsxs("div",{className:"relative",children:[i.jsx("input",{ref:S,id:e,type:"text",className:`form-input ${s?"input-error":""}`,value:F,onChange:m,onKeyDown:j,"aria-invalid":!!s,"aria-describedby":[r?`${e}-hint`:null,s?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:n,autoComplete:"street-address",placeholder:v.placeholder||"Enter an address",disabled:T||v.disabled,...v}),T&&i.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading address suggestions..."}),c&&d.length>0&&i.jsx("div",{ref:C,className:"absolute z-50 w-full mt-1 bg-white border border-slate-200 rounded-lg shadow-lg max-h-60 overflow-y-auto",role:"listbox",children:d.map((N,k)=>i.jsxs("div",{className:`px-4 py-3 cursor-pointer transition-colors ${k===w?"bg-blue-50 text-slate-900":"bg-white text-slate-900 hover:bg-slate-50"} ${k<d.length-1?"border-b border-slate-100":""}`,role:"option","aria-selected":k===w,onClick:()=>A(N),onMouseEnter:()=>$(k),children:[i.jsx("div",{className:"font-medium text-slate-900",children:N.structured_formatting.main_text}),N.structured_formatting.secondary_text&&i.jsx("div",{className:"text-sm text-slate-500 mt-0.5",children:N.structured_formatting.secondary_text})]},N.place_id))})]})})}function ye(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Te(e,t){return e.key??`${ye(e.question)}-${t}`}function le(e,t){const r={},s=n=>n==null||typeof n=="string"&&n.trim()==="";return e.forEach((n,a)=>{const l=Te(n,a),o=t[l];if(n.required)switch(n.inputType){case"checkbox":o!==!0&&(r[l]="Required");break;case"radio":case"select":s(o)&&(r[l]="Required");break;case"number":(o==null||typeof o=="string"&&o.trim()==="")&&(r[l]="Required");break;case"date":case"email":case"tel":case"url":case"password":case"text":case"textarea":case"address":default:s(o)&&(r[l]="Required");break}}),r}function _t(e){if(e===""||e===null||e===void 0)return;const t=Number(e);return Number.isNaN(t)?void 0:t}function Ie(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function Me(e){if(e instanceof Date&&!Number.isNaN(e.getTime()))return e.getTime();if(typeof e=="string"){const t=Date.parse(e);return Number.isNaN(t)?null:t}return null}function Qe(e,t){const r=Ie(e),s=Ie(t);if(r!=null&&s!=null)return r-s;const n=Me(e),a=Me(t);return n!=null&&a!=null?n-a:e==null||t==null?null:String(e).localeCompare(String(t))}function ft(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function ie(e,t,r){switch(t){case"equals":return e===r;case"lessThan":{const s=Qe(e,r);return s!=null&&s<0}case"greaterThan":{const s=Qe(e,r);return s!=null&&s>0}case"contains":return ft(e,r);case"startsWith":return e!=null&&r!=null&&String(e).startsWith(String(r));case"endsWith":return e!=null&&r!=null&&String(e).endsWith(String(r));default:return!1}}function be(e,t){return t.reduce((r,s)=>r?.[s],e)}function H(e,t,r){if(t.length===0)return e;const[s,...n]=t;if(n.length===0){if(typeof s=="number"){const v=(Array.isArray(e)?e:[]).slice();return v[s]=r,v}return{...e,[s]:r}}const a=e?.[s],l=typeof n[0]=="number"?Array.isArray(a)?a:[]:a&&typeof a=="object"?a:{},o=H(l,n,r);if(typeof s=="number"){const v=(Array.isArray(e)?e:[]).slice();return v[s]=o,v}return{...e,[s]:o}}function ae(e,t,r){return be(e,[...t??[],r])}function pt(e,t,r,s){return H(e,[...t??[],r],s)}const mt="__items",ce=e=>`${e}${mt}`;function gt(e){const t=(r,s)=>r.map((n,a)=>{const l=s.length?s.join("__"):"root",o=n.key??`${l}__q${a}_${String(n.question).slice(0,24).replace(/\W+/g,"-")||"field"}`,v=(n.conditionals??[]).map((S,h)=>{const E=S.conditionalQuestions?t(S.conditionalQuestions,[...s,`${o}__c${h}`]):void 0;return{...S,conditionalQuestions:E}});return{...n,key:o,conditionals:v}});return t(e,[])}function J(e){return e==null?"":typeof e=="string"?e:String(e)}function ht(e){return e==null?"":typeof e=="number"&&Number.isFinite(e)||typeof e=="string"?e:""}function yt(e){return e==null?"":typeof e=="string"||typeof e=="number"?e:String(e)}function bt({questions:e,initialValues:t,controlledValues:r,onChangeValues:s,onSubmit:n}){const a=u.useMemo(()=>gt(e),[e]),l=u.useMemo(()=>{const d={};return t&&Object.assign(d,t),d},[t]),[o,f]=u.useState(l);u.useEffect(()=>{f(l)},[l]);const[v,S]=u.useState({}),h=u.useMemo(()=>({...v,...r??o}),[v,r,o]);u.useEffect(()=>{r&&S(d=>({...d,...r}))},[r]);const[E,C]=u.useState({});function T(d,_){const c=d.key,p=d.question,w=ae(h,_,c),$=E[c],x=y=>{let b=pt(h,_,c,y);if(d.inputType==="radio"&&d.conditionals){const g=d.conditionals??[];for(const m of g){const j=ae(h,_,c),A=ie(j,m.conditionalType,m.conditionalValue),N=ie(y,m.conditionalType,m.conditionalValue);if(A&&!N&&m.conditionalQuestionsAllowMultiple){const k=m.conditionalQuestions??[];if(k.length>0){const B=ce(c);b=H(b,[..._??[],B],[]);const D=(R,q)=>{R.forEach(K=>{(K.conditionals??[]).forEach(W=>{if(W.conditionalQuestionsAllowMultiple){const ee=ce(K.key);b=H(b,[...q,ee],[])}const z=W.conditionalQuestions??[];z.length>0&&D(z,q)})})};D(k,[..._??[],B])}}}}r&&s?s(b):f(b),S(b)};switch(d.inputType){case"text":return i.jsx(Ze,{id:c,label:p,value:J(w),onChange:y=>x(y.currentTarget.value),"aria-required":d.required||void 0,error:$},c);case"email":return i.jsx(qe,{id:c,label:p,value:J(w),onChange:y=>x(y.currentTarget.value),"aria-required":d.required||void 0,error:$},c);case"password":return i.jsx(nt,{id:c,label:p,value:J(w),onChange:y=>x(y.currentTarget.value),"aria-required":d.required||void 0,error:$},c);case"tel":return i.jsxs(i.Fragment,{children:[i.jsx(et,{id:c,label:p,value:J(w),onChange:y=>x(y.currentTarget.value),"aria-required":d.required||void 0,error:$},c),c==="phone"&&i.jsxs("div",{className:"mt-3 text-xs text-slate-600 space-y-1",children:[i.jsx("p",{children:"By entering your phone number, you agree to receive a one-time SMS from Credify Insurance with a verification code."}),i.jsx("p",{children:"Message & data rates may apply. One message per request."}),i.jsxs("p",{children:["See our"," ",i.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","and"," ",i.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Terms of Service"}),"."]})]})]});case"url":return i.jsx(tt,{id:c,label:p,value:J(w),onChange:y=>x(y.currentTarget.value),"aria-required":d.required||void 0,error:$},c);case"number":return i.jsx(Re,{id:c,label:p,value:ht(w),onChange:y=>x(_t(y.currentTarget.value)),"aria-required":d.required||void 0,error:$},c);case"textarea":return i.jsx(rt,{id:c,label:p,value:J(w),onChange:y=>x(y.currentTarget.value),"aria-required":d.required||void 0,error:$,rows:4},c);case"date":return i.jsx(st,{id:c,label:p,value:J(w),onChange:y=>x(y.currentTarget.value),"aria-required":d.required||void 0,error:$},c);case"checkbox":{if(d.options){const y=Array.isArray(w)?w:[];return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"form-label",children:[p,d.required&&i.jsx("span",{className:"text-red-600 ml-1",children:"*"})]}),i.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:d.options.map(b=>{const g=`${c}-${ye(b)}`,m=y.includes(b);return i.jsx(Ce,{id:g,label:b,checked:m,onChange:j=>{const A=new Set(y);j.currentTarget.checked?A.add(b):A.delete(b),x(Array.from(A))},"aria-required":d.required||void 0},g)})}),$&&i.jsx("p",{className:"mt-1 text-sm text-red-600",children:$})]},c)}return i.jsx(Ce,{id:c,label:d.required?`${p} *`:p,checked:!!w,onChange:y=>x(y.currentTarget.checked),"aria-required":d.required||void 0},c)}case"radio":{const y=d.options??[],b=_&&_.length>0?`${c}__${_.join("__")}`:c;return i.jsx(at,{legend:p,legendClassName:d.required?"legend-required":void 0,children:y.map(g=>i.jsx(it,{name:b,value:g,checked:w===g,onChange:()=>x(g),children:g},`${c}-${ye(g)}`))},c)}case"select":{let y=d.options??[];return c==="quote_vehicle_id"&&(y=r?.vehicles__items?.map(b=>b.vin)??[]),i.jsx(ot,{id:c,label:p,"aria-required":d.required||void 0,error:$,value:yt(w),onChange:b=>x(b.currentTarget.value),placeholder:"Select an option",options:y.map(b=>({value:b,label:b}))},c)}case"address":return i.jsx(ut,{id:c,label:p,value:J(w),onChange:y=>x(y),"aria-required":d.required||void 0,error:$},c);default:return null}}function M(d,_){return d.map((c,p)=>{const w=String(c.key),$=T(c,_),x=c.conditionals??[];if(!x.length)return i.jsx("div",{children:$},`wrap-${w}-${p}`);const y=ae(h,_,w),b=x.filter(m=>ie(y,m.conditionalType,m.conditionalValue)),g=b.length>1&&!b.some(m=>m.conditionalQuestionsAllowMultiple)?b.slice(0,1):b;return i.jsxs("div",{children:[$,g.map((m,j)=>{const A=m.conditionalQuestions??[];if(!A.length)return null;if(!m.conditionalQuestionsAllowMultiple)return i.jsx("div",{className:"mt-3",children:M(A,_)},`branch-${w}-${j}`);const N=ce(w),k=be(h,[..._??[],N])??[],B=Math.max(1,k.length||1),D=()=>{const K=H(h,[..._??[],N,k.length],{});r&&s?s(K):f(K),S(K)},R=()=>{const K=k.slice(0,Math.max(0,k.length-1)),Y=H(h,[..._??[],N],K);r&&s?s(Y):f(Y),S(Y)},q=`${w}__c${j}`;return i.jsxs("div",{className:"mt-3",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),i.jsxs("div",{className:"space-x-2",children:[i.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:D,children:"Add another"}),B>1&&i.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:R,children:"Remove last"})]})]}),Array.from({length:B}).map((K,Y)=>{const W=[..._??[],N,Y],z=`${q}__i${Y}`;return i.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[i.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",Y+1]}),A.map(ee=>i.jsxs("div",{className:"mt-3",children:[T(ee,W),(()=>{const He=ee.conditionals??[];if(!He.length)return null;const Jt=ae(h,W,ee.key),fe=He.filter(te=>ie(Jt,te.conditionalType,te.conditionalValue));return(fe.length>1&&!fe.some(te=>te.conditionalQuestionsAllowMultiple)?fe.slice(0,1):fe).map((te,Ee)=>{const Ae=te.conditionalQuestions??[];if(!Ae.length)return null;if(!te.conditionalQuestionsAllowMultiple)return i.jsx("div",{className:"mt-3",children:M(Ae,W)},`nested-${z}-${Ee}`);const pe=ce(ee.key),me=be(h,[...W,pe])??[],Je=Math.max(1,me.length||1),Xt=()=>{const se=H(h,[...W,pe,me.length],{});r&&s?s(se):f(se),S(se)},Zt=()=>{const se=me.slice(0,Math.max(0,me.length-1)),ne=H(h,[...W,pe],se);r&&s?s(ne):f(ne),S(ne)};return i.jsxs("div",{className:"mt-3",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),i.jsxs("div",{className:"space-x-2",children:[i.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Xt,children:"Add another"}),Je>1&&i.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Zt,children:"Remove last"})]})]}),Array.from({length:Je}).map((se,ne)=>{const Rt=[...W,pe,ne];return i.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[i.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",ne+1]}),M(Ae,Rt)]},`nested-item-${z}-${Ee}-${ne}`)})]},`nested-repeat-${z}-${Ee}`)})})()]},`${z}-${String(ee.key)}`))]},`group-${z}`)})]},`branch-${w}-${j}`)})]},`wrap-${w}-${p}`)})}const F=u.useMemo(()=>{const d=[],_=(c,p)=>{c.forEach(w=>{d.push(w);const $=String(w.key),x=w.conditionals??[];if(!x.length)return;const y=ae(h,p,$),b=x.filter(m=>ie(y,m.conditionalType,m.conditionalValue));(b.length>1&&!b.some(m=>m.conditionalQuestionsAllowMultiple)?b.slice(0,1):b).forEach(m=>{const j=m.conditionalQuestions??[];j.length&&(m.conditionalQuestionsAllowMultiple||_(j,p))})})};return _(a),d},[a,h]);function Q(d){d.preventDefault();const _=le(F,h);if(C(_),Object.keys(_).length>0){const c=F.findIndex(p=>_[p.key]);c>=0&&document.getElementById(F[c].key)?.focus();return}n(h)}return i.jsx("form",{className:"space-y-6 px-1",onSubmit:Q,noValidate:!0,children:M(a)})}const vt="GTM-NK8LGHTQ";function wt(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function X(e,t={}){wt().push({event:e,credifyWidget:{...t,containerId:vt}})}function xt(){X("credify_widget_opened")}function je(){X("credify_widget_closed")}function kt(e){X("credify_widget_stage_viewed",e)}function Be(e){X("credify_widget_stage_completed",e)}function Nt(){X("credify_widget_flow_completed")}function St(e){X("credify_widget_rates_viewed",e??{})}function $t(){X("credify_widget_rates_back")}function Fe(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function De(e){if(e instanceof Date&&!Number.isNaN(e.getTime()))return e.getTime();if(typeof e=="string"){const t=Date.parse(e);return Number.isNaN(t)?null:t}return null}function Le(e,t){const r=Fe(e),s=Fe(t);if(r!=null&&s!=null)return r-s;const n=De(e),a=De(t);return n!=null&&a!=null?n-a:e==null||t==null?null:String(e).localeCompare(String(t))}function Et(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function We(e,t,r){switch(t){case"equals":return e===r;case"lessThan":{const s=Le(e,r);return s!=null&&s<0}case"greaterThan":{const s=Le(e,r);return s!=null&&s>0}case"contains":return Et(e,r);case"startsWith":return e!=null&&r!=null&&String(e).startsWith(String(r));case"endsWith":return e!=null&&r!=null&&String(e).endsWith(String(r));default:return!1}}function Ke(e,t){const r=[];return(n=>{n.forEach(a=>{r.push(a);const l=String(a.key),o=t[l],f=a.conditionals??[];if(!f.length)return;const v=f.filter(h=>We(o,h.conditionalType,h.conditionalValue));(v.length>1&&!v.some(h=>h.conditionalQuestionsAllowMultiple)?v.slice(0,1):v).forEach(h=>{const E=h.conditionalQuestions??[];E.length&&(h.conditionalQuestionsAllowMultiple||E.forEach(C=>r.push(C)))})})})(e),r}const ze="__items",Oe=e=>`${e}${ze}`;function ve(e,t){for(const r of e){const s=String(r.key),n=t[s],a=r.conditionals??[];if(!a.length)continue;const l=a.filter(f=>We(n,f.conditionalType,f.conditionalValue)),o=l.length>1&&!l.some(f=>f.conditionalQuestionsAllowMultiple)?l.slice(0,1):l;for(const f of o){const v=f.conditionalQuestions??[];if(!v.length)continue;if(!f.conditionalQuestionsAllowMultiple){if(ve(v,t))return!0;continue}const S=t[Oe(s)]??[];if(S.length===0)return!0;for(const h of S){const E=le(v,h);if(Object.values(E).some(Boolean)||ve(v,h))return!0}}}return!1}function Pe(e,t){return ve(e,t)}function At({stages:e,onStageComplete:t,onComplete:r,initialValues:s,initialActive:n}){const[a,l]=u.useState(n??0),[o,f]=u.useState(s??{}),[v,S]=u.useState({}),[h,E]=u.useState(!1),[C,T]=u.useState(!1),[M,F]=u.useState(null),Q=u.useRef([]),d=Array.isArray(e)&&e.length>0,_=d?e[Math.min(a,e.length-1)]:null,c=_?.key??null;u.useEffect(()=>{n!==void 0&&l(n)},[n]),u.useEffect(()=>{const g=Q.current[a];g&&g.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[a]),u.useEffect(()=>{s!==void 0&&f(s)},[s]),u.useEffect(()=>{if(!_||!c){E(!1),F(null);return}if(v[c]){E(!1),F(null);return}let g=!1;return E(!0),F(null),Promise.resolve(_.loadQuestions()).then(m=>{if(!g){if(!Array.isArray(m))throw new Error(`loadQuestions("${c}") did not return an array`);S(j=>({...j,[c]:m}))}}).catch(m=>{g||F(`Failed to load stage "${_?.title??""}": ${m?.message??"Unknown error"}`)}).finally(()=>{g||E(!1)}),()=>{g=!0}},[_,c,v]);const p=c?v[c]:void 0;u.useEffect(()=>{_&&c&&p&&kt({stageKey:c,stageTitle:_.title??c,stepIndex:a+1,totalSteps:e.length})},[c,a,e.length,_,p]);const w=u.useMemo(()=>{if(!p)return{};const g={};(A=>{const N=[],k=B=>{B.forEach((D,R)=>{const q=Te(D,R);N.push(q);const K=Oe(q);N.push(K),(D.conditionals??[]).forEach(W=>{const z=W.conditionalQuestions??[];z.length>0&&k(z)})})};return k(A),N})(p).forEach(A=>{A in o&&(g[A]=o[A])});for(const[A,N]of Object.entries(o))A.endsWith(ze)&&!(A in g)&&(g[A]=N);return g},[p,o]),$=g=>{f(m=>({...m,...g}))},x=()=>{l(g=>g>0?g-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},y=async()=>{if(!p||!_||h||M||C)return;const g=Ke(p,o),m=le(g,o),j=Object.values(m).some(Boolean),A=Pe(p,o);if(!(j||A)){T(!0);try{const N=Math.min(a+1,e.length-1),k=a>=e.length-1,{success:B,error:D}=k?await r(o,c??""):await t(w,c??"");if(!B){F(D??"An error occurred");return}k||l(N)}finally{T(!1)}}},b=u.useMemo(()=>{if(!p||h||M||C)return!0;const g=Ke(p,o),m=le(g,o),j=Object.values(m).some(Boolean),A=Pe(p,o);return j||A},[p,o,h,M,C]);return d?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"form-wizard-steps-header flex items-center justify-between gap-4",children:[i.jsx("ol",{className:"form-wizard-steps flex gap-2 text-xs overflow-x-auto flex-1 pb-1 scrollbar-hide items-center",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.flatMap((g,m)=>[i.jsx("li",{ref:j=>{Q.current[m]=j},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${m<a?"bg-blue-600 text-white border-blue-600":m===a?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:g.title},g.key??`stage-${m}`),...m<e.length-1?[i.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${g.key??m}`)]:[]])}),i.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[Math.min(a+1,e.length)," / ",e.length]})]}),i.jsxs("div",{children:[h&&i.jsx("div",{className:"text-slate-500",children:"Loading…"}),_&&i.jsx(bt,{questions:p??[],controlledValues:w,onChangeValues:$,onSubmit:()=>y()},_.key)]}),!h&&M&&i.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[i.jsx("div",{children:M}),_&&i.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{S(g=>{if(!c)return g;const m={...g};return delete m[c],m})},children:"Retry"})]}),i.jsxs("div",{className:a>0?"grid grid-cols-2 gap-3":"",children:[a>0&&i.jsx("button",{type:"button",onClick:x,disabled:h,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Back"}),i.jsxs("button",{type:"button","data-widget-ctrl":"next",onClick:y,disabled:b,className:["form-wizard-next-btn",a>0?"":"w-full","h-12 rounded-full text-white transition","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center justify-center gap-2",b?"bg-gray-300":"bg-blue-600 hover:bg-blue-600/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 bg-primary hover:bg-primary/90 focus-visible:ring-primary/40"].join(" "),children:[C&&i.jsxs("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),a===e.length-1?"Finish":"Next"]})]})]}):i.jsx("div",{className:"text-slate-600",children:"Loading..."})}const we="credify_quote_id",xe="credify_auth_token";function Ct(e){try{localStorage.setItem(we,e)}catch(t){console.error("Failed to save quoteId to localStorage:",t)}}function Tt(){try{return localStorage.getItem(we)}catch(e){return console.error("Failed to load quoteId from localStorage:",e),null}}function Ue(){try{localStorage.removeItem(we)}catch(e){console.error("Failed to clear quoteId from localStorage:",e)}}function It(e){try{localStorage.setItem(xe,e)}catch(t){console.error("Failed to save authToken to localStorage:",t)}}function Mt(){try{return localStorage.getItem(xe)}catch(e){return console.error("Failed to load authToken from localStorage:",e),null}}function Ve(){try{localStorage.removeItem(xe)}catch(e){console.error("Failed to clear authToken from localStorage:",e)}}function Qt(){Ue(),Ve()}const U="https://api.getcredify.com";let re=null;function jt(e){re=e,It(e)}function de(){return re}function ke(){const e=Mt();e&&(re=e)}function Ge(){re=null,Ve()}async function V(e,t){const r={"Content-Type":"application/json"};re&&(r.Authorization=`Bearer ${re}`);const s=await fetch(e,{method:"POST",headers:r,body:JSON.stringify(t)});if(!s.ok){let n=`Request failed with status ${s.status}`;try{n=(await s.json()).error||n}catch{n=s.statusText||n}const a=new Error(n);throw a.statusCode=s.status,a}return s}async function Bt(e){return await(await V(`${U}/get-questions-by-stage`,{stage:e})).json()}async function Ne(){return await(await V(`${U}/get-stages-for-quote`,{})).json()}async function Ft(e){const r=await(await V(`${U}/create-quote`,{phone:e})).json();if(!r||typeof r!="object"||!r.quoteId)throw new Error(`Invalid createQuote response: ${JSON.stringify(r)}`);return r}async function oe(e,t,r){const s={payload:e,getRates:t};return r&&typeof r=="string"&&r.trim()!==""&&(s.quoteId=r),await(await V(`${U}/update-quote`,s)).json()}async function Dt(e,t){return await(await V(`${U}/verify-quote`,{quoteId:e,smsCode:t})).json()}async function Lt(e){return await(await V(`${U}/is-supported-state`,{state:e})).json()}async function Wt(){return await(await V(`${U}/get-rates`,{})).json()}async function Kt(e){const t=e?{quoteId:e}:{};return await(await V(`${U}/get-quote`,t)).json()}async function zt(e){const r=await(await V(`${U}/request-bind`,{quoteRateId:e})).json();return r&&typeof r=="object"&&"success"in r?r:{success:!0}}const Ot=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function Ye({onBack:e}){const t=()=>{$t(),e?.()};return i.jsx("button",{type:"button",onClick:t,className:"credify-btn-back credify-btn-back-rates h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition w-full",children:"Back"})}function Pt({rates:e,onBack:t}){const r=Array.isArray(e)&&e.length>0,[s,n]=u.useState({});return u.useEffect(()=>{ke()},[]),r?i.jsxs("section",{className:"mt-8",children:[i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),i.jsx("div",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(a=>{const l=a.premium_cents/100,o=Ot.format(l),f=a.quote_rate_id,v=s[f]??"idle",S=v==="loading",h=v==="success",E=async()=>{n(C=>({...C,[f]:"loading"}));try{if(ke(),!de())throw new Error("Authentication required. Please verify your phone number first.");if(!((await zt(a.quote_rate_id))?.success!==!1))throw new Error("Request failed");Qt(),Ge(),n(F=>({...F,[f]:"success"}))}catch{n(C=>({...C,[f]:"error"}))}};return i.jsxs("div",{className:"flex flex-col rounded-xl border border-slate-200 bg-white p-6 shadow-sm transition hover:shadow-md",children:[i.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[a.carrier_logo_base64?i.jsx("img",{src:`data:image/png;base64,${a.carrier_logo_base64}`,alt:a.carrier_name,className:"h-12 w-auto object-contain"}):i.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-md bg-slate-100 text-sm font-semibold text-slate-500",children:a.carrier_name.charAt(0).toUpperCase()}),i.jsx("div",{className:"flex-1",children:i.jsx("h4",{className:"font-semibold text-slate-900",children:a.carrier_name})})]}),i.jsxs("div",{className:"mb-2",children:[i.jsx("p",{className:"text-sm text-slate-500",children:"Premium"}),i.jsx("p",{className:"text-2xl font-bold text-slate-900",children:o})]}),i.jsxs("div",{className:"mb-4",children:[i.jsx("p",{className:"text-sm text-slate-500",children:"Term"}),i.jsxs("p",{className:"font-medium text-slate-700",children:[a.term_months," months"]})]}),a.carrier_quote_id&&i.jsx("div",{className:"mb-4",children:i.jsxs("p",{className:"text-xs text-slate-400",children:["Quote ID: ",a.carrier_quote_id]})}),i.jsxs("div",{className:"mt-auto pt-4",children:[i.jsx("button",{type:"button",onClick:E,disabled:S||h,className:`rates-bind-btn w-full rounded-full px-4 py-2.5 text-sm font-semibold transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 disabled:cursor-not-allowed ${h?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:S?"Requesting…":h?"Requested":"Request Bind"}),v==="error"&&i.jsx("p",{className:"mt-2 text-xs text-red-600",children:"Something went wrong. Please try again."}),v==="success"&&i.jsx("p",{className:"mt-2 text-xs text-emerald-600",children:"We received your bind request."})]})]},f)})}),t&&i.jsx(Ye,{onBack:t})]}):i.jsxs("section",{className:"mt-8",children:[i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),i.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"No rates are available at this time."}),t&&i.jsx(Ye,{onBack:t})]})}function I(e){if(e===!0)return"Yes";if(e===!1)return"No"}function P(e){if(e)try{const t=typeof e=="string"?new Date(e):e;return isNaN(t.getTime())?void 0:t.toISOString().split("T")[0]}catch{return}}function Ut(e){const t={};e.phone&&(t.phone=e.phone),e.first_name&&(t.first_name=e.first_name),e.last_name&&(t.last_name=e.last_name),e.email&&(t.email=e.email),e.date_of_birth&&(t.date_of_birth=P(e.date_of_birth)),e.product&&(t.product=e.product),e.state&&(t.state=e.state);const r=[];e.line_1&&r.push(e.line_1),e.line_2&&r.push(e.line_2),e.city&&r.push(e.city),e.state&&r.push(e.state),e.postal_code&&r.push(e.postal_code),r.length>0&&(t.address=r.join(", ")),e.years_at_address!==null&&e.years_at_address!==void 0&&(t.years_at_address=e.years_at_address),e.months_at_address!==null&&e.months_at_address!==void 0&&(t.months_at_address=e.months_at_address),e.move_in_date&&(t.move_in_date=P(e.move_in_date));const s=[];return e.prior_line_1&&s.push(e.prior_line_1),e.prior_line_2&&s.push(e.prior_line_2),e.prior_city&&s.push(e.prior_city),e.prior_state&&s.push(e.prior_state),e.prior_postal_code&&s.push(e.prior_postal_code),s.length>0&&(t.prior_address=s.join(", ")),e.years_at_prior_address!==null&&e.years_at_prior_address!==void 0&&(t.years_at_prior_address=e.years_at_prior_address),e.auto_has_prior_insurance!==null&&e.auto_has_prior_insurance!==void 0&&(t.auto_has_prior_insurance=I(e.auto_has_prior_insurance)),e.auto_prior_expiration_date&&(t.auto_prior_expiration_date=P(e.auto_prior_expiration_date)),e.auto_prior_carrier_name&&(t.auto_prior_carrier_name=e.auto_prior_carrier_name),e.auto_prior_liability_limit&&(t.auto_prior_liability_limit=e.auto_prior_liability_limit),e.auto_reason_for_no_insurance&&(t.auto_reason_for_no_insurance=e.auto_reason_for_no_insurance),e.auto_prior_years!==null&&e.auto_prior_years!==void 0&&(t.auto_prior_years=e.auto_prior_years),e.auto_prior_months!==null&&e.auto_prior_months!==void 0&&(t.auto_prior_months=e.auto_prior_months),e.auto_continuous_coverage_years!==null&&e.auto_continuous_coverage_years!==void 0&&(t.auto_continuous_coverage_years=e.auto_continuous_coverage_years),e.auto_cancelled_declined_refused_to_renew!==null&&e.auto_cancelled_declined_refused_to_renew!==void 0&&(t.auto_cancelled_declined_refused_to_renew=I(e.auto_cancelled_declined_refused_to_renew)),e.home_has_prior_insurance!==null&&e.home_has_prior_insurance!==void 0&&(t.home_has_prior_insurance=I(e.home_has_prior_insurance)),e.home_prior_expiration_date&&(t.home_prior_expiration_date=P(e.home_prior_expiration_date)),e.home_prior_carrier_name&&(t.home_prior_carrier_name=e.home_prior_carrier_name),e.year_built!==null&&e.year_built!==void 0&&(t.year_built=e.year_built),e.number_of_units!==null&&e.number_of_units!==void 0&&(t.number_of_units=e.number_of_units),e.number_of_stories!==null&&e.number_of_stories!==void 0&&(t.number_of_stories=e.number_of_stories),e.number_of_beds!==null&&e.number_of_beds!==void 0&&(t.number_of_beds=e.number_of_beds),e.number_of_full_baths!==null&&e.number_of_full_baths!==void 0&&(t.number_of_full_baths=e.number_of_full_baths),e.number_of_partial_baths!==null&&e.number_of_partial_baths!==void 0&&(t.number_of_partial_baths=e.number_of_partial_baths),e.under_construction!==null&&e.under_construction!==void 0&&(t.under_construction=I(e.under_construction)),e.distance_from_fire_hydrant_ft&&(t.distance_from_fire_hydrant_ft=e.distance_from_fire_hydrant_ft),e.distance_from_fire_station_miles&&(t.distance_from_fire_station_miles=e.distance_from_fire_station_miles),e.architectural_style&&(t.architectural_style=e.architectural_style),e.dwelling_type&&(t.dwelling_type=e.dwelling_type),e.construction_quality&&(t.construction_quality=e.construction_quality),e.located_over_water!==null&&e.located_over_water!==void 0&&(t.located_over_water=e.located_over_water),e.construction_type&&(t.construction_type=e.construction_type),e.exterior_wall_type&&(t.exterior_wall_type=e.exterior_wall_type),e.foundation_type&&(t.foundation_type=e.foundation_type),e.roof_material_type&&(t.roof_material_type=e.roof_material_type),e.year_roof_updated!==null&&e.year_roof_updated!==void 0&&(t.year_roof_updated=e.year_roof_updated),e.heating_type&&(t.heating_type=e.heating_type),e.heating_fuel_type&&(t.heating_fuel_type=e.heating_fuel_type),e.number_of_fireplaces!==null&&e.number_of_fireplaces!==void 0&&(t.number_of_fireplaces=e.number_of_fireplaces),e.basement_type&&(t.basement_type=e.basement_type),e.parking_type&&(t.parking_type=e.parking_type),e.number_of_parking_spaces!==null&&e.number_of_parking_spaces!==void 0&&(t.number_of_parking_spaces=e.number_of_parking_spaces),e.plumbing_type&&(t.plumbing_type=e.plumbing_type),e.pool_type&&(t.pool_type=e.pool_type),e.total_area_sq_ft!==null&&e.total_area_sq_ft!==void 0&&(t.total_area_sq_ft=e.total_area_sq_ft),e.parcel_area_sq_ft!==null&&e.parcel_area_sq_ft!==void 0&&(t.parcel_area_sq_ft=e.parcel_area_sq_ft),e.residence_type&&(t.residence_type=e.residence_type),e.usage_type&&(t.usage_type=e.usage_type),e.household_size!==null&&e.household_size!==void 0&&(t.household_size=e.household_size),e.number_of_mortgagees!==null&&e.number_of_mortgagees!==void 0&&(t.number_of_mortgagees=e.number_of_mortgagees),e.has_dog!==null&&e.has_dog!==void 0&&(t.has_dog=I(e.has_dog)),e.dog_breed_type&&(t.dog_breed_type=e.dog_breed_type),e.number_of_dogs!==null&&e.number_of_dogs!==void 0&&(t.number_of_dogs=e.number_of_dogs),e.has_business_on_premises!==null&&e.has_business_on_premises!==void 0&&(t.has_business_on_premises=I(e.has_business_on_premises)),e.business_class&&(t.business_class=e.business_class),e.retiree_discount!==null&&e.retiree_discount!==void 0&&(t.retiree_discount=I(e.retiree_discount)),e.gated_community_discount!==null&&e.gated_community_discount!==void 0&&(t.gated_community_discount=I(e.gated_community_discount)),e.multi_policy_discount!==null&&e.multi_policy_discount!==void 0&&(t.multi_policy_discount=I(e.multi_policy_discount)),e.non_smoker_discount!==null&&e.non_smoker_discount!==void 0&&(t.non_smoker_discount=I(e.non_smoker_discount)),e.first_time_buyer_discount!==null&&e.first_time_buyer_discount!==void 0&&(t.first_time_buyer_discount=I(e.first_time_buyer_discount)),e.fire_detection_system!==null&&e.fire_detection_system!==void 0&&(t.fire_detection_system=I(e.fire_detection_system)),e.burglar_alarm_system!==null&&e.burglar_alarm_system!==void 0&&(t.burglar_alarm_system=I(e.burglar_alarm_system)),e.burglar_alarm_system_type&&(t.burglar_alarm_system_type=e.burglar_alarm_system_type),e.smoke_detectors!==null&&e.smoke_detectors!==void 0&&(t.smoke_detectors=I(e.smoke_detectors)),e.sprinkler_system!==null&&e.sprinkler_system!==void 0&&(t.sprinkler_system=I(e.sprinkler_system)),e.sprinkler_system_type&&(t.sprinkler_system_type=e.sprinkler_system_type),e.gas_leakage_detector!==null&&e.gas_leakage_detector!==void 0&&(t.gas_leakage_detector=I(e.gas_leakage_detector)),e.deadbolt_locks!==null&&e.deadbolt_locks!==void 0&&(t.deadbolt_locks=I(e.deadbolt_locks)),e.fire_extinguisher!==null&&e.fire_extinguisher!==void 0&&(t.fire_extinguisher=I(e.fire_extinguisher)),e.order_credit_authorized!==null&&e.order_credit_authorized!==void 0&&(t.order_credit_authorized=I(e.order_credit_authorized)),e.has_health_insurance_auto_accident!==null&&e.has_health_insurance_auto_accident!==void 0&&(t.has_health_insurance_auto_accident=I(e.has_health_insurance_auto_accident)),e.named_insured_foreclosure_repo_bankruptcy!==null&&e.named_insured_foreclosure_repo_bankruptcy!==void 0&&(t.named_insured_foreclosure_repo_bankruptcy=I(e.named_insured_foreclosure_repo_bankruptcy)),e.named_insured_convicted_insurance_fraud!==null&&e.named_insured_convicted_insurance_fraud!==void 0&&(t.named_insured_convicted_insurance_fraud=I(e.named_insured_convicted_insurance_fraud)),e.drivers&&e.drivers.length>0?(t.drivers="Yes",t.drivers__items=e.drivers.map(n=>{const a={};return n.first_name&&(a.first_name=n.first_name),n.last_name&&(a.last_name=n.last_name),n.date_of_birth&&(a.date_of_birth=P(n.date_of_birth)),n.gender&&(a.gender=n.gender),n.marital_status&&(a.marital_status=n.marital_status),n.relationship_to_insured&&(a.relationship_to_insured=n.relationship_to_insured),n.license_state&&(a.license_state=n.license_state),n.license_status&&(a.license_status=n.license_status),n.license_number&&(a.license_number=n.license_number),n.date_first_licensed&&(a.date_first_licensed=P(n.date_first_licensed)),n.education_level&&(a.education_level=n.education_level),n.occupation&&(a.occupation=n.occupation),n.industry&&(a.industry=n.industry),n.driver_violations&&n.driver_violations.length>0&&(a.driver_violations__items=n.driver_violations.map(l=>{const o={};return l.code&&(o.code=l.code),l.occurred_at&&(o.occurred_at=P(l.occurred_at)),o})),n.driver_accidents&&n.driver_accidents.length>0&&(a.driver_accidents__items=n.driver_accidents.map(l=>{const o={};return l.occurred_at&&(o.occurred_at=P(l.occurred_at)),l.description&&(o.description=l.description),l.quote_vehicle_id&&(o.quote_vehicle_id=l.quote_vehicle_id),l.property_damage_amount_paid_cents!==null&&l.property_damage_amount_paid_cents!==void 0&&(o.property_damage_amount_paid_cents=l.property_damage_amount_paid_cents),l.personal_injury_amount_paid_cents!==null&&l.personal_injury_amount_paid_cents!==void 0&&(o.personal_injury_amount_paid_cents=l.personal_injury_amount_paid_cents),o})),n.losses&&n.losses.length>0&&(a.losses=n.losses.map(l=>{const o={};return l.description&&(o.description=l.description),l.date_of_incident&&(o.date_of_incident=P(l.date_of_incident)),l.amount_paid_cents!==null&&l.amount_paid_cents!==void 0&&(o.amount_paid_cents=l.amount_paid_cents),l.quote_vehicle_id&&(o.quote_vehicle_id=l.quote_vehicle_id),o})),a})):t.drivers="No",e.vehicles&&e.vehicles.length>0?(t.vehicles="Yes",t.vehicles__items=e.vehicles.map(n=>{const a={};n.vin&&(a.vin=n.vin),n.year!==null&&n.year!==void 0&&(a.year=n.year),n.make&&(a.make=n.make),n.model&&(a.model=n.model),n.ownership_type&&(a.ownership_type=n.ownership_type),n.usage&&(a.usage=n.usage),n.annual_mileage!==null&&n.annual_mileage!==void 0&&(a.annual_mileage=n.annual_mileage),n.miles_to_work!==null&&n.miles_to_work!==void 0&&(a.miles_to_work=n.miles_to_work),n.percent_to_work!==null&&n.percent_to_work!==void 0&&(a.percent_to_work=n.percent_to_work);const l=[];return n.garaging_address_line_1&&l.push(n.garaging_address_line_1),n.garaging_address_line_2&&l.push(n.garaging_address_line_2),n.garaging_address_city&&l.push(n.garaging_address_city),n.garaging_address_state&&l.push(n.garaging_address_state),n.garaging_address_postal_code&&l.push(n.garaging_address_postal_code),l.length>0&&(a.garaging_address=l.join(", ")),n.anti_theft_type&&(a.anti_theft_type=n.anti_theft_type),n.passive_restraint_type&&(a.passive_restraint_type=n.passive_restraint_type),n.coverages&&n.coverages.length>0&&(a.coverages__items=n.coverages.map(o=>{const f={};return o.type&&(f.type=o.type),o.per_person_limit_cents!==null&&o.per_person_limit_cents!==void 0&&(f.per_person_limit_cents=o.per_person_limit_cents),o.per_incident_limit_cents!==null&&o.per_incident_limit_cents!==void 0&&(f.per_incident_limit_cents=o.per_incident_limit_cents),o.per_incident_limit_percent!==null&&o.per_incident_limit_percent!==void 0&&(f.per_incident_limit_percent=o.per_incident_limit_percent),o.per_day_limit_cents!==null&&o.per_day_limit_cents!==void 0&&(f.per_day_limit_cents=o.per_day_limit_cents),o.deductible_cents!==null&&o.deductible_cents!==void 0&&(f.deductible_cents=o.deductible_cents),o.is_declined!==null&&o.is_declined!==void 0&&(f.is_declined=I(o.is_declined)),f})),n.vehicle_lienholders&&n.vehicle_lienholders.length>0&&(a.vehicle_lienholders__items=n.vehicle_lienholders.map(o=>{const f={};return o.name&&(f.name=o.name),o.type&&(f.type=o.type),o.line_1&&(f.line_1=o.line_1),o.line_2&&(f.line_2=o.line_2),o.city&&(f.city=o.city),o.state&&(f.state=o.state),o.postal_code&&(f.postal_code=o.postal_code),o.phone&&(f.phone=o.phone),o.fax&&(f.fax=o.fax),f})),a})):t.vehicles="No",e.losses&&e.losses.length>0&&(t.home_losses__items=e.losses.map(n=>{const a={};return n.description&&(a.description=n.description),n.date_of_incident&&(a.date_of_incident=P(n.date_of_incident)),n.amount_paid_cents!==null&&n.amount_paid_cents!==void 0&&(a.amount_paid_cents=n.amount_paid_cents),a})),t}function Se(e){const t={},r=a=>{if(typeof a=="string"){if(a==="Yes")return!0;if(a==="No")return!1}return a},s=Object.keys(e).filter(a=>!a.includes("__items")),n=new Set;for(const[a,l]of Object.entries(e))a.endsWith("__items")&&Array.isArray(l)&&l.forEach(o=>{typeof o=="object"&&o!==null&&Object.keys(o).forEach(f=>{n.add(f)})});for(const[a,l]of Object.entries(e))if(a.endsWith("__items")){const o=a.replace("__items","");if(s.includes(o)){const v=Array.isArray(l)?l.map(S=>Se(S)):l;t[o]=v}}else a.includes("__items")||n.has(a)||(t[a]=r(l));return t}function Vt({isOpen:e,onClose:t}){const[r,s]=u.useState([]),[n,a]=u.useState(null),[l,o]=u.useState(null),[f,v]=u.useState(null),[S,h]=u.useState(void 0),[E,C]=u.useState(!1);function T(Q){const d={SMSVerification:"Verify",AutoCurrentCarrier:"Current Auto Policy",HomeCurrentCarrier:"Current Home Policy"};return Q.map(_=>({key:_,title:d[_]||_,loadQuestions:async()=>(await Bt(_)).questions}))}u.useEffect(()=>{e&&(async()=>{try{const d=Tt();if(ke(),d){C(!0),a(d);try{const _=de(),c=await Kt(_?void 0:d);if(!c||!c.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:p}=c,{stages:w}=await Ne(),$=T(w);s($);try{const x=Ut(p);v(x)}catch(x){throw new Error(`Failed to transform quote data: ${x instanceof Error?x.message:"Unknown error"}`)}if(p.current_stage){const x=$.findIndex(y=>y.key===p.current_stage);x>=0?h(x):h($.length-1)}else h($.length-1)}catch(_){_.statusCode===404?(Ue(),a(null)):Ge()}finally{C(!1)}}else{const{stages:_}=await Ne();s(T(_))}}catch{C(!1)}})()},[e]),u.useEffect(()=>{if(!e)return;const{overflow:Q}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Q}},[e]);const M=u.useCallback(Q=>{Q.key==="Escape"&&(je(),t())},[t]);if(u.useEffect(()=>{if(e)return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[e,M]),u.useEffect(()=>{e||(v(null),h(void 0),C(!1))},[e]),u.useEffect(()=>{e&&xt()},[e]),u.useEffect(()=>{l&&Array.isArray(l)&&St({rateCount:l.length})},[l]),!e)return null;const F=()=>{je(),t()};return i.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"insurance-modal-title",children:[i.jsx("div",{className:"backdrop","aria-hidden":"true"}),i.jsxs("div",{className:"modal-panel bg-white relative w-full max-w-2xl flex flex-col max-h-[90vh] overflow-hidden",role:"document",children:[i.jsx("button",{onClick:F,className:"modal-close-btn absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-xl","aria-label":"Close",type:"button",children:"×"}),i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's get you the best insurance rates."}),i.jsx("p",{className:"p-subtitle",children:"This should only take a few minutes."})]}),i.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[!l&&i.jsx(i.Fragment,{children:E||r.length===0?i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx("div",{className:"text-slate-600",children:"Loading..."})}):i.jsx(At,{stages:r,initialValues:f??void 0,initialActive:S,onStageComplete:async(Q,d)=>{try{const _=Se(Q),{stages:c}=await Ne(),p=T(c);s(p);const w=p.findIndex(g=>g.key===d),$=p[w],x=w+1,b=(x<p.length?p[x]:null)?.key||d;if(n)if(d==="SMSVerification"){const{isVerified:g,token:m}=await Dt(n,_.sms_code);if(!g)throw new Error("Invalid SMS code");m&&jt(m),await oe({current_stage:b},!1)}else if(d==="State"){const{isSupported:g}=await Lt(_.state);if(!g)throw new Error("State is not supported");const m=de();await oe({..._,current_stage:b},!1,m?void 0:n)}else{const g=de();await oe({..._,current_stage:b},!1,g?void 0:n||void 0)}else{const m=(await Ft(_.phone))?.quoteId;if(!m||typeof m!="string"||m.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${m}`);a(m),Ct(m),await oe({current_stage:b},!1,m)}return Be({stageKey:d,stageTitle:$?.title??d,stepIndex:w+1,totalSteps:p.length}),{success:!0}}catch(_){return{success:!1,error:_ instanceof Error?_.message:"An error occurred"}}},onComplete:async Q=>{try{const d=Se(Q);if(!n)throw new Error("Quote ID is required");await oe(d,!0),v(Q);const{rates:_}=await Wt();o(_);const c=r.length,p=r[c-1];return Be({stageKey:p?.key??"unknown",stageTitle:p?.title??"unknown",stepIndex:c,totalSteps:c}),Nt(),{success:!0}}catch(d){return{success:!1,error:d instanceof Error?d.message:"An error occurred"}}}})})," ",l&&n&&i.jsx(Pt,{rates:l,onBack:()=>o(null)})]}),i.jsx("div",{className:"mt-4 pt-4 border-t border-slate-200",children:i.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})})]})]})}function Gt({isOpen:e}){return i.jsx(Vt,{isOpen:e,onClose:()=>{_e.close()}})}let G=null,Z=null,ue=!1;function Yt(){G||(G=document.createElement("div"),G.id="insurance-widget-root",document.documentElement.appendChild(G)),!Z&&G&&(Z=Xe.createRoot(G))}function $e(){Yt(),Z&&Z.render(u.createElement(Gt,{isOpen:ue}))}function Ht(){Z&&G&&(Z.unmount(),G.remove()),Z=null,G=null}const _e={init:e=>{ue=!!e?.autoOpen,$e()},open:()=>{ue=!0,$e()},close:()=>{ue=!1,$e()},destroy:Ht};typeof window<"u"&&(window.CredifyInsuranceWidget=_e),L.CredifyInsuranceWidget=_e,L.default=_e,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@import"https://fonts.googleapis.com/css2?family=Spline+Sans:wght@400;500;700&display=swap";/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@layer properties,theme,base,components,utilities;@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-emerald-600:oklch(59.6% .145 163.225);--color-blue-50:oklch(97% .014 254.604);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--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%;tab-size:4;line-height:1.5;font-family:var(--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(--default-font-feature-settings,normal);font-variation-settings:var(--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(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--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{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.z-0{z-index:0}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-4{margin-top:calc(var(--spacing)*-4)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.h-5{height:calc(var(--spacing)*5)}.h-12{height:calc(var(--spacing)*12)}.max-h-60{max-height:calc(var(--spacing)*60)}.max-h-\\[90vh\\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-screen{min-height:100vh}.w-5{width:calc(var(--spacing)*5)}.w-12{width:calc(var(--spacing)*12)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\\[var\\(--accent-color\\)\\]{border-color:var(--accent-color)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-red-500{border-color:var(--color-red-500)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.object-contain{object-fit:contain}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--text-primary\\)\\]{color:var(--text-primary)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.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)}.shadow-sm{--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{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,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.focus-within\\:border-\\[var\\(--primary-color\\)\\]:focus-within{border-color:var(--primary-color)}@media (hover:hover){.hover\\:bg-blue-600\\/90:hover{background-color:#155dfce6}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/90:hover{background-color:color-mix(in oklab,var(--color-blue-600)90%,transparent)}}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:text-blue-700:hover{color:var(--color-blue-700)}.hover\\:text-slate-600:hover{color:var(--color-slate-600)}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px 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)}}.focus-visible\\:ring-2:focus-visible{--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)}.focus-visible\\:ring-blue-600\\/40:focus-visible{--tw-ring-color:#155dfc66}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-600\\/40:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-600)40%,transparent)}}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-slate-300:disabled{background-color:var(--color-slate-300)}.disabled\\:text-slate-500:disabled{color:var(--color-slate-500)}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:64rem){.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}:root{--primary-color:#006aff;--secondary-color:#f0f4ff;--background-color:#fff;--text-primary:#1a202c;--text-secondary:#718096;--accent-color:#e2e8f0;--radius-sm:.25rem;--radius-md:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-2xl:1.25rem;--radius-3xl:1.75rem;--radius-full:9999px;--radio-dot-svg:url("data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27%23006aff%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%274%27/%3e%3c/svg%3e");--select-button-svg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24px' height='24px' fill='%23718096' viewBox='0 0 256 256'%3e%3cpath d='m215.39 92.94-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 1 1 11.32-11.32L128 154.06l74.07-72.44a8 8 0 0 1 11.32 11.32Z'/%3e%3c/svg%3e")}#insurance-widget-root,#root{color:var(--text-primary);font-family:Spline Sans,ui-sans-serif,system-ui,sans-serif}#insurance-widget-root .backdrop,#root .backdrop{background:#00000080;position:fixed;inset:0}#insurance-widget-root .modal-panel,#root .modal-panel{border-radius:var(--radius-2xl);padding:1.5rem;box-shadow:0 24px 64px -20px #00000059;background:#fff!important}@media (min-width:640px){#insurance-widget-root .modal-panel,#root .modal-panel{padding:2rem}}@media (min-width:768px){#insurance-widget-root .modal-panel,#root .modal-panel{padding:2.5rem}}@media (max-width:767px){#insurance-widget-root .modal-panel,#root .modal-panel{width:100%;max-width:none;height:100%;max-height:none;box-shadow:none;border-radius:0;position:fixed;inset:0}}#insurance-widget-root .h1-title,#root .h1-title{letter-spacing:-.01em;color:var(--text-primary);font-size:1.875rem;font-weight:700;line-height:2.25rem}@media (min-width:640px){#insurance-widget-root .h1-title,#root .h1-title{font-size:2.25rem;line-height:2.5rem}}#insurance-widget-root .p-subtitle,#root .p-subtitle{color:var(--text-secondary);margin-top:.5rem}#insurance-widget-root .form-label,#root .form-label{color:var(--text-secondary);margin-bottom:.5rem;font-size:.875rem;font-weight:500;display:block}#insurance-widget-root .form-input,#root .form-input{border-radius:var(--radius-lg);border:1px solid var(--accent-color);width:100%;color:var(--text-primary);background:#fff;outline:none;padding:.75rem 1rem;font-size:1rem;transition:box-shadow .15s,border-color .15s}#insurance-widget-root .form-input::placeholder,#root .form-input::placeholder{color:#94a3b8}#insurance-widget-root .form-input:focus,#root .form-input:focus{border-color:var(--primary-color);box-shadow:0 0 0 1px var(--primary-color)}#insurance-widget-root .select-caret,#root .select-caret{background-image:var(--select-button-svg);appearance:none;background-position:right .75rem center;background-repeat:no-repeat;background-size:1.25rem 1.25rem;padding-right:2.5rem}#insurance-widget-root .radio-card,#root .radio-card{border-radius:var(--radius-md);border:2px solid var(--accent-color);cursor:pointer;background:#fff;align-items:center;gap:.75rem;padding:1rem;transition:all .15s;display:flex}#insurance-widget-root .radio-card:hover,#root .radio-card:hover{border-color:#cfd8e3}#insurance-widget-root .radio-input,#root .radio-input{border:2px solid var(--accent-color);appearance:none;background:0 0;border-radius:9999px;outline:none;width:1.25rem;height:1.25rem}#insurance-widget-root .radio-input:checked,#root .radio-input:checked{border-color:var(--primary-color);background-image:var(--radio-dot-svg);background-position:50%;background-repeat:no-repeat}#insurance-widget-root .radio-card:has(.radio-input:checked),#root .radio-card:has(.radio-input:checked){border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color)}@supports (color:color-mix(in lab,red,red)){#insurance-widget-root .radio-card:has(.radio-input:checked),#root .radio-card:has(.radio-input:checked){box-shadow:0 0 0 2px color-mix(in oklab,var(--primary-color)20%,transparent)}}#insurance-widget-root .radio-label,#root .radio-label{color:var(--text-primary);font-size:1rem;font-weight:600}#insurance-widget-root .btn-primary,#root .btn-primary{border-radius:var(--radius-full);background:var(--primary-color);color:#fff;letter-spacing:.02em;justify-content:center;align-items:center;width:100%;height:3rem;font-weight:700;transition:opacity .15s;display:flex}#insurance-widget-root .btn-primary:hover,#root .btn-primary:hover{opacity:.9}#insurance-widget-root .btn-outline,#root .btn-outline{border-radius:var(--radius-full);width:100%;height:3rem;color:var(--text-primary);border:1px solid var(--accent-color);letter-spacing:.02em;background:#fff;justify-content:center;align-items:center;font-weight:700;transition:background .15s,color .15s,border-color .15s,opacity .15s;display:flex}#insurance-widget-root .btn-outline:hover,#root .btn-outline:hover{border-color:#cfd8e3}#insurance-widget-root .btn-primary,#root .btn-primary,#insurance-widget-root .btn-outline,#root .btn-outline{cursor:pointer}#insurance-widget-root .btn-primary:disabled,#root .btn-primary:disabled,#insurance-widget-root .btn-outline:disabled,#root .btn-outline:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(20%)}#insurance-widget-root .btn-primary:not(:disabled):hover,#root .btn-primary:not(:disabled):hover{opacity:.95}#insurance-widget-root .btn-outline:not(:disabled):hover,#root .btn-outline:not(:disabled):hover{border-color:#cfd8e3}#insurance-widget-root .quote-btn,#root .quote-btn{background-color:var(--color-blue-600);padding-inline:calc(var(--spacing)*6);padding-block:calc(var(--spacing)*3);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white);--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);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,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-radius:3.40282e38px}@media (hover:hover){:is(#insurance-widget-root .quote-btn,#root .quote-btn):hover{background-color:var(--color-blue-700)}}#insurance-widget-root .input-error,#root .input-error{border-color:#dc2626!important;box-shadow:0 0 0 1px #dc2626!important}#insurance-widget-root .checkbox-card,#root .checkbox-card{border-radius:var(--radius-md);border:2px solid var(--accent-color);cursor:pointer;background:#fff;align-items:center;gap:.75rem;padding:1rem;transition:all .15s;display:flex}#insurance-widget-root .checkbox-card:hover,#root .checkbox-card:hover{border-color:#cfd8e3}#insurance-widget-root .checkbox-input,#root .checkbox-input{border:2px solid var(--accent-color);appearance:none;background:#fff;border-radius:.375rem;outline:none;place-items:center;width:1.25rem;height:1.25rem;display:grid}#insurance-widget-root .checkbox-input:checked,#root .checkbox-input:checked{border-color:var(--primary-color);background-color:var(--primary-color);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 24 24'%3e%3cpath d='M20.285 6.709a1 1 0 0 1 0 1.414l-9.192 9.193a1 1 0 0 1-1.414 0L3.715 11.55a1 1 0 1 1 1.414-1.414l5.05 5.05 8.485-8.478a1 1 0 0 1 1.621.001z'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat}#insurance-widget-root .checkbox-card:has(.checkbox-input:checked),#root .checkbox-card:has(.checkbox-input:checked){border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color)}@supports (color:color-mix(in lab,red,red)){#insurance-widget-root .checkbox-card:has(.checkbox-input:checked),#root .checkbox-card:has(.checkbox-input:checked){box-shadow:0 0 0 2px color-mix(in oklab,var(--primary-color)20%,transparent)}}#insurance-widget-root .checkbox-label,#root .checkbox-label{color:var(--text-primary);font-size:1rem;font-weight:600}#insurance-widget-root .modal-scroll,#root .modal-scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;max-height:min(90dvh,800px);overflow-y:auto}#insurance-widget-root .modal-scroll .h1-title,#root .modal-scroll .h1-title{z-index:1;background:#fff;padding-top:.25rem;padding-bottom:.75rem;position:sticky;top:0}#insurance-widget-root .panel-body,#root .panel-body{padding:4px;scroll-padding:4px}#insurance-widget-root .tel-input-wrapper:focus-within:not(.error),#root .tel-input-wrapper:focus-within:not(.error){outline:1px solid var(--primary-color);outline-offset:0px;z-index:1}#insurance-widget-root .tel-input-wrapper.error,#root .tel-input-wrapper.error{outline-offset:0px;z-index:1;outline:1px solid #ef4444}#insurance-widget-root .tel-input-wrapper:focus-within:after,#root .tel-input-wrapper:focus-within:after{content:"";border:1px solid var(--primary-color);pointer-events:none;z-index:10;border-radius:.75rem;position:absolute;inset:-1px}#insurance-widget-root .tel-input-wrapper.error:after,#root .tel-input-wrapper.error:after{content:"";pointer-events:none;z-index:10;border:1px solid #ef4444;border-radius:.75rem;position:absolute;inset:-1px}#insurance-widget-root .form-label:has(+input[aria-required=true]):after,#root .form-label:has(+input[aria-required=true]):after,#insurance-widget-root .form-label:has(+select[aria-required=true]):after,#root .form-label:has(+select[aria-required=true]):after,#insurance-widget-root .form-label:has(+textarea[aria-required=true]):after,#root .form-label:has(+textarea[aria-required=true]):after,#insurance-widget-root .legend-required:after,#root .legend-required:after{content:" *";color:#dc2626;margin-left:.25rem}#insurance-widget-root .scrollbar-hide,#root .scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}#insurance-widget-root .scrollbar-hide::-webkit-scrollbar{display:none}#root .scrollbar-hide::-webkit-scrollbar{display:none}#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button],#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button],#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled,#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;color:#fff!important;background-color:#2563eb!important;min-height:3rem!important;display:flex!important;position:relative!important;overflow:visible!important}#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled,#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled{opacity:.5!important;background-color:#d1d5db!important}#insurance-widget-root .credify-link-underline,#root .credify-link-underline{color:var(--primary-color);text-decoration:underline}#insurance-widget-root .credify-link-underline:hover,#root .credify-link-underline:hover{color:#0052cc}#insurance-widget-root button.modal-close-btn[type=button],#root button.modal-close-btn[type=button]{appearance:none;background:0 0;border:none;padding:0;visibility:visible!important;opacity:1!important;cursor:pointer!important;clip-path:none!important;pointer-events:auto!important;display:inline-flex!important;overflow:visible!important}@media (max-width:767px){#insurance-widget-root button.modal-close-btn[type=button],#root button.modal-close-btn[type=button]{visibility:hidden!important;pointer-events:none!important;display:none!important}}#insurance-widget-root button.credify-btn-back[type=button],#root button.credify-btn-back[type=button],#insurance-widget-root button.credify-btn-back[type=button]:disabled,#root button.credify-btn-back[type=button]:disabled{transition:border-color .15s,background-color .15s;visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;box-sizing:border-box!important;border-radius:var(--radius-full)!important;color:#1a202c!important;text-align:center!important;cursor:pointer!important;background-color:#fff!important;border:1px solid #e2e8f0!important;place-content:center!important;place-items:center!important;height:3rem!important;min-height:3rem!important;margin:0!important;padding:0!important;font-size:1rem!important;font-weight:600!important;line-height:1!important;display:grid!important;overflow:visible!important}#insurance-widget-root button.credify-btn-back[type=button]:not(:disabled):hover,#root button.credify-btn-back[type=button]:not(:disabled):hover{background-color:#f9fafb!important;border-color:#cbd5e1!important}#insurance-widget-root button.credify-btn-back[type=button]:disabled,#root button.credify-btn-back[type=button]:disabled{opacity:.5!important;cursor:not-allowed!important;background-color:#f3f4f6!important}#insurance-widget-root button.credify-btn-back-rates[type=button],#root button.credify-btn-back-rates[type=button]{margin-top:2rem!important}#insurance-widget-root button.credify-retry-btn[type=button],#root button.credify-retry-btn[type=button]{cursor:pointer;font:inherit;border:none;visibility:visible!important;color:var(--text-primary)!important;clip-path:none!important;pointer-events:auto!important;background:0 0!important;text-decoration:underline!important;display:inline!important;overflow:visible!important}#insurance-widget-root button.rates-bind-btn[type=button],#root button.rates-bind-btn[type=button],#insurance-widget-root button.rates-bind-btn[type=button]:disabled,#root button.rates-bind-btn[type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;box-sizing:border-box!important;text-align:center!important;color:#fff!important;background-color:#2563eb!important;place-content:center!important;place-items:center!important;min-height:2.5rem!important;padding:0 1rem!important;line-height:1!important;display:grid!important;overflow:visible!important}#insurance-widget-root button.rates-bind-btn[type=button]:disabled,#root button.rates-bind-btn[type=button]:disabled{opacity:.5!important;background-color:#cbd5e1!important}#insurance-widget-root button.rates-bind-btn.rates-bind-btn-requested,#root button.rates-bind-btn.rates-bind-btn-requested{color:#fff!important;background-color:#10b981!important}#insurance-widget-root button.quote-btn[type=button],#root button.quote-btn[type=button]{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;color:#fff!important;background-color:#2563eb!important;display:inline-flex!important;overflow:visible!important}#insurance-widget-root a.credify-link-underline[href],#root a.credify-link-underline[href]{color:var(--primary-color);visibility:visible!important;clip-path:none!important;pointer-events:auto!important;text-decoration:underline!important;display:inline!important;overflow:visible!important}#insurance-widget-root input.form-input,#root input.form-input,#insurance-widget-root select.form-input,#root select.form-input,#insurance-widget-root textarea.form-input,#root textarea.form-input{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;display:block!important;overflow:visible!important}#insurance-widget-root button.btn-primary[type=button],#root button.btn-primary[type=button],#insurance-widget-root button.btn-primary[type=submit],#root button.btn-primary[type=submit],#insurance-widget-root button.btn-outline[type=button],#root button.btn-outline[type=button],#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled,#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;min-height:3rem!important;display:flex!important;overflow:visible!important}#insurance-widget-root button.btn-primary[type=button],#root button.btn-primary[type=button],#insurance-widget-root button.btn-primary[type=submit],#root button.btn-primary[type=submit]{color:#fff!important;background-color:#2563eb!important}#insurance-widget-root button.btn-outline[type=button],#root button.btn-outline[type=button]{color:var(--text-primary)!important;border:1px solid var(--accent-color)!important;background-color:#fff!important}#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled,#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{opacity:.5!important}#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled{color:#fff!important;background-color:#d1d5db!important}#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{color:var(--text-primary)!important;background-color:#f1f5f9!important}#insurance-widget-root .form-wizard-steps-header,#root .form-wizard-steps-header{visibility:visible!important;display:flex!important}#insurance-widget-root .form-wizard-steps,#root .form-wizard-steps{flex:1;align-items:center;gap:.5rem;min-width:0;margin:0;padding:0;font-size:.75rem;line-height:1rem;list-style:none;overflow-x:auto;display:flex!important}#insurance-widget-root .form-wizard-step-pill,#root .form-wizard-step-pill{white-space:nowrap;border:1px solid;border-radius:9999px;flex-shrink:0;padding:.25rem .625rem;visibility:visible!important;display:inline-flex!important}#insurance-widget-root .form-wizard-step-arrow,#root .form-wizard-step-arrow{color:#94a3b8;flex-shrink:0;visibility:visible!important;display:inline-flex!important}#insurance-widget-root .form-wizard-step-counter,#root .form-wizard-step-counter{color:#64748b;flex-shrink:0;font-size:.875rem;line-height:1.25rem;visibility:visible!important;display:block!important}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@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}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--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}}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
(function(){if(typeof q>"u")var q={env:{}}})();(function(q,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("react-dom/client"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react","react-dom/client","react/jsx-runtime"],g):(q=typeof globalThis<"u"?globalThis:q||self,g(q.CredifyInsuranceWidget={},q.React,q.ReactDOM,q.React))})(this,(function(q,g,wr,o){"use strict";function z({id:r,label:e,hint:t,error:i,required:a,className:s,children:c}){return o.jsxs("div",{className:s,children:[o.jsxs("label",{htmlFor:r,className:"form-label",children:[e," ",a&&o.jsx("span",{className:"text-red-600",children:"*"})]}),c,t&&!i&&o.jsx("p",{id:`${r}-hint`,className:"mt-1 text-sm text-slate-500",children:t}),i&&o.jsx("p",{id:`${r}-error`,className:"mt-1 text-sm text-red-600",children:i})]})}function Tr({id:r,label:e,hint:t,error:i,required:a,className:s,...c}){return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsx("input",{id:r,className:`form-input ${i?"input-error":""}`,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,required:a,...c,type:"text"})})}function Ke({id:r,label:e,hint:t,error:i,required:a,className:s,...c}){return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsx("input",{id:r,type:"number",className:`form-input ${i?"input-error":""}`,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,required:a,...c})})}function Or({id:r,label:e,hint:t,error:i,required:a,className:s,...c}){return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsx("input",{id:r,type:"email",className:`form-input ${i?"input-error":""}`,inputMode:"email",autoComplete:"email",required:a,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,...c})})}function Me(r){const e=r.replace(/\D/g,"");if(e.length===10)return`(${e.slice(0,3)}) ${e.slice(3,6)} - ${e.slice(6)}`;if(e.length>10){const t=e.slice(0,10);return`(${t.slice(0,3)}) ${t.slice(3,6)} - ${t.slice(6)}`}return e.length>=6?`(${e.slice(0,3)}) ${e.slice(3,6)} - ${e.slice(6)}`:e.length>=3?`(${e.slice(0,3)}) ${e.slice(3)}`:e.length>0?`(${e}`:e}function Ne(r){return r.replace(/\D/g,"")}function Ir({id:r,label:e,hint:t,error:i,required:a,className:s,value:c="",onChange:n,...l}){const[_,d]=g.useState(""),S=g.useRef(null),y=g.useRef(0);g.useEffect(()=>{if(!c){d("");return}let w=Ne(c);w.length===11&&w.startsWith("1")&&(w=w.slice(1));const G=w.slice(0,10);d(Me(G))},[c]);const b=w=>{const G=w.target,W=G.value;y.current=G.selectionStart||0;const I=Ne(W).slice(0,10),v=Me(I);d(v);const f=I.length===10?`+1${I}`:I,u={...w,currentTarget:{...w.currentTarget,value:f},target:{...w.target,value:f}};n?.(u),setTimeout(()=>{if(S.current){const E=W.slice(0,y.current),h=Ne(E),M=Me(h),N=Math.min(M.length,v.length);S.current.setSelectionRange(N,N)}},0)};return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsxs("div",{className:`tel-input-wrapper flex items-center border rounded-lg transition-colors w-full relative ${i?"border-red-500 error":"border-[var(--accent-color)] focus-within:border-[var(--primary-color)]"}`,children:[o.jsx("label",{htmlFor:r,className:"px-3 py-3 text-slate-700 font-medium border-r border-[var(--accent-color)] bg-slate-50 flex-shrink-0 relative z-0 rounded-l-lg",children:"+1"}),o.jsx("input",{ref:S,id:r,type:"tel",className:`flex-1 px-4 py-3 border-0 rounded-r-lg outline-none bg-transparent text-[var(--text-primary)] text-base ${i?"input-error":""}`,inputMode:"tel",autoComplete:"tel",required:a,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,value:_,onChange:b,...l})]})})}function Lr({id:r,label:e,hint:t,error:i,required:a,className:s,...c}){return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsx("input",{id:r,type:"url",className:`form-input ${i?"input-error":""}`,inputMode:"url",autoComplete:"url",required:a,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,...c})})}function Dr({id:r,label:e,hint:t,error:i,required:a,className:s,...c}){return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsx("input",{id:r,type:"password",className:`form-input ${i?"input-error":""}`,autoComplete:"current-password",required:a,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,...c})})}function Pr({id:r,label:e,hint:t,error:i,required:a,className:s,rows:c=4,...n}){return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsx("textarea",{id:r,rows:c,className:`form-input ${i?"input-error":""}`,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,required:a,...n})})}function Rr({id:r,label:e,hint:t,error:i,required:a,className:s,...c}){return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsx("input",{id:r,type:"date",className:`form-input ${i?"input-error":""}`,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,required:a,...c})})}function je({id:r,label:e,className:t,...i}){return o.jsxs("label",{className:`checkbox-card ${t||""}`,htmlFor:r,children:[o.jsx("input",{id:r,type:"checkbox",className:"checkbox-input",...i}),o.jsx("span",{className:"checkbox-label",children:e})]})}function Br({name:r,value:e,checked:t,onChange:i,children:a}){return o.jsxs("label",{className:"radio-card",children:[o.jsx("input",{className:"radio-input",type:"radio",name:r,value:e,checked:t,onChange:i}),o.jsx("span",{className:"radio-label",children:a})]})}function Fr({legend:r,children:e,className:t,legendClassName:i}){return o.jsxs("fieldset",{className:t,children:[o.jsx("legend",{className:`form-label mb-4 ${i||""}`,children:r}),o.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:e})]})}function xr({id:r,label:e,hint:t,error:i,required:a,className:s,placeholder:c,options:n,children:l,..._}){const d=[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,S=!!l;return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsxs("select",{id:r,className:`form-input select-caret ${i?"input-error":""}`,"aria-invalid":!!i,"aria-describedby":d,required:a,..._,children:[c&&o.jsx("option",{value:"",disabled:!0,selected:!("value"in _),children:c}),S?l:n?.map(y=>o.jsx("option",{value:y.value,disabled:y.disabled,children:y.label},y.value))]})})}const Hr="AIzaSyDjLdKLxoa-maLNGAyq_I_2r_Fe_TzFikw";function $r(){return new Promise((r,e)=>{if(window.google?.maps?.places){r();return}const t=document.querySelector('script[src*="maps.googleapis.com"]');if(t){t.addEventListener("load",()=>r()),t.addEventListener("error",()=>e(new Error("Failed to load Google Maps script")));return}const i=document.createElement("script");i.src=`https://maps.googleapis.com/maps/api/js?key=${Hr}&libraries=places`,i.async=!0,i.defer=!0,i.onload=()=>r(),i.onerror=()=>e(new Error("Failed to load Google Maps script")),document.head.appendChild(i)})}function Gr(r){const e={fullAddress:r.formatted_address};return r.address_components&&r.address_components.forEach(t=>{const i=t.types;i.includes("street_number")&&(e.streetNumber=t.long_name),i.includes("route")&&(e.streetName=t.long_name),i.includes("locality")&&(e.city=t.long_name),i.includes("administrative_area_level_1")&&(e.state=t.short_name),i.includes("postal_code")&&(e.zipCode=t.long_name),i.includes("country")&&(e.country=t.short_name)}),e}function Ur({id:r,label:e,hint:t,error:i,required:a,className:s,onChange:c,onPlaceSelect:n,value:l,..._}){const d=g.useRef(null),S=g.useRef(null),y=g.useRef(null),b=g.useRef(null),[w,G]=g.useState(!0),[W,B]=g.useState(l||""),[I,v]=g.useState([]),[f,u]=g.useState(!1),[E,h]=g.useState(-1),M=g.useRef([]),N=g.useRef(!1),D=g.useRef(-1);g.useEffect(()=>{M.current=I},[I]),g.useEffect(()=>{N.current=f},[f]),g.useEffect(()=>{D.current=E},[E]),g.useEffect(()=>{l!==void 0&&B(String(l))},[l]);const m=g.useRef(null);g.useEffect(()=>{if(!d.current)return;let C=!0;return $r().then(()=>{!C||!d.current||(S.current=new google.maps.places.AutocompleteService,y.current=new google.maps.places.PlacesService(document.createElement("div")),G(!1))}).catch(A=>{console.error("Error loading Google Maps:",A),G(!1)}),()=>{C=!1,m.current&&clearTimeout(m.current)}},[]);const L=C=>{const A=C.target.value;if(B(A),c?.(A),m.current&&clearTimeout(m.current),A.length<3){v([]),u(!1);return}m.current=setTimeout(()=>{S.current&&S.current.getPlacePredictions({input:A,types:["address"]},(T,H)=>{H===google.maps.places.PlacesServiceStatus.OK&&T?(v(T),u(!0),h(-1)):(v([]),u(!1))})},300)},p=C=>{if(!N.current||M.current.length===0){C.key==="Escape"&&(u(!1),N.current=!1);return}switch(C.key){case"ArrowDown":C.preventDefault(),h(A=>{const T=A<M.current.length-1?A+1:A;return D.current=T,T});break;case"ArrowUp":C.preventDefault(),h(A=>{const T=A>0?A-1:-1;return D.current=T,T});break;case"Enter":C.preventDefault(),D.current>=0&&D.current<M.current.length&&k(M.current[D.current]);break;case"Escape":C.preventDefault(),u(!1),N.current=!1;break}};g.useEffect(()=>{const C=A=>{b.current&&!b.current.contains(A.target)&&d.current&&!d.current.contains(A.target)&&(u(!1),N.current=!1)};if(f)return document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C)}},[f]);const k=C=>{y.current&&y.current.getDetails({placeId:C.place_id,fields:["address_components","formatted_address","geometry"]},(A,T)=>{if(T===google.maps.places.PlacesServiceStatus.OK&&A){const H=A.formatted_address||"";B(H),u(!1),v([]),N.current=!1;const R=Gr(A);c?.(H,R),n?.(A)}})};return o.jsx(z,{id:r,label:e,hint:t,error:i,required:a,className:s,children:o.jsxs("div",{className:"relative",children:[o.jsx("input",{ref:d,id:r,type:"text",className:`form-input ${i?"input-error":""}`,value:W,onChange:L,onKeyDown:p,"aria-invalid":!!i,"aria-describedby":[t?`${r}-hint`:null,i?`${r}-error`:null].filter(Boolean).join(" ")||void 0,required:a,autoComplete:"street-address",placeholder:_.placeholder||"Enter an address",disabled:w||_.disabled,..._}),w&&o.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading address suggestions..."}),f&&I.length>0&&o.jsx("div",{ref:b,className:"absolute z-50 w-full mt-1 bg-white border border-slate-200 rounded-lg shadow-lg max-h-60 overflow-y-auto",role:"listbox",children:I.map((C,A)=>o.jsxs("div",{className:`px-4 py-3 cursor-pointer transition-colors ${A===E?"bg-blue-50 text-slate-900":"bg-white text-slate-900 hover:bg-slate-50"} ${A<I.length-1?"border-b border-slate-100":""}`,role:"option","aria-selected":A===E,onClick:()=>k(C),onMouseEnter:()=>h(A),children:[o.jsx("div",{className:"font-medium text-slate-900",children:C.structured_formatting.main_text}),C.structured_formatting.secondary_text&&o.jsx("div",{className:"text-sm text-slate-500 mt-0.5",children:C.structured_formatting.secondary_text})]},C.place_id))})]})})}function we(r){return r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Qe(r,e){return r.key??`${we(r.question)}-${e}`}function me(r,e){const t={},i=a=>a==null||typeof a=="string"&&a.trim()==="";return r.forEach((a,s)=>{const c=Qe(a,s),n=e[c];if(a.required)switch(a.inputType){case"checkbox":n!==!0&&(t[c]="Required");break;case"radio":case"select":i(n)&&(t[c]="Required");break;case"number":(n==null||typeof n=="string"&&n.trim()==="")&&(t[c]="Required");break;case"date":case"email":case"tel":case"url":case"password":case"text":case"textarea":case"address":default:i(n)&&(t[c]="Required");break}}),t}function Wr(r){if(r===""||r===null||r===void 0)return;const e=Number(r);return Number.isNaN(e)?void 0:e}const Vr={NoPriorInsurance:"No Prior Insurance",TwentyFirstCentury:"21st Century",ACentral:"A.Central",AAA:"AAA",AARP:"AARP",Acadia:"Acadia",Ace:"Ace",Acuity:"Acuity",AdirondackInsExchange:"Adirondack Ins Exchange",Aegis:"Aegis",AIC:"AIC",AIG:"AIG",AlfaAlliance:"Alfa Alliance",Allied:"Allied",Allstate:"Allstate",AmericaFirst:"America First",AmericanCommerce:"American Commerce",AmericanFamily:"American Family",Amica:"Amica",ASILloyds:"ASI Lloyds",AustinMutual:"Austin Mutual",Autoone:"Autoone",AutoOwners:"Auto-Owners",BadgerMutual:"Badger Mutual",Balboa:"Balboa",Bankers:"Bankers",BeaconNational:"Beacon National",BrethernMutual:"Brethern Mutual",BristolWest:"Bristol West",CapitalInsuranceGroup:"Capital Insurance Group",Celina:"Celina",CentralMutualOfOH:"Central Mutual of OH",Chubb:"Chubb",Cincinnati:"Cincinnati",Clearcover:"Clearcover",CNA:"CNA",ColonialPenn:"Colonial Penn",ColoradoCasualty:"Colorado Casualty",Columbia:"Columbia",CommerceWest:"Commerce West",CommonwealthCasualty:"Commonwealth Casualty",Ameriprise:"CONNECT",ConstitutionalCasualty:"Constitutional Casualty",Cornerstone:"Cornerstone",Countrywide:"Countrywide",CSE:"CSE",Cumberland:"Cumberland",Dairyland:"Dairyland",Deerbrook:"Deerbrook",Direct:"Direct",Donegal:"Donegal",Drive:"Drive",Electric:"Electric",EMC:"EMC",Encompass:"Encompass",Erie:"Erie",Esurance:"Esurance",Explorer:"Explorer",FarmBureau:"Farm Bureau",Farmers:"Farmers",FiremansFund:"Firemans Fund",FirstAmerican:"First American",Foremost:"Foremost",Geico:"Geico",GeneralCasualty:"General Casualty",GermantownMutual:"Germantown Mutual",GMAC:"GMAC",Grange:"Grange",GreatAmerican:"Great American",Grinnell:"Grinnell",GuideOne:"Guide One",Hanover:"Hanover",Harbor:"Harbor",Harleysville:"Harleysville",HartfordOMNI:"Hartford OMNI",Hartford:"Hartford",HastingsMutual:"Hastings Mutual",HawkeyeSecurity:"Hawkeye Security",HDI:"HDI",HoraceMann:"Horace Mann",HoustonGeneral:"Houston General",IFA:"IFA",ImperialCasualty:"Imperial Casualty",IndianaFarmers:"Indiana Farmers",Indiana:"Indiana",Infinity:"Infinity",Insurequest:"Insurequest",Integon:"Integon",Integrity:"Integrity",Kemper:"Kemper",LibertyMutual:"Liberty Mutual",LibertyNorthwest:"Liberty Northwest",MainStreetAmerica:"Main Street America",Mapfre:"Mapfre",Mendota:"Mendota",MerchantsGroup:"Merchants Group",Mercury:"Mercury",Metlife:"MetLife",Metropolitan:"Metropolitan",MidContinent:"Mid-Continent",MidwesternIndemnity:"Midwestern Indemnity",Montgomery:"Montgomery",MSA:"MSA",MtWashington:"Mt. Washington",MutualBenefit:"Mutual Benefit",NationalGeneral:"National General",Nationwide:"Nationwide",NewYorkCentralMutual:"New York Central Mutual",NJManufacturers:"NJ Manufacturers",NJSkylands:"NJ Skylands",Northstar:"Northstar",Occidental:"Occidental",OhioCasualty:"Ohio Casualty",OmahaPC:"Omaha P/C",OneBeacon:"One Beacon",OregonMutual:"Oregon Mutual",Palisades:"Palisades",PeerlessMontgomery:"Peerless/Montgomery",Pekin:"Pekin",Pemco:"Pemco",PennNational:"Penn National",PlymouthRock:"Plymouth Rock",PreferredMutual:"Preferred Mutual",Proformance:"Proformance",Progressive:"Progressive",Prudential:"Prudential",Republic:"Republic",RockfordMutual:"Rockford Mutual",RoyalAndSunAlliance:"Royal and Sun Alliance",Safeco:"Safeco",SECURA:"SECURA",Selective:"Selective",SouthernCounty:"Southern County",SouthernMutual:"Southern Mutual",SouthernTrust:"Southern Trust",StPaulTravelers:"St. Paul/Travelers",StandardMutual:"Standard Mutual",StarCasualty:"Star Casualty",StateAuto:"State Auto",StateFarm:"State Farm",Fidelity:"Stillwater",Travelers:"Travelers",TWFG:"TWFG",Unigard:"Unigard",UnitedFireAndCasualty:"United Fire and Casualty",Unitrin:"Unitrin",Universal:"Universal",USAA:"USAA",UticaNational:"Utica National",Victoria:"Victoria",WestBend:"West Bend",WesternNational:"Western National",WesternReserveGroup:"Western Reserve Group",Westfield:"Westfield",WhiteMountains:"White Mountains",WilsonMutual:"Wilson Mutual",Windsor:"Windsor",Zurich:"Zurich",OtherStandard:"Other Standard",OtherNonStandard:"Other Non-Standard"},Yr={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},Kr={TwentyFirstCentury:"21st Century",AAA:"AAA",Acuity:"Acuity",AdirondackInsExchange:"Adirondack Ins Exchange",AIG:"AIG",AlfaAlliance:"Alfa Alliance",AllianzOfAmerica:"Allianz of America",AllianzOfAmericaJefferson:"Allianz of America-Jefferson",Allied:"Allied",Allmerica:"Allmerica",Allstate:"Allstate",AmericaFirst:"America First",AmericanFamily:"American Family",AmericanCommerce:"American Commerce",Amica:"Amica",ASILloyds:"ASI Lloyds",Assurant:"Assurant",AtlasGeneralAgency:"Atlas General Agency",AustinMutual:"Austin Mutual",AutoOwners:"Auto-Owners",BadgerMutual:"Badger Mutual",Balboa:"Balboa",Bamboo:"Bamboo",BeaconNational:"Beacon National",BunkerHill:"Bunker Hill",CapitalInsuranceGroup:"Capital Insurance Group",CentralMutualOfOH:"Central Mutual of OH",ChubbInsurance:"Chubb",Cincinnati:"Cincinnati",Citizens:"Citizens",ColoradoCasualty:"Colorado Casualty",Ameriprise:"CONNECT",CSE:"CSE",Cumberland:"Cumberland",Cypress:"Cypress",Dairyland:"Dairyland",Donegal:"Donegal",Electric:"Electric",EMC:"EMC",Encompass:"Encompass",Erie:"Erie",Esurance:"Esurance",ExcelsiorInsuranceCompany:"Excelsior Insurance Company",FairPlan:"Fair Plan",FarmBureau:"Farm Bureau",Farmers:"Farmers",FiremansFund:"Firemans Fund",FirstAmerican:"First American",ForemostInsuranceCompany:"Foremost Insurance Company",Geico:"Geico",GeneralCasualty:"General Casualty",GermantownMutual:"Germantown Mutual",GMAC:"GMAC",Grange:"Grange",Grinnell:"Grinnell",GuideOne:"Guide One",Hanover:"Hanover",Harleysville:"Harleysville",Hartford:"Hartford",HartfordOMNI:"Hartford OMNI",HawkeyeSecurity:"Hawkeye Security",HippoInsuranceCompany:"Hippo Insurance Company",HomeownersOfAmerica:"Homeowners of America",Homesite:"Homesite",HoraceMann:"Horace Mann",HoustonGeneral:"Houston General",Indiana:"Indiana",IndianaFarmers:"Indiana Farmers",Integrity:"Integrity",Kemper:"Kemper",LibertyMutual:"Liberty Mutual",LibertyNorthwest:"Liberty Northwest",Lloyds:"Lloyds",MainStreetAmerica:"Main Street America",MarkelInsuranceCompany:"Markel Insurance Company",MerchantsGroup:"Merchants Group",Mercury:"Mercury",Metlife:"MetLife",MidwesternIndemnity:"Midwestern Indemnity",Montgomery:"Montgomery",MSA:"MSA",MutualBenefit:"Mutual Benefit",Tower:"National General",NatGenPremier:"NatGen Premier",Nationwide:"Nationwide",NationwideScottsdale:"Nationwide-Scottsdale",NewYorkCentralMutual:"New York Central Mutual",NJSkylands:"NJ Skylands",Northstar:"Northstar",OhioCasualty:"Ohio Casualty",OneBeacon:"One Beacon",OregonMutual:"Oregon Mutual",PeerlessMontgomery:"Peerless/Montgomery",Pekin:"Pekin",PennNational:"Penn National",PlymouthRock:"Plymouth Rock",PreferredMutual:"Preferred Mutual",Prudential:"Prudential",PureHighValue:"Pure High Value",Republic:"Republic",RoyalAndSunAlliance:"Royal and Sun Alliance",Safeco:"Safeco",SECURA:"SECURA",SouthernMutual:"Southern Mutual",SouthernTrust:"Southern Trust",StPaulTravelers:"St. Paul/Travelers",StandardMutual:"Standard Mutual",StateAuto:"State Auto",StateFarm:"State Farm",StateFarmFloridaInsuranceCompany:"State Farm Florida Insurance Company",Fidelity:"Stillwater",SunshineStateInsuranceCompany:"Sunshine State Insurance Company",Travelers:"Travelers",TWFG:"TWFG",Unigard:"Unigard",UnitedFireAndCasualty:"United Fire and Casualty",Unitrin:"Unitrin",Universal:"Universal",USAA:"USAA",UticaNational:"Utica National",Wellington:"Wellington",WestBend:"West Bend",WesternNational:"Western National",WesternReserveGroup:"Western Reserve Group",Westfield:"Westfield",WhiteMountains:"White Mountains",WilsonMutual:"Wilson Mutual",Zurich:"Zurich",Other:"Other",OtherNonStandard:"Other Non-Standard",OtherStandard:"Other Standard"},jr={Business:"Business",Pleasure:"Pleasure",Farming:"Farming",To_FromWork:"To/From Work",To_FromSchool:"To/From School"},Qr={Dontknow:"Don't Know",ThirtyToSixty:"30/60",FiftyToHundred:"50/100",HundredToHundred:"100/100",HundredToThreeHundred:"100/300",TwoHundredFiftyToFiveHundred:"250/500",ThreeHundredToThreeHundred:"300/300",FiveHundredToFiveHundred:"500/500",HundredCSL:"100CSL",ThreeHundredCSL:"300CSL",FiveHundredCSL:"500CSL"},qr={ActiveMilitaryDuty:"Active Military Duty",DrivingCompanyCar:"Driving A Company Car",DrivingCarOwnedByRelative:"Driving A Car Owned By A Relative",HasNotOwnedOrOperatedVehicle:"Has Not Owned Or Operated A Vehicle",OwnedVehParkedStoredOffRoadNotDriven:"Owned Veh Parked/Stored Off Road/Not Driven",NonPayment:"Non-Payment",Other:"Other"},Xr={Dontknow:"Don't Know",cov30to60:"30/60",cov50to100:"50/100",cov100to100:"100/100",cov100to300:"100/300",cov250to500:"250/500",cov300to300:"300/300",cov500to500:"500/500",cov100CSL:"100 CSL",cov300CSL:"300 CSL",cov500CSL:"500 CSL"},zr={Reject:"Reject",cov30to60:"30/60",cov50to100:"50/100",cov100to100:"100/100",cov100to300:"100/300",cov250to500:"250/500",cov300to300:"300/300",cov500to500:"500/500",cov100CSL:"100 CSL",cov300CSL:"300 CSL",cov500CSL:"500 CSL"},Jr={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},Zr={None:"None",cov500:"500",cov1000:"1,000",cov2000:"2,000",cov2500:"2,500",cov5000:"5,000",cov10000:"10,000",cov15000:"15,000",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000"},et={NoCoverage:"No Coverage",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000"},rt={No_Coverage:"No Coverage",cov2500:"2,500",cov5000:"5,000",cov10000:"10,000",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000"},tt={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},qe={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",Thousand:"1,000",TwoThousand:"2,000"},nt={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},it={NoCoverage:"No Coverage",cov20to600:"20/600",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500"},Xe={NoHighSchoolDiploma:"No High School Diploma",HighSchoolDiploma:"High School Diploma",SomeCollegeNoDegree:"Some College - No Degree",VocationalTechnicalDegree:"Vocational Technical Degree",AssociatesDegree:"Associates Degree",Bachelors:"Bachelors",Masters:"Masters",Phd:"Phd",MedicalDegree:"Medical Degree",LawDegree:"Law Degree"},ze={"Agriclt/Forestry/Fish":"Agriculture/Forestry/Fishing","Art/Design/Media":"Art/Design/Media","Banking/Finance/RE":"Banking/Finance/Real Estate","Business/Sales/Offi":"Business/Sales/Office","Construct/EnrgyTrds":"Construction/Energy Trades",Disabled:"Disabled","Education/Library":"Education/Library","Engr/Archt/Sci/Math":"Engineer/Architect/Science/Math","Government/Military":"Government/Military","Homemaker/Houseprsn":"Homemaker/House person","Info Tech":"Information Technology",Insurance:"Insurance","Lgl/Law Enfcmt/Sec":"Legal/Law Enforcement/Security","Maint/Rpr/Hsekeep":"Maintenance/Repair/Housekeeping","Mfg/Production":"Manufacturing/Production","Med/Soc Svcs/Relig":"Medical/Social Services/Religion",Other:"Other","Person.Care/Service":"Personal Care/Service","Rest/Hotel Services":"Restaurant/Hotel Services",Retired:"Retired","Sports/Recreation":"Sports/Recreation",Student:"Student","Trvl/Trnsprt/Warehs":"Travel/Transportation/Warehousing",Unemployed:"Unemployed"},ot={"Agriclt/Forestry/Fish":["Agr Inspect/Grader","Arborist","Clerk","Equip. Operator","Farm/Ranch Owner","Farm/Ranch Worker","Fisherman","Florist","Laborer/Worker","Landscape/NursryWkr","Landscaper","Logger","Millworker","Other","Ranger","Supervisor","Timber Grader/Scale"],"Art/Design/Media":["Actor","Admin Assist","Announcer/Broadcstr","Artist/Animator","Author/Writer","Choreography/Dancer","Clerk","Composer/Director","Curator","Designer","Editor","Journalist/Reporter","Musician/Singer","Other","Printer","Producer","Production Crew","Projectionist","Receptionist/Sec","Ticket Sales/Usher"],"Banking/Finance/RE":["Accountant/Auditor","Admin Assist","Analyst/Broker","Bookkeeper","Branch Manager","Clerk","Collections","Consultant","Controller","CSR/Teller","Director/Administr","Executive","Financial Advisor","Investment Banker","Investor","Loan/EscrowProcess","Mgr-Credit/Loan","Mgr-Portfolio/Prod.","Mgr-Property","Other","Realtor","Receptionist/Sec","SalesAgt/Represent.","Trader,Finan Instru","Underwriter"],"Business/Sales/Offi":["Account Executive","Admin Assist","Buyer","Clerk-Office","Consultant","CSR","Director/Administr","Executive","H.R. Representative","Marketing Researchr","Messenger/Courier","Mgr - District","Mgr - Finance","Mgr-Dept/Store","Mgr-General Opers","Mgr-H.R./PublicRel","Mgr-Mkt/Sales","Mgr/Supervisr-Offic","Other","Receptionist/Sec","Sales-Counter/Rentl","Sales-Home Based","Sales-Mfg Rep","Sales-Retail/Whlsle","Sales-Route/Vendor"],"Construct/EnrgyTrds":["Boiler Oper/Maker","Bricklayer/Mason","Carpenter","Carpet Installer","Concrete Worker","Constrct Proj Mgr","Contractor","Crane Operator","Electrician/Linesmn","ElevatorTech/Instl","Equip. Operator","FloorLayer/Finisher","Foreman/Supervisor","Handyman","Heat/Air Technician","Inspector","Laborer/Worker","Metalworker","Miner","Oil/GasDril/RigOpr","Other","Painter","Plstr/Drywall/Stuc","Plumber","Roofer"],Disabled:["Disabled"],"Education/Library":["Admin Assist","Audio-Visual Tech.","Child/DayCare Wrker","Clerk","Counselor","Grad. Teaching/Asst","Instructor-Vocation","Librarian/Curator","Other","Professor, College","Receptionist/Sec","Superintendent","Teacher, College","Teacher, K-12","Teaching Asst/Aide","Tutor"],"Engr/Archt/Sci/Math":["Actuary","Admin Assist","Analyst","Architect","Clerk","Clinical Data Coord.","Drafter","Engineer","Manager-Project","Manager-R&D","Mathematician","Other","Receptionist/Sec","Research Prog. Dir.","Researcher","Scientist","Sociologist","Surveyor/Mapmaker","Technician"],"Government/Military":["Accountant/Auditor","Admin Assist","Analyst","Attorney","Chief Executive","Clerk","Commissioner","Council member","Director/Administr","Enlst Mil Prsnl E1-4","Legislator","Mayor/City Manager","Meter Reader","NCO (E5-9)","Officer-Commissiond","Officer-Warrant","Other","Park Ranger","Planner","Postmaster","Receptionist/Sec","Regulator","US Postal Worker"],"Homemaker/Houseprsn":["Homemaker/Houseprsn"],"Info Tech":["Admin Assist","Analyst","Clerk","Director/Administr","Engineer-Hardware","Engineer-Software","Engineer-Systems","Executive","Manager-Systems","Network Admin","Other","Programmer","Project Coordinator","Receptionist/Sec","Support Technician","Systems Security","Technical Writer","Web Developer"],Insurance:["Accountant/Auditor","Actuarial Clerk","Actuary","Admin Assist","Agent/Broker","Analyst","Attorney","Claims Adjuster","Clerk","Commissioner","CSR","Director/Administr","Executive","Other","Product Manager","Receptionist/Sec","Sales Rep","Underwriter"],"Lgl/Law Enfcmt/Sec":["Airport Sec Ofcr","Animal Control Ofcr","Attorney","Bailiff","Corrections Officer","Court Clrk/Reporter","Deputy Sheriff","Dispatcher","Examiner","Fed Agt/Marshall","Fire Chief","Fire Fighter/Supv.","Gaming Ofcr/Invest","Highway Patrol Ofcr","Judge/Hearing Ofcr","Legal Asst./Sec","Other","Paralegal/Law Clerk","Police Chief","Police Det/Investgr","Police Offcr/Supvr","Process Server","Prvt Invest/Detec.","Security Guard","Sheriff"],"Maint/Rpr/Hsekeep":["Bldg Maint Engineer","Custodian/Janitor","Electrician","Field Service Tech.","Handyman","Heat/AirCond Repair","Housekeeper/Maid","Lndscpe/Grnds Maint","Maint Mechanic","Mechanic","Other"],"Mfg/Production":["Admin Assist","Clerk","Factory Worker","Foreman/Supervisor","Furniture Finisher","Inspector","Jeweler","Machine Operator","Other","Packer","Plant Manager","Printer/Bookbinder","Quality Control","Receptionist/Sec","Refining Operator","Shoemaker","Tailor/Custom Sewer","Textile Worker","Upholsterer"],"Med/Soc Svcs/Relig":["Admin Assist","Assist-Med/Dent/Vet","Clergy","Clerk","Client Care Worker","Dental Hygenist","Dentist","Doctor","Hospice Volunteer","Mortician","Nurse - C.N.A.","Nurse - LPN","Nurse - RN","Nurse Practitioner","Optometrist","Other","Paramedic/EM Tech","Pharmacist","Receptionist/Sec","Social Worker","Support Services","Technician","Therapist","Veterinarian"],Other:["Other"],"Person.Care/Service":["Caregiver","Dry Cleaner/Laundry","Hair Stylist/Barber","Housekeeper","Manicurist","Masseuse","Nanny","Other","Pet Services","Receptionist/Sec"],"Rest/Hotel Services":["Baker","Bartender","Bellhop","Bus Person","Caterer","Chef","Concessionaire","Concierge","Cook-Rest/Cafeteria","Cook/Wrkr-Fast Food","Delivery Person","Desk Clerk","Dishwasher","Food Prod/Packing","Host/Maitre d","Housekeeper/Maid","Manager","Other","Valet","Waiter/Waitress","Wine Steward"],Retired:["Retired"],"Sports/Recreation":["Activity/Recre.Asst","Admin Assist","Agent","Athlete","CampCounselor/Lead","Clerk","Coach","Concessionaire","Director, Program","Event Mgr/Promoter","Life Guard","Mgr - Fitness Club","Other","Park Ranger","Receptionist/Sec","Sales-Tkt/Mmbrshp","SportsBrdcstr/Journ","Trainer/Instructor","Umpire/Referee"],Student:["Graduate Student","High school","Other","Undergraduate"],"Trvl/Trnsprt/Warehs":["Admin Assist","Air Traffic Control","Airport Ops Crew","Bellhop/Porter","Clerk","Crane Loader/Oper","Dispatcher","Driver-Bus/Strcar","Driver-Taxi/Limo","Driver-Truck/Delvry","Flight Attendant","Forklift Operator","Laborer","Longshoreman","Mate/Sailor","Mgr Warehse/Dist","Other","Parking Lot Attend","Pilot/Capt/Eng","Railroad Worker","Receptionist/Sec","Shipping/RecClk","Subway/LgtRail Oper","Ticket Agent","Transportation Spec"],Unemployed:["Unemployed"]},Je={"Agr Inspect/Grader":"Agriculture Inspector/Grader",Arborist:"Arborist",Clerk:"Clerk","Equip. Operator":"Equipment Operator","Farm/Ranch Owner":"Farm/Ranch Owner","Farm/Ranch Worker":"Farm/Ranch Worker",Fisherman:"Fisherman",Florist:"Florist","Laborer/Worker":"Laborer/Worker","Landscape/NursryWkr":"Landscaper/Nursery Worker",Landscaper:"Landscaper",Logger:"Logger",Millworker:"Mill worker",Other:"Other",Ranger:"Ranger",Supervisor:"Supervisor","Timber Grader/Scale":"Timber Grader/Scale",Actor:"Actor","Admin Assist":"Administrative Assistant","Announcer/Broadcstr":"Announcer/Broadcaster","Artist/Animator":"Artist/Animator","Author/Writer":"Author/Writer","Choreography/Dancer":"Choreography/Dancer","Composer/Director":"Composer/Director",Curator:"Curator",Designer:"Designer",Editor:"Editor","Journalist/Reporter":"Journalist/Reporter","Musician/Singer":"Musician/Singer",Printer:"Printer",Producer:"Producer","Production Crew":"Production Crew",Projectionist:"Projectionist","Receptionist/Sec":"Receptionist/Secretary","Ticket Sales/Usher":"Ticket Sales/Usher","Accountant/Auditor":"Accountant/Auditor","Analyst/Broker":"Analyst/Broker",Bookkeeper:"Bookkeeper","Branch Manager":"Branch Manager",Collections:"Collections",Consultant:"Consultant",Controller:"Controller","CSR/Teller":"CSR/Teller","Director/Administr":"Director/Administrator",Executive:"Executive","Financial Advisor":"Financial Advisor","Investment Banker":"Investment Banker",Investor:"Investor","Loan/EscrowProcess":"Loan/Escrow Processor","Mgr-Credit/Loan":"Manager-Credit/Loan","Mgr-Portfolio/Prod.":"Manager-Portfolio/Production","Mgr-Property":"Manager-Property",Realtor:"Realtor","SalesAgt/Represent.":"Sales Agent/Representative","Trader,Finan Instru":"Trader, Financial Instruments",Underwriter:"Underwriter","Account Executive":"Account Executive",Buyer:"Buyer","Clerk-Office":"Clerk-Office",CSR:"Customer Service Representative","H.R. Representative":"H.R. Representative","Marketing Researchr":"Marketing Researcher","Messenger/Courier":"Messenger/Courier","Mgr - District":"Manager - District","Mgr - Finance":"Manager - Finance","Mgr-Dept/Store":"Manager - Department/Store","Mgr-General Opers":"Manager - General Operations","Mgr-H.R./PublicRel":"Manager - H.R./Public Relations","Mgr-Mkt/Sales":"Manager - Marketing/Sales","Mgr/Supervisr-Offic":"Manager/Supervisor - Office","Sales-Counter/Rentl":"Sales-Counter/Rental","Sales-Home Based":"Sales-Home Based","Sales-Mfg Rep":"Sales-Manufacture Rep","Sales-Retail/Whlsle":"Sales-Retail/Wholesale","Sales-Route/Vendor":"Sales-Route/Vendor","Boiler Oper/Maker":"Boiler Operator/Maker","Bricklayer/Mason":"Bricklayer/Mason",Carpenter:"Carpenter","Carpet Installer":"Carpet Installer","Concrete Worker":"Concrete Worker","Constrct Proj Mgr":"Construction - Project Manager",Contractor:"Contractor","Crane Operator":"Crane Operator","Electrician/Linesmn":"Electrician/Linesman","ElevatorTech/Instl":"Elevator Technician/Installer","FloorLayer/Finisher":"Floor Layer/Finisher","Foreman/Supervisor":"Foreman/Supervisor",Handyman:"Handyman","Heat/Air Technician":"Heat/Air Technician",Inspector:"Inspector",Metalworker:"Metalworker",Miner:"Miner","Oil/GasDril/RigOpr":"Oil/Gas Driller/Rig Operator",Painter:"Painter","Plstr/Drywall/Stuc":"Plaster/Drywall/Stucco",Plumber:"Plumber",Roofer:"Roofer",Disabled:"Disabled","Audio-Visual Tech.":"Audio-Visual Tech.","Child/DayCare Wrker":"Child/Daycare Worker",Counselor:"Counselor","Grad. Teaching/Asst":"Graduate Teaching Assistant","Instructor-Vocation":"Instructor-Vocation","Librarian/Curator":"Librarian/Curator","Professor, College":"Professor, College",Superintendent:"Superintendent","Teacher, College":"Teacher, College","Teacher, K-12":"Teacher, K-12","Teaching Asst/Aide":"Teaching Assistant/Aide",Tutor:"Tutor",Actuary:"Actuary",Analyst:"Analyst",Architect:"Architect","Clinical Data Coord.":"Clinical Data Coordinator",Drafter:"Drafter",Engineer:"Engineer","Manager-Project":"Manager-Project","Manager-R&D":"Manager-R&D",Mathematician:"Mathematician","Research Prog. Dir.":"Research Program Director",Researcher:"Researcher",Scientist:"Scientist",Sociologist:"Sociologist","Surveyor/Mapmaker":"Surveyor/Mapmaker",Technician:"Technician",Attorney:"Attorney","Chief Executive":"Chief Executive",Commissioner:"Commissioner","Council member":"Council member","Enlst Mil Prsnl E1-4":"Enlisted Military Personnel (E1-4)",Legislator:"Legislator","Mayor/City Manager":"Mayor/City Manager","Meter Reader":"Meter Reader","NCO (E5-9)":"NCO (E5-9)","Officer-Commissiond":"Officer-Commissioned","Officer-Warrant":"Officer-Warrant","Park Ranger":"Park Ranger",Planner:"Planner",Postmaster:"Postmaster",Regulator:"Regulator","US Postal Worker":"US Postal Worker","Homemaker/Houseprsn":"Homemaker/House person","Engineer-Hardware":"Engineer-Hardware","Engineer-Software":"Engineer-Software","Engineer-Systems":"Engineer-Systems","Manager-Systems":"Manager-Systems","Network Admin":"Network Administrator",Programmer:"Programmer","Project Coordinator":"Project Coordinator","Support Technician":"Support Technician","Systems Security":"Systems Security","Technical Writer":"Technical Writer","Web Developer":"Web Developer","Actuarial Clerk":"Actuarial Clerk","Agent/Broker":"Agent/Broker","Claims Adjuster":"Claims Adjuster","Product Manager":"Product Manager","Sales Rep":"Sales Representative","Airport Sec Ofcr":"Airport Security Officer","Animal Control Ofcr":"Animal Control Officer",Bailiff:"Bailiff","Corrections Officer":"Corrections Officer","Court Clrk/Reporter":"Court Clerk/Reporter","Deputy Sheriff":"Deputy Sheriff",Dispatcher:"Dispatcher",Examiner:"Examiner","Fed Agt/Marshall":"Federal Agent/Marshall","Fire Chief":"Fire Chief","Fire Fighter/Supv.":"Fire Fighter/Supervisor","Gaming Ofcr/Invest":"Gaming Officer/Investigator","Highway Patrol Ofcr":"Highway Patrol Officer","Judge/Hearing Ofcr":"Judge/Hearing Officer","Legal Asst./Sec":"Legal Assistant/Secretary","Paralegal/Law Clerk":"Paralegal/Law Clerk","Police Chief":"Police Chief","Police Det/Investgr":"Police Detective/Investigator","Police Offcr/Supvr":"Police Officer/Supervisor","Process Server":"Process Server","Prvt Invest/Detec.":"Private Investigator/Detective","Security Guard":"Security Guard",Sheriff:"Sheriff","Bldg Maint Engineer":"Building Maintenance Engineer","Custodian/Janitor":"Custodian/Janitor",Electrician:"Electrician","Field Service Tech.":"Field Service Technician","Heat/AirCond Repair":"Heat/Air Conditioner Repairman","Housekeeper/Maid":"Housekeeper/Maid","Lndscpe/Grnds Maint":"Landscape/Grounds Maintenance","Maint Mechanic":"Maintenance Mechanic",Mechanic:"Mechanic","Factory Worker":"Factory Worker","Furniture Finisher":"Furniture Finisher",Jeweler:"Jeweler","Machine Operator":"Machine Operator",Packer:"Packer","Plant Manager":"Plant Manager","Printer/Bookbinder":"Printer/Bookbinder","Quality Control":"Quality Control","Refining Operator":"Refining Operator",Shoemaker:"Shoemaker","Tailor/Custom Sewer":"Tailor/Custom Sewer","Textile Worker":"Textile Worker",Upholsterer:"Upholsterer","Assist-Med/Dent/Vet":"Assistant - Medic/Dent/Vet",Clergy:"Clergy","Client Care Worker":"Client Care Worker","Dental Hygenist":"Dental Hygienist",Dentist:"Dentist",Doctor:"Doctor","Hospice Volunteer":"Hospice Volunteer",Mortician:"Mortician","Nurse - C.N.A.":"Nurse - C.N.A.","Nurse - LPN":"Nurse - LPN","Nurse - RN":"Nurse - RN","Nurse Practitioner":"Nurse Practitioner",Optometrist:"Optometrist","Paramedic/EM Tech":"Paramedic/E.M. Technician",Pharmacist:"Pharmacist","Social Worker":"Social Worker","Support Services":"Support Services",Therapist:"Therapist",Veterinarian:"Veterinarian",Caregiver:"Caregiver","Dry Cleaner/Laundry":"Dry Cleaner/Laundry","Hair Stylist/Barber":"Hair Stylist/Barber",Housekeeper:"Housekeeper",Manicurist:"Manicurist",Masseuse:"Masseuse",Nanny:"Nanny","Pet Services":"Pet Services",Baker:"Baker",Bartender:"Bartender",Bellhop:"Bellhop","Bus Person":"Bus Person",Caterer:"Caterer",Chef:"Chef",Concessionaire:"Concessionaire",Concierge:"Concierge","Cook-Rest/Cafeteria":"Cook - Restaurant/Cafeteria","Cook/Wrkr-Fast Food":"Cook/Worker-Fast Food","Delivery Person":"Delivery Person","Desk Clerk":"Desk Clerk",Dishwasher:"Dishwasher","Food Prod/Packing":"Food Production/Packing","Host/Maitre d":"Host/Maitre d",Manager:"Manager",Valet:"Valet","Waiter/Waitress":"Waiter/Waitress","Wine Steward":"Wine Steward",Retired:"Retired","Activity/Recre.Asst":"Activity/Recreational Assistant",Agent:"Agent",Athlete:"Athlete","CampCounselor/Lead":"Camp Counselor/Lead",Coach:"Coach","Director, Program":"Director, Program","Event Mgr/Promoter":"Event Manager/Promoter","Life Guard":"Life Guard","Mgr - Fitness Club":"Manager - Fitness Club","Sales-Tkt/Mmbrshp":"Sales-Ticket/Membership","SportsBrdcstr/Journ":"Sports Broadcaster/Journalist","Trainer/Instructor":"Trainer/Instructor","Umpire/Referee":"Umpire/Referee","Graduate Student":"Graduate Student","High school":"High school",Undergraduate:"Undergraduate","Air Traffic Control":"Air Traffic Control","Airport Ops Crew":"Airport Operations Crew","Bellhop/Porter":"Bellhop/Porter","Crane Loader/Oper":"Crane Loader/Operator","Driver-Bus/Strcar":"Driver - Bus/Streetcar","Driver-Taxi/Limo":"Driver-Taxi/Limo","Driver-Truck/Delvry":"Driver-Truck/Delivery","Flight Attendant":"Flight Attendant","Forklift Operator":"Forklift Operator",Laborer:"Laborer",Longshoreman:"Longshoreman","Mate/Sailor":"Mate/Sailor","Mgr Warehse/Dist":"Manager - Warehouse/District","Parking Lot Attend":"Parking Lot Attendant","Pilot/Capt/Eng":"Pilot/Captain/Engineer","Railroad Worker":"Railroad Worker","Shipping/RecClk":"Shipping/Receiving Clerk","Subway/LgtRail Oper":"Subway/Light Rail Operator","Ticket Agent":"Ticket Agent","Transportation Spec":"Transportation Specialist",Unemployed:"Unemployed"};function Te(r,e){if(typeof r!="string")return r;const t=r.trim();if(!t)return r;if(e[t])return t;const i=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===i||e[s]?.toLowerCase()===i)??r}function Oe(r){return Te(r,ze)}function Ze(r){return Te(r,Xe)}function er(r){return Te(r,Je)}function at(r){return r.trim().toLowerCase()}function rr(r){if(typeof r!="string")return null;const e=r.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!e)return null;const t=Number(e[1]),i=Number(e[2]),a=Number(e[3]);if(!Number.isFinite(t)||!Number.isFinite(i)||!Number.isFinite(a)||i<1||i>12||a<1||a>31)return null;const s=new Date(Date.UTC(t,i-1,a));return s.getUTCFullYear()!==t||s.getUTCMonth()!==i-1||s.getUTCDate()!==a?null:s.getTime()}function Ie(r){let e=null,t=null,i=null;const a=new Set,s=new Set;return r.forEach(c=>{const n=String(c.key??""),l=at(String(c.question??""));(n==="auto_prior_carrier_name"||l.includes("current auto insurance company"))&&(e=n),(n==="effective_date"||l.includes("when do you need your insurance to begin"))&&(t=n),(n==="auto_prior_expiration_date"||l.includes("when does the current policy expire"))&&(i=n),(n==="auto_reason_for_no_insurance"||l.includes("reason you are not currently insured"))&&a.add(n),(n==="auto_prior_years"||n==="auto_prior_months"||n==="auto_continuous_coverage_years"||n==="auto_prior_expiration_date"||n==="auto_current_annual_premium_cents"||n==="auto_prior_liability_limit")&&s.add(n)}),{currentCarrierKey:e,effectiveDateKey:t,expirationDateKey:i,noInsuranceReasonKeys:a,hideWhenNoPriorInsuranceKeys:s}}function de(r,e){if((e.currentCarrierKey?r[e.currentCarrierKey]:void 0)==="NoPriorInsurance")return!0;if(!e.effectiveDateKey||!e.expirationDateKey)return!1;const i=rr(r[e.expirationDateKey]),a=rr(r[e.effectiveDateKey]);return i==null||a==null?!1:i<a}function Le(r,e,t){const i=String(r.key??""),s=(t.currentCarrierKey?e[t.currentCarrierKey]:void 0)==="NoPriorInsurance";return s&&t.hideWhenNoPriorInsuranceKeys.has(i)?!1:!t.noInsuranceReasonKeys.has(i)||s?!0:de(e,t)}function he(r,e){const t=String(r.key??"");return e.noInsuranceReasonKeys.has(t)}const st=["ACURA","ALFA ROMEO","ASTON MARTIN","AUDI","BENTLEY","BMW","BUGATTI","BUICK","CADILLAC","CHEVROLET","CHRYSLER","CRUISE","DODGE","FERRARI","FIAT","FORD","FREIGHTLINER","GENESIS","GLOBAL ELECTRIC MOTORS","GMC","HONDA","HYUNDAI","INFINITI","JAGUAR","JEEP","KARMA AUTOMOTIVE","KIA","LAMBORGHINI","LAND ROVER","LEXUS","LINCOLN","LOTUS","MASERATI","MAZDA","MCLAREN AUTOMOTIVE","MERCEDES-BENZ","MINI","MITSUBISHI","NISSAN","POLESTAR","PORSCHE","RAM","ROLLS-ROYCE","SUBARU","TESLA","TOYOTA","VOLKSWAGEN","VOLVO"],tr={2020:{TOYOTA:["CAMRY LE","CAMRY SE","COROLLA LE","COROLLA SE","RAV4 LE","HIGHLANDER LE","TACOMA SR5","PRIUS LE"],FORD:["F-150 XL","F-150 XLT","ESCAPE SE","EXPLORER XLT","MUSTANG GT","EDGE SEL","FUSION SE"],CHEVROLET:["SILVERADO 1500 WT","EQUINOX LS","MALIBU LT","TRAVERSE LS","TAHOE LS","BOLT EV LT"],NISSAN:["ALTIMA S","SENTRA S","ROGUE S","FRONTIER S","MAXIMA SV","PATHFINDER S"],HONDA:["ACCORD EX","ACCORD EXL","ACCORD HYBRID","ACCORD HYBRID EX","ACCORD HYBRID EXL","ACCORD LX","ACCORD SPORT","ACCORD TOURING","ACCORD TOURING HYBRID","CIVIC EX","CIVIC EXL","CIVIC LX","CIVIC SI","CIVIC SPORT","CIVIC SPORT TOURING","CIVIC TOURING","CIVIC TYPE-R","CIVIC TYPE-R TOURING","CLARITY","CLARITY TOURING","CR-V EX","CR-V EXL","CR-V LX","CR-V SPORT","CR-V TOURING","FIT EX","FIT EXL","FIT LX","FIT SPORT","HR-V EX","HR-V EXL","HR-V LX","HR-V SPORT","HR-V TOURING","INSIGHT EX","INSIGHT LX","INSIGHT TOURING","ODYSSEY ELITE","ODYSSEY EX","ODYSSEY EXL","ODYSSEY LX","ODYSSEY TOURING","PASSPORT ELITE","PASSPORT EXL","PASSPORT SPORT","PASSPORT TOURING","PILOT BLACK","PILOT ELITE","PILOT EX","PILOT EXL","PILOT LX","PILOT TOURING","RIDGELINE BLACK EDITION","RIDGELINE RTL","RIDGELINE SPORT"]}},nr={2020:{TOYOTA:{"CAMRY LE":["SEDAN 4 Door"],"CAMRY SE":["SEDAN 4 Door"],"COROLLA LE":["SEDAN 4 Door"],"COROLLA SE":["SEDAN 4 Door"],"RAV4 LE":["SUV 4 Door"],"HIGHLANDER LE":["SUV 4 Door"],"TACOMA SR5":["PICKUP 4 Door"],"PRIUS LE":["HATCHBACK 4 Door"]},FORD:{"F-150 XL":["PICKUP 4 Door"],"F-150 XLT":["PICKUP 4 Door"],"ESCAPE SE":["SUV 4 Door"],"EXPLORER XLT":["SUV 4 Door"],"MUSTANG GT":["COUPE 2 Door"],"EDGE SEL":["SUV 4 Door"],"FUSION SE":["SEDAN 4 Door"]},CHEVROLET:{"SILVERADO 1500 WT":["PICKUP 4 Door"],"EQUINOX LS":["SUV 4 Door"],"MALIBU LT":["SEDAN 4 Door"],"TRAVERSE LS":["SUV 4 Door"],"TAHOE LS":["SUV 4 Door"],"BOLT EV LT":["HATCHBACK 4 Door"]},NISSAN:{"ALTIMA S":["SEDAN 4 Door"],"SENTRA S":["SEDAN 4 Door"],"ROGUE S":["SUV 4 Door"],"FRONTIER S":["PICKUP 4 Door"],"MAXIMA SV":["SEDAN 4 Door"],"PATHFINDER S":["SUV 4 Door"]},HONDA:{"ACCORD EX":["SEDAN 4 Front 4L DOHC 16V"]}}};function De(r){return String(r??"").trim().toUpperCase()}function ge(r,e){if(!(!e||!r))return e[r]!==void 0?r:Object.keys(e).find(t=>t.toUpperCase()===r)}function lt(r){return Object.keys(r).map(e=>Number(e)).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t)}function ir(r,e,t){const i=r[e],a=ge(t,i),s=a?i?.[a]:void 0;return!!(s&&s.length>0)}function ct(r,e,t){if(ir(t,r,e))return r;const i=lt(t),a=Number(r);if(!Number.isFinite(a)||i.length===0)return;let s,c=1/0;for(const n of i){const l=String(n);if(!ir(t,l,e))continue;const _=Math.abs(n-a);_<c&&(c=_,s=l)}return s}function Pe(r,e,t,i){const a=i[r],s=ge(e,a);if(!s)return;const c=a?.[s],n=ge(t,c);if(!n)return;const l=c?.[n];return l&&l.length>0?l:void 0}function ut(r,e,t,i){if(Pe(r,e,t,i))return r;const a=Object.keys(i).map(l=>Number(l)).filter(l=>Number.isFinite(l)).sort((l,_)=>l-_),s=Number(r);if(!Number.isFinite(s)||a.length===0)return;let c,n=1/0;for(const l of a){const _=String(l);if(!Pe(_,e,t,i))continue;const d=Math.abs(l-s);d<n&&(n=d,c=_)}return c}function dt(r,e){const t=String(r??"").trim(),i=De(e);if(!t||!i)return[];const a=ct(t,i,tr);if(!a)return[];const s=tr[a],c=ge(i,s);return c?[...s[c]??[]]:[]}function ft(r,e,t){const i=String(r??"").trim(),a=De(e),s=De(t);if(!i||!a||!s)return[];const c=ut(i,a,s,nr);if(!c)return[];const n=Pe(c,a,s,nr);return n?[...n]:[]}const _t={None:"None","30000/60000/25000":"30/60k","30000/60000/30000":"30/60k","50000/100000/30000":"50/100k","50000/100000/50000":"50/100k","100000/300000/50000":"100/300k","100000/300000/100000":"100/300k","250000/500000/100000":"250/500k","250000/500000/250000":"250/500k","300000/500000/250000":"300/500k","300000/500000/300000":"300/500k","500000/500000/300000":"500k CSL","500000/500000/500000":"500k CSL","500000/1000000/300000":"500k/1M","500000/1000000/500000":"500k/1M"},pt={auto_prior_carrier_name:Vr,auto_prior_liability_limit:Qr,auto_reason_for_no_insurance:qr,residence_type:Yr,home_prior_carrier_name:Kr,policy_bi:Xr,policy_um:zr,policy_pd:Jr,policy_mp:Zr,policy_umpd:et,policy_pip:rt,policy_auto_death_indemnity:tt,vehicle_comp_deductible:qe,vehicle_coll_deductible:qe,vehicle_towing_and_labor:nt,vehicle_transportation_expense:it,education_level:Xe,industry:ze,occupation:Je,usage:jr},mt=["OTHER / NOT LISTED"],ht=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],gt=["Other"];function or(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${i}`}function yt(r){const e=r.replace(/\D+/g,"");if(e!=="")return Wr(e)}function vt(r){return r==="-"||r==="+"||r==="."||r==="e"||r==="E"}function St(r){if(r!=="effective_date")return;const e=new Date;return e.setDate(e.getDate()+1),or(e)}function ye(r){return r.inputType!=="radio"||!r.options||r.options.length!==1||r.options[0]!=="Yes"?!1:(r.conditionals??[]).some(t=>t.conditionalQuestionsAllowMultiple&&t.conditionalType==="equals"&&t.conditionalValue==="Yes")}function ar(r,e){return ye(r)?"Yes":e}function sr(r){return typeof r=="number"&&Number.isFinite(r)?r:typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r))?Number(r):null}function lr(r){if(r instanceof Date&&!Number.isNaN(r.getTime()))return r.getTime();if(typeof r=="string"){const e=Date.parse(r);return Number.isNaN(e)?null:e}return null}function cr(r,e){const t=sr(r),i=sr(e);if(t!=null&&i!=null)return t-i;const a=lr(r),s=lr(e);return a!=null&&s!=null?a-s:r==null||e==null?null:String(r).localeCompare(String(e))}function Ct(r,e){return Array.isArray(r)?r.some(t=>t===e):typeof r=="string"?e!=null&&r.includes(String(e)):!1}function fe(r,e,t){switch(e){case"equals":return r===t;case"lessThan":{const i=cr(r,t);return i!=null&&i<0}case"greaterThan":{const i=cr(r,t);return i!=null&&i>0}case"contains":return Ct(r,t);case"startsWith":return r!=null&&t!=null&&String(r).startsWith(String(t));case"endsWith":return r!=null&&t!=null&&String(r).endsWith(String(t));default:return!1}}function Re(r,e){return e.reduce((t,i)=>t?.[i],r)}function te(r,e,t){if(e.length===0)return r;const[i,...a]=e;if(a.length===0){if(typeof i=="number"){const _=(Array.isArray(r)?r:[]).slice();return _[i]=t,_}return{...r,[i]:t}}const s=r?.[i],c=typeof a[0]=="number"?Array.isArray(s)?s:[]:s&&typeof s=="object"?s:{},n=te(c,a,t);if(typeof i=="number"){const _=(Array.isArray(r)?r:[]).slice();return _[i]=n,_}return{...r,[i]:n}}function j(r,e,t){return Re(r,[...e??[],t])}function J(r,e,t,i){return te(r,[...e??[],t],i)}function At(r,e){return r?.length?`${r.join("-")}-${e}`:e}const bt="__items",ve=r=>`${r}${bt}`;function Et(r){const e=(t,i)=>t.map((a,s)=>{const c=i.length?i.join("__"):"root",n=a.key??`${c}__q${s}_${String(a.question).slice(0,24).replace(/\W+/g,"-")||"field"}`,_=(a.conditionals??[]).map((d,S)=>{const y=d.conditionalQuestions?e(d.conditionalQuestions,[...i,`${n}__c${S}`]):void 0;return{...d,conditionalQuestions:y}});return{...a,key:n,conditionals:_}});return e(r,[])}function ne(r){return r==null?"":typeof r=="string"?r:String(r)}function kt(r){return r==null?"":typeof r=="number"&&Number.isFinite(r)||typeof r=="string"?r:""}function Mt(r){return r==null?"":typeof r=="string"||typeof r=="number"?r:String(r)}function Nt({questions:r,initialValues:e,controlledValues:t,onChangeValues:i,onSubmit:a}){const s=g.useMemo(()=>Et(r),[r]),c=g.useMemo(()=>Ie(s),[s]),n=g.useMemo(()=>{const v={};return e&&Object.assign(v,e),v},[e]),[l,_]=g.useState(n);g.useEffect(()=>{_(n)},[n]);const[d,S]=g.useState({}),y=g.useMemo(()=>({...d,...t??l}),[d,t,l]);g.useEffect(()=>{t&&S(v=>({...v,...t}))},[t]);const[b,w]=g.useState({});g.useEffect(()=>{let v=y,f=!1;s.forEach(u=>{if(!ye(u))return;const E=String(u.key);j(v,void 0,E)!=="Yes"&&(v=J(v,void 0,E,"Yes"),f=!0)}),f&&(t&&i?i(v):_(v),S(v))},[s,y,t,i]);function G(v,f){const u=v.key;if(u==="relationship_to_insured"&&f){const m=f[f.length-1];if(typeof m=="number"&&m===0)return null}const E=v.question,h=j(y,f,u),M=he(v,c)?de(y,c):v.required,N=b[u],D=m=>{let L=J(y,f,u,m);if(v.inputType==="radio"&&v.conditionals){const p=v.conditionals??[];for(const k of p){const C=j(y,f,u),A=fe(C,k.conditionalType,k.conditionalValue),T=fe(m,k.conditionalType,k.conditionalValue);if(A&&!T&&k.conditionalQuestionsAllowMultiple){const H=k.conditionalQuestions??[];if(H.length>0){const R=ve(u);L=te(L,[...f??[],R],[]);const $=(F,P)=>{F.forEach(x=>{(x.conditionals??[]).forEach(U=>{if(U.conditionalQuestionsAllowMultiple){const X=ve(x.key);L=te(L,[...P,X],[])}const Y=U.conditionalQuestions??[];Y.length>0&&$(Y,P)})})};$(H,[...f??[],R])}}}}t&&i?i(L):_(L),S(L)};if(u==="driver_vehicle_assignments"){const m=y.vehicles__items??[],L=y.drivers__items??[];if(m.length===0||L.length===0)return o.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},u);const p=y.driver_vehicle_assignments??{},k=(A,T,H)=>{const R={...p},$=`v${A}`;R[$]={...R[$]??{}},R[$][`d${T}`]=H,D(R)},C=A=>{if(L.length<2)return null;const T=p[`v${A}`];if(!T)return null;const H=L.map((F,P)=>T[`d${P}`]??0),R=H.filter(F=>F>0);if(R.length>=2&&R.every(F=>F===R[0])&&R[0]===50)return`Assignments for Vehicle ${A+1} cannot be 50 percent for both Drivers.`;const $=H.reduce((F,P)=>F+P,0);return $>0&&$!==100?`Driver percentages for this vehicle must add up to 100% (currently ${$}%).`:null};return o.jsxs("div",{children:[o.jsx("h4",{style:{marginBottom:"12px"},children:E}),m.map((A,T)=>{const H=[A.year,A.make,A.model].filter(Boolean).join(" ")||`Vehicle ${T+1}`,R=C(T);return o.jsxs("fieldset",{style:{border:`1px solid ${R?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[o.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:H}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:L.map(($,F)=>{const P=[$.first_name,$.last_name].filter(Boolean).join(" ")||`Driver ${F+1}`,x=p[`v${T}`]?.[`d${F}`];return o.jsx("div",{style:{flex:"0 0 140px"},children:o.jsx(Ke,{id:`assignment-v${T}-d${F}`,label:`${P} %`,value:x??"",min:0,max:100,step:1,inputMode:"numeric",onChange:V=>{const U=V.currentTarget.value.replace(/\D+/g,"");k(T,F,U===""?0:Math.min(100,parseInt(U,10)))}})},`${T}-${F}`)})}),R&&o.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:R})]},T)})]},u)}switch(v.inputType){case"text":return o.jsx(Tr,{id:u,label:E,value:ne(h),onChange:m=>D(m.currentTarget.value),"aria-required":M||void 0,error:N},u);case"email":return o.jsx(Or,{id:u,label:E,value:ne(h),onChange:m=>D(m.currentTarget.value),"aria-required":M||void 0,error:N},u);case"password":return o.jsx(Dr,{id:u,label:E,value:ne(h),onChange:m=>D(m.currentTarget.value),"aria-required":M||void 0,error:N},u);case"tel":return o.jsxs(o.Fragment,{children:[o.jsx(Ir,{id:u,label:E,value:ne(h),onChange:m=>D(m.currentTarget.value),"aria-required":M||void 0,error:N},u),u==="phone"&&o.jsxs("div",{className:"mt-3 text-xs text-slate-600 space-y-1",children:[o.jsx("p",{children:"By entering your phone number, you agree to receive a one-time SMS from Credify Insurance with a verification code."}),o.jsx("p",{children:"Message & data rates may apply. One message per request."}),o.jsxs("p",{children:["See our"," ",o.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","and"," ",o.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Terms of Service"}),"."]})]})]});case"url":return o.jsx(Lr,{id:u,label:E,value:ne(h),onChange:m=>D(m.currentTarget.value),"aria-required":M||void 0,error:N},u);case"number":return o.jsx(Ke,{id:u,label:E,value:kt(h),min:0,step:1,inputMode:"numeric",pattern:"[0-9]*",onKeyDown:m=>{vt(m.key)&&m.preventDefault()},onChange:m=>D(yt(m.currentTarget.value)),"aria-required":M||void 0,error:N},u);case"textarea":return o.jsx(Pr,{id:u,label:E,value:ne(h),onChange:m=>D(m.currentTarget.value),"aria-required":M||void 0,error:N,rows:4},u);case"date":{let m=St(u),L=N;if(u==="date_first_licensed"&&f){const p=j(y,f,"date_of_birth");if(typeof p=="string"&&p){const k=new Date(p);if(!isNaN(k.getTime())){const C=new Date(k);if(C.setFullYear(C.getFullYear()+16),m=or(C),typeof h=="string"&&h){const A=new Date(h);!isNaN(A.getTime())&&A<C&&(L="Driver must be at least 16 years old at the date first licensed")}}}}return o.jsx(Rr,{id:u,label:E,value:ne(h),min:m,onChange:p=>D(p.currentTarget.value),"aria-required":M||void 0,error:L},u)}case"checkbox":{if(v.options){const m=Array.isArray(h)?h:[];return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"form-label",children:[E,M&&o.jsx("span",{className:"text-red-600 ml-1",children:"*"})]}),o.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:v.options.map(L=>{const p=`${u}-${we(L)}`,k=m.includes(L);return o.jsx(je,{id:p,label:L,checked:k,onChange:C=>{const A=new Set(m);C.currentTarget.checked?A.add(L):A.delete(L),D(Array.from(A))},"aria-required":M||void 0},p)})}),N&&o.jsx("p",{className:"mt-1 text-sm text-red-600",children:N})]},u)}return o.jsx(je,{id:u,label:M?`${E} *`:E,checked:!!h,onChange:m=>D(m.currentTarget.checked),"aria-required":M||void 0},u)}case"radio":{if(ye(v))return null;const m=v.options??[],L=f&&f.length>0?`${u}__${f.join("__")}`:u;return o.jsx(Fr,{legend:E,legendClassName:M?"legend-required":void 0,children:m.map(p=>o.jsx(Br,{name:L,value:p,checked:h===p,onChange:()=>D(p),children:p},`${u}-${we(p)}`))},u)}case"select":{let m=v.options??[];if(u==="quote_vehicle_id"&&(m=t?.vehicles__items?.map(p=>p.vin)??[]),u==="make"&&(m=[...st]),u==="model"){const p=j(y,f,"year"),k=j(y,f,"make");m=dt(p,k),m.length===0&&(m=[...mt]),typeof h=="string"&&h&&!m.includes(h)&&(m=[h,...m])}if(u==="body_style"){const p=j(y,f,"year"),k=j(y,f,"make"),C=j(y,f,"model");m=ft(p,k,C),m.length===0&&(m=[...ht]),typeof h=="string"&&h&&!m.includes(h)&&(m=[h,...m])}if(u==="occupation"){const p=String(Oe(j(y,f,"industry"))??"").trim();m=[...ot[p]??gt],typeof h=="string"&&h&&!m.includes(h)&&(m=[h,...m])}const L=At(f,u);return o.jsx(xr,{id:L,label:E,"aria-required":M||void 0,error:N,value:Mt(h),onChange:p=>{const k=p.currentTarget.value;if(u!=="year"&&u!=="make"&&u!=="model"&&u!=="industry"){D(k);return}let C=J(y,f,u,k);u==="year"?(C=J(C,f,"make",""),C=J(C,f,"model",""),C=J(C,f,"body_style","")):u==="make"?(C=J(C,f,"model",""),C=J(C,f,"body_style","")):u==="model"?C=J(C,f,"body_style",""):u==="industry"&&(C=J(C,f,"occupation","")),t&&i?i(C):_(C),S(C)},placeholder:"Select an option",options:m.map(p=>({value:p,label:pt[u]?.[p]??_t[p]??p}))},L)}case"address":return o.jsx(Ur,{id:u,label:E,value:ne(h),onChange:m=>D(m),"aria-required":M||void 0,error:N},u);default:return null}}function W(v,f){return v.map((u,E)=>{const h=String(u.key);if(!Le(u,y,c))return null;const M=G(u,f),N=u.conditionals??[];if(!N.length)return o.jsx("div",{children:M},`wrap-${h}-${E}`);const D=ar(u,j(y,f,h)),m=N.filter(p=>fe(D,p.conditionalType,p.conditionalValue)),L=m.length>1&&!m.some(p=>p.conditionalQuestionsAllowMultiple)?m.slice(0,1):m;return o.jsxs("div",{children:[M,L.map((p,k)=>{const C=p.conditionalQuestions??[];if(!C.length)return null;if(!p.conditionalQuestionsAllowMultiple)return o.jsx("div",{className:"mt-3",children:W(C,f)},`branch-${h}-${k}`);const A=ve(h),T=Re(y,[...f??[],A])??[],H=Math.max(1,T.length||1),R=()=>{const P=te(y,[...f??[],A,T.length],{});t&&i?i(P):_(P),S(P)},$=()=>{const P=T.slice(0,Math.max(0,T.length-1)),x=te(y,[...f??[],A],P);t&&i?i(x):_(x),S(x)},F=`${h}__c${k}`;return o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),o.jsxs("div",{className:"space-x-2",children:[o.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:R,children:"Add another"}),H>1&&o.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:$,children:"Remove last"})]})]}),Array.from({length:H}).map((P,x)=>{const V=[...f??[],A,x],U=`${F}__i${x}`,Y=T[x]??{},X=h==="drivers",K=X?`Driver #${x+1}`:`Entry #${x+1}`,un=X&&typeof Y.ssn_display=="string"&&Y.ssn_display?` — ${Y.ssn_display}`:"";return o.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[o.jsxs("div",{className:"text-sm font-semibold mb-2",children:[K,un]}),C.map(pe=>o.jsxs("div",{className:"mt-3",children:[G(pe,V),(()=>{const Mr=pe.conditionals??[];if(!Mr.length)return null;const dn=j(y,V,pe.key),be=Mr.filter(se=>fe(dn,se.conditionalType,se.conditionalValue));return(be.length>1&&!be.some(se=>se.conditionalQuestionsAllowMultiple)?be.slice(0,1):be).map((se,Ve)=>{const Ye=se.conditionalQuestions??[];if(!Ye.length)return null;if(!se.conditionalQuestionsAllowMultiple)return o.jsx("div",{className:"mt-3",children:W(Ye,V)},`nested-${U}-${Ve}`);const Ee=ve(pe.key),ke=Re(y,[...V,Ee])??[],Nr=Math.max(1,ke.length||1),fn=()=>{const ue=te(y,[...V,Ee,ke.length],{});t&&i?i(ue):_(ue),S(ue)},_n=()=>{const ue=ke.slice(0,Math.max(0,ke.length-1)),le=te(y,[...V,Ee],ue);t&&i?i(le):_(le),S(le)};return o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),o.jsxs("div",{className:"space-x-2",children:[o.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:fn,children:"Add another"}),Nr>1&&o.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:_n,children:"Remove last"})]})]}),Array.from({length:Nr}).map((ue,le)=>{const pn=[...V,Ee,le];return o.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[o.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",le+1]}),W(Ye,pn)]},`nested-item-${U}-${Ve}-${le}`)})]},`nested-repeat-${U}-${Ve}`)})})()]},`${U}-${String(pe.key)}`))]},`group-${U}`)})]},`branch-${h}-${k}`)})]},`wrap-${h}-${E}`)})}const B=g.useMemo(()=>{const v=[],f=(u,E)=>{u.forEach(h=>{if(!Le(h,y,c))return;ye(h)||v.push(h);const M=String(h.key),N=h.conditionals??[];if(!N.length)return;const D=ar(h,j(y,E,M)),m=N.filter(p=>fe(D,p.conditionalType,p.conditionalValue));(m.length>1&&!m.some(p=>p.conditionalQuestionsAllowMultiple)?m.slice(0,1):m).forEach(p=>{const k=p.conditionalQuestions??[];k.length&&(p.conditionalQuestionsAllowMultiple||f(k,E))})})};return f(s),v},[s,y,c]);function I(v){v.preventDefault();const f=de(y,c),u=B.map(h=>he(h,c)?{...h,required:f}:h),E=me(u,y);if(w(E),Object.keys(E).length>0){const h=B.findIndex(M=>E[M.key]);h>=0&&document.getElementById(B[h].key)?.focus();return}a(y)}return o.jsx("form",{className:"space-y-6 px-1",onSubmit:I,noValidate:!0,children:W(s)})}const wt="GTM-NK8LGHTQ";function Tt(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function oe(r,e={}){Tt().push({event:r,credifyWidget:{...e,containerId:wt}})}function Ot(){oe("credify_widget_opened")}function ur(){oe("credify_widget_closed")}function It(r){oe("credify_widget_stage_viewed",r)}function dr(r){oe("credify_widget_stage_completed",r)}function Lt(){oe("credify_widget_flow_completed")}function Dt(r){oe("credify_widget_rates_viewed",r??{})}function Pt(){oe("credify_widget_rates_back")}function fr(r){return r.inputType!=="radio"||!r.options||r.options.length!==1||r.options[0]!=="Yes"?!1:(r.conditionals??[]).some(t=>t.conditionalQuestionsAllowMultiple&&t.conditionalType==="equals"&&t.conditionalValue==="Yes")}function _r(r,e){return fr(r)?"Yes":e}function pr(r){return typeof r=="number"&&Number.isFinite(r)?r:typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r))?Number(r):null}function mr(r){if(r instanceof Date&&!Number.isNaN(r.getTime()))return r.getTime();if(typeof r=="string"){const e=Date.parse(r);return Number.isNaN(e)?null:e}return null}function hr(r,e){const t=pr(r),i=pr(e);if(t!=null&&i!=null)return t-i;const a=mr(r),s=mr(e);return a!=null&&s!=null?a-s:r==null||e==null?null:String(r).localeCompare(String(e))}function Rt(r,e){return Array.isArray(r)?r.some(t=>t===e):typeof r=="string"?e!=null&&r.includes(String(e)):!1}function gr(r,e,t){switch(e){case"equals":return r===t;case"lessThan":{const i=hr(r,t);return i!=null&&i<0}case"greaterThan":{const i=hr(r,t);return i!=null&&i>0}case"contains":return Rt(r,t);case"startsWith":return r!=null&&t!=null&&String(r).startsWith(String(t));case"endsWith":return r!=null&&t!=null&&String(r).endsWith(String(t));default:return!1}}function yr(r,e){const t=Ie(r),i=[];return(s=>{s.forEach(c=>{if(!Le(c,e,t))return;fr(c)||i.push(c);const n=String(c.key),l=_r(c,e[n]),_=c.conditionals??[];if(!_.length)return;const d=_.filter(y=>gr(l,y.conditionalType,y.conditionalValue));(d.length>1&&!d.some(y=>y.conditionalQuestionsAllowMultiple)?d.slice(0,1):d).forEach(y=>{const b=y.conditionalQuestions??[];b.length&&(y.conditionalQuestionsAllowMultiple||b.forEach(w=>i.push(w)))})})})(r),i}const vr="__items",Be=r=>`${r}${vr}`;function Bt(r,e){if(r.key==="relationship_to_insured"){const t=e[e.length-1];return typeof t=="number"&&t===0}return!1}function Fe(r,e,t=[]){for(const i of r){const a=String(i.key),s=_r(i,e[a]),c=i.conditionals??[];if(!c.length)continue;const n=c.filter(_=>gr(s,_.conditionalType,_.conditionalValue)),l=n.length>1&&!n.some(_=>_.conditionalQuestionsAllowMultiple)?n.slice(0,1):n;for(const _ of l){const d=_.conditionalQuestions??[];if(!d.length)continue;if(!_.conditionalQuestionsAllowMultiple){if(Fe(d,e,t))return!0;continue}const S=e[Be(a)]??[];if(S.length===0)return!0;for(const[y,b]of S.entries()){const w=[...t,Be(a),y],G=d.filter(B=>!Bt(B,w)),W=me(G,b);if(Object.values(W).some(Boolean)||Fe(d,b,w))return!0}}}return!1}function Sr(r,e){return Fe(r,e)}function Ft({stages:r,onStageComplete:e,onComplete:t,initialValues:i,initialActive:a}){const[s,c]=g.useState(a??0),[n,l]=g.useState(i??{}),[_,d]=g.useState({}),[S,y]=g.useState(!1),[b,w]=g.useState(!1),[G,W]=g.useState(null),B=g.useRef([]),I=g.useRef(r),v=Array.isArray(r)&&r.length>0,f=v?r[Math.min(s,r.length-1)]:null,u=f?.key??null;g.useEffect(()=>{a!==void 0&&c(a)},[a]),g.useEffect(()=>{I.current=r},[r]),g.useEffect(()=>{const p=B.current[s];p&&p.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[s]),g.useEffect(()=>{i!==void 0&&l(i)},[i]),g.useEffect(()=>{if(!f||!u){y(!1),W(null);return}if(_[u]){y(!1),W(null);return}let p=!1;return y(!0),W(null),Promise.resolve(f.loadQuestions()).then(k=>{if(!p){if(!Array.isArray(k))throw new Error(`loadQuestions("${u}") did not return an array`);d(C=>({...C,[u]:k}))}}).catch(k=>{p||W(`Failed to load stage "${f?.title??""}": ${k?.message??"Unknown error"}`)}).finally(()=>{p||y(!1)}),()=>{p=!0}},[f,u,_]);const E=u?_[u]:void 0,h=g.useMemo(()=>Ie(E??[]),[E]);g.useEffect(()=>{f&&u&&E&&It({stageKey:u,stageTitle:f.title??u,stepIndex:s+1,totalSteps:r.length})},[u,s,r.length,f,E]);const M=g.useMemo(()=>{if(!E)return{};const p={};(A=>{const T=[],H=R=>{R.forEach(($,F)=>{const P=Qe($,F);T.push(P);const x=Be(P);T.push(x),($.conditionals??[]).forEach(U=>{const Y=U.conditionalQuestions??[];Y.length>0&&H(Y)})})};return H(A),T})(E).forEach(A=>{A in n&&(p[A]=n[A])});for(const[A,T]of Object.entries(n))A.endsWith(vr)&&!(A in p)&&(p[A]=T);return p},[E,n]),N=p=>{l(k=>({...k,...p}))},D=()=>{c(p=>p>0?p-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},m=async()=>{if(!E||!f||S||G||b)return;const p=yr(E,n),k=de(n,h),C=p.map(P=>he(P,h)?{...P,required:k}:P),A=me(C,n),T=Object.values(A).some(Boolean),H=Sr(E,n),R=n.driver_vehicle_assignments,$=n.drivers__items??[];let F=!1;if(R&&$.length>=2){const P=n.vehicles__items??[];for(let x=0;x<P.length;x++){const V=R[`v${x}`];if(!V)continue;const U=$.map((K,ie)=>V[`d${ie}`]??0),Y=U.filter(K=>K>0);if(Y.length>=2&&Y.every(K=>K===50)){F=!0;break}const X=U.reduce((K,ie)=>K+ie,0);if(X>0&&X!==100){F=!0;break}}}if(!(T||H||F)){w(!0);try{const P=s>=r.length-1,{success:x,error:V}=P?await t(n,u??""):await e(M,u??"");if(!x){W(V??"An error occurred");return}if(!P){const U=I.current,Y=U.findIndex(K=>K.key===u),X=Y>=0?Math.min(Y+1,U.length-1):Math.min(s+1,U.length-1);c(X)}}finally{w(!1)}}},L=g.useMemo(()=>{if(!E||S||G||b)return!0;const p=yr(E,n),k=de(n,h),C=p.map(P=>he(P,h)?{...P,required:k}:P),A=me(C,n),T=Object.values(A).some(Boolean),H=Sr(E,n),R=n.driver_vehicle_assignments,$=n.drivers__items??[];let F=!1;if(R&&$.length>=2){const P=n.vehicles__items??[];for(let x=0;x<P.length;x++){const V=R[`v${x}`];if(!V)continue;const U=$.map((K,ie)=>V[`d${ie}`]??0),Y=U.filter(K=>K>0);if(Y.length>=2&&Y.every(K=>K===50)){F=!0;break}const X=U.reduce((K,ie)=>K+ie,0);if(X>0&&X!==100){F=!0;break}}}return T||H||F},[E,n,S,G,b,h]);return v?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"form-wizard-steps-header flex items-center justify-between gap-4",children:[o.jsx("ol",{className:"form-wizard-steps flex gap-2 text-xs overflow-x-auto flex-1 pb-1 scrollbar-hide items-center",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:r.flatMap((p,k)=>[o.jsx("li",{ref:C=>{B.current[k]=C},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${k<s?"bg-blue-600 text-white border-blue-600":k===s?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:p.title},p.key??`stage-${k}`),...k<r.length-1?[o.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${p.key??k}`)]:[]])}),o.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[Math.min(s+1,r.length)," / ",r.length]})]}),o.jsxs("div",{children:[S&&o.jsx("div",{className:"text-slate-500",children:"Loading…"}),f&&o.jsx(Nt,{questions:E??[],controlledValues:M,onChangeValues:N,onSubmit:()=>m()},f.key)]}),!S&&G&&o.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[o.jsx("div",{children:G}),f&&o.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{d(p=>{if(!u)return p;const k={...p};return delete k[u],k})},children:"Retry"})]}),o.jsxs("div",{className:s>0?"grid grid-cols-2 gap-3":"",children:[s>0&&o.jsx("button",{type:"button",onClick:D,disabled:S,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Back"}),o.jsxs("button",{type:"button","data-widget-ctrl":"next",onClick:m,disabled:L,className:["form-wizard-next-btn",s>0?"":"w-full","h-12 rounded-full text-white transition","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center justify-center gap-2",L?"bg-gray-300":"bg-blue-600 hover:bg-blue-600/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 bg-primary hover:bg-primary/90 focus-visible:ring-primary/40"].join(" "),children:[b&&o.jsxs("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[o.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),o.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s===r.length-1?"Finish":"Next"]})]})]}):o.jsx("div",{className:"text-slate-600",children:"Loading..."})}const xe="credify_quote_id",He="credify_auth_token";function xt(r){try{localStorage.setItem(xe,r)}catch(e){console.error("Failed to save quoteId to localStorage:",e)}}function Ht(){try{return localStorage.getItem(xe)}catch(r){return console.error("Failed to load quoteId from localStorage:",r),null}}function Cr(){try{localStorage.removeItem(xe)}catch(r){console.error("Failed to clear quoteId from localStorage:",r)}}function $t(r){try{localStorage.setItem(He,r)}catch(e){console.error("Failed to save authToken to localStorage:",e)}}function Gt(){try{return localStorage.getItem(He)}catch(r){return console.error("Failed to load authToken from localStorage:",r),null}}function Ar(){try{localStorage.removeItem(He)}catch(r){console.error("Failed to clear authToken from localStorage:",r)}}function Ut(){Cr(),Ar()}const Z="https://api.getcredify.com";let ce=null;function Wt(r){ce=r,$t(r)}function Se(){return ce}function $e(){const r=Gt();r&&(ce=r)}function br(){ce=null,Ar()}async function ee(r,e){const t={"Content-Type":"application/json"};ce&&(t.Authorization=`Bearer ${ce}`);const i=await fetch(r,{method:"POST",headers:t,body:JSON.stringify(e)});if(!i.ok){let a=`Request failed with status ${i.status}`;try{a=(await i.json()).error||a}catch{a=i.statusText||a}const s=new Error(a);throw s.statusCode=i.status,s}return i}async function Vt(r){return await(await ee(`${Z}/get-questions-by-stage`,{stage:r})).json()}async function Ge(){return await(await ee(`${Z}/get-stages-for-quote`,{})).json()}async function Yt(r){const t=await(await ee(`${Z}/create-quote`,{phone:r})).json();if(!t||typeof t!="object"||!t.quoteId)throw new Error(`Invalid createQuote response: ${JSON.stringify(t)}`);return t}async function _e(r,e,t){const i={payload:r,getRates:e};return t&&typeof t=="string"&&t.trim()!==""&&(i.quoteId=t),await(await ee(`${Z}/update-quote`,i)).json()}async function Kt(r,e){return await(await ee(`${Z}/verify-quote`,{quoteId:r,smsCode:e})).json()}async function jt(r){return await(await ee(`${Z}/is-supported-state`,{state:r})).json()}async function Qt(){return await(await ee(`${Z}/get-rates`,{})).json()}async function qt(r){const e=r?{quoteId:r}:{};return await(await ee(`${Z}/get-quote`,e)).json()}async function Xt(r){const t=await(await ee(`${Z}/request-bind`,{quoteRateId:r})).json();return t&&typeof t=="object"&&"success"in t?t:{success:!0}}const zt=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function Er({onBack:r}){const e=()=>{Pt(),r?.()};return o.jsx("button",{type:"button",onClick:e,className:"credify-btn-back credify-btn-back-rates h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition w-full",children:"Back"})}function Jt({rates:r,onBack:e}){const t=Array.isArray(r)&&r.length>0,[i,a]=g.useState({});return g.useEffect(()=>{$e()},[]),t?o.jsxs("section",{className:"mt-8",children:[o.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),o.jsx("div",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:r.map(s=>{const c=s.premium_cents/100,n=zt.format(c),l=s.quote_rate_id,_=i[l]??"idle",d=_==="loading",S=_==="success",y=async()=>{a(b=>({...b,[l]:"loading"}));try{if($e(),!Se())throw new Error("Authentication required. Please verify your phone number first.");if(!((await Xt(s.quote_rate_id))?.success!==!1))throw new Error("Request failed");Ut(),br(),a(W=>({...W,[l]:"success"}))}catch{a(b=>({...b,[l]:"error"}))}};return o.jsxs("div",{className:"flex flex-col rounded-xl border border-slate-200 bg-white p-6 shadow-sm transition hover:shadow-md",children:[o.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s.carrier_logo_base64?o.jsx("img",{src:`data:image/png;base64,${s.carrier_logo_base64}`,alt:s.carrier_name,className:"h-12 w-auto object-contain"}):o.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-md bg-slate-100 text-sm font-semibold text-slate-500",children:s.carrier_name.charAt(0).toUpperCase()}),o.jsx("div",{className:"flex-1",children:o.jsx("h4",{className:"font-semibold text-slate-900",children:s.carrier_name})})]}),o.jsxs("div",{className:"mb-2",children:[o.jsx("p",{className:"text-sm text-slate-500",children:"Premium"}),o.jsx("p",{className:"text-2xl font-bold text-slate-900",children:n})]}),o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-sm text-slate-500",children:"Term"}),o.jsxs("p",{className:"font-medium text-slate-700",children:[s.term_months," months"]})]}),s.carrier_quote_id&&o.jsx("div",{className:"mb-4",children:o.jsxs("p",{className:"text-xs text-slate-400",children:["Quote ID: ",s.carrier_quote_id]})}),o.jsxs("div",{className:"mt-auto pt-4",children:[o.jsx("button",{type:"button",onClick:y,disabled:d||S,className:`rates-bind-btn w-full rounded-full px-4 py-2.5 text-sm font-semibold transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 disabled:cursor-not-allowed ${S?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:d?"Requesting…":S?"Requested":"Request Bind"}),_==="error"&&o.jsx("p",{className:"mt-2 text-xs text-red-600",children:"Something went wrong. Please try again."}),_==="success"&&o.jsx("p",{className:"mt-2 text-xs text-emerald-600",children:"We received your bind request."})]})]},l)})}),e&&o.jsx(Er,{onBack:e})]}):o.jsxs("section",{className:"mt-8",children:[o.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),o.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"No rates are available at this time."}),e&&o.jsx(Er,{onBack:e})]})}function O(r){if(r===!0)return"Yes";if(r===!1)return"No"}function Q(r){if(r)try{const e=typeof r=="string"?new Date(r):r;return isNaN(e.getTime())?void 0:e.toISOString().split("T")[0]}catch{return}}function Zt(r){const e=r,t={};e.phone&&(t.phone=e.phone),e.first_name&&(t.first_name=e.first_name),e.last_name&&(t.last_name=e.last_name),e.email&&(t.email=e.email),e.date_of_birth&&(t.date_of_birth=Q(e.date_of_birth)),e.product&&(t.product=e.product),e.state&&(t.state=e.state);const i=[];e.line_1&&i.push(e.line_1),e.line_2&&i.push(e.line_2),e.city&&i.push(e.city),e.state&&i.push(e.state),e.postal_code&&i.push(e.postal_code),i.length>0&&(t.address=i.join(", ")),e.years_at_address!==null&&e.years_at_address!==void 0&&(t.years_at_address=e.years_at_address),e.months_at_address!==null&&e.months_at_address!==void 0&&(t.months_at_address=e.months_at_address),e.move_in_date&&(t.move_in_date=Q(e.move_in_date));const a=[];e.prior_line_1&&a.push(e.prior_line_1),e.prior_line_2&&a.push(e.prior_line_2),e.prior_city&&a.push(e.prior_city),e.prior_state&&a.push(e.prior_state),e.prior_postal_code&&a.push(e.prior_postal_code),a.length>0&&(t.prior_address=a.join(", ")),e.years_at_prior_address!==null&&e.years_at_prior_address!==void 0&&(t.years_at_prior_address=e.years_at_prior_address),e.is_mailing_address_different!==null&&e.is_mailing_address_different!==void 0&&(t.is_mailing_address_different=O(e.is_mailing_address_different)),e.mailing_address&&(t.mailing_address=e.mailing_address),e.effective_date&&(t.effective_date=Q(e.effective_date)),e.auto_has_prior_insurance!==null&&e.auto_has_prior_insurance!==void 0&&(t.auto_has_prior_insurance=O(e.auto_has_prior_insurance)),e.auto_prior_expiration_date&&(t.auto_prior_expiration_date=Q(e.auto_prior_expiration_date)),e.auto_prior_carrier_name&&(t.auto_prior_carrier_name=e.auto_prior_carrier_name),e.auto_prior_liability_limit&&(t.auto_prior_liability_limit=e.auto_prior_liability_limit),e.auto_reason_for_no_insurance&&(t.auto_reason_for_no_insurance=e.auto_reason_for_no_insurance),e.auto_prior_years!==null&&e.auto_prior_years!==void 0&&(t.auto_prior_years=e.auto_prior_years),e.auto_prior_months!==null&&e.auto_prior_months!==void 0&&(t.auto_prior_months=e.auto_prior_months),e.auto_continuous_coverage_years!==null&&e.auto_continuous_coverage_years!==void 0&&(t.auto_continuous_coverage_years=e.auto_continuous_coverage_years),e.auto_cancelled_declined_refused_to_renew!==null&&e.auto_cancelled_declined_refused_to_renew!==void 0&&(t.auto_cancelled_declined_refused_to_renew=O(e.auto_cancelled_declined_refused_to_renew)),e.auto_current_annual_premium_cents!==null&&e.auto_current_annual_premium_cents!==void 0&&(t.auto_current_annual_premium_cents=e.auto_current_annual_premium_cents),e.policy_bi&&(t.policy_bi=e.policy_bi),e.policy_um&&(t.policy_um=e.policy_um),e.policy_pd&&(t.policy_pd=e.policy_pd),e.policy_mp&&(t.policy_mp=e.policy_mp),e.policy_umpd&&(t.policy_umpd=e.policy_umpd),e.policy_pip&&(t.policy_pip=e.policy_pip),e.policy_auto_death_indemnity&&(t.policy_auto_death_indemnity=e.policy_auto_death_indemnity),e.driver_vehicle_assignments&&(t.driver_vehicle_assignments=e.driver_vehicle_assignments),e.home_has_prior_insurance!==null&&e.home_has_prior_insurance!==void 0&&(t.home_has_prior_insurance=O(e.home_has_prior_insurance)),e.home_prior_expiration_date&&(t.home_prior_expiration_date=Q(e.home_prior_expiration_date)),e.home_prior_carrier_name&&(t.home_prior_carrier_name=e.home_prior_carrier_name),e.year_built!==null&&e.year_built!==void 0&&(t.year_built=e.year_built),e.number_of_units!==null&&e.number_of_units!==void 0&&(t.number_of_units=e.number_of_units),e.number_of_stories!==null&&e.number_of_stories!==void 0&&(t.number_of_stories=e.number_of_stories),e.number_of_beds!==null&&e.number_of_beds!==void 0&&(t.number_of_beds=e.number_of_beds),e.number_of_full_baths!==null&&e.number_of_full_baths!==void 0&&(t.number_of_full_baths=e.number_of_full_baths),e.number_of_partial_baths!==null&&e.number_of_partial_baths!==void 0&&(t.number_of_partial_baths=e.number_of_partial_baths),e.under_construction!==null&&e.under_construction!==void 0&&(t.under_construction=O(e.under_construction)),e.distance_from_fire_hydrant_ft&&(t.distance_from_fire_hydrant_ft=e.distance_from_fire_hydrant_ft),e.distance_from_fire_station_miles&&(t.distance_from_fire_station_miles=e.distance_from_fire_station_miles),e.architectural_style&&(t.architectural_style=e.architectural_style),e.dwelling_type&&(t.dwelling_type=e.dwelling_type),e.construction_quality&&(t.construction_quality=e.construction_quality),e.located_over_water!==null&&e.located_over_water!==void 0&&(t.located_over_water=e.located_over_water),e.construction_type&&(t.construction_type=e.construction_type),e.exterior_wall_type&&(t.exterior_wall_type=e.exterior_wall_type),e.foundation_type&&(t.foundation_type=e.foundation_type),e.roof_material_type&&(t.roof_material_type=e.roof_material_type),e.year_roof_updated!==null&&e.year_roof_updated!==void 0&&(t.year_roof_updated=e.year_roof_updated),e.heating_type&&(t.heating_type=e.heating_type),e.heating_fuel_type&&(t.heating_fuel_type=e.heating_fuel_type),e.number_of_fireplaces!==null&&e.number_of_fireplaces!==void 0&&(t.number_of_fireplaces=e.number_of_fireplaces),e.basement_type&&(t.basement_type=e.basement_type),e.parking_type&&(t.parking_type=e.parking_type),e.number_of_parking_spaces!==null&&e.number_of_parking_spaces!==void 0&&(t.number_of_parking_spaces=e.number_of_parking_spaces),e.plumbing_type&&(t.plumbing_type=e.plumbing_type),e.pool_type&&(t.pool_type=e.pool_type),e.total_area_sq_ft!==null&&e.total_area_sq_ft!==void 0&&(t.total_area_sq_ft=e.total_area_sq_ft),e.parcel_area_sq_ft!==null&&e.parcel_area_sq_ft!==void 0&&(t.parcel_area_sq_ft=e.parcel_area_sq_ft),e.residence_type&&(t.residence_type=e.residence_type),e.usage_type&&(t.usage_type=e.usage_type),e.household_size!==null&&e.household_size!==void 0&&(t.household_size=e.household_size),e.number_of_mortgagees!==null&&e.number_of_mortgagees!==void 0&&(t.number_of_mortgagees=e.number_of_mortgagees),e.has_dog!==null&&e.has_dog!==void 0&&(t.has_dog=O(e.has_dog)),e.dog_breed_type&&(t.dog_breed_type=e.dog_breed_type),e.number_of_dogs!==null&&e.number_of_dogs!==void 0&&(t.number_of_dogs=e.number_of_dogs),e.has_business_on_premises!==null&&e.has_business_on_premises!==void 0&&(t.has_business_on_premises=O(e.has_business_on_premises)),e.business_class&&(t.business_class=e.business_class),e.retiree_discount!==null&&e.retiree_discount!==void 0&&(t.retiree_discount=O(e.retiree_discount)),e.gated_community_discount!==null&&e.gated_community_discount!==void 0&&(t.gated_community_discount=O(e.gated_community_discount)),e.multi_policy_discount!==null&&e.multi_policy_discount!==void 0&&(t.multi_policy_discount=O(e.multi_policy_discount)),e.non_smoker_discount!==null&&e.non_smoker_discount!==void 0&&(t.non_smoker_discount=O(e.non_smoker_discount)),e.first_time_buyer_discount!==null&&e.first_time_buyer_discount!==void 0&&(t.first_time_buyer_discount=O(e.first_time_buyer_discount)),e.fire_detection_system!==null&&e.fire_detection_system!==void 0&&(t.fire_detection_system=O(e.fire_detection_system)),e.burglar_alarm_system!==null&&e.burglar_alarm_system!==void 0&&(t.burglar_alarm_system=O(e.burglar_alarm_system)),e.burglar_alarm_system_type&&(t.burglar_alarm_system_type=e.burglar_alarm_system_type),e.smoke_detectors!==null&&e.smoke_detectors!==void 0&&(t.smoke_detectors=O(e.smoke_detectors)),e.sprinkler_system!==null&&e.sprinkler_system!==void 0&&(t.sprinkler_system=O(e.sprinkler_system)),e.sprinkler_system_type&&(t.sprinkler_system_type=e.sprinkler_system_type),e.gas_leakage_detector!==null&&e.gas_leakage_detector!==void 0&&(t.gas_leakage_detector=O(e.gas_leakage_detector)),e.deadbolt_locks!==null&&e.deadbolt_locks!==void 0&&(t.deadbolt_locks=O(e.deadbolt_locks)),e.fire_extinguisher!==null&&e.fire_extinguisher!==void 0&&(t.fire_extinguisher=O(e.fire_extinguisher)),e.order_credit_authorized!==null&&e.order_credit_authorized!==void 0&&(t.order_credit_authorized=O(e.order_credit_authorized)),e.has_health_insurance_auto_accident!==null&&e.has_health_insurance_auto_accident!==void 0&&(t.has_health_insurance_auto_accident=O(e.has_health_insurance_auto_accident)),e.named_insured_foreclosure_repo_bankruptcy!==null&&e.named_insured_foreclosure_repo_bankruptcy!==void 0&&(t.named_insured_foreclosure_repo_bankruptcy=O(e.named_insured_foreclosure_repo_bankruptcy)),e.named_insured_convicted_insurance_fraud!==null&&e.named_insured_convicted_insurance_fraud!==void 0&&(t.named_insured_convicted_insurance_fraud=O(e.named_insured_convicted_insurance_fraud));const s={};if(e.vehicles)for(const c of e.vehicles)c.quote_vehicle_id&&c.vin&&(s[c.quote_vehicle_id]=c.vin);return e.drivers&&e.drivers.length>0?(t.drivers="Yes",t.drivers__items=e.drivers.map(c=>{const n=c,l={};n.first_name&&(l.first_name=n.first_name),n.middle_name&&(l.middle_name=n.middle_name),n.last_name&&(l.last_name=n.last_name),n.date_of_birth&&(l.date_of_birth=Q(n.date_of_birth)),n.gender&&(l.gender=n.gender),n.marital_status&&(l.marital_status=n.marital_status),n.relationship_to_insured&&(l.relationship_to_insured=n.relationship_to_insured),n.is_registered_owner!==null&&n.is_registered_owner!==void 0&&(l.is_registered_owner=n.is_registered_owner?"Yes":"No"),n.license_state&&(l.license_state=n.license_state),n.license_status&&(l.license_status=n.license_status),n.license_number&&(l.license_number=n.license_number),n.date_first_licensed&&(l.date_first_licensed=Q(n.date_first_licensed)),n.education_level&&(l.education_level=Ze(n.education_level)),n.occupation&&(l.occupation=er(n.occupation)),n.industry&&(l.industry=Oe(n.industry)),n.employment_status&&(l.employment_status=n.employment_status),n.last_5_years_license_suspended_or_revoked!==null&&n.last_5_years_license_suspended_or_revoked!==void 0&&(l.last_5_years_license_suspended_or_revoked=O(n.last_5_years_license_suspended_or_revoked)),n.accident_prevention_course!==null&&n.accident_prevention_course!==void 0&&(l.accident_prevention_course=O(n.accident_prevention_course)),n.accident_prevention_course_date&&(l.accident_prevention_course_date=Q(n.accident_prevention_course_date)),n.sr22!==null&&n.sr22!==void 0&&(l.sr22=O(n.sr22));const _=n.ssn_display;typeof _=="string"&&(l.ssn_display=_);const d=n.driver_violations;d&&d.length>0&&(l.driver_violations="Yes",l.driver_violations__items=d.map(b=>{const w={};return b.code&&(w.code=b.code),b.occurred_at&&(w.occurred_at=Q(b.occurred_at)),w}));const S=n.driver_accidents;S&&S.length>0&&(l.driver_accidents="Yes",l.driver_accidents__items=S.map(b=>{const w={};return b.occurred_at&&(w.occurred_at=Q(b.occurred_at)),b.description&&(w.description=b.description),b.quote_vehicle_id&&(w.quote_vehicle_id=s[b.quote_vehicle_id]??b.quote_vehicle_id),b.property_damage_amount_paid_cents!==null&&b.property_damage_amount_paid_cents!==void 0&&(w.property_damage_amount_paid_cents=b.property_damage_amount_paid_cents),b.personal_injury_amount_paid_cents!==null&&b.personal_injury_amount_paid_cents!==void 0&&(w.personal_injury_amount_paid_cents=b.personal_injury_amount_paid_cents),w}));const y=n.losses;return y&&y.length>0&&(l.losses="Yes",l.losses__items=y.map(b=>{const w={};return b.description&&(w.description=b.description),b.date_of_incident&&(w.date_of_incident=Q(b.date_of_incident)),b.amount_paid_cents!==null&&b.amount_paid_cents!==void 0&&(w.amount_paid_cents=b.amount_paid_cents),b.quote_vehicle_id&&(w.quote_vehicle_id=s[b.quote_vehicle_id]??b.quote_vehicle_id),w})),l})):t.drivers="No",e.vehicles&&e.vehicles.length>0?(t.vehicles="Yes",t.vehicles__items=e.vehicles.map(c=>{const n=c,l={};n.vin&&(l.vin=n.vin),n.year!==null&&n.year!==void 0&&(l.year=String(n.year)),n.make&&(l.make=n.make),n.model&&(l.model=n.model),n.body_style&&(l.body_style=n.body_style),n.ownership_type&&(l.ownership_type=n.ownership_type),n.usage&&(l.usage=n.usage),n.annual_mileage!==null&&n.annual_mileage!==void 0&&(l.annual_mileage=n.annual_mileage),n.miles_to_work!==null&&n.miles_to_work!==void 0&&(l.miles_to_work=n.miles_to_work),n.percent_to_work!==null&&n.percent_to_work!==void 0&&(l.percent_to_work=n.percent_to_work);const _=[];return n.garaging_address_line_1&&_.push(n.garaging_address_line_1),n.garaging_address_line_2&&_.push(n.garaging_address_line_2),n.garaging_address_city&&_.push(n.garaging_address_city),n.garaging_address_state&&_.push(n.garaging_address_state),n.garaging_address_postal_code&&_.push(n.garaging_address_postal_code),_.length>0&&(l.garaging_address=_.join(", ")),n.new_when_purchased!==null&&n.new_when_purchased!==void 0&&(l.new_when_purchased=O(n.new_when_purchased)),n.purchase_date&&(l.purchase_date=Q(n.purchase_date)),n.anti_theft_type&&(l.anti_theft_type=n.anti_theft_type),n.passive_restraint_type&&(l.passive_restraint_type=n.passive_restraint_type),n.anti_lock_brakes!==null&&n.anti_lock_brakes!==void 0&&(l.anti_lock_brakes=O(n.anti_lock_brakes)),n.daytime_running_lights!==null&&n.daytime_running_lights!==void 0&&(l.daytime_running_lights=O(n.daytime_running_lights)),n.custom_equipment_value_cents!==null&&n.custom_equipment_value_cents!==void 0&&(l.custom_equipment_value_cents=n.custom_equipment_value_cents),n.vehicle_has_modifications!==null&&n.vehicle_has_modifications!==void 0&&(l.vehicle_has_modifications=O(n.vehicle_has_modifications)),n.vehicle_garaged_at_residence!==null&&n.vehicle_garaged_at_residence!==void 0&&(l.vehicle_garaged_at_residence=O(n.vehicle_garaged_at_residence)),n.vehicle_comp_deductible&&(l.vehicle_comp_deductible=n.vehicle_comp_deductible),n.vehicle_coll_deductible&&(l.vehicle_coll_deductible=n.vehicle_coll_deductible),n.vehicle_towing_and_labor&&(l.vehicle_towing_and_labor=n.vehicle_towing_and_labor),n.vehicle_transportation_expense&&(l.vehicle_transportation_expense=n.vehicle_transportation_expense),n.vehicle_full_glass!==null&&n.vehicle_full_glass!==void 0&&(l.vehicle_full_glass=O(n.vehicle_full_glass)),n.vehicle_loan_lease!==null&&n.vehicle_loan_lease!==void 0&&(l.vehicle_loan_lease=O(n.vehicle_loan_lease)),n.coverages&&n.coverages.length>0&&(l.coverages__items=n.coverages.map(d=>{const S={};return d.type&&(S.type=d.type),d.per_person_limit_cents!==null&&d.per_person_limit_cents!==void 0&&(S.per_person_limit_cents=d.per_person_limit_cents),d.per_incident_limit_cents!==null&&d.per_incident_limit_cents!==void 0&&(S.per_incident_limit_cents=d.per_incident_limit_cents),d.per_incident_limit_percent!==null&&d.per_incident_limit_percent!==void 0&&(S.per_incident_limit_percent=d.per_incident_limit_percent),d.per_day_limit_cents!==null&&d.per_day_limit_cents!==void 0&&(S.per_day_limit_cents=d.per_day_limit_cents),d.deductible_cents!==null&&d.deductible_cents!==void 0&&(S.deductible_cents=d.deductible_cents),d.is_declined!==null&&d.is_declined!==void 0&&(S.is_declined=O(d.is_declined)),S})),n.vehicle_lienholders&&n.vehicle_lienholders.length>0&&(l.vehicle_lienholders__items=n.vehicle_lienholders.map(d=>{const S={};return d.name&&(S.name=d.name),d.type&&(S.type=d.type),d.line_1&&(S.line_1=d.line_1),d.line_2&&(S.line_2=d.line_2),d.city&&(S.city=d.city),d.state&&(S.state=d.state),d.postal_code&&(S.postal_code=d.postal_code),d.phone&&(S.phone=d.phone),d.fax&&(S.fax=d.fax),S})),l})):t.vehicles="No",e.losses&&e.losses.length>0&&(t.home_losses="Yes",t.home_losses__items=e.losses.map(c=>{const n={};return c.description&&(n.description=c.description),c.date_of_incident&&(n.date_of_incident=Q(c.date_of_incident)),c.amount_paid_cents!==null&&c.amount_paid_cents!==void 0&&(n.amount_paid_cents=c.amount_paid_cents),n})),t}const en=new Set(["Product","State","Driver","Vehicle"]);function rn(r){return r?Array.isArray(r.drivers__items)?r.drivers__items.length:Array.isArray(r.drivers)?r.drivers.length:null:null}function kr(r,e){if(rn(e)===1){const i=r.filter(a=>a.key!=="AutoPolicy");return i.length>0?i:r}return r}function Ue(r){const e={},t=n=>{if(typeof n=="string"){if(n==="Yes")return!0;if(n==="No")return!1}return n},i=Object.keys(r).filter(n=>!n.includes("__items")),a=new Set,s=new Set;for(const[n,l]of Object.entries(r))n.endsWith("__items")&&Array.isArray(l)&&(s.add(n.replace("__items","")),l.forEach(_=>{typeof _=="object"&&_!==null&&Object.keys(_).forEach(d=>{a.add(d)})}));for(const[n,l]of Object.entries(r))if(n.endsWith("__items")){const _=n.replace("__items","");if(i.includes(_)){const S=Array.isArray(l)?l.map(y=>Ue(y)):l;e[_]=S}}else if(!n.includes("__items")){if(s.has(n))continue;a.has(n)||(e[n]=t(l))}const c=e.auto_prior_carrier_name;return typeof c=="string"&&c.trim()!==""&&(e.auto_has_prior_insurance=c!=="NoPriorInsurance"),Array.isArray(e.drivers)&&(e.drivers=e.drivers.map(n=>{if(!n||typeof n!="object")return n;const l={...n};return l.industry=Oe(l.industry),l.education_level=Ze(l.education_level),l.occupation=er(l.occupation),l})),console.log("[DEBUG_TRANSFORM] transformed.drivers type:",typeof e.drivers,"isArray:",Array.isArray(e.drivers),Array.isArray(e.drivers)?`count=${e.drivers.length}`:`value=${JSON.stringify(e.drivers)?.slice(0,100)}`),Array.isArray(e.drivers)&&e.drivers.forEach((n,l)=>{const _=n;console.log(`[DEBUG_TRANSFORM] Driver ${l}:`,{first_name:_.first_name,gender:_.gender,marital_status:_.marital_status,education_level:_.education_level,industry:_.industry,occupation:_.occupation,sr22:_.sr22,keys:Object.keys(_)})}),e}function tn(r,e){const t=r.findIndex(a=>a.key===e);return t<0?e:r[t+1]?.key??e}function nn(r,e){return r!=="AutoCurrentCarrier"||e.some(i=>String(i.key)==="auto_cancelled_declined_refused_to_renew")?e:[...e,{question:"Has any auto insurance company cancelled, declined or refused to renew you in the last 5 years?",inputType:"radio",options:["Yes","No"],key:"auto_cancelled_declined_refused_to_renew",required:!0}]}function on(r,e){if(r!=="Vehicle")return e;const t=i=>i.map(a=>{const s=a.conditionals?.map(c=>{const n=c.conditionalQuestions??[];return n.length?{...c,conditionalQuestions:t(n)}:c});return String(a.key)!=="vin"?s?{...a,conditionals:s}:a:{...a,required:!1,...s?{conditionals:s}:{}}});return t(e)}function an({isOpen:r,onClose:e}){const[t,i]=g.useState([]),[a,s]=g.useState(null),[c,n]=g.useState(null),[l,_]=g.useState(null),[d,S]=g.useState(void 0),[y,b]=g.useState(!1);function w(B){const I={SMSVerification:"Verify",AutoCurrentCarrier:"Current Auto Policy",HomeCurrentCarrier:"Current Home Policy",AutoPolicy:"Policy"};return B.map(v=>({key:v,title:I[v]||v,loadQuestions:async()=>{const f=await Vt(v),u=nn(v,f.questions);return on(v,u)}}))}g.useEffect(()=>{r&&(async()=>{try{const I=Ht();if($e(),I){b(!0),s(I);try{const v=Se(),f=await qt(v?void 0:I);if(!f||!f.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:u}=f,{stages:E}=await Ge(),h=w(E);i(h);let M;try{M=Zt(u),_(M)}catch(D){throw new Error(`Failed to transform quote data: ${D instanceof Error?D.message:"Unknown error"}`)}const N=kr(h,M);if(i(N),u.current_stage){const D=N.findIndex(m=>m.key===u.current_stage);D>=0?S(D):S(N.length-1)}else S(N.length-1)}catch(v){v.statusCode===404?(Cr(),s(null)):br()}finally{b(!1)}}else{const{stages:v}=await Ge();i(w(v))}}catch{b(!1)}})()},[r]),g.useEffect(()=>{if(!r)return;const{overflow:B}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=B}},[r]);const G=g.useCallback(B=>{B.key==="Escape"&&(ur(),e())},[e]);if(g.useEffect(()=>{if(r)return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[r,G]),g.useEffect(()=>{r||(_(null),S(void 0),b(!1))},[r]),g.useEffect(()=>{r&&Ot()},[r]),g.useEffect(()=>{c&&Array.isArray(c)&&Dt({rateCount:c.length})},[c]),!r)return null;const W=()=>{ur(),e()};return o.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"insurance-modal-title",children:[o.jsx("div",{className:"backdrop","aria-hidden":"true"}),o.jsxs("div",{className:"modal-panel bg-white relative w-full max-w-2xl flex flex-col max-h-[90vh] overflow-hidden",role:"document",children:[o.jsx("button",{onClick:W,className:"modal-close-btn absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-xl","aria-label":"Close",type:"button",children:"×"}),o.jsxs("div",{className:"text-center mb-6",children:[o.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's get you the best insurance rates."}),o.jsx("p",{className:"p-subtitle",children:"This should only take a few minutes."})]}),o.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[!c&&o.jsx(o.Fragment,{children:y||t.length===0?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx("div",{className:"text-slate-600",children:"Loading..."})}):o.jsx(Ft,{stages:t,initialValues:l??void 0,initialActive:d,onStageComplete:async(B,I)=>{try{const v=Ue(B);let f=t;const u=f.findIndex(M=>M.key===I),E=f[u],h=tn(f,I);if(a)if(I==="SMSVerification"){const{isVerified:M,token:N}=await Kt(a,v.sms_code);if(!M)throw new Error("Invalid SMS code");N&&Wt(N),await _e({current_stage:h},!1)}else if(I==="State"){const{isSupported:M}=await jt(v.state);if(!M)throw new Error("State is not supported");const N=Se();await _e({...v,current_stage:h},!1,N?void 0:a)}else{const M=Se();await _e({...v,current_stage:h},!1,M?void 0:a||void 0)}else{const N=(await Yt(v.phone))?.quoteId;if(!N||typeof N!="string"||N.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${N}`);s(N),xt(N),await _e({current_stage:h},!1,N)}if(en.has(I))try{const{stages:M}=await Ge();f=w(M),f=kr(f,B),i(f)}catch(M){console.warn("Unable to refresh stages after flow-shaping step",M)}return dr({stageKey:I,stageTitle:E?.title??I,stepIndex:u+1,totalSteps:f.length}),{success:!0}}catch(v){return{success:!1,error:v instanceof Error?v.message:"An error occurred"}}},onComplete:async B=>{try{const I=Ue(B);if(!a)throw new Error("Quote ID is required");await _e(I,!0),_(B);const{rates:v}=await Qt();n(v);const f=t.length,u=t[f-1];return dr({stageKey:u?.key??"unknown",stageTitle:u?.title??"unknown",stepIndex:f,totalSteps:f}),Lt(),{success:!0}}catch(I){return{success:!1,error:I instanceof Error?I.message:"An error occurred"}}}})})," ",c&&a&&o.jsx(Jt,{rates:c,onBack:()=>n(null)})]}),o.jsx("div",{className:"mt-4 pt-4 border-t border-slate-200",children:o.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})})]})]})}function sn({isOpen:r}){return o.jsx(an,{isOpen:r,onClose:()=>{Ae.close()}})}let re=null,ae=null,Ce=!1;function ln(){re||(re=document.createElement("div"),re.id="insurance-widget-root",document.documentElement.appendChild(re)),!ae&&re&&(ae=wr.createRoot(re))}function We(){ln(),ae&&ae.render(g.createElement(sn,{isOpen:Ce}))}function cn(){ae&&re&&(ae.unmount(),re.remove()),ae=null,re=null}const Ae={init:r=>{Ce=!!r?.autoOpen,We()},open:()=>{Ce=!0,We()},close:()=>{Ce=!1,We()},destroy:cn};typeof window<"u"&&(window.CredifyInsuranceWidget=Ae),q.CredifyInsuranceWidget=Ae,q.default=Ae,Object.defineProperties(q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
3
3
|
//# sourceMappingURL=index.umd.js.map
|