@getcredify/credify-insurance-widget 1.8.2 → 1.10.1
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-BJWx1o2P.css +1 -0
- package/dist/iframe/assets/iframe-nZxuu7aJ.js +88 -0
- package/dist/iframe/assets/iframe-nZxuu7aJ.js.map +1 -0
- package/dist/iframe/iframe.html +2 -2
- package/dist/index.es.js +6039 -1720
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +40 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -2
- package/dist/iframe/assets/iframe-BX0vtreg.js +0 -50
- package/dist/iframe/assets/iframe-BX0vtreg.js.map +0 -1
- package/dist/iframe/assets/iframe-DKxk2TnK.css +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
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"}})}));
|
|
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-cyan-500:oklch(71.5% .143 215.221);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--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-800:oklch(27.9% .041 260.031);--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-md:28rem;--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;--tracking-wide:.025em;--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{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.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}.col-span-full{grid-column:1/-1}.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)}.h-full{height:100%}.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-auto{width:auto!important}.w-5{width:calc(var(--spacing)*5)}.w-12{width:calc(var(--spacing)*12)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8\\.5rem\\]{min-width:8.5rem}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.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}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-items-center{justify-items:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}: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)))}.self-end{align-self:flex-end}.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-2{border-style:var(--tw-border-style);border-width:2px}.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-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-\\[var\\(--accent-color\\)\\]{border-color:var(--accent-color)}.border-blue-300{border-color:var(--color-blue-300)}.border-blue-600{border-color:var(--color-blue-600)}.border-cyan-500{border-color:var(--color-cyan-500)}.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)}.border-transparent{border-color:#0000}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-50\\/30{background-color:#eff6ff4d}@supports (color:color-mix(in lab,red,red)){.bg-blue-50\\/30{background-color:color-mix(in oklab,var(--color-blue-50)30%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.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-4{padding:calc(var(--spacing)*4)}.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{padding-block:calc(var(--spacing)*2)}.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}.text-left{text-align:left}.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)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.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-blue-700{color:var(--color-blue-700)}.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-800{color:var(--color-slate-800)}.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)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-blue-100\\/60{--tw-shadow-color:#dbeafe99}@supports (color:color-mix(in lab,red,red)){.shadow-blue-100\\/60{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-blue-100)60%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-100{--tw-ring-color:var(--color-blue-100)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-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\\:text-slate-800:hover{color:var(--color-slate-800)}.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\\:max-w-\\[calc\\(\\(100\\%-1rem\\)\\/2\\)\\]{max-width:calc(50% - .5rem)}.sm\\:grid-cols-2{grid-template-columns:repeat(2,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 input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#insurance-widget-root input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#root input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#root input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#insurance-widget-root input[type=number],#root input[type=number]{-moz-appearance:textfield}#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-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
(function(){if(typeof Oe>"u")var Oe={env:{}}})();(function(Oe,b){typeof exports=="object"&&typeof module<"u"?b(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"],b):(Oe=typeof globalThis<"u"?globalThis:Oe||self,b(Oe.CredifyInsuranceWidget={},Oe.React,Oe.ReactDOM,Oe.React))})(this,(function(Oe,b,Io,l){"use strict";function Le({id:e,label:t,hint:r,error:n,required:o,className:i,children:a}){return l.jsxs("div",{className:i,children:[l.jsxs("label",{htmlFor:e,className:"form-label",children:[t," ",o&&l.jsx("span",{className:"text-red-600",children:"*"})]}),a,r&&!n&&l.jsx("p",{id:`${e}-hint`,className:"mt-1 text-sm text-slate-500",children:r}),n&&l.jsx("p",{id:`${e}-error`,className:"mt-1 text-sm text-red-600",children:n})]})}function Pr({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsx("input",{id:e,className:`form-input ${n?"input-error":""}`,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:o,...a,type:"text"})})}function Yt({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsx("input",{id:e,type:"number",className:`form-input ${n?"input-error":""}`,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:o,...a})})}function Mo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsx("input",{id:e,type:"email",className:`form-input ${n?"input-error":""}`,inputMode:"email",autoComplete:"email",required:o,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,...a})})}function Kt(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 Jt(e){return e.replace(/\D/g,"")}function Lo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...c}){const[u,d]=b.useState(""),f=b.useRef(null),m=b.useRef(0);b.useEffect(()=>{if(!a){d("");return}let y=Jt(a);y.length===11&&y.startsWith("1")&&(y=y.slice(1));const h=y.slice(0,10);d(Kt(h))},[a]);const g=y=>{const h=y.target,ie=h.value;m.current=h.selectionStart||0;const X=Jt(ie).slice(0,10),ee=Kt(X);d(ee);const D=X.length===10?`+1${X}`:X,M={...y,currentTarget:{...y.currentTarget,value:D},target:{...y.target,value:D}};s?.(M),setTimeout(()=>{if(f.current){const B=ie.slice(0,m.current),P=Jt(B),S=Kt(P),I=Math.min(S.length,ee.length);f.current.setSelectionRange(I,I)}},0)};return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsxs("div",{className:`tel-input-wrapper flex items-center border rounded-lg transition-colors w-full relative ${n?"border-red-500 error":"border-[var(--accent-color)] focus-within:border-[var(--primary-color)]"}`,children:[l.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"}),l.jsx("input",{ref:f,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 ${n?"input-error":""}`,inputMode:"tel",autoComplete:"tel",required:o,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,value:u,onChange:g,...c})]})})}function Do({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsx("input",{id:e,type:"url",className:`form-input ${n?"input-error":""}`,inputMode:"url",autoComplete:"url",required:o,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,...a})})}function Po({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsx("input",{id:e,type:"password",className:`form-input ${n?"input-error":""}`,autoComplete:"current-password",required:o,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,...a})})}function $o({id:e,label:t,hint:r,error:n,required:o,className:i,rows:a=4,...s}){return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsx("textarea",{id:e,rows:a,className:`form-input ${n?"input-error":""}`,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:o,...s})})}function Fo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsx("input",{id:e,type:"date",className:`form-input ${n?"input-error":""}`,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:o,...a})})}function $r({id:e,label:t,className:r,...n}){return l.jsxs("label",{className:`checkbox-card ${r||""}`,htmlFor:e,children:[l.jsx("input",{id:e,type:"checkbox",className:"checkbox-input",...n}),l.jsx("span",{className:"checkbox-label",children:t})]})}function xo({name:e,value:t,checked:r,onChange:n,children:o}){return l.jsxs("label",{className:"radio-card",children:[l.jsx("input",{className:"radio-input",type:"radio",name:e,value:t,checked:r,onChange:n}),l.jsx("span",{className:"radio-label",children:o})]})}function Bo({legend:e,children:t,className:r,legendClassName:n}){return l.jsxs("fieldset",{className:r,children:[l.jsx("legend",{className:`form-label mb-4 ${n||""}`,children:e}),l.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:t})]})}function st({id:e,label:t,hint:r,error:n,required:o,className:i,placeholder:a,options:s,children:c,...u}){const d=[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,f=!!c;return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsxs("select",{id:e,className:`form-input select-caret ${n?"input-error":""}`,"aria-invalid":!!n,"aria-describedby":d,required:o,...u,children:[a&&l.jsx("option",{value:"",disabled:!0,selected:!("value"in u),children:a}),f?c:s?.map(m=>l.jsx("option",{value:m.value,disabled:m.disabled,children:m.label},m.value))]})})}const zo="AIzaSyDjLdKLxoa-maLNGAyq_I_2r_Fe_TzFikw";function Ro(){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 n=document.createElement("script");n.src=`https://maps.googleapis.com/maps/api/js?key=${zo}&libraries=places`,n.async=!0,n.defer=!0,n.onload=()=>e(),n.onerror=()=>t(new Error("Failed to load Google Maps script")),document.head.appendChild(n)})}function Uo(e){const t={fullAddress:e.formatted_address};return e.address_components&&e.address_components.forEach(r=>{const n=r.types;n.includes("street_number")&&(t.streetNumber=r.long_name),n.includes("route")&&(t.streetName=r.long_name),n.includes("locality")&&(t.city=r.long_name),n.includes("administrative_area_level_1")&&(t.state=r.short_name),n.includes("postal_code")&&(t.zipCode=r.long_name),n.includes("country")&&(t.country=r.short_name)}),t}function Ho({id:e,label:t,hint:r,error:n,required:o,className:i,onChange:a,onPlaceSelect:s,value:c,...u}){const d=b.useRef(null),f=b.useRef(null),m=b.useRef(null),g=b.useRef(null),[y,h]=b.useState(!0),[ie,te]=b.useState(c||""),[X,ee]=b.useState([]),[D,M]=b.useState(!1),[B,P]=b.useState(-1),S=b.useRef([]),I=b.useRef(!1),V=b.useRef(-1);b.useEffect(()=>{S.current=X},[X]),b.useEffect(()=>{I.current=D},[D]),b.useEffect(()=>{V.current=B},[B]),b.useEffect(()=>{c!==void 0&&te(String(c))},[c]);const $=b.useRef(null);b.useEffect(()=>{if(!d.current)return;let Y=!0;return Ro().then(()=>{!Y||!d.current||(f.current=new google.maps.places.AutocompleteService,m.current=new google.maps.places.PlacesService(document.createElement("div")),h(!1))}).catch(E=>{console.error("Error loading Google Maps:",E),h(!1)}),()=>{Y=!1,$.current&&clearTimeout($.current)}},[]);const G=Y=>{const E=Y.target.value;if(te(E),a?.(E),$.current&&clearTimeout($.current),E.length<3){ee([]),M(!1);return}$.current=setTimeout(()=>{f.current&&f.current.getPlacePredictions({input:E,types:["address"]},(W,pe)=>{pe===google.maps.places.PlacesServiceStatus.OK&&W?(ee(W),M(!0),P(-1)):(ee([]),M(!1))})},300)},U=Y=>{if(!I.current||S.current.length===0){Y.key==="Escape"&&(M(!1),I.current=!1);return}switch(Y.key){case"ArrowDown":Y.preventDefault(),P(E=>{const W=E<S.current.length-1?E+1:E;return V.current=W,W});break;case"ArrowUp":Y.preventDefault(),P(E=>{const W=E>0?E-1:-1;return V.current=W,W});break;case"Enter":Y.preventDefault(),V.current>=0&&V.current<S.current.length&&re(S.current[V.current]);break;case"Escape":Y.preventDefault(),M(!1),I.current=!1;break}};b.useEffect(()=>{const Y=E=>{g.current&&!g.current.contains(E.target)&&d.current&&!d.current.contains(E.target)&&(M(!1),I.current=!1)};if(D)return document.addEventListener("mousedown",Y),()=>{document.removeEventListener("mousedown",Y)}},[D]);const re=Y=>{m.current&&m.current.getDetails({placeId:Y.place_id,fields:["address_components","formatted_address","geometry"]},(E,W)=>{if(W===google.maps.places.PlacesServiceStatus.OK&&E){const pe=E.formatted_address||"";te(pe),M(!1),ee([]),I.current=!1;const de=Uo(E);a?.(pe,de),s?.(E)}})};return l.jsx(Le,{id:e,label:t,hint:r,error:n,required:o,className:i,children:l.jsxs("div",{className:"relative",children:[l.jsx("input",{ref:d,id:e,type:"text",className:`form-input ${n?"input-error":""}`,value:ie,onChange:G,onKeyDown:U,"aria-invalid":!!n,"aria-describedby":[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,required:o,autoComplete:"street-address",placeholder:u.placeholder||"Enter an address",disabled:y||u.disabled,...u}),y&&l.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading address suggestions..."}),D&&X.length>0&&l.jsx("div",{ref:g,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:X.map((Y,E)=>l.jsxs("div",{className:`px-4 py-3 cursor-pointer transition-colors ${E===B?"bg-blue-50 text-slate-900":"bg-white text-slate-900 hover:bg-slate-50"} ${E<X.length-1?"border-b border-slate-100":""}`,role:"option","aria-selected":E===B,onClick:()=>re(Y),onMouseEnter:()=>P(E),children:[l.jsx("div",{className:"font-medium text-slate-900",children:Y.structured_formatting.main_text}),Y.structured_formatting.secondary_text&&l.jsx("div",{className:"text-sm text-slate-500 mt-0.5",children:Y.structured_formatting.secondary_text})]},Y.place_id))})]})})}function qt(e){const t=(r,n)=>r.map((o,i)=>{const a=n.length?n.join("__"):"root",s=o.key??`${a}__q${i}_${String(o.question).slice(0,24).replace(/\W+/g,"-")||"field"}`,u=(o.conditionals??[]).map((d,f)=>{const m=d.conditionalQuestions?t(d.conditionalQuestions,[...n,`${s}__c${f}`]):void 0;return{...d,conditionalQuestions:m}});return{...o,key:s,conditionals:u}});return t(e,[])}function p(e,t,r){function n(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);const u=a.prototype,d=Object.keys(u);for(let f=0;f<d.length;f++){const m=d[f];m in s||(s[m]=u[m].bind(s))}}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(s){var c;const u=r?.Parent?new i:this;n(u,s),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class Qe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Fr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const xr={};function je(e){return xr}function Br(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Qt(e,t){return typeof t=="bigint"?t.toString():t}function Xt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function er(e){return e==null}function tr(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Zo(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const i=r>o?r:o,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const zr=Symbol("evaluating");function ne(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==zr)return n===void 0&&(n=zr,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function We(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ze(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Rr(e){return JSON.stringify(e)}function jo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Wo=Xt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ct(e){if(vt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(vt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Hr(e){return ct(e)?{...e}:Array.isArray(e)?[...e]:e}const Go=new Set(["string","number","symbol"]);function Xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Re(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function L(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Vo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Yo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ko(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=ze(e._zod.def,{get shape(){const a={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return We(this,"shape",a),a},checks:[]});return Re(e,i)}function Jo(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=ze(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return We(this,"shape",a),a},checks:[]});return Re(e,i)}function qo(e,t){if(!ct(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const i=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ze(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return We(this,"shape",i),i}});return Re(e,o)}function Qo(e,t){if(!ct(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return We(this,"shape",n),n}});return Re(e,r)}function Xo(e,t){const r=ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return We(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Re(e,r)}function ei(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=ze(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(r)for(const u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(const u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return We(this,"shape",c),c},checks:[]});return Re(t,a)}function ti(e,t,r){const n=ze(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return We(this,"shape",i),i}});return Re(t,n)}function et(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Zr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function bt(e){return typeof e=="string"?e:e?.message}function Ge(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=bt(e.inst?._zod.def?.error?.(e))??bt(t?.error?.(e))??bt(r.customError?.(e))??bt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function rr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lt(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const jr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Wr=p("$ZodError",jr),Gr=p("$ZodError",jr,{Parent:Error});function ri(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function ni(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a}));else if(i.code==="invalid_key")n({issues:i.issues});else if(i.code==="invalid_element")n({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let a=r,s=0;for(;s<i.path.length;){const c=i.path[s];s===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(i))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return n(e),r}const nr=e=>(t,r,n,o)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Qe;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(c=>Ge(c,i,je())));throw Ur(s,o?.callee),s}return a.value},or=e=>async(t,r,n,o)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(o?.Err??e)(a.issues.map(c=>Ge(c,i,je())));throw Ur(s,o?.callee),s}return a.value},St=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Qe;return i.issues.length?{success:!1,error:new(e??Wr)(i.issues.map(a=>Ge(a,o,je())))}:{success:!0,data:i.value}},oi=St(Gr),wt=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Ge(a,o,je())))}:{success:!0,data:i.value}},ii=wt(Gr),ai=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return nr(e)(t,r,o)},si=e=>(t,r,n)=>nr(e)(t,r,n),ci=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return or(e)(t,r,o)},li=e=>async(t,r,n)=>or(e)(t,r,n),ui=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return St(e)(t,r,o)},di=e=>(t,r,n)=>St(e)(t,r,n),_i=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return wt(e)(t,r,o)},fi=e=>async(t,r,n)=>wt(e)(t,r,n),pi=/^[cC][^\s-]{8,}$/,mi=/^[0-9a-z]+$/,hi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gi=/^[0-9a-vA-V]{20}$/,yi=/^[A-Za-z0-9]{27}$/,vi=/^[a-zA-Z0-9_-]{21}$/,bi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Si=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Vr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,wi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ci="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ai(){return new RegExp(Ci,"u")}const Ei=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ti=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ni=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ki=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Oi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yr=/^[A-Za-z0-9_-]*$/,Ii=/^\+[1-9]\d{6,14}$/,Kr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Mi=new RegExp(`^${Kr}$`);function Jr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Li(e){return new RegExp(`^${Jr(e)}$`)}function Di(e){const t=Jr({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Kr}T(?:${n})$`)}const Pi=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$i=/^-?\d+$/,Fi=/^-?\d+(?:\.\d+)?$/,xi=/^(?:true|false)$/i,Bi=/^[^A-Z]*$/,zi=/^[^a-z]*$/,Ee=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),qr={number:"number",bigint:"bigint",object:"date"},Qr=p("$ZodCheckLessThan",(e,t)=>{Ee.init(e,t);const r=qr[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xr=p("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);const r=qr[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ri=p("$ZodCheckMultipleOf",(e,t)=>{Ee.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Zo(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ui=p("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Yo[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=o,s.maximum=i,r&&(s.pattern=$i)}),e._zod.check=a=>{const s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Hi=p("$ZodCheckMaxLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!er(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const a=rr(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Zi=p("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!er(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const a=rr(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ji=p("$ZodCheckLengthEquals",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!er(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,i=o.length;if(i===t.length)return;const a=rr(o),s=i>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ct=p("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Wi=p("$ZodCheckRegex",(e,t)=>{Ct.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gi=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bi),Ct.init(e,t)}),Vi=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zi),Ct.init(e,t)}),Yi=p("$ZodCheckIncludes",(e,t)=>{Ee.init(e,t);const r=Xe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Ki=p("$ZodCheckStartsWith",(e,t)=>{Ee.init(e,t);const r=new RegExp(`^${Xe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ji=p("$ZodCheckEndsWith",(e,t)=>{Ee.init(e,t);const r=new RegExp(`.*${Xe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),qi=p("$ZodCheckOverwrite",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Qi{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
3
|
+
`).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),i=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
|
|
4
|
+
`))}}const Xi={major:4,minor:3,patch:6},_e=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Xi;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,s,c)=>{let u=et(a),d;for(const f of s){if(f._zod.def.when){if(!f._zod.def.when(a))continue}else if(u)continue;const m=a.issues.length,g=f._zod.check(a);if(g instanceof Promise&&c?.async===!1)throw new Qe;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,a.issues.length!==m&&(u||(u=et(a,m)))});else{if(a.issues.length===m)continue;u||(u=et(a,m))}}return d?d.then(()=>a):a},i=(a,s,c)=>{if(et(a))return a.aborted=!0,a;const u=o(s,n,c);if(u instanceof Promise){if(c.async===!1)throw new Qe;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,a,s)):i(u,a,s)}const c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Qe;return c.then(u=>o(u,n,s))}return o(c,n,s)}}ne(e,"~standard",()=>({validate:o=>{try{const i=oi(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ii(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),ir=p("$ZodString",(e,t)=>{_e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Pi(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),le=p("$ZodStringFormat",(e,t)=>{Ct.init(e,t),ir.init(e,t)}),ea=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Si),le.init(e,t)}),ta=p("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Vr(n))}else t.pattern??(t.pattern=Vr());le.init(e,t)}),ra=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=wi),le.init(e,t)}),na=p("$ZodURL",(e,t)=>{le.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),oa=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ai()),le.init(e,t)}),ia=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=vi),le.init(e,t)}),aa=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pi),le.init(e,t)}),sa=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mi),le.init(e,t)}),ca=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=hi),le.init(e,t)}),la=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=gi),le.init(e,t)}),ua=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=yi),le.init(e,t)}),da=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Di(t)),le.init(e,t)}),_a=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Mi),le.init(e,t)}),fa=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Li(t)),le.init(e,t)}),pa=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bi),le.init(e,t)}),ma=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ei),le.init(e,t),e._zod.bag.format="ipv4"}),ha=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ti),le.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ga=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ni),le.init(e,t)}),ya=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ki),le.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,i]=n;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function en(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const va=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Oi),le.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{en(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ba(e){if(!Yr.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return en(r)}const Sa=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yr),le.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{ba(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),wa=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ii),le.init(e,t)});function Ca(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Aa=p("$ZodJWT",(e,t)=>{le.init(e,t),e._zod.check=r=>{Ca(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tn=p("$ZodNumber",(e,t)=>{_e.init(e,t),e._zod.pattern=e._zod.bag.pattern??Fi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),Ea=p("$ZodNumberFormat",(e,t)=>{Ui.init(e,t),tn.init(e,t)}),Ta=p("$ZodBoolean",(e,t)=>{_e.init(e,t),e._zod.pattern=xi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Na=p("$ZodUnknown",(e,t)=>{_e.init(e,t),e._zod.parse=r=>r}),ka=p("$ZodNever",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function rn(e,t,r){e.issues.length&&t.issues.push(...Zr(r,e.issues)),t.value[r]=e.value}const Oa=p("$ZodArray",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const s=o[a],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?i.push(c.then(u=>rn(u,r,a))):rn(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function At(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Zr(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function nn(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=Vo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function on(e,t,r,n,o,i){const a=[],s=o.keySet,c=o.catchall._zod,u=c.def.type,d=c.optout==="optional";for(const f in t){if(s.has(f))continue;if(u==="never"){a.push(f);continue}const m=c.run({value:t[f],issues:[]},n);m instanceof Promise?e.push(m.then(g=>At(g,r,f,t,d))):At(m,r,f,t,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const Ia=p("$ZodObject",(e,t)=>{if(_e.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=Xt(()=>nn(t));ne(e._zod,"propValues",()=>{const s=t.shape,c={};for(const u in s){const d=s[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(const f of d.values)c[u].add(f)}}return c});const o=vt,i=t.catchall;let a;e._zod.parse=(s,c)=>{a??(a=n.value);const u=s.value;if(!o(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};const d=[],f=a.shape;for(const m of a.keys){const g=f[m],y=g._zod.optout==="optional",h=g._zod.run({value:u[m],issues:[]},c);h instanceof Promise?d.push(h.then(ie=>At(ie,s,m,u,y))):At(h,s,m,u,y)}return i?on(d,u,s,c,n.value,e):d.length?Promise.all(d).then(()=>s):s}}),Ma=p("$ZodObjectJIT",(e,t)=>{Ia.init(e,t);const r=e._zod.parse,n=Xt(()=>nn(t)),o=m=>{const g=new Qi(["shape","payload","ctx"]),y=n.value,h=ee=>{const D=Rr(ee);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};g.write("const input = payload.value;");const ie=Object.create(null);let te=0;for(const ee of y.keys)ie[ee]=`key_${te++}`;g.write("const newResult = {};");for(const ee of y.keys){const D=ie[ee],M=Rr(ee),P=m[ee]?._zod?.optout==="optional";g.write(`const ${D} = ${h(ee)};`),P?g.write(`
|
|
5
|
+
if (${D}.issues.length) {
|
|
6
|
+
if (${M} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${D}.value === undefined) {
|
|
15
|
+
if (${M} in input) {
|
|
16
|
+
newResult[${M}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${M}] = ${D}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):g.write(`
|
|
23
|
+
if (${D}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${D}.value === undefined) {
|
|
31
|
+
if (${M} in input) {
|
|
32
|
+
newResult[${M}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${M}] = ${D}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`)}g.write("payload.value = newResult;"),g.write("return payload;");const X=g.compile();return(ee,D)=>X(m,ee,D)};let i;const a=vt,s=!xr.jitless,u=s&&Wo.value,d=t.catchall;let f;e._zod.parse=(m,g)=>{f??(f=n.value);const y=m.value;return a(y)?s&&u&&g?.async===!1&&g.jitless!==!0?(i||(i=o(t.shape)),m=i(m,g),d?on([],y,m,g,f,e):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),m)}});function an(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!et(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Ge(a,n,je())))}),t)}const La=p("$ZodUnion",(e,t)=>{_e.init(e,t),ne(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ne(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ne(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ne(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>tr(i.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let a=!1;const s=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(c=>an(c,o,e,i)):an(s,o,e,i)}}),Da=p("$ZodIntersection",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,i=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,u])=>sn(r,c,u)):sn(r,i,a)}});function ar(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ct(e)&&ct(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(const i of n){const a=ar(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],i=t[n],a=ar(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function sn(e,t,r){const n=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(s);const i=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&o&&e.issues.push({...o,keys:i}),et(e))return e;const a=ar(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Pa=p("$ZodEnum",(e,t)=>{_e.init(e,t);const r=Br(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Go.has(typeof o)).map(o=>typeof o=="string"?Xe(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),$a=p("$ZodLiteral",(e,t)=>{if(_e.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Xe(n):n?Xe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{const i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Fa=p("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fr(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new Qe;return r.value=o,r}});function cn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ln=p("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${tr(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>cn(i,r.value)):cn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),xa=p("$ZodExactOptional",(e,t)=>{ln.init(e,t),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Ba=p("$ZodNullable",(e,t)=>{_e.init(e,t),ne(e._zod,"optin",()=>t.innerType._zod.optin),ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${tr(r.source)}|null)$`):void 0}),ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),za=p("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>un(i,t)):un(o,t)}});function un(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ra=p("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Ua=p("$ZodNonOptional",(e,t)=>{_e.init(e,t),ne(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>dn(i,e)):dn(o,e)}});function dn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ha=p("$ZodCatch",(e,t)=>{_e.init(e,t),ne(e._zod,"optin",()=>t.innerType._zod.optin),ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Ge(a,n,je()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Ge(i,n,je()))},input:r.value}),r.issues=[]),r)}}),Za=p("$ZodPipe",(e,t)=>{_e.init(e,t),ne(e._zod,"values",()=>t.in._zod.values),ne(e._zod,"optin",()=>t.in._zod.optin),ne(e._zod,"optout",()=>t.out._zod.optout),ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(a=>Et(a,t.in,n)):Et(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Et(i,t.out,n)):Et(o,t.out,n)}});function Et(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const ja=p("$ZodReadonly",(e,t)=>{_e.init(e,t),ne(e._zod,"propValues",()=>t.innerType._zod.propValues),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"optin",()=>t.innerType?._zod?.optin),ne(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(_n):_n(o)}});function _n(e){return e.value=Object.freeze(e.value),e}const Wa=p("$ZodCustom",(e,t)=>{Ee.init(e,t),_e.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>fn(i,r,n,e));fn(o,r,n,e)}});function fn(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(lt(o))}}var pn;class Ga{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Va(){return new Ga}(pn=globalThis).__zod_globalRegistry??(pn.__zod_globalRegistry=Va());const ut=globalThis.__zod_globalRegistry;function Ya(e,t){return new e({type:"string",...L(t)})}function Ka(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...L(t)})}function mn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...L(t)})}function Ja(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...L(t)})}function qa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...L(t)})}function Qa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...L(t)})}function Xa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...L(t)})}function es(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...L(t)})}function ts(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...L(t)})}function rs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...L(t)})}function ns(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...L(t)})}function os(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...L(t)})}function is(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...L(t)})}function as(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...L(t)})}function ss(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...L(t)})}function cs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...L(t)})}function ls(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...L(t)})}function us(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...L(t)})}function ds(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...L(t)})}function _s(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...L(t)})}function fs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...L(t)})}function ps(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...L(t)})}function ms(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...L(t)})}function hs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...L(t)})}function gs(e,t){return new e({type:"string",format:"date",check:"string_format",...L(t)})}function ys(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...L(t)})}function vs(e,t){return new e({type:"string",format:"duration",check:"string_format",...L(t)})}function bs(e,t){return new e({type:"number",coerce:!0,checks:[],...L(t)})}function Ss(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...L(t)})}function ws(e,t){return new e({type:"boolean",...L(t)})}function Cs(e){return new e({type:"unknown"})}function As(e,t){return new e({type:"never",...L(t)})}function hn(e,t){return new Qr({check:"less_than",...L(t),value:e,inclusive:!1})}function sr(e,t){return new Qr({check:"less_than",...L(t),value:e,inclusive:!0})}function gn(e,t){return new Xr({check:"greater_than",...L(t),value:e,inclusive:!1})}function cr(e,t){return new Xr({check:"greater_than",...L(t),value:e,inclusive:!0})}function yn(e,t){return new Ri({check:"multiple_of",...L(t),value:e})}function vn(e,t){return new Hi({check:"max_length",...L(t),maximum:e})}function Tt(e,t){return new Zi({check:"min_length",...L(t),minimum:e})}function bn(e,t){return new ji({check:"length_equals",...L(t),length:e})}function Es(e,t){return new Wi({check:"string_format",format:"regex",...L(t),pattern:e})}function Ts(e){return new Gi({check:"string_format",format:"lowercase",...L(e)})}function Ns(e){return new Vi({check:"string_format",format:"uppercase",...L(e)})}function ks(e,t){return new Yi({check:"string_format",format:"includes",...L(t),includes:e})}function Os(e,t){return new Ki({check:"string_format",format:"starts_with",...L(t),prefix:e})}function Is(e,t){return new Ji({check:"string_format",format:"ends_with",...L(t),suffix:e})}function tt(e){return new qi({check:"overwrite",tx:e})}function Ms(e){return tt(t=>t.normalize(e))}function Ls(){return tt(e=>e.trim())}function Ds(){return tt(e=>e.toLowerCase())}function Ps(){return tt(e=>e.toUpperCase())}function $s(){return tt(e=>jo(e))}function Fs(e,t,r){return new e({type:"array",element:t,...L(r)})}function xs(e,t,r){return new e({type:"custom",check:"custom",fn:t,...L(r)})}function Bs(e){const t=zs(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(lt(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(lt(o))}},e(r.value,r)));return t}function zs(e,t){const r=new Ee({check:"custom",...L(t)});return r._zod.check=e,r}function Sn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ut,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function be(e,t,r={path:[],schemaPath:[]}){var n;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{const m=a.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,m,d)}const f=e._zod.parent;f&&(a.ref||(a.ref=f),be(f,t,d),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&Ae(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function wn(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const a of e.seen.entries()){const s=e.metadataRegistry.get(a[0])?.id;if(s){const c=n.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,a[0])}}const o=a=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(a[0])?.id,m=e.external.uri??(y=>y);if(f)return{ref:m(f)};const g=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=g,{defId:g,ref:`${m("__shared")}#/${s}/${g}`}}if(a[1]===r)return{ref:"#"};const u=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=a=>{if(a[1].schema.$ref)return;const s=a[1],{ref:c,defId:u}=o(a);s.def={...s.schema},u&&(s.defId=u);const d=s.schema;for(const f in d)delete d[f];d.$ref=c};if(e.cycles==="throw")for(const a of e.seen.entries()){const s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
39
|
+
|
|
40
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const s=a[1];if(t===a[0]){i(a);continue}if(e.external){const u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function Cn(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=a=>{const s=e.seen.get(a);if(s.ref===null)return;const c=s.def??s.schema,u={...c},d=s.ref;if(s.ref=null,d){n(d);const m=e.seen.get(d),g=m.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,u),a._zod.parent===d)for(const h in c)h==="$ref"||h==="allOf"||h in u||delete c[h];if(g.$ref&&m.def)for(const h in c)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(c[h])===JSON.stringify(m.def[h])&&delete c[h]}const f=a._zod.parent;if(f&&f!==d){n(f);const m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(const g in c)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(c[g])===JSON.stringify(m.def[g])&&delete c[g]}e.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};for(const a of[...e.seen.entries()].reverse())n(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,r.def??r.schema);const i=e.external?.defs??{};for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(i[s.defId]=s.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Nt(t,"input",e.processors),output:Nt(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ae(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ae(n.element,r);if(n.type==="set")return Ae(n.valueType,r);if(n.type==="lazy")return Ae(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ae(n.innerType,r);if(n.type==="intersection")return Ae(n.left,r)||Ae(n.right,r);if(n.type==="record"||n.type==="map")return Ae(n.keyType,r)||Ae(n.valueType,r);if(n.type==="pipe")return Ae(n.in,r)||Ae(n.out,r);if(n.type==="object"){for(const o in n.shape)if(Ae(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(Ae(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(Ae(o,r))return!0;return!!(n.rest&&Ae(n.rest,r))}return!1}const Rs=(e,t={})=>r=>{const n=Sn({...r,processors:t});return be(e,n),wn(n,e),Cn(n,e)},Nt=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},a=Sn({...o??{},target:i,io:t,processors:r});return be(e,a),wn(a,e),Cn(a,e)},Us={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hs=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=Us[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const d=[...c];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Zs=(e,t,r,n)=>{const o=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),typeof i=="number"&&(o.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof a=="number"&&(o.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},js=(e,t,r,n)=>{r.type="boolean"},Ws=(e,t,r,n)=>{r.not={}},Gs=(e,t,r,n)=>{},Vs=(e,t,r,n)=>{const o=e._zod.def,i=Br(o.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Ys=(e,t,r,n)=>{const o=e._zod.def,i=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Ks=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Js=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},qs=(e,t,r,n)=>{const o=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=be(i.element,t,{...n,path:[...n.path,"items"]})},Qs=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const u in a)o.properties[u]=be(a[u],t,{...n,path:[...n.path,"properties",u]});const s=new Set(Object.keys(a)),c=new Set([...s].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=be(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Xs=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,c)=>be(s,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},ec=(e,t,r,n)=>{const o=e._zod.def,i=be(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=be(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},tc=(e,t,r,n)=>{const o=e._zod.def,i=be(o.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},rc=(e,t,r,n)=>{const o=e._zod.def;be(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},nc=(e,t,r,n)=>{const o=e._zod.def;be(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},oc=(e,t,r,n)=>{const o=e._zod.def;be(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},ic=(e,t,r,n)=>{const o=e._zod.def;be(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},ac=(e,t,r,n)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;be(i,t,n);const a=t.seen.get(e);a.ref=i},sc=(e,t,r,n)=>{const o=e._zod.def;be(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},An=(e,t,r,n)=>{const o=e._zod.def;be(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},cc=p("ZodISODateTime",(e,t)=>{da.init(e,t),ue.init(e,t)});function lc(e){return hs(cc,e)}const uc=p("ZodISODate",(e,t)=>{_a.init(e,t),ue.init(e,t)});function dc(e){return gs(uc,e)}const _c=p("ZodISOTime",(e,t)=>{fa.init(e,t),ue.init(e,t)});function fc(e){return ys(_c,e)}const pc=p("ZodISODuration",(e,t)=>{pa.init(e,t),ue.init(e,t)});function mc(e){return vs(pc,e)}const Ie=p("ZodError",(e,t)=>{Wr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ni(e,r)},flatten:{value:r=>ri(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Qt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Qt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),hc=nr(Ie),gc=or(Ie),yc=St(Ie),vc=wt(Ie),bc=ai(Ie),Sc=si(Ie),wc=ci(Ie),Cc=li(Ie),Ac=ui(Ie),Ec=di(Ie),Tc=_i(Ie),Nc=fi(Ie),fe=p("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nt(e,"input"),output:Nt(e,"output")}}),e.toJSONSchema=Rs(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ze(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Re(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>hc(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>yc(e,r,n),e.parseAsync=async(r,n)=>gc(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>vc(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>bc(e,r,n),e.decode=(r,n)=>Sc(e,r,n),e.encodeAsync=async(r,n)=>wc(e,r,n),e.decodeAsync=async(r,n)=>Cc(e,r,n),e.safeEncode=(r,n)=>Ac(e,r,n),e.safeDecode=(r,n)=>Ec(e,r,n),e.safeEncodeAsync=async(r,n)=>Tc(e,r,n),e.safeDecodeAsync=async(r,n)=>Nc(e,r,n),e.refine=(r,n)=>e.check(Cl(r,n)),e.superRefine=r=>e.check(Al(r)),e.overwrite=r=>e.check(tt(r)),e.optional=()=>Ln(e),e.exactOptional=()=>ul(e),e.nullable=()=>Dn(e),e.nullish=()=>Ln(Dn(e)),e.nonoptional=r=>hl(e,r),e.array=()=>Xc(e),e.or=r=>In([e,r]),e.and=r=>ol(e,r),e.transform=r=>$n(e,cl(r)),e.default=r=>fl(e,r),e.prefault=r=>ml(e,r),e.catch=r=>yl(e,r),e.pipe=r=>$n(e,r),e.readonly=()=>Sl(e),e.describe=r=>{const n=e.clone();return ut.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return ut.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ut.get(e);const n=e.clone();return ut.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),En=p("_ZodString",(e,t)=>{ir.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Hs(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Es(...n)),e.includes=(...n)=>e.check(ks(...n)),e.startsWith=(...n)=>e.check(Os(...n)),e.endsWith=(...n)=>e.check(Is(...n)),e.min=(...n)=>e.check(Tt(...n)),e.max=(...n)=>e.check(vn(...n)),e.length=(...n)=>e.check(bn(...n)),e.nonempty=(...n)=>e.check(Tt(1,...n)),e.lowercase=n=>e.check(Ts(n)),e.uppercase=n=>e.check(Ns(n)),e.trim=()=>e.check(Ls()),e.normalize=(...n)=>e.check(Ms(...n)),e.toLowerCase=()=>e.check(Ds()),e.toUpperCase=()=>e.check(Ps()),e.slugify=()=>e.check($s())}),kc=p("ZodString",(e,t)=>{ir.init(e,t),En.init(e,t),e.email=r=>e.check(Ka(Oc,r)),e.url=r=>e.check(es(Ic,r)),e.jwt=r=>e.check(ms(Wc,r)),e.emoji=r=>e.check(ts(Mc,r)),e.guid=r=>e.check(mn(Tn,r)),e.uuid=r=>e.check(Ja(kt,r)),e.uuidv4=r=>e.check(qa(kt,r)),e.uuidv6=r=>e.check(Qa(kt,r)),e.uuidv7=r=>e.check(Xa(kt,r)),e.nanoid=r=>e.check(rs(Lc,r)),e.guid=r=>e.check(mn(Tn,r)),e.cuid=r=>e.check(ns(Dc,r)),e.cuid2=r=>e.check(os(Pc,r)),e.ulid=r=>e.check(is($c,r)),e.base64=r=>e.check(_s(Hc,r)),e.base64url=r=>e.check(fs(Zc,r)),e.xid=r=>e.check(as(Fc,r)),e.ksuid=r=>e.check(ss(xc,r)),e.ipv4=r=>e.check(cs(Bc,r)),e.ipv6=r=>e.check(ls(zc,r)),e.cidrv4=r=>e.check(us(Rc,r)),e.cidrv6=r=>e.check(ds(Uc,r)),e.e164=r=>e.check(ps(jc,r)),e.datetime=r=>e.check(lc(r)),e.date=r=>e.check(dc(r)),e.time=r=>e.check(fc(r)),e.duration=r=>e.check(mc(r))});function Ve(e){return Ya(kc,e)}const ue=p("ZodStringFormat",(e,t)=>{le.init(e,t),En.init(e,t)}),Oc=p("ZodEmail",(e,t)=>{ra.init(e,t),ue.init(e,t)}),Tn=p("ZodGUID",(e,t)=>{ea.init(e,t),ue.init(e,t)}),kt=p("ZodUUID",(e,t)=>{ta.init(e,t),ue.init(e,t)}),Ic=p("ZodURL",(e,t)=>{na.init(e,t),ue.init(e,t)}),Mc=p("ZodEmoji",(e,t)=>{oa.init(e,t),ue.init(e,t)}),Lc=p("ZodNanoID",(e,t)=>{ia.init(e,t),ue.init(e,t)}),Dc=p("ZodCUID",(e,t)=>{aa.init(e,t),ue.init(e,t)}),Pc=p("ZodCUID2",(e,t)=>{sa.init(e,t),ue.init(e,t)}),$c=p("ZodULID",(e,t)=>{ca.init(e,t),ue.init(e,t)}),Fc=p("ZodXID",(e,t)=>{la.init(e,t),ue.init(e,t)}),xc=p("ZodKSUID",(e,t)=>{ua.init(e,t),ue.init(e,t)}),Bc=p("ZodIPv4",(e,t)=>{ma.init(e,t),ue.init(e,t)}),zc=p("ZodIPv6",(e,t)=>{ha.init(e,t),ue.init(e,t)}),Rc=p("ZodCIDRv4",(e,t)=>{ga.init(e,t),ue.init(e,t)}),Uc=p("ZodCIDRv6",(e,t)=>{ya.init(e,t),ue.init(e,t)}),Hc=p("ZodBase64",(e,t)=>{va.init(e,t),ue.init(e,t)}),Zc=p("ZodBase64URL",(e,t)=>{Sa.init(e,t),ue.init(e,t)}),jc=p("ZodE164",(e,t)=>{wa.init(e,t),ue.init(e,t)}),Wc=p("ZodJWT",(e,t)=>{Aa.init(e,t),ue.init(e,t)}),Nn=p("ZodNumber",(e,t)=>{tn.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Zs(e,n,o),e.gt=(n,o)=>e.check(gn(n,o)),e.gte=(n,o)=>e.check(cr(n,o)),e.min=(n,o)=>e.check(cr(n,o)),e.lt=(n,o)=>e.check(hn(n,o)),e.lte=(n,o)=>e.check(sr(n,o)),e.max=(n,o)=>e.check(sr(n,o)),e.int=n=>e.check(kn(n)),e.safe=n=>e.check(kn(n)),e.positive=n=>e.check(gn(0,n)),e.nonnegative=n=>e.check(cr(0,n)),e.negative=n=>e.check(hn(0,n)),e.nonpositive=n=>e.check(sr(0,n)),e.multipleOf=(n,o)=>e.check(yn(n,o)),e.step=(n,o)=>e.check(yn(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null}),Gc=p("ZodNumberFormat",(e,t)=>{Ea.init(e,t),Nn.init(e,t)});function kn(e){return Ss(Gc,e)}const Vc=p("ZodBoolean",(e,t)=>{Ta.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>js(e,r,n)});function Yc(e){return ws(Vc,e)}const Kc=p("ZodUnknown",(e,t)=>{Na.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gs()});function On(){return Cs(Kc)}const Jc=p("ZodNever",(e,t)=>{ka.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ws(e,r,n)});function qc(e){return As(Jc,e)}const Qc=p("ZodArray",(e,t)=>{Oa.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qs(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(Tt(r,n)),e.nonempty=r=>e.check(Tt(1,r)),e.max=(r,n)=>e.check(vn(r,n)),e.length=(r,n)=>e.check(bn(r,n)),e.unwrap=()=>e.element});function Xc(e,t){return Fs(Qc,e,t)}const el=p("ZodObject",(e,t)=>{Ma.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qs(e,r,n,o),ne(e,"shape",()=>t.shape),e.keyof=()=>rt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:On()}),e.loose=()=>e.clone({...e._zod.def,catchall:On()}),e.strict=()=>e.clone({...e._zod.def,catchall:qc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>qo(e,r),e.safeExtend=r=>Qo(e,r),e.merge=r=>Xo(e,r),e.pick=r=>Ko(e,r),e.omit=r=>Jo(e,r),e.partial=(...r)=>ei(Mn,e,r[0]),e.required=(...r)=>ti(Pn,e,r[0])});function tl(e,t){const r={type:"object",shape:e??{},...L(t)};return new el(r)}const rl=p("ZodUnion",(e,t)=>{La.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xs(e,r,n,o),e.options=t.options});function In(e,t){return new rl({type:"union",options:e,...L(t)})}const nl=p("ZodIntersection",(e,t)=>{Da.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ec(e,r,n,o)});function ol(e,t){return new nl({type:"intersection",left:e,right:t})}const lr=p("ZodEnum",(e,t)=>{Pa.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Vs(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const a of n)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new lr({...t,checks:[],...L(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new lr({...t,checks:[],...L(o),entries:i})}});function rt(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new lr({type:"enum",entries:r,...L(t)})}const il=p("ZodLiteral",(e,t)=>{$a.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ys(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function al(e,t){return new il({type:"literal",values:Array.isArray(e)?e:[e],...L(t)})}const sl=p("ZodTransform",(e,t)=>{Fa.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Js(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(lt(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(lt(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function cl(e){return new sl({type:"transform",transform:e})}const Mn=p("ZodOptional",(e,t)=>{ln.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>An(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ln(e){return new Mn({type:"optional",innerType:e})}const ll=p("ZodExactOptional",(e,t)=>{xa.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>An(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ul(e){return new ll({type:"optional",innerType:e})}const dl=p("ZodNullable",(e,t)=>{Ba.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>tc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Dn(e){return new dl({type:"nullable",innerType:e})}const _l=p("ZodDefault",(e,t)=>{za.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fl(e,t){return new _l({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Hr(t)}})}const pl=p("ZodPrefault",(e,t)=>{Ra.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ml(e,t){return new pl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Hr(t)}})}const Pn=p("ZodNonOptional",(e,t)=>{Ua.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function hl(e,t){return new Pn({type:"nonoptional",innerType:e,...L(t)})}const gl=p("ZodCatch",(e,t)=>{Ha.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ic(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yl(e,t){return new gl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vl=p("ZodPipe",(e,t)=>{Za.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ac(e,r,n,o),e.in=t.in,e.out=t.out});function $n(e,t){return new vl({type:"pipe",in:e,out:t})}const bl=p("ZodReadonly",(e,t)=>{ja.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new bl({type:"readonly",innerType:e})}const wl=p("ZodCustom",(e,t)=>{Wa.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ks(e,r)});function Cl(e,t={}){return xs(wl,e,t)}function Al(e){return Bs(e)}const ur={custom:"custom"};function ge(e){return bs(Nn,e)}const Fn=new Date().getUTCFullYear(),Ot=Ve().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),xn=In([al(""),Ve().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),El=(e,t,r)=>ge({error:`${e} must be a number.`}).min(t,`${e} must be between ${t.toLocaleString()} and ${r.toLocaleString()}.`).max(r,`${e} must be between ${t.toLocaleString()} and ${r.toLocaleString()}.`).int(`${e} must be a whole number.`),nt=(e,t)=>ge({error:`${e} must be a number.`}).min(0,`${e} must be between 0 and ${t.toLocaleString()}.`).max(t,`${e} must be between 0 and ${t.toLocaleString()}.`).int(`${e} must be a whole number.`),It=(e,t=1600)=>ge({error:`${e} must be a valid 4-digit year.`}).int(`${e} must be a whole number.`).min(t,`${e} should be between ${t} and the current year.`).max(Fn,`${e} cannot be in the future.`),Mt=e=>ge({error:`${e} must be a number.`}).int(`${e} must be a whole number.`).min(0,`${e} must be between 0 and 99.`).max(99,`${e} must be between 0 and 99.`),dt=(e,t,r=0)=>{const n=Math.pow(10,t)-1,o=n.toLocaleString("en-US"),i=r.toLocaleString("en-US");return ge({error:`${e} must be a number.`}).min(r,`${e}: Value must be between ${i} and ${o}.`).max(n,`${e}: Value must be between ${i} and ${o}.`).int(`${e} must be a whole number.`)},Tl={email:Ve().trim().min(1,"Required").email("Please enter a valid email address."),phone:Ve().trim().min(1,"Required").refine(e=>{let t=e.replace(/\D/g,"");return t.length===11&&t.startsWith("1")&&(t=t.slice(1)),t.length===10},"Please enter a valid 10-digit US phone number."),social_security_number:Ve().trim().refine(e=>e===""||/^\d{3}-\d{2}-\d{4}$/.test(e),"Social Security Number must be in the format XXX-XX-XXXX.").optional(),sms_code:Ve().trim().min(1,"Required").regex(/^\d{6}$/,"Please enter the 6-digit code."),first_name:Ot,last_name:Ot,middle_name:xn,co_applicant_first_name:Ot,co_applicant_last_name:Ot,co_applicant_middle_name:xn,year_built:It("Year built",1800),year_roof_updated:ge({error:"Please enter a valid 4-digit year."}).int("Year must be a whole number.").min(1e3,"Please enter a valid 4-digit year.").max(9999,"Please enter a valid 4-digit year."),heating_update_year:It("Heating update year"),plumbing_update_year:It("Plumbing update year"),electrical_update_year:It("Electrical update year"),total_area_sq_ft:El("Square footage",1,999999),sale_price_cents:ge({error:"Purchase Price must be a number."}).min(1,"Purchase Price must be between 1 and 21,474,836.").max(21474836,"Purchase Price must be between 1 and 21,474,836.").int("Purchase Price must be a whole number."),home_prior_years:Mt("Number of years with your prior carrier"),home_continuous_coverage_years:Mt("How long you have had continuous home coverage"),household_size:ge({error:"Household size must be a number."}).min(1,"Occupants must be between 1 and 8.").max(8,"Occupants must be between 1 and 8.").int("Occupants must be between 1 and 8."),number_of_mortgagees:ge({error:"Number of mortgagees must be a number."}).int().min(0,"Number of mortgagees cannot be negative.").max(3,"Number of mortgagees must be between 0 and 3."),dwelling_replacement_cost:dt("Replacement cost",9,1),other_structures_coverage:dt("Other structures",9),personal_property_coverage:dt("Personal property",7),loss_of_use_coverage:dt("Loss of use coverage",8),years_at_address:ge({error:"Years at address must be a number."}).int().min(0,"Years at address cannot be negative.").max(100,"Years at address must be 100 or less."),months_at_address:ge({error:"Months at address must be a number."}).int().min(0,"Months at address cannot be negative.").max(11,"Months at address must be between 0 and 11."),years_at_prior_address:ge({error:"Years at prior address must be a number."}).int().min(0,"Years at prior address cannot be negative.").max(100,"Years at prior address must be 100 or less."),number_of_units:ge({error:"Number of units must be a number."}).int().min(1,"Number of units/apartments should be greater than 0.").max(99,"Number of units/apartments must be between 1 and 99."),number_of_families:ge({error:"Number of families must be a number."}).int("Number of families must be a whole number.").refine(e=>e>=1&&e<=5,{message:"Number of families must be between 1 and 5."}),number_of_dogs:ge({error:"Number of dogs must be a number."}).int().min(0,"Number of dogs must be between 0 and 99.").max(99,"Number of dogs must be between 0 and 99."),distance_to_coast_miles:ge({error:"Distance to coast must be a number."}).int().min(0,"Distance to coast cannot be negative.").max(9999,"Distance to coast must be at most 4 digits."),amount_paid_cents:dt("Amount paid",7),vin:Ve().superRefine((e,t)=>{if(typeof e!="string"||e.trim()==="")return;if(/\s/.test(e)){t.addIssue({code:ur.custom,message:"VIN cannot contain spaces."});return}const r=e.trim();/^[A-HJ-NPR-Z0-9]{17}$/i.test(r)||t.addIssue({code:ur.custom,message:"VIN must be exactly 17 letters and numbers (excluding I, O, and Q)."})}),annual_mileage:ge({error:"Annual mileage must be a number."}).int("Annual mileage must be a whole number.").min(1e3,"Vehicle annual use should be between 1,000 & 100,000 miles.").max(1e5,"Vehicle annual use should be between 1,000 & 100,000 miles."),miles_to_work:ge({error:"Miles driven to work/school must be a number."}).int("Miles driven to work/school must be a whole number.").min(1,"Please enter a value greater than 0.").max(9999,"Miles driven to work/school must be between 1 and 9,999."),custom_equipment_value_cents:nt("Modifications value",9999999),cost_new_value_cents:nt("Cost new value",9999999),stated_value_amount_cents:nt("Stated Value Amount",9999999),property_damage_amount_paid_cents:nt("Property damage amount paid",9999999),personal_injury_amount_paid_cents:nt("Personal injury amount paid",9999999),auto_current_annual_premium_cents:nt("Current annual premium",9999999),auto_prior_years:Mt("Years with prior auto carrier"),auto_prior_months:ge({error:"Months with prior carrier must be a number."}).int().min(0,"Months with prior carrier must be between 0 and 11.").max(11,"Months with prior carrier must be between 0 and 11."),auto_continuous_coverage_years:Mt("Years with continuous auto coverage")};function he(e){return new Date(`${e}T00:00:00Z`)}function Se(){const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function Ue(e,t){let r=t.getUTCFullYear()-e.getUTCFullYear();const n=t.getUTCMonth()-e.getUTCMonth();return(n<0||n===0&&t.getUTCDate()<e.getUTCDate())&&r--,r}const Bn=[{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:e=>{const t=e.date_of_birth;if(!t||typeof t!="string")return;const r=he(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":Ue(r,Se())<18?"Applicant can't be under the age of 18.":void 0}},{targetKey:"co_applicant_date_of_birth",dependsOn:["co_applicant_date_of_birth"],validate:e=>{const t=e.co_applicant_date_of_birth;if(!t||typeof t!="string")return;const r=he(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":Ue(r,Se())<16?"Co-applicant can't be under the age of 16.":void 0}},{targetKey:"year_roof_updated",dependsOn:["year_roof_updated","year_built"],validate:e=>{const t=Number(e.year_roof_updated),r=Number(e.year_built);if(isNaN(t))return;const n=isNaN(r)?1e3:r;if(t<n||t>Fn)return"Roof renovation/replacement year must be between the home's build year and the current year."}},{targetKey:"move_in_date",dependsOn:["move_in_date","year_built"],validate:e=>{const t=e.move_in_date,r=e.year_built;if(!t||r==null)return;const n=he(String(t));if(isNaN(n.getTime()))return;const o=Number(r);if(!isNaN(o))return n.getUTCFullYear()<o?"Purchase date cannot be prior to the year the building was originally constructed.":void 0}},{targetKey:"date_first_licensed",dependsOn:["date_first_licensed"],validate:e=>{const t=e.date_first_licensed;if(!t||typeof t!="string")return;const r=he(t);return isNaN(r.getTime())?"Invalid date.":r>Se()?"Date first licensed cannot be in the future.":void 0}},{targetKey:"date_first_licensed",dependsOn:["date_first_licensed","date_of_birth"],validate:e=>{const t=e.date_first_licensed,r=e.date_of_birth;if(!t||typeof t!="string"||!r||typeof r!="string")return;const n=he(r),o=he(t);if(isNaN(n.getTime())||isNaN(o.getTime()))return;if(o<n)return"Date licensed cannot be before driver date of birth.";const i=new Date(Date.UTC(n.getUTCFullYear()+18,n.getUTCMonth(),n.getUTCDate()));return o<i?"Driver can't be licensed to drive before the age of 18.":void 0}},{targetKey:"occurred_at",dependsOn:["occurred_at"],validate:e=>{const t=e.occurred_at;if(!t||typeof t!="string")return;const r=he(t);return isNaN(r.getTime())?"Invalid date.":r>Se()?"Incident date cannot be in the future.":void 0}},{targetKey:"accident_prevention_course_date",dependsOn:["accident_prevention_course_date"],validate:e=>{const t=e.accident_prevention_course_date;if(!t||typeof t!="string")return;const r=he(t);return isNaN(r.getTime())?"Invalid date.":r>Se()?"Course date cannot be in the future.":void 0}},{targetKey:"effective_date",dependsOn:["effective_date"],validate:e=>{const t=e.effective_date;if(!t||typeof t!="string")return;const r=he(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Se(),o=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+3,n.getUTCDate()));if(r<n)return"Insurance start date cannot be in the past.";if(r>o)return"Insurance must begin within 3 months from today."}},{targetKey:"years_at_address",dependsOn:["years_at_address","date_of_birth"],validate:e=>{const t=e.years_at_address,r=e.date_of_birth;if(t==null||r==null||typeof r!="string")return;const n=Number(t);if(isNaN(n))return;const o=he(r);if(isNaN(o.getTime()))return;const i=Ue(o,Se());return n>i?"Time at address cannot be greater than the applicant age.":void 0}},{targetKey:"years_at_prior_address",dependsOn:["years_at_prior_address","date_of_birth"],validate:e=>{const t=e.years_at_prior_address,r=e.date_of_birth;if(t==null||r==null||typeof r!="string")return;const n=Number(t);if(isNaN(n))return;const o=he(r);if(isNaN(o.getTime()))return;const i=Ue(o,Se());return n>i?"Years at prior address cannot be greater than the applicant age.":void 0}},{targetKey:"home_prior_years",dependsOn:["home_prior_years","home_continuous_coverage_years"],validate:e=>{const t=e.home_prior_years,r=e.home_continuous_coverage_years;if(t==null||r==null)return;const n=Number(t),o=Number(r);if(!(isNaN(n)||isNaN(o)))return n>o?"Years with prior carrier cannot be higher than years with continuous coverage.":void 0}},{targetKey:"home_prior_years",dependsOn:["home_prior_years","date_of_birth"],validate:e=>{const t=e.home_prior_years,r=e.date_of_birth;if(t==null||r==null||typeof r!="string")return;const n=Number(t);if(isNaN(n))return;const o=he(r);if(isNaN(o.getTime()))return;const i=Ue(o,Se());return n>i?"Years with prior carrier cannot be greater than the Applicant's age.":void 0}},{targetKey:"home_continuous_coverage_years",dependsOn:["home_continuous_coverage_years","date_of_birth"],validate:e=>{const t=e.home_continuous_coverage_years,r=e.date_of_birth;if(t==null||r==null||typeof r!="string")return;const n=Number(t);if(isNaN(n))return;const o=he(r);if(isNaN(o.getTime()))return;const i=Ue(o,Se());return n>i?"Years with continuous home coverage cannot be greater than the Applicant's age.":void 0}},{targetKey:"move_in_date",dependsOn:["move_in_date"],validate:e=>{const t=e.move_in_date;if(!t||typeof t!="string")return;const r=he(t);return isNaN(r.getTime())?"Invalid date.":r>Se()?"Purchase date cannot be in the future.":void 0}},{targetKey:"date_of_incident",dependsOn:["date_of_incident"],validate:e=>{const t=e.date_of_incident;if(!t||typeof t!="string")return;const r=he(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Se();return r>n?"Loss date cannot be in the future.":void 0}},{targetKey:"home_prior_expiration_date",dependsOn:["home_prior_expiration_date"],validate:e=>{const t=e.home_prior_expiration_date;if(!t||typeof t!="string")return;const r=he(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Se(),o=new Date(Date.UTC(n.getUTCFullYear()-1,n.getUTCMonth(),n.getUTCDate())),i=new Date(Date.UTC(n.getUTCFullYear()+1,n.getUTCMonth(),n.getUTCDate()));if(r<o||r>i)return"Policy expiration date must be between 1 year ago and 1 year from now."}},{targetKey:"purchase_date",dependsOn:["purchase_date"],validate:e=>{const t=e.purchase_date;if(!t||typeof t!="string")return;const r=he(t);return isNaN(r.getTime())?"Invalid date.":r>Se()?"Vehicle purchase date cannot be in the future.":void 0}},{targetKey:"purchase_date",dependsOn:["purchase_date","year"],validate:e=>{const t=e.purchase_date,r=e.year;if(!t||typeof t!="string"||r==null)return;const n=he(t);if(isNaN(n.getTime()))return;const o=Number(r);if(!isNaN(o))return n.getUTCFullYear()<o?"The year the vehicle was purchased is not valid with the model year.":void 0}},{targetKey:"auto_prior_expiration_date",dependsOn:["auto_prior_expiration_date"],validate:e=>{const t=e.auto_prior_expiration_date;if(!t||typeof t!="string")return;const r=he(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Se(),o=new Date(Date.UTC(n.getUTCFullYear()-1,n.getUTCMonth(),n.getUTCDate())),i=new Date(Date.UTC(n.getUTCFullYear()+1,n.getUTCMonth(),n.getUTCDate()));if(r<o||r>i)return"Auto policy expiration date must be between 1 year ago and 1 year from now."}},{targetKey:"auto_prior_years",dependsOn:["auto_prior_years","auto_continuous_coverage_years"],validate:e=>{const t=e.auto_prior_years,r=e.auto_continuous_coverage_years;if(t==null||r==null)return;const n=Number(t),o=Number(r);if(!(isNaN(n)||isNaN(o)))return n>o?"Years with prior auto carrier cannot be higher than years with continuous coverage.":void 0}},{targetKey:"auto_prior_years",dependsOn:["auto_prior_years","date_of_birth"],validate:e=>{const t=e.auto_prior_years,r=e.date_of_birth;if(t==null||r==null||typeof r!="string")return;const n=Number(t);if(isNaN(n))return;const o=he(r);if(isNaN(o.getTime()))return;const i=Ue(o,Se());return n>i?"Years with prior auto carrier cannot be greater than the Applicant's age.":void 0}},{targetKey:"auto_continuous_coverage_years",dependsOn:["auto_continuous_coverage_years","date_of_birth"],validate:e=>{const t=e.auto_continuous_coverage_years,r=e.date_of_birth;if(t==null||r==null||typeof r!="string")return;const n=Number(t);if(isNaN(n))return;const o=he(r);if(isNaN(o.getTime()))return;const i=Ue(o,Se());return n>i?"Years with continuous auto coverage cannot be greater than the Applicant's age.":void 0}},{targetKey:"vehicle_coll_deductible",dependsOn:["vehicle_coll_deductible","vehicle_comp_deductible"],validate:e=>{const t=e.vehicle_coll_deductible,r=e.vehicle_comp_deductible;if(!(!t||typeof t!="string"||!r||typeof r!="string")&&r==="NoCoverage"&&t!=="NoCoverage")return"Collision Coverage cannot be chosen if Comprehensive is No Coverage."}},{targetKey:"policy_um",dependsOn:["policy_um","policy_bi"],validate:e=>{const t=e.policy_um,r=e.policy_bi;if(!t||typeof t!="string"||!r||typeof r!="string"||t==="Reject"||r==="Dontknow")return;const n=u=>u.endsWith("CSL"),o=n(t),i=n(r);if(o&&!i)return"A Combined Single Limit cannot be selected for Uninsured/Underinsured Motorist unless a Combined Single Limit has also been selected for Liability.";const a={cov30to60:30,cov50to100:50,cov100to100:100,cov100to300:100,cov250to500:250,cov300to300:300,cov500to500:500,cov100CSL:100,cov300CSL:300,cov500CSL:500},s=a[t],c=a[r];if(s!=null&&c!=null&&s>c)return"Uninsured/Underinsured Motorist Limit value cannot be greater than Bodily Injury Limit value."}},{targetKey:"policy_umpd",dependsOn:["policy_umpd","policy_pd"],validate:e=>{const t=e.policy_umpd,r=e.policy_pd;if(!t||typeof t!="string"||!r||typeof r!="string"||t==="NoCoverage"||r==="Dontknow")return;const n=a=>{if(!a.startsWith("cov"))return null;const s=parseInt(a.replace("cov",""),10);return isNaN(s)?null:s},o=n(t),i=n(r);if(o!=null&&i!=null&&o>i)return"Uninsured Motorist Property Damage Limit value cannot be greater than Liability Property Damage Limit value."}},{targetKey:"custom_equipment_value_cents",dependsOn:["custom_equipment_value_cents","stated_value_amount_cents"],validate:e=>{const t=e.custom_equipment_value_cents,r=e.stated_value_amount_cents;if(t==null||r==null)return;const n=Number(t),o=Number(r);if(!(isNaN(n)||isNaN(o))&&o>0&&n>0)return"Modifications should be included in the stated value of the vehicle. If a stated value quote is not required, remove the stated value."}}];function dr(e,t){const r=Tl[e];if(!r)return;const n=r.safeParse(t);return n.success?void 0:n.error.issues[0].message}function zn(e){if(/\s/.test(e))return!1;const t=e.trim();return t.length===17&&/^[A-HJ-NPR-Z0-9]{17}$/i.test(t)}function Nl(e,t){const r={};for(const n of Bn){if(t?.has(n.targetKey))continue;const o=n.validate(e);o&&(r[n.targetKey]=o)}return r}function _r(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Lt(e,t){return e.key??`${_r(e.question)}-${t}`}function He(e,t){return t==="number"?e==null||typeof e=="string"&&e.trim()==="":t==="checkbox"?e!==!0:e==null||typeof e=="string"&&e.trim()===""}function Dt(e,t){const r={};e.forEach((i,a)=>{const s=Lt(i,a),c=t[s];if(i.required&&He(c,i.inputType)){r[s]="Required";return}if(!He(c,i.inputType)){const u=dr(s,c);if(u){r[s]=u;return}}});const n=new Set(Object.keys(r).filter(i=>r[i])),o=Nl(t,n);for(const[i,a]of Object.entries(o))r[i]=a;return r}function kl(e){if(e===""||e===null||e===void 0)return;const t=Number(e);return Number.isNaN(t)?void 0:t}const Ol=new Set(["Home","HomeConstruction","HomeFeatures"]),Il=new Set(["HomePolicy","BundlePolicy"]),Ml=new Set(["HomeCustomer","BundleCustomer"]);function fr(e,t){return e==="has_health_insurance_auto_accident"?t!=="BundleCustomer":e==="household_size"?!(t&&Ol.has(t)):e==="number_of_mortgagees"?!(t&&Il.has(t)):(e==="has_co_applicant"||e==="co_applicant_middle_name"||e==="co_applicant_relationship")&&t&&Ml.has(t)?!1:e==="multi_policy_discount"&&t==="HomePolicy"?!0:Ll.has(e)}const Ll=new Set(["anti_theft_type","passive_restraint_type","anti_lock_brakes","daytime_running_lights","vehicle_full_glass","vehicle_loan_lease","percent_to_work","stated_value_amount_cents","vehicle_comp_deductible","vehicle_coll_deductible","vehicle_towing_and_labor","vehicle_transportation_expense","accident_prevention_course","driver_accidents","driver_violations","losses","middle_name","ssn_display","has_health_insurance_auto_accident","auto_prior_years","auto_prior_months","auto_continuous_coverage_years","auto_current_annual_premium_cents","has_co_applicant","co_applicant_middle_name","co_applicant_relationship","tort_threshold","pip_coverage_type","extended_medical","additional_pip","policy_pip_deductible","is_corporation"]),Dl={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"},Pl={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},$l={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"},Fl={Business:"Business",Pleasure:"Pleasure",Farming:"Farming",To_FromWork:"To/From Work",To_FromSchool:"To/From School"},xl={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"},Bl={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"},zl={Dontknow:"Don't Know",cov30to60:"30/60",cov35to70:"35/70",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"},Rl={Reject:"Reject",cov30to60:"30/60",cov35to70:"35/70",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"},Ul={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},Hl={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"},Zl={cov25000:"25,000",cov35000:"35,000",cov50000:"50,000",cov100000:"100,000",cov200000:"200,000",cov250000:"250,000",cov300000:"300,000",cov500000:"500,000"},jl={cov15000:"15,000",cov2500:"2,500",cov5000:"5,000",cov10000:"10,000",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov75000:"75,000",cov150000:"150,000"},Wl={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},pr={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",Thousand:"1,000",TwoThousand:"2,000"},Rn={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},Un={NoCoverage:"No Coverage",cov20to600:"20/600",cov25to750:"25/750",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500"},Hn={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"},Gl={TwoFamilyHome:"2-Family Home",American4square:"American 4-square",Basic:"Basic",BiLevel:"Bi-Level",Bungalow:"Bungalow",CapeCod:"Cape Cod",Colonial:"Colonial",ColonialSpanish:"Colonial - Spanish",CompletelyCustom:"Completely Custom",Contemporary:"Contemporary",ContractorModern:"Contractor Modern",Farmhouse:"Farmhouse",Folk:"Folk",Log:"Log",Mediterranean:"Mediterranean",Ranch:"Ranch",TriLevel:"Tri-Level",Tudor:"Tudor",Vernacular:"Vernacular",Victorian:"Victorian"},Vl={SingleFamilyHouse:"Single Family House",Townhouse:"Townhouse",Rowhouse:"Rowhouse",Duplex:"Duplex/Two Family Unit",Triplex:"Tri-plex/Three Family Unit",Fourplex:"Four-plex/Four Family Unit",MultFamily:"Multi-family (more than four units)"},Yl={OwnerPrimary:"Owner Primary",OwnerSecondary:"Owner Secondary",OwnerSeasonal:"Owner Seasonal"},Kl={Basic:"Basic",Modest:"Modest",Average:"Average",AboveAverage:"Above Average",Expensive:"Expensive",VeryExpensive:"Very Expensive",Opulent:"Opulent"},Jl={Frame:"Frame",Masonry:"Masonry",MasonryVeneer:"Masonry Veneer",Log:"Log",Asbestos:"Asbestos",EFIS:"EFIS",HardiPlank:"HardiPlank",SuperiorFireResistive:"Superior Fire Resistive",SuperiorMasonryNonCombustible:"Superior Masonry Non Combustible",SuperiorNonCombustible:"Superior Non Combustible"},ql={Slab:"Slab",Basement:"Basement",CrawlSpace:"Crawl Space",PartialBasement:"Partial Basement",PiersPostsPiles:"Piers / Posts / Piles",Open:"Open"},Ql={NotOverWater:"No",PartiallyOverWater:"Partially Over Water",FullyOrEntirelyOverWater:"Fully or Entirely Over Water"},Xl={One:"1",OneHalf:"1.5",Two:"2",TwoHalf:"2.5",Three:"3",ThreeHalf:"3.5",Four:"4",BiLevel:"Bi-Level",TriLevel:"Tri-Level"},eu={VinylSiding:"Vinyl Siding",WoodFraming:"Wood Framing",BrickVeneer:"Brick Veneer",Stucco:"Stucco",AdobeBlock:"Adobe Block",AluminumSiding:"Aluminum Siding",CementFiberShingles:"Cement Fiber Shingles",Clapboard:"Clapboard",ConcreteBlock:"Concrete Block",HardboardSiding:"Hardboard Siding",InsulatedConcreteForms:"Insulated Concrete Forms",LightGaugeSteelFraming:"Light Gauge Steel Framing",LogsSolid:"Logs (Solid)",MasoniteSiding:"Masonite Siding",PreEngineeredMetal:"Pre-Engineered Metal",SolidBrickConstruction:"Solid Brick Construction",SolidConcrete:"Solid Concrete",StandardPoleFramed:"Standard Pole Framed",Stone:"Stone",StructuralInsulatedPanels:"Structural Insulated Panels",TimberFraming:"Timber Framing"},tu={ASPHALT_SHINGLES:"Asphalt Shingles",ARCHITECTURAL_SHINGLES:"Architectural Shingles",METAL:"Metal",TILE_CONCRETE:"Tile (Concrete)",ASBESTOS:"Asbestos",BUILT_UP:"Built-Up",COMPOSITION:"Composition",CONCRETE:"Concrete",COPPER:"Copper",CORRUGATED_STEEL:"Corrugated Steel",FIBERGLASS:"Fiberglass",FOAM:"Foam",GRAVEL:"Gravel",MEMBRANE:"Membrane",MINERAL_FIBER_SHAKE:"Mineral Fiber Shake",PLASTIC:"Plastic",ROCK:"Rock",ROLLED_PAPER:"Rolled Paper",RUBBER:"Rubber",SLATE:"Slate",TAR:"Tar",TAR_GRAVEL:"Tar and Gravel",TILE_CLAY:"Tile (Clay)",TILE_MISSION:"Tile (Mission)",TILE_SPANISH:"Tile (Spanish)",TIN:"Tin",WOOD_FIBERGLASS_SHINGLES:"Wood/Fiberglass Shingles",WOOD_SHAKE:"Wood Shake",WOOD_SHINGLES:"Wood Shingles",OTHER:"Other"},ru={B_Gable:"Gable",C_Hip:"Hip",A_Flat:"Flat",D_Other:"Other"},nu={NotUpdated:"Not Updated",PartialUpdate:"Partial Update",CompleteUpdate:"Complete Update"},ou={Electric:"Electric",Gas:"Gas",GasForcedAir:"Gas - Forced Air",GasHotWater:"Gas - Hot Water",Oil:"Oil",OilForcedAir:"Oil - Forced Air",OilHotWater:"Oil - Hot Water",SolidFuel:"Solid Fuel",HeatPump:"Heat Pump",Other:"Other"},iu={AboveGround:"Above Ground",BelowGround:"Below Ground"},au={Basement:"Below Grade Basement",SplitLevelBasement:"Split Level Basement",WalkoutBasement:"Walkout Basement"},su={EntirelyCopper:"Entirely Copper",EntirelyGalvanized:"Entirely Galvanized",EntirelyPEX:"Entirely PEX",EntirelyPVC:"Entirely PVC",Polybutylene:"Polybutylene"},cu={TwentyFive:"$25,000",Fifty:"$50,000",OneHundred:"$100,000",TwoHundred:"$200,000",ThreeHundred:"$300,000",FourHundred:"$400,000",FiveHundred:"$500,000"},lu={cov1000:"$1,000",cov2000:"$2,000",cov3000:"$3,000",cov4000:"$4,000",cov5000:"$5,000"},uu={TwoHundredFifty:"$250",FiveHundred:"$500",SevenHundredFifty:"$750",OneThousand:"$1,000",OneThousandFiveHundred:"$1,500",TwoThousand:"$2,000",TwoThousandFiveHundred:"$2,500",ThreeThousands:"$3,000",FourThousands:"$4,000",FiveThousands:"$5,000",OnePercent:"1%",TwoPercent:"2%",ThreePercent:"3%",FourPercent:"4%",FivePercent:"5%"},du={None:"None",OnePercent:"1%",TwoPercent:"2%",FivePercent:"5%",TenPercent:"10%"},_u={_0_500ft:"0-500 Feet",_501_1000ft:"501-1000 Feet",_1001ftAndGreater:"1001 Feet And Greater"},fu={Lessthan5miles:"Less Than 5 Miles",Over5miles:"Over 5 Miles",NotAvailable:"Not Available"},Zn={"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"},jn={Single:"Single",Married:"Married",Seperated:"Separated",Divorced:"Divorced",Widowed:"Widowed",DomesticPartner:"Domestic Partner"},Wn={Female:"Female",Male:"Male"},Gn={"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"},pu={CONTAMINATION:"Contamination",CREDITCARD:"Credit Card",DAMAGETOPROPERTYOFOTHERS:"Damage To Property Of Others",DOGBITELIABILITY:"Dog Bite",EARTHMOVEMENT:"Earth Movement",EARTHQUAKE:"Earthquake",EXTENDEDCOVERAGEPERILS:"Extended Coverage Perils",FIRE:"Fire",FLOOD:"Flood",FREEZINGWATERINCLUDINGBURSTPIPES:"Freezing Water",HAIL:"Hail",HURRICANE:"Hurricane",LIABILITYALLOTHER:"Liability",LIGHTNING:"Lightning",MEDICALPAYMENTS:"Medical Payments",MYSTERIOUSDISAPPEARANCE:"Mysterious Disappearance",MYSTERIOUSDISAPPEARANCESCHEDULEDPROPERTY:"Mysterious Disappearance - Scheduled Property",PHYSICALDAMAGEALLOTHER:"Physical Damage",SINKHOLE:"Sinkhole",SLIPFALLLIABILITY:"Slip/Fall",SMOKE:"Smoke",THEFTSCHEDULEDPROPERTY:"Theft - Scheduled Property",THEFTBURGLARY:"Theft - Burglary",TORNADO:"Tornado",VANDALISMMALICIOUSMISCHIEF:"Vandalism",WATERDAMAGE:"Water Damage",WIND:"Wind",WORKERSCOMPENSATION:"Workers Compensation",ALLOTHER:"All Other"},mu={Verbal_Threshold:"Limited right to sue",Zero_Threshold:"Unlimited right to sue",Full:"Full",Limited:"Limited"},hu={Primary:"Primary",Secondary:"Secondary"},gu={cov1000:"$1,000",cov10000:"$10,000"},yu={cov100_10400_LIMITED:"100 - 10,400/ LIMITED",cov125_13000_LIMITED:"125 - 13,000/ LIMITED",cov175_18200_LIMITED:"175 - 18,200/ LIMITED",cov250_26000_LIMITED:"250 - 26,000/ LIMITED",cov400_41600_LIMITED:"400 - 41,600/ LIMITED",cov500_52000_LIMITED:"500 - 52,000/ LIMITED",cov600_62400_LIMITED:"600 - 62,400/ LIMITED",cov700_72800_LIMITED:"700 - 72,800/ LIMITED",cov100_UNLIMITED:"100/UNLIMITED",cov125_UNLIMITED:"125/UNLIMITED",cov175_UNLIMITED:"175/UNLIMITED",cov250_UNLIMITED:"250/UNLIMITED",cov400_UNLIMITED:"400/UNLIMITED",cov500_UNLIMITED:"500/UNLIMITED",cov600_UNLIMITED:"600/UNLIMITED",cov700_UNLIMITED:"700/UNLIMITED"},vu={cov250:"$250",cov500:"$500",cov1000:"$1,000",cov2000:"$2,000",cov2500:"$2,500"},bu={"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"]},Su={"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"},Vn=bu,Yn=Su;function mr(e,t){if(typeof e!="string")return e;const r=e.trim();if(!r)return e;if(t[r])return r;const n=r.toLowerCase();return Object.keys(t).find(i=>i.toLowerCase()===n||t[i]?.toLowerCase()===n)??e}function Pt(e){return mr(e,Gn)}function Kn(e){return mr(e,Hn)}function Jn(e){return mr(e,Yn)}function wu(e){return e.trim().toLowerCase()}function qn(e){if(typeof e!="string")return null;const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return null;const r=Number(t[1]),n=Number(t[2]),o=Number(t[3]);if(!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(o)||n<1||n>12||o<1||o>31)return null;const i=new Date(Date.UTC(r,n-1,o));return i.getUTCFullYear()!==r||i.getUTCMonth()!==n-1||i.getUTCDate()!==o?null:i.getTime()}function ot(e,t){if(!t.effectiveDateKey||!t.expirationDateKey)return!1;const r=qn(e[t.expirationDateKey]),n=qn(e[t.effectiveDateKey]);return r==null||n==null?!1:r<n}const Cu=new Set(["HomePolicy","BundlePolicy"]);function $t(e,t,r){return String(e.key??"")!=="lapse_in_coverage"||!r||!Cu.has(r)?!0:t.home_prior_carrier_name!=="NoPriorInsurance"}function hr(e){let t=null,r=null,n=null;const o=new Set,i=new Set,a=c=>{const u=String(c.key??""),d=wu(String(c.question??""));!t&&(u==="auto_prior_carrier_name"||u==="home_prior_carrier_name"||d.includes("current auto insurance company"))&&(t=u),!r&&(u==="effective_date"||d.includes("when do you need your insurance to begin"))&&(r=u),!n&&(u==="auto_prior_expiration_date"||u==="home_prior_expiration_date"||d.includes("when does the current policy expire"))&&(n=u),(u==="auto_reason_for_no_insurance"||d.includes("reason you are not currently insured")||d.includes("reason for lapse in coverage"))&&o.add(u),(u==="auto_prior_years"||u==="auto_prior_months"||u==="auto_continuous_coverage_years"||u==="auto_prior_expiration_date"||u==="auto_current_annual_premium_cents"||u==="auto_prior_liability_limit")&&i.add(u)};e.forEach(a);const s=c=>{c.forEach(u=>{(u.conditionals??[]).forEach(d=>{const f=d.conditionalQuestions??[];f.forEach(a),s(f)})})};return s(e),{currentCarrierKey:t,effectiveDateKey:r,expirationDateKey:n,noInsuranceReasonKeys:o,hideWhenNoPriorInsuranceKeys:i}}function _t(e,t){return t.currentCarrierKey==="home_prior_carrier_name"&&e.home_prior_carrier_name==="NoPriorInsurance"&&e.auto_prior_carrier_name!=="NoPriorInsurance"?!1:(t.currentCarrierKey?e[t.currentCarrierKey]:void 0)==="NoPriorInsurance"?!0:!t.effectiveDateKey||!t.expirationDateKey||t.expirationDateKey==="home_prior_expiration_date"&&ot(e,t)?!1:ot(e,t)}function Ft(e,t,r){const n=String(e.key??"");if(r.noInsuranceReasonKeys.has(n)&&r.currentCarrierKey==="home_prior_carrier_name"&&t.home_prior_carrier_name==="NoPriorInsurance"&&t.auto_prior_carrier_name!=="NoPriorInsurance")return!1;const i=(r.currentCarrierKey?t[r.currentCarrierKey]:void 0)==="NoPriorInsurance";return i&&r.hideWhenNoPriorInsuranceKeys.has(n)?!1:!r.noInsuranceReasonKeys.has(n)||i?!0:_t(t,r)}function xt(e,t){const r=String(e.key??"");return t.noInsuranceReasonKeys.has(r)}const Au=["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"],gr="credify_quote_id",yr="credify_auth_token";function Eu(e){try{localStorage.setItem(gr,e)}catch(t){console.error("Failed to save quoteId to localStorage:",t)}}function Tu(){try{return localStorage.getItem(gr)}catch(e){return console.error("Failed to load quoteId from localStorage:",e),null}}function Qn(){try{localStorage.removeItem(gr)}catch(e){console.error("Failed to clear quoteId from localStorage:",e)}}function Nu(e){try{localStorage.setItem(yr,e)}catch(t){console.error("Failed to save authToken to localStorage:",t)}}function ku(){try{return localStorage.getItem(yr)}catch(e){return console.error("Failed to load authToken from localStorage:",e),null}}function Xn(){try{localStorage.removeItem(yr)}catch(e){console.error("Failed to clear authToken from localStorage:",e)}}function Ou(){Qn(),Xn()}const De="https://api.getcredify.com";let it=null;function Iu(e){it=e,Nu(e)}function Bt(){return it}function vr(){const e=ku();e&&(it=e)}function eo(){it=null,Xn()}async function Pe(e,t){const r={"Content-Type":"application/json"};it&&(r.Authorization=`Bearer ${it}`);const n=await fetch(e,{method:"POST",headers:r,body:JSON.stringify(t)});if(!n.ok){let o=`Request failed with status ${n.status}`;try{o=(await n.json()).error||o}catch{o=n.statusText||o}const i=new Error(o);throw i.statusCode=n.status,i}return n}async function Mu(e){try{return await e.json()}catch{return{}}}async function Lu(e,t){const r=t?{stage:e,quoteId:t}:{stage:e};return await(await Pe(`${De}/get-questions-by-stage`,r)).json()}async function br(e){const t=e?{quoteId:e}:{};return await(await Pe(`${De}/get-stages-for-quote`,t)).json()}async function Du(e){const r=await(await Pe(`${De}/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 ft(e,t,r){const n={payload:e,getRates:t};r&&typeof r=="string"&&r.trim()!==""&&(n.quoteId=r);const o=await Pe(`${De}/update-quote`,n);return await Mu(o)}async function Pu(e,t){return await(await Pe(`${De}/verify-quote`,{quoteId:e,smsCode:t})).json()}async function $u(e){return await(await Pe(`${De}/is-supported-state`,{state:e})).json()}async function Fu(){return await(await Pe(`${De}/get-rates`,{})).json()}async function xu(e){const t=e?{quoteId:e}:{};return await(await Pe(`${De}/get-quote`,t)).json()}async function to(e){return(await Pe(`${De}/get-vehicle-options`,e)).json()}async function Bu(e){return(await Pe(`${De}/get-vehicle-options`,{...e,action:"vinDecode"})).json()}async function zu(e){const r=await(await Pe(`${De}/request-bind`,{quoteRateId:e})).json();return r&&typeof r=="object"&&"success"in r?r:{success:!0}}const Ru=["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible"],zt=new Set([...Ru,"is_corporation"]);tl({additional_pip:rt(["cov100_10400_LIMITED","cov125_13000_LIMITED","cov175_18200_LIMITED","cov250_26000_LIMITED","cov400_41600_LIMITED","cov500_52000_LIMITED","cov600_62400_LIMITED","cov700_72800_LIMITED","cov100_UNLIMITED","cov125_UNLIMITED","cov175_UNLIMITED","cov250_UNLIMITED","cov400_UNLIMITED","cov500_UNLIMITED","cov600_UNLIMITED","cov700_UNLIMITED"]),tort_threshold:rt(["Verbal_Threshold","Zero_Threshold","Full","Limited"]),pip_coverage_type:rt(["Primary","Secondary"]),extended_medical:rt(["cov1000","cov10000"]),policy_pip_deductible:rt(["cov250","cov500","cov1000","cov2000","cov2500"]),has_health_insurance_auto_accident:Yc().nullable().optional()}).superRefine((e,t)=>{e.pip_coverage_type==="Secondary"&&e.has_health_insurance_auto_accident!==!0&&t.addIssue({code:ur.custom,path:["pip_coverage_type"],message:"Secondary PIP coverage requires health insurance that covers auto accidents."})});const Sr=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),Uu={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"},ro={auto_prior_carrier_name:Dl,auto_prior_liability_limit:xl,auto_reason_for_no_insurance:Bl,residence_type:Pl,home_prior_carrier_name:$l,policy_bi:zl,policy_um:Rl,policy_pd:Ul,policy_mp:Hl,policy_umpd:Zl,policy_pip:jl,policy_auto_death_indemnity:Wl,vehicle_comp_deductible:pr,vehicle_coll_deductible:pr,vehicle_towing_and_labor:Rn,vehicle_transportation_expense:Un,education_level:Hn,industry:Gn,occupation:Yn,usage:Fl,architectural_style:Gl,dwelling_type:Vl,occupancy_type:Yl,construction_quality:Kl,construction_type:Jl,foundation_type:ql,located_over_water:Ql,number_of_stories:Xl,exterior_wall_type:eu,roof_material_type:tu,roof_shape:ru,roof_updated_type:nu,heating_type:ou,oil_tank_location:iu,basement_type:au,plumbing_type:su,personal_liability:cu,dwelling_medical_payments:lu,all_perils_deductible:uu,windstorm_deductible:du,distance_from_fire_hydrant_ft:_u,distance_from_fire_station_miles:fu,employment_industry:Zn,marital_status:jn,gender:Wn,co_applicant_employment_industry:Zn,co_applicant_marital_status:jn,co_applicant_gender:Wn,description:pu,tort_threshold:mu,pip_coverage_type:hu,extended_medical:gu,additional_pip:yu,policy_pip_deductible:vu},Hu=["OTHER / NOT LISTED"],Zu=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],ju=["Other"];function Ne(e){const t=e.getUTCFullYear(),r=String(e.getUTCMonth()+1).padStart(2,"0"),n=String(e.getUTCDate()).padStart(2,"0");return`${t}-${r}-${n}`}function Wu(e){const t=e.replace(/\D+/g,"");if(t!=="")return kl(t)}function Gu(e){return e==="-"||e==="+"||e==="."||e==="e"||e==="E"}const Vu={year_built:4,year_roof_updated:4,heating_update_year:4,plumbing_update_year:4,electrical_update_year:4,total_area_sq_ft:6,sale_price_cents:9,dwelling_replacement_cost:9,other_structures_coverage:9,personal_property_coverage:7,amount_paid_cents:7,loss_of_use_coverage:8,home_prior_years:2,home_continuous_coverage_years:2,number_of_dogs:2,number_of_units:2,months_at_address:2,years_at_address:3,years_at_prior_address:3,distance_to_coast_miles:4,household_size:1,number_of_families:1,number_of_mortgagees:1,annual_mileage:6,miles_to_work:4,custom_equipment_value_cents:7,cost_new_value_cents:7,stated_value_amount_cents:7,property_damage_amount_paid_cents:7,personal_injury_amount_paid_cents:7,auto_current_annual_premium_cents:7,auto_prior_years:2,auto_prior_months:2,auto_continuous_coverage_years:2},Rt={first_name:"given-name",last_name:"family-name",co_applicant_first_name:"given-name",co_applicant_last_name:"family-name",date_of_birth:"bday",co_applicant_date_of_birth:"bday",sms_code:"one-time-code",vin:"off",license_number:"off",effective_date:"off"};function Yu(e){const t=new Date,r=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));if(e==="effective_date"){const n=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+3,r.getUTCDate()));return{min:Ne(r),max:Ne(n)}}if(e==="home_prior_expiration_date"){const n=new Date(Date.UTC(r.getUTCFullYear()-1,r.getUTCMonth(),r.getUTCDate())),o=new Date(Date.UTC(r.getUTCFullYear()+1,r.getUTCMonth(),r.getUTCDate()));return{min:Ne(n),max:Ne(o)}}if(e==="date_of_incident")return{max:Ne(r)};if(e==="move_in_date")return{max:Ne(r)};if(e==="purchase_date")return{max:Ne(r)};if(e==="date_of_birth")return{max:Ne(r)};if(e==="date_first_licensed")return{max:Ne(r)};if(e==="occurred_at")return{max:Ne(r)};if(e==="accident_prevention_course_date")return{max:Ne(r)};if(e==="auto_prior_expiration_date"){const n=new Date(Date.UTC(r.getUTCFullYear()-1,r.getUTCMonth(),r.getUTCDate())),o=new Date(Date.UTC(r.getUTCFullYear()+1,r.getUTCMonth(),r.getUTCDate()));return{min:Ne(n),max:Ne(o)}}return{}}const Ku=new Set(["Disabled","Retired","Unemployed","Other"]);function wr(e,t,r){const n=String(e.key??"");if(n!=="occupation"&&n!=="co_applicant_occupation"||n==="co_applicant_occupation")return!0;const o=we(t,r,"industry"),i=we(t,r,"employment_industry"),a=String(o??i??"").trim();return!Ku.has(a)}function no(e){const t=e.state??e.State??e.state??e.State??"";if(typeof t!="string"||!t.trim())return!1;const r=t.trim().toLowerCase();return r==="nj"||r==="n.j."||r==="n.j"||r==="new jersey"}function Cr(e,t){const r=String(e.key??"");return zt.has(r)?no(t):!0}function Ju(e,t){const r=String(e??""),n=zt.has(r)||r==="has_health_insurance_auto_accident"||r==="is_corporation";return no(t)&&n}function Ar(e,t,r,n){return!(!fr(e,n)||Ju(e,r))}function Ut(e){return e.inputType!=="radio"||!e.options||e.options.length!==1||e.options[0]!=="Yes"?!1:(e.conditionals??[]).some(r=>r.conditionalQuestionsAllowMultiple&&r.conditionalType==="equals"&&r.conditionalValue==="Yes")}function oo(e,t){return Ut(e)?"Yes":t}function io(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function ao(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 so(e,t){const r=io(e),n=io(t);if(r!=null&&n!=null)return r-n;const o=ao(e),i=ao(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function qu(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function pt(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=so(e,r);return n!=null&&n<0}case"greaterThan":{const n=so(e,r);return n!=null&&n>0}case"contains":return qu(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 mt(e,t){return t.reduce((r,n)=>r?.[n],e)}function $e(e,t,r){if(t.length===0)return e;const[n,...o]=t;if(o.length===0){if(typeof n=="number"){const u=(Array.isArray(e)?e:[]).slice();return u[n]=r,u}return{...e,[n]:r}}const i=e?.[n],a=typeof o[0]=="number"?Array.isArray(i)?i:[]:i&&typeof i=="object"?i:{},s=$e(a,o,r);if(typeof n=="number"){const u=(Array.isArray(e)?e:[]).slice();return u[n]=s,u}return{...e,[n]:s}}function we(e,t,r){return mt(e,[...t??[],r])}function Ce(e,t,r,n){return $e(e,[...t??[],r],n)}function Qu(e,t){return e?.length?`${e.join("-")}-${t}`:t}const Xu="__items",Ht=e=>`${e}${Xu}`;function Me(e){return e==null?"":typeof e=="string"?e:String(e)}function ed(e){return e==null?"":typeof e=="number"&&Number.isFinite(e)||typeof e=="string"?e:""}function td(e){return e==null?"":typeof e=="string"||typeof e=="number"?e:String(e)}function rd({questions:e,initialValues:t,controlledValues:r,onChangeValues:n,onSubmit:o,quoteId:i,widgetStageKey:a}){const s=b.useMemo(()=>qt(e),[e]),c=b.useMemo(()=>hr(s),[s]),u=b.useMemo(()=>a==="BundlePolicy"?!0:s.some(N=>String(N.key)==="home_prior_carrier_name")&&s.some(N=>String(N.key)==="driver_vehicle_assignments"),[a,s]),d=b.useMemo(()=>{const N={};return t&&Object.assign(N,t),N},[t]),[f,m]=b.useState(d);b.useEffect(()=>{m(d)},[d]);const[g,y]=b.useState({}),h=b.useMemo(()=>({...g,...r??f}),[g,r,f]);b.useEffect(()=>{r&&y(N=>({...N,...r}))},[r]);const[ie,te]=b.useState({}),X=b.useRef(new Map),ee=b.useRef(new Set),[,D]=b.useState({}),[M,B]=b.useState({}),P=b.useRef(!1);b.useEffect(()=>{!i||P.current||!s.some(v=>v.key==="year"||v.key==="make"||v.key==="model"||v.key==="body_style")||(P.current=!0,to({quoteId:i}).catch(()=>{}))},[i,s]);const[S,I]=b.useState({}),[V,$]=b.useState({}),G=b.useCallback(async(N,v)=>{if(!i||!zn(v))return;const _=N?N.join("-"):"_root";I(T=>({...T,[_]:!0})),$(T=>({...T,[_]:null}));try{const T=await Bu({quoteId:i,vin:v});if(T.error){$(O=>({...O,[_]:T.error}));return}let C=h;T.year&&(C=Ce(C,N,"year",String(T.year))),T.make&&(C=Ce(C,N,"make",T.make)),T.model&&(C=Ce(C,N,"model",T.model)),T.bodyStyle&&(C=Ce(C,N,"body_style",T.bodyStyle)),r&&n?n(C):m(C),y(C),X.current.clear(),ee.current.clear(),D({})}catch{$(T=>({...T,[_]:"VIN lookup failed — please enter vehicle details manually"}))}finally{I(T=>({...T,[_]:!1}))}},[i,h,r,n]),U=b.useCallback((N,v)=>{if(!i)return;const _=`${v.year}|${v.make??""}|${v.model??""}`,T=v.model?"bodyStyles":v.make?"models":"makes",C=`${N}:${T}`,O=X.current.get(_);if(O)return O[T]??[];ee.current.has(_)||(ee.current.add(_),queueMicrotask(()=>{B(Z=>({...Z,[C]:!0})),to({quoteId:i,...v}).then(Z=>{X.current.set(_,Z),D(x=>({...x,[C]:Z[T]??[]}))}).catch(()=>{X.current.set(_,{}),D(Z=>({...Z,[C]:[]}))}).finally(()=>{ee.current.delete(_),B(Z=>({...Z,[C]:!1}))})}))},[i]);function re(N,v,_){return{...N?mt(h,N)??{}:h,[v]:_}}function Y(N,v){const _=Bn.filter(C=>C.targetKey===N||C.dependsOn.includes(N)),T={[N]:void 0};for(const C of _){const O=C.validate(v);C.targetKey in T?O!==void 0&&(T[C.targetKey]=O):T[C.targetKey]=O}te(C=>({...C,...T}))}const E=(N,v,_)=>{const T=we(h,_,N);if(He(T,v)){ie[N]&&te(O=>({...O,[N]:void 0}));return}const C=dr(N,T);if(C){te(O=>({...O,[N]:C}));return}Y(N,re(_,N,T))};b.useEffect(()=>{let N=h,v=!1;s.forEach(_=>{if(!Ut(_))return;const T=String(_.key);we(N,void 0,T)!=="Yes"&&(N=Ce(N,void 0,T,"Yes"),v=!0)}),v&&(r&&n?n(N):m(N),y(N))},[s,h,r,n]);function W(N,v){const _=N.key;if((_==="relationship_to_insured"||_==="is_registered_owner")&&v){const A=v[v.length-1];if(typeof A=="number"&&A===0)return null}if((_==="purchase_date"||_==="cost_new_value_cents")&&v)return null;if(_==="custom_equipment_value_cents"&&v){const A=we(h,v,"vehicle_has_modifications");if(A!=="Yes"&&A!==!0)return null}const T=_==="auto_reason_for_no_insurance"&&c.currentCarrierKey?h[c.currentCarrierKey]==="NoPriorInsurance"?"Reason you are not currently insured":"Reason for lapse in coverage":N.question,C=N.hint,O=we(h,v,_),Z=xt(N,c)?_t(h,c):N.required,x=ie[_],H=A=>{let w=Ce(h,v,_,A);if(N.inputType==="radio"&&N.conditionals){const k=N.conditionals??[];for(const q of k){const z=we(h,v,_),j=pt(z,q.conditionalType,q.conditionalValue),F=pt(A,q.conditionalType,q.conditionalValue);if(j&&!F&&q.conditionalQuestionsAllowMultiple){const me=q.conditionalQuestions??[];if(me.length>0){const K=Ht(_);w=$e(w,[...v??[],K],[]);const ae=(oe,Q)=>{oe.forEach(J=>{(J.conditionals??[]).forEach(se=>{if(se.conditionalQuestionsAllowMultiple){const ce=Ht(J.key);w=$e(w,[...Q,ce],[])}const ve=se.conditionalQuestions??[];ve.length>0&&ae(ve,Q)})})};ae(me,[...v??[],K])}}}}r&&n?n(w):m(w),y(w)};if(_==="vehicle_policy_selections"){const A=h.vehicles__items??[],w=h.drivers__items??[];if(A.length===0)return l.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles first to configure coverage selections."},_);const k=h.driver_vehicle_assignments??{},q=w.length>1,z=Q=>Object.entries(Q).map(([J,ye])=>({value:J,label:ye})),j=z(pr),F=z(Rn),me=z(Un),K=(Q,J,ye)=>{const se=$e(h,["vehicles__items",Q,J],ye);r&&n?n(se):m(se),y(se)},ae=(Q,J,ye)=>{const se={...k},ve=`v${Q}`;se[ve]={...se[ve]??{}},se[ve][`d${J}`]=ye;const ce=$e(h,["driver_vehicle_assignments"],se);r&&n?n(ce):m(ce),y(ce)},oe=Q=>{if(!q)return null;const J=k[`v${Q}`];if(!J)return null;const ye=w.map((ce,xe)=>J[`d${xe}`]??0),se=ye.filter(ce=>ce>0);if(se.length>=2&&se.every(ce=>ce===se[0])&&se[0]===50)return`Assignments for Vehicle ${Q+1} cannot be 50 percent for both Drivers.`;const ve=ye.reduce((ce,xe)=>ce+xe,0);return ve>0&&ve!==100?`Driver percentages for this vehicle must add up to 100% (currently ${ve}%).`:null};return l.jsx("div",{children:A.map((Q,J)=>{const ye=[Q.year,Q.make,Q.model].filter(Boolean).join(" ")||`Vehicle ${J+1}`,se=oe(J),ve=ce=>typeof Q[ce]=="string"?Q[ce]:"";return l.jsxs("fieldset",{style:{border:`1px solid ${se?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[l.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:ye}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px"},children:[l.jsx(st,{id:`veh-${J}-comp`,label:"Comprehensive deductible",required:!0,placeholder:"Select...",options:j,value:ve("vehicle_comp_deductible"),onChange:ce=>K(J,"vehicle_comp_deductible",ce.currentTarget.value)}),l.jsx(st,{id:`veh-${J}-coll`,label:"Collision deductible",required:!0,placeholder:"Select...",options:j,value:ve("vehicle_coll_deductible"),onChange:ce=>K(J,"vehicle_coll_deductible",ce.currentTarget.value)}),l.jsx(st,{id:`veh-${J}-tow`,label:"Towing and Labor",required:!0,placeholder:"Select...",options:F,value:ve("vehicle_towing_and_labor"),onChange:ce=>K(J,"vehicle_towing_and_labor",ce.currentTarget.value)}),l.jsx(st,{id:`veh-${J}-trans`,label:"Transportation expense",required:!0,placeholder:"Select...",options:me,value:ve("vehicle_transportation_expense"),onChange:ce=>K(J,"vehicle_transportation_expense",ce.currentTarget.value)})]}),q&&l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsx("p",{style:{fontWeight:600,margin:"0 0 8px"},children:"Drivers usage (%)"}),l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:w.map((ce,xe)=>{const Or=[ce.first_name,ce.last_name].filter(Boolean).join(" ")||`Driver ${xe+1}`,No=k[`v${J}`]?.[`d${xe}`];return l.jsx("div",{style:{flex:"0 0 140px"},children:l.jsx(Yt,{id:`assignment-v${J}-d${xe}`,label:`${Or} %`,value:No??"",min:0,max:100,step:1,inputMode:"numeric",onChange:Ir=>{const ke=Ir.currentTarget.value.replace(/\D+/g,"");ae(J,xe,ke===""?0:Math.min(100,parseInt(ke,10)))}})},`${J}-${xe}`)})}),se&&l.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:se})]})]},J)})},_)}if(_==="driver_vehicle_assignments"){const A=h.vehicles__items??[],w=h.drivers__items??[];if(u&&w.length<=1)return null;if(A.length===0||w.length===0)return l.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},_);const k=h.driver_vehicle_assignments??{},q=(j,F,me)=>{const K={...k},ae=`v${j}`;K[ae]={...K[ae]??{}},K[ae][`d${F}`]=me,H(K)},z=j=>{if(w.length<2)return null;const F=k[`v${j}`];if(!F)return null;const me=w.map((oe,Q)=>F[`d${Q}`]??0),K=me.filter(oe=>oe>0);if(K.length>=2&&K.every(oe=>oe===K[0])&&K[0]===50)return`Assignments for Vehicle ${j+1} cannot be 50 percent for both Drivers.`;const ae=me.reduce((oe,Q)=>oe+Q,0);return ae>0&&ae!==100?`Driver percentages for this vehicle must add up to 100% (currently ${ae}%).`:null};return l.jsxs("div",{children:[l.jsx("h4",{style:{marginBottom:"12px"},children:T}),A.map((j,F)=>{const me=[j.year,j.make,j.model].filter(Boolean).join(" ")||`Vehicle ${F+1}`,K=z(F);return l.jsxs("fieldset",{style:{border:`1px solid ${K?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[l.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:me}),l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:w.map((ae,oe)=>{const Q=[ae.first_name,ae.last_name].filter(Boolean).join(" ")||`Driver ${oe+1}`,J=k[`v${F}`]?.[`d${oe}`];return l.jsx("div",{style:{flex:"0 0 140px"},children:l.jsx(Yt,{id:`assignment-v${F}-d${oe}`,label:`${Q} %`,value:J??"",min:0,max:100,step:1,inputMode:"numeric",onChange:ye=>{const se=ye.currentTarget.value.replace(/\D+/g,"");q(F,oe,se===""?0:Math.min(100,parseInt(se,10)))}})},`${F}-${oe}`)})}),K&&l.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:K})]},F)})]},_)}switch(N.inputType){case"text":{if(_==="vin"&&i){const A=v?v.join("-"):"_root",w=S[A]??!1,k=V[A]??null,q=[C?`${_}-hint`:null,x?`${_}-error`:null,k?`${_}-vin-error`:null].filter(Boolean).join(" ");return l.jsxs("div",{children:[l.jsx(Le,{id:_,label:T,hint:C,error:x,required:Z,children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("input",{id:_,className:`form-input ${x?"input-error":""}`,"aria-invalid":!!x,"aria-describedby":q||void 0,"aria-required":Z||void 0,required:Z,value:Me(O),maxLength:17,onChange:z=>H(z.currentTarget.value),onBlur:()=>E(_,"text",v),autoComplete:Rt[_],type:"text"})}),l.jsx("button",{type:"button",disabled:w||!zn(Me(O)),className:"btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",onClick:()=>G(v,Me(O)),children:w?"Looking up...":"Verify VIN"})]})}),k&&l.jsx("p",{id:`${_}-vin-error`,className:"text-sm text-red-600 mt-1",children:k})]},_)}if(_==="sms_code"){const A=Me(O);return l.jsx(Pr,{id:_,label:T,hint:C,value:A,inputMode:"numeric",pattern:"[0-9]*",maxLength:6,onChange:w=>{const k=w.currentTarget.value.replace(/\D+/g,"").slice(0,6);H(k)},onBlur:()=>E(_,"text",v),"aria-required":Z||void 0,error:x,autoComplete:Rt[_]},_)}return l.jsx(Pr,{id:_,label:T,hint:C,value:Me(O),onChange:A=>H(A.currentTarget.value),onBlur:()=>E(_,"text",v),"aria-required":Z||void 0,error:x,autoComplete:Rt[_]},_)}case"email":return l.jsx(Mo,{id:_,label:T,value:Me(O),onChange:A=>H(A.currentTarget.value),onBlur:()=>E(_,"email",v),"aria-required":Z||void 0,error:x},_);case"password":return l.jsx(Po,{id:_,label:T,value:Me(O),onChange:A=>H(A.currentTarget.value),onBlur:()=>E(_,"password",v),"aria-required":Z||void 0,error:x},_);case"tel":return l.jsxs(l.Fragment,{children:[l.jsx(Lo,{id:_,label:T,value:Me(O),onChange:A=>H(A.currentTarget.value),onBlur:()=>E(_,"tel",v),"aria-required":Z||void 0,error:x},_),_==="phone"&&l.jsxs("div",{className:"mt-3 text-xs text-slate-600 space-y-1",children:[l.jsx("p",{children:"By entering your phone number, you agree to receive a one-time SMS from Credify Insurance with a verification code."}),l.jsx("p",{children:"Message & data rates may apply. One message per request."}),l.jsxs("p",{children:["See our"," ",l.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","and"," ",l.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Terms of Service"}),"."]})]})]});case"url":return l.jsx(Do,{id:_,label:T,value:Me(O),onChange:A=>H(A.currentTarget.value),onBlur:()=>E(_,"url",v),"aria-required":Z||void 0,error:x},_);case"number":{const A=Vu[_];return l.jsx(Yt,{id:_,label:T,hint:C,value:ed(O),inputMode:"numeric",pattern:"[0-9]*",onKeyDown:w=>{if(Gu(w.key)){w.preventDefault();return}A!==void 0&&/^\d$/.test(w.key)&&String(w.currentTarget.value).replace(/\D/g,"").length>=A&&w.preventDefault()},onChange:w=>{let k=w.currentTarget.value;A!==void 0&&(k=k.slice(0,A)),H(Wu(k))},onBlur:()=>E(_,"number",v),"aria-required":Z||void 0,error:x},_)}case"textarea":return l.jsx($o,{id:_,label:T,value:Me(O),onChange:A=>H(A.currentTarget.value),onBlur:()=>E(_,"textarea",v),"aria-required":Z||void 0,error:x,rows:4},_);case"date":{const{min:A,max:w}=Yu(_);return l.jsx(Fo,{id:_,label:T,hint:C,value:Me(O),min:A,max:w,onChange:k=>{const q=k.currentTarget.value;H(q),!He(q,"date")&&!dr(_,q)&&Y(_,re(v,_,q))},onBlur:()=>E(_,"date",v),"aria-required":Z||void 0,error:x,autoComplete:Rt[_]},_)}case"checkbox":{if(N.options){const A=Array.isArray(O)?O:[];return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"form-label",children:[T,Z&&l.jsx("span",{className:"text-red-600 ml-1",children:"*"})]}),l.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:N.options.map(w=>{const k=`${_}-${_r(w)}`,q=A.includes(w);return l.jsx($r,{id:k,label:w,checked:q,onChange:z=>{const j=new Set(A);z.currentTarget.checked?j.add(w):j.delete(w),H(Array.from(j))},"aria-required":Z||void 0},k)})}),x&&l.jsx("p",{className:"mt-1 text-sm text-red-600",children:x})]},_)}return l.jsx($r,{id:_,label:Z?`${T} *`:T,checked:!!O,onChange:A=>H(A.currentTarget.checked),"aria-required":Z||void 0},_)}case"radio":{if(Ut(N))return null;const A=N.options??[],w=v&&v.length>0?`${_}__${v.join("__")}`:_;return l.jsx(Bo,{legend:T,legendClassName:Z?"legend-required":void 0,children:A.map(k=>l.jsx(xo,{name:w,value:k,checked:O===k,onChange:()=>{H(k),Y(_,re(v,_,k))},children:ro[_]?.[k]??k},`${_}-${_r(k)}`))},_)}case"select":{let A=N.options??[];_==="quote_vehicle_id"&&(A=r?.vehicles__items?.map(z=>z.vin)??[]);let w=!1,k;if(_==="make"||_==="model"||_==="body_style"){const z=v?v.join("-"):"_root",j=we(h,v,"year"),F=typeof j=="number"?j:Number(j);if(_==="make"){const me=`${z}:makes`;if(!F||!Number.isFinite(F))w=!0,k="Select a year first";else{const K=U(z,{year:F});K&&K.length>0?A=K:M[me]?(w=!0,k="Loading makes..."):A=[...Au]}}else if(_==="model"){const me=`${z}:models`,K=String(we(h,v,"make")??"");if(!K)w=!0,k="Select a make first";else if(F&&Number.isFinite(F)){const ae=U(z,{year:F,make:K});ae&&ae.length>0?A=ae:M[me]?(w=!0,k="Loading models..."):A=[...Hu]}typeof O=="string"&&O&&!A.includes(O)&&(A=[O,...A])}else{const me=`${z}:bodyStyles`,K=String(we(h,v,"make")??""),ae=String(we(h,v,"model")??"");if(!ae)w=!0,k="Select a model first";else if(F&&Number.isFinite(F)&&K){const oe=U(z,{year:F,make:K,model:ae});oe&&oe.length>0?A=oe:M[me]?(w=!0,k="Loading body styles..."):A=[...Zu]}typeof O=="string"&&O&&!A.includes(O)&&(A=[O,...A])}}if(_==="occupation"||_==="co_applicant_occupation"){const z=_==="co_applicant_occupation"?"co_applicant_employment_industry":void 0,j=z?void 0:we(h,v,"industry"),F=we(h,v,z??"employment_industry"),K=String(Pt(j??F)??"").trim();A=[...Vn[K]??ju],typeof O=="string"&&O&&!A.includes(O)&&(A=[O,...A])}const q=Qu(v,_);return l.jsx(st,{id:q,label:k?`${T} — ${k}`:T,"aria-required":Z||void 0,error:x,disabled:w,value:td(O),onChange:z=>{const j=z.currentTarget.value;if(_!=="year"&&_!=="make"&&_!=="model"&&_!=="industry"&&_!=="employment_industry"&&_!=="co_applicant_employment_industry"){H(j),Y(_,re(v,_,j));return}let F=Ce(h,v,_,j);if(_==="year")F=Ce(F,v,"make",""),F=Ce(F,v,"model",""),F=Ce(F,v,"body_style","");else if(_==="make")F=Ce(F,v,"model",""),F=Ce(F,v,"body_style","");else if(_==="model")F=Ce(F,v,"body_style","");else if(_==="industry"||_==="employment_industry")F=Ce(F,v,"occupation","");else if(_==="co_applicant_employment_industry"){const K=String(Pt(j)??"").trim(),ae=Vn[K]??[],oe=ae.find(Q=>Q===K)??ae[0]??"";F=Ce(F,v,"co_applicant_occupation",oe??"")}r&&n?n(F):m(F),y(F);const me=v?mt(F,v)??{}:F;Y(_,{...me,[_]:j})},placeholder:k??"Select an option",options:A.map(z=>({value:z,label:ro[_]?.[z]??Uu[z]??z}))},q)}case"address":return l.jsx(Ho,{id:_,label:T,value:Me(O),onChange:(A,w)=>{let k=Ce(h,v,_,A);if(w?.state){const q=v?[...v,"state"]:["state"];k=$e(k,q,w.state)}r&&n?n(k):m(k),y(k)},onBlur:()=>E(_,"address",v),required:Z,"aria-required":Z||void 0,error:x},_);default:return null}}function pe(N,v){return N.map((_,T)=>{const C=String(_.key);if(!Ft(_,h,c)||!wr(_,h,v)||!Cr(_,h)||!$t(_,h,a))return null;if(Ar(C,_,h,a)){const w=c.currentCarrierKey?h[c.currentCarrierKey]:void 0;if(!(w&&w!=="NoPriorInsurance"&&ot(h,c)&&Sr.has(C)))return null}const O=W(_,v),Z=_.conditionals??[];if(!Z.length)return a==="BundlePolicy"&&C==="policy_bi"?l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mt-6 mb-3",children:"Vehicle Coverage Information"}),O]},`wrap-${C}-${T}`):l.jsx("div",{children:O},`wrap-${C}-${T}`);const x=oo(_,we(h,v,C)),H=Z.filter(w=>pt(x,w.conditionalType,w.conditionalValue)),A=H.length>1&&!H.some(w=>w.conditionalQuestionsAllowMultiple)?H.slice(0,1):H;return l.jsxs("div",{children:[O,A.map((w,k)=>{const q=w.conditionalQuestions??[];if(!q.length)return null;if(!w.conditionalQuestionsAllowMultiple)return l.jsx("div",{className:"mt-3",children:pe(q,v)},`branch-${C}-${k}`);const z=Ht(C),j=mt(h,[...v??[],z])??[],F=Math.max(1,j.length||1),me=()=>{const oe=$e(h,[...v??[],z,j.length],{});r&&n?n(oe):m(oe),y(oe)},K=()=>{const oe=j.slice(0,Math.max(0,j.length-1)),Q=$e(h,[...v??[],z],oe);r&&n?n(Q):m(Q),y(Q)},ae=`${C}__c${k}`;return l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),l.jsxs("div",{className:"space-x-2",children:[l.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:me,children:"Add another"}),F>1&&l.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:K,children:"Remove last"})]})]}),Array.from({length:F}).map((oe,Q)=>{const J=[...v??[],z,Q],ye=`${ae}__i${Q}`,se=j[Q]??{},ve=C==="drivers",Or=ve?`Driver #${Q+1}`:C==="vehicles"?`Vehicle #${Q+1}`:C==="home_losses"||C==="losses"?`Loss #${Q+1}`:`Entry #${Q+1}`,Ir=ve&&typeof se.ssn_display=="string"&&se.ssn_display?` — ${se.ssn_display}`:"";return l.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[l.jsxs("div",{className:"text-sm font-semibold mb-2",children:[Or,Ir]}),q.map(ke=>{const Mr=String(ke.key);if(!Ft(ke,h,c)||!wr(ke,h,J)||!Cr(ke,h)||!$t(ke,h,a))return null;if(Ar(Mr,ke,h,a)){const yt=c.currentCarrierKey?h[c.currentCarrierKey]:void 0;if(!(yt&&yt!=="NoPriorInsurance"&&ot(h,c)&&Sr.has(Mr)))return null}return l.jsxs("div",{className:"mt-3",children:[W(ke,J),(()=>{const yt=ke.conditionals??[];if(!yt.length)return null;const ko=we(h,J,ke.key),Wt=yt.filter(Je=>pt(ko,Je.conditionalType,Je.conditionalValue));return(Wt.length>1&&!Wt.some(Je=>Je.conditionalQuestionsAllowMultiple)?Wt.slice(0,1):Wt).map((Je,Lr)=>{const Dr=Je.conditionalQuestions??[];if(!Dr.length)return null;if(!Je.conditionalQuestionsAllowMultiple)return l.jsx("div",{className:"mt-3",children:pe(Dr,J)},`nested-${ye}-${Lr}`);const Gt=Ht(ke.key),Vt=mt(h,[...J,Gt])??[],Oo=Math.max(1,Vt.length||1),Dd=()=>{const at=$e(h,[...J,Gt,Vt.length],{});r&&n?n(at):m(at),y(at)},Pd=()=>{const at=Vt.slice(0,Math.max(0,Vt.length-1)),qe=$e(h,[...J,Gt],at);r&&n?n(qe):m(qe),y(qe)};return l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),l.jsxs("div",{className:"space-x-2",children:[l.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Dd,children:"Add another"}),Oo>1&&l.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Pd,children:"Remove last"})]})]}),Array.from({length:Oo}).map((at,qe)=>{const $d=[...J,Gt,qe];return l.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[l.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",qe+1]}),pe(Dr,$d)]},`nested-item-${ye}-${Lr}-${qe}`)})]},`nested-repeat-${ye}-${Lr}`)})})()]},`${ye}-${Mr}`)})]},`group-${ye}`)})]},`branch-${C}-${k}`)})]},`wrap-${C}-${T}`)})}const de=b.useMemo(()=>{const N=[],v=(_,T)=>{_.forEach(C=>{if(!Ft(C,h,c)||!wr(C,h,T)||!Cr(C,h)||!$t(C,h,a))return;const O=String(C.key);if(Ar(O,C,h,a)){const w=c.currentCarrierKey?h[c.currentCarrierKey]:void 0;if(!(w&&w!=="NoPriorInsurance"&&ot(h,c)&&Sr.has(O)))return}Ut(C)||N.push(C);const Z=C.conditionals??[];if(!Z.length)return;const x=oo(C,we(h,T,O)),H=Z.filter(w=>pt(x,w.conditionalType,w.conditionalValue));(H.length>1&&!H.some(w=>w.conditionalQuestionsAllowMultiple)?H.slice(0,1):H).forEach(w=>{const k=w.conditionalQuestions??[];k.length&&(w.conditionalQuestionsAllowMultiple||v(k,T))})})};return v(s),N},[s,h,c,a]);function Fe(N){N.preventDefault();const v=_t(h,c),_=de.map(C=>xt(C,c)?{...C,required:v}:C),T=Dt(_,h);if(te(T),Object.keys(T).length>0){const C=de.findIndex(O=>T[O.key]);C>=0&&document.getElementById(de[C].key)?.focus();return}o(h)}return l.jsx("form",{className:"space-y-6 px-1",onSubmit:Fe,noValidate:!0,children:pe(s)})}const nd="GTM-NK8LGHTQ";function od(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function Ye(e,t={}){od().push({event:e,credifyWidget:{...t,containerId:nd}})}function id(){Ye("credify_widget_opened")}function co(){Ye("credify_widget_closed")}function ad(e){Ye("credify_widget_stage_viewed",e)}function lo(e){Ye("credify_widget_stage_completed",e)}function sd(){Ye("credify_widget_flow_completed")}function cd(e){Ye("credify_widget_rates_viewed",e??{})}function ld(){Ye("credify_widget_rates_back")}function ud(e,t){const r=String(e.key??"");if(!zt.has(r))return!0;const n=t.state??t.State??t.state??t.State??"";if(typeof n!="string"||!n.trim())return!1;const o=n.trim().toLowerCase();return o==="nj"||o==="n.j."||o==="n.j"||o==="new jersey"}function dd(e){const t=e.state??e.State??e.state??e.State??"";if(typeof t!="string"||!t.trim())return!1;const r=t.trim().toLowerCase();return r==="nj"||r==="n.j."||r==="n.j"||r==="new jersey"}function _d(e,t){const r=String(e??""),n=zt.has(r)||r==="has_health_insurance_auto_accident"||r==="is_corporation";return dd(t)&&n}const uo=new Set(["Disabled","Retired","Unemployed","Other"]);function fd(e,t){const r=String(e.key??"");if(r==="co_applicant_occupation"||r!=="occupation")return!0;const n=t.industry,o=t.employment_industry,i=String(n??o??"").trim();return!uo.has(i)}function pd(e,t){const r=String(e.key??"");if(r==="co_applicant_occupation"||r!=="occupation")return!0;const n=t.industry,o=t.employment_industry,i=String(n??o??"").trim();return!uo.has(i)}function _o(e){return e.inputType!=="radio"||!e.options||e.options.length!==1||e.options[0]!=="Yes"?!1:(e.conditionals??[]).some(r=>r.conditionalQuestionsAllowMultiple&&r.conditionalType==="equals"&&r.conditionalValue==="Yes")}function fo(e,t){return _o(e)?"Yes":t}function po(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function mo(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 ho(e,t){const r=po(e),n=po(t);if(r!=null&&n!=null)return r-n;const o=mo(e),i=mo(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function md(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function go(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=ho(e,r);return n!=null&&n<0}case"greaterThan":{const n=ho(e,r);return n!=null&&n>0}case"contains":return md(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}}const hd=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]);function yo(e,t,r){const n=qt([...e]),o=hr(n),i=[],a=s=>{s.forEach(c=>{if(!Ft(c,t,o)||!fd(c,t)||!ud(c,t)||!$t(c,t,r))return;const u=String(c.key);if(fr(u,r)&&!_d(u,t)){const y=o.currentCarrierKey?t[o.currentCarrierKey]:void 0;if(!(y&&y!=="NoPriorInsurance"&&ot(t,o)&&hd.has(u)))return}_o(c)||i.push(c);const d=fo(c,t[u]),f=c.conditionals??[];if(!f.length)return;const m=f.filter(y=>go(d,y.conditionalType,y.conditionalValue));(m.length>1&&!m.some(y=>y.conditionalQuestionsAllowMultiple)?m.slice(0,1):m).forEach(y=>{const h=y.conditionalQuestions??[];h.length&&(y.conditionalQuestionsAllowMultiple||a(h))})})};return a(n),i}const vo="__items",Er=e=>`${e}${vo}`;function gd(e,t){if(e.key==="relationship_to_insured"||e.key==="is_registered_owner"){const r=t[t.length-1];return typeof r=="number"&&r===0}return!1}function Tr(e,t,r=[],n=void 0){for(const o of e){const i=String(o.key),a=fo(o,t[i]),s=o.conditionals??[];if(!s.length)continue;const c=s.filter(d=>go(a,d.conditionalType,d.conditionalValue)),u=c.length>1&&!c.some(d=>d.conditionalQuestionsAllowMultiple)?c.slice(0,1):c;for(const d of u){const f=d.conditionalQuestions??[];if(!f.length)continue;if(!d.conditionalQuestionsAllowMultiple){if(Tr(f,t,r,n))return!0;continue}const m=t[Er(i)]??[];if(m.length===0)return!0;for(const[g,y]of m.entries()){const h=[...r,Er(i),g],ie=f.filter(X=>!(gd(X,h)||fr(String(X.key),n)||!pd(X,y))),te=Dt(ie,y);if(Object.values(te).some(Boolean)||Tr(f,y,h,n))return!0}}}return!1}function bo(e,t,r){return Tr(e,t,[],r)}function So(e){const t=e.vehicles__items??[];if(!Array.isArray(t)||t.length===0)return!1;for(const r of t)if(He(r.vehicle_comp_deductible,"select")||He(r.vehicle_coll_deductible,"select")||He(r.vehicle_towing_and_labor,"select")||He(r.vehicle_transportation_expense,"select"))return!0;return!1}function yd({stages:e,onStageComplete:t,onComplete:r,initialValues:n,initialActive:o,quoteId:i}){const[a,s]=b.useState(o??0),[c,u]=b.useState(n??{}),[d,f]=b.useState({}),[m,g]=b.useState(!1),[y,h]=b.useState(!1),[ie,te]=b.useState(null),X=b.useRef([]),ee=b.useRef(e),D=Array.isArray(e)&&e.length>0,M=D?Math.min(a,e.length-1):0,B=D?e[M]:null,P=B?.key??null;b.useEffect(()=>{o!==void 0&&s(o)},[o]),ee.current=e;const S=b.useMemo(()=>!!(M>=e.length-1||e.slice(M+1).every(W=>W.key==="AutoPolicy")&&(c.drivers__items??[]).length<=1),[M,e,c]);b.useEffect(()=>{D&&a>=e.length&&s(e.length-1)},[a,e.length,D]),b.useEffect(()=>{const E=X.current[M];E&&E.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[M]),b.useEffect(()=>{n!==void 0&&u(n)},[n]),b.useEffect(()=>{if(!B||!P){g(!1),te(null);return}if(d[P]){g(!1),te(null);return}let E=!1;return g(!0),te(null),Promise.resolve(B.loadQuestions()).then(W=>{if(!E){if(!Array.isArray(W))throw new Error(`loadQuestions("${P}") did not return an array`);f(pe=>({...pe,[P]:W}))}}).catch(W=>{E||te(`Failed to load stage "${B?.title??""}": ${W?.message??"Unknown error"}`)}).finally(()=>{E||g(!1)}),()=>{E=!0}},[B,P,d]);const I=P?d[P]:void 0,V=b.useMemo(()=>hr(qt(I??[])),[I]);b.useEffect(()=>{B&&P&&I&&ad({stageKey:P,stageTitle:B.title??P,stepIndex:a+1,totalSteps:e.length})},[P,a,e.length,B,I]);const $=b.useMemo(()=>{if(!I)return{};const E={};(de=>{const Fe=[],N=v=>{v.forEach((_,T)=>{const C=Lt(_,T);Fe.push(C);const O=Er(C);Fe.push(O),(_.conditionals??[]).forEach(x=>{const H=x.conditionalQuestions??[];H.length>0&&N(H)})})};return N(de),Fe})(I).forEach(de=>{de in c&&(E[de]=c[de])});for(const de of["state","State","address","product"])de in c&&(E[de]=c[de]);for(const[de,Fe]of Object.entries(c))de.endsWith(vo)&&!(de in E)&&(E[de]=Fe);return E},[I,c]),G=E=>{u(W=>({...W,...E}))},U=()=>{s(E=>E>0?E-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},re=async()=>{if(!I||!B||m||ie||y)return;const E=yo(I,$,P??void 0),W=_t(c,V),pe=E.map(x=>xt(x,V)?{...x,required:W}:x),de=Dt(pe,$),Fe=new Set(pe.map((x,H)=>Lt(x,H))),N=Object.entries(de).some(([x,H])=>H&&Fe.has(x)),v=bo(I,c,P??void 0),T=E.some(x=>String(x.key??"")==="vehicle_policy_selections")?So(c):!1,C=c.driver_vehicle_assignments,O=c.drivers__items??[];let Z=!1;if(C&&O.length>=2){const x=c.vehicles__items??[];for(let H=0;H<x.length;H++){const A=C[`v${H}`];if(!A)continue;const w=O.map((z,j)=>A[`d${j}`]??0),k=w.filter(z=>z>0);if(k.length>=2&&k.every(z=>z===50)){Z=!0;break}const q=w.reduce((z,j)=>z+j,0);if(q>0&&q!==100){Z=!0;break}}}if(!(N||v||T||Z)){h(!0);try{const x=S,{success:H,error:A}=x?await r(c,P??""):await t($,P??"");if(!H){te(A??"An error occurred");return}if(!x){const w=ee.current,k=w.findIndex(z=>z.key===P),q=k>=0?Math.min(k+1,w.length-1):Math.min(a+1,w.length-1);s(q)}}finally{h(!1)}}},Y=b.useMemo(()=>{if(!I||m||ie||y)return!0;const E=yo(I,$,P??void 0),W=_t(c,V),pe=E.map(x=>xt(x,V)?{...x,required:W}:x),de=Dt(pe,$),Fe=new Set(pe.map((x,H)=>Lt(x,H))),N=Object.entries(de).some(([x,H])=>H&&Fe.has(x)),v=bo(I,c,P??void 0),T=E.some(x=>String(x.key??"")==="vehicle_policy_selections")?So(c):!1,C=c.driver_vehicle_assignments,O=c.drivers__items??[];let Z=!1;if(C&&O.length>=2){const x=c.vehicles__items??[];for(let H=0;H<x.length;H++){const A=C[`v${H}`];if(!A)continue;const w=O.map((z,j)=>A[`d${j}`]??0),k=w.filter(z=>z>0);if(k.length>=2&&k.every(z=>z===50)){Z=!0;break}const q=w.reduce((z,j)=>z+j,0);if(q>0&&q!==100){Z=!0;break}}}return N||v||T||Z},[I,$,c,m,ie,y,V,P]);return D?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"form-wizard-steps-header flex items-center justify-between gap-4",children:[l.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((E,W)=>[l.jsx("li",{ref:pe=>{X.current[W]=pe},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${W<M?"bg-blue-600 text-white border-blue-600":W===M?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:E.title},E.key??`stage-${W}`),...W<e.length-1?[l.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${E.key??W}`)]:[]])}),l.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[M+1," / ",e.length]})]}),l.jsxs("div",{children:[m&&l.jsx("div",{className:"text-slate-500",children:"Loading…"}),B&&l.jsx(rd,{questions:I??[],controlledValues:$,onChangeValues:G,onSubmit:()=>re(),quoteId:i,widgetStageKey:P??void 0},B.key)]}),!m&&ie&&l.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[l.jsx("div",{children:ie}),B&&l.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{f(E=>{if(!P)return E;const W={...E};return delete W[P],W})},children:"Retry"})]}),l.jsxs("div",{className:M>0?"grid grid-cols-2 gap-3":"",children:[M>0&&l.jsx("button",{type:"button",onClick:U,disabled:m,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Back"}),l.jsxs("button",{type:"button","data-widget-ctrl":"next",onClick:re,disabled:Y,className:["form-wizard-next-btn",M>0?"":"w-full","h-12 rounded-full text-white transition","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center justify-center gap-2",Y?"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:[y&&l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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?"Finish":"Next"]})]})]}):l.jsx("div",{className:"text-slate-600",children:"Loading..."})}const vd=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),wo={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},Co=["PersonalHome","PersonalAuto","Flood","ExcessFlood"],ht="rounded-2xl border-2 border-blue-300 bg-blue-50/30 p-4 shadow-blue-100/60 ring-1 ring-blue-100",gt="mb-3 inline-flex w-fit items-center rounded-full bg-blue-100 px-2.5 py-1 text-xs font-semibold text-blue-700",Ao="w-full max-w-md min-w-0 sm:max-w-[calc((100%-1rem)/2)]",bd="rounded-2xl border-2 border-transparent p-4";function Eo({onBack:e}){const t=()=>{ld(),e?.()};return l.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 Ze({rate:e,status:t,onRequestBind:r,featured:n=!1,showLobLabel:o=!0,showFeaturedBadge:i,className:a}){const s=Number.isFinite(e.term_months)&&e.term_months>0?e.term_months:1,u=(e.monthly_premium_cents!=null?e.monthly_premium_cents:Math.round((e.premium_cents||0)/s))/100,d=vd.format(u),f=t==="loading",m=t==="success",g=!!(e.effective_date&&e.policy_end_date),y=e.lob?wo[e.lob]||e.lob:null,h=i??n;return l.jsxs("div",{className:`flex w-full flex-col rounded-xl bg-white p-6 shadow-sm transition hover:shadow-md ${n?"border-2 border-blue-300 shadow-blue-100/60 ring-1 ring-blue-100":"border border-slate-200"}${a?` ${a}`:""}`,children:[o&&y&&l.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-slate-500",children:y}),h&&l.jsx("div",{className:"mb-3 inline-flex w-fit items-center rounded-full bg-blue-50 px-2.5 py-1 text-xs font-semibold text-blue-700",children:"Featured"}),l.jsxs("div",{className:"mb-4 flex flex-col items-start gap-2",children:[e.carrier_logo_base64?l.jsx("img",{src:`data:image/png;base64,${e.carrier_logo_base64}`,alt:e.carrier_name,className:"h-12 w-auto max-w-full object-contain"}):l.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:e.carrier_name.charAt(0).toUpperCase()}),l.jsx("h4",{className:"w-full break-words text-left font-semibold text-slate-900",children:e.carrier_name})]}),l.jsx("div",{className:"mb-2",children:l.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:[d,l.jsx("span",{className:"ml-1 text-sm font-medium text-slate-500",children:"/month"})]})}),g&&l.jsx("div",{className:"mb-2",children:l.jsxs("p",{className:"text-xs text-slate-500",children:["Effective ",e.effective_date," - ",e.policy_end_date]})}),e.carrier_quote_id&&l.jsx("div",{className:"mb-4",children:l.jsxs("p",{className:"text-xs text-slate-400",children:["Quote ID: ",e.carrier_quote_id]})}),l.jsxs("div",{className:"mt-auto pt-4",children:[l.jsx("button",{type:"button",onClick:r,disabled:f||m,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 ${m?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:f?"Requesting…":m?"Requested":"Request Bind"}),t==="error"&&l.jsx("p",{className:"mt-2 text-xs text-red-600",children:"Something went wrong. Please try again."}),t==="success"&&l.jsx("p",{className:"mt-2 text-xs text-emerald-600",children:"We received your bind request."})]})]})}function Sd({rates:e,onBack:t,isBundleFlow:r=!1}){const n=e,o=Array.isArray(n)&&n.length>0,[i,a]=b.useState({}),[s,c]=b.useState("admitted"),u=b.useMemo(()=>o?n.filter(S=>(S.admitted_status??"admitted")==="admitted"):[],[n,o]),d=b.useMemo(()=>o?n.filter(S=>S.admitted_status==="non_admitted"):[],[n,o]),f=u.length,m=d.length,g=f+m>0;b.useEffect(()=>{g&&s==="admitted"&&f===0&&m>0&&c("non_admitted")},[s,f,m,g]);const y=b.useMemo(()=>g?s==="admitted"?u:d:[],[g,s,u,d]);b.useEffect(()=>{vr()},[]);const h=b.useMemo(()=>{if(y.length===0)return[];if(!y.some($=>$.lob))return[{lob:null,title:"Rates",rates:[...y].sort((G,U)=>{const re=Number.isFinite(G.term_months)&&G.term_months>0?G.term_months:1,Y=Number.isFinite(U.term_months)&&U.term_months>0?U.term_months:1,E=G.monthly_premium_cents??Math.round((G.premium_cents||0)/re),W=U.monthly_premium_cents??Math.round((U.premium_cents||0)/Y);return E-W})}];const I=new Map;for(const $ of y){const G=$.lob||"_other",U=I.get(G);U?U.push($):I.set(G,[$])}return[...I.entries()].sort(([$],[G])=>{const U=Co.indexOf($),re=Co.indexOf(G);return(U===-1?999:U)-(re===-1?999:re)}).map(([$,G])=>({lob:$,title:wo[$]??$,rates:[...G].sort((U,re)=>{const Y=Number.isFinite(U.term_months)&&U.term_months>0?U.term_months:1,E=Number.isFinite(re.term_months)&&re.term_months>0?re.term_months:1,W=U.monthly_premium_cents??Math.round((U.premium_cents||0)/Y),pe=re.monthly_premium_cents??Math.round((re.premium_cents||0)/E);return W-pe})}))},[y]),ie=b.useMemo(()=>{if(!r)return[];const S=n.some($=>$.lob==="PersonalAuto"),I=n.some($=>$.lob==="PersonalHome"),V=[];return S||V.push("Sorry, no rates found for Personal Auto."),I||V.push("Sorry, no rates found for Homeowners."),V},[r,n]);if(!g)return l.jsxs("section",{className:"mt-8",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),l.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Sorry, no rates are available at this time."}),t&&l.jsx(Eo,{onBack:t})]});const te=async S=>{a(I=>({...I,[S]:"loading"}));try{if(vr(),!Bt())throw new Error("Authentication required. Please verify your phone number first.");if(!((await zu(S))?.success!==!1))throw new Error("Request failed");Ou(),eo(),a(G=>({...G,[S]:"success"}))}catch{a(I=>({...I,[S]:"error"}))}},X=h.find(S=>S.lob==="PersonalAuto"),ee=h.find(S=>S.lob==="PersonalHome"),D=!!(X?.rates.length&&ee?.rates.length),M=h.filter(S=>!D||S.lob!=="PersonalAuto"&&S.lob!=="PersonalHome"),B=D&&X&&ee?[{rate:X.rates[0]},{rate:ee.rates[0]}]:[],P=B.length===1;return l.jsxs("section",{className:"mt-8",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),ie.length>0&&l.jsx("div",{className:"mt-3 space-y-1",children:ie.map(S=>l.jsx("p",{className:"text-sm text-slate-600",children:S},S))}),l.jsx("div",{className:"mt-4 border-b border-slate-200",children:l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsxs("button",{type:"button",onClick:()=>c("admitted"),className:`border-b-2 px-1 py-2 text-sm font-semibold transition ${s==="admitted"?"border-cyan-500 text-slate-900":"border-transparent text-slate-500 hover:text-slate-800"}`,children:["Admitted (",f,")"]}),l.jsxs("button",{type:"button",onClick:()=>c("non_admitted"),className:`border-b-2 px-1 py-2 text-sm font-semibold transition ${s==="non_admitted"?"border-cyan-500 text-slate-900":"border-transparent text-slate-500 hover:text-slate-800"}`,children:["Non-admitted (",m,")"]})]})}),y.length===0&&l.jsx("p",{className:"mt-4 text-sm text-slate-500",children:s==="admitted"?"Sorry, no admitted rates are available at this time.":"Sorry, no non-admitted rates are available at this time."}),y.length>0&&D&&X&&ee&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:P?"mt-6 flex justify-center":"mt-6",children:l.jsxs("div",{className:P?`w-full max-w-md ${ht}`:ht,children:[l.jsx("div",{className:gt,children:"Featured Bundle"}),l.jsx("div",{className:P?"grid justify-items-center gap-4":"grid gap-4 sm:grid-cols-2",children:B.map(({rate:S})=>l.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:l.jsx(Ze,{rate:S,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[S.quote_rate_id]??"idle",onRequestBind:()=>te(S.quote_rate_id)})},S.quote_rate_id))})]})}),X.rates.length>1&&l.jsxs("div",{className:"mt-6",children:[l.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",X.title," Options"]}),l.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:X.rates.slice(1).map(S=>l.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:l.jsx(Ze,{rate:S,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[S.quote_rate_id]??"idle",onRequestBind:()=>te(S.quote_rate_id)})},S.quote_rate_id))})]}),ee.rates.length>1&&l.jsxs("div",{className:"mt-6",children:[l.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",ee.title," Options"]}),l.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:ee.rates.slice(1).map(S=>l.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:l.jsx(Ze,{rate:S,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[S.quote_rate_id]??"idle",onRequestBind:()=>te(S.quote_rate_id)})},S.quote_rate_id))})]})]}),y.length>0&&M.map(S=>{const[I,...V]=S.rates;return l.jsxs("div",{className:"mt-6",children:[l.jsx("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:S.title}),V.length===0?l.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:l.jsx("div",{className:"col-span-full flex justify-center",children:l.jsxs("div",{className:`${Ao} ${ht}`,children:[l.jsx("div",{className:gt,children:"Featured"}),l.jsx(Ze,{rate:I,featured:!1,showLobLabel:S.lob==null,showFeaturedBadge:!1,status:i[I.quote_rate_id]??"idle",onRequestBind:()=>te(I.quote_rate_id)})]})})}):V.length===1?l.jsxs("div",{className:"grid items-stretch gap-4 sm:grid-cols-2",children:[l.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${ht}`,children:[l.jsx("div",{className:gt,children:"Featured"}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:l.jsx(Ze,{rate:I,featured:!1,showLobLabel:S.lob==null,showFeaturedBadge:!1,status:i[I.quote_rate_id]??"idle",onRequestBind:()=>te(I.quote_rate_id),className:"h-full min-h-0"})})]}),l.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${bd}`,children:[l.jsx("div",{className:`${gt} pointer-events-none invisible shrink-0`,"aria-hidden":!0,children:"Featured"}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:l.jsx(Ze,{rate:V[0],featured:!1,showLobLabel:S.lob==null,showFeaturedBadge:!1,status:i[V[0].quote_rate_id]??"idle",onRequestBind:()=>te(V[0].quote_rate_id),className:"h-full min-h-0"})})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:l.jsx("div",{className:"col-span-full flex justify-center",children:l.jsxs("div",{className:`${Ao} ${ht}`,children:[l.jsx("div",{className:gt,children:"Featured"}),l.jsx(Ze,{rate:I,featured:!1,showLobLabel:S.lob==null,showFeaturedBadge:!1,status:i[I.quote_rate_id]??"idle",onRequestBind:()=>te(I.quote_rate_id)})]})})}),l.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:V.map($=>l.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:l.jsx(Ze,{rate:$,featured:!1,showLobLabel:S.lob==null,showFeaturedBadge:!1,status:i[$.quote_rate_id]??"idle",onRequestBind:()=>te($.quote_rate_id)})},$.quote_rate_id))})]})]},S.lob??"all")}),t&&l.jsx(Eo,{onBack:t})]})}function R(e){if(e===!0)return"Yes";if(e===!1)return"No"}function Te(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 wd(e){const t=e,r={};t.phone&&(r.phone=t.phone),t.first_name&&(r.first_name=t.first_name),t.last_name&&(r.last_name=t.last_name),t.email&&(r.email=t.email),t.date_of_birth&&(r.date_of_birth=Te(t.date_of_birth)),t.product&&(r.product=t.product),t.state&&(r.state=t.state);const n=[];t.line_1&&n.push(t.line_1),t.line_2&&n.push(t.line_2),t.city&&n.push(t.city),t.state&&n.push(t.state),t.postal_code&&n.push(t.postal_code),n.length>0&&(r.address=n.join(", ")),t.years_at_address!==null&&t.years_at_address!==void 0&&(r.years_at_address=t.years_at_address),t.months_at_address!==null&&t.months_at_address!==void 0&&(r.months_at_address=t.months_at_address),t.move_in_date&&(r.move_in_date=Te(t.move_in_date));const o=[];t.prior_line_1&&o.push(t.prior_line_1),t.prior_line_2&&o.push(t.prior_line_2),t.prior_city&&o.push(t.prior_city),t.prior_state&&o.push(t.prior_state),t.prior_postal_code&&o.push(t.prior_postal_code),o.length>0&&(r.prior_address=o.join(", ")),t.years_at_prior_address!==null&&t.years_at_prior_address!==void 0&&(r.years_at_prior_address=t.years_at_prior_address),t.is_mailing_address_different!==null&&t.is_mailing_address_different!==void 0&&(r.is_mailing_address_different=R(t.is_mailing_address_different)),t.mailing_address&&(r.mailing_address=t.mailing_address),t.effective_date&&(r.effective_date=Te(t.effective_date)),t.auto_has_prior_insurance!==null&&t.auto_has_prior_insurance!==void 0&&(r.auto_has_prior_insurance=R(t.auto_has_prior_insurance)),t.auto_prior_expiration_date&&(r.auto_prior_expiration_date=Te(t.auto_prior_expiration_date)),t.auto_prior_carrier_name&&(r.auto_prior_carrier_name=t.auto_prior_carrier_name),t.auto_prior_liability_limit&&(r.auto_prior_liability_limit=t.auto_prior_liability_limit),t.auto_reason_for_no_insurance&&(r.auto_reason_for_no_insurance=t.auto_reason_for_no_insurance),t.auto_prior_years!==null&&t.auto_prior_years!==void 0&&(r.auto_prior_years=t.auto_prior_years),t.auto_prior_months!==null&&t.auto_prior_months!==void 0&&(r.auto_prior_months=t.auto_prior_months),t.auto_continuous_coverage_years!==null&&t.auto_continuous_coverage_years!==void 0&&(r.auto_continuous_coverage_years=t.auto_continuous_coverage_years),t.auto_cancelled_declined_refused_to_renew!==null&&t.auto_cancelled_declined_refused_to_renew!==void 0&&(r.auto_cancelled_declined_refused_to_renew=R(t.auto_cancelled_declined_refused_to_renew)),t.auto_current_annual_premium_cents!==null&&t.auto_current_annual_premium_cents!==void 0&&(r.auto_current_annual_premium_cents=t.auto_current_annual_premium_cents),t.policy_bi&&(r.policy_bi=t.policy_bi),t.policy_um&&(r.policy_um=t.policy_um),t.policy_pd&&(r.policy_pd=t.policy_pd),t.policy_mp&&(r.policy_mp=t.policy_mp),t.policy_umpd&&(r.policy_umpd=t.policy_umpd),t.policy_pip&&(r.policy_pip=t.policy_pip),t.policy_auto_death_indemnity&&(r.policy_auto_death_indemnity=t.policy_auto_death_indemnity),t.driver_vehicle_assignments&&(r.driver_vehicle_assignments=t.driver_vehicle_assignments),t.home_has_prior_insurance!==null&&t.home_has_prior_insurance!==void 0&&(r.home_has_prior_insurance=R(t.home_has_prior_insurance)),t.home_prior_expiration_date&&(r.home_prior_expiration_date=Te(t.home_prior_expiration_date)),t.home_prior_carrier_name&&(r.home_prior_carrier_name=t.home_prior_carrier_name),t.home_prior_years!==null&&t.home_prior_years!==void 0&&(r.home_prior_years=t.home_prior_years),t.home_continuous_coverage_years!==null&&t.home_continuous_coverage_years!==void 0&&(r.home_continuous_coverage_years=t.home_continuous_coverage_years),t.property_insurance_cancelled!==null&&t.property_insurance_cancelled!==void 0&&(r.property_insurance_cancelled=R(t.property_insurance_cancelled)),t.lapse_in_coverage!==null&&t.lapse_in_coverage!==void 0&&(r.lapse_in_coverage=R(t.lapse_in_coverage)),t.year_built!==null&&t.year_built!==void 0&&(r.year_built=t.year_built),t.number_of_units!==null&&t.number_of_units!==void 0&&(r.number_of_units=t.number_of_units),t.number_of_stories!==null&&t.number_of_stories!==void 0&&(r.number_of_stories=t.number_of_stories),t.number_of_beds!==null&&t.number_of_beds!==void 0&&(r.number_of_beds=t.number_of_beds),t.number_of_full_baths!==null&&t.number_of_full_baths!==void 0&&(r.number_of_full_baths=t.number_of_full_baths),t.number_of_partial_baths!==null&&t.number_of_partial_baths!==void 0&&(r.number_of_partial_baths=t.number_of_partial_baths),t.under_construction!==null&&t.under_construction!==void 0&&(r.under_construction=R(t.under_construction)),t.distance_from_fire_hydrant_ft&&(r.distance_from_fire_hydrant_ft=t.distance_from_fire_hydrant_ft),t.distance_from_fire_station_miles&&(r.distance_from_fire_station_miles=t.distance_from_fire_station_miles),t.architectural_style&&(r.architectural_style=t.architectural_style),t.dwelling_type&&(r.dwelling_type=t.dwelling_type),t.construction_quality&&(r.construction_quality=t.construction_quality),t.located_over_water!==null&&t.located_over_water!==void 0&&(r.located_over_water=t.located_over_water),t.construction_type&&(r.construction_type=t.construction_type),t.exterior_wall_type&&(r.exterior_wall_type=t.exterior_wall_type),t.foundation_type&&(r.foundation_type=t.foundation_type),t.roof_material_type&&(r.roof_material_type=t.roof_material_type),t.roof_shape&&(r.roof_shape=t.roof_shape),t.roof_updated_type&&(r.roof_updated_type=t.roof_updated_type),t.year_roof_updated!==null&&t.year_roof_updated!==void 0&&(r.year_roof_updated=t.year_roof_updated),t.mit_credit_form!==null&&t.mit_credit_form!==void 0&&(r.mit_credit_form=R(t.mit_credit_form)),t.storm_shutters!==null&&t.storm_shutters!==void 0&&(r.storm_shutters=R(t.storm_shutters)),t.heating_type&&(r.heating_type=t.heating_type),t.oil_tank_location&&(r.oil_tank_location=t.oil_tank_location),t.heating_fuel_type&&(r.heating_fuel_type=t.heating_fuel_type),t.number_of_fireplaces!==null&&t.number_of_fireplaces!==void 0&&(r.number_of_fireplaces=t.number_of_fireplaces),t.basement_type&&(r.basement_type=t.basement_type),t.parking_type&&(r.parking_type=t.parking_type),t.number_of_parking_spaces!==null&&t.number_of_parking_spaces!==void 0&&(r.number_of_parking_spaces=t.number_of_parking_spaces),t.plumbing_type&&(r.plumbing_type=t.plumbing_type),t.pool_type&&(r.pool_type=t.pool_type),t.total_area_sq_ft!==null&&t.total_area_sq_ft!==void 0&&(r.total_area_sq_ft=t.total_area_sq_ft),t.parcel_area_sq_ft!==null&&t.parcel_area_sq_ft!==void 0&&(r.parcel_area_sq_ft=t.parcel_area_sq_ft),t.residence_type&&(r.residence_type=t.residence_type),t.usage_type&&(r.usage_type=t.usage_type),t.household_size!==null&&t.household_size!==void 0&&(r.household_size=t.household_size),t.number_of_mortgagees!==null&&t.number_of_mortgagees!==void 0&&(r.number_of_mortgagees=t.number_of_mortgagees),t.has_dog!==null&&t.has_dog!==void 0&&(r.has_dog=R(t.has_dog)),t.dog_breed_type&&(r.dog_breed_type=t.dog_breed_type),t.number_of_dogs!==null&&t.number_of_dogs!==void 0&&(r.number_of_dogs=t.number_of_dogs),t.has_vicious_animals!==null&&t.has_vicious_animals!==void 0&&(r.has_vicious_animals=R(t.has_vicious_animals)),t.has_business_on_premises!==null&&t.has_business_on_premises!==void 0&&(r.has_business_on_premises=R(t.has_business_on_premises)),t.business_class&&(r.business_class=t.business_class),t.occupancy_type&&(r.occupancy_type=t.occupancy_type),t.short_term_rental!==null&&t.short_term_rental!==void 0&&(r.short_term_rental=R(t.short_term_rental)),t.sale_price_cents!==null&&t.sale_price_cents!==void 0&&(r.sale_price_cents=Math.round(Number(t.sale_price_cents)/100)),t.number_of_families!==null&&t.number_of_families!==void 0&&(r.number_of_families=t.number_of_families),t.number_of_units_in_firewall!==null&&t.number_of_units_in_firewall!==void 0&&(r.number_of_units_in_firewall=t.number_of_units_in_firewall),t.heating_update_yn!==null&&t.heating_update_yn!==void 0&&(r.heating_update_yn=R(t.heating_update_yn)),t.heating_update_type&&(r.heating_update_type=t.heating_update_type),t.heating_update_year!==null&&t.heating_update_year!==void 0&&(r.heating_update_year=t.heating_update_year),t.plumbing_update_yn!==null&&t.plumbing_update_yn!==void 0&&(r.plumbing_update_yn=R(t.plumbing_update_yn)),t.plumbing_update_type&&(r.plumbing_update_type=t.plumbing_update_type),t.plumbing_update_year!==null&&t.plumbing_update_year!==void 0&&(r.plumbing_update_year=t.plumbing_update_year),t.electrical_update_yn!==null&&t.electrical_update_yn!==void 0&&(r.electrical_update_yn=R(t.electrical_update_yn)),t.electrical_update_type&&(r.electrical_update_type=t.electrical_update_type),t.electrical_update_year!==null&&t.electrical_update_year!==void 0&&(r.electrical_update_year=t.electrical_update_year),t.electric_circuit_breaker!==null&&t.electric_circuit_breaker!==void 0&&(r.electric_circuit_breaker=R(t.electric_circuit_breaker)),t.dwelling_replacement_cost!==null&&t.dwelling_replacement_cost!==void 0&&(r.dwelling_replacement_cost=t.dwelling_replacement_cost),t.other_structures_coverage!==null&&t.other_structures_coverage!==void 0&&(r.other_structures_coverage=t.other_structures_coverage),t.personal_property_coverage!==null&&t.personal_property_coverage!==void 0&&(r.personal_property_coverage=t.personal_property_coverage),t.loss_of_use_coverage!==null&&t.loss_of_use_coverage!==void 0&&(r.loss_of_use_coverage=t.loss_of_use_coverage),t.personal_liability&&(r.personal_liability=t.personal_liability),t.dwelling_medical_payments&&(r.dwelling_medical_payments=t.dwelling_medical_payments),t.all_perils_deductible&&(r.all_perils_deductible=t.all_perils_deductible),t.windstorm_deductible&&(r.windstorm_deductible=t.windstorm_deductible),t.has_garage!==null&&t.has_garage!==void 0&&(r.has_garage=R(t.has_garage)),t.has_pool!==null&&t.has_pool!==void 0&&(r.has_pool=R(t.has_pool)),t.has_trampoline!==null&&t.has_trampoline!==void 0&&(r.has_trampoline=R(t.has_trampoline)),t.gender&&(r.gender=t.gender),t.marital_status&&(r.marital_status=t.marital_status),t.employment_industry&&(r.employment_industry=t.employment_industry),t.occupation&&(r.occupation=t.occupation),t.has_co_applicant!==null&&t.has_co_applicant!==void 0&&(r.has_co_applicant=R(t.has_co_applicant)),t.co_applicant_first_name&&(r.co_applicant_first_name=t.co_applicant_first_name),t.co_applicant_middle_name&&(r.co_applicant_middle_name=t.co_applicant_middle_name),t.co_applicant_last_name&&(r.co_applicant_last_name=t.co_applicant_last_name),t.co_applicant_gender&&(r.co_applicant_gender=t.co_applicant_gender),t.co_applicant_marital_status&&(r.co_applicant_marital_status=t.co_applicant_marital_status),t.co_applicant_relationship&&(r.co_applicant_relationship=t.co_applicant_relationship),t.co_applicant_date_of_birth&&(r.co_applicant_date_of_birth=Te(t.co_applicant_date_of_birth)),t.co_applicant_employment_industry&&(r.co_applicant_employment_industry=t.co_applicant_employment_industry),t.co_applicant_occupation&&(r.co_applicant_occupation=t.co_applicant_occupation),t.retiree_discount!==null&&t.retiree_discount!==void 0&&(r.retiree_discount=R(t.retiree_discount)),t.gated_community_discount!==null&&t.gated_community_discount!==void 0&&(r.gated_community_discount=R(t.gated_community_discount)),t.multi_policy_discount!==null&&t.multi_policy_discount!==void 0&&(r.multi_policy_discount=R(t.multi_policy_discount)),t.non_smoker_discount!==null&&t.non_smoker_discount!==void 0&&(r.non_smoker_discount=R(t.non_smoker_discount)),t.first_time_buyer_discount!==null&&t.first_time_buyer_discount!==void 0&&(r.first_time_buyer_discount=R(t.first_time_buyer_discount)),t.fire_detection_system!==null&&t.fire_detection_system!==void 0&&(r.fire_detection_system=R(t.fire_detection_system)),t.burglar_alarm_system!==null&&t.burglar_alarm_system!==void 0&&(r.burglar_alarm_system=R(t.burglar_alarm_system)),t.burglar_alarm_system_type&&(r.burglar_alarm_system_type=t.burglar_alarm_system_type),t.smoke_detectors!==null&&t.smoke_detectors!==void 0&&(r.smoke_detectors=R(t.smoke_detectors)),t.sprinkler_system!==null&&t.sprinkler_system!==void 0&&(r.sprinkler_system=R(t.sprinkler_system)),t.sprinkler_system_type&&(r.sprinkler_system_type=t.sprinkler_system_type),t.gas_leakage_detector!==null&&t.gas_leakage_detector!==void 0&&(r.gas_leakage_detector=R(t.gas_leakage_detector)),t.deadbolt_locks!==null&&t.deadbolt_locks!==void 0&&(r.deadbolt_locks=R(t.deadbolt_locks)),t.fire_extinguisher!==null&&t.fire_extinguisher!==void 0&&(r.fire_extinguisher=R(t.fire_extinguisher)),t.order_credit_authorized!==null&&t.order_credit_authorized!==void 0&&(r.order_credit_authorized=R(t.order_credit_authorized)),t.has_health_insurance_auto_accident!==null&&t.has_health_insurance_auto_accident!==void 0&&(r.has_health_insurance_auto_accident=R(t.has_health_insurance_auto_accident)),t.is_corporation!==null&&t.is_corporation!==void 0&&(r.is_corporation=R(t.is_corporation)),t.named_insured_foreclosure_repo_bankruptcy!==null&&t.named_insured_foreclosure_repo_bankruptcy!==void 0&&(r.named_insured_foreclosure_repo_bankruptcy=R(t.named_insured_foreclosure_repo_bankruptcy)),t.named_insured_convicted_insurance_fraud!==null&&t.named_insured_convicted_insurance_fraud!==void 0&&(r.named_insured_convicted_insurance_fraud=R(t.named_insured_convicted_insurance_fraud));const i={};if(t.vehicles)for(const a of t.vehicles)a.quote_vehicle_id&&a.vin&&(i[a.quote_vehicle_id]=a.vin);return t.drivers&&t.drivers.length>0?(r.drivers="Yes",r.drivers__items=t.drivers.map(a=>{const s=a,c={};s.first_name&&(c.first_name=s.first_name),s.middle_name&&(c.middle_name=s.middle_name),s.last_name&&(c.last_name=s.last_name),s.date_of_birth&&(c.date_of_birth=Te(s.date_of_birth)),s.gender&&(c.gender=s.gender),s.marital_status&&(c.marital_status=s.marital_status),s.relationship_to_insured&&(c.relationship_to_insured=s.relationship_to_insured),s.is_registered_owner!==null&&s.is_registered_owner!==void 0&&(c.is_registered_owner=s.is_registered_owner?"Yes":"No"),s.license_state&&(c.license_state=s.license_state),s.license_status&&(c.license_status=s.license_status),s.license_number&&(c.license_number=s.license_number),s.date_first_licensed&&(c.date_first_licensed=Te(s.date_first_licensed)),s.education_level&&(c.education_level=Kn(s.education_level)),s.occupation&&(c.occupation=Jn(s.occupation)),s.industry&&(c.industry=Pt(s.industry)),s.employment_status&&(c.employment_status=s.employment_status),s.last_5_years_license_suspended_or_revoked!==null&&s.last_5_years_license_suspended_or_revoked!==void 0&&(c.last_5_years_license_suspended_or_revoked=R(s.last_5_years_license_suspended_or_revoked)),s.accident_prevention_course!==null&&s.accident_prevention_course!==void 0&&(c.accident_prevention_course=R(s.accident_prevention_course)),s.accident_prevention_course_date&&(c.accident_prevention_course_date=Te(s.accident_prevention_course_date)),s.sr22!==null&&s.sr22!==void 0&&(c.sr22=R(s.sr22));const u=s.ssn_display;typeof u=="string"&&(c.ssn_display=u);const d=s.driver_violations;d&&d.length>0&&(c.driver_violations="Yes",c.driver_violations__items=d.map(g=>{const y={};return g.code&&(y.code=g.code),g.occurred_at&&(y.occurred_at=Te(g.occurred_at)),y}));const f=s.driver_accidents;f&&f.length>0&&(c.driver_accidents="Yes",c.driver_accidents__items=f.map(g=>{const y={};return g.occurred_at&&(y.occurred_at=Te(g.occurred_at)),g.description&&(y.description=g.description),g.quote_vehicle_id&&(y.quote_vehicle_id=i[g.quote_vehicle_id]??g.quote_vehicle_id),g.property_damage_amount_paid_cents!==null&&g.property_damage_amount_paid_cents!==void 0&&(y.property_damage_amount_paid_cents=g.property_damage_amount_paid_cents),g.personal_injury_amount_paid_cents!==null&&g.personal_injury_amount_paid_cents!==void 0&&(y.personal_injury_amount_paid_cents=g.personal_injury_amount_paid_cents),y}));const m=s.losses;return m&&m.length>0&&(c.losses="Yes",c.losses__items=m.map(g=>{const y={};return g.description&&(y.description=g.description),g.date_of_incident&&(y.date_of_incident=Te(g.date_of_incident)),g.amount_paid_cents!==null&&g.amount_paid_cents!==void 0&&(y.amount_paid_cents=g.amount_paid_cents),g.quote_vehicle_id&&(y.quote_vehicle_id=i[g.quote_vehicle_id]??g.quote_vehicle_id),y})),c})):r.drivers="No",t.vehicles&&t.vehicles.length>0?(r.vehicles="Yes",r.vehicles__items=t.vehicles.map(a=>{const s=a,c={};s.vin&&(c.vin=s.vin),s.year!==null&&s.year!==void 0&&(c.year=String(s.year)),s.make&&(c.make=s.make),s.model&&(c.model=s.model),s.body_style&&(c.body_style=s.body_style),s.ownership_type&&(c.ownership_type=s.ownership_type),s.usage&&(c.usage=s.usage),s.annual_mileage!==null&&s.annual_mileage!==void 0&&(c.annual_mileage=s.annual_mileage),s.miles_to_work!==null&&s.miles_to_work!==void 0&&(c.miles_to_work=s.miles_to_work),s.percent_to_work!==null&&s.percent_to_work!==void 0&&(c.percent_to_work=s.percent_to_work);const u=[];return s.garaging_address_line_1&&u.push(s.garaging_address_line_1),s.garaging_address_line_2&&u.push(s.garaging_address_line_2),s.garaging_address_city&&u.push(s.garaging_address_city),s.garaging_address_state&&u.push(s.garaging_address_state),s.garaging_address_postal_code&&u.push(s.garaging_address_postal_code),u.length>0&&(c.garaging_address=u.join(", ")),s.new_when_purchased!==null&&s.new_when_purchased!==void 0&&(c.new_when_purchased=R(s.new_when_purchased)),s.purchase_date&&(c.purchase_date=Te(s.purchase_date)),s.anti_theft_type&&(c.anti_theft_type=s.anti_theft_type),s.passive_restraint_type&&(c.passive_restraint_type=s.passive_restraint_type),s.anti_lock_brakes!==null&&s.anti_lock_brakes!==void 0&&(c.anti_lock_brakes=R(s.anti_lock_brakes)),s.daytime_running_lights!==null&&s.daytime_running_lights!==void 0&&(c.daytime_running_lights=R(s.daytime_running_lights)),s.custom_equipment_value_cents!==null&&s.custom_equipment_value_cents!==void 0&&(c.custom_equipment_value_cents=s.custom_equipment_value_cents),s.cost_new_value_cents!==null&&s.cost_new_value_cents!==void 0&&(c.cost_new_value_cents=s.cost_new_value_cents),s.stated_value_amount_cents!==null&&s.stated_value_amount_cents!==void 0&&(c.stated_value_amount_cents=s.stated_value_amount_cents),s.vehicle_has_modifications!==null&&s.vehicle_has_modifications!==void 0&&(c.vehicle_has_modifications=R(s.vehicle_has_modifications)),s.vehicle_garaged_at_residence!==null&&s.vehicle_garaged_at_residence!==void 0&&(c.vehicle_garaged_at_residence=R(s.vehicle_garaged_at_residence)),s.vehicle_comp_deductible&&(c.vehicle_comp_deductible=s.vehicle_comp_deductible),s.vehicle_coll_deductible&&(c.vehicle_coll_deductible=s.vehicle_coll_deductible),s.vehicle_towing_and_labor&&(c.vehicle_towing_and_labor=s.vehicle_towing_and_labor),s.vehicle_transportation_expense&&(c.vehicle_transportation_expense=s.vehicle_transportation_expense),s.vehicle_full_glass!==null&&s.vehicle_full_glass!==void 0&&(c.vehicle_full_glass=R(s.vehicle_full_glass)),s.vehicle_loan_lease!==null&&s.vehicle_loan_lease!==void 0&&(c.vehicle_loan_lease=R(s.vehicle_loan_lease)),s.coverages&&s.coverages.length>0&&(c.coverages__items=s.coverages.map(d=>{const f={};return d.type&&(f.type=d.type),d.per_person_limit_cents!==null&&d.per_person_limit_cents!==void 0&&(f.per_person_limit_cents=d.per_person_limit_cents),d.per_incident_limit_cents!==null&&d.per_incident_limit_cents!==void 0&&(f.per_incident_limit_cents=d.per_incident_limit_cents),d.per_incident_limit_percent!==null&&d.per_incident_limit_percent!==void 0&&(f.per_incident_limit_percent=d.per_incident_limit_percent),d.per_day_limit_cents!==null&&d.per_day_limit_cents!==void 0&&(f.per_day_limit_cents=d.per_day_limit_cents),d.deductible_cents!==null&&d.deductible_cents!==void 0&&(f.deductible_cents=d.deductible_cents),d.is_declined!==null&&d.is_declined!==void 0&&(f.is_declined=R(d.is_declined)),f})),s.vehicle_lienholders&&s.vehicle_lienholders.length>0&&(c.vehicle_lienholders__items=s.vehicle_lienholders.map(d=>{const f={};return d.name&&(f.name=d.name),d.type&&(f.type=d.type),d.line_1&&(f.line_1=d.line_1),d.line_2&&(f.line_2=d.line_2),d.city&&(f.city=d.city),d.state&&(f.state=d.state),d.postal_code&&(f.postal_code=d.postal_code),d.phone&&(f.phone=d.phone),d.fax&&(f.fax=d.fax),f})),c})):r.vehicles="No",t.losses&&t.losses.length>0&&(r.home_losses="Yes",r.home_losses__items=t.losses.map(a=>{const s={};return a.description&&(s.description=a.description),a.date_of_incident&&(s.date_of_incident=Te(a.date_of_incident)),a.amount_paid_cents!==null&&a.amount_paid_cents!==void 0&&(s.amount_paid_cents=Math.round(Number(a.amount_paid_cents)/100)),s})),r}const Cd=new Set(["Product","Driver","Vehicle"]);function Ad(e){return e?Array.isArray(e.drivers__items)?e.drivers__items.length:Array.isArray(e.drivers)?e.drivers.length:null:null}function To(e,t){const r=Ad(t),n=e.filter(i=>i.key!=="AutoPolicy"),o=n.length>0?n:e;return o}function Nr(e){const t={},r=u=>{if(typeof u=="string"){if(u==="Yes")return!0;if(u==="No")return!1}return u},n=Object.keys(e).filter(u=>!u.includes("__items")),o=new Set,i=new Set;for(const[u,d]of Object.entries(e))u.endsWith("__items")&&Array.isArray(d)&&(i.add(u.replace("__items","")),d.forEach(f=>{typeof f=="object"&&f!==null&&Object.keys(f).forEach(m=>{o.add(m)})}));for(const[u,d]of Object.entries(e))if(u.endsWith("__items")){const f=u.replace("__items","");if(n.includes(f)){const g=Array.isArray(d)?d.map(y=>Nr(y)):d;t[f]=g}}else if(!u.includes("__items")){if(i.has(u))continue;o.has(u)||(t[u]=r(d))}const a=t.auto_prior_carrier_name;if(typeof a=="string"&&a.trim()!==""){const u=a==="NoPriorInsurance";t.auto_has_prior_insurance=!u,u&&(delete t.auto_prior_years,delete t.auto_prior_months,delete t.auto_prior_expiration_date,delete t.auto_prior_liability_limit,delete t.auto_continuous_coverage_years,delete t.auto_cancelled_declined_refused_to_renew,delete t.auto_current_annual_premium_cents)}const s=t.home_prior_carrier_name;if(typeof s=="string"&&s.trim()!==""){const u=s==="NoPriorInsurance";t.home_has_prior_insurance=!u,u&&(delete t.home_prior_years,delete t.home_continuous_coverage_years,delete t.home_prior_expiration_date,delete t.property_insurance_cancelled)}Array.isArray(t.drivers)&&(t.drivers=t.drivers.map(u=>{if(!u||typeof u!="object")return u;const d={...u};return d.industry=Pt(d.industry),d.education_level=Kn(d.education_level),d.occupation=Jn(d.occupation),d})),console.log("[DEBUG_TRANSFORM] transformed.drivers type:",typeof t.drivers,"isArray:",Array.isArray(t.drivers),Array.isArray(t.drivers)?`count=${t.drivers.length}`:`value=${JSON.stringify(t.drivers)?.slice(0,100)}`),Array.isArray(t.drivers)&&t.drivers.forEach((u,d)=>{const f=u;console.log(`[DEBUG_TRANSFORM] Driver ${d}:`,{first_name:f.first_name,gender:f.gender,marital_status:f.marital_status,education_level:f.education_level,industry:f.industry,occupation:f.occupation,sr22:f.sr22,keys:Object.keys(f)})});const c=21474836;if("sale_price_cents"in t){const u=t.sale_price_cents;if(typeof u=="number"&&Number.isFinite(u)){const d=Math.trunc(u);if(d>=1){const f=Math.min(d,c);t.sale_price_cents=f*100}}}return Array.isArray(t.home_losses)&&(t.home_losses=t.home_losses.map(u=>{if(!u||typeof u!="object")return u;const d=u,f=d.amount_paid_cents;if(typeof f!="number"||!Number.isFinite(f))return d;const m=Math.trunc(f),g=Math.min(Math.max(m,0),c);return{...d,amount_paid_cents:g*100}})),t}function Ed(e,t){const r=e.findIndex(o=>o.key===t);return r<0?t:e[r+1]?.key??t}function Td(e){return e.some(t=>String(t.key)==="BundlePolicy"||String(t.key)==="BundleCustomer")}function Nd(e,t){if(e!=="AutoCurrentCarrier")return t;const r=t.some(i=>String(i.key)==="auto_cancelled_declined_refused_to_renew"),n=t.some(i=>String(i.key)==="vehicle_policy_selections"),o=[...t];return r||o.push({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}),n||o.push({question:"Vehicle coverage selections",inputType:"custom",key:"vehicle_policy_selections",required:!1}),o}function kd(e,t){if(e!=="Vehicle")return t;const r=n=>n.map(o=>{const i=o.conditionals?.map(a=>{const s=a.conditionalQuestions??[];return s.length?{...a,conditionalQuestions:r(s)}:a});return String(o.key)!=="vin"?i?{...o,conditionals:i}:o:{...o,required:!1,...i?{conditionals:i}:{}}});return r(t)}function Od({isOpen:e,onClose:t}){const[r,n]=b.useState([]),[o,i]=b.useState(null),a=b.useRef(null);b.useEffect(()=>{a.current=o},[o]);const[s,c]=b.useState(null),[u,d]=b.useState(!1),[f,m]=b.useState(null),[g,y]=b.useState(void 0),[h,ie]=b.useState(!1);function te(D){const M={SMSVerification:"Verify",Product:"Product & Address",AutoCurrentCarrier:"Policy",HomeCurrentCarrier:"Current Home Policy",AutoPolicy:"Policy",Vehicle:"Vehicle Details",Driver:"Operator",Customer:"Applicant",HomeConstruction:"Structure",HomeFeatures:"Features",HomePolicy:"Policy",HomeCustomer:"Applicant",BundlePolicy:"Policy",BundleCustomer:"Customer"};let B=D.map(S=>({key:S,title:M[S]||S,loadQuestions:async()=>{const I=await Lu(S,a.current??void 0);let V=Nd(S,I.questions);return V=kd(S,V),V}}));if(D.includes("Vehicle")&&D.includes("Driver")&&D.includes("AutoCurrentCarrier")&&D.includes("Customer")){const S=B.findIndex(I=>I.key==="Product");if(S>=0){const I=B.slice(0,S+1),V=B.slice(S+1),$=re=>V.find(Y=>Y.key===re)??null,G=[$("Vehicle"),$("Driver"),$("AutoCurrentCarrier"),$("Customer")].filter(re=>!!re),U=V.filter(re=>!["Vehicle","Driver","AutoCurrentCarrier","Customer","AutoPolicy"].includes(String(re.key)));B=[...I,...G,...U]}}return B}b.useEffect(()=>{e&&(async()=>{try{const M=Tu();if(vr(),M){ie(!0),i(M);try{const B=Bt(),P=await xu(B?void 0:M);if(!P||!P.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:S}=P,{stages:I}=await br(M),V=te(I);n(V);let $;try{$=wd(S),m($)}catch(U){throw new Error(`Failed to transform quote data: ${U instanceof Error?U.message:"Unknown error"}`)}const G=To(V,$);if(n(G),S.current_stage){const U=S.current_stage==="State"?"Product":S.current_stage,re=G.findIndex(Y=>Y.key===U);re>=0?y(re):y(G.length-1)}else y(G.length-1)}catch(B){B.statusCode===404?(Qn(),i(null)):eo()}finally{ie(!1)}}else{const{stages:B}=await br();n(te(B))}}catch{ie(!1)}})()},[e]),b.useEffect(()=>{if(!e)return;const{overflow:D}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=D}},[e]);const X=b.useCallback(D=>{D.key==="Escape"&&(co(),t())},[t]);if(b.useEffect(()=>{if(e)return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[e,X]),b.useEffect(()=>{e||(m(null),y(void 0),ie(!1),d(!1))},[e]),b.useEffect(()=>{e&&id()},[e]),b.useEffect(()=>{s&&Array.isArray(s)&&cd({rateCount:s.length})},[s]),!e)return null;const ee=()=>{co(),t()};return l.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"insurance-modal-title",children:[l.jsx("div",{className:"backdrop","aria-hidden":"true"}),l.jsxs("div",{className:"modal-panel bg-white relative w-full max-w-2xl flex flex-col max-h-[90vh] overflow-hidden",role:"document",children:[l.jsx("button",{onClick:ee,className:"modal-close-btn absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-xl","aria-label":"Close",type:"button",children:"×"}),l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's get you the best insurance rates."}),u&&l.jsx("p",{className:"p-subtitle",children:"This should only take a few minutes."})]}),l.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[!s&&l.jsx(l.Fragment,{children:h||r.length===0?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx("div",{className:"text-slate-600",children:"Loading..."})}):l.jsx(yd,{stages:r,initialValues:f??void 0,initialActive:g,quoteId:o??void 0,onStageComplete:async(D,M)=>{try{const B=Nr(D);let P=o,S=r;const I=S.findIndex(G=>G.key===M),V=S[I],$=Ed(S,M);if(P)if(M==="SMSVerification"){const{isVerified:G,token:U}=await Pu(P,B.sms_code);if(!G)throw new Error("Invalid SMS code");U&&Iu(U),await ft({current_stage:$},!1)}else if(M==="Product"){const{isSupported:G}=await $u(B.state);if(!G)throw new Error("State is not supported");const U=Bt();await ft({...B,current_stage:$},!1,U?void 0:P)}else{const G=Bt();await ft({...B,current_stage:$},!1,G?void 0:P||void 0)}else{const U=(await Du(B.phone))?.quoteId;if(!U||typeof U!="string"||U.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${U}`);P=U,i(U),Eu(U),await ft({current_stage:$},!1,U)}if(Cd.has(M))try{const{stages:G}=await br(P||void 0);S=te(G),S=To(S,D),n(S)}catch(G){console.warn("Unable to refresh stages after flow-shaping step",G)}return lo({stageKey:M,stageTitle:V?.title??M,stepIndex:I+1,totalSteps:S.length}),{success:!0}}catch(B){return{success:!1,error:B instanceof Error?B.message:"An error occurred"}}},onComplete:async D=>{try{const M=Nr(D);if(!o)throw new Error("Quote ID is required");await ft(M,!0),m(D),d(!0);try{const{rates:S}=await Fu();c(S)}finally{d(!1)}const B=r.length,P=r[B-1];return lo({stageKey:P?.key??"unknown",stageTitle:P?.title??"unknown",stepIndex:B,totalSteps:B}),sd(),{success:!0}}catch{return{success:!1,error:"Oops, something went wrong. Please try again later."}}}})})," ",s&&o&&l.jsx(Sd,{rates:s,onBack:()=>c(null),isBundleFlow:Td(r)})]}),l.jsx("div",{className:"mt-4 pt-4 border-t border-slate-200",children:l.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})})]})]})}function Id({isOpen:e}){return l.jsx(Od,{isOpen:e,onClose:()=>{jt.close()}})}let Be=null,Ke=null,Zt=!1;function Md(){Be||(Be=document.createElement("div"),Be.id="insurance-widget-root",document.documentElement.appendChild(Be)),!Ke&&Be&&(Ke=Io.createRoot(Be))}function kr(){Md(),Ke&&Ke.render(b.createElement(Id,{isOpen:Zt}))}function Ld(){Ke&&Be&&(Ke.unmount(),Be.remove()),Ke=null,Be=null}const jt={init:e=>{Zt=!!e?.autoOpen,kr()},open:()=>{Zt=!0,kr()},close:()=>{Zt=!1,kr()},destroy:Ld};typeof window<"u"&&(window.CredifyInsuranceWidget=jt),Oe.CredifyInsuranceWidget=jt,Oe.default=jt,Object.defineProperties(Oe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
3
41
|
//# sourceMappingURL=index.umd.js.map
|