@getcredify/credify-insurance-widget 1.13.7 → 1.13.13

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/index.umd.js CHANGED
@@ -1,43 +1,43 @@
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;--ease-in-out:cubic-bezier(.4,0,.2,1);--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,.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))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.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}@property --tw-ease{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;--tw-ease:initial}}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- (function(){if(typeof Le>"u")var Le={env:{}}})();(function(Le,p){typeof exports=="object"&&typeof module<"u"?p(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"],p):(Le=typeof globalThis<"u"?globalThis:Le||self,p(Le.CredifyInsuranceWidget={},Le.React,Le.ReactDOM,Le.React))})(this,(function(Le,p,Ho,c){"use strict";function Oe({id:e,label:t,hint:r,error:n,required:o,className:i,children:a}){return c.jsxs("div",{className:i,children:[c.jsxs("label",{htmlFor:e,className:"form-label",children:[t," ",o&&c.jsx("span",{className:"text-red-600",children:"*"})]}),a,r&&!n&&c.jsx("p",{id:`${e}-hint`,className:"mt-1 text-sm text-slate-500",children:r}),n&&c.jsx("p",{id:`${e}-error`,className:"mt-1 text-sm text-red-600",children:n})]})}function Kt({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 $r(e,t){if(!e)return"";const r=parseInt(e,10);if(isNaN(r))return"";const n=r.toLocaleString("en-US");return t?`$${n}`:n}function Uo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a,onChange:s,onKeyDown:l,isCurrency:u=!1,maxDigits:d,...m}){const[b,h]=p.useState(""),S=p.useRef(null);p.useEffect(()=>{if(a==null||a===""){h("");return}const R=String(a).replace(/\D/g,"");h($r(R,u))},[a,u]);const g=R=>{let K=R.target.value.replace(/\D/g,"");d!==void 0&&(K=K.slice(0,d)),h($r(K,u));const V={...R,currentTarget:{...R.currentTarget,value:K},target:{...R.target,value:K}};s?.(V)},Y=R=>{if(["-","+",".","e","E"].includes(R.key)){R.preventDefault();return}if(d!==void 0&&/^\d$/.test(R.key)&&R.currentTarget.value.replace(/\D/g,"").length>=d){R.preventDefault();return}l?.(R)};return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsx("input",{ref:S,id:e,type:"text",inputMode:"numeric",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,value:b,onChange:g,onKeyDown:Y,...m})})}function Br(e){return e.length<=3?e:e.length<=5?`${e.slice(0,3)}-${e.slice(3)}`:`${e.slice(0,3)}-${e.slice(3,5)}-${e.slice(5,9)}`}function Zo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...l}){const[u,d]=p.useState(""),m=p.useRef(null);p.useEffect(()=>{const h=a.replace(/\D/g,"").slice(0,9);d(Br(h))},[a]);const b=h=>{const S=h.target.value,g=h.target.selectionStart??0,Y=S.replace(/\D/g,"").slice(0,9),R=Br(Y);d(R);const K={...h,currentTarget:{...h.currentTarget,value:R},target:{...h.target,value:R}};s?.(K),setTimeout(()=>{if(m.current){const V=S.slice(0,g).replace(/\D/g,"").length;let G=V;V>5?G+=2:V>3&&(G+=1),m.current.setSelectionRange(G,G)}},0)};return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsx("input",{ref:m,id:e,type:"text",inputMode:"numeric",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,maxLength:11,placeholder:"XXX-XX-XXXX",autoComplete:"off",value:u,onChange:b,...l})})}function qt({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Wo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Jt(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 Qt(e){return e.replace(/\D/g,"")}function Go({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...l}){const[u,d]=p.useState(""),m=p.useRef(null),b=p.useRef(0);p.useEffect(()=>{if(!a){d("");return}let S=Qt(a);S.length===11&&S.startsWith("1")&&(S=S.slice(1));const g=S.slice(0,10);d(Jt(g))},[a]);const h=S=>{const g=S.target,Y=g.value;b.current=g.selectionStart||0;const K=Qt(Y).slice(0,10),V=Jt(K);d(V);const G=K.length===10?`+1${K}`:K,L={...S,currentTarget:{...S.currentTarget,value:G},target:{...S.target,value:G}};s?.(L),setTimeout(()=>{if(m.current){const X=Y.slice(0,b.current),H=Qt(X),ae=Jt(H),J=Math.min(ae.length,V.length);m.current.setSelectionRange(J,J)}},0)};return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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:[c.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"}),c.jsx("input",{ref:m,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:h,...l})]})})}function jo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Vo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Yo({id:e,label:t,hint:r,error:n,required:o,className:i,rows:a=4,...s}){return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Ko({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 xr({id:e,label:t,className:r,...n}){return c.jsxs("label",{className:`checkbox-card ${r||""}`,htmlFor:e,children:[c.jsx("input",{id:e,type:"checkbox",className:"checkbox-input",...n}),c.jsx("span",{className:"checkbox-label",children:t})]})}function qo({name:e,value:t,checked:r,onChange:n,children:o}){return c.jsxs("label",{className:"radio-card",children:[c.jsx("input",{className:"radio-input",type:"radio",name:e,value:t,checked:r,onChange:n}),c.jsx("span",{className:"radio-label",children:o})]})}function Jo({legend:e,children:t,className:r,legendClassName:n}){return c.jsxs("fieldset",{className:r,children:[c.jsx("legend",{className:`form-label mb-4 ${n||""}`,children:e}),c.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:l,...u}){const d=[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,m=!!l;return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsxs("select",{id:e,className:`form-input select-caret ${n?"input-error":""}`,"aria-invalid":!!n,"aria-describedby":d,required:o,...u,children:[a&&c.jsx("option",{value:"",disabled:!0,selected:!("value"in u),children:a}),m?l:s?.map(b=>c.jsx("option",{value:b.value,disabled:b.disabled,children:b.label},b.value))]})})}const Qo="AIzaSyDjLdKLxoa-maLNGAyq_I_2r_Fe_TzFikw";function Xo(){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=${Qo}&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 ei(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 ti({id:e,label:t,hint:r,error:n,required:o,className:i,onChange:a,onPlaceSelect:s,value:l,...u}){const d=p.useRef(null),m=p.useRef(null),b=p.useRef(null),h=p.useRef(null),[S,g]=p.useState(!0),[Y,R]=p.useState(l||""),[K,V]=p.useState([]),[G,L]=p.useState(!1),[X,H]=p.useState(-1),ae=p.useRef([]),J=p.useRef(!1),F=p.useRef(-1);p.useEffect(()=>{ae.current=K},[K]),p.useEffect(()=>{J.current=G},[G]),p.useEffect(()=>{F.current=X},[X]),p.useEffect(()=>{l!==void 0&&R(String(l))},[l]);const $=p.useRef(null);p.useEffect(()=>{if(!d.current)return;let z=!0;return Xo().then(()=>{!z||!d.current||(m.current=new google.maps.places.AutocompleteService,b.current=new google.maps.places.PlacesService(document.createElement("div")),g(!1))}).catch(f=>{console.error("Error loading Google Maps:",f),g(!1)}),()=>{z=!1,$.current&&clearTimeout($.current)}},[]);const Q=z=>{const f=z.target.value;if(R(f),a?.(f),$.current&&clearTimeout($.current),f.length<3){V([]),L(!1);return}$.current=setTimeout(()=>{m.current&&m.current.getPlacePredictions({input:f,types:["address"]},(A,M)=>{M===google.maps.places.PlacesServiceStatus.OK&&A?(V(A),L(!0),H(-1)):(V([]),L(!1))})},300)},ie=z=>{if(!J.current||ae.current.length===0){z.key==="Escape"&&(L(!1),J.current=!1);return}switch(z.key){case"ArrowDown":z.preventDefault(),H(f=>{const A=f<ae.current.length-1?f+1:f;return F.current=A,A});break;case"ArrowUp":z.preventDefault(),H(f=>{const A=f>0?f-1:-1;return F.current=A,A});break;case"Enter":z.preventDefault(),F.current>=0&&F.current<ae.current.length&&Z(ae.current[F.current]);break;case"Escape":z.preventDefault(),L(!1),J.current=!1;break}};p.useEffect(()=>{const z=f=>{h.current&&!h.current.contains(f.target)&&d.current&&!d.current.contains(f.target)&&(L(!1),J.current=!1)};if(G)return document.addEventListener("mousedown",z),()=>{document.removeEventListener("mousedown",z)}},[G]);const Z=z=>{b.current&&b.current.getDetails({placeId:z.place_id,fields:["address_components","formatted_address","geometry"]},(f,A)=>{if(A===google.maps.places.PlacesServiceStatus.OK&&f){const M=f.formatted_address||"";R(M),L(!1),V([]),J.current=!1;const k=ei(f);a?.(M,k),s?.(f)}})};return c.jsx(Oe,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsxs("div",{className:"relative",children:[c.jsx("input",{ref:d,id:e,type:"text",className:`form-input ${n?"input-error":""}`,value:Y,onChange:Q,onKeyDown:ie,"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:S||u.disabled,...u}),S&&c.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading address suggestions..."}),G&&K.length>0&&c.jsx("div",{ref:h,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:K.map((z,f)=>c.jsxs("div",{className:`px-4 py-3 cursor-pointer transition-colors ${f===X?"bg-blue-50 text-slate-900":"bg-white text-slate-900 hover:bg-slate-50"} ${f<K.length-1?"border-b border-slate-100":""}`,role:"option","aria-selected":f===X,onClick:()=>Z(z),onMouseEnter:()=>H(f),children:[c.jsx("div",{className:"font-medium text-slate-900",children:z.structured_formatting.main_text}),z.structured_formatting.secondary_text&&c.jsx("div",{className:"text-sm text-slate-500 mt-0.5",children:z.structured_formatting.secondary_text})]},z.place_id))})]})})}function Xt(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,m)=>{const b=d.conditionalQuestions?t(d.conditionalQuestions,[...n,`${s}__c${m}`]):void 0;return{...d,conditionalQuestions:b}});return{...o,key:s,conditionals:u}});return t(e,[])}function y(e,t,r){function n(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);const u=a.prototype,d=Object.keys(u);for(let m=0;m<d.length;m++){const b=d[m];b in s||(s[b]=u[b].bind(s))}}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(s){var l;const u=r?.Parent?new i:this;n(u,s),(l=u._zod).deferred??(l.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 zr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Rr={};function Ge(e){return Rr}function Hr(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 er(e,t){return typeof t=="bigint"?t.toString():t}function tr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function rr(e){return e==null}function nr(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ri(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 l=n.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[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 Ur=Symbol("evaluating");function se(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ur)return n===void 0&&(n=Ur,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function je(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 Zr(e){return JSON.stringify(e)}function ni(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Wr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const oi=tr(()=>{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(bt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(bt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Gr(e){return ct(e)?{...e}:Array.isArray(e)?[...e]:e}const ii=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 D(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 ai(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const si={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 ci(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 je(this,"shape",a),a},checks:[]});return Re(e,i)}function li(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 je(this,"shape",a),a},checks:[]});return Re(e,i)}function ui(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 je(this,"shape",i),i}});return Re(e,o)}function di(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 je(this,"shape",n),n}});return Re(e,r)}function _i(e,t){const r=ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return je(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Re(e,r)}function fi(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,l={...s};if(r)for(const u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(const u in s)l[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return je(this,"shape",l),l},checks:[]});return Re(t,a)}function mi(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 je(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 jr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function vt(e){return typeof e=="string"?e:e?.message}function Ve(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=vt(e.inst?._zod.def?.error?.(e))??vt(t?.error?.(e))??vt(r.customError?.(e))??vt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function or(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 Vr=(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,er,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Yr=y("$ZodError",Vr),Kr=y("$ZodError",Vr,{Parent:Error});function pi(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 hi(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 l=i.path[s];s===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(i))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return n(e),r}const ir=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(l=>Ve(l,i,Ge())));throw Wr(s,o?.callee),s}return a.value},ar=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(l=>Ve(l,i,Ge())));throw Wr(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??Yr)(i.issues.map(a=>Ve(a,o,Ge())))}:{success:!0,data:i.value}},gi=St(Kr),At=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=>Ve(a,o,Ge())))}:{success:!0,data:i.value}},yi=At(Kr),bi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ir(e)(t,r,o)},vi=e=>(t,r,n)=>ir(e)(t,r,n),Si=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ar(e)(t,r,o)},Ai=e=>async(t,r,n)=>ar(e)(t,r,n),Ci=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return St(e)(t,r,o)},wi=e=>(t,r,n)=>St(e)(t,r,n),Ei=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return At(e)(t,r,o)},Ti=e=>async(t,r,n)=>At(e)(t,r,n),Ni=/^[cC][^\s-]{8,}$/,ki=/^[0-9a-z]+$/,Oi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ii=/^[0-9a-vA-V]{20}$/,Mi=/^[A-Za-z0-9]{27}$/,Li=/^[a-zA-Z0-9_-]{21}$/,Di=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Pi=/^([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})$/,qr=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)$/,Fi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$i="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bi(){return new RegExp($i,"u")}const xi=/^(?:(?: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])$/,zi=/^(([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}|:))$/,Ri=/^((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])$/,Hi=/^(([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])$/,Ui=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jr=/^[A-Za-z0-9_-]*$/,Zi=/^\+[1-9]\d{6,14}$/,Qr="(?:(?:\\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])))",Wi=new RegExp(`^${Qr}$`);function Xr(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 Gi(e){return new RegExp(`^${Xr(e)}$`)}function ji(e){const t=Xr({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(`^${Qr}T(?:${n})$`)}const Vi=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Yi=/^-?\d+$/,Ki=/^-?\d+(?:\.\d+)?$/,qi=/^(?:true|false)$/i,Ji=/^[^A-Z]*$/,Qi=/^[^a-z]*$/,Te=y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),en={number:"number",bigint:"bigint",object:"date"},tn=y("$ZodCheckLessThan",(e,t)=>{Te.init(e,t);const r=en[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})}}),rn=y("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);const r=en[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})}}),Xi=y("$ZodCheckMultipleOf",(e,t)=>{Te.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):ri(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})}}),ea=y("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=si[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=Yi)}),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})}}),ta=y("$ZodCheckMaxLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!rr(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=or(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ra=y("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!rr(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=or(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),na=y("$ZodCheckLengthEquals",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!rr(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=or(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=y("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.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=()=>{})}),oa=y("$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})}}),ia=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ji),Ct.init(e,t)}),aa=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Qi),Ct.init(e,t)}),sa=y("$ZodCheckIncludes",(e,t)=>{Te.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})}}),ca=y("$ZodCheckStartsWith",(e,t)=>{Te.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})}}),la=y("$ZodCheckEndsWith",(e,t)=>{Te.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})}}),ua=y("$ZodCheckOverwrite",(e,t)=>{Te.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class da{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(`
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-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--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;--ease-in-out:cubic-bezier(.4,0,.2,1);--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-5{margin-top:calc(var(--spacing)*5)}.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-200{border-color:var(--color-red-200)}.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-red-50{background-color:var(--color-red-50)}.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-5{padding:calc(var(--spacing)*5)}.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-red-700{color:var(--color-red-700)}.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,.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))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.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-blue-700:hover{background-color:var(--color-blue-700)}.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}@property --tw-ease{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;--tw-ease:initial}}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ (function(){if(typeof De>"u")var De={env:{}}})();(function(De,m){typeof exports=="object"&&typeof module<"u"?m(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"],m):(De=typeof globalThis<"u"?globalThis:De||self,m(De.CredifyInsuranceWidget={},De.React,De.ReactDOM,De.React))})(this,(function(De,m,Uo,c){"use strict";function Me({id:e,label:t,hint:r,error:n,required:o,className:i,children:a}){return c.jsxs("div",{className:i,children:[c.jsxs("label",{htmlFor:e,className:"form-label",children:[t," ",o&&c.jsx("span",{className:"text-red-600",children:"*"})]}),a,r&&!n&&c.jsx("p",{id:`${e}-hint`,className:"mt-1 text-sm text-slate-500",children:r}),n&&c.jsx("p",{id:`${e}-error`,className:"mt-1 text-sm text-red-600",children:n})]})}function Xt({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 $r(e,t){if(!e)return"";const r=parseInt(e,10);if(isNaN(r))return"";const n=r.toLocaleString("en-US");return t?`$${n}`:n}function Zo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a,onChange:s,onKeyDown:l,isCurrency:u=!1,maxDigits:d,...p}){const[v,y]=m.useState(""),S=m.useRef(null);m.useEffect(()=>{if(a==null||a===""){y("");return}const x=String(a).replace(/\D/g,"");y($r(x,u))},[a,u]);const g=x=>{let j=x.target.value.replace(/\D/g,"");d!==void 0&&(j=j.slice(0,d)),y($r(j,u));const Z={...x,currentTarget:{...x.currentTarget,value:j},target:{...x.target,value:j}};s?.(Z)},U=x=>{if(["-","+",".","e","E"].includes(x.key)){x.preventDefault();return}if(d!==void 0&&/^\d$/.test(x.key)&&x.currentTarget.value.replace(/\D/g,"").length>=d){x.preventDefault();return}l?.(x)};return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsx("input",{ref:S,id:e,type:"text",inputMode:"numeric",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,value:v,onChange:g,onKeyDown:U,...p})})}function Br(e){return e.length<=3?e:e.length<=5?`${e.slice(0,3)}-${e.slice(3)}`:`${e.slice(0,3)}-${e.slice(3,5)}-${e.slice(5,9)}`}function Wo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...l}){const[u,d]=m.useState(""),p=m.useRef(null);m.useEffect(()=>{const y=a.replace(/\D/g,"").slice(0,9);d(Br(y))},[a]);const v=y=>{const S=y.target.value,g=y.target.selectionStart??0,U=S.replace(/\D/g,"").slice(0,9),x=Br(U);d(x);const j={...y,currentTarget:{...y.currentTarget,value:x},target:{...y.target,value:x}};s?.(j),setTimeout(()=>{if(p.current){const Z=S.slice(0,g).replace(/\D/g,"").length;let H=Z;Z>5?H+=2:Z>3&&(H+=1),p.current.setSelectionRange(H,H)}},0)};return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsx("input",{ref:p,id:e,type:"text",inputMode:"numeric",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,maxLength:11,placeholder:"XXX-XX-XXXX",autoComplete:"off",value:u,onChange:v,...l})})}function er({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Go({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 tr(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 rr(e){return e.replace(/\D/g,"")}function jo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...l}){const[u,d]=m.useState(""),p=m.useRef(null),v=m.useRef(0);m.useEffect(()=>{if(!a){d("");return}let S=rr(a);S.length===11&&S.startsWith("1")&&(S=S.slice(1));const g=S.slice(0,10);d(tr(g))},[a]);const y=S=>{const g=S.target,U=g.value;v.current=g.selectionStart||0;const j=rr(U).slice(0,10),Z=tr(j);d(Z);const H=j.length===10?`+1${j}`:j,P={...S,currentTarget:{...S.currentTarget,value:H},target:{...S.target,value:H}};s?.(P),setTimeout(()=>{if(p.current){const K=U.slice(0,v.current),z=rr(K),ne=tr(z),V=Math.min(ne.length,Z.length);p.current.setSelectionRange(V,V)}},0)};return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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:[c.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"}),c.jsx("input",{ref:p,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:y,...l})]})})}function Vo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Yo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 Ko({id:e,label:t,hint:r,error:n,required:o,className:i,rows:a=4,...s}){return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 qo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.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 xr({id:e,label:t,className:r,...n}){return c.jsxs("label",{className:`checkbox-card ${r||""}`,htmlFor:e,children:[c.jsx("input",{id:e,type:"checkbox",className:"checkbox-input",...n}),c.jsx("span",{className:"checkbox-label",children:t})]})}function Jo({name:e,value:t,checked:r,onChange:n,children:o}){return c.jsxs("label",{className:"radio-card",children:[c.jsx("input",{className:"radio-input",type:"radio",name:e,value:t,checked:r,onChange:n}),c.jsx("span",{className:"radio-label",children:o})]})}function Qo({legend:e,children:t,className:r,legendClassName:n}){return c.jsxs("fieldset",{className:r,children:[c.jsx("legend",{className:`form-label mb-4 ${n||""}`,children:e}),c.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:t})]})}function dt({id:e,label:t,hint:r,error:n,required:o,className:i,placeholder:a,options:s,children:l,...u}){const d=[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,p=!!l;return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsxs("select",{id:e,className:`form-input select-caret ${n?"input-error":""}`,"aria-invalid":!!n,"aria-describedby":d,required:o,...u,children:[a&&c.jsx("option",{value:"",disabled:!0,selected:!("value"in u),children:a}),p?l:s?.map(v=>c.jsx("option",{value:v.value,disabled:v.disabled,children:v.label},v.value))]})})}const Xo="AIzaSyDjLdKLxoa-maLNGAyq_I_2r_Fe_TzFikw";function ei(){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=${Xo}&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 ti(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 ri({id:e,label:t,hint:r,error:n,required:o,className:i,onChange:a,onPlaceSelect:s,value:l,...u}){const d=m.useRef(null),p=m.useRef(null),v=m.useRef(null),y=m.useRef(null),[S,g]=m.useState(!0),[U,x]=m.useState(l||""),[j,Z]=m.useState([]),[H,P]=m.useState(!1),[K,z]=m.useState(-1),ne=m.useRef([]),V=m.useRef(!1),te=m.useRef(-1);m.useEffect(()=>{ne.current=j},[j]),m.useEffect(()=>{V.current=H},[H]),m.useEffect(()=>{te.current=K},[K]),m.useEffect(()=>{l!==void 0&&x(String(l))},[l]);const ie=m.useRef(null);m.useEffect(()=>{if(!d.current)return;let L=!0;return ei().then(()=>{!L||!d.current||(p.current=new google.maps.places.AutocompleteService,v.current=new google.maps.places.PlacesService(document.createElement("div")),g(!1))}).catch(f=>{console.error("Error loading Google Maps:",f),g(!1)}),()=>{L=!1,ie.current&&clearTimeout(ie.current)}},[]);const Ee=L=>{const f=L.target.value;if(x(f),a?.(f),ie.current&&clearTimeout(ie.current),f.length<3){Z([]),P(!1);return}ie.current=setTimeout(()=>{p.current&&p.current.getPlacePredictions({input:f,types:["address"]},(A,I)=>{I===google.maps.places.PlacesServiceStatus.OK&&A?(Z(A),P(!0),z(-1)):(Z([]),P(!1))})},300)},Ie=L=>{if(!V.current||ne.current.length===0){L.key==="Escape"&&(P(!1),V.current=!1);return}switch(L.key){case"ArrowDown":L.preventDefault(),z(f=>{const A=f<ne.current.length-1?f+1:f;return te.current=A,A});break;case"ArrowUp":L.preventDefault(),z(f=>{const A=f>0?f-1:-1;return te.current=A,A});break;case"Enter":L.preventDefault(),te.current>=0&&te.current<ne.current.length&&q(ne.current[te.current]);break;case"Escape":L.preventDefault(),P(!1),V.current=!1;break}};m.useEffect(()=>{const L=f=>{y.current&&!y.current.contains(f.target)&&d.current&&!d.current.contains(f.target)&&(P(!1),V.current=!1)};if(H)return document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)}},[H]);const q=L=>{v.current&&v.current.getDetails({placeId:L.place_id,fields:["address_components","formatted_address","geometry"]},(f,A)=>{if(A===google.maps.places.PlacesServiceStatus.OK&&f){const I=f.formatted_address||"";x(I),P(!1),Z([]),V.current=!1;const k=ti(f);a?.(I,k),s?.(f)}})};return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsxs("div",{className:"relative",children:[c.jsx("input",{ref:d,id:e,type:"text",className:`form-input ${n?"input-error":""}`,value:U,onChange:Ee,onKeyDown:Ie,"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:S||u.disabled,...u}),S&&c.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading address suggestions..."}),H&&j.length>0&&c.jsx("div",{ref:y,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:j.map((L,f)=>c.jsxs("div",{className:`px-4 py-3 cursor-pointer transition-colors ${f===K?"bg-blue-50 text-slate-900":"bg-white text-slate-900 hover:bg-slate-50"} ${f<j.length-1?"border-b border-slate-100":""}`,role:"option","aria-selected":f===K,onClick:()=>q(L),onMouseEnter:()=>z(f),children:[c.jsx("div",{className:"font-medium text-slate-900",children:L.structured_formatting.main_text}),L.structured_formatting.secondary_text&&c.jsx("div",{className:"text-sm text-slate-500 mt-0.5",children:L.structured_formatting.secondary_text})]},L.place_id))})]})})}function nr(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,p)=>{const v=d.conditionalQuestions?t(d.conditionalQuestions,[...n,`${s}__c${p}`]):void 0;return{...d,conditionalQuestions:v}});return{...o,key:s,conditionals:u}});return t(e,[])}function b(e,t,r){function n(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);const u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){const v=d[p];v in s||(s[v]=u[v].bind(s))}}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(s){var l;const u=r?.Parent?new i:this;n(u,s),(l=u._zod).deferred??(l.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 et extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class zr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Rr={};function Ve(e){return Rr}function Hr(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 or(e,t){return typeof t=="bigint"?t.toString():t}function ir(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ar(e){return e==null}function sr(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ni(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 l=n.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[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 Ur=Symbol("evaluating");function se(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ur)return n===void 0&&(n=Ur,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function He(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Zr(e){return JSON.stringify(e)}function oi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Wr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function At(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ii=ir(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function _t(e){if(At(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(At(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Gr(e){return _t(e)?{...e}:Array.isArray(e)?[...e]:e}const ai=new Set(["string","number","symbol"]);function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ue(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function F(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 si(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const ci={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 li(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=He(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 Ye(this,"shape",a),a},checks:[]});return Ue(e,i)}function ui(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=He(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 Ye(this,"shape",a),a},checks:[]});return Ue(e,i)}function di(e,t){if(!_t(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=He(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Ye(this,"shape",i),i}});return Ue(e,o)}function _i(e,t){if(!_t(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=He(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ye(this,"shape",n),n}});return Ue(e,r)}function fi(e,t){const r=He(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ye(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ue(e,r)}function mi(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=He(t._zod.def,{get shape(){const s=t._zod.def.shape,l={...s};if(r)for(const u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(const u in s)l[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Ye(this,"shape",l),l},checks:[]});return Ue(t,a)}function pi(e,t,r){const n=He(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 Ye(this,"shape",i),i}});return Ue(t,n)}function rt(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 jr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ct(e){return typeof e=="string"?e:e?.message}function Ke(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=Ct(e.inst?._zod.def?.error?.(e))??Ct(t?.error?.(e))??Ct(r.customError?.(e))??Ct(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function cr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ft(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Vr=(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,or,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Yr=b("$ZodError",Vr),Kr=b("$ZodError",Vr,{Parent:Error});function hi(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 gi(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 l=i.path[s];s===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(i))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return n(e),r}const lr=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 et;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>Ke(l,i,Ve())));throw Wr(s,o?.callee),s}return a.value},ur=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(l=>Ke(l,i,Ve())));throw Wr(s,o?.callee),s}return a.value},wt=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 et;return i.issues.length?{success:!1,error:new(e??Yr)(i.issues.map(a=>Ke(a,o,Ve())))}:{success:!0,data:i.value}},yi=wt(Kr),Et=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=>Ke(a,o,Ve())))}:{success:!0,data:i.value}},bi=Et(Kr),vi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return lr(e)(t,r,o)},Si=e=>(t,r,n)=>lr(e)(t,r,n),Ai=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ur(e)(t,r,o)},Ci=e=>async(t,r,n)=>ur(e)(t,r,n),wi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return wt(e)(t,r,o)},Ei=e=>(t,r,n)=>wt(e)(t,r,n),Ti=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Et(e)(t,r,o)},Ni=e=>async(t,r,n)=>Et(e)(t,r,n),ki=/^[cC][^\s-]{8,}$/,Oi=/^[0-9a-z]+$/,Ii=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mi=/^[0-9a-vA-V]{20}$/,Li=/^[A-Za-z0-9]{27}$/,Di=/^[a-zA-Z0-9_-]{21}$/,Pi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fi=/^([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})$/,qr=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)$/,$i=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Bi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xi(){return new RegExp(Bi,"u")}const zi=/^(?:(?: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])$/,Ri=/^(([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}|:))$/,Hi=/^((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])$/,Ui=/^(([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])$/,Zi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jr=/^[A-Za-z0-9_-]*$/,Wi=/^\+[1-9]\d{6,14}$/,Qr="(?:(?:\\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])))",Gi=new RegExp(`^${Qr}$`);function Xr(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 ji(e){return new RegExp(`^${Xr(e)}$`)}function Vi(e){const t=Xr({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(`^${Qr}T(?:${n})$`)}const Yi=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ki=/^-?\d+$/,qi=/^-?\d+(?:\.\d+)?$/,Ji=/^(?:true|false)$/i,Qi=/^[^A-Z]*$/,Xi=/^[^a-z]*$/,Ne=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),en={number:"number",bigint:"bigint",object:"date"},tn=b("$ZodCheckLessThan",(e,t)=>{Ne.init(e,t);const r=en[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})}}),rn=b("$ZodCheckGreaterThan",(e,t)=>{Ne.init(e,t);const r=en[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})}}),ea=b("$ZodCheckMultipleOf",(e,t)=>{Ne.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):ni(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})}}),ta=b("$ZodCheckNumberFormat",(e,t)=>{Ne.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=ci[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=Ki)}),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})}}),ra=b("$ZodCheckMaxLength",(e,t)=>{var r;Ne.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ar(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=cr(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),na=b("$ZodCheckMinLength",(e,t)=>{var r;Ne.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ar(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=cr(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),oa=b("$ZodCheckLengthEquals",(e,t)=>{var r;Ne.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ar(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=cr(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})}}),Tt=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ne.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=()=>{})}),ia=b("$ZodCheckRegex",(e,t)=>{Tt.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})}}),aa=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qi),Tt.init(e,t)}),sa=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Xi),Tt.init(e,t)}),ca=b("$ZodCheckIncludes",(e,t)=>{Ne.init(e,t);const r=tt(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})}}),la=b("$ZodCheckStartsWith",(e,t)=>{Ne.init(e,t);const r=new RegExp(`^${tt(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})}}),ua=b("$ZodCheckEndsWith",(e,t)=>{Ne.init(e,t);const r=new RegExp(`.*${tt(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})}}),da=b("$ZodCheckOverwrite",(e,t)=>{Ne.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class _a{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
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 _a={major:4,minor:3,patch:6},me=y("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_a;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,l)=>{let u=et(a),d;for(const m of s){if(m._zod.def.when){if(!m._zod.def.when(a))continue}else if(u)continue;const b=a.issues.length,h=m._zod.check(a);if(h instanceof Promise&&l?.async===!1)throw new Qe;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,a.issues.length!==b&&(u||(u=et(a,b)))});else{if(a.issues.length===b)continue;u||(u=et(a,b))}}return d?d.then(()=>a):a},i=(a,s,l)=>{if(et(a))return a.aborted=!0,a;const u=o(s,n,l);if(u instanceof Promise){if(l.async===!1)throw new Qe;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};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 l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Qe;return l.then(u=>o(u,n,s))}return o(l,n,s)}}se(e,"~standard",()=>({validate:o=>{try{const i=gi(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return yi(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),sr=y("$ZodString",(e,t)=>{me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Vi(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}}),_e=y("$ZodStringFormat",(e,t)=>{Ct.init(e,t),sr.init(e,t)}),fa=y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Pi),_e.init(e,t)}),ma=y("$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=qr(n))}else t.pattern??(t.pattern=qr());_e.init(e,t)}),pa=y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fi),_e.init(e,t)}),ha=y("$ZodURL",(e,t)=>{_e.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})}}}),ga=y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Bi()),_e.init(e,t)}),ya=y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Li),_e.init(e,t)}),ba=y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ni),_e.init(e,t)}),va=y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ki),_e.init(e,t)}),Sa=y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Oi),_e.init(e,t)}),Aa=y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ii),_e.init(e,t)}),Ca=y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Mi),_e.init(e,t)}),wa=y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ji(t)),_e.init(e,t)}),Ea=y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Wi),_e.init(e,t)}),Ta=y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Gi(t)),_e.init(e,t)}),Na=y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Di),_e.init(e,t)}),ka=y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=xi),_e.init(e,t),e._zod.bag.format="ipv4"}),Oa=y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zi),_e.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})}}}),Ia=y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ri),_e.init(e,t)}),Ma=y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Hi),_e.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 nn(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const La=y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ui),_e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{nn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Da(e){if(!Jr.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return nn(r)}const Pa=y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Jr),_e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Da(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Fa=y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zi),_e.init(e,t)});function $a(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 Ba=y("$ZodJWT",(e,t)=>{_e.init(e,t),e._zod.check=r=>{$a(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),on=y("$ZodNumber",(e,t)=>{me.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ki,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}}),xa=y("$ZodNumberFormat",(e,t)=>{ea.init(e,t),on.init(e,t)}),za=y("$ZodBoolean",(e,t)=>{me.init(e,t),e._zod.pattern=qi,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}}),Ra=y("$ZodUnknown",(e,t)=>{me.init(e,t),e._zod.parse=r=>r}),Ha=y("$ZodNever",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function an(e,t,r){e.issues.length&&t.issues.push(...jr(r,e.issues)),t.value[r]=e.value}const Ua=y("$ZodArray",(e,t)=>{me.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],l=t.element._zod.run({value:s,issues:[]},n);l instanceof Promise?i.push(l.then(u=>an(u,r,a))):an(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function wt(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...jr(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function sn(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=ai(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function cn(e,t,r,n,o,i){const a=[],s=o.keySet,l=o.catchall._zod,u=l.def.type,d=l.optout==="optional";for(const m in t){if(s.has(m))continue;if(u==="never"){a.push(m);continue}const b=l.run({value:t[m],issues:[]},n);b instanceof Promise?e.push(b.then(h=>wt(h,r,m,t,d))):wt(b,r,m,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 Za=y("$ZodObject",(e,t)=>{if(me.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=tr(()=>sn(t));se(e._zod,"propValues",()=>{const s=t.shape,l={};for(const u in s){const d=s[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(const m of d.values)l[u].add(m)}}return l});const o=bt,i=t.catchall;let a;e._zod.parse=(s,l)=>{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=[],m=a.shape;for(const b of a.keys){const h=m[b],S=h._zod.optout==="optional",g=h._zod.run({value:u[b],issues:[]},l);g instanceof Promise?d.push(g.then(Y=>wt(Y,s,b,u,S))):wt(g,s,b,u,S)}return i?cn(d,u,s,l,n.value,e):d.length?Promise.all(d).then(()=>s):s}}),Wa=y("$ZodObjectJIT",(e,t)=>{Za.init(e,t);const r=e._zod.parse,n=tr(()=>sn(t)),o=b=>{const h=new da(["shape","payload","ctx"]),S=n.value,g=V=>{const G=Zr(V);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};h.write("const input = payload.value;");const Y=Object.create(null);let R=0;for(const V of S.keys)Y[V]=`key_${R++}`;h.write("const newResult = {};");for(const V of S.keys){const G=Y[V],L=Zr(V),H=b[V]?._zod?.optout==="optional";h.write(`const ${G} = ${g(V)};`),H?h.write(`
5
- if (${G}.issues.length) {
6
- if (${L} in input) {
7
- payload.issues = payload.issues.concat(${G}.issues.map(iss => ({
4
+ `))}}const fa={major:4,minor:3,patch:6},pe=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fa;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,l)=>{let u=rt(a),d;for(const p of s){if(p._zod.def.when){if(!p._zod.def.when(a))continue}else if(u)continue;const v=a.issues.length,y=p._zod.check(a);if(y instanceof Promise&&l?.async===!1)throw new et;if(d||y instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await y,a.issues.length!==v&&(u||(u=rt(a,v)))});else{if(a.issues.length===v)continue;u||(u=rt(a,v))}}return d?d.then(()=>a):a},i=(a,s,l)=>{if(rt(a))return a.aborted=!0,a;const u=o(s,n,l);if(u instanceof Promise){if(l.async===!1)throw new et;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};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 l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new et;return l.then(u=>o(u,n,s))}return o(l,n,s)}}se(e,"~standard",()=>({validate:o=>{try{const i=yi(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return bi(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),dr=b("$ZodString",(e,t)=>{pe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Yi(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}}),_e=b("$ZodStringFormat",(e,t)=>{Tt.init(e,t),dr.init(e,t)}),ma=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Fi),_e.init(e,t)}),pa=b("$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=qr(n))}else t.pattern??(t.pattern=qr());_e.init(e,t)}),ha=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=$i),_e.init(e,t)}),ga=b("$ZodURL",(e,t)=>{_e.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})}}}),ya=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xi()),_e.init(e,t)}),ba=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Di),_e.init(e,t)}),va=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ki),_e.init(e,t)}),Sa=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Oi),_e.init(e,t)}),Aa=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ii),_e.init(e,t)}),Ca=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mi),_e.init(e,t)}),wa=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Li),_e.init(e,t)}),Ea=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Vi(t)),_e.init(e,t)}),Ta=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Gi),_e.init(e,t)}),Na=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ji(t)),_e.init(e,t)}),ka=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Pi),_e.init(e,t)}),Oa=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=zi),_e.init(e,t),e._zod.bag.format="ipv4"}),Ia=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ri),_e.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})}}}),Ma=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Hi),_e.init(e,t)}),La=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ui),_e.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 nn(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Da=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Zi),_e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{nn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Pa(e){if(!Jr.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return nn(r)}const Fa=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Jr),_e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Pa(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),$a=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wi),_e.init(e,t)});function Ba(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 xa=b("$ZodJWT",(e,t)=>{_e.init(e,t),e._zod.check=r=>{Ba(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),on=b("$ZodNumber",(e,t)=>{pe.init(e,t),e._zod.pattern=e._zod.bag.pattern??qi,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}}),za=b("$ZodNumberFormat",(e,t)=>{ta.init(e,t),on.init(e,t)}),Ra=b("$ZodBoolean",(e,t)=>{pe.init(e,t),e._zod.pattern=Ji,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}}),Ha=b("$ZodUnknown",(e,t)=>{pe.init(e,t),e._zod.parse=r=>r}),Ua=b("$ZodNever",(e,t)=>{pe.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function an(e,t,r){e.issues.length&&t.issues.push(...jr(r,e.issues)),t.value[r]=e.value}const Za=b("$ZodArray",(e,t)=>{pe.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],l=t.element._zod.run({value:s,issues:[]},n);l instanceof Promise?i.push(l.then(u=>an(u,r,a))):an(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Nt(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...jr(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function sn(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=si(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function cn(e,t,r,n,o,i){const a=[],s=o.keySet,l=o.catchall._zod,u=l.def.type,d=l.optout==="optional";for(const p in t){if(s.has(p))continue;if(u==="never"){a.push(p);continue}const v=l.run({value:t[p],issues:[]},n);v instanceof Promise?e.push(v.then(y=>Nt(y,r,p,t,d))):Nt(v,r,p,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 Wa=b("$ZodObject",(e,t)=>{if(pe.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=ir(()=>sn(t));se(e._zod,"propValues",()=>{const s=t.shape,l={};for(const u in s){const d=s[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(const p of d.values)l[u].add(p)}}return l});const o=At,i=t.catchall;let a;e._zod.parse=(s,l)=>{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=[],p=a.shape;for(const v of a.keys){const y=p[v],S=y._zod.optout==="optional",g=y._zod.run({value:u[v],issues:[]},l);g instanceof Promise?d.push(g.then(U=>Nt(U,s,v,u,S))):Nt(g,s,v,u,S)}return i?cn(d,u,s,l,n.value,e):d.length?Promise.all(d).then(()=>s):s}}),Ga=b("$ZodObjectJIT",(e,t)=>{Wa.init(e,t);const r=e._zod.parse,n=ir(()=>sn(t)),o=v=>{const y=new _a(["shape","payload","ctx"]),S=n.value,g=Z=>{const H=Zr(Z);return`shape[${H}]._zod.run({ value: input[${H}], issues: [] }, ctx)`};y.write("const input = payload.value;");const U=Object.create(null);let x=0;for(const Z of S.keys)U[Z]=`key_${x++}`;y.write("const newResult = {};");for(const Z of S.keys){const H=U[Z],P=Zr(Z),z=v[Z]?._zod?.optout==="optional";y.write(`const ${H} = ${g(Z)};`),z?y.write(`
5
+ if (${H}.issues.length) {
6
+ if (${P} in input) {
7
+ payload.issues = payload.issues.concat(${H}.issues.map(iss => ({
8
8
  ...iss,
9
- path: iss.path ? [${L}, ...iss.path] : [${L}]
9
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
10
10
  })));
11
11
  }
12
12
  }
13
13
 
14
- if (${G}.value === undefined) {
15
- if (${L} in input) {
16
- newResult[${L}] = undefined;
14
+ if (${H}.value === undefined) {
15
+ if (${P} in input) {
16
+ newResult[${P}] = undefined;
17
17
  }
18
18
  } else {
19
- newResult[${L}] = ${G}.value;
19
+ newResult[${P}] = ${H}.value;
20
20
  }
21
21
 
22
- `):h.write(`
23
- if (${G}.issues.length) {
24
- payload.issues = payload.issues.concat(${G}.issues.map(iss => ({
22
+ `):y.write(`
23
+ if (${H}.issues.length) {
24
+ payload.issues = payload.issues.concat(${H}.issues.map(iss => ({
25
25
  ...iss,
26
- path: iss.path ? [${L}, ...iss.path] : [${L}]
26
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
27
27
  })));
28
28
  }
29
29
 
30
- if (${G}.value === undefined) {
31
- if (${L} in input) {
32
- newResult[${L}] = undefined;
30
+ if (${H}.value === undefined) {
31
+ if (${P} in input) {
32
+ newResult[${P}] = undefined;
33
33
  }
34
34
  } else {
35
- newResult[${L}] = ${G}.value;
35
+ newResult[${P}] = ${H}.value;
36
36
  }
37
37
 
38
- `)}h.write("payload.value = newResult;"),h.write("return payload;");const K=h.compile();return(V,G)=>K(b,V,G)};let i;const a=bt,s=!Rr.jitless,u=s&&oi.value,d=t.catchall;let m;e._zod.parse=(b,h)=>{m??(m=n.value);const S=b.value;return a(S)?s&&u&&h?.async===!1&&h.jitless!==!0?(i||(i=o(t.shape)),b=i(b,h),d?cn([],S,b,h,m,e):b):r(b,h):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function ln(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=>Ve(a,n,Ge())))}),t)}const Ga=y("$ZodUnion",(e,t)=>{me.init(e,t),se(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),se(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),se(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),se(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=>nr(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 l of t.options){const u=l._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(l=>ln(l,o,e,i)):ln(s,o,e,i)}}),ja=y("$ZodIntersection",(e,t)=>{me.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(([l,u])=>un(r,l,u)):un(r,i,a)}});function cr(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=cr(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=cr(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 un(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 l of s.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const l of s.keys)n.has(l)||n.set(l,{}),n.get(l).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=cr(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 Va=y("$ZodEnum",(e,t)=>{me.init(e,t);const r=Hr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>ii.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}}),Ya=y("$ZodLiteral",(e,t)=>{if(me.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}}),Ka=y("$ZodTransform",(e,t)=>{me.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zr(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 dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const _n=y("$ZodOptional",(e,t)=>{me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),se(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${nr(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=>dn(i,r.value)):dn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),qa=y("$ZodExactOptional",(e,t)=>{_n.init(e,t),se(e._zod,"values",()=>t.innerType._zod.values),se(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Ja=y("$ZodNullable",(e,t)=>{me.init(e,t),se(e._zod,"optin",()=>t.innerType._zod.optin),se(e._zod,"optout",()=>t.innerType._zod.optout),se(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${nr(r.source)}|null)$`):void 0}),se(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)}),Qa=y("$ZodDefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",se(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=>fn(i,t)):fn(o,t)}});function fn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Xa=y("$ZodPrefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",se(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))}),es=y("$ZodNonOptional",(e,t)=>{me.init(e,t),se(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=>mn(i,e)):mn(o,e)}});function mn(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 ts=y("$ZodCatch",(e,t)=>{me.init(e,t),se(e._zod,"optin",()=>t.innerType._zod.optin),se(e._zod,"optout",()=>t.innerType._zod.optout),se(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=>Ve(a,n,Ge()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Ve(i,n,Ge()))},input:r.value}),r.issues=[]),r)}}),rs=y("$ZodPipe",(e,t)=>{me.init(e,t),se(e._zod,"values",()=>t.in._zod.values),se(e._zod,"optin",()=>t.in._zod.optin),se(e._zod,"optout",()=>t.out._zod.optout),se(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 ns=y("$ZodReadonly",(e,t)=>{me.init(e,t),se(e._zod,"propValues",()=>t.innerType._zod.propValues),se(e._zod,"values",()=>t.innerType._zod.values),se(e._zod,"optin",()=>t.innerType?._zod?.optin),se(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(pn):pn(o)}});function pn(e){return e.value=Object.freeze(e.value),e}const os=y("$ZodCustom",(e,t)=>{Te.init(e,t),me.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=>hn(i,r,n,e));hn(o,r,n,e)}});function hn(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 gn;class is{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 as(){return new is}(gn=globalThis).__zod_globalRegistry??(gn.__zod_globalRegistry=as());const ut=globalThis.__zod_globalRegistry;function ss(e,t){return new e({type:"string",...D(t)})}function cs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D(t)})}function yn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D(t)})}function ls(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D(t)})}function us(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D(t)})}function ds(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D(t)})}function fs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D(t)})}function ms(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D(t)})}function ps(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D(t)})}function hs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D(t)})}function gs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D(t)})}function ys(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D(t)})}function bs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D(t)})}function vs(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D(t)})}function Ss(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D(t)})}function As(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D(t)})}function Cs(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D(t)})}function ws(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D(t)})}function Es(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D(t)})}function Ts(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D(t)})}function Ns(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D(t)})}function ks(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D(t)})}function Os(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D(t)})}function Is(e,t){return new e({type:"string",format:"date",check:"string_format",...D(t)})}function Ms(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D(t)})}function Ls(e,t){return new e({type:"string",format:"duration",check:"string_format",...D(t)})}function Ds(e,t){return new e({type:"number",coerce:!0,checks:[],...D(t)})}function Ps(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...D(t)})}function Fs(e,t){return new e({type:"boolean",...D(t)})}function $s(e){return new e({type:"unknown"})}function Bs(e,t){return new e({type:"never",...D(t)})}function bn(e,t){return new tn({check:"less_than",...D(t),value:e,inclusive:!1})}function lr(e,t){return new tn({check:"less_than",...D(t),value:e,inclusive:!0})}function vn(e,t){return new rn({check:"greater_than",...D(t),value:e,inclusive:!1})}function ur(e,t){return new rn({check:"greater_than",...D(t),value:e,inclusive:!0})}function Sn(e,t){return new Xi({check:"multiple_of",...D(t),value:e})}function An(e,t){return new ta({check:"max_length",...D(t),maximum:e})}function Tt(e,t){return new ra({check:"min_length",...D(t),minimum:e})}function Cn(e,t){return new na({check:"length_equals",...D(t),length:e})}function xs(e,t){return new oa({check:"string_format",format:"regex",...D(t),pattern:e})}function zs(e){return new ia({check:"string_format",format:"lowercase",...D(e)})}function Rs(e){return new aa({check:"string_format",format:"uppercase",...D(e)})}function Hs(e,t){return new sa({check:"string_format",format:"includes",...D(t),includes:e})}function Us(e,t){return new ca({check:"string_format",format:"starts_with",...D(t),prefix:e})}function Zs(e,t){return new la({check:"string_format",format:"ends_with",...D(t),suffix:e})}function tt(e){return new ua({check:"overwrite",tx:e})}function Ws(e){return tt(t=>t.normalize(e))}function Gs(){return tt(e=>e.trim())}function js(){return tt(e=>e.toLowerCase())}function Vs(){return tt(e=>e.toUpperCase())}function Ys(){return tt(e=>ni(e))}function Ks(e,t,r){return new e({type:"array",element:t,...D(r)})}function qs(e,t,r){return new e({type:"custom",check:"custom",fn:t,...D(r)})}function Js(e){const t=Qs(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 Qs(e,t){const r=new Te({check:"custom",...D(t)});return r._zod.check=e,r}function wn(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 Se(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 b=a.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,b,d)}const m=e._zod.parent;m&&(a.ref||(a.ref=m),Se(m,t,d),t.seen.get(m).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Ee(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 En(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 l=n.get(s);if(l&&l!==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 m=e.external.registry.get(a[0])?.id,b=e.external.uri??(S=>S);if(m)return{ref:b(m)};const h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${b("__shared")}#/${s}/${h}`}}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:l,defId:u}=o(a);s.def={...s.schema},u&&(s.defId=u);const d=s.schema;for(const m in d)delete d[m];d.$ref=l};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>
38
+ `)}y.write("payload.value = newResult;"),y.write("return payload;");const j=y.compile();return(Z,H)=>j(v,Z,H)};let i;const a=At,s=!Rr.jitless,u=s&&ii.value,d=t.catchall;let p;e._zod.parse=(v,y)=>{p??(p=n.value);const S=v.value;return a(S)?s&&u&&y?.async===!1&&y.jitless!==!0?(i||(i=o(t.shape)),v=i(v,y),d?cn([],S,v,y,p,e):v):r(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function ln(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=>!rt(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=>Ke(a,n,Ve())))}),t)}const ja=b("$ZodUnion",(e,t)=>{pe.init(e,t),se(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),se(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),se(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),se(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=>sr(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 l of t.options){const u=l._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(l=>ln(l,o,e,i)):ln(s,o,e,i)}}),Va=b("$ZodIntersection",(e,t)=>{pe.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(([l,u])=>un(r,l,u)):un(r,i,a)}});function _r(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(_t(e)&&_t(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=_r(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=_r(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 un(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 l of s.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const l of s.keys)n.has(l)||n.set(l,{}),n.get(l).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}),rt(e))return e;const a=_r(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 Ya=b("$ZodEnum",(e,t)=>{pe.init(e,t);const r=Hr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>ai.has(typeof o)).map(o=>typeof o=="string"?tt(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}}),Ka=b("$ZodLiteral",(e,t)=>{if(pe.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"?tt(n):n?tt(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}}),qa=b("$ZodTransform",(e,t)=>{pe.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zr(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 et;return r.value=o,r}});function dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const _n=b("$ZodOptional",(e,t)=>{pe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),se(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${sr(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=>dn(i,r.value)):dn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Ja=b("$ZodExactOptional",(e,t)=>{_n.init(e,t),se(e._zod,"values",()=>t.innerType._zod.values),se(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Qa=b("$ZodNullable",(e,t)=>{pe.init(e,t),se(e._zod,"optin",()=>t.innerType._zod.optin),se(e._zod,"optout",()=>t.innerType._zod.optout),se(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${sr(r.source)}|null)$`):void 0}),se(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)}),Xa=b("$ZodDefault",(e,t)=>{pe.init(e,t),e._zod.optin="optional",se(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=>fn(i,t)):fn(o,t)}});function fn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const es=b("$ZodPrefault",(e,t)=>{pe.init(e,t),e._zod.optin="optional",se(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))}),ts=b("$ZodNonOptional",(e,t)=>{pe.init(e,t),se(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=>mn(i,e)):mn(o,e)}});function mn(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 rs=b("$ZodCatch",(e,t)=>{pe.init(e,t),se(e._zod,"optin",()=>t.innerType._zod.optin),se(e._zod,"optout",()=>t.innerType._zod.optout),se(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=>Ke(a,n,Ve()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Ke(i,n,Ve()))},input:r.value}),r.issues=[]),r)}}),ns=b("$ZodPipe",(e,t)=>{pe.init(e,t),se(e._zod,"values",()=>t.in._zod.values),se(e._zod,"optin",()=>t.in._zod.optin),se(e._zod,"optout",()=>t.out._zod.optout),se(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=>kt(a,t.in,n)):kt(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>kt(i,t.out,n)):kt(o,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const os=b("$ZodReadonly",(e,t)=>{pe.init(e,t),se(e._zod,"propValues",()=>t.innerType._zod.propValues),se(e._zod,"values",()=>t.innerType._zod.values),se(e._zod,"optin",()=>t.innerType?._zod?.optin),se(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(pn):pn(o)}});function pn(e){return e.value=Object.freeze(e.value),e}const is=b("$ZodCustom",(e,t)=>{Ne.init(e,t),pe.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=>hn(i,r,n,e));hn(o,r,n,e)}});function hn(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(ft(o))}}var gn;class as{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 ss(){return new as}(gn=globalThis).__zod_globalRegistry??(gn.__zod_globalRegistry=ss());const mt=globalThis.__zod_globalRegistry;function cs(e,t){return new e({type:"string",...F(t)})}function ls(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...F(t)})}function yn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...F(t)})}function us(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...F(t)})}function ds(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...F(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...F(t)})}function fs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...F(t)})}function ms(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...F(t)})}function ps(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...F(t)})}function hs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...F(t)})}function gs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...F(t)})}function ys(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...F(t)})}function bs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...F(t)})}function vs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...F(t)})}function Ss(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...F(t)})}function As(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...F(t)})}function Cs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...F(t)})}function ws(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...F(t)})}function Es(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...F(t)})}function Ts(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...F(t)})}function Ns(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...F(t)})}function ks(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...F(t)})}function Os(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...F(t)})}function Is(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...F(t)})}function Ms(e,t){return new e({type:"string",format:"date",check:"string_format",...F(t)})}function Ls(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...F(t)})}function Ds(e,t){return new e({type:"string",format:"duration",check:"string_format",...F(t)})}function Ps(e,t){return new e({type:"number",coerce:!0,checks:[],...F(t)})}function Fs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...F(t)})}function $s(e,t){return new e({type:"boolean",...F(t)})}function Bs(e){return new e({type:"unknown"})}function xs(e,t){return new e({type:"never",...F(t)})}function bn(e,t){return new tn({check:"less_than",...F(t),value:e,inclusive:!1})}function fr(e,t){return new tn({check:"less_than",...F(t),value:e,inclusive:!0})}function vn(e,t){return new rn({check:"greater_than",...F(t),value:e,inclusive:!1})}function mr(e,t){return new rn({check:"greater_than",...F(t),value:e,inclusive:!0})}function Sn(e,t){return new ea({check:"multiple_of",...F(t),value:e})}function An(e,t){return new ra({check:"max_length",...F(t),maximum:e})}function Ot(e,t){return new na({check:"min_length",...F(t),minimum:e})}function Cn(e,t){return new oa({check:"length_equals",...F(t),length:e})}function zs(e,t){return new ia({check:"string_format",format:"regex",...F(t),pattern:e})}function Rs(e){return new aa({check:"string_format",format:"lowercase",...F(e)})}function Hs(e){return new sa({check:"string_format",format:"uppercase",...F(e)})}function Us(e,t){return new ca({check:"string_format",format:"includes",...F(t),includes:e})}function Zs(e,t){return new la({check:"string_format",format:"starts_with",...F(t),prefix:e})}function Ws(e,t){return new ua({check:"string_format",format:"ends_with",...F(t),suffix:e})}function nt(e){return new da({check:"overwrite",tx:e})}function Gs(e){return nt(t=>t.normalize(e))}function js(){return nt(e=>e.trim())}function Vs(){return nt(e=>e.toLowerCase())}function Ys(){return nt(e=>e.toUpperCase())}function Ks(){return nt(e=>oi(e))}function qs(e,t,r){return new e({type:"array",element:t,...F(r)})}function Js(e,t,r){return new e({type:"custom",check:"custom",fn:t,...F(r)})}function Qs(e){const t=Xs(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ft(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(ft(o))}},e(r.value,r)));return t}function Xs(e,t){const r=new Ne({check:"custom",...F(t)});return r._zod.check=e,r}function wn(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??mt,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 ve(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 v=a.schema,y=t.processors[o.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);y(e,t,v,d)}const p=e._zod.parent;p&&(a.ref||(a.ref=p),ve(p,t,d),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&we(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 En(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 l=n.get(s);if(l&&l!==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 p=e.external.registry.get(a[0])?.id,v=e.external.uri??(S=>S);if(p)return{ref:v(p)};const y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${v("__shared")}#/${s}/${y}`}}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:l,defId:u}=o(a);s.def={...s.schema},u&&(s.defId=u);const d=s.schema;for(const p in d)delete d[p];d.$ref=l};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
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 Tn(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 l=s.def??s.schema,u={...l},d=s.ref;if(s.ref=null,d){n(d);const b=e.seen.get(d),h=b.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,u),a._zod.parent===d)for(const g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(h.$ref&&b.def)for(const g in l)g==="$ref"||g==="allOf"||g in b.def&&JSON.stringify(l[g])===JSON.stringify(b.def[g])&&delete l[g]}const m=a._zod.parent;if(m&&m!==d){n(m);const b=e.seen.get(m);if(b?.schema.$ref&&(l.$ref=b.schema.$ref,b.def))for(const h in l)h==="$ref"||h==="allOf"||h in b.def&&JSON.stringify(l[h])===JSON.stringify(b.def[h])&&delete l[h]}e.override({zodSchema:a,jsonSchema:l,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 Ee(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 Ee(n.element,r);if(n.type==="set")return Ee(n.valueType,r);if(n.type==="lazy")return Ee(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 Ee(n.innerType,r);if(n.type==="intersection")return Ee(n.left,r)||Ee(n.right,r);if(n.type==="record"||n.type==="map")return Ee(n.keyType,r)||Ee(n.valueType,r);if(n.type==="pipe")return Ee(n.in,r)||Ee(n.out,r);if(n.type==="object"){for(const o in n.shape)if(Ee(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(Ee(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(Ee(o,r))return!0;return!!(n.rest&&Ee(n.rest,r))}return!1}const Xs=(e,t={})=>r=>{const n=wn({...r,processors:t});return Se(e,n),En(n,e),Tn(n,e)},Nt=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},a=wn({...o??{},target:i,io:t,processors:r});return Se(e,a),En(a,e),Tn(a,e)},ec={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tc=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=ec[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){const d=[...l];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},rc=(e,t,r,n)=>{const o=r,{minimum:i,maximum:a,format:s,multipleOf:l,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 l=="number"&&(o.multipleOf=l)},nc=(e,t,r,n)=>{r.type="boolean"},oc=(e,t,r,n)=>{r.not={}},ic=(e,t,r,n)=>{},ac=(e,t,r,n)=>{const o=e._zod.def,i=Hr(o.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},sc=(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},cc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},lc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},uc=(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=Se(i.element,t,{...n,path:[...n.path,"items"]})},dc=(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]=Se(a[u],t,{...n,path:[...n.path,"properties",u]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Se(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},_c=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,l)=>Se(s,t,{...n,path:[...n.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},fc=(e,t,r,n)=>{const o=e._zod.def,i=Se(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=Se(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},mc=(e,t,r,n)=>{const o=e._zod.def,i=Se(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"}]},pc=(e,t,r,n)=>{const o=e._zod.def;Se(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},hc=(e,t,r,n)=>{const o=e._zod.def;Se(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},gc=(e,t,r,n)=>{const o=e._zod.def;Se(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)))},yc=(e,t,r,n)=>{const o=e._zod.def;Se(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},bc=(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;Se(i,t,n);const a=t.seen.get(e);a.ref=i},vc=(e,t,r,n)=>{const o=e._zod.def;Se(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},Nn=(e,t,r,n)=>{const o=e._zod.def;Se(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Sc=y("ZodISODateTime",(e,t)=>{wa.init(e,t),fe.init(e,t)});function Ac(e){return Os(Sc,e)}const Cc=y("ZodISODate",(e,t)=>{Ea.init(e,t),fe.init(e,t)});function wc(e){return Is(Cc,e)}const Ec=y("ZodISOTime",(e,t)=>{Ta.init(e,t),fe.init(e,t)});function Tc(e){return Ms(Ec,e)}const Nc=y("ZodISODuration",(e,t)=>{Na.init(e,t),fe.init(e,t)});function kc(e){return Ls(Nc,e)}const De=y("ZodError",(e,t)=>{Yr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>hi(e,r)},flatten:{value:r=>pi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,er,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,er,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Oc=ir(De),Ic=ar(De),Mc=St(De),Lc=At(De),Dc=bi(De),Pc=vi(De),Fc=Si(De),$c=Ai(De),Bc=Ci(De),xc=wi(De),zc=Ei(De),Rc=Ti(De),pe=y("ZodType",(e,t)=>(me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nt(e,"input"),output:Nt(e,"output")}}),e.toJSONSchema=Xs(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)=>Oc(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Mc(e,r,n),e.parseAsync=async(r,n)=>Ic(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Lc(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Dc(e,r,n),e.decode=(r,n)=>Pc(e,r,n),e.encodeAsync=async(r,n)=>Fc(e,r,n),e.decodeAsync=async(r,n)=>$c(e,r,n),e.safeEncode=(r,n)=>Bc(e,r,n),e.safeDecode=(r,n)=>xc(e,r,n),e.safeEncodeAsync=async(r,n)=>zc(e,r,n),e.safeDecodeAsync=async(r,n)=>Rc(e,r,n),e.refine=(r,n)=>e.check($l(r,n)),e.superRefine=r=>e.check(Bl(r)),e.overwrite=r=>e.check(tt(r)),e.optional=()=>Fn(e),e.exactOptional=()=>Cl(e),e.nullable=()=>$n(e),e.nullish=()=>Fn($n(e)),e.nonoptional=r=>Ol(e,r),e.array=()=>_l(e),e.or=r=>Dn([e,r]),e.and=r=>gl(e,r),e.transform=r=>xn(e,Sl(r)),e.default=r=>Tl(e,r),e.prefault=r=>kl(e,r),e.catch=r=>Ml(e,r),e.pipe=r=>xn(e,r),e.readonly=()=>Pl(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)),kn=y("_ZodString",(e,t)=>{sr.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>tc(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(xs(...n)),e.includes=(...n)=>e.check(Hs(...n)),e.startsWith=(...n)=>e.check(Us(...n)),e.endsWith=(...n)=>e.check(Zs(...n)),e.min=(...n)=>e.check(Tt(...n)),e.max=(...n)=>e.check(An(...n)),e.length=(...n)=>e.check(Cn(...n)),e.nonempty=(...n)=>e.check(Tt(1,...n)),e.lowercase=n=>e.check(zs(n)),e.uppercase=n=>e.check(Rs(n)),e.trim=()=>e.check(Gs()),e.normalize=(...n)=>e.check(Ws(...n)),e.toLowerCase=()=>e.check(js()),e.toUpperCase=()=>e.check(Vs()),e.slugify=()=>e.check(Ys())}),Hc=y("ZodString",(e,t)=>{sr.init(e,t),kn.init(e,t),e.email=r=>e.check(cs(Uc,r)),e.url=r=>e.check(fs(Zc,r)),e.jwt=r=>e.check(ks(ol,r)),e.emoji=r=>e.check(ms(Wc,r)),e.guid=r=>e.check(yn(On,r)),e.uuid=r=>e.check(ls(kt,r)),e.uuidv4=r=>e.check(us(kt,r)),e.uuidv6=r=>e.check(ds(kt,r)),e.uuidv7=r=>e.check(_s(kt,r)),e.nanoid=r=>e.check(ps(Gc,r)),e.guid=r=>e.check(yn(On,r)),e.cuid=r=>e.check(hs(jc,r)),e.cuid2=r=>e.check(gs(Vc,r)),e.ulid=r=>e.check(ys(Yc,r)),e.base64=r=>e.check(Es(tl,r)),e.base64url=r=>e.check(Ts(rl,r)),e.xid=r=>e.check(bs(Kc,r)),e.ksuid=r=>e.check(vs(qc,r)),e.ipv4=r=>e.check(Ss(Jc,r)),e.ipv6=r=>e.check(As(Qc,r)),e.cidrv4=r=>e.check(Cs(Xc,r)),e.cidrv6=r=>e.check(ws(el,r)),e.e164=r=>e.check(Ns(nl,r)),e.datetime=r=>e.check(Ac(r)),e.date=r=>e.check(wc(r)),e.time=r=>e.check(Tc(r)),e.duration=r=>e.check(kc(r))});function He(e){return ss(Hc,e)}const fe=y("ZodStringFormat",(e,t)=>{_e.init(e,t),kn.init(e,t)}),Uc=y("ZodEmail",(e,t)=>{pa.init(e,t),fe.init(e,t)}),On=y("ZodGUID",(e,t)=>{fa.init(e,t),fe.init(e,t)}),kt=y("ZodUUID",(e,t)=>{ma.init(e,t),fe.init(e,t)}),Zc=y("ZodURL",(e,t)=>{ha.init(e,t),fe.init(e,t)}),Wc=y("ZodEmoji",(e,t)=>{ga.init(e,t),fe.init(e,t)}),Gc=y("ZodNanoID",(e,t)=>{ya.init(e,t),fe.init(e,t)}),jc=y("ZodCUID",(e,t)=>{ba.init(e,t),fe.init(e,t)}),Vc=y("ZodCUID2",(e,t)=>{va.init(e,t),fe.init(e,t)}),Yc=y("ZodULID",(e,t)=>{Sa.init(e,t),fe.init(e,t)}),Kc=y("ZodXID",(e,t)=>{Aa.init(e,t),fe.init(e,t)}),qc=y("ZodKSUID",(e,t)=>{Ca.init(e,t),fe.init(e,t)}),Jc=y("ZodIPv4",(e,t)=>{ka.init(e,t),fe.init(e,t)}),Qc=y("ZodIPv6",(e,t)=>{Oa.init(e,t),fe.init(e,t)}),Xc=y("ZodCIDRv4",(e,t)=>{Ia.init(e,t),fe.init(e,t)}),el=y("ZodCIDRv6",(e,t)=>{Ma.init(e,t),fe.init(e,t)}),tl=y("ZodBase64",(e,t)=>{La.init(e,t),fe.init(e,t)}),rl=y("ZodBase64URL",(e,t)=>{Pa.init(e,t),fe.init(e,t)}),nl=y("ZodE164",(e,t)=>{Fa.init(e,t),fe.init(e,t)}),ol=y("ZodJWT",(e,t)=>{Ba.init(e,t),fe.init(e,t)}),In=y("ZodNumber",(e,t)=>{on.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>rc(e,n,o),e.gt=(n,o)=>e.check(vn(n,o)),e.gte=(n,o)=>e.check(ur(n,o)),e.min=(n,o)=>e.check(ur(n,o)),e.lt=(n,o)=>e.check(bn(n,o)),e.lte=(n,o)=>e.check(lr(n,o)),e.max=(n,o)=>e.check(lr(n,o)),e.int=n=>e.check(Mn(n)),e.safe=n=>e.check(Mn(n)),e.positive=n=>e.check(vn(0,n)),e.nonnegative=n=>e.check(ur(0,n)),e.negative=n=>e.check(bn(0,n)),e.nonpositive=n=>e.check(lr(0,n)),e.multipleOf=(n,o)=>e.check(Sn(n,o)),e.step=(n,o)=>e.check(Sn(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}),il=y("ZodNumberFormat",(e,t)=>{xa.init(e,t),In.init(e,t)});function Mn(e){return Ps(il,e)}const al=y("ZodBoolean",(e,t)=>{za.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nc(e,r,n)});function sl(e){return Fs(al,e)}const cl=y("ZodUnknown",(e,t)=>{Ra.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ic()});function Ln(){return $s(cl)}const ll=y("ZodNever",(e,t)=>{Ha.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oc(e,r,n)});function ul(e){return Bs(ll,e)}const dl=y("ZodArray",(e,t)=>{Ua.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>uc(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(An(r,n)),e.length=(r,n)=>e.check(Cn(r,n)),e.unwrap=()=>e.element});function _l(e,t){return Ks(dl,e,t)}const fl=y("ZodObject",(e,t)=>{Wa.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dc(e,r,n,o),se(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:Ln()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ln()}),e.strict=()=>e.clone({...e._zod.def,catchall:ul()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ui(e,r),e.safeExtend=r=>di(e,r),e.merge=r=>_i(e,r),e.pick=r=>ci(e,r),e.omit=r=>li(e,r),e.partial=(...r)=>fi(Pn,e,r[0]),e.required=(...r)=>mi(Bn,e,r[0])});function ml(e,t){const r={type:"object",shape:e??{},...D(t)};return new fl(r)}const pl=y("ZodUnion",(e,t)=>{Ga.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_c(e,r,n,o),e.options=t.options});function Dn(e,t){return new pl({type:"union",options:e,...D(t)})}const hl=y("ZodIntersection",(e,t)=>{ja.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fc(e,r,n,o)});function gl(e,t){return new hl({type:"intersection",left:e,right:t})}const dr=y("ZodEnum",(e,t)=>{Va.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>ac(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 dr({...t,checks:[],...D(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 dr({...t,checks:[],...D(o),entries:i})}});function rt(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new dr({type:"enum",entries:r,...D(t)})}const yl=y("ZodLiteral",(e,t)=>{Ya.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sc(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 bl(e,t){return new yl({type:"literal",values:Array.isArray(e)?e:[e],...D(t)})}const vl=y("ZodTransform",(e,t)=>{Ka.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lc(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zr(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 Sl(e){return new vl({type:"transform",transform:e})}const Pn=y("ZodOptional",(e,t)=>{_n.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Fn(e){return new Pn({type:"optional",innerType:e})}const Al=y("ZodExactOptional",(e,t)=>{qa.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Cl(e){return new Al({type:"optional",innerType:e})}const wl=y("ZodNullable",(e,t)=>{Ja.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function $n(e){return new wl({type:"nullable",innerType:e})}const El=y("ZodDefault",(e,t)=>{Qa.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Tl(e,t){return new El({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Gr(t)}})}const Nl=y("ZodPrefault",(e,t)=>{Xa.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function kl(e,t){return new Nl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Gr(t)}})}const Bn=y("ZodNonOptional",(e,t)=>{es.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ol(e,t){return new Bn({type:"nonoptional",innerType:e,...D(t)})}const Il=y("ZodCatch",(e,t)=>{ts.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ml(e,t){return new Il({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ll=y("ZodPipe",(e,t)=>{rs.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bc(e,r,n,o),e.in=t.in,e.out=t.out});function xn(e,t){return new Ll({type:"pipe",in:e,out:t})}const Dl=y("ZodReadonly",(e,t)=>{ns.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Pl(e){return new Dl({type:"readonly",innerType:e})}const Fl=y("ZodCustom",(e,t)=>{os.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cc(e,r)});function $l(e,t={}){return qs(Fl,e,t)}function Bl(e){return Js(e)}const _r={custom:"custom"};function ye(e){return Ds(In,e)}const zn=new Date().getUTCFullYear(),Ot=He().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),Rn=Dn([bl(""),He().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),xl=(e,t,r)=>ye({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)=>ye({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)=>ye({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(zn,`${e} cannot be in the future.`),Mt=e=>ye({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 ye({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.`)},zl={email:He().trim().min(1,"Required").email("Please enter a valid email address."),phone:He().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:He().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:He().trim().min(1,"Required").regex(/^\d{6}$/,"Please enter the 6-digit code."),first_name:Ot,last_name:Ot,middle_name:Rn,co_applicant_first_name:Ot,co_applicant_last_name:Ot,co_applicant_middle_name:Rn,year_built:It("Year built",1800),year_roof_updated:ye({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:xl("Square footage",1,999999),sale_price_cents:ye({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:ye({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:ye({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:ye({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:ye({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:ye({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:ye({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:ye({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:ye({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:ye({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),license_number:He().trim().min(1,"Required").max(20,"License number must be 20 characters or fewer.").regex(/^[A-Z0-9]+$/i,"License number must contain only letters and numbers."),vin:He().superRefine((e,t)=>{if(typeof e!="string"||e.trim()==="")return;if(/\s/.test(e)){t.addIssue({code:_r.custom,message:"VIN cannot contain spaces."});return}const r=e.trim();/^[A-HJ-NPR-Z0-9]{17}$/i.test(r)||t.addIssue({code:_r.custom,message:"VIN must be exactly 17 letters and numbers (excluding I, O, and Q)."})}),annual_mileage:ye({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:ye({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:ye({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 ge(e){return new Date(`${e}T00:00:00Z`)}function Ae(){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 Hn=[{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:e=>{const t=e.date_of_birth;if(!t||typeof t!="string")return;const r=ge(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":Ue(r,Ae())<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=ge(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":Ue(r,Ae())<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>zn)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=ge(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=ge(t);return isNaN(r.getTime())?"Invalid date.":r>Ae()?"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=ge(r),o=ge(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=ge(t);return isNaN(r.getTime())?"Invalid date.":r>Ae()?"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=ge(t);return isNaN(r.getTime())?"Invalid date.":r>Ae()?"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=ge(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Ae(),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=ge(r);if(isNaN(o.getTime()))return;const i=Ue(o,Ae());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=ge(r);if(isNaN(o.getTime()))return;const i=Ue(o,Ae());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=ge(r);if(isNaN(o.getTime()))return;const i=Ue(o,Ae());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=ge(r);if(isNaN(o.getTime()))return;const i=Ue(o,Ae());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=ge(t);return isNaN(r.getTime())?"Invalid date.":r>Ae()?"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=ge(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Ae();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=ge(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Ae(),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=ge(t);return isNaN(r.getTime())?"Invalid date.":r>Ae()?"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=ge(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=ge(t);if(isNaN(r.getTime()))return"Invalid date.";const n=Ae(),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=ge(r);if(isNaN(o.getTime()))return;const i=Ue(o,Ae());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=ge(r);if(isNaN(o.getTime()))return;const i=Ue(o,Ae());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],l=a[r];if(s!=null&&l!=null&&s>l)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 fr(e,t){const r=zl[e];if(!r)return;const n=r.safeParse(t);return n.success?void 0:n.error.issues[0].message}function Un(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 Rl(e,t){const r={};for(const n of Hn){if(t?.has(n.targetKey))continue;const o=n.validate(e);o&&(r[n.targetKey]=o)}return r}function mr(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Lt(e,t){return e.key??`${mr(e.question)}-${t}`}function Ze(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),l=t[s];if(i.required&&Ze(l,i.inputType)){r[s]="Required";return}if(!Ze(l,i.inputType)){const u=fr(s,l);if(u){r[s]=u;return}}});const n=new Set(Object.keys(r).filter(i=>r[i])),o=Rl(t,n);for(const[i,a]of Object.entries(o))r[i]=a;return r}function Hl(e){if(e===""||e===null||e===void 0)return;const t=Number(e);return Number.isNaN(t)?void 0:t}const Ul=new Set(["Home","HomeConstruction","HomeFeatures"]),Zl=new Set(["HomePolicy","BundlePolicy"]),Wl=new Set(["HomeCustomer","BundleCustomer"]);function pr(e,t){return e==="has_health_insurance_auto_accident"?t!=="BundleCustomer":e==="household_size"?!(t&&Ul.has(t)):e==="number_of_mortgagees"?!(t&&Zl.has(t)):(e==="has_co_applicant"||e==="co_applicant_middle_name"||e==="co_applicant_relationship")&&t&&Wl.has(t)?!1:e==="multi_policy_discount"&&t==="HomePolicy"?!0:Gl.has(e)}const Gl=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_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"]),jl={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"},Vl={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},Yl={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"},Kl={Business:"Business",Pleasure:"Pleasure",Farming:"Farming",To_FromWork:"To/From Work",To_FromSchool:"To/From School"},ql={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"},Jl={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"},Ql={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"},Xl={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"},eu={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},tu={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"},ru={cov25000:"25,000",cov35000:"35,000",cov50000:"50,000",cov100000:"100,000",cov200000:"200,000",cov250000:"250,000",cov300000:"300,000",cov500000:"500,000"},nu={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"},ou={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},hr={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",Thousand:"1,000",TwoThousand:"2,000"},Zn={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},Wn={NoCoverage:"No Coverage",cov20to600:"20/600",cov25to750:"25/750",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500"},Gn={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"},iu={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"},au={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)"},su={OwnerPrimary:"Owner Primary",OwnerSecondary:"Owner Secondary",OwnerSeasonal:"Owner Seasonal"},cu={Basic:"Basic",Modest:"Modest",Average:"Average",AboveAverage:"Above Average",Expensive:"Expensive",VeryExpensive:"Very Expensive",Opulent:"Opulent"},lu={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"},uu={Slab:"Slab",Basement:"Basement",CrawlSpace:"Crawl Space",PartialBasement:"Partial Basement",PiersPostsPiles:"Piers / Posts / Piles",Open:"Open"},du={NotOverWater:"No",PartiallyOverWater:"Partially Over Water",FullyOrEntirelyOverWater:"Fully or Entirely Over Water"},_u={One:"1",OneHalf:"1.5",Two:"2",TwoHalf:"2.5",Three:"3",ThreeHalf:"3.5",Four:"4",BiLevel:"Bi-Level",TriLevel:"Tri-Level"},fu={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"},mu={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"},pu={B_Gable:"Gable",C_Hip:"Hip",A_Flat:"Flat",D_Other:"Other"},hu={NotUpdated:"Not Updated",PartialUpdate:"Partial Update",CompleteUpdate:"Complete Update"},gu={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"},yu={AboveGround:"Above Ground",BelowGround:"Below Ground"},bu={Basement:"Below Grade Basement",SplitLevelBasement:"Split Level Basement",WalkoutBasement:"Walkout Basement"},vu={EntirelyCopper:"Entirely Copper",EntirelyGalvanized:"Entirely Galvanized",EntirelyPEX:"Entirely PEX",EntirelyPVC:"Entirely PVC",Polybutylene:"Polybutylene"},Su={TwentyFive:"$25,000",Fifty:"$50,000",OneHundred:"$100,000",TwoHundred:"$200,000",ThreeHundred:"$300,000",FourHundred:"$400,000",FiveHundred:"$500,000"},Au={cov1000:"$1,000",cov2000:"$2,000",cov3000:"$3,000",cov4000:"$4,000",cov5000:"$5,000"},Cu={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%"},wu={None:"None",OnePercent:"1%",TwoPercent:"2%",FivePercent:"5%",TenPercent:"10%"},Eu={_0_500ft:"0-500 Feet",_501_1000ft:"501-1000 Feet",_1001ftAndGreater:"1001 Feet And Greater"},Tu={Lessthan5miles:"Less Than 5 Miles",Over5miles:"Over 5 Miles",NotAvailable:"Not Available"},jn={"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"},Vn={Single:"Single",Married:"Married",Seperated:"Separated",Divorced:"Divorced",Widowed:"Widowed",DomesticPartner:"Domestic Partner"},Yn={Female:"Female",Male:"Male"},Kn={"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"},Nu={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"},ku={Verbal_Threshold:"Limited right to sue",Zero_Threshold:"Unlimited right to sue",Full:"Full",Limited:"Limited"},Ou={Primary:"Primary",Secondary:"Secondary"},Iu={cov1000:"$1,000",cov10000:"$10,000"},Mu={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"},Lu={cov250:"$250",cov500:"$500",cov1000:"$1,000",cov2000:"$2,000",cov2500:"$2,500"},Du={"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"]},Pu={"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"},qn=Du,Jn=Pu;function gr(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 gr(e,Kn)}function Qn(e){return gr(e,Gn)}function Xn(e){return gr(e,Jn)}function Fu(e){return e.trim().toLowerCase()}function eo(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=eo(e[t.expirationDateKey]),n=eo(e[t.effectiveDateKey]);return r==null||n==null?!1:r<n}const $u=new Set(["HomePolicy","BundlePolicy"]);function Ft(e,t,r){return String(e.key??"")!=="lapse_in_coverage"||!r||!$u.has(r)?!0:t.home_prior_carrier_name!=="NoPriorInsurance"}function yr(e){let t=null,r=null,n=null;const o=new Set,i=new Set,a=l=>{const u=String(l.key??""),d=Fu(String(l.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=l=>{l.forEach(u=>{(u.conditionals??[]).forEach(d=>{const m=d.conditionalQuestions??[];m.forEach(a),s(m)})})};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 $t(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 Bt(e,t){const r=String(e.key??"");return t.noInsuranceReasonKeys.has(r)}const Bu=["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"],br="credify_quote_id",vr="credify_auth_token";function xu(e){try{localStorage.setItem(br,e)}catch(t){console.error("Failed to save quoteId to localStorage:",t)}}function zu(){try{return localStorage.getItem(br)}catch(e){return console.error("Failed to load quoteId from localStorage:",e),null}}function to(){try{localStorage.removeItem(br)}catch(e){console.error("Failed to clear quoteId from localStorage:",e)}}function Ru(e){try{localStorage.setItem(vr,e)}catch(t){console.error("Failed to save authToken to localStorage:",t)}}function Hu(){try{return localStorage.getItem(vr)}catch(e){return console.error("Failed to load authToken from localStorage:",e),null}}function ro(){try{localStorage.removeItem(vr)}catch(e){console.error("Failed to clear authToken from localStorage:",e)}}function Uu(){to(),ro()}const Pe="https://api.getcredify.com";let it=null;function Zu(e){it=e,Ru(e)}function xt(){return it}function Sr(){const e=Hu();e&&(it=e)}function no(){it=null,ro()}async function Fe(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 Wu(e){try{return await e.json()}catch{return{}}}async function Gu(e,t){const r=t?{stage:e,quoteId:t}:{stage:e};return await(await Fe(`${Pe}/get-questions-by-stage`,r)).json()}async function zt(e){const t=e?{quoteId:e}:{};return await(await Fe(`${Pe}/get-stages-for-quote`,t)).json()}async function ju(e){const r=await(await Fe(`${Pe}/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 Fe(`${Pe}/update-quote`,n);return await Wu(o)}async function Vu(e,t){return await(await Fe(`${Pe}/verify-quote`,{quoteId:e,smsCode:t})).json()}async function Yu(e){return await(await Fe(`${Pe}/is-supported-state`,{state:e})).json()}async function Ku(){return await(await Fe(`${Pe}/get-rates`,{})).json()}async function oo(e){const t=e?{quoteId:e}:{};return await(await Fe(`${Pe}/get-quote`,t)).json()}async function io(e){return(await Fe(`${Pe}/get-vehicle-options`,e)).json()}async function qu(e){return(await Fe(`${Pe}/get-vehicle-options`,{...e,action:"vinDecode"})).json()}async function Ju(e){const r=await(await Fe(`${Pe}/request-bind`,{quoteRateId:e})).json();return r&&typeof r=="object"&&"success"in r?r:{success:!0}}const Qu=["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible"],Rt=new Set([...Qu,"is_corporation"]);ml({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:sl().nullable().optional()}).superRefine((e,t)=>{e.pip_coverage_type==="Secondary"&&e.has_health_insurance_auto_accident!==!0&&t.addIssue({code:_r.custom,path:["pip_coverage_type"],message:"Secondary PIP coverage requires health insurance that covers auto accidents."})});const Ar=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),Xu={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"},ao={auto_prior_carrier_name:jl,auto_prior_liability_limit:ql,auto_reason_for_no_insurance:Jl,residence_type:Vl,home_prior_carrier_name:Yl,policy_bi:Ql,policy_um:Xl,policy_pd:eu,policy_mp:tu,policy_umpd:ru,policy_pip:nu,policy_auto_death_indemnity:ou,vehicle_comp_deductible:hr,vehicle_coll_deductible:hr,vehicle_towing_and_labor:Zn,vehicle_transportation_expense:Wn,education_level:Gn,industry:Kn,occupation:Jn,usage:Kl,architectural_style:iu,dwelling_type:au,occupancy_type:su,construction_quality:cu,construction_type:lu,foundation_type:uu,located_over_water:du,number_of_stories:_u,exterior_wall_type:fu,roof_material_type:mu,roof_shape:pu,roof_updated_type:hu,heating_type:gu,oil_tank_location:yu,basement_type:bu,plumbing_type:vu,personal_liability:Su,dwelling_medical_payments:Au,all_perils_deductible:Cu,windstorm_deductible:wu,distance_from_fire_hydrant_ft:Eu,distance_from_fire_station_miles:Tu,employment_industry:jn,marital_status:Vn,gender:Yn,co_applicant_employment_industry:jn,co_applicant_marital_status:Vn,co_applicant_gender:Yn,description:Nu,tort_threshold:ku,pip_coverage_type:Ou,extended_medical:Iu,additional_pip:Mu,policy_pip_deductible:Lu},ed=["OTHER / NOT LISTED"],td=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],rd=["Other"];function Ie(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 so(e){const t=e.replace(/\D+/g,"");if(t!=="")return Hl(t)}function nd(e){return e==="-"||e==="+"||e==="."||e==="e"||e==="E"}const od={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},co=new Set(["sale_price_cents","dwelling_replacement_cost","other_structures_coverage","personal_property_coverage","loss_of_use_coverage","custom_equipment_value_cents","cost_new_value_cents","stated_value_amount_cents","property_damage_amount_paid_cents","personal_injury_amount_paid_cents","auto_current_annual_premium_cents","amount_paid_cents"]),id=new Set(["total_area_sq_ft","annual_mileage","miles_to_work","distance_to_coast_miles"]),Ht={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"},ad={license_number:20};function sd(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:Ie(r),max:Ie(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:Ie(n),max:Ie(o)}}if(e==="date_of_incident")return{max:Ie(r)};if(e==="move_in_date")return{max:Ie(r)};if(e==="purchase_date")return{max:Ie(r)};if(e==="date_of_birth")return{max:Ie(r)};if(e==="date_first_licensed")return{max:Ie(r)};if(e==="occurred_at")return{max:Ie(r)};if(e==="accident_prevention_course_date")return{max:Ie(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:Ie(n),max:Ie(o)}}return{}}const cd=new Set(["Disabled","Retired","Unemployed","Other"]);function Cr(e,t,r){const n=String(e.key??"");if(n!=="occupation"&&n!=="co_applicant_occupation"||n==="co_applicant_occupation")return!0;const o=Ce(t,r,"industry"),i=Ce(t,r,"employment_industry"),a=String(o??i??"").trim();return!cd.has(a)}function lo(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 wr(e,t){const r=String(e.key??"");return Rt.has(r)?lo(t):!0}function ld(e,t){const r=String(e??""),n=Rt.has(r)||r==="has_health_insurance_auto_accident"||r==="is_corporation";return lo(t)&&n}function Er(e,t,r,n){return!(!pr(e,n)||ld(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 uo(e,t){return Ut(e)?"Yes":t}function _o(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function fo(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 mo(e,t){const r=_o(e),n=_o(t);if(r!=null&&n!=null)return r-n;const o=fo(e),i=fo(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function ud(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function mt(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=mo(e,r);return n!=null&&n<0}case"greaterThan":{const n=mo(e,r);return n!=null&&n>0}case"contains":return ud(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 pt(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 Ce(e,t,r){return pt(e,[...t??[],r])}function we(e,t,r,n){return $e(e,[...t??[],r],n)}function dd(e,t){return e?.length?`${e.join("-")}-${t}`:t}const _d="__items",Zt=e=>`${e}${_d}`;function Ne(e){return e==null?"":typeof e=="string"?e:String(e)}function po(e){return e==null?"":typeof e=="number"&&Number.isFinite(e)||typeof e=="string"?e:""}function fd(e){return e==null?"":typeof e=="string"||typeof e=="number"?e:String(e)}function md({questions:e,initialValues:t,controlledValues:r,onChangeValues:n,onSubmit:o,quoteId:i,widgetStageKey:a}){const s=p.useMemo(()=>Xt(e),[e]),l=p.useMemo(()=>yr(s),[s]),u=p.useMemo(()=>a==="BundlePolicy"?!0:s.some(C=>String(C.key)==="home_prior_carrier_name")&&s.some(C=>String(C.key)==="driver_vehicle_assignments"),[a,s]),d=p.useMemo(()=>{const C={};return t&&Object.assign(C,t),C},[t]),[m,b]=p.useState(d);p.useEffect(()=>{b(d)},[d]);const[h,S]=p.useState({}),g=p.useMemo(()=>({...h,...r??m}),[h,r,m]);p.useEffect(()=>{r&&S(C=>({...C,...r}))},[r]);const[Y,R]=p.useState({}),K=p.useRef(new Map),V=p.useRef(new Set),[,G]=p.useState({}),[L,X]=p.useState({}),H=p.useRef(!1);p.useEffect(()=>{!i||H.current||!s.some(v=>v.key==="year"||v.key==="make"||v.key==="model"||v.key==="body_style")||(H.current=!0,io({quoteId:i}).catch(()=>{}))},[i,s]);const[ae,J]=p.useState({}),[F,$]=p.useState({}),Q=p.useCallback(async(C,v)=>{if(!i||!Un(v))return;const _=C?C.join("-"):"_root";J(N=>({...N,[_]:!0})),$(N=>({...N,[_]:null}));try{const N=await qu({quoteId:i,vin:v});if(N.error){$(I=>({...I,[_]:N.error}));return}let w=g;N.year&&(w=we(w,C,"year",String(N.year))),N.make&&(w=we(w,C,"make",N.make)),N.model&&(w=we(w,C,"model",N.model)),N.bodyStyle&&(w=we(w,C,"body_style",N.bodyStyle)),r&&n?n(w):b(w),S(w),K.current.clear(),V.current.clear(),G({})}catch{$(N=>({...N,[_]:"VIN lookup failed — please enter vehicle details manually"}))}finally{J(N=>({...N,[_]:!1}))}},[i,g,r,n]),ie=p.useCallback((C,v)=>{if(!i)return;const _=`${v.year}|${v.make??""}|${v.model??""}`,N=v.model?"bodyStyles":v.make?"models":"makes",w=`${C}:${N}`,I=K.current.get(_);if(I)return I[N]??[];V.current.has(_)||(V.current.add(_),queueMicrotask(()=>{X(j=>({...j,[w]:!0})),io({quoteId:i,...v}).then(j=>{K.current.set(_,j),G(P=>({...P,[w]:j[N]??[]}))}).catch(()=>{K.current.set(_,{}),G(j=>({...j,[w]:[]}))}).finally(()=>{V.current.delete(_),X(j=>({...j,[w]:!1}))})}))},[i]);function Z(C,v,_){return{...C?pt(g,C)??{}:g,[v]:_}}function z(C,v){const _=Hn.filter(w=>w.targetKey===C||w.dependsOn.includes(C)),N={[C]:void 0};for(const w of _){const I=w.validate(v);w.targetKey in N?I!==void 0&&(N[w.targetKey]=I):N[w.targetKey]=I}R(w=>({...w,...N}))}const f=(C,v,_)=>{const N=Ce(g,_,C);if(Ze(N,v)){Y[C]&&R(I=>({...I,[C]:void 0}));return}const w=fr(C,N);if(w){R(I=>({...I,[C]:w}));return}z(C,Z(_,C,N))};p.useEffect(()=>{let C=g,v=!1;s.forEach(_=>{if(!Ut(_))return;const N=String(_.key);Ce(C,void 0,N)!=="Yes"&&(C=we(C,void 0,N,"Yes"),v=!0)}),v&&(r&&n?n(C):b(C),S(C))},[s,g,r,n]);function A(C,v){const _=C.key;if((_==="relationship_to_insured"||_==="is_registered_owner")&&v){const E=v[v.length-1];if(typeof E=="number"&&E===0)return null}if((_==="purchase_date"||_==="cost_new_value_cents")&&v)return null;if(_==="custom_equipment_value_cents"&&v){const E=Ce(g,v,"vehicle_has_modifications");if(E!=="Yes"&&E!==!0)return null}const N=_==="auto_reason_for_no_insurance"&&l.currentCarrierKey?g[l.currentCarrierKey]==="NoPriorInsurance"?"Reason you are not currently insured":"Reason for lapse in coverage":C.question,w=C.hint,I=Ce(g,v,_),j=Bt(C,l)?_t(g,l):C.required,P=Y[_],W=E=>{let T=we(g,v,_,E);if(C.inputType==="radio"&&C.conditionals){const O=C.conditionals??[];for(const te of O){const B=Ce(g,v,_),q=mt(B,te.conditionalType,te.conditionalValue),x=mt(E,te.conditionalType,te.conditionalValue);if(q&&!x&&te.conditionalQuestionsAllowMultiple){const he=te.conditionalQuestions??[];if(he.length>0){const re=Zt(_);T=$e(T,[...v??[],re],[]);const le=(ce,oe)=>{ce.forEach(ne=>{(ne.conditionals??[]).forEach(ue=>{if(ue.conditionalQuestionsAllowMultiple){const de=Zt(ne.key);T=$e(T,[...oe,de],[])}const ve=ue.conditionalQuestions??[];ve.length>0&&le(ve,oe)})})};le(he,[...v??[],re])}}}}r&&n?n(T):b(T),S(T)};if(_==="vehicle_policy_selections"){const E=g.vehicles__items??[],T=g.drivers__items??[];if(E.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles first to configure coverage selections."},_);const O=g.driver_vehicle_assignments??{},te=T.length>1,B=oe=>Object.entries(oe).map(([ne,be])=>({value:ne,label:be})),q=B(hr),x=B(Zn),he=B(Wn),re=(oe,ne,be)=>{const ue=$e(g,["vehicles__items",oe,ne],be);r&&n?n(ue):b(ue),S(ue)},le=(oe,ne,be)=>{const ue={...O},ve=`v${oe}`;ue[ve]={...ue[ve]??{}},ue[ve][`d${ne}`]=be;const de=$e(g,["driver_vehicle_assignments"],ue);r&&n?n(de):b(de),S(de)},ce=oe=>{if(!te)return null;const ne=O[`v${oe}`];if(!ne)return null;const be=T.map((de,Be)=>ne[`d${Be}`]??0),ue=be.filter(de=>de>0);if(ue.length>=2&&ue.every(de=>de===ue[0])&&ue[0]===50)return`Assignments for Vehicle ${oe+1} cannot be 50 percent for both Drivers.`;const ve=be.reduce((de,Be)=>de+Be,0);return ve>0&&ve!==100?`Driver percentages for this vehicle must add up to 100% (currently ${ve}%).`:null};return c.jsx("div",{children:E.map((oe,ne)=>{const be=[oe.year,oe.make,oe.model].filter(Boolean).join(" ")||`Vehicle ${ne+1}`,ue=ce(ne),ve=de=>typeof oe[de]=="string"?oe[de]:"";return c.jsxs("fieldset",{style:{border:`1px solid ${ue?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[c.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:be}),c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px"},children:[c.jsx(st,{id:`veh-${ne}-comp`,label:"Comprehensive deductible",required:!0,placeholder:"Select...",options:q,value:ve("vehicle_comp_deductible"),onChange:de=>re(ne,"vehicle_comp_deductible",de.currentTarget.value)}),c.jsx(st,{id:`veh-${ne}-coll`,label:"Collision deductible",required:!0,placeholder:"Select...",options:q,value:ve("vehicle_coll_deductible"),onChange:de=>re(ne,"vehicle_coll_deductible",de.currentTarget.value)}),c.jsx(st,{id:`veh-${ne}-tow`,label:"Towing and Labor",required:!0,placeholder:"Select...",options:x,value:ve("vehicle_towing_and_labor"),onChange:de=>re(ne,"vehicle_towing_and_labor",de.currentTarget.value)}),c.jsx(st,{id:`veh-${ne}-trans`,label:"Transportation expense",required:!0,placeholder:"Select...",options:he,value:ve("vehicle_transportation_expense"),onChange:de=>re(ne,"vehicle_transportation_expense",de.currentTarget.value)})]}),te&&c.jsxs("div",{style:{marginTop:"16px"},children:[c.jsx("p",{style:{fontWeight:600,margin:"0 0 8px"},children:"Drivers usage (%)"}),c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:T.map((de,Be)=>{const Mr=[de.first_name,de.last_name].filter(Boolean).join(" ")||`Driver ${Be+1}`,xo=O[`v${ne}`]?.[`d${Be}`];return c.jsx("div",{style:{flex:"0 0 140px"},children:c.jsx(qt,{id:`assignment-v${ne}-d${Be}`,label:`${Mr} %`,value:xo??"",min:0,max:100,step:1,inputMode:"numeric",onChange:Lr=>{const Me=Lr.currentTarget.value.replace(/\D+/g,"");le(ne,Be,Me===""?0:Math.min(100,parseInt(Me,10)))}})},`${ne}-${Be}`)})}),ue&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:ue})]})]},ne)})},_)}if(_==="driver_vehicle_assignments"){const E=g.vehicles__items??[],T=g.drivers__items??[];if(u&&T.length<=1)return null;if(E.length===0||T.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},_);const O=g.driver_vehicle_assignments??{},te=(q,x,he)=>{const re={...O},le=`v${q}`;re[le]={...re[le]??{}},re[le][`d${x}`]=he,W(re)},B=q=>{if(T.length<2)return null;const x=O[`v${q}`];if(!x)return null;const he=T.map((ce,oe)=>x[`d${oe}`]??0),re=he.filter(ce=>ce>0);if(re.length>=2&&re.every(ce=>ce===re[0])&&re[0]===50)return`Assignments for Vehicle ${q+1} cannot be 50 percent for both Drivers.`;const le=he.reduce((ce,oe)=>ce+oe,0);return le>0&&le!==100?`Driver percentages for this vehicle must add up to 100% (currently ${le}%).`:null};return c.jsxs("div",{children:[c.jsx("h4",{style:{marginBottom:"12px"},children:N}),E.map((q,x)=>{const he=[q.year,q.make,q.model].filter(Boolean).join(" ")||`Vehicle ${x+1}`,re=B(x);return c.jsxs("fieldset",{style:{border:`1px solid ${re?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[c.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:he}),c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:T.map((le,ce)=>{const oe=[le.first_name,le.last_name].filter(Boolean).join(" ")||`Driver ${ce+1}`,ne=O[`v${x}`]?.[`d${ce}`];return c.jsx("div",{style:{flex:"0 0 140px"},children:c.jsx(qt,{id:`assignment-v${x}-d${ce}`,label:`${oe} %`,value:ne??"",min:0,max:100,step:1,inputMode:"numeric",onChange:be=>{const ue=be.currentTarget.value.replace(/\D+/g,"");te(x,ce,ue===""?0:Math.min(100,parseInt(ue,10)))}})},`${x}-${ce}`)})}),re&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:re})]},x)})]},_)}switch(C.inputType){case"text":{if(_==="vin"&&i){const E=v?v.join("-"):"_root",T=ae[E]??!1,O=F[E]??null,te=[w?`${_}-hint`:null,P?`${_}-error`:null,O?`${_}-vin-error`:null].filter(Boolean).join(" ");return c.jsxs("div",{children:[c.jsx(Oe,{id:_,label:N,hint:w,error:P,required:j,children:c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx("input",{id:_,className:`form-input ${P?"input-error":""}`,"aria-invalid":!!P,"aria-describedby":te||void 0,"aria-required":j||void 0,required:j,value:Ne(I),maxLength:17,onChange:B=>W(B.currentTarget.value),onBlur:()=>f(_,"text",v),autoComplete:Ht[_],type:"text"})}),c.jsx("button",{type:"button",disabled:T||!Un(Ne(I)),className:"btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",onClick:()=>Q(v,Ne(I)),children:T?"Looking up...":"Verify VIN"})]})}),O&&c.jsx("p",{id:`${_}-vin-error`,className:"text-sm text-red-600 mt-1",children:O})]},_)}if(_==="sms_code"){const E=Ne(I);return c.jsx(Kt,{id:_,label:N,hint:w,value:E,inputMode:"numeric",pattern:"[0-9]*",maxLength:6,onChange:T=>{const O=T.currentTarget.value.replace(/\D+/g,"").slice(0,6);W(O)},onBlur:()=>f(_,"text",v),"aria-required":j||void 0,error:P,autoComplete:Ht[_]},_)}return _==="license_number"?c.jsx(Kt,{id:_,label:N,hint:w,value:Ne(I),onChange:E=>W(E.currentTarget.value.replace(/[^A-Z0-9]/gi,"").slice(0,20)),onBlur:()=>f(_,"text",v),"aria-required":j||void 0,error:P,autoComplete:"off",maxLength:20},_):_==="social_security_number"?c.jsx(Zo,{id:_,label:N,hint:w,value:Ne(I),onChange:E=>W(E.currentTarget.value),onBlur:()=>f(_,"text",v),"aria-required":j||void 0,error:P},_):c.jsx(Kt,{id:_,label:N,hint:w,value:Ne(I),onChange:E=>W(E.currentTarget.value),onBlur:()=>f(_,"text",v),"aria-required":j||void 0,error:P,autoComplete:Ht[_],maxLength:ad[_]},_)}case"email":return c.jsx(Wo,{id:_,label:N,value:Ne(I),onChange:E=>W(E.currentTarget.value),onBlur:()=>f(_,"email",v),"aria-required":j||void 0,error:P},_);case"password":return c.jsx(Vo,{id:_,label:N,value:Ne(I),onChange:E=>W(E.currentTarget.value),onBlur:()=>f(_,"password",v),"aria-required":j||void 0,error:P},_);case"tel":return c.jsxs(c.Fragment,{children:[c.jsx(Go,{id:_,label:N,value:Ne(I),onChange:E=>W(E.currentTarget.value),onBlur:()=>f(_,"tel",v),"aria-required":j||void 0,error:P},_),_==="phone"&&c.jsxs("div",{className:"mt-3 text-xs text-slate-600 space-y-1",children:[c.jsx("p",{children:"By entering your phone number, you agree to receive a one-time SMS from Credify Insurance with a verification code."}),c.jsx("p",{children:"Message & data rates may apply. One message per request."}),c.jsxs("p",{children:["See our"," ",c.jsx("a",{href:"https://getcredify.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","and"," ",c.jsx("a",{href:"https://getcredify.com/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Terms of Service"}),"."]})]})]});case"url":return c.jsx(jo,{id:_,label:N,value:Ne(I),onChange:E=>W(E.currentTarget.value),onBlur:()=>f(_,"url",v),"aria-required":j||void 0,error:P},_);case"number":{const E=od[_];return co.has(_)||id.has(_)?c.jsx(Uo,{id:_,label:N,hint:w,value:po(I),isCurrency:co.has(_),maxDigits:E,onChange:T=>W(so(T.currentTarget.value)),onBlur:()=>f(_,"number",v),"aria-required":j||void 0,error:P},_):c.jsx(qt,{id:_,label:N,hint:w,value:po(I),inputMode:"numeric",pattern:"[0-9]*",onKeyDown:T=>{if(nd(T.key)){T.preventDefault();return}E!==void 0&&/^\d$/.test(T.key)&&String(T.currentTarget.value).replace(/\D/g,"").length>=E&&T.preventDefault()},onChange:T=>{let O=T.currentTarget.value;E!==void 0&&(O=O.slice(0,E)),W(so(O))},onBlur:()=>f(_,"number",v),"aria-required":j||void 0,error:P},_)}case"textarea":return c.jsx(Yo,{id:_,label:N,value:Ne(I),onChange:E=>W(E.currentTarget.value),onBlur:()=>f(_,"textarea",v),"aria-required":j||void 0,error:P,rows:4},_);case"date":{const{min:E,max:T}=sd(_);return c.jsx(Ko,{id:_,label:N,hint:w,value:Ne(I),min:E,max:T,onChange:O=>{const te=O.currentTarget.value;W(te),!Ze(te,"date")&&!fr(_,te)&&z(_,Z(v,_,te))},onBlur:()=>f(_,"date",v),"aria-required":j||void 0,error:P,autoComplete:Ht[_]},_)}case"checkbox":{if(C.options){const E=Array.isArray(I)?I:[];return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"form-label",children:[N,j&&c.jsx("span",{className:"text-red-600 ml-1",children:"*"})]}),c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:C.options.map(T=>{const O=`${_}-${mr(T)}`,te=E.includes(T);return c.jsx(xr,{id:O,label:T,checked:te,onChange:B=>{const q=new Set(E);B.currentTarget.checked?q.add(T):q.delete(T),W(Array.from(q))},"aria-required":j||void 0},O)})}),P&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:P})]},_)}return c.jsx(xr,{id:_,label:j?`${N} *`:N,checked:!!I,onChange:E=>W(E.currentTarget.checked),"aria-required":j||void 0},_)}case"radio":{if(Ut(C))return null;const E=C.options??[],T=v&&v.length>0?`${_}__${v.join("__")}`:_;return c.jsx(Jo,{legend:N,legendClassName:j?"legend-required":void 0,children:E.map(O=>c.jsx(qo,{name:T,value:O,checked:I===O,onChange:()=>{W(O),z(_,Z(v,_,O))},children:ao[_]?.[O]??O},`${_}-${mr(O)}`))},_)}case"select":{let E=C.options??[];_==="quote_vehicle_id"&&(E=r?.vehicles__items?.map(B=>B.vin)??[]);let T=!1,O;if(_==="make"||_==="model"||_==="body_style"){const B=v?v.join("-"):"_root",q=Ce(g,v,"year"),x=typeof q=="number"?q:Number(q);if(_==="make"){const he=`${B}:makes`;if(!x||!Number.isFinite(x))T=!0,O="Select a year first";else{const re=ie(B,{year:x});re&&re.length>0?E=re:L[he]?(T=!0,O="Loading makes..."):E=[...Bu]}}else if(_==="model"){const he=`${B}:models`,re=String(Ce(g,v,"make")??"");if(!re)T=!0,O="Select a make first";else if(x&&Number.isFinite(x)){const le=ie(B,{year:x,make:re});le&&le.length>0?E=le:L[he]?(T=!0,O="Loading models..."):E=[...ed]}typeof I=="string"&&I&&!E.includes(I)&&(E=[I,...E])}else{const he=`${B}:bodyStyles`,re=String(Ce(g,v,"make")??""),le=String(Ce(g,v,"model")??"");if(!le)T=!0,O="Select a model first";else if(x&&Number.isFinite(x)&&re){const ce=ie(B,{year:x,make:re,model:le});ce&&ce.length>0?E=ce:L[he]?(T=!0,O="Loading body styles..."):E=[...td]}typeof I=="string"&&I&&!E.includes(I)&&(E=[I,...E])}}if(_==="occupation"||_==="co_applicant_occupation"){const B=_==="co_applicant_occupation"?"co_applicant_employment_industry":void 0,q=B?void 0:Ce(g,v,"industry"),x=Ce(g,v,B??"employment_industry"),re=String(Pt(q??x)??"").trim();E=[...qn[re]??rd],typeof I=="string"&&I&&!E.includes(I)&&(E=[I,...E])}const te=dd(v,_);return c.jsx(st,{id:te,label:O?`${N} — ${O}`:N,"aria-required":j||void 0,error:P,disabled:T,value:fd(I),onChange:B=>{const q=B.currentTarget.value;if(_!=="year"&&_!=="make"&&_!=="model"&&_!=="industry"&&_!=="employment_industry"&&_!=="co_applicant_employment_industry"){W(q),z(_,Z(v,_,q));return}let x=we(g,v,_,q);if(_==="year")x=we(x,v,"make",""),x=we(x,v,"model",""),x=we(x,v,"body_style","");else if(_==="make")x=we(x,v,"model",""),x=we(x,v,"body_style","");else if(_==="model")x=we(x,v,"body_style","");else if(_==="industry"||_==="employment_industry")x=we(x,v,"occupation","");else if(_==="co_applicant_employment_industry"){const re=String(Pt(q)??"").trim(),le=qn[re]??[],ce=le.find(oe=>oe===re)??le[0]??"";x=we(x,v,"co_applicant_occupation",ce??"")}r&&n?n(x):b(x),S(x);const he=v?pt(x,v)??{}:x;z(_,{...he,[_]:q})},placeholder:O??"Select an option",options:E.map(B=>({value:B,label:ao[_]?.[B]??Xu[B]??B}))},te)}case"address":return c.jsx(ti,{id:_,label:N,value:Ne(I),onChange:(E,T)=>{let O=we(g,v,_,E);const te=T?.state??(typeof E=="string"?E.match(/,\s*([A-Z]{2})\s+\d{5}\b/)?.[1]:void 0);if(te){const B=v?[...v,"state"]:["state"];O=$e(O,B,te)}r&&n?n(O):b(O),S(O)},onBlur:()=>f(_,"address",v),required:j,"aria-required":j||void 0,error:P},_);default:return null}}function M(C,v){return C.map((_,N)=>{const w=String(_.key);if(!$t(_,g,l)||!Cr(_,g,v)||!wr(_,g)||!Ft(_,g,a))return null;if(Er(w,_,g,a)){const T=l.currentCarrierKey?g[l.currentCarrierKey]:void 0;if(!(T&&T!=="NoPriorInsurance"&&ot(g,l)&&Ar.has(w)))return null}const I=A(_,v),j=_.conditionals??[];if(!j.length)return a==="BundlePolicy"&&w==="policy_bi"?c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mt-6 mb-3",children:"Vehicle Coverage Information"}),I]},`wrap-${w}-${N}`):c.jsx("div",{children:I},`wrap-${w}-${N}`);const P=uo(_,Ce(g,v,w)),W=j.filter(T=>mt(P,T.conditionalType,T.conditionalValue)),E=W.length>1&&!W.some(T=>T.conditionalQuestionsAllowMultiple)?W.slice(0,1):W;return c.jsxs("div",{children:[I,E.map((T,O)=>{const te=T.conditionalQuestions??[];if(!te.length)return null;if(!T.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:M(te,v)},`branch-${w}-${O}`);const B=Zt(w),q=pt(g,[...v??[],B])??[],x=Math.max(1,q.length||1),he=()=>{const ce=$e(g,[...v??[],B,q.length],{});r&&n?n(ce):b(ce),S(ce)},re=()=>{const ce=q.slice(0,Math.max(0,q.length-1)),oe=$e(g,[...v??[],B],ce);r&&n?n(oe):b(oe),S(oe)},le=`${w}__c${O}`;return c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),c.jsxs("div",{className:"space-x-2",children:[c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:he,children:"Add another"}),x>1&&c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:re,children:"Remove last"})]})]}),Array.from({length:x}).map((ce,oe)=>{const ne=[...v??[],B,oe],be=`${le}__i${oe}`,ue=q[oe]??{},ve=w==="drivers",Mr=ve?`Driver #${oe+1}`:w==="vehicles"?`Vehicle #${oe+1}`:w==="home_losses"||w==="losses"?`Loss #${oe+1}`:`Entry #${oe+1}`,Lr=ve&&typeof ue.ssn_display=="string"&&ue.ssn_display?` — ${ue.ssn_display}`:"";return c.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[c.jsxs("div",{className:"text-sm font-semibold mb-2",children:[Mr,Lr]}),te.map(Me=>{const Dr=String(Me.key);if(!$t(Me,g,l)||!Cr(Me,g,ne)||!wr(Me,g)||!Ft(Me,g,a))return null;if(Er(Dr,Me,g,a)){const yt=l.currentCarrierKey?g[l.currentCarrierKey]:void 0;if(!(yt&&yt!=="NoPriorInsurance"&&ot(g,l)&&Ar.has(Dr)))return null}return c.jsxs("div",{className:"mt-3",children:[A(Me,ne),(()=>{const yt=Me.conditionals??[];if(!yt.length)return null;const zo=Ce(g,ne,Me.key),jt=yt.filter(qe=>mt(zo,qe.conditionalType,qe.conditionalValue));return(jt.length>1&&!jt.some(qe=>qe.conditionalQuestionsAllowMultiple)?jt.slice(0,1):jt).map((qe,Pr)=>{const Fr=qe.conditionalQuestions??[];if(!Fr.length)return null;if(!qe.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:M(Fr,ne)},`nested-${be}-${Pr}`);const Vt=Zt(Me.key),Yt=pt(g,[...ne,Vt])??[],Ro=Math.max(1,Yt.length||1),Xd=()=>{const at=$e(g,[...ne,Vt,Yt.length],{});r&&n?n(at):b(at),S(at)},e_=()=>{const at=Yt.slice(0,Math.max(0,Yt.length-1)),Je=$e(g,[...ne,Vt],at);r&&n?n(Je):b(Je),S(Je)};return c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),c.jsxs("div",{className:"space-x-2",children:[c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Xd,children:"Add another"}),Ro>1&&c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:e_,children:"Remove last"})]})]}),Array.from({length:Ro}).map((at,Je)=>{const t_=[...ne,Vt,Je];return c.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[c.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",Je+1]}),M(Fr,t_)]},`nested-item-${be}-${Pr}-${Je}`)})]},`nested-repeat-${be}-${Pr}`)})})()]},`${be}-${Dr}`)})]},`group-${be}`)})]},`branch-${w}-${O}`)})]},`wrap-${w}-${N}`)})}const k=p.useMemo(()=>{const C=[],v=(_,N)=>{_.forEach(w=>{if(!$t(w,g,l)||!Cr(w,g,N)||!wr(w,g)||!Ft(w,g,a))return;const I=String(w.key);if(Er(I,w,g,a)){const T=l.currentCarrierKey?g[l.currentCarrierKey]:void 0;if(!(T&&T!=="NoPriorInsurance"&&ot(g,l)&&Ar.has(I)))return}Ut(w)||C.push(w);const j=w.conditionals??[];if(!j.length)return;const P=uo(w,Ce(g,N,I)),W=j.filter(T=>mt(P,T.conditionalType,T.conditionalValue));(W.length>1&&!W.some(T=>T.conditionalQuestionsAllowMultiple)?W.slice(0,1):W).forEach(T=>{const O=T.conditionalQuestions??[];O.length&&(T.conditionalQuestionsAllowMultiple||v(O,N))})})};return v(s),C},[s,g,l,a]);function ee(C){C.preventDefault();const v=_t(g,l),_=k.map(w=>Bt(w,l)?{...w,required:v}:w),N=Dt(_,g);if(R(N),Object.keys(N).length>0){const w=k.findIndex(I=>N[I.key]);w>=0&&document.getElementById(k[w].key)?.focus();return}o(g)}return c.jsx("form",{className:"space-y-6 px-1",onSubmit:ee,noValidate:!0,children:M(s)})}const pd="GTM-NK8LGHTQ";function hd(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function Ye(e,t={}){hd().push({event:e,credifyWidget:{...t,containerId:pd}})}function gd(){Ye("credify_widget_opened")}function ho(){Ye("credify_widget_closed")}function yd(e){Ye("credify_widget_stage_viewed",e)}function go(e){Ye("credify_widget_stage_completed",e)}function bd(){Ye("credify_widget_flow_completed")}function vd(e){Ye("credify_widget_rates_viewed",e??{})}function Sd(){Ye("credify_widget_rates_back")}function Ad(e,t){const r=String(e.key??"");if(!Rt.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 Cd(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 wd(e,t){const r=String(e??""),n=Rt.has(r)||r==="has_health_insurance_auto_accident"||r==="is_corporation";return Cd(t)&&n}const yo=new Set(["Disabled","Retired","Unemployed","Other"]);function Ed(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!yo.has(i)}function Td(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!yo.has(i)}function bo(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 vo(e,t){return bo(e)?"Yes":t}function So(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 Co(e,t){const r=So(e),n=So(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 Nd(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function wo(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=Co(e,r);return n!=null&&n<0}case"greaterThan":{const n=Co(e,r);return n!=null&&n>0}case"contains":return Nd(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 kd=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]);function Eo(e,t,r){const n=Xt([...e]),o=yr(n),i=[],a=s=>{s.forEach(l=>{if(!$t(l,t,o)||!Ed(l,t)||!Ad(l,t)||!Ft(l,t,r))return;const u=String(l.key);if(pr(u,r)&&!wd(u,t)){const S=o.currentCarrierKey?t[o.currentCarrierKey]:void 0;if(!(S&&S!=="NoPriorInsurance"&&ot(t,o)&&kd.has(u)))return}bo(l)||i.push(l);const d=vo(l,t[u]),m=l.conditionals??[];if(!m.length)return;const b=m.filter(S=>wo(d,S.conditionalType,S.conditionalValue));(b.length>1&&!b.some(S=>S.conditionalQuestionsAllowMultiple)?b.slice(0,1):b).forEach(S=>{const g=S.conditionalQuestions??[];g.length&&(S.conditionalQuestionsAllowMultiple||a(g))})})};return a(n),i}const To="__items",Tr=e=>`${e}${To}`;function Od(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 Nr(e,t,r=[],n=void 0){for(const o of e){const i=String(o.key),a=vo(o,t[i]),s=o.conditionals??[];if(!s.length)continue;const l=s.filter(d=>wo(a,d.conditionalType,d.conditionalValue)),u=l.length>1&&!l.some(d=>d.conditionalQuestionsAllowMultiple)?l.slice(0,1):l;for(const d of u){const m=d.conditionalQuestions??[];if(!m.length)continue;if(!d.conditionalQuestionsAllowMultiple){if(Nr(m,t,r,n))return!0;continue}const b=t[Tr(i)]??[];if(b.length===0)return!0;for(const[h,S]of b.entries()){const g=[...r,Tr(i),h],Y=m.filter(K=>!(Od(K,g)||pr(String(K.key),n)||!Td(K,S))),R=Dt(Y,S);if(Object.values(R).some(Boolean)||Nr(m,S,g,n))return!0}}}return!1}function No(e,t,r){return Nr(e,t,[],r)}function ko(e){const t=e.vehicles__items??[];if(!Array.isArray(t)||t.length===0)return!1;for(const r of t)if(Ze(r.vehicle_comp_deductible,"select")||Ze(r.vehicle_coll_deductible,"select")||Ze(r.vehicle_towing_and_labor,"select")||Ze(r.vehicle_transportation_expense,"select"))return!0;return!1}function Id({stages:e,onStageComplete:t,onComplete:r,initialValues:n,initialActive:o,quoteId:i}){const[a,s]=p.useState(o??0),[l,u]=p.useState(n??{}),[d,m]=p.useState({}),[b,h]=p.useState(!1),[S,g]=p.useState(!1),[Y,R]=p.useState(null),K=p.useRef([]),V=p.useRef(e),G=Array.isArray(e)&&e.length>0,L=G?Math.min(a,e.length-1):0,X=G?e[L]:null,H=X?.key??null;p.useEffect(()=>{o!==void 0&&s(o)},[o]),V.current=e;const ae=p.useMemo(()=>!!(L>=e.length-1||e.slice(L+1).every(A=>A.key==="AutoPolicy")&&(l.drivers__items??[]).length<=1),[L,e,l]);p.useEffect(()=>{G&&a>=e.length&&s(e.length-1)},[a,e.length,G]),p.useEffect(()=>{const f=K.current[L];f&&f.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[L]),p.useEffect(()=>{n!==void 0&&u(n)},[n]),p.useEffect(()=>{if(!X||!H){h(!1),R(null);return}if(d[H]){h(!1),R(null);return}let f=!1;return h(!0),R(null),Promise.resolve(X.loadQuestions()).then(A=>{if(!f){if(!Array.isArray(A))throw new Error(`loadQuestions("${H}") did not return an array`);m(M=>({...M,[H]:A}))}}).catch(A=>{f||R(`Failed to load stage "${X?.title??""}": ${A?.message??"Unknown error"}`)}).finally(()=>{f||h(!1)}),()=>{f=!0}},[X,H,d]);const J=H?d[H]:void 0,F=p.useMemo(()=>yr(Xt(J??[])),[J]);p.useEffect(()=>{X&&H&&J&&yd({stageKey:H,stageTitle:X.title??H,stepIndex:a+1,totalSteps:e.length})},[H,a,e.length,X,J]);const $=p.useMemo(()=>{if(!J)return{};const f={};(k=>{const ee=[],C=v=>{v.forEach((_,N)=>{const w=Lt(_,N);ee.push(w);const I=Tr(w);ee.push(I),(_.conditionals??[]).forEach(P=>{const W=P.conditionalQuestions??[];W.length>0&&C(W)})})};return C(k),ee})(J).forEach(k=>{k in l&&(f[k]=l[k])});for(const k of["state","State","address","product"])k in l&&(f[k]=l[k]);for(const[k,ee]of Object.entries(l))k.endsWith(To)&&!(k in f)&&(f[k]=ee);return f},[J,l]),Q=f=>{u(A=>({...A,...f}))},ie=()=>{s(f=>f>0?f-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},Z=async()=>{if(!J||!X||b||Y||S)return;const f=Eo(J,$,H??void 0),A=_t(l,F),M=f.map(P=>Bt(P,F)?{...P,required:A}:P),k=Dt(M,$),ee=new Set(M.map((P,W)=>Lt(P,W))),C=Object.entries(k).some(([P,W])=>W&&ee.has(P)),v=No(J,l,H??void 0),N=f.some(P=>String(P.key??"")==="vehicle_policy_selections")?ko(l):!1,w=l.driver_vehicle_assignments,I=l.drivers__items??[];let j=!1;if(w&&I.length>=2){const P=l.vehicles__items??[];for(let W=0;W<P.length;W++){const E=w[`v${W}`];if(!E)continue;const T=I.map((B,q)=>E[`d${q}`]??0),O=T.filter(B=>B>0);if(O.length>=2&&O.every(B=>B===50)){j=!0;break}const te=T.reduce((B,q)=>B+q,0);if(te>0&&te!==100){j=!0;break}}}if(!(C||v||N||j)){g(!0);try{const P=ae,{success:W,error:E}=P?await r(l,H??""):await t($,H??"");if(!W){R(E??"An error occurred");return}if(!P){const T=V.current,O=T.findIndex(B=>B.key===H),te=O>=0?Math.min(O+1,T.length-1):Math.min(a+1,T.length-1);s(te)}}finally{g(!1)}}},z=p.useMemo(()=>{if(!J||b||Y||S)return!0;const f=Eo(J,$,H??void 0),A=_t(l,F),M=f.map(P=>Bt(P,F)?{...P,required:A}:P),k=Dt(M,$),ee=new Set(M.map((P,W)=>Lt(P,W))),C=Object.entries(k).some(([P,W])=>W&&ee.has(P)),v=No(J,l,H??void 0),N=f.some(P=>String(P.key??"")==="vehicle_policy_selections")?ko(l):!1,w=l.driver_vehicle_assignments,I=l.drivers__items??[];let j=!1;if(w&&I.length>=2){const P=l.vehicles__items??[];for(let W=0;W<P.length;W++){const E=w[`v${W}`];if(!E)continue;const T=I.map((B,q)=>E[`d${q}`]??0),O=T.filter(B=>B>0);if(O.length>=2&&O.every(B=>B===50)){j=!0;break}const te=T.reduce((B,q)=>B+q,0);if(te>0&&te!==100){j=!0;break}}}return C||v||N||j},[J,$,l,b,Y,S,F,H]);return G?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"form-wizard-steps-header flex items-center justify-between gap-4",children:[c.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((f,A)=>[c.jsx("li",{ref:M=>{K.current[A]=M},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${A<L?"bg-blue-600 text-white border-blue-600":A===L?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:f.title},f.key??`stage-${A}`),...A<e.length-1?[c.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${f.key??A}`)]:[]])}),c.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[L+1," / ",e.length]})]}),c.jsxs("div",{children:[b&&c.jsx("div",{className:"text-slate-500",children:"Loading…"}),X&&c.jsx(md,{questions:J??[],controlledValues:$,onChangeValues:Q,onSubmit:()=>Z(),quoteId:i,widgetStageKey:H??void 0},X.key)]}),!b&&Y&&c.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[c.jsx("div",{children:Y}),X&&c.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{m(f=>{if(!H)return f;const A={...f};return delete A[H],A})},children:"Retry"})]}),c.jsxs("div",{className:L>0?"grid grid-cols-2 gap-3":"",children:[L>0&&c.jsx("button",{type:"button",onClick:ie,disabled:b,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Back"}),c.jsxs("button",{type:"button","data-widget-ctrl":"next",onClick:Z,disabled:z,className:["form-wizard-next-btn",L>0?"":"w-full","h-12 rounded-full text-white transition","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center justify-center gap-2",z?"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:[S&&c.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:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.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"})]}),ae?"Finish":"Next"]})]})]}):c.jsx("div",{className:"text-slate-600",children:"Loading..."})}const Md=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),Oo={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},Io=["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",Mo="w-full max-w-md min-w-0 sm:max-w-[calc((100%-1rem)/2)]",Ld="rounded-2xl border-2 border-transparent p-4";function Lo({onBack:e}){const t=()=>{Sd(),e?.()};return c.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 We({rate:e,status:t,onRequestBind:r,disabled:n,featured:o=!1,showLobLabel:i=!0,showFeaturedBadge:a,className:s}){const l=Number.isFinite(e.term_months)&&e.term_months>0?e.term_months:1,d=(e.monthly_premium_cents!=null?e.monthly_premium_cents:Math.round((e.premium_cents||0)/l))/100,m=Md.format(d),b=t==="loading",h=t==="success",S=!!n||b||h,g=!!(e.effective_date&&e.policy_end_date),Y=e.lob?Oo[e.lob]||e.lob:null,R=a??o;return c.jsxs("div",{className:`flex w-full flex-col rounded-xl bg-white p-6 shadow-sm transition hover:shadow-md ${o?"border-2 border-blue-300 shadow-blue-100/60 ring-1 ring-blue-100":"border border-slate-200"}${s?` ${s}`:""}`,children:[i&&Y&&c.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-slate-500",children:Y}),R&&c.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"}),c.jsxs("div",{className:"mb-4 flex flex-col items-start gap-2",children:[e.carrier_logo_base64?c.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"}):c.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()}),c.jsx("h4",{className:"w-full break-words text-left font-semibold text-slate-900",children:e.carrier_name})]}),c.jsx("div",{className:"mb-2",children:c.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:[m,c.jsx("span",{className:"ml-1 text-sm font-medium text-slate-500",children:"/month"})]})}),g&&c.jsx("div",{className:"mb-2",children:c.jsxs("p",{className:"text-xs text-slate-500",children:["Effective ",e.effective_date," - ",e.policy_end_date]})}),e.carrier_quote_id&&c.jsx("div",{className:"mb-4",children:c.jsxs("p",{className:"text-xs text-slate-400",children:["Quote ID: ",e.carrier_quote_id]})}),c.jsxs("div",{className:"mt-auto pt-4",children:[c.jsx("button",{type:"button",onClick:r,disabled: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 ${h?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:b?"Requesting…":h?"Requested":"Request Bind"}),t==="error"&&c.jsx("p",{className:"mt-2 text-xs text-red-600",children:"Something went wrong. Please try again."}),t==="success"&&c.jsx("p",{className:"mt-2 text-xs text-emerald-600",children:"We received your bind request."})]})]})}function Dd({rates:e,onBack:t,isBundleFlow:r=!1}){const n=Array.isArray(e)?e:[],o=n.length>0,[i,a]=p.useState({}),[s,l]=p.useState("admitted"),[u,d]=p.useState(!1),m=p.useMemo(()=>n.some(f=>f.lob==="PersonalAuto"),[n]),b=p.useMemo(()=>n.some(f=>f.lob==="PersonalHome"),[n]),h=p.useMemo(()=>{if(!r)return[];const f=[];return m&&f.push("PersonalAuto"),b&&f.push("PersonalHome"),f},[r,m,b]),S=p.useMemo(()=>{const f=new Set;for(const A of n){const M=A.lob??null;M&&i[A.quote_rate_id]==="success"&&f.add(M)}return f},[n,i]),g=p.useMemo(()=>Object.values(i).some(f=>f==="success"),[i]),Y=p.useMemo(()=>u?!0:!r||h.length===0?g:h.every(f=>S.has(f)),[u,r,g,h,S]),R=p.useMemo(()=>o?n.filter(f=>(f.admitted_status??"admitted")==="admitted"):[],[n,o]),K=p.useMemo(()=>o?n.filter(f=>f.admitted_status==="non_admitted"):[],[n,o]),V=R.length,G=K.length,L=V+G>0;p.useEffect(()=>{L&&s==="admitted"&&V===0&&G>0&&l("non_admitted")},[s,V,G,L]);const X=p.useMemo(()=>L?s==="admitted"?R:K:[],[L,s,R,K]);p.useEffect(()=>{Sr()},[]),p.useEffect(()=>{!Y||u||(Uu(),no(),d(!0))},[Y,u]);const H=p.useMemo(()=>{if(X.length===0)return[];if(!X.some(k=>k.lob))return[{lob:null,title:"Rates",rates:[...X].sort((ee,C)=>{const v=Number.isFinite(ee.term_months)&&ee.term_months>0?ee.term_months:1,_=Number.isFinite(C.term_months)&&C.term_months>0?C.term_months:1,N=ee.monthly_premium_cents??Math.round((ee.premium_cents||0)/v),w=C.monthly_premium_cents??Math.round((C.premium_cents||0)/_);return N-w})}];const A=new Map;for(const k of X){const ee=k.lob||"_other",C=A.get(ee);C?C.push(k):A.set(ee,[k])}return[...A.entries()].sort(([k],[ee])=>{const C=Io.indexOf(k),v=Io.indexOf(ee);return(C===-1?999:C)-(v===-1?999:v)}).map(([k,ee])=>({lob:k,title:Oo[k]??k,rates:[...ee].sort((C,v)=>{const _=Number.isFinite(C.term_months)&&C.term_months>0?C.term_months:1,N=Number.isFinite(v.term_months)&&v.term_months>0?v.term_months:1,w=C.monthly_premium_cents??Math.round((C.premium_cents||0)/_),I=v.monthly_premium_cents??Math.round((v.premium_cents||0)/N);return w-I})}))},[X]),ae=p.useMemo(()=>{if(!r)return[];const f=n.some(k=>k.lob==="PersonalAuto"),A=n.some(k=>k.lob==="PersonalHome"),M=[];return f||M.push("Sorry, no rates found for Personal Auto."),A||M.push("Sorry, no rates found for Homeowners."),M},[r,n]);if(!L)return c.jsxs("section",{className:"mt-8",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),c.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Sorry, no rates are available at this time."}),t&&c.jsx(Lo,{onBack:t})]});const J=async f=>{a(A=>({...A,[f]:"loading"}));try{if(Sr(),!xt())throw new Error("Authentication required. Please verify your phone number first.");if(!((await Ju(f))?.success!==!1))throw new Error("Request failed");a(ee=>({...ee,[f]:"success"}))}catch{a(A=>({...A,[f]:"error"}))}},F=H.find(f=>f.lob==="PersonalAuto"),$=H.find(f=>f.lob==="PersonalHome"),Q=!!(F?.rates.length&&$?.rates.length),ie=H.filter(f=>!Q||f.lob!=="PersonalAuto"&&f.lob!=="PersonalHome"),Z=Q&&F&&$?[{rate:F.rates[0]},{rate:$.rates[0]}]:[],z=Z.length===1;return c.jsxs("section",{className:"mt-8",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),ae.length>0&&c.jsx("div",{className:"mt-3 space-y-1",children:ae.map(f=>c.jsx("p",{className:"text-sm text-slate-600",children:f},f))}),c.jsx("div",{className:"mt-4 border-b border-slate-200",children:c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsxs("button",{type:"button",onClick:()=>l("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 (",V,")"]}),c.jsxs("button",{type:"button",onClick:()=>l("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 (",G,")"]})]})}),X.length===0&&c.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."}),X.length>0&&Q&&F&&$&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:z?"mt-6 flex justify-center":"mt-6",children:c.jsxs("div",{className:z?`w-full max-w-md ${ht}`:ht,children:[c.jsx("div",{className:gt,children:"Featured Bundle"}),c.jsx("div",{className:z?"grid justify-items-center gap-4":"grid gap-4 sm:grid-cols-2",children:Z.map(({rate:f})=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(We,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:Y||(r?!!(f.lob&&h.includes(f.lob)&&S.has(f.lob)):g),onRequestBind:()=>J(f.quote_rate_id)})},f.quote_rate_id))})]})}),F.rates.length>1&&c.jsxs("div",{className:"mt-6",children:[c.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",F.title," Options"]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:F.rates.slice(1).map(f=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(We,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:Y||(r?!!(f.lob&&h.includes(f.lob)&&S.has(f.lob)):g),onRequestBind:()=>J(f.quote_rate_id)})},f.quote_rate_id))})]}),$.rates.length>1&&c.jsxs("div",{className:"mt-6",children:[c.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",$.title," Options"]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:$.rates.slice(1).map(f=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(We,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:Y||(r?!!(f.lob&&h.includes(f.lob)&&S.has(f.lob)):g),onRequestBind:()=>J(f.quote_rate_id)})},f.quote_rate_id))})]})]}),X.length>0&&ie.map(f=>{const[A,...M]=f.rates;return c.jsxs("div",{className:"mt-6",children:[c.jsx("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:f.title}),M.length===0?c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:c.jsx("div",{className:"col-span-full flex justify-center",children:c.jsxs("div",{className:`${Mo} ${ht}`,children:[c.jsx("div",{className:gt,children:"Featured"}),c.jsx(We,{rate:A,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[A.quote_rate_id]??"idle",disabled:Y||(r?!!(A.lob&&h.includes(A.lob)&&S.has(A.lob)):g),onRequestBind:()=>J(A.quote_rate_id)})]})})}):M.length===1?c.jsxs("div",{className:"grid items-stretch gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${ht}`,children:[c.jsx("div",{className:gt,children:"Featured"}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:c.jsx(We,{rate:A,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[A.quote_rate_id]??"idle",onRequestBind:()=>J(A.quote_rate_id),disabled:Y||(r?!!(A.lob&&h.includes(A.lob)&&S.has(A.lob)):g),className:"h-full min-h-0"})})]}),c.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${Ld}`,children:[c.jsx("div",{className:`${gt} pointer-events-none invisible shrink-0`,"aria-hidden":!0,children:"Featured"}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:c.jsx(We,{rate:M[0],featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[M[0].quote_rate_id]??"idle",onRequestBind:()=>J(M[0].quote_rate_id),disabled:Y||(r?!!(M[0].lob&&h.includes(M[0].lob)&&S.has(M[0].lob)):g),className:"h-full min-h-0"})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:c.jsx("div",{className:"col-span-full flex justify-center",children:c.jsxs("div",{className:`${Mo} ${ht}`,children:[c.jsx("div",{className:gt,children:"Featured"}),c.jsx(We,{rate:A,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[A.quote_rate_id]??"idle",disabled:Y||(r?!!(A.lob&&h.includes(A.lob)&&S.has(A.lob)):g),onRequestBind:()=>J(A.quote_rate_id)})]})})}),c.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:M.map(k=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(We,{rate:k,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[k.quote_rate_id]??"idle",disabled:Y||(r?!!(k.lob&&h.includes(k.lob)&&S.has(k.lob)):g),onRequestBind:()=>J(k.quote_rate_id)})},k.quote_rate_id))})]})]},f.lob??"all")}),t&&c.jsx(Lo,{onBack:t})]})}const kr=["Validating your details...","Checking underwriting rules...","Applying eligible discounts...","Reviewing your risk profile...","Calculating premium...","Check complete"],Do={Auto:{label:"Auto Policy",icon:"🚗",accent:"#0369A1"},Home:{label:"Home Policy",icon:"🏠",accent:"#059669"},Bundle:{label:"Home + Auto Bundle",icon:"🔗",accent:"#7C3AED"}},Pd=8e3;function Fd({progress:e,color:t,size:r=80}){const n=(r-10)/2,o=2*Math.PI*n,i=o-e/100*o;return c.jsxs("svg",{width:r,height:r,style:{transform:"rotate(-90deg)"},children:[c.jsx("circle",{cx:r/2,cy:r/2,r:n,fill:"none",stroke:"#F1F5F9",strokeWidth:6}),c.jsx("circle",{cx:r/2,cy:r/2,r:n,fill:"none",stroke:t,strokeWidth:6,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:i,style:{transition:"stroke-dashoffset 0.2s linear"}})]})}function $d({providers:e=[],totalTime:t=6e4,flow:r="Auto",isComplete:n=!1,onComplete:o}){const i=Do[r]??Do.Auto,a=e.length>0?Pd:t,[s,l]=p.useState(0),[u,d]=p.useState(0),[m,b]=p.useState(0),[h,S]=p.useState(0),[g,Y]=p.useState(!0),R=p.useRef(n),K=p.useRef(o),V=p.useRef(s),G=p.useRef(e.length),L=p.useRef(!1),X=p.useRef(!1);p.useEffect(()=>{R.current=n,n&&e.length===0&&!L.current&&(L.current=!0,K.current?.())},[n,e.length]),p.useEffect(()=>{K.current=o},[o]),p.useEffect(()=>{V.current=s},[s]),p.useEffect(()=>{G.current=e.length,e.length>0&&(X.current=!1,l(0),d(0),b(0),S(0),Y(!0))},[e.length]),p.useEffect(()=>{if(e.length===0){R.current&&!L.current&&(L.current=!0,K.current?.());return}X.current=!1;const F=100,$=100/(a/F),Q=setInterval(()=>{b(ie=>{if(X.current||L.current)return ie;const Z=ie+$;return Z<100?Z:(X.current=!0,setTimeout(()=>{if(R.current){if(L.current)return;L.current=!0,K.current?.();return}const f=V.current===G.current-1;Y(!1),setTimeout(()=>{f?(l(0),d(A=>A+1)):l(A=>A+1),b(0),S(0),Y(!0)},300)},400),100)})},F);return()=>clearInterval(Q)},[s,a,e.length]),p.useEffect(()=>{if(e.length===0)return;const F=Math.floor(a/kr.length),$=setInterval(()=>S(Q=>Math.min(Q+1,kr.length-1)),F);return()=>clearInterval($)},[s,a,e.length]);const H=e.length===0,ae=H?null:e[Math.min(s,e.length-1)],J=u>0;return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
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 Tn(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 l=s.def??s.schema,u={...l},d=s.ref;if(s.ref=null,d){n(d);const v=e.seen.get(d),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(y)):Object.assign(l,y),Object.assign(l,u),a._zod.parent===d)for(const g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(y.$ref&&v.def)for(const g in l)g==="$ref"||g==="allOf"||g in v.def&&JSON.stringify(l[g])===JSON.stringify(v.def[g])&&delete l[g]}const p=a._zod.parent;if(p&&p!==d){n(p);const v=e.seen.get(p);if(v?.schema.$ref&&(l.$ref=v.schema.$ref,v.def))for(const y in l)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(l[y])===JSON.stringify(v.def[y])&&delete l[y]}e.override({zodSchema:a,jsonSchema:l,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:It(t,"input",e.processors),output:It(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function we(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 we(n.element,r);if(n.type==="set")return we(n.valueType,r);if(n.type==="lazy")return we(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 we(n.innerType,r);if(n.type==="intersection")return we(n.left,r)||we(n.right,r);if(n.type==="record"||n.type==="map")return we(n.keyType,r)||we(n.valueType,r);if(n.type==="pipe")return we(n.in,r)||we(n.out,r);if(n.type==="object"){for(const o in n.shape)if(we(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(we(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(we(o,r))return!0;return!!(n.rest&&we(n.rest,r))}return!1}const ec=(e,t={})=>r=>{const n=wn({...r,processors:t});return ve(e,n),En(n,e),Tn(n,e)},It=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},a=wn({...o??{},target:i,io:t,processors:r});return ve(e,a),En(a,e),Tn(a,e)},tc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rc=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=tc[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){const d=[...l];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},nc=(e,t,r,n)=>{const o=r,{minimum:i,maximum:a,format:s,multipleOf:l,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 l=="number"&&(o.multipleOf=l)},oc=(e,t,r,n)=>{r.type="boolean"},ic=(e,t,r,n)=>{r.not={}},ac=(e,t,r,n)=>{},sc=(e,t,r,n)=>{const o=e._zod.def,i=Hr(o.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},cc=(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},lc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},dc=(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=ve(i.element,t,{...n,path:[...n.path,"items"]})},_c=(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]=ve(a[u],t,{...n,path:[...n.path,"properties",u]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=ve(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},fc=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,l)=>ve(s,t,{...n,path:[...n.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},mc=(e,t,r,n)=>{const o=e._zod.def,i=ve(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=ve(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},pc=(e,t,r,n)=>{const o=e._zod.def,i=ve(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"}]},hc=(e,t,r,n)=>{const o=e._zod.def;ve(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},gc=(e,t,r,n)=>{const o=e._zod.def;ve(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},yc=(e,t,r,n)=>{const o=e._zod.def;ve(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)))},bc=(e,t,r,n)=>{const o=e._zod.def;ve(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},vc=(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;ve(i,t,n);const a=t.seen.get(e);a.ref=i},Sc=(e,t,r,n)=>{const o=e._zod.def;ve(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},Nn=(e,t,r,n)=>{const o=e._zod.def;ve(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Ac=b("ZodISODateTime",(e,t)=>{Ea.init(e,t),fe.init(e,t)});function Cc(e){return Is(Ac,e)}const wc=b("ZodISODate",(e,t)=>{Ta.init(e,t),fe.init(e,t)});function Ec(e){return Ms(wc,e)}const Tc=b("ZodISOTime",(e,t)=>{Na.init(e,t),fe.init(e,t)});function Nc(e){return Ls(Tc,e)}const kc=b("ZodISODuration",(e,t)=>{ka.init(e,t),fe.init(e,t)});function Oc(e){return Ds(kc,e)}const Pe=b("ZodError",(e,t)=>{Yr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>gi(e,r)},flatten:{value:r=>hi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,or,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,or,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ic=lr(Pe),Mc=ur(Pe),Lc=wt(Pe),Dc=Et(Pe),Pc=vi(Pe),Fc=Si(Pe),$c=Ai(Pe),Bc=Ci(Pe),xc=wi(Pe),zc=Ei(Pe),Rc=Ti(Pe),Hc=Ni(Pe),he=b("ZodType",(e,t)=>(pe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:It(e,"input"),output:It(e,"output")}}),e.toJSONSchema=ec(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(He(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)=>Ue(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Ic(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Lc(e,r,n),e.parseAsync=async(r,n)=>Mc(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Dc(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Pc(e,r,n),e.decode=(r,n)=>Fc(e,r,n),e.encodeAsync=async(r,n)=>$c(e,r,n),e.decodeAsync=async(r,n)=>Bc(e,r,n),e.safeEncode=(r,n)=>xc(e,r,n),e.safeDecode=(r,n)=>zc(e,r,n),e.safeEncodeAsync=async(r,n)=>Rc(e,r,n),e.safeDecodeAsync=async(r,n)=>Hc(e,r,n),e.refine=(r,n)=>e.check(Bl(r,n)),e.superRefine=r=>e.check(xl(r)),e.overwrite=r=>e.check(nt(r)),e.optional=()=>Fn(e),e.exactOptional=()=>wl(e),e.nullable=()=>$n(e),e.nullish=()=>Fn($n(e)),e.nonoptional=r=>Il(e,r),e.array=()=>fl(e),e.or=r=>Dn([e,r]),e.and=r=>yl(e,r),e.transform=r=>xn(e,Al(r)),e.default=r=>Nl(e,r),e.prefault=r=>Ol(e,r),e.catch=r=>Ll(e,r),e.pipe=r=>xn(e,r),e.readonly=()=>Fl(e),e.describe=r=>{const n=e.clone();return mt.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return mt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return mt.get(e);const n=e.clone();return mt.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),kn=b("_ZodString",(e,t)=>{dr.init(e,t),he.init(e,t),e._zod.processJSONSchema=(n,o,i)=>rc(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(zs(...n)),e.includes=(...n)=>e.check(Us(...n)),e.startsWith=(...n)=>e.check(Zs(...n)),e.endsWith=(...n)=>e.check(Ws(...n)),e.min=(...n)=>e.check(Ot(...n)),e.max=(...n)=>e.check(An(...n)),e.length=(...n)=>e.check(Cn(...n)),e.nonempty=(...n)=>e.check(Ot(1,...n)),e.lowercase=n=>e.check(Rs(n)),e.uppercase=n=>e.check(Hs(n)),e.trim=()=>e.check(js()),e.normalize=(...n)=>e.check(Gs(...n)),e.toLowerCase=()=>e.check(Vs()),e.toUpperCase=()=>e.check(Ys()),e.slugify=()=>e.check(Ks())}),Uc=b("ZodString",(e,t)=>{dr.init(e,t),kn.init(e,t),e.email=r=>e.check(ls(Zc,r)),e.url=r=>e.check(ms(Wc,r)),e.jwt=r=>e.check(Os(il,r)),e.emoji=r=>e.check(ps(Gc,r)),e.guid=r=>e.check(yn(On,r)),e.uuid=r=>e.check(us(Mt,r)),e.uuidv4=r=>e.check(ds(Mt,r)),e.uuidv6=r=>e.check(_s(Mt,r)),e.uuidv7=r=>e.check(fs(Mt,r)),e.nanoid=r=>e.check(hs(jc,r)),e.guid=r=>e.check(yn(On,r)),e.cuid=r=>e.check(gs(Vc,r)),e.cuid2=r=>e.check(ys(Yc,r)),e.ulid=r=>e.check(bs(Kc,r)),e.base64=r=>e.check(Ts(rl,r)),e.base64url=r=>e.check(Ns(nl,r)),e.xid=r=>e.check(vs(qc,r)),e.ksuid=r=>e.check(Ss(Jc,r)),e.ipv4=r=>e.check(As(Qc,r)),e.ipv6=r=>e.check(Cs(Xc,r)),e.cidrv4=r=>e.check(ws(el,r)),e.cidrv6=r=>e.check(Es(tl,r)),e.e164=r=>e.check(ks(ol,r)),e.datetime=r=>e.check(Cc(r)),e.date=r=>e.check(Ec(r)),e.time=r=>e.check(Nc(r)),e.duration=r=>e.check(Oc(r))});function Ze(e){return cs(Uc,e)}const fe=b("ZodStringFormat",(e,t)=>{_e.init(e,t),kn.init(e,t)}),Zc=b("ZodEmail",(e,t)=>{ha.init(e,t),fe.init(e,t)}),On=b("ZodGUID",(e,t)=>{ma.init(e,t),fe.init(e,t)}),Mt=b("ZodUUID",(e,t)=>{pa.init(e,t),fe.init(e,t)}),Wc=b("ZodURL",(e,t)=>{ga.init(e,t),fe.init(e,t)}),Gc=b("ZodEmoji",(e,t)=>{ya.init(e,t),fe.init(e,t)}),jc=b("ZodNanoID",(e,t)=>{ba.init(e,t),fe.init(e,t)}),Vc=b("ZodCUID",(e,t)=>{va.init(e,t),fe.init(e,t)}),Yc=b("ZodCUID2",(e,t)=>{Sa.init(e,t),fe.init(e,t)}),Kc=b("ZodULID",(e,t)=>{Aa.init(e,t),fe.init(e,t)}),qc=b("ZodXID",(e,t)=>{Ca.init(e,t),fe.init(e,t)}),Jc=b("ZodKSUID",(e,t)=>{wa.init(e,t),fe.init(e,t)}),Qc=b("ZodIPv4",(e,t)=>{Oa.init(e,t),fe.init(e,t)}),Xc=b("ZodIPv6",(e,t)=>{Ia.init(e,t),fe.init(e,t)}),el=b("ZodCIDRv4",(e,t)=>{Ma.init(e,t),fe.init(e,t)}),tl=b("ZodCIDRv6",(e,t)=>{La.init(e,t),fe.init(e,t)}),rl=b("ZodBase64",(e,t)=>{Da.init(e,t),fe.init(e,t)}),nl=b("ZodBase64URL",(e,t)=>{Fa.init(e,t),fe.init(e,t)}),ol=b("ZodE164",(e,t)=>{$a.init(e,t),fe.init(e,t)}),il=b("ZodJWT",(e,t)=>{xa.init(e,t),fe.init(e,t)}),In=b("ZodNumber",(e,t)=>{on.init(e,t),he.init(e,t),e._zod.processJSONSchema=(n,o,i)=>nc(e,n,o),e.gt=(n,o)=>e.check(vn(n,o)),e.gte=(n,o)=>e.check(mr(n,o)),e.min=(n,o)=>e.check(mr(n,o)),e.lt=(n,o)=>e.check(bn(n,o)),e.lte=(n,o)=>e.check(fr(n,o)),e.max=(n,o)=>e.check(fr(n,o)),e.int=n=>e.check(Mn(n)),e.safe=n=>e.check(Mn(n)),e.positive=n=>e.check(vn(0,n)),e.nonnegative=n=>e.check(mr(0,n)),e.negative=n=>e.check(bn(0,n)),e.nonpositive=n=>e.check(fr(0,n)),e.multipleOf=(n,o)=>e.check(Sn(n,o)),e.step=(n,o)=>e.check(Sn(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}),al=b("ZodNumberFormat",(e,t)=>{za.init(e,t),In.init(e,t)});function Mn(e){return Fs(al,e)}const sl=b("ZodBoolean",(e,t)=>{Ra.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oc(e,r,n)});function cl(e){return $s(sl,e)}const ll=b("ZodUnknown",(e,t)=>{Ha.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ac()});function Ln(){return Bs(ll)}const ul=b("ZodNever",(e,t)=>{Ua.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ic(e,r,n)});function dl(e){return xs(ul,e)}const _l=b("ZodArray",(e,t)=>{Za.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dc(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(Ot(r,n)),e.nonempty=r=>e.check(Ot(1,r)),e.max=(r,n)=>e.check(An(r,n)),e.length=(r,n)=>e.check(Cn(r,n)),e.unwrap=()=>e.element});function fl(e,t){return qs(_l,e,t)}const ml=b("ZodObject",(e,t)=>{Ga.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_c(e,r,n,o),se(e,"shape",()=>t.shape),e.keyof=()=>ot(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ln()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ln()}),e.strict=()=>e.clone({...e._zod.def,catchall:dl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>di(e,r),e.safeExtend=r=>_i(e,r),e.merge=r=>fi(e,r),e.pick=r=>li(e,r),e.omit=r=>ui(e,r),e.partial=(...r)=>mi(Pn,e,r[0]),e.required=(...r)=>pi(Bn,e,r[0])});function pl(e,t){const r={type:"object",shape:e??{},...F(t)};return new ml(r)}const hl=b("ZodUnion",(e,t)=>{ja.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fc(e,r,n,o),e.options=t.options});function Dn(e,t){return new hl({type:"union",options:e,...F(t)})}const gl=b("ZodIntersection",(e,t)=>{Va.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mc(e,r,n,o)});function yl(e,t){return new gl({type:"intersection",left:e,right:t})}const pr=b("ZodEnum",(e,t)=>{Ya.init(e,t),he.init(e,t),e._zod.processJSONSchema=(n,o,i)=>sc(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 pr({...t,checks:[],...F(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 pr({...t,checks:[],...F(o),entries:i})}});function ot(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new pr({type:"enum",entries:r,...F(t)})}const bl=b("ZodLiteral",(e,t)=>{Ka.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cc(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 vl(e,t){return new bl({type:"literal",values:Array.isArray(e)?e:[e],...F(t)})}const Sl=b("ZodTransform",(e,t)=>{qa.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>uc(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(ft(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(ft(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Al(e){return new Sl({type:"transform",transform:e})}const Pn=b("ZodOptional",(e,t)=>{_n.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Fn(e){return new Pn({type:"optional",innerType:e})}const Cl=b("ZodExactOptional",(e,t)=>{Ja.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function wl(e){return new Cl({type:"optional",innerType:e})}const El=b("ZodNullable",(e,t)=>{Qa.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function $n(e){return new El({type:"nullable",innerType:e})}const Tl=b("ZodDefault",(e,t)=>{Xa.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nl(e,t){return new Tl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Gr(t)}})}const kl=b("ZodPrefault",(e,t)=>{es.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ol(e,t){return new kl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Gr(t)}})}const Bn=b("ZodNonOptional",(e,t)=>{ts.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Il(e,t){return new Bn({type:"nonoptional",innerType:e,...F(t)})}const Ml=b("ZodCatch",(e,t)=>{rs.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ll(e,t){return new Ml({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Dl=b("ZodPipe",(e,t)=>{ns.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vc(e,r,n,o),e.in=t.in,e.out=t.out});function xn(e,t){return new Dl({type:"pipe",in:e,out:t})}const Pl=b("ZodReadonly",(e,t)=>{os.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Fl(e){return new Pl({type:"readonly",innerType:e})}const $l=b("ZodCustom",(e,t)=>{is.init(e,t),he.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lc(e,r)});function Bl(e,t={}){return Js($l,e,t)}function xl(e){return Qs(e)}const hr={custom:"custom"};function be(e){return Ps(In,e)}const zn=new Date().getUTCFullYear(),Lt=Ze().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),Rn=Dn([vl(""),Ze().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),zl=(e,t,r)=>be({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.`),it=(e,t)=>be({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.`),Dt=(e,t=1600)=>be({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(zn,`${e} cannot be in the future.`),Pt=e=>be({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.`),pt=(e,t,r=0)=>{const n=Math.pow(10,t)-1,o=n.toLocaleString("en-US"),i=r.toLocaleString("en-US");return be({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.`)},Rl={email:Ze().trim().min(1,"Required").email("Please enter a valid email address."),phone:Ze().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:Ze().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:Ze().trim().min(1,"Required").regex(/^\d{6}$/,"Please enter the 6-digit code."),first_name:Lt,last_name:Lt,middle_name:Rn,co_applicant_first_name:Lt,co_applicant_last_name:Lt,co_applicant_middle_name:Rn,year_built:Dt("Year built",1800),year_roof_updated:be({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:Dt("Heating update year"),plumbing_update_year:Dt("Plumbing update year"),electrical_update_year:Dt("Electrical update year"),total_area_sq_ft:zl("Square footage",1,999999),sale_price_cents:be({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:Pt("Number of years with your prior carrier"),home_continuous_coverage_years:Pt("How long you have had continuous home coverage"),household_size:be({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:be({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:pt("Replacement cost",9,1),other_structures_coverage:pt("Other structures",9),personal_property_coverage:pt("Personal property",7),loss_of_use_coverage:pt("Loss of use coverage",8),years_at_address:be({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:be({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:be({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:be({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:be({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:be({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:be({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:pt("Amount paid",7),license_number:Ze().trim().min(1,"Required").max(20,"License number must be 20 characters or fewer.").regex(/^[A-Z0-9]+$/i,"License number must contain only letters and numbers."),vin:Ze().superRefine((e,t)=>{if(typeof e!="string"||e.trim()==="")return;if(/\s/.test(e)){t.addIssue({code:hr.custom,message:"VIN cannot contain spaces."});return}const r=e.trim();/^[A-HJ-NPR-Z0-9]{17}$/i.test(r)||t.addIssue({code:hr.custom,message:"VIN must be exactly 17 letters and numbers (excluding I, O, and Q)."})}),annual_mileage:be({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:be({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:it("Modifications value",9999999),cost_new_value_cents:it("Cost new value",9999999),stated_value_amount_cents:it("Stated Value Amount",9999999),property_damage_amount_paid_cents:it("Property damage amount paid",9999999),personal_injury_amount_paid_cents:it("Personal injury amount paid",9999999),auto_current_annual_premium_cents:it("Current annual premium",9999999),auto_prior_years:Pt("Years with prior auto carrier"),auto_prior_months:be({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:Pt("Years with continuous auto coverage")};function ge(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 We(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 Hn=[{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:e=>{const t=e.date_of_birth;if(!t||typeof t!="string")return;const r=ge(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":We(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=ge(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":We(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>zn)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=ge(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=ge(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=ge(r),o=ge(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=ge(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=ge(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=ge(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=ge(r);if(isNaN(o.getTime()))return;const i=We(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=ge(r);if(isNaN(o.getTime()))return;const i=We(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=ge(r);if(isNaN(o.getTime()))return;const i=We(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=ge(r);if(isNaN(o.getTime()))return;const i=We(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=ge(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=ge(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=ge(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=ge(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=ge(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=ge(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=ge(r);if(isNaN(o.getTime()))return;const i=We(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=ge(r);if(isNaN(o.getTime()))return;const i=We(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],l=a[r];if(s!=null&&l!=null&&s>l)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 gr(e,t){const r=Rl[e];if(!r)return;const n=r.safeParse(t);return n.success?void 0:n.error.issues[0].message}function Un(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 Hl(e,t){const r={};for(const n of Hn){if(t?.has(n.targetKey))continue;const o=n.validate(e);o&&(r[n.targetKey]=o)}return r}function yr(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Ft(e,t){return e.key??`${yr(e.question)}-${t}`}function Ge(e,t){return t==="number"?e==null||typeof e=="string"&&e.trim()==="":t==="checkbox"?e!==!0:e==null||typeof e=="string"&&e.trim()===""}function $t(e,t){const r={};e.forEach((i,a)=>{const s=Ft(i,a),l=t[s];if(i.required&&Ge(l,i.inputType)){r[s]="Required";return}if(!Ge(l,i.inputType)){const u=gr(s,l);if(u){r[s]=u;return}}});const n=new Set(Object.keys(r).filter(i=>r[i])),o=Hl(t,n);for(const[i,a]of Object.entries(o))r[i]=a;return r}function Ul(e){if(e===""||e===null||e===void 0)return;const t=Number(e);return Number.isNaN(t)?void 0:t}const Zl=["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible"],Wl=new Set([...Zl,"is_corporation"]);pl({additional_pip:ot(["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:ot(["Verbal_Threshold","Zero_Threshold","Full","Limited"]),pip_coverage_type:ot(["Primary","Secondary"]),extended_medical:ot(["cov1000","cov10000"]),policy_pip_deductible:ot(["cov250","cov500","cov1000","cov2000","cov2500"]),has_health_insurance_auto_accident:cl().nullable().optional()}).superRefine((e,t)=>{e.pip_coverage_type==="Secondary"&&e.has_health_insurance_auto_accident!==!0&&t.addIssue({code:hr.custom,path:["pip_coverage_type"],message:"Secondary PIP coverage requires health insurance that covers auto accidents."})});const Gl=new Set(["Home","HomeConstruction","HomeFeatures"]),jl=new Set(["HomePolicy","BundlePolicy"]),Vl=new Set(["HomeCustomer","BundleCustomer"]);function Zn(e){if(typeof e!="string"||!e.trim())return!1;const t=e.trim().toLowerCase();return t==="nj"||t==="n.j."||t==="n.j"||t==="new jersey"}function Wn(e){return e?Zn(e.state??e.State):!1}function br(e,t,r){return e==="has_health_insurance_auto_accident"?t==="BundleCustomer"?!1:!Wn(r):Wl.has(e)?!Wn(r):e==="household_size"?!(t&&Gl.has(t)):e==="number_of_mortgagees"?!(t&&jl.has(t)):(e==="has_co_applicant"||e==="co_applicant_middle_name"||e==="co_applicant_relationship")&&t&&Vl.has(t)?!1:e==="multi_policy_discount"&&t==="HomePolicy"?!0:Yl.has(e)}const Yl=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","auto_current_annual_premium_cents","has_co_applicant","co_applicant_middle_name","co_applicant_relationship"]),Kl={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"},ql={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},Jl={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"},Ql={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"},eu={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"},tu={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"},ru={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"},nu={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},ou={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"},iu={cov25000:"25,000",cov35000:"35,000",cov50000:"50,000",cov100000:"100,000",cov200000:"200,000",cov250000:"250,000",cov300000:"300,000",cov500000:"500,000"},au={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"},su={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},vr={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",Thousand:"1,000",TwoThousand:"2,000"},Bt={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},cu=["NoCoverage","TwentyFive","Fifty","SeventyFive","Hundred","TwoHundred","Unlimited"],Gn={NoCoverage:"No Coverage",cov20to600:"20/600",cov25to750:"25/750",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500"},jn={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"},lu={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"},uu={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)"},du={OwnerPrimary:"Owner Primary",OwnerSecondary:"Owner Secondary",OwnerSeasonal:"Owner Seasonal"},_u={Basic:"Basic",Modest:"Modest",Average:"Average",AboveAverage:"Above Average",Expensive:"Expensive",VeryExpensive:"Very Expensive",Opulent:"Opulent"},fu={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"},mu={Slab:"Slab",Basement:"Basement",CrawlSpace:"Crawl Space",PartialBasement:"Partial Basement",PiersPostsPiles:"Piers / Posts / Piles",Open:"Open"},pu={NotOverWater:"No",PartiallyOverWater:"Partially Over Water",FullyOrEntirelyOverWater:"Fully or Entirely Over Water"},hu={One:"1",OneHalf:"1.5",Two:"2",TwoHalf:"2.5",Three:"3",ThreeHalf:"3.5",Four:"4",BiLevel:"Bi-Level",TriLevel:"Tri-Level"},gu={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"},yu={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"},bu={B_Gable:"Gable",C_Hip:"Hip",A_Flat:"Flat",D_Other:"Other"},vu={NotUpdated:"Not Updated",PartialUpdate:"Partial Update",CompleteUpdate:"Complete Update"},Su={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"},Au={AboveGround:"Above Ground",BelowGround:"Below Ground"},Cu={Basement:"Below Grade Basement",SplitLevelBasement:"Split Level Basement",WalkoutBasement:"Walkout Basement"},wu={EntirelyCopper:"Entirely Copper",EntirelyGalvanized:"Entirely Galvanized",EntirelyPEX:"Entirely PEX",EntirelyPVC:"Entirely PVC",Polybutylene:"Polybutylene"},Eu={TwentyFive:"$25,000",Fifty:"$50,000",OneHundred:"$100,000",TwoHundred:"$200,000",ThreeHundred:"$300,000",FourHundred:"$400,000",FiveHundred:"$500,000"},Tu={cov1000:"$1,000",cov2000:"$2,000",cov3000:"$3,000",cov4000:"$4,000",cov5000:"$5,000"},Nu={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%"},ku={None:"None",OnePercent:"1%",TwoPercent:"2%",FivePercent:"5%",TenPercent:"10%"},Ou={_0_500ft:"0-500 Feet",_501_1000ft:"501-1000 Feet",_1001ftAndGreater:"1001 Feet And Greater"},Iu={Lessthan5miles:"Less Than 5 Miles",Over5miles:"Over 5 Miles",NotAvailable:"Not Available"},Vn={"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"},Yn={Single:"Single",Married:"Married",Seperated:"Separated",Divorced:"Divorced",Widowed:"Widowed",DomesticPartner:"Domestic Partner"},Kn={Female:"Female",Male:"Male"},qn={"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"},Mu={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"},Lu={Verbal_Threshold:"Limited right to sue",Zero_Threshold:"Unlimited right to sue",Full:"Full",Limited:"Limited"},Du={Primary:"Primary",Secondary:"Secondary"},Pu={cov1000:"$1,000",cov10000:"$10,000"},Fu={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"},$u={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"]},xu={"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"},Jn=Bu,Qn=xu;function Sr(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 xt(e){return Sr(e,qn)}function Xn(e){return Sr(e,jn)}function eo(e){return Sr(e,Qn)}function zu(e){return e.trim().toLowerCase()}function to(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 at(e,t){if(!t.effectiveDateKey||!t.expirationDateKey)return!1;const r=to(e[t.expirationDateKey]),n=to(e[t.effectiveDateKey]);return r==null||n==null?!1:r<n}const Ru=new Set(["HomePolicy","BundlePolicy"]);function zt(e,t,r){return String(e.key??"")!=="lapse_in_coverage"||!r||!Ru.has(r)?!0:t.home_prior_carrier_name!=="NoPriorInsurance"}function Ar(e){let t=null,r=null,n=null;const o=new Set,i=new Set,a=l=>{const u=String(l.key??""),d=zu(String(l.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=l=>{l.forEach(u=>{(u.conditionals??[]).forEach(d=>{const p=d.conditionalQuestions??[];p.forEach(a),s(p)})})};return s(e),{currentCarrierKey:t,effectiveDateKey:r,expirationDateKey:n,noInsuranceReasonKeys:o,hideWhenNoPriorInsuranceKeys:i}}function ht(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"&&at(e,t)?!1:at(e,t)}function Rt(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:ht(t,r)}function Ht(e,t){const r=String(e.key??"");return t.noInsuranceReasonKeys.has(r)}const Hu=["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"],Cr="credify_quote_id",wr="credify_auth_token";function Uu(e){try{localStorage.setItem(Cr,e)}catch(t){console.error("Failed to save quoteId to localStorage:",t)}}function Zu(){try{return localStorage.getItem(Cr)}catch(e){return console.error("Failed to load quoteId from localStorage:",e),null}}function ro(){try{localStorage.removeItem(Cr)}catch(e){console.error("Failed to clear quoteId from localStorage:",e)}}function Wu(e){try{localStorage.setItem(wr,e)}catch(t){console.error("Failed to save authToken to localStorage:",t)}}function Gu(){try{return localStorage.getItem(wr)}catch(e){return console.error("Failed to load authToken from localStorage:",e),null}}function no(){try{localStorage.removeItem(wr)}catch(e){console.error("Failed to clear authToken from localStorage:",e)}}function ju(){ro(),no()}const Fe="https://api.getcredify.com";let st=null;function Vu(e){st=e,Wu(e)}function Ut(){return st}function Er(){const e=Gu();e&&(st=e)}function oo(){st=null,no()}async function $e(e,t){const r={"Content-Type":"application/json"};st&&(r.Authorization=`Bearer ${st}`);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 Yu(e){try{return await e.json()}catch{return{}}}async function Ku(e,t){const r=t?{stage:e,quoteId:t}:{stage:e};return await(await $e(`${Fe}/get-questions-by-stage`,r)).json()}async function Zt(e){const t=e?{quoteId:e}:{};return await(await $e(`${Fe}/get-stages-for-quote`,t)).json()}async function qu(e){const r=await(await $e(`${Fe}/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 ct(e,t,r){const n={payload:e,getRates:t};r&&typeof r=="string"&&r.trim()!==""&&(n.quoteId=r);const o=await $e(`${Fe}/update-quote`,n),i=await Yu(o);return!i||typeof i!="object"||!("status"in i)||i.status==null?{status:"success"}:i}async function Ju(e,t){return await(await $e(`${Fe}/verify-quote`,{quoteId:e,smsCode:t})).json()}async function Qu(e){return await(await $e(`${Fe}/is-supported-state`,{state:e})).json()}async function io(){return await(await $e(`${Fe}/get-rates`,{})).json()}async function ao(e){const t=e?{quoteId:e}:{};return await(await $e(`${Fe}/get-quote`,t)).json()}async function so(e){return(await $e(`${Fe}/get-vehicle-options`,e)).json()}async function Xu(e){return(await $e(`${Fe}/get-vehicle-options`,{...e,action:"vinDecode"})).json()}async function ed(e){const r=await(await $e(`${Fe}/request-bind`,{quoteRateId:e})).json();return r&&typeof r=="object"&&"success"in r?r:{success:!0}}const Tr=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),td={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"},co={auto_prior_carrier_name:Kl,auto_prior_liability_limit:Xl,auto_reason_for_no_insurance:eu,residence_type:ql,home_prior_carrier_name:Jl,policy_bi:tu,policy_um:ru,policy_pd:nu,policy_mp:ou,policy_umpd:iu,policy_pip:au,policy_auto_death_indemnity:su,vehicle_comp_deductible:vr,vehicle_coll_deductible:vr,vehicle_towing_and_labor:Bt,vehicle_transportation_expense:Gn,education_level:jn,industry:qn,occupation:Qn,usage:Ql,architectural_style:lu,dwelling_type:uu,occupancy_type:du,construction_quality:_u,construction_type:fu,foundation_type:mu,located_over_water:pu,number_of_stories:hu,exterior_wall_type:gu,roof_material_type:yu,roof_shape:bu,roof_updated_type:vu,heating_type:Su,oil_tank_location:Au,basement_type:Cu,plumbing_type:wu,personal_liability:Eu,dwelling_medical_payments:Tu,all_perils_deductible:Nu,windstorm_deductible:ku,distance_from_fire_hydrant_ft:Ou,distance_from_fire_station_miles:Iu,employment_industry:Vn,marital_status:Yn,gender:Kn,co_applicant_employment_industry:Vn,co_applicant_marital_status:Yn,co_applicant_gender:Kn,description:Mu,tort_threshold:Lu,pip_coverage_type:Du,extended_medical:Pu,additional_pip:Fu,policy_pip_deductible:$u},rd=["OTHER / NOT LISTED"],nd=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],od=["Other"];function Le(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 lo(e){const t=e.replace(/\D+/g,"");if(t!=="")return Ul(t)}function id(e){return e==="-"||e==="+"||e==="."||e==="e"||e==="E"}const ad={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},uo=new Set(["sale_price_cents","dwelling_replacement_cost","other_structures_coverage","personal_property_coverage","loss_of_use_coverage","custom_equipment_value_cents","cost_new_value_cents","stated_value_amount_cents","property_damage_amount_paid_cents","personal_injury_amount_paid_cents","auto_current_annual_premium_cents","amount_paid_cents"]),sd=new Set(["total_area_sq_ft","annual_mileage","miles_to_work","distance_to_coast_miles"]),Wt={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"},cd={license_number:20};function ld(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:Le(r),max:Le(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:Le(n),max:Le(o)}}if(e==="date_of_incident")return{max:Le(r)};if(e==="move_in_date")return{max:Le(r)};if(e==="purchase_date")return{max:Le(r)};if(e==="date_of_birth")return{max:Le(r)};if(e==="date_first_licensed")return{max:Le(r)};if(e==="occurred_at")return{max:Le(r)};if(e==="accident_prevention_course_date")return{max:Le(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:Le(n),max:Le(o)}}return{}}const ud=new Set(["Disabled","Retired","Unemployed","Other"]);function Nr(e,t,r){const n=String(e.key??"");if(n!=="occupation"&&n!=="co_applicant_occupation"||n==="co_applicant_occupation")return!0;const o=Ae(t,r,"industry"),i=Ae(t,r,"employment_industry"),a=String(o??i??"").trim();return!ud.has(a)}function kr(e,t,r,n){return br(e,n,r)}function Gt(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 _o(e,t){return Gt(e)?"Yes":t}function fo(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 po(e,t){const r=fo(e),n=fo(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 dd(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function gt(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=po(e,r);return n!=null&&n<0}case"greaterThan":{const n=po(e,r);return n!=null&&n>0}case"contains":return dd(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 yt(e,t){return t.reduce((r,n)=>r?.[n],e)}function Be(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=Be(a,o,r);if(typeof n=="number"){const u=(Array.isArray(e)?e:[]).slice();return u[n]=s,u}return{...e,[n]:s}}function Ae(e,t,r){return yt(e,[...t??[],r])}function Ce(e,t,r,n){return Be(e,[...t??[],r],n)}function _d(e,t){return e?.length?`${e.join("-")}-${t}`:t}const fd="__items",jt=e=>`${e}${fd}`;function ke(e){return e==null?"":typeof e=="string"?e:String(e)}function ho(e){return e==null?"":typeof e=="number"&&Number.isFinite(e)||typeof e=="string"?e:""}function md(e){return e==null?"":typeof e=="string"||typeof e=="number"?e:String(e)}function pd({questions:e,initialValues:t,controlledValues:r,onChangeValues:n,onSubmit:o,quoteId:i,widgetStageKey:a}){const s=m.useMemo(()=>nr(e),[e]),l=m.useMemo(()=>Ar(s),[s]),u=m.useMemo(()=>a==="BundlePolicy"?!0:s.some(C=>String(C.key)==="home_prior_carrier_name")&&s.some(C=>String(C.key)==="driver_vehicle_assignments"),[a,s]),d=m.useMemo(()=>{const C={};return t&&Object.assign(C,t),C},[t]),[p,v]=m.useState(d);m.useEffect(()=>{v(d)},[d]);const[y,S]=m.useState({}),g=m.useMemo(()=>({...y,...r??p}),[y,r,p]);m.useEffect(()=>{r&&S(C=>({...C,...r}))},[r]);const[U,x]=m.useState({}),j=m.useRef(new Map),Z=m.useRef(new Set),[,H]=m.useState({}),[P,K]=m.useState({}),z=m.useRef(!1);m.useEffect(()=>{!i||z.current||!s.some(h=>h.key==="year"||h.key==="make"||h.key==="model"||h.key==="body_style")||(z.current=!0,so({quoteId:i}).catch(()=>{}))},[i,s]);const[ne,V]=m.useState({}),[te,ie]=m.useState({}),Ee=m.useCallback(async(C,h)=>{if(!i||!Un(h))return;const _=C?C.join("-"):"_root";V(w=>({...w,[_]:!0})),ie(w=>({...w,[_]:null}));try{const w=await Xu({quoteId:i,vin:h});if(w.error){ie(O=>({...O,[_]:w.error}));return}let N=g;w.year&&(N=Ce(N,C,"year",String(w.year))),w.make&&(N=Ce(N,C,"make",w.make)),w.model&&(N=Ce(N,C,"model",w.model)),w.bodyStyle&&(N=Ce(N,C,"body_style",w.bodyStyle)),r&&n?n(N):v(N),S(N),j.current.clear(),Z.current.clear(),H({})}catch{ie(w=>({...w,[_]:"VIN lookup failed — please enter vehicle details manually"}))}finally{V(w=>({...w,[_]:!1}))}},[i,g,r,n]),Ie=m.useCallback(C=>{const h=`${C.year}|${C.make??""}|${C.model??""}`,_=C.model?"bodyStyles":C.make?"models":"makes",w=j.current.get(h);return w?w[_]??[]:void 0},[]),q=m.useCallback((C,h)=>{if(!i)return;const _=`${h.year}|${h.make??""}|${h.model??""}`,w=h.model?"bodyStyles":h.make?"models":"makes",N=`${C}:${w}`;j.current.has(_)||Z.current.has(_)||(Z.current.add(_),K(O=>({...O,[N]:!0})),so({quoteId:i,...h}).then(O=>{j.current.set(_,O),H(D=>({...D,[N]:O[w]??[]}))}).catch(()=>{j.current.set(_,{}),H(O=>({...O,[N]:[]}))}).finally(()=>{Z.current.delete(_),K(O=>({...O,[N]:!1}))}))},[i]);function L(C,h,_){return{...C?yt(g,C)??{}:g,[h]:_}}function f(C,h){const _=Hn.filter(N=>N.targetKey===C||N.dependsOn.includes(C)),w={[C]:void 0};for(const N of _){const O=N.validate(h);N.targetKey in w?O!==void 0&&(w[N.targetKey]=O):w[N.targetKey]=O}x(N=>({...N,...w}))}const A=(C,h,_)=>{const w=Ae(g,_,C);if(Ge(w,h)){U[C]&&x(O=>({...O,[C]:void 0}));return}const N=gr(C,w);if(N){x(O=>({...O,[C]:N}));return}f(C,L(_,C,w))};m.useEffect(()=>{let C=g,h=!1;s.forEach(_=>{if(!Gt(_))return;const w=String(_.key);Ae(C,void 0,w)!=="Yes"&&(C=Ce(C,void 0,w,"Yes"),h=!0)}),h&&(r&&n?n(C):v(C),S(C))},[s,g,r,n]);function I(C,h){const _=C.key;if((_==="relationship_to_insured"||_==="is_registered_owner")&&h){const E=h[h.length-1];if(typeof E=="number"&&E===0)return null}if((_==="purchase_date"||_==="cost_new_value_cents")&&h)return null;if(_==="custom_equipment_value_cents"&&h){const E=Ae(g,h,"vehicle_has_modifications");if(E!=="Yes"&&E!==!0)return null}const w=_==="auto_reason_for_no_insurance"&&l.currentCarrierKey?g[l.currentCarrierKey]==="NoPriorInsurance"?"Reason you are not currently insured":"Reason for lapse in coverage":C.question,N=C.hint,O=Ae(g,h,_),D=Ht(C,l)?ht(g,l):C.required,Y=U[_],ee=E=>{let T=Ce(g,h,_,E);if(C.inputType==="radio"&&C.conditionals){const M=C.conditionals??[];for(const B of M){const ae=Ae(g,h,_),le=gt(ae,B.conditionalType,B.conditionalValue),Q=gt(E,B.conditionalType,B.conditionalValue);if(le&&!Q&&B.conditionalQuestionsAllowMultiple){const ue=B.conditionalQuestions??[];if(ue.length>0){const $=jt(_);T=Be(T,[...h??[],$],[]);const ce=(X,oe)=>{X.forEach(J=>{(J.conditionals??[]).forEach(ye=>{if(ye.conditionalQuestionsAllowMultiple){const Te=jt(J.key);T=Be(T,[...oe,Te],[])}const me=ye.conditionalQuestions??[];me.length>0&&ce(me,oe)})})};ce(ue,[...h??[],$])}}}}r&&n?n(T):v(T),S(T)};if(_==="vehicle_policy_selections"){const E=g.vehicles__items??[],T=g.drivers__items??[];if(E.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles first to configure coverage selections."},_);const M=g.driver_vehicle_assignments??{},B=T.length>1,ae=J=>Object.entries(J).map(([re,ye])=>({value:re,label:ye})),le=ae(vr),Q=Zn(g.state??g.State)?Object.fromEntries(cu.filter(J=>J in Bt).map(J=>[J,Bt[J]])):Bt,ue=ae(Q),$=ae(Gn),ce=(J,re,ye)=>{const me=Be(g,["vehicles__items",J,re],ye);r&&n?n(me):v(me),S(me)},X=(J,re,ye)=>{const me={...M},Te=`v${J}`;me[Te]={...me[Te]??{}},me[Te][`d${re}`]=ye;const de=Be(g,["driver_vehicle_assignments"],me);r&&n?n(de):v(de),S(de)},oe=J=>{if(!B)return null;const re=M[`v${J}`];if(!re)return null;const ye=T.map((de,xe)=>re[`d${xe}`]??0),me=ye.filter(de=>de>0);if(me.length>=2&&me.every(de=>de===me[0])&&me[0]===50)return`Assignments for Vehicle ${J+1} cannot be 50 percent for both Drivers.`;const Te=ye.reduce((de,xe)=>de+xe,0);return Te>0&&Te!==100?`Driver percentages for this vehicle must add up to 100% (currently ${Te}%).`:null};return c.jsx("div",{children:E.map((J,re)=>{const ye=[J.year,J.make,J.model].filter(Boolean).join(" ")||`Vehicle ${re+1}`,me=oe(re),Te=de=>typeof J[de]=="string"?J[de]:"";return c.jsxs("fieldset",{style:{border:`1px solid ${me?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[c.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:ye}),c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px"},children:[c.jsx(dt,{id:`veh-${re}-comp`,label:"Comprehensive deductible",required:!0,placeholder:"Select...",options:le,value:Te("vehicle_comp_deductible"),onChange:de=>ce(re,"vehicle_comp_deductible",de.currentTarget.value)}),c.jsx(dt,{id:`veh-${re}-coll`,label:"Collision deductible",required:!0,placeholder:"Select...",options:le,value:Te("vehicle_coll_deductible"),onChange:de=>ce(re,"vehicle_coll_deductible",de.currentTarget.value)}),c.jsx(dt,{id:`veh-${re}-tow`,label:"Towing and Labor",required:!0,placeholder:"Select...",options:ue,value:Te("vehicle_towing_and_labor"),onChange:de=>ce(re,"vehicle_towing_and_labor",de.currentTarget.value)}),c.jsx(dt,{id:`veh-${re}-trans`,label:"Transportation expense",required:!0,placeholder:"Select...",options:$,value:Te("vehicle_transportation_expense"),onChange:de=>ce(re,"vehicle_transportation_expense",de.currentTarget.value)})]}),B&&c.jsxs("div",{style:{marginTop:"16px"},children:[c.jsx("p",{style:{fontWeight:600,margin:"0 0 8px"},children:"Drivers usage (%)"}),c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:T.map((de,xe)=>{const zo=[de.first_name,de.last_name].filter(Boolean).join(" ")||`Driver ${xe+1}`,Dr=M[`v${re}`]?.[`d${xe}`];return c.jsx("div",{style:{flex:"0 0 140px"},children:c.jsx(er,{id:`assignment-v${re}-d${xe}`,label:`${zo} %`,value:Dr??"",min:0,max:100,step:1,inputMode:"numeric",onChange:ze=>{const lt=ze.currentTarget.value.replace(/\D+/g,"");X(re,xe,lt===""?0:Math.min(100,parseInt(lt,10)))}})},`${re}-${xe}`)})}),me&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:me})]})]},re)})},_)}if(_==="driver_vehicle_assignments"){const E=g.vehicles__items??[],T=g.drivers__items??[];if(u&&T.length<=1)return null;if(E.length===0||T.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},_);const M=g.driver_vehicle_assignments??{},B=(le,Q,ue)=>{const $={...M},ce=`v${le}`;$[ce]={...$[ce]??{}},$[ce][`d${Q}`]=ue,ee($)},ae=le=>{if(T.length<2)return null;const Q=M[`v${le}`];if(!Q)return null;const ue=T.map((X,oe)=>Q[`d${oe}`]??0),$=ue.filter(X=>X>0);if($.length>=2&&$.every(X=>X===$[0])&&$[0]===50)return`Assignments for Vehicle ${le+1} cannot be 50 percent for both Drivers.`;const ce=ue.reduce((X,oe)=>X+oe,0);return ce>0&&ce!==100?`Driver percentages for this vehicle must add up to 100% (currently ${ce}%).`:null};return c.jsxs("div",{children:[c.jsx("h4",{style:{marginBottom:"12px"},children:w}),E.map((le,Q)=>{const ue=[le.year,le.make,le.model].filter(Boolean).join(" ")||`Vehicle ${Q+1}`,$=ae(Q);return c.jsxs("fieldset",{style:{border:`1px solid ${$?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[c.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:ue}),c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:T.map((ce,X)=>{const oe=[ce.first_name,ce.last_name].filter(Boolean).join(" ")||`Driver ${X+1}`,J=M[`v${Q}`]?.[`d${X}`];return c.jsx("div",{style:{flex:"0 0 140px"},children:c.jsx(er,{id:`assignment-v${Q}-d${X}`,label:`${oe} %`,value:J??"",min:0,max:100,step:1,inputMode:"numeric",onChange:re=>{const ye=re.currentTarget.value.replace(/\D+/g,"");B(Q,X,ye===""?0:Math.min(100,parseInt(ye,10)))}})},`${Q}-${X}`)})}),$&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:$})]},Q)})]},_)}switch(C.inputType){case"text":{if(_==="vin"&&i){const E=h?h.join("-"):"_root",T=ne[E]??!1,M=te[E]??null,B=[N?`${_}-hint`:null,Y?`${_}-error`:null,M?`${_}-vin-error`:null].filter(Boolean).join(" ");return c.jsxs("div",{children:[c.jsx(Me,{id:_,label:w,hint:N,error:Y,required:D,children:c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx("input",{id:_,className:`form-input ${Y?"input-error":""}`,"aria-invalid":!!Y,"aria-describedby":B||void 0,"aria-required":D||void 0,required:D,value:ke(O),maxLength:17,onChange:ae=>ee(ae.currentTarget.value),onBlur:()=>A(_,"text",h),autoComplete:Wt[_],type:"text"})}),c.jsx("button",{type:"button",disabled:T||!Un(ke(O)),className:"btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",onClick:()=>Ee(h,ke(O)),children:T?"Looking up...":"Verify VIN"})]})}),M&&c.jsx("p",{id:`${_}-vin-error`,className:"text-sm text-red-600 mt-1",children:M})]},_)}if(_==="sms_code"){const E=ke(O);return c.jsx(Xt,{id:_,label:w,hint:N,value:E,inputMode:"numeric",pattern:"[0-9]*",maxLength:6,onChange:T=>{const M=T.currentTarget.value.replace(/\D+/g,"").slice(0,6);ee(M)},onBlur:()=>A(_,"text",h),"aria-required":D||void 0,error:Y,autoComplete:Wt[_]},_)}return _==="license_number"?c.jsx(Xt,{id:_,label:w,hint:N,value:ke(O),onChange:E=>ee(E.currentTarget.value.replace(/[^A-Z0-9]/gi,"").slice(0,20)),onBlur:()=>A(_,"text",h),"aria-required":D||void 0,error:Y,autoComplete:"off",maxLength:20},_):_==="social_security_number"?c.jsx(Wo,{id:_,label:w,hint:N,value:ke(O),onChange:E=>ee(E.currentTarget.value),onBlur:()=>A(_,"text",h),"aria-required":D||void 0,error:Y},_):c.jsx(Xt,{id:_,label:w,hint:N,value:ke(O),onChange:E=>ee(E.currentTarget.value),onBlur:()=>A(_,"text",h),"aria-required":D||void 0,error:Y,autoComplete:Wt[_],maxLength:cd[_]},_)}case"email":return c.jsx(Go,{id:_,label:w,value:ke(O),onChange:E=>ee(E.currentTarget.value),onBlur:()=>A(_,"email",h),"aria-required":D||void 0,error:Y},_);case"password":return c.jsx(Yo,{id:_,label:w,value:ke(O),onChange:E=>ee(E.currentTarget.value),onBlur:()=>A(_,"password",h),"aria-required":D||void 0,error:Y},_);case"tel":return c.jsxs(c.Fragment,{children:[c.jsx(jo,{id:_,label:w,value:ke(O),onChange:E=>ee(E.currentTarget.value),onBlur:()=>A(_,"tel",h),"aria-required":D||void 0,error:Y},_),_==="phone"&&c.jsxs("div",{className:"mt-3 text-xs text-slate-600 space-y-1",children:[c.jsx("p",{children:"By entering your phone number, you agree to receive a one-time SMS from Credify Insurance with a verification code."}),c.jsx("p",{children:"Message & data rates may apply. One message per request."}),c.jsxs("p",{children:["See our"," ",c.jsx("a",{href:"https://getcredify.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","and"," ",c.jsx("a",{href:"https://getcredify.com/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Terms of Service"}),"."]})]})]});case"url":return c.jsx(Vo,{id:_,label:w,value:ke(O),onChange:E=>ee(E.currentTarget.value),onBlur:()=>A(_,"url",h),"aria-required":D||void 0,error:Y},_);case"number":{const E=ad[_];return uo.has(_)||sd.has(_)?c.jsx(Zo,{id:_,label:w,hint:N,value:ho(O),isCurrency:uo.has(_),maxDigits:E,onChange:T=>ee(lo(T.currentTarget.value)),onBlur:()=>A(_,"number",h),"aria-required":D||void 0,error:Y},_):c.jsx(er,{id:_,label:w,hint:N,value:ho(O),inputMode:"numeric",pattern:"[0-9]*",onKeyDown:T=>{if(id(T.key)){T.preventDefault();return}E!==void 0&&/^\d$/.test(T.key)&&String(T.currentTarget.value).replace(/\D/g,"").length>=E&&T.preventDefault()},onChange:T=>{let M=T.currentTarget.value;E!==void 0&&(M=M.slice(0,E)),ee(lo(M))},onBlur:()=>A(_,"number",h),"aria-required":D||void 0,error:Y},_)}case"textarea":return c.jsx(Ko,{id:_,label:w,value:ke(O),onChange:E=>ee(E.currentTarget.value),onBlur:()=>A(_,"textarea",h),"aria-required":D||void 0,error:Y,rows:4},_);case"date":{const{min:E,max:T}=ld(_);return c.jsx(qo,{id:_,label:w,hint:N,value:ke(O),min:E,max:T,onChange:M=>{const B=M.currentTarget.value;ee(B),!Ge(B,"date")&&!gr(_,B)&&f(_,L(h,_,B))},onBlur:()=>A(_,"date",h),"aria-required":D||void 0,error:Y,autoComplete:Wt[_]},_)}case"checkbox":{if(C.options){const E=Array.isArray(O)?O:[];return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"form-label",children:[w,D&&c.jsx("span",{className:"text-red-600 ml-1",children:"*"})]}),c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:C.options.map(T=>{const M=`${_}-${yr(T)}`,B=E.includes(T);return c.jsx(xr,{id:M,label:T,checked:B,onChange:ae=>{const le=new Set(E);ae.currentTarget.checked?le.add(T):le.delete(T),ee(Array.from(le))},"aria-required":D||void 0},M)})}),Y&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:Y})]},_)}return c.jsx(xr,{id:_,label:D?`${w} *`:w,checked:!!O,onChange:E=>ee(E.currentTarget.checked),"aria-required":D||void 0},_)}case"radio":{if(Gt(C))return null;const E=C.options??[],T=h&&h.length>0?`${_}__${h.join("__")}`:_;return c.jsx(Qo,{legend:w,legendClassName:D?"legend-required":void 0,children:E.map(M=>c.jsx(Jo,{name:T,value:M,checked:O===M,onChange:()=>{ee(M),f(_,L(h,_,M))},children:co[_]?.[M]??M},`${_}-${yr(M)}`))},_)}case"select":{let E=C.options??[];_==="quote_vehicle_id"&&(E=r?.vehicles__items?.map(Q=>Q.vin)??[]);let T=!1,M,B,ae;if(_==="year"||_==="make"||_==="model"||_==="body_style"){const Q=h?h.join("-"):"_root";ne[Q]&&(T=!0,M="Looking up VIN...")}if(!T&&(_==="make"||_==="model"||_==="body_style")){const Q=h?h.join("-"):"_root";ae=Q;const ue=Ae(g,h,"year"),$=typeof ue=="number"?ue:Number(ue);if(_==="make"){const ce=`${Q}:makes`;if(!$||!Number.isFinite($))T=!0,M="Select a year first";else{B={year:$};const X=Ie(B);X&&X.length>0?E=X:P[ce]?(T=!0,M="Loading makes..."):E=[...Hu]}}else if(_==="model"){const ce=`${Q}:models`,X=String(Ae(g,h,"make")??"");if(!X)T=!0,M="Select a make first";else if($&&Number.isFinite($)){B={year:$,make:X};const oe=Ie(B);oe&&oe.length>0?E=oe:P[ce]?(T=!0,M="Loading models..."):E=[...rd]}typeof O=="string"&&O&&!E.includes(O)&&(E=[O,...E])}else{const ce=`${Q}:bodyStyles`,X=String(Ae(g,h,"make")??""),oe=String(Ae(g,h,"model")??"");if(!oe)T=!0,M="Select a model first";else if($&&Number.isFinite($)&&X){B={year:$,make:X,model:oe};const J=Ie(B);J&&J.length>0?E=J:P[ce]?(T=!0,M="Loading body styles..."):E=[...nd]}typeof O=="string"&&O&&!E.includes(O)&&(E=[O,...E])}}if(_==="occupation"||_==="co_applicant_occupation"){const Q=_==="co_applicant_occupation"?"co_applicant_employment_industry":void 0,ue=Q?void 0:Ae(g,h,"industry"),$=Ae(g,h,Q??"employment_industry"),X=String(xt(ue??$)??"").trim();E=[...Jn[X]??od],typeof O=="string"&&O&&!E.includes(O)&&(E=[O,...E])}const le=_d(h,_);return c.jsx(dt,{id:le,label:M?`${w} — ${M}`:w,"aria-required":D||void 0,error:Y,disabled:T,value:md(O),onChange:Q=>{const ue=Q.currentTarget.value;if(_!=="year"&&_!=="make"&&_!=="model"&&_!=="industry"&&_!=="employment_industry"&&_!=="co_applicant_employment_industry"){ee(ue),f(_,L(h,_,ue));return}let $=Ce(g,h,_,ue);if(_==="year")$=Ce($,h,"make",""),$=Ce($,h,"model",""),$=Ce($,h,"body_style","");else if(_==="make")$=Ce($,h,"model",""),$=Ce($,h,"body_style","");else if(_==="model")$=Ce($,h,"body_style","");else if(_==="industry"||_==="employment_industry")$=Ce($,h,"occupation","");else if(_==="co_applicant_employment_industry"){const X=String(xt(ue)??"").trim(),oe=Jn[X]??[],J=oe.find(re=>re===X)??oe[0]??"";$=Ce($,h,"co_applicant_occupation",J??"")}r&&n?n($):v($),S($);const ce=h?yt($,h)??{}:$;f(_,{...ce,[_]:ue})},placeholder:M??"Select an option",onFocus:B&&ae?()=>q(ae,B):void 0,options:E.map(Q=>({value:Q,label:co[_]?.[Q]??td[Q]??Q}))},le)}case"address":return c.jsx(ri,{id:_,label:w,value:ke(O),onChange:(E,T)=>{let M=Ce(g,h,_,E);const B=T?.state??(typeof E=="string"?E.match(/,\s*([A-Z]{2})\s+\d{5}\b/)?.[1]:void 0);if(B){const ae=h?[...h,"state"]:["state"];M=Be(M,ae,B)}r&&n?n(M):v(M),S(M)},onBlur:()=>A(_,"address",h),required:D,"aria-required":D||void 0,error:Y},_);default:return null}}function k(C,h){return C.map((_,w)=>{const N=String(_.key);if(!Rt(_,g,l)||!Nr(_,g,h)||!zt(_,g,a))return null;if(kr(N,_,g,a)){const T=l.currentCarrierKey?g[l.currentCarrierKey]:void 0;if(!(T&&T!=="NoPriorInsurance"&&at(g,l)&&Tr.has(N)))return null}const O=I(_,h),D=_.conditionals??[];if(!D.length)return a==="BundlePolicy"&&N==="policy_bi"?c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mt-6 mb-3",children:"Vehicle Coverage Information"}),O]},`wrap-${N}-${w}`):c.jsx("div",{children:O},`wrap-${N}-${w}`);const Y=_o(_,Ae(g,h,N)),ee=D.filter(T=>gt(Y,T.conditionalType,T.conditionalValue)),E=ee.length>1&&!ee.some(T=>T.conditionalQuestionsAllowMultiple)?ee.slice(0,1):ee;return c.jsxs("div",{children:[O,E.map((T,M)=>{const B=T.conditionalQuestions??[];if(!B.length)return null;if(!T.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:k(B,h)},`branch-${N}-${M}`);const ae=jt(N),le=yt(g,[...h??[],ae])??[],Q=Math.max(1,le.length||1),ue=()=>{const X=Be(g,[...h??[],ae,le.length],{});r&&n?n(X):v(X),S(X)},$=()=>{const X=le.slice(0,Math.max(0,le.length-1)),oe=Be(g,[...h??[],ae],X);r&&n?n(oe):v(oe),S(oe)},ce=`${N}__c${M}`;return c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),c.jsxs("div",{className:"space-x-2",children:[c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:ue,children:"Add another"}),Q>1&&c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:$,children:"Remove last"})]})]}),Array.from({length:Q}).map((X,oe)=>{const J=[...h??[],ae,oe],re=`${ce}__i${oe}`,ye=le[oe]??{},me=N==="drivers",xe=me?`Driver #${oe+1}`:N==="vehicles"?`Vehicle #${oe+1}`:N==="home_losses"||N==="losses"?`Loss #${oe+1}`:`Entry #${oe+1}`,Dr=me&&typeof ye.ssn_display=="string"&&ye.ssn_display?` — ${ye.ssn_display}`:"";return c.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[c.jsxs("div",{className:"text-sm font-semibold mb-2",children:[xe,Dr]}),B.map(ze=>{const lt=String(ze.key);if(!Rt(ze,g,l)||!Nr(ze,g,J)||!zt(ze,g,a))return null;if(kr(lt,ze,g,a)){const St=l.currentCarrierKey?g[l.currentCarrierKey]:void 0;if(!(St&&St!=="NoPriorInsurance"&&at(g,l)&&Tr.has(lt)))return null}return c.jsxs("div",{className:"mt-3",children:[I(ze,J),(()=>{const St=ze.conditionals??[];if(!St.length)return null;const Ro=Ae(g,J,ze.key),qt=St.filter(Qe=>gt(Ro,Qe.conditionalType,Qe.conditionalValue));return(qt.length>1&&!qt.some(Qe=>Qe.conditionalQuestionsAllowMultiple)?qt.slice(0,1):qt).map((Qe,Pr)=>{const Fr=Qe.conditionalQuestions??[];if(!Fr.length)return null;if(!Qe.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:k(Fr,J)},`nested-${re}-${Pr}`);const Jt=jt(ze.key),Qt=yt(g,[...J,Jt])??[],Ho=Math.max(1,Qt.length||1),Qd=()=>{const ut=Be(g,[...J,Jt,Qt.length],{});r&&n?n(ut):v(ut),S(ut)},Xd=()=>{const ut=Qt.slice(0,Math.max(0,Qt.length-1)),Xe=Be(g,[...J,Jt],ut);r&&n?n(Xe):v(Xe),S(Xe)};return c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),c.jsxs("div",{className:"space-x-2",children:[c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Qd,children:"Add another"}),Ho>1&&c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Xd,children:"Remove last"})]})]}),Array.from({length:Ho}).map((ut,Xe)=>{const e_=[...J,Jt,Xe];return c.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[c.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",Xe+1]}),k(Fr,e_)]},`nested-item-${re}-${Pr}-${Xe}`)})]},`nested-repeat-${re}-${Pr}`)})})()]},`${re}-${lt}`)})]},`group-${re}`)})]},`branch-${N}-${M}`)})]},`wrap-${N}-${w}`)})}const W=m.useMemo(()=>{const C=[],h=(_,w)=>{_.forEach(N=>{if(!Rt(N,g,l)||!Nr(N,g,w)||!zt(N,g,a))return;const O=String(N.key);if(kr(O,N,g,a)){const T=l.currentCarrierKey?g[l.currentCarrierKey]:void 0;if(!(T&&T!=="NoPriorInsurance"&&at(g,l)&&Tr.has(O)))return}Gt(N)||C.push(N);const D=N.conditionals??[];if(!D.length)return;const Y=_o(N,Ae(g,w,O)),ee=D.filter(T=>gt(Y,T.conditionalType,T.conditionalValue));(ee.length>1&&!ee.some(T=>T.conditionalQuestionsAllowMultiple)?ee.slice(0,1):ee).forEach(T=>{const M=T.conditionalQuestions??[];M.length&&(T.conditionalQuestionsAllowMultiple||h(M,w))})})};return h(s),C},[s,g,l,a]);function G(C){C.preventDefault();const h=ht(g,l),_=W.map(N=>Ht(N,l)?{...N,required:h}:N),w=$t(_,g);if(x(w),Object.keys(w).length>0){const N=W.findIndex(O=>w[O.key]);N>=0&&document.getElementById(W[N].key)?.focus();return}o(g)}return c.jsx("form",{className:"space-y-6 px-1",onSubmit:G,noValidate:!0,children:k(s)})}const hd="GTM-NK8LGHTQ";function gd(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function qe(e,t={}){gd().push({event:e,credifyWidget:{...t,containerId:hd}})}function yd(){qe("credify_widget_opened")}function go(){qe("credify_widget_closed")}function bd(e){qe("credify_widget_stage_viewed",e)}function yo(e){qe("credify_widget_stage_completed",e)}function vd(){qe("credify_widget_flow_completed")}function Sd(e){qe("credify_widget_rates_viewed",e??{})}function Ad(){qe("credify_widget_rates_back")}const bo=new Set(["Disabled","Retired","Unemployed","Other"]);function Cd(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!bo.has(i)}function wd(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!bo.has(i)}function vo(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 So(e,t){return vo(e)?"Yes":t}function Ao(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function Co(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 wo(e,t){const r=Ao(e),n=Ao(t);if(r!=null&&n!=null)return r-n;const o=Co(e),i=Co(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function Ed(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function Eo(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=wo(e,r);return n!=null&&n<0}case"greaterThan":{const n=wo(e,r);return n!=null&&n>0}case"contains":return Ed(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 Td=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]);function To(e,t,r){const n=nr([...e]),o=Ar(n),i=[],a=s=>{s.forEach(l=>{if(!Rt(l,t,o)||!Cd(l,t)||!zt(l,t,r))return;const u=String(l.key);if(br(u,r,t)){const S=o.currentCarrierKey?t[o.currentCarrierKey]:void 0;if(!(S&&S!=="NoPriorInsurance"&&at(t,o)&&Td.has(u)))return}vo(l)||i.push(l);const d=So(l,t[u]),p=l.conditionals??[];if(!p.length)return;const v=p.filter(S=>Eo(d,S.conditionalType,S.conditionalValue));(v.length>1&&!v.some(S=>S.conditionalQuestionsAllowMultiple)?v.slice(0,1):v).forEach(S=>{const g=S.conditionalQuestions??[];g.length&&(S.conditionalQuestionsAllowMultiple||a(g))})})};return a(n),i}const No="__items",Or=e=>`${e}${No}`;function Nd(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 Ir(e,t,r=[],n=void 0){for(const o of e){const i=String(o.key),a=So(o,t[i]),s=o.conditionals??[];if(!s.length)continue;const l=s.filter(d=>Eo(a,d.conditionalType,d.conditionalValue)),u=l.length>1&&!l.some(d=>d.conditionalQuestionsAllowMultiple)?l.slice(0,1):l;for(const d of u){const p=d.conditionalQuestions??[];if(!p.length)continue;if(!d.conditionalQuestionsAllowMultiple){if(Ir(p,t,r,n))return!0;continue}const v=t[Or(i)]??[];if(v.length===0)return!0;for(const[y,S]of v.entries()){const g=[...r,Or(i),y],U=p.filter(j=>!(Nd(j,g)||br(String(j.key),n,S)||!wd(j,S))),x=$t(U,S);if(Object.values(x).some(Boolean)||Ir(p,S,g,n))return!0}}}return!1}function ko(e,t,r){return Ir(e,t,[],r)}function Oo(e){const t=e.vehicles__items??[];if(!Array.isArray(t)||t.length===0)return!1;for(const r of t)if(Ge(r.vehicle_comp_deductible,"select")||Ge(r.vehicle_coll_deductible,"select")||Ge(r.vehicle_towing_and_labor,"select")||Ge(r.vehicle_transportation_expense,"select"))return!0;return!1}function kd({stages:e,onStageComplete:t,onComplete:r,initialValues:n,initialActive:o,quoteId:i}){const[a,s]=m.useState(o??0),[l,u]=m.useState(n??{}),[d,p]=m.useState({}),[v,y]=m.useState(!1),[S,g]=m.useState(!1),[U,x]=m.useState(null),j=m.useRef([]),Z=m.useRef(e),H=Array.isArray(e)&&e.length>0,P=H?Math.min(a,e.length-1):0,K=H?e[P]:null,z=K?.key??null;m.useEffect(()=>{o!==void 0&&s(o)},[o]),Z.current=e;const ne=m.useMemo(()=>!!(P>=e.length-1||e.slice(P+1).every(A=>A.key==="AutoPolicy")&&(l.drivers__items??[]).length<=1),[P,e,l]);m.useEffect(()=>{H&&a>=e.length&&s(e.length-1)},[a,e.length,H]),m.useEffect(()=>{const f=j.current[P];f&&f.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[P]),m.useEffect(()=>{n!==void 0&&u(n)},[n]),m.useEffect(()=>{if(!K||!z){y(!1),x(null);return}if(d[z]){y(!1),x(null);return}let f=!1;return y(!0),x(null),Promise.resolve(K.loadQuestions()).then(A=>{if(!f){if(!Array.isArray(A))throw new Error(`loadQuestions("${z}") did not return an array`);p(I=>({...I,[z]:A}))}}).catch(A=>{f||x(`Failed to load stage "${K?.title??""}": ${A?.message??"Unknown error"}`)}).finally(()=>{f||y(!1)}),()=>{f=!0}},[K,z,d]);const V=z?d[z]:void 0,te=m.useMemo(()=>Ar(nr(V??[])),[V]);m.useEffect(()=>{K&&z&&V&&bd({stageKey:z,stageTitle:K.title??z,stepIndex:a+1,totalSteps:e.length})},[z,a,e.length,K,V]);const ie=m.useMemo(()=>{if(!V)return{};const f={};(k=>{const W=[],G=C=>{C.forEach((h,_)=>{const w=Ft(h,_);W.push(w);const N=Or(w);W.push(N),(h.conditionals??[]).forEach(D=>{const Y=D.conditionalQuestions??[];Y.length>0&&G(Y)})})};return G(k),W})(V).forEach(k=>{k in l&&(f[k]=l[k])});for(const k of["state","State","address","product"])k in l&&(f[k]=l[k]);for(const[k,W]of Object.entries(l))k.endsWith(No)&&!(k in f)&&(f[k]=W);return f},[V,l]),Ee=f=>{u(A=>({...A,...f}))},Ie=()=>{s(f=>f>0?f-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},q=async()=>{if(!V||!K||v||U||S)return;const f=To(V,ie,z??void 0),A=ht(l,te),I=f.map(D=>Ht(D,te)?{...D,required:A}:D),k=$t(I,ie),W=new Set(I.map((D,Y)=>Ft(D,Y))),G=Object.entries(k).some(([D,Y])=>Y&&W.has(D)),C=ko(V,l,z??void 0),_=f.some(D=>String(D.key??"")==="vehicle_policy_selections")?Oo(l):!1,w=l.driver_vehicle_assignments,N=l.drivers__items??[];let O=!1;if(w&&N.length>=2){const D=l.vehicles__items??[];for(let Y=0;Y<D.length;Y++){const ee=w[`v${Y}`];if(!ee)continue;const E=N.map((B,ae)=>ee[`d${ae}`]??0),T=E.filter(B=>B>0);if(T.length>=2&&T.every(B=>B===50)){O=!0;break}const M=E.reduce((B,ae)=>B+ae,0);if(M>0&&M!==100){O=!0;break}}}if(!(G||C||_||O)){g(!0);try{const D=ne,{success:Y,error:ee}=D?await r(l,z??""):await t(ie,z??"");if(!Y){x(ee??"An error occurred");return}if(!D){const E=Z.current,T=E.findIndex(B=>B.key===z),M=T>=0?Math.min(T+1,E.length-1):Math.min(a+1,E.length-1);s(M)}}finally{g(!1)}}},L=m.useMemo(()=>{if(!V||v||U||S)return!0;const f=To(V,ie,z??void 0),A=ht(l,te),I=f.map(D=>Ht(D,te)?{...D,required:A}:D),k=$t(I,ie),W=new Set(I.map((D,Y)=>Ft(D,Y))),G=Object.entries(k).some(([D,Y])=>Y&&W.has(D)),C=ko(V,l,z??void 0),_=f.some(D=>String(D.key??"")==="vehicle_policy_selections")?Oo(l):!1,w=l.driver_vehicle_assignments,N=l.drivers__items??[];let O=!1;if(w&&N.length>=2){const D=l.vehicles__items??[];for(let Y=0;Y<D.length;Y++){const ee=w[`v${Y}`];if(!ee)continue;const E=N.map((B,ae)=>ee[`d${ae}`]??0),T=E.filter(B=>B>0);if(T.length>=2&&T.every(B=>B===50)){O=!0;break}const M=E.reduce((B,ae)=>B+ae,0);if(M>0&&M!==100){O=!0;break}}}return G||C||_||O},[V,ie,l,v,U,S,te,z]);return H?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"form-wizard-steps-header flex items-center justify-between gap-4",children:[c.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((f,A)=>[c.jsx("li",{ref:I=>{j.current[A]=I},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${A<P?"bg-blue-600 text-white border-blue-600":A===P?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:f.title},f.key??`stage-${A}`),...A<e.length-1?[c.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${f.key??A}`)]:[]])}),c.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[P+1," / ",e.length]})]}),c.jsxs("div",{children:[v&&c.jsx("div",{className:"text-slate-500",children:"Loading…"}),K&&c.jsx(pd,{questions:V??[],controlledValues:ie,onChangeValues:Ee,onSubmit:()=>q(),quoteId:i,widgetStageKey:z??void 0},K.key)]}),!v&&U&&c.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[c.jsx("div",{children:U}),K&&c.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{p(f=>{if(!z)return f;const A={...f};return delete A[z],A})},children:"Retry"})]}),c.jsxs("div",{className:P>0?"grid grid-cols-2 gap-3":"",children:[P>0&&c.jsx("button",{type:"button",onClick:Ie,disabled:v,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Back"}),c.jsxs("button",{type:"button","data-widget-ctrl":"next",onClick:q,disabled:L,className:["form-wizard-next-btn",P>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:[S&&c.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:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.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"})]}),ne?"Finish":"Next"]})]})]}):c.jsx("div",{className:"text-slate-600",children:"Loading..."})}const Od=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),Io={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},Mo=["PersonalHome","PersonalAuto","Flood","ExcessFlood"],bt="rounded-2xl border-2 border-blue-300 bg-blue-50/30 p-4 shadow-blue-100/60 ring-1 ring-blue-100",vt="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",Lo="w-full max-w-md min-w-0 sm:max-w-[calc((100%-1rem)/2)]",Id="rounded-2xl border-2 border-transparent p-4";function Do({onBack:e}){const t=()=>{Ad(),e?.()};return c.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 je({rate:e,status:t,onRequestBind:r,disabled:n,featured:o=!1,showLobLabel:i=!0,showFeaturedBadge:a,className:s}){const l=Number.isFinite(e.term_months)&&e.term_months>0?e.term_months:1,d=(e.monthly_premium_cents!=null?e.monthly_premium_cents:Math.round((e.premium_cents||0)/l))/100,p=Od.format(d),v=t==="loading",y=t==="success",S=!!n||v||y,g=!!(e.effective_date&&e.policy_end_date),U=e.lob?Io[e.lob]||e.lob:null,x=a??o;return c.jsxs("div",{className:`flex w-full flex-col rounded-xl bg-white p-6 shadow-sm transition hover:shadow-md ${o?"border-2 border-blue-300 shadow-blue-100/60 ring-1 ring-blue-100":"border border-slate-200"}${s?` ${s}`:""}`,children:[i&&U&&c.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-slate-500",children:U}),x&&c.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"}),c.jsxs("div",{className:"mb-4 flex flex-col items-start gap-2",children:[e.carrier_logo_base64?c.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"}):c.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()}),c.jsx("h4",{className:"w-full break-words text-left font-semibold text-slate-900",children:e.carrier_name})]}),c.jsx("div",{className:"mb-2",children:c.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:[p,c.jsx("span",{className:"ml-1 text-sm font-medium text-slate-500",children:"/month"})]})}),g&&c.jsx("div",{className:"mb-2",children:c.jsxs("p",{className:"text-xs text-slate-500",children:["Effective ",e.effective_date," - ",e.policy_end_date]})}),e.carrier_quote_id&&c.jsx("div",{className:"mb-4",children:c.jsxs("p",{className:"text-xs text-slate-400",children:["Quote ID: ",e.carrier_quote_id]})}),c.jsxs("div",{className:"mt-auto pt-4",children:[c.jsx("button",{type:"button",onClick:r,disabled: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 ${y?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:v?"Requesting…":y?"Requested":"Request Bind"}),t==="error"&&c.jsx("p",{className:"mt-2 text-xs text-red-600",children:"Something went wrong. Please try again."}),t==="success"&&c.jsx("p",{className:"mt-2 text-xs text-emerald-600",children:"We received your bind request."})]})]})}function Md({rates:e,onBack:t,isBundleFlow:r=!1}){const n=Array.isArray(e)?e:[],o=n.length>0,[i,a]=m.useState({}),[s,l]=m.useState("admitted"),[u,d]=m.useState(!1),p=m.useMemo(()=>n.some(f=>f.lob==="PersonalAuto"),[n]),v=m.useMemo(()=>n.some(f=>f.lob==="PersonalHome"),[n]),y=m.useMemo(()=>{if(!r)return[];const f=[];return p&&f.push("PersonalAuto"),v&&f.push("PersonalHome"),f},[r,p,v]),S=m.useMemo(()=>{const f=new Set;for(const A of n){const I=A.lob??null;I&&i[A.quote_rate_id]==="success"&&f.add(I)}return f},[n,i]),g=m.useMemo(()=>Object.values(i).some(f=>f==="success"),[i]),U=m.useMemo(()=>u?!0:!r||y.length===0?g:y.every(f=>S.has(f)),[u,r,g,y,S]),x=m.useMemo(()=>o?n.filter(f=>(f.admitted_status??"admitted")==="admitted"):[],[n,o]),j=m.useMemo(()=>o?n.filter(f=>f.admitted_status==="non_admitted"):[],[n,o]),Z=x.length,H=j.length,P=Z+H>0;m.useEffect(()=>{P&&s==="admitted"&&Z===0&&H>0&&l("non_admitted")},[s,Z,H,P]);const K=m.useMemo(()=>P?s==="admitted"?x:j:[],[P,s,x,j]);m.useEffect(()=>{Er()},[]),m.useEffect(()=>{!U||u||(ju(),oo(),d(!0))},[U,u]);const z=m.useMemo(()=>{if(K.length===0)return[];if(!K.some(k=>k.lob))return[{lob:null,title:"Rates",rates:[...K].sort((W,G)=>{const C=Number.isFinite(W.term_months)&&W.term_months>0?W.term_months:1,h=Number.isFinite(G.term_months)&&G.term_months>0?G.term_months:1,_=W.monthly_premium_cents??Math.round((W.premium_cents||0)/C),w=G.monthly_premium_cents??Math.round((G.premium_cents||0)/h);return _-w})}];const A=new Map;for(const k of K){const W=k.lob||"_other",G=A.get(W);G?G.push(k):A.set(W,[k])}return[...A.entries()].sort(([k],[W])=>{const G=Mo.indexOf(k),C=Mo.indexOf(W);return(G===-1?999:G)-(C===-1?999:C)}).map(([k,W])=>({lob:k,title:Io[k]??k,rates:[...W].sort((G,C)=>{const h=Number.isFinite(G.term_months)&&G.term_months>0?G.term_months:1,_=Number.isFinite(C.term_months)&&C.term_months>0?C.term_months:1,w=G.monthly_premium_cents??Math.round((G.premium_cents||0)/h),N=C.monthly_premium_cents??Math.round((C.premium_cents||0)/_);return w-N})}))},[K]),ne=m.useMemo(()=>{if(!r)return[];const f=n.some(k=>k.lob==="PersonalAuto"),A=n.some(k=>k.lob==="PersonalHome"),I=[];return f||I.push("Sorry, no rates found for Personal Auto."),A||I.push("Sorry, no rates found for Homeowners."),I},[r,n]);if(!P)return c.jsxs("section",{className:"mt-8",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),c.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Sorry, no rates are available at this time."}),t&&c.jsx(Do,{onBack:t})]});const V=async f=>{a(A=>({...A,[f]:"loading"}));try{if(Er(),!Ut())throw new Error("Authentication required. Please verify your phone number first.");if(!((await ed(f))?.success!==!1))throw new Error("Request failed");a(W=>({...W,[f]:"success"}))}catch{a(A=>({...A,[f]:"error"}))}},te=z.find(f=>f.lob==="PersonalAuto"),ie=z.find(f=>f.lob==="PersonalHome"),Ee=!!(te?.rates.length&&ie?.rates.length),Ie=z.filter(f=>!Ee||f.lob!=="PersonalAuto"&&f.lob!=="PersonalHome"),q=Ee&&te&&ie?[{rate:te.rates[0]},{rate:ie.rates[0]}]:[],L=q.length===1;return c.jsxs("section",{className:"mt-8",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),ne.length>0&&c.jsx("div",{className:"mt-3 space-y-1",children:ne.map(f=>c.jsx("p",{className:"text-sm text-slate-600",children:f},f))}),c.jsx("div",{className:"mt-4 border-b border-slate-200",children:c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsxs("button",{type:"button",onClick:()=>l("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 (",Z,")"]}),c.jsxs("button",{type:"button",onClick:()=>l("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 (",H,")"]})]})}),K.length===0&&c.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."}),K.length>0&&Ee&&te&&ie&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:L?"mt-6 flex justify-center":"mt-6",children:c.jsxs("div",{className:L?`w-full max-w-md ${bt}`:bt,children:[c.jsx("div",{className:vt,children:"Featured Bundle"}),c.jsx("div",{className:L?"grid justify-items-center gap-4":"grid gap-4 sm:grid-cols-2",children:q.map(({rate:f})=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(je,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:U||(r?!!(f.lob&&y.includes(f.lob)&&S.has(f.lob)):g),onRequestBind:()=>V(f.quote_rate_id)})},f.quote_rate_id))})]})}),te.rates.length>1&&c.jsxs("div",{className:"mt-6",children:[c.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",te.title," Options"]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:te.rates.slice(1).map(f=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(je,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:U||(r?!!(f.lob&&y.includes(f.lob)&&S.has(f.lob)):g),onRequestBind:()=>V(f.quote_rate_id)})},f.quote_rate_id))})]}),ie.rates.length>1&&c.jsxs("div",{className:"mt-6",children:[c.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",ie.title," Options"]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:ie.rates.slice(1).map(f=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(je,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:U||(r?!!(f.lob&&y.includes(f.lob)&&S.has(f.lob)):g),onRequestBind:()=>V(f.quote_rate_id)})},f.quote_rate_id))})]})]}),K.length>0&&Ie.map(f=>{const[A,...I]=f.rates;return c.jsxs("div",{className:"mt-6",children:[c.jsx("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:f.title}),I.length===0?c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:c.jsx("div",{className:"col-span-full flex justify-center",children:c.jsxs("div",{className:`${Lo} ${bt}`,children:[c.jsx("div",{className:vt,children:"Featured"}),c.jsx(je,{rate:A,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[A.quote_rate_id]??"idle",disabled:U||(r?!!(A.lob&&y.includes(A.lob)&&S.has(A.lob)):g),onRequestBind:()=>V(A.quote_rate_id)})]})})}):I.length===1?c.jsxs("div",{className:"grid items-stretch gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${bt}`,children:[c.jsx("div",{className:vt,children:"Featured"}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:c.jsx(je,{rate:A,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[A.quote_rate_id]??"idle",onRequestBind:()=>V(A.quote_rate_id),disabled:U||(r?!!(A.lob&&y.includes(A.lob)&&S.has(A.lob)):g),className:"h-full min-h-0"})})]}),c.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${Id}`,children:[c.jsx("div",{className:`${vt} pointer-events-none invisible shrink-0`,"aria-hidden":!0,children:"Featured"}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:c.jsx(je,{rate:I[0],featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[I[0].quote_rate_id]??"idle",onRequestBind:()=>V(I[0].quote_rate_id),disabled:U||(r?!!(I[0].lob&&y.includes(I[0].lob)&&S.has(I[0].lob)):g),className:"h-full min-h-0"})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:c.jsx("div",{className:"col-span-full flex justify-center",children:c.jsxs("div",{className:`${Lo} ${bt}`,children:[c.jsx("div",{className:vt,children:"Featured"}),c.jsx(je,{rate:A,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[A.quote_rate_id]??"idle",disabled:U||(r?!!(A.lob&&y.includes(A.lob)&&S.has(A.lob)):g),onRequestBind:()=>V(A.quote_rate_id)})]})})}),c.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:I.map(k=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(je,{rate:k,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[k.quote_rate_id]??"idle",disabled:U||(r?!!(k.lob&&y.includes(k.lob)&&S.has(k.lob)):g),onRequestBind:()=>V(k.quote_rate_id)})},k.quote_rate_id))})]})]},f.lob??"all")}),t&&c.jsx(Do,{onBack:t})]})}const Mr=["Validating your details...","Checking underwriting rules...","Applying eligible discounts...","Reviewing your risk profile...","Calculating premium...","Check complete"],Po={Auto:{label:"Auto Policy",icon:"🚗",accent:"#0369A1"},Home:{label:"Home Policy",icon:"🏠",accent:"#059669"},Bundle:{label:"Home + Auto Bundle",icon:"🔗",accent:"#7C3AED"}},Ld=8e3;function Dd({progress:e,color:t,size:r=80}){const n=(r-10)/2,o=2*Math.PI*n,i=o-e/100*o;return c.jsxs("svg",{width:r,height:r,style:{transform:"rotate(-90deg)"},children:[c.jsx("circle",{cx:r/2,cy:r/2,r:n,fill:"none",stroke:"#F1F5F9",strokeWidth:6}),c.jsx("circle",{cx:r/2,cy:r/2,r:n,fill:"none",stroke:t,strokeWidth:6,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:i,style:{transition:"stroke-dashoffset 0.2s linear"}})]})}function Pd({providers:e=[],totalTime:t=6e4,flow:r="Auto",isComplete:n=!1,onComplete:o}){const i=Po[r]??Po.Auto,a=e.length>0?Ld:t,[s,l]=m.useState(0),[u,d]=m.useState(0),[p,v]=m.useState(0),[y,S]=m.useState(0),[g,U]=m.useState(!0),x=m.useRef(n),j=m.useRef(o),Z=m.useRef(s),H=m.useRef(e.length),P=m.useRef(!1),K=m.useRef(!1);m.useEffect(()=>{x.current=n,n&&e.length===0&&!P.current&&(P.current=!0,j.current?.())},[n,e.length]),m.useEffect(()=>{j.current=o},[o]),m.useEffect(()=>{Z.current=s},[s]),m.useEffect(()=>{H.current=e.length,e.length>0&&(K.current=!1,l(0),d(0),v(0),S(0),U(!0))},[e.length]),m.useEffect(()=>{if(e.length===0){x.current&&!P.current&&(P.current=!0,j.current?.());return}K.current=!1;const te=100,ie=100/(a/te),Ee=setInterval(()=>{v(Ie=>{if(K.current||P.current)return Ie;const q=Ie+ie;return q<100?q:(K.current=!0,setTimeout(()=>{if(x.current){if(P.current)return;P.current=!0,j.current?.();return}const f=Z.current===H.current-1;U(!1),setTimeout(()=>{f?(l(0),d(A=>A+1)):l(A=>A+1),v(0),S(0),U(!0)},300)},400),100)})},te);return()=>clearInterval(Ee)},[s,a,e.length]),m.useEffect(()=>{if(e.length===0)return;const te=Math.floor(a/Mr.length),ie=setInterval(()=>S(Ee=>Math.min(Ee+1,Mr.length-1)),te);return()=>clearInterval(ie)},[s,a,e.length]);const z=e.length===0,ne=z?null:e[Math.min(s,e.length-1)],V=u>0;return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
41
41
  @keyframes providerPulse {
42
42
  0%, 100% { transform: scale(1); }
43
43
  50% { transform: scale(1.05); }
@@ -72,5 +72,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
72
72
  .iq-status-text {
73
73
  animation: statusFadeIn 0.25s ease forwards;
74
74
  }
75
- `}),c.jsx("div",{style:{background:"#F8FAFC",display:"flex",alignItems:"center",justifyContent:"center",padding:"2rem",fontFamily:"'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",height:"100%",minHeight:400,overflowY:"auto"},children:c.jsxs("div",{style:{width:"100%",maxWidth:560},children:[c.jsxs("div",{style:{textAlign:"center",marginBottom:40},children:[c.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,background:i.accent+"12",border:`1px solid ${i.accent}30`,borderRadius:100,padding:"6px 16px",marginBottom:16},children:[c.jsx("span",{style:{fontSize:14},children:i.icon}),c.jsx("span",{style:{fontSize:12,fontWeight:700,color:i.accent,letterSpacing:"0.1em",textTransform:"uppercase"},children:i.label})]}),c.jsx("h1",{style:{fontSize:26,fontWeight:700,color:"#0F172A",margin:0,letterSpacing:"-0.02em",lineHeight:1.3},children:H?"Connecting to top carriers":"Fetching your best rates"}),c.jsx("p",{style:{fontSize:14,color:"#64748B",marginTop:8,marginBottom:0},children:H?"Identifying the carriers eligible for your quote...":J?"Still gathering — a few carriers are taking a little longer...":"We're reaching out to multiple insurers on your behalf"})]}),c.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:32},children:H?c.jsx("div",{style:{display:"flex",gap:20},children:[0,1,2,3,4].map(F=>c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6},children:[c.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${F*.12}s`}}),c.jsx("div",{style:{width:40,height:8,borderRadius:4,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${F*.12}s`}})]},`skeleton-${F}`))}):ae?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("div",{style:{width:64,height:64,borderRadius:18,background:ae.color+"18",border:`2px solid ${ae.color}`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:16,color:ae.color,position:"relative",animation:"providerPulse 1.8s ease-in-out infinite"},children:[ae.abbr,c.jsx("div",{style:{position:"absolute",inset:-5,borderRadius:22,border:`2px solid ${ae.color}`,pointerEvents:"none",animation:"ringPulse 1.6s ease-in-out infinite"}})]}),c.jsx("span",{style:{fontSize:13,fontWeight:600,color:ae.color,letterSpacing:"0.04em"},children:ae.name})]}):null}),c.jsxs("div",{className:`iq-card-fade ${g?"iq-card-visible":"iq-card-hidden"}`,style:{background:"#FFFFFF",borderRadius:24,border:"1px solid #E2E8F0",padding:32},children:[c.jsx("div",{style:{display:"flex",alignItems:"center",gap:20,marginBottom:28},children:H||!ae?c.jsxs("div",{style:{flex:1,textAlign:"center",padding:"8px 0"},children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 6px"},children:"Please wait"}),c.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:"Checking eligible providers"}),c.jsx("p",{style:{fontSize:13,color:"#64748B",margin:0},children:"Reviewing your details against our carrier network"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{position:"relative",flexShrink:0},children:[c.jsx(Fd,{progress:m,color:ae.color,size:80}),c.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsxs("span",{style:{fontSize:14,fontWeight:700,color:ae.color},children:[Math.round(m),"%"]})})]}),c.jsxs("div",{style:{flex:1},children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 4px"},children:J?"Still checking":"Now checking"}),c.jsx("h2",{style:{fontSize:20,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:ae.name}),c.jsx("p",{className:"iq-status-text",style:{fontSize:13,color:"#64748B",margin:0},children:kr[h]},`${s}-${h}`)]})]})}),c.jsxs("div",{children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.08em",textTransform:"uppercase",margin:"0 0 8px"},children:H?"Initializing":"Gathering quotes"}),c.jsx("div",{style:{height:6,background:"#F1F5F9",borderRadius:100,overflow:"hidden"},children:c.jsx("div",{style:{height:"100%",width:"35%",background:i.accent,borderRadius:100,animation:"shimmerSlide 1.4s ease-in-out infinite"}})})]})]})]})})]})}const Bd={SafecoPersonal:{name:"Safeco",abbr:"SFC",color:"#0F337A"},AssuranceAmerica:{name:"Assurance America",abbr:"AA",color:"#2768B5"},CommonWealthCasualty:{name:"Commonwealth Casualty",abbr:"CW",color:"#2D69EC"},Alinsco:{name:"Alinsco",abbr:"AL",color:"#20395D"},ACORDBOLTPersonalAuto:{name:"Bolt Auto",abbr:"BLT",color:"#1F2937"},ACORDBOLTPersonalHome:{name:"Bolt Home",abbr:"BLT",color:"#1F2937"},TwentyFirstCentury:{name:"21st Century",abbr:"21C",color:"#B2392A"},ACentral:{name:"A-Central",abbr:"ACT",color:"#EAAD1D"},AAA:{name:"AAA",abbr:"AAA",color:"#DB461C"},AARP:{name:"AARP",abbr:"ARP",color:"#DB4724"},Acadia:{name:"Acadia",abbr:"ACD",color:"#386B61"},Ace:{name:"ACE",abbr:"ACE",color:"#457D48"},Acuity:{name:"Acuity",abbr:"ACU",color:"#D74630"},AdirondackInsExchange:{name:"Adirondack",abbr:"ADK",color:"#1F5490"},Aegis:{name:"Aegis",abbr:"AEG",color:"#1A4675"},AIC:{name:"AIC",abbr:"AIC",color:"#508F47"},AIG:{name:"AIG",abbr:"AIG",color:"#223572"},AlfaAlliance:{name:"Alfa Alliance",abbr:"ALF",color:"#C13D17"},AllianzOfAmerica:{name:"Allianz",abbr:"ALZ",color:"#003781"},AllianzOfAmericaJefferson:{name:"Allianz Jefferson",abbr:"ALZ",color:"#003781"},Allied:{name:"Allied",abbr:"ALD",color:"#0047BB"},Allmerica:{name:"Allmerica",abbr:"ALM",color:"#003DA5"},Allstate:{name:"Allstate",abbr:"ALS",color:"#002F87"},AmericaFirst:{name:"America First",abbr:"AMF",color:"#003DA5"},AmericanCommerce:{name:"American Commerce",abbr:"ACM",color:"#003DA5"},AmericanFamily:{name:"American Family",abbr:"AMF",color:"#0033A0"},Amica:{name:"Amica",abbr:"AMI",color:"#003DA5"},Ameriprise:{name:"Ameriprise",abbr:"AMP",color:"#003DA5"},ASILloyds:{name:"ASI Lloyds",abbr:"ASI",color:"#003DA5"},Assurant:{name:"Assurant",abbr:"ASR",color:"#0033A0"},AtlasGeneralAgency:{name:"Atlas General",abbr:"ATL",color:"#1F3864"},AustinMutual:{name:"Austin Mutual",abbr:"AUS",color:"#1F3864"},Autoone:{name:"AutoOne",abbr:"AON",color:"#003DA5"},AutoOwners:{name:"Auto-Owners",abbr:"AO",color:"#C8102E"},BadgerMutual:{name:"Badger Mutual",abbr:"BDG",color:"#003DA5"},Balboa:{name:"Balboa",abbr:"BAL",color:"#1F3864"},Bamboo:{name:"Bamboo",abbr:"BMB",color:"#0F4C3A"},Bankers:{name:"Bankers",abbr:"BNK",color:"#1F3864"},BeaconNational:{name:"Beacon National",abbr:"BCN",color:"#003DA5"},BrethernMutual:{name:"Brethren Mutual",abbr:"BRT",color:"#1F3864"},BristolWest:{name:"Bristol West",abbr:"BW",color:"#003DA5"},BunkerHill:{name:"Bunker Hill",abbr:"BHL",color:"#1F3864"},CapitalInsuranceGroup:{name:"Capital Insurance",abbr:"CIG",color:"#003DA5"},Celina:{name:"Celina",abbr:"CEL",color:"#1F3864"},CentralMutualOfOH:{name:"Central Mutual",abbr:"CMO",color:"#003DA5"},Chubb:{name:"Chubb",abbr:"CHB",color:"#000000"},ChubbInsurance:{name:"Chubb",abbr:"CHB",color:"#000000"},Cincinnati:{name:"Cincinnati",abbr:"CIN",color:"#003DA5"},Citizens:{name:"Citizens",abbr:"CTZ",color:"#003DA5"},Clearcover:{name:"Clearcover",abbr:"CC",color:"#00B5E2"},CNA:{name:"CNA",abbr:"CNA",color:"#CC3232"},ColonialPenn:{name:"Colonial Penn",abbr:"CPN",color:"#0072CE"},ColoradoCasualty:{name:"Colorado Casualty",abbr:"COC",color:"#1F3864"},Columbia:{name:"Columbia",abbr:"CLM",color:"#003DA5"},CommerceWest:{name:"Commerce West",abbr:"CMW",color:"#003DA5"},CommonwealthCasualty:{name:"Commonwealth Casualty",abbr:"CW",color:"#1F3864"},ConstitutionalCasualty:{name:"Constitutional Casualty",abbr:"CON",color:"#1F3864"},Cornerstone:{name:"Cornerstone",abbr:"CRN",color:"#1F3864"},Countrywide:{name:"Countrywide",abbr:"CTW",color:"#003DA5"},CSE:{name:"CSE",abbr:"CSE",color:"#003DA5"},Cumberland:{name:"Cumberland",abbr:"CMB",color:"#1F3864"},Cypress:{name:"Cypress",abbr:"CYP",color:"#0F4C3A"},Dairyland:{name:"Dairyland",abbr:"DL",color:"#0072CE"},Deerbrook:{name:"Deerbrook",abbr:"DBK",color:"#1F3864"},Direct:{name:"Direct",abbr:"DIR",color:"#D52B1E"},Donegal:{name:"Donegal",abbr:"DON",color:"#003DA5"},Drive:{name:"Drive",abbr:"DRV",color:"#1F3864"},Electric:{name:"Electric",abbr:"ELC",color:"#003DA5"},EMC:{name:"EMC",abbr:"EMC",color:"#003DA5"},Encompass:{name:"Encompass",abbr:"ENC",color:"#002F87"},Erie:{name:"Erie",abbr:"ERI",color:"#005FAC"},Esurance:{name:"Esurance",abbr:"ESU",color:"#00A6CE"},ExcelsiorInsuranceCompany:{name:"Excelsior",abbr:"EXC",color:"#1F3864"},Explorer:{name:"Explorer",abbr:"EXP",color:"#1F3864"},FairPlan:{name:"FAIR Plan",abbr:"FPN",color:"#1F3864"},FarmBureau:{name:"Farm Bureau",abbr:"FB",color:"#00843D"},Farmers:{name:"Farmers",abbr:"FRM",color:"#1C428B"},Fidelity:{name:"Fidelity",abbr:"FID",color:"#00833F"},FiremansFund:{name:"Fireman's Fund",abbr:"FF",color:"#E31837"},FirstAmerican:{name:"First American",abbr:"FAM",color:"#003DA5"},Foremost:{name:"Foremost",abbr:"FOR",color:"#E31837"},ForemostInsuranceCompany:{name:"Foremost",abbr:"FOR",color:"#E31837"},Geico:{name:"GEICO",abbr:"GEI",color:"#0F4293"},GeneralCasualty:{name:"General Casualty",abbr:"GC",color:"#1F3864"},GermantownMutual:{name:"Germantown Mutual",abbr:"GTM",color:"#1F3864"},GMAC:{name:"GMAC",abbr:"GMA",color:"#003DA5"},Grange:{name:"Grange",abbr:"GRG",color:"#003DA5"},GreatAmerican:{name:"Great American",abbr:"GA",color:"#003DA5"},Grinnell:{name:"Grinnell Mutual",abbr:"GRN",color:"#E31837"},GuideOne:{name:"GuideOne",abbr:"GO",color:"#0072CE"},Hanover:{name:"Hanover",abbr:"HAN",color:"#003DA5"},Harbor:{name:"Harbor",abbr:"HBR",color:"#1F3864"},Harleysville:{name:"Harleysville",abbr:"HRL",color:"#003DA5"},Hartford:{name:"The Hartford",abbr:"HFD",color:"#7F1734"},HartfordOMNI:{name:"Hartford OMNI",abbr:"HOM",color:"#7F1734"},HastingsMutual:{name:"Hastings Mutual",abbr:"HST",color:"#1F3864"},HawkeyeSecurity:{name:"Hawkeye Security",abbr:"HWK",color:"#1F3864"},HDI:{name:"HDI",abbr:"HDI",color:"#00563F"},HippoInsuranceCompany:{name:"Hippo",abbr:"HPO",color:"#00C9A7"},HomeownersOfAmerica:{name:"Homeowners of America",abbr:"HOA",color:"#003DA5"},Homesite:{name:"Homesite",abbr:"HMS",color:"#0033A0"},HoraceMann:{name:"Horace Mann",abbr:"HM",color:"#003DA5"},HoustonGeneral:{name:"Houston General",abbr:"HG",color:"#1F3864"},IFA:{name:"IFA",abbr:"IFA",color:"#003DA5"},ImperialCasualty:{name:"Imperial Casualty",abbr:"IMP",color:"#1F3864"},Indiana:{name:"Indiana Insurance",abbr:"IND",color:"#003DA5"},IndianaFarmers:{name:"Indiana Farmers",abbr:"IFM",color:"#00843D"},Infinity:{name:"Infinity",abbr:"INF",color:"#E31837"},Insurequest:{name:"Insurequest",abbr:"INQ",color:"#1F3864"},Integon:{name:"Integon",abbr:"ITG",color:"#003DA5"},Integrity:{name:"Integrity",abbr:"ITY",color:"#1F3864"},Kemper:{name:"Kemper",abbr:"KMP",color:"#0033A0"},LibertyMutual:{name:"Liberty Mutual",abbr:"LM",color:"#FFD000"},LibertyNorthwest:{name:"Liberty Northwest",abbr:"LNW",color:"#FFD000"},Lloyds:{name:"Lloyd's",abbr:"LLY",color:"#003DA5"},MainStreetAmerica:{name:"Main Street America",abbr:"MSA",color:"#003DA5"},Mapfre:{name:"MAPFRE",abbr:"MAP",color:"#E31837"},MarkelInsuranceCompany:{name:"Markel",abbr:"MKL",color:"#003DA5"},Mendota:{name:"Mendota",abbr:"MND",color:"#1F3864"},MerchantsGroup:{name:"Merchants Group",abbr:"MRC",color:"#003DA5"},Mercury:{name:"Mercury",abbr:"MER",color:"#ED1C24"},Metlife:{name:"MetLife",abbr:"MET",color:"#0090DA"},Metropolitan:{name:"Metropolitan",abbr:"MTP",color:"#0090DA"},MidContinent:{name:"Mid-Continent",abbr:"MC",color:"#003DA5"},MidwesternIndemnity:{name:"Midwestern Indemnity",abbr:"MWI",color:"#003DA5"},Montgomery:{name:"Montgomery",abbr:"MTG",color:"#1F3864"},MSA:{name:"MSA",abbr:"MSA",color:"#003DA5"},MtWashington:{name:"Mt. Washington",abbr:"MTW",color:"#1F3864"},MutualBenefit:{name:"Mutual Benefit",abbr:"MB",color:"#1F3864"},NatGenPremier:{name:"NatGen Premier",abbr:"NGP",color:"#0033A0"},NationalGeneral:{name:"National General",abbr:"NG",color:"#0033A0"},Nationwide:{name:"Nationwide",abbr:"NW",color:"#204D9B"},NationwideScottsdale:{name:"Nationwide Scottsdale",abbr:"NWS",color:"#204D9B"},NewYorkCentralMutual:{name:"NY Central Mutual",abbr:"NYC",color:"#003DA5"},NJManufacturers:{name:"NJM Insurance",abbr:"NJM",color:"#003DA5"},NJSkylands:{name:"NJ Skylands",abbr:"NJS",color:"#003DA5"},Northstar:{name:"Northstar",abbr:"NST",color:"#1F3864"},Occidental:{name:"Occidental",abbr:"OCC",color:"#1F3864"},OhioCasualty:{name:"Ohio Casualty",abbr:"OHC",color:"#003DA5"},OmahaPC:{name:"Omaha P&C",abbr:"OMA",color:"#003DA5"},OneBeacon:{name:"OneBeacon",abbr:"OB",color:"#003DA5"},OregonMutual:{name:"Oregon Mutual",abbr:"ORE",color:"#003DA5"},Palisades:{name:"Palisades",abbr:"PAL",color:"#1F3864"},PeerlessMontgomery:{name:"Peerless Montgomery",abbr:"PRM",color:"#1F3864"},Pekin:{name:"Pekin",abbr:"PEK",color:"#003DA5"},Pemco:{name:"PEMCO",abbr:"PMC",color:"#0072CE"},PennNational:{name:"Penn National",abbr:"PN",color:"#003DA5"},PlymouthRock:{name:"Plymouth Rock",abbr:"PLR",color:"#003DA5"},PreferredMutual:{name:"Preferred Mutual",abbr:"PFM",color:"#003DA5"},Proformance:{name:"Proformance",abbr:"PRF",color:"#1F3864"},Progressive:{name:"Progressive",abbr:"PRG",color:"#0053BA"},Prudential:{name:"Prudential",abbr:"PRU",color:"#0033A0"},PureHighValue:{name:"PURE",abbr:"PUR",color:"#003DA5"},Republic:{name:"Republic",abbr:"REP",color:"#003DA5"},RockfordMutual:{name:"Rockford Mutual",abbr:"RKF",color:"#1F3864"},RoyalAndSunAlliance:{name:"Royal & SunAlliance",abbr:"RSA",color:"#003DA5"},Safeco:{name:"Safeco",abbr:"SFC",color:"#E4002B"},SECURA:{name:"SECURA",abbr:"SEC",color:"#003DA5"},Selective:{name:"Selective",abbr:"SEL",color:"#003DA5"},SouthernCounty:{name:"Southern County",abbr:"SCM",color:"#1F3864"},SouthernMutual:{name:"Southern Mutual",abbr:"SM",color:"#1F3864"},SouthernTrust:{name:"Southern Trust",abbr:"ST",color:"#1F3864"},StPaulTravelers:{name:"St. Paul Travelers",abbr:"SPT",color:"#C8102E"},StandardMutual:{name:"Standard Mutual",abbr:"STM",color:"#1F3864"},StarCasualty:{name:"Star Casualty",abbr:"SC",color:"#1F3864"},StateAuto:{name:"State Auto",abbr:"SA",color:"#003DA5"},StateFarm:{name:"State Farm",abbr:"SF",color:"#CC0717"},StateFarmFloridaInsuranceCompany:{name:"State Farm Florida",abbr:"SFF",color:"#CC0717"},SunshineStateInsuranceCompany:{name:"Sunshine State",abbr:"SSS",color:"#FFC72C"},Travelers:{name:"Travelers",abbr:"TRV",color:"#C8102E"},Tower:{name:"Tower",abbr:"TWR",color:"#1F3864"},TWFG:{name:"TWFG",abbr:"TWF",color:"#003DA5"},Unigard:{name:"Unigard",abbr:"UNG",color:"#1F3864"},UnitedFireAndCasualty:{name:"United Fire & Casualty",abbr:"UFC",color:"#003DA5"},Unitrin:{name:"Unitrin",abbr:"UTN",color:"#003DA5"},Universal:{name:"Universal",abbr:"UNV",color:"#003DA5"},USAA:{name:"USAA",abbr:"USA",color:"#1A3258"},UticaNational:{name:"Utica National",abbr:"UTC",color:"#003DA5"},Victoria:{name:"Victoria",abbr:"VIC",color:"#1F3864"},Wellington:{name:"Wellington",abbr:"WLG",color:"#1F3864"},WestBend:{name:"West Bend",abbr:"WB",color:"#003DA5"},WesternNational:{name:"Western National",abbr:"WN",color:"#003DA5"},WesternReserveGroup:{name:"Western Reserve",abbr:"WR",color:"#003DA5"},Westfield:{name:"Westfield",abbr:"WF",color:"#F05136"},WhiteMountains:{name:"White Mountains",abbr:"WM",color:"#1F3864"},WilsonMutual:{name:"Wilson Mutual",abbr:"WLM",color:"#1F3864"},Windsor:{name:"Windsor",abbr:"WIN",color:"#1F3864"},Zurich:{name:"Zurich",abbr:"ZUR",color:"#003399"}},Po=["#0369A1","#1D4ED8","#0F766E","#7C3AED","#B45309","#DC2626","#0891B2","#9333EA"];function xd(e){return e.replace(/[^A-Za-z0-9]/g,"").slice(0,3).toUpperCase()||"CAR"}function zd(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").trim()}function Rd(e){const t=new Set,r=[];return e.forEach((n,o)=>{const a=Bd[n]??{name:zd(n),abbr:xd(n),color:Po[o%Po.length]};t.has(a.name)||(t.add(a.name),r.push(a))}),r}function Hd(e,t){if(!e)return[];const r=[];return(t==="Auto"||t==="Bundle")&&Array.isArray(e.PersonalAuto)&&r.push(...e.PersonalAuto),(t==="Home"||t==="Bundle")&&Array.isArray(e.PersonalHome)&&r.push(...e.PersonalHome),Rd(r)}function U(e){if(e===!0)return"Yes";if(e===!1)return"No"}function ke(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 Ud(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=ke(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=ke(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=U(t.is_mailing_address_different)),t.mailing_address&&(r.mailing_address=t.mailing_address),t.effective_date&&(r.effective_date=ke(t.effective_date)),t.auto_has_prior_insurance!==null&&t.auto_has_prior_insurance!==void 0&&(r.auto_has_prior_insurance=U(t.auto_has_prior_insurance)),t.auto_prior_expiration_date&&(r.auto_prior_expiration_date=ke(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=U(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=U(t.home_has_prior_insurance)),t.home_prior_expiration_date&&(r.home_prior_expiration_date=ke(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=U(t.property_insurance_cancelled)),t.lapse_in_coverage!==null&&t.lapse_in_coverage!==void 0&&(r.lapse_in_coverage=U(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=U(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=U(t.mit_credit_form)),t.storm_shutters!==null&&t.storm_shutters!==void 0&&(r.storm_shutters=U(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=U(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=U(t.has_vicious_animals)),t.has_business_on_premises!==null&&t.has_business_on_premises!==void 0&&(r.has_business_on_premises=U(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=U(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=U(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=U(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=U(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=U(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=U(t.has_garage)),t.has_pool!==null&&t.has_pool!==void 0&&(r.has_pool=U(t.has_pool)),t.has_trampoline!==null&&t.has_trampoline!==void 0&&(r.has_trampoline=U(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=U(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=ke(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=U(t.retiree_discount)),t.gated_community_discount!==null&&t.gated_community_discount!==void 0&&(r.gated_community_discount=U(t.gated_community_discount)),t.multi_policy_discount!==null&&t.multi_policy_discount!==void 0&&(r.multi_policy_discount=U(t.multi_policy_discount)),t.non_smoker_discount!==null&&t.non_smoker_discount!==void 0&&(r.non_smoker_discount=U(t.non_smoker_discount)),t.first_time_buyer_discount!==null&&t.first_time_buyer_discount!==void 0&&(r.first_time_buyer_discount=U(t.first_time_buyer_discount)),t.fire_detection_system!==null&&t.fire_detection_system!==void 0&&(r.fire_detection_system=U(t.fire_detection_system)),t.burglar_alarm_system!==null&&t.burglar_alarm_system!==void 0&&(r.burglar_alarm_system=U(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=U(t.smoke_detectors)),t.sprinkler_system!==null&&t.sprinkler_system!==void 0&&(r.sprinkler_system=U(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=U(t.gas_leakage_detector)),t.deadbolt_locks!==null&&t.deadbolt_locks!==void 0&&(r.deadbolt_locks=U(t.deadbolt_locks)),t.fire_extinguisher!==null&&t.fire_extinguisher!==void 0&&(r.fire_extinguisher=U(t.fire_extinguisher)),t.order_credit_authorized!==null&&t.order_credit_authorized!==void 0&&(r.order_credit_authorized=U(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=U(t.has_health_insurance_auto_accident)),t.is_corporation!==null&&t.is_corporation!==void 0&&(r.is_corporation=U(t.is_corporation)),t.named_insured_foreclosure_repo_bankruptcy!==null&&t.named_insured_foreclosure_repo_bankruptcy!==void 0&&(r.named_insured_foreclosure_repo_bankruptcy=U(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=U(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,l={};s.first_name&&(l.first_name=s.first_name),s.middle_name&&(l.middle_name=s.middle_name),s.last_name&&(l.last_name=s.last_name),s.date_of_birth&&(l.date_of_birth=ke(s.date_of_birth)),s.gender&&(l.gender=s.gender),s.marital_status&&(l.marital_status=s.marital_status),s.relationship_to_insured&&(l.relationship_to_insured=s.relationship_to_insured),s.is_registered_owner!==null&&s.is_registered_owner!==void 0&&(l.is_registered_owner=s.is_registered_owner?"Yes":"No"),s.license_state&&(l.license_state=s.license_state),s.license_status&&(l.license_status=s.license_status),s.license_number&&(l.license_number=s.license_number),s.date_first_licensed&&(l.date_first_licensed=ke(s.date_first_licensed)),s.education_level&&(l.education_level=Qn(s.education_level)),s.occupation&&(l.occupation=Xn(s.occupation)),s.industry&&(l.industry=Pt(s.industry)),s.employment_status&&(l.employment_status=s.employment_status),s.last_5_years_license_suspended_or_revoked!==null&&s.last_5_years_license_suspended_or_revoked!==void 0&&(l.last_5_years_license_suspended_or_revoked=U(s.last_5_years_license_suspended_or_revoked)),s.accident_prevention_course!==null&&s.accident_prevention_course!==void 0&&(l.accident_prevention_course=U(s.accident_prevention_course)),s.accident_prevention_course_date&&(l.accident_prevention_course_date=ke(s.accident_prevention_course_date)),s.sr22!==null&&s.sr22!==void 0&&(l.sr22=U(s.sr22));const u=s.ssn_display;typeof u=="string"&&(l.ssn_display=u);const d=s.driver_violations;d&&d.length>0&&(l.driver_violations="Yes",l.driver_violations__items=d.map(h=>{const S={};return h.code&&(S.code=h.code),h.occurred_at&&(S.occurred_at=ke(h.occurred_at)),S}));const m=s.driver_accidents;m&&m.length>0&&(l.driver_accidents="Yes",l.driver_accidents__items=m.map(h=>{const S={};return h.occurred_at&&(S.occurred_at=ke(h.occurred_at)),h.description&&(S.description=h.description),h.quote_vehicle_id&&(S.quote_vehicle_id=i[h.quote_vehicle_id]??h.quote_vehicle_id),h.property_damage_amount_paid_cents!==null&&h.property_damage_amount_paid_cents!==void 0&&(S.property_damage_amount_paid_cents=h.property_damage_amount_paid_cents),h.personal_injury_amount_paid_cents!==null&&h.personal_injury_amount_paid_cents!==void 0&&(S.personal_injury_amount_paid_cents=h.personal_injury_amount_paid_cents),S}));const b=s.losses;return b&&b.length>0&&(l.losses="Yes",l.losses__items=b.map(h=>{const S={};return h.description&&(S.description=h.description),h.date_of_incident&&(S.date_of_incident=ke(h.date_of_incident)),h.amount_paid_cents!==null&&h.amount_paid_cents!==void 0&&(S.amount_paid_cents=h.amount_paid_cents),h.quote_vehicle_id&&(S.quote_vehicle_id=i[h.quote_vehicle_id]??h.quote_vehicle_id),S})),l})):r.drivers="No",t.vehicles&&t.vehicles.length>0?(r.vehicles="Yes",r.vehicles__items=t.vehicles.map(a=>{const s=a,l={};s.vin&&(l.vin=s.vin),s.year!==null&&s.year!==void 0&&(l.year=String(s.year)),s.make&&(l.make=s.make),s.model&&(l.model=s.model),s.body_style&&(l.body_style=s.body_style),s.ownership_type&&(l.ownership_type=s.ownership_type),s.usage&&(l.usage=s.usage),s.annual_mileage!==null&&s.annual_mileage!==void 0&&(l.annual_mileage=s.annual_mileage),s.miles_to_work!==null&&s.miles_to_work!==void 0&&(l.miles_to_work=s.miles_to_work),s.percent_to_work!==null&&s.percent_to_work!==void 0&&(l.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&&(l.garaging_address=u.join(", ")),s.new_when_purchased!==null&&s.new_when_purchased!==void 0&&(l.new_when_purchased=U(s.new_when_purchased)),s.purchase_date&&(l.purchase_date=ke(s.purchase_date)),s.anti_theft_type&&(l.anti_theft_type=s.anti_theft_type),s.passive_restraint_type&&(l.passive_restraint_type=s.passive_restraint_type),s.anti_lock_brakes!==null&&s.anti_lock_brakes!==void 0&&(l.anti_lock_brakes=U(s.anti_lock_brakes)),s.daytime_running_lights!==null&&s.daytime_running_lights!==void 0&&(l.daytime_running_lights=U(s.daytime_running_lights)),s.custom_equipment_value_cents!==null&&s.custom_equipment_value_cents!==void 0&&(l.custom_equipment_value_cents=s.custom_equipment_value_cents),s.cost_new_value_cents!==null&&s.cost_new_value_cents!==void 0&&(l.cost_new_value_cents=s.cost_new_value_cents),s.stated_value_amount_cents!==null&&s.stated_value_amount_cents!==void 0&&(l.stated_value_amount_cents=s.stated_value_amount_cents),s.vehicle_has_modifications!==null&&s.vehicle_has_modifications!==void 0&&(l.vehicle_has_modifications=U(s.vehicle_has_modifications)),s.vehicle_garaged_at_residence!==null&&s.vehicle_garaged_at_residence!==void 0&&(l.vehicle_garaged_at_residence=U(s.vehicle_garaged_at_residence)),s.vehicle_comp_deductible&&(l.vehicle_comp_deductible=s.vehicle_comp_deductible),s.vehicle_coll_deductible&&(l.vehicle_coll_deductible=s.vehicle_coll_deductible),s.vehicle_towing_and_labor&&(l.vehicle_towing_and_labor=s.vehicle_towing_and_labor),s.vehicle_transportation_expense&&(l.vehicle_transportation_expense=s.vehicle_transportation_expense),s.vehicle_full_glass!==null&&s.vehicle_full_glass!==void 0&&(l.vehicle_full_glass=U(s.vehicle_full_glass)),s.vehicle_loan_lease!==null&&s.vehicle_loan_lease!==void 0&&(l.vehicle_loan_lease=U(s.vehicle_loan_lease)),s.coverages&&s.coverages.length>0&&(l.coverages__items=s.coverages.map(d=>{const m={};return d.type&&(m.type=d.type),d.per_person_limit_cents!==null&&d.per_person_limit_cents!==void 0&&(m.per_person_limit_cents=d.per_person_limit_cents),d.per_incident_limit_cents!==null&&d.per_incident_limit_cents!==void 0&&(m.per_incident_limit_cents=d.per_incident_limit_cents),d.per_incident_limit_percent!==null&&d.per_incident_limit_percent!==void 0&&(m.per_incident_limit_percent=d.per_incident_limit_percent),d.per_day_limit_cents!==null&&d.per_day_limit_cents!==void 0&&(m.per_day_limit_cents=d.per_day_limit_cents),d.deductible_cents!==null&&d.deductible_cents!==void 0&&(m.deductible_cents=d.deductible_cents),d.is_declined!==null&&d.is_declined!==void 0&&(m.is_declined=U(d.is_declined)),m})),s.vehicle_lienholders&&s.vehicle_lienholders.length>0&&(l.vehicle_lienholders__items=s.vehicle_lienholders.map(d=>{const m={};return d.name&&(m.name=d.name),d.type&&(m.type=d.type),d.line_1&&(m.line_1=d.line_1),d.line_2&&(m.line_2=d.line_2),d.city&&(m.city=d.city),d.state&&(m.state=d.state),d.postal_code&&(m.postal_code=d.postal_code),d.phone&&(m.phone=d.phone),d.fax&&(m.fax=d.fax),m})),l})):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=ke(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 Zd=new Set(["Product","Driver","Vehicle"]);function Wd(e){return e?Array.isArray(e.drivers__items)?e.drivers__items.length:Array.isArray(e.drivers)?e.drivers.length:null:null}function Fo(e,t){const r=Wd(t),n=e.filter(i=>i.key!=="AutoPolicy"),o=n.length>0?n:e;return o}function Or(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(m=>{typeof m=="object"&&m!==null&&Object.keys(m).forEach(b=>{o.add(b)})}));for(const[u,d]of Object.entries(e))if(u.endsWith("__items")){const m=u.replace("__items","");if(n.includes(m)){const h=Array.isArray(d)?d.map(S=>Or(S)):d;t[m]=h}}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=Qn(d.education_level),d.occupation=Xn(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 m=u;console.log(`[DEBUG_TRANSFORM] Driver ${d}:`,{first_name:m.first_name,gender:m.gender,marital_status:m.marital_status,education_level:m.education_level,industry:m.industry,occupation:m.occupation,sr22:m.sr22,keys:Object.keys(m)})});const l=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 m=Math.min(d,l);t.sale_price_cents=m*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,m=d.amount_paid_cents;if(typeof m!="number"||!Number.isFinite(m))return d;const b=Math.trunc(m),h=Math.min(Math.max(b,0),l);return{...d,amount_paid_cents:h*100}})),t}function Gd(e,t){const r=e.findIndex(o=>o.key===t);return r<0?t:e[r+1]?.key??t}function $o(e){return e.some(t=>String(t.key)==="BundlePolicy"||String(t.key)==="BundleCustomer")}function Bo(e){return $o(e)?"Bundle":e.some(t=>String(t.key)==="Vehicle"||String(t.key)==="Driver")?"Auto":"Home"}const jd={Auto:45e3,Home:5e4,Bundle:1e5};function Vd(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 Yd(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 Kd({isOpen:e,onClose:t}){const[r,n]=p.useState([]),[o,i]=p.useState(null),a=p.useRef(null);p.useEffect(()=>{a.current=o},[o]);const[s,l]=p.useState(null),[u,d]=p.useState(!1),[m,b]=p.useState(!1),[h,S]=p.useState([]),g=p.useRef(null),[Y,R]=p.useState(null),[K,V]=p.useState(void 0),[G,L]=p.useState(!1),X=p.useRef(!1);p.useEffect(()=>{if(!u||m)return;const F=Bo(r);let $=!1;const Q=[];let ie=0;const Z=8,z=5e3,f=async()=>{if($)return;ie++;try{const{quote:M}=await oo();if($)return;const k=M?.appetites??null,ee=Hd(k,F);if(ee.length>0){S(ee);return}}catch(M){console.warn("Provider polling: getQuote failed",M)}if($||ie>=Z)return;const A=window.setTimeout(f,z);Q.push(A)};return f(),()=>{$=!0,Q.forEach(A=>window.clearTimeout(A))}},[u,m,r]);function H(F){const $={SMSVerification:"Verify",Name:"Basic Details",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 Q=F.map(Z=>({key:Z,title:$[Z]||Z,loadQuestions:async()=>{const z=await Gu(Z,a.current??void 0);let f=Vd(Z,z.questions);return f=Yd(Z,f),f}}));if(F.includes("Vehicle")&&F.includes("Driver")&&F.includes("AutoCurrentCarrier")&&F.includes("Customer")){const Z=Q.findIndex(z=>z.key==="Product");if(Z>=0){const z=Q.slice(0,Z+1),f=Q.slice(Z+1),A=ee=>f.find(C=>C.key===ee)??null,M=[A("Vehicle"),A("Driver"),A("AutoCurrentCarrier"),A("Customer")].filter(ee=>!!ee),k=f.filter(ee=>!["Vehicle","Driver","AutoCurrentCarrier","Customer","AutoPolicy"].includes(String(ee.key)));Q=[...z,...M,...k]}}return Q}p.useEffect(()=>{const F=async()=>{try{const $=zu();if(Sr(),$){L(!0),i($);try{const Q=xt(),ie=await oo(Q?void 0:$);if(!ie||!ie.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:Z}=ie,{stages:z}=await zt($),f=H(z);n(f);let A;try{A=Ud(Z),R(A)}catch(k){throw new Error(`Failed to transform quote data: ${k instanceof Error?k.message:"Unknown error"}`)}const M=Fo(f,A);if(n(M),Z.current_stage){const k=Z.current_stage==="State"?"Product":Z.current_stage,ee=M.findIndex(C=>C.key===k);ee>=0?V(ee):V(M.length-1)}else V(M.length-1)}catch(Q){const ie=Q;if(ie.statusCode===404)to(),i(null);else if(ie.statusCode===401){no();try{const{stages:Z}=await zt($),z=H(Z);n(z);const f=z.findIndex(A=>A.key==="SMSVerification");f>=0&&V(f)}catch{}}}finally{L(!1)}}else{const{stages:Q}=await zt();n(H(Q))}}catch{L(!1)}};e&&!X.current&&(X.current=!0,F())},[e]),p.useEffect(()=>{if(!e)return;const{overflow:F}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=F}},[e]);const ae=p.useCallback(F=>{F.key==="Escape"&&(ho(),t())},[t]);if(p.useEffect(()=>{if(e)return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[e,ae]),p.useEffect(()=>{e||(R(null),V(void 0),L(!1),d(!1))},[e]),p.useEffect(()=>{e&&gd()},[e]),p.useEffect(()=>{s&&Array.isArray(s)&&vd({rateCount:s.length})},[s]),!e)return null;const J=()=>{ho(),t()};return c.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"insurance-modal-title",children:[c.jsx("div",{className:"backdrop","aria-hidden":"true"}),c.jsxs("div",{className:"modal-panel bg-white relative w-full max-w-2xl flex flex-col max-h-[90vh] overflow-hidden",role:"document",children:[c.jsx("button",{onClick:J,className:"modal-close-btn absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-xl","aria-label":"Close",type:"button",children:"×"}),!u&&c.jsx("div",{className:"text-center mb-6",children:c.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's get you the best insurance rates."})}),c.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[u&&(()=>{const F=Bo(r);return c.jsx($d,{providers:h,totalTime:jd[F],flow:F,isComplete:m,onComplete:()=>{d(!1),b(!1),S([]),g.current&&(l(g.current),g.current=null)}})})(),!s&&!u&&c.jsx(c.Fragment,{children:G||r.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"text-slate-600",children:"Loading..."})}):c.jsx(Id,{stages:r,initialValues:Y??void 0,initialActive:K,quoteId:o??void 0,onStageComplete:async(F,$)=>{try{const Q=Or(F);let ie=o,Z=r;const z=Z.findIndex(M=>M.key===$),f=Z[z],A=Gd(Z,$);if(ie)if($==="SMSVerification"){const{isVerified:M,token:k}=await Vu(ie,Q.sms_code);if(!M)throw new Error("Invalid SMS code");k&&Zu(k),await ft({current_stage:A},!1)}else if($==="Product"){const{isSupported:M}=await Yu(Q.state);if(!M)throw new Error("State is not supported");const k=xt();await ft({...Q,current_stage:A},!1,k?void 0:ie)}else{const M=xt();await ft({...Q,current_stage:A},!1,M?void 0:ie||void 0)}else{const k=(await ju(Q.phone))?.quoteId;if(!k||typeof k!="string"||k.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${k}`);ie=k,i(k),xu(k),await ft({current_stage:A},!1,k)}if(Zd.has($))try{const{stages:M}=await zt(ie||void 0);Z=H(M),Z=Fo(Z,F),n(Z)}catch(M){console.warn("Unable to refresh stages after flow-shaping step",M)}return go({stageKey:$,stageTitle:f?.title??$,stepIndex:z+1,totalSteps:Z.length}),{success:!0}}catch(Q){return{success:!1,error:Q instanceof Error?Q.message:"An error occurred"}}},onComplete:async F=>{try{const $=Or(F);if(!o)throw new Error("Quote ID is required");R(F),S([]),b(!1),g.current=null,d(!0);try{await ft($,!0);const{rates:Z}=await Ku();g.current=Z,b(!0)}catch(Z){throw d(!1),Z}const Q=r.length,ie=r[Q-1];return go({stageKey:ie?.key??"unknown",stageTitle:ie?.title??"unknown",stepIndex:Q,totalSteps:Q}),bd(),{success:!0}}catch{return{success:!1,error:"Oops, something went wrong. Please try again later."}}}})})," ",s&&o&&c.jsx(Dd,{rates:s,onBack:()=>l(null),isBundleFlow:$o(r)})]}),c.jsx("div",{className:"mt-4 pt-4 border-t border-slate-200",children:c.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})})]})]})}function qd({isOpen:e}){return c.jsx(Kd,{isOpen:e,onClose:()=>{Gt.close()}})}let xe=null,Ke=null,Wt=!1;function Jd(){xe||(xe=document.createElement("div"),xe.id="insurance-widget-root",document.documentElement.appendChild(xe)),!Ke&&xe&&(Ke=Ho.createRoot(xe))}function Ir(){Jd(),Ke&&Ke.render(p.createElement(qd,{isOpen:Wt}))}function Qd(){Ke&&xe&&(Ke.unmount(),xe.remove()),Ke=null,xe=null}const Gt={init:e=>{Wt=!!e?.autoOpen,Ir()},open:()=>{Wt=!0,Ir()},close:()=>{Wt=!1,Ir()},destroy:Qd};typeof window<"u"&&(window.CredifyInsuranceWidget=Gt),Le.CredifyInsuranceWidget=Gt,Le.default=Gt,Object.defineProperties(Le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
75
+ `}),c.jsx("div",{style:{background:"#F8FAFC",display:"flex",alignItems:"center",justifyContent:"center",padding:"2rem",fontFamily:"'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",height:"100%",minHeight:400,overflowY:"auto"},children:c.jsxs("div",{style:{width:"100%",maxWidth:560},children:[c.jsxs("div",{style:{textAlign:"center",marginBottom:40},children:[c.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,background:i.accent+"12",border:`1px solid ${i.accent}30`,borderRadius:100,padding:"6px 16px",marginBottom:16},children:[c.jsx("span",{style:{fontSize:14},children:i.icon}),c.jsx("span",{style:{fontSize:12,fontWeight:700,color:i.accent,letterSpacing:"0.1em",textTransform:"uppercase"},children:i.label})]}),c.jsx("h1",{style:{fontSize:26,fontWeight:700,color:"#0F172A",margin:0,letterSpacing:"-0.02em",lineHeight:1.3},children:z?"Connecting to top carriers":"Fetching your best rates"}),c.jsx("p",{style:{fontSize:14,color:"#64748B",marginTop:8,marginBottom:0},children:z?"Identifying the carriers eligible for your quote...":V?"Still gathering — a few carriers are taking a little longer...":"We're reaching out to multiple insurers on your behalf"})]}),c.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:32},children:z?c.jsx("div",{style:{display:"flex",gap:20},children:[0,1,2,3,4].map(te=>c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6},children:[c.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${te*.12}s`}}),c.jsx("div",{style:{width:40,height:8,borderRadius:4,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${te*.12}s`}})]},`skeleton-${te}`))}):ne?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("div",{style:{width:64,height:64,borderRadius:18,background:ne.color+"18",border:`2px solid ${ne.color}`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:16,color:ne.color,position:"relative",animation:"providerPulse 1.8s ease-in-out infinite"},children:[ne.abbr,c.jsx("div",{style:{position:"absolute",inset:-5,borderRadius:22,border:`2px solid ${ne.color}`,pointerEvents:"none",animation:"ringPulse 1.6s ease-in-out infinite"}})]}),c.jsx("span",{style:{fontSize:13,fontWeight:600,color:ne.color,letterSpacing:"0.04em"},children:ne.name})]}):null}),c.jsxs("div",{className:`iq-card-fade ${g?"iq-card-visible":"iq-card-hidden"}`,style:{background:"#FFFFFF",borderRadius:24,border:"1px solid #E2E8F0",padding:32},children:[c.jsx("div",{style:{display:"flex",alignItems:"center",gap:20,marginBottom:28},children:z||!ne?c.jsxs("div",{style:{flex:1,textAlign:"center",padding:"8px 0"},children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 6px"},children:"Please wait"}),c.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:"Checking eligible providers"}),c.jsx("p",{style:{fontSize:13,color:"#64748B",margin:0},children:"Reviewing your details against our carrier network"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{position:"relative",flexShrink:0},children:[c.jsx(Dd,{progress:p,color:ne.color,size:80}),c.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsxs("span",{style:{fontSize:14,fontWeight:700,color:ne.color},children:[Math.round(p),"%"]})})]}),c.jsxs("div",{style:{flex:1},children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 4px"},children:V?"Still checking":"Now checking"}),c.jsx("h2",{style:{fontSize:20,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:ne.name}),c.jsx("p",{className:"iq-status-text",style:{fontSize:13,color:"#64748B",margin:0},children:Mr[y]},`${s}-${y}`)]})]})}),c.jsxs("div",{children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.08em",textTransform:"uppercase",margin:"0 0 8px"},children:z?"Initializing":"Gathering quotes"}),c.jsx("div",{style:{height:6,background:"#F1F5F9",borderRadius:100,overflow:"hidden"},children:c.jsx("div",{style:{height:"100%",width:"35%",background:i.accent,borderRadius:100,animation:"shimmerSlide 1.4s ease-in-out infinite"}})})]})]})]})})]})}function Fd({message:e,onRetry:t,onEdit:r,isRetrying:n=!1}){return c.jsxs("section",{className:"mt-4",children:[c.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50 p-5",children:[c.jsx("h3",{className:"text-base font-semibold text-red-700",children:"We couldn't submit your quote"}),c.jsx("p",{className:"mt-2 text-sm text-red-700",children:e})]}),c.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-3",children:[c.jsx("button",{type:"button",onClick:r,disabled:n,className:"h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition disabled:opacity-50 disabled:cursor-not-allowed",children:"Edit details"}),c.jsx("button",{type:"button",onClick:t,disabled:n,className:"h-12 rounded-full bg-blue-600 text-white font-semibold hover:bg-blue-700 transition disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Trying again…":"Try again"})]})]})}const $d={SafecoPersonal:{name:"Safeco",abbr:"SFC",color:"#0F337A"},AssuranceAmerica:{name:"Assurance America",abbr:"AA",color:"#2768B5"},CommonWealthCasualty:{name:"Commonwealth Casualty",abbr:"CW",color:"#2D69EC"},Alinsco:{name:"Alinsco",abbr:"AL",color:"#20395D"},ACORDBOLTPersonalAuto:{name:"Bolt Auto",abbr:"BLT",color:"#1F2937"},ACORDBOLTPersonalHome:{name:"Bolt Home",abbr:"BLT",color:"#1F2937"},TwentyFirstCentury:{name:"21st Century",abbr:"21C",color:"#B2392A"},ACentral:{name:"A-Central",abbr:"ACT",color:"#EAAD1D"},AAA:{name:"AAA",abbr:"AAA",color:"#DB461C"},AARP:{name:"AARP",abbr:"ARP",color:"#DB4724"},Acadia:{name:"Acadia",abbr:"ACD",color:"#386B61"},Ace:{name:"ACE",abbr:"ACE",color:"#457D48"},Acuity:{name:"Acuity",abbr:"ACU",color:"#D74630"},AdirondackInsExchange:{name:"Adirondack",abbr:"ADK",color:"#1F5490"},Aegis:{name:"Aegis",abbr:"AEG",color:"#1A4675"},AIC:{name:"AIC",abbr:"AIC",color:"#508F47"},AIG:{name:"AIG",abbr:"AIG",color:"#223572"},AlfaAlliance:{name:"Alfa Alliance",abbr:"ALF",color:"#C13D17"},AllianzOfAmerica:{name:"Allianz",abbr:"ALZ",color:"#003781"},AllianzOfAmericaJefferson:{name:"Allianz Jefferson",abbr:"ALZ",color:"#003781"},Allied:{name:"Allied",abbr:"ALD",color:"#0047BB"},Allmerica:{name:"Allmerica",abbr:"ALM",color:"#003DA5"},Allstate:{name:"Allstate",abbr:"ALS",color:"#002F87"},AmericaFirst:{name:"America First",abbr:"AMF",color:"#003DA5"},AmericanCommerce:{name:"American Commerce",abbr:"ACM",color:"#003DA5"},AmericanFamily:{name:"American Family",abbr:"AMF",color:"#0033A0"},Amica:{name:"Amica",abbr:"AMI",color:"#003DA5"},Ameriprise:{name:"Ameriprise",abbr:"AMP",color:"#003DA5"},ASILloyds:{name:"ASI Lloyds",abbr:"ASI",color:"#003DA5"},Assurant:{name:"Assurant",abbr:"ASR",color:"#0033A0"},AtlasGeneralAgency:{name:"Atlas General",abbr:"ATL",color:"#1F3864"},AustinMutual:{name:"Austin Mutual",abbr:"AUS",color:"#1F3864"},Autoone:{name:"AutoOne",abbr:"AON",color:"#003DA5"},AutoOwners:{name:"Auto-Owners",abbr:"AO",color:"#C8102E"},BadgerMutual:{name:"Badger Mutual",abbr:"BDG",color:"#003DA5"},Balboa:{name:"Balboa",abbr:"BAL",color:"#1F3864"},Bamboo:{name:"Bamboo",abbr:"BMB",color:"#0F4C3A"},Bankers:{name:"Bankers",abbr:"BNK",color:"#1F3864"},BeaconNational:{name:"Beacon National",abbr:"BCN",color:"#003DA5"},BrethernMutual:{name:"Brethren Mutual",abbr:"BRT",color:"#1F3864"},BristolWest:{name:"Bristol West",abbr:"BW",color:"#003DA5"},BunkerHill:{name:"Bunker Hill",abbr:"BHL",color:"#1F3864"},CapitalInsuranceGroup:{name:"Capital Insurance",abbr:"CIG",color:"#003DA5"},Celina:{name:"Celina",abbr:"CEL",color:"#1F3864"},CentralMutualOfOH:{name:"Central Mutual",abbr:"CMO",color:"#003DA5"},Chubb:{name:"Chubb",abbr:"CHB",color:"#000000"},ChubbInsurance:{name:"Chubb",abbr:"CHB",color:"#000000"},Cincinnati:{name:"Cincinnati",abbr:"CIN",color:"#003DA5"},Citizens:{name:"Citizens",abbr:"CTZ",color:"#003DA5"},Clearcover:{name:"Clearcover",abbr:"CC",color:"#00B5E2"},CNA:{name:"CNA",abbr:"CNA",color:"#CC3232"},ColonialPenn:{name:"Colonial Penn",abbr:"CPN",color:"#0072CE"},ColoradoCasualty:{name:"Colorado Casualty",abbr:"COC",color:"#1F3864"},Columbia:{name:"Columbia",abbr:"CLM",color:"#003DA5"},CommerceWest:{name:"Commerce West",abbr:"CMW",color:"#003DA5"},CommonwealthCasualty:{name:"Commonwealth Casualty",abbr:"CW",color:"#1F3864"},ConstitutionalCasualty:{name:"Constitutional Casualty",abbr:"CON",color:"#1F3864"},Cornerstone:{name:"Cornerstone",abbr:"CRN",color:"#1F3864"},Countrywide:{name:"Countrywide",abbr:"CTW",color:"#003DA5"},CSE:{name:"CSE",abbr:"CSE",color:"#003DA5"},Cumberland:{name:"Cumberland",abbr:"CMB",color:"#1F3864"},Cypress:{name:"Cypress",abbr:"CYP",color:"#0F4C3A"},Dairyland:{name:"Dairyland",abbr:"DL",color:"#0072CE"},Deerbrook:{name:"Deerbrook",abbr:"DBK",color:"#1F3864"},Direct:{name:"Direct",abbr:"DIR",color:"#D52B1E"},Donegal:{name:"Donegal",abbr:"DON",color:"#003DA5"},Drive:{name:"Drive",abbr:"DRV",color:"#1F3864"},Electric:{name:"Electric",abbr:"ELC",color:"#003DA5"},EMC:{name:"EMC",abbr:"EMC",color:"#003DA5"},Encompass:{name:"Encompass",abbr:"ENC",color:"#002F87"},Erie:{name:"Erie",abbr:"ERI",color:"#005FAC"},Esurance:{name:"Esurance",abbr:"ESU",color:"#00A6CE"},ExcelsiorInsuranceCompany:{name:"Excelsior",abbr:"EXC",color:"#1F3864"},Explorer:{name:"Explorer",abbr:"EXP",color:"#1F3864"},FairPlan:{name:"FAIR Plan",abbr:"FPN",color:"#1F3864"},FarmBureau:{name:"Farm Bureau",abbr:"FB",color:"#00843D"},Farmers:{name:"Farmers",abbr:"FRM",color:"#1C428B"},Fidelity:{name:"Fidelity",abbr:"FID",color:"#00833F"},FiremansFund:{name:"Fireman's Fund",abbr:"FF",color:"#E31837"},FirstAmerican:{name:"First American",abbr:"FAM",color:"#003DA5"},Foremost:{name:"Foremost",abbr:"FOR",color:"#E31837"},ForemostInsuranceCompany:{name:"Foremost",abbr:"FOR",color:"#E31837"},Geico:{name:"GEICO",abbr:"GEI",color:"#0F4293"},GeneralCasualty:{name:"General Casualty",abbr:"GC",color:"#1F3864"},GermantownMutual:{name:"Germantown Mutual",abbr:"GTM",color:"#1F3864"},GMAC:{name:"GMAC",abbr:"GMA",color:"#003DA5"},Grange:{name:"Grange",abbr:"GRG",color:"#003DA5"},GreatAmerican:{name:"Great American",abbr:"GA",color:"#003DA5"},Grinnell:{name:"Grinnell Mutual",abbr:"GRN",color:"#E31837"},GuideOne:{name:"GuideOne",abbr:"GO",color:"#0072CE"},Hanover:{name:"Hanover",abbr:"HAN",color:"#003DA5"},Harbor:{name:"Harbor",abbr:"HBR",color:"#1F3864"},Harleysville:{name:"Harleysville",abbr:"HRL",color:"#003DA5"},Hartford:{name:"The Hartford",abbr:"HFD",color:"#7F1734"},HartfordOMNI:{name:"Hartford OMNI",abbr:"HOM",color:"#7F1734"},HastingsMutual:{name:"Hastings Mutual",abbr:"HST",color:"#1F3864"},HawkeyeSecurity:{name:"Hawkeye Security",abbr:"HWK",color:"#1F3864"},HDI:{name:"HDI",abbr:"HDI",color:"#00563F"},HippoInsuranceCompany:{name:"Hippo",abbr:"HPO",color:"#00C9A7"},HomeownersOfAmerica:{name:"Homeowners of America",abbr:"HOA",color:"#003DA5"},Homesite:{name:"Homesite",abbr:"HMS",color:"#0033A0"},HoraceMann:{name:"Horace Mann",abbr:"HM",color:"#003DA5"},HoustonGeneral:{name:"Houston General",abbr:"HG",color:"#1F3864"},IFA:{name:"IFA",abbr:"IFA",color:"#003DA5"},ImperialCasualty:{name:"Imperial Casualty",abbr:"IMP",color:"#1F3864"},Indiana:{name:"Indiana Insurance",abbr:"IND",color:"#003DA5"},IndianaFarmers:{name:"Indiana Farmers",abbr:"IFM",color:"#00843D"},Infinity:{name:"Infinity",abbr:"INF",color:"#E31837"},Insurequest:{name:"Insurequest",abbr:"INQ",color:"#1F3864"},Integon:{name:"Integon",abbr:"ITG",color:"#003DA5"},Integrity:{name:"Integrity",abbr:"ITY",color:"#1F3864"},Kemper:{name:"Kemper",abbr:"KMP",color:"#0033A0"},LibertyMutual:{name:"Liberty Mutual",abbr:"LM",color:"#FFD000"},LibertyNorthwest:{name:"Liberty Northwest",abbr:"LNW",color:"#FFD000"},Lloyds:{name:"Lloyd's",abbr:"LLY",color:"#003DA5"},MainStreetAmerica:{name:"Main Street America",abbr:"MSA",color:"#003DA5"},Mapfre:{name:"MAPFRE",abbr:"MAP",color:"#E31837"},MarkelInsuranceCompany:{name:"Markel",abbr:"MKL",color:"#003DA5"},Mendota:{name:"Mendota",abbr:"MND",color:"#1F3864"},MerchantsGroup:{name:"Merchants Group",abbr:"MRC",color:"#003DA5"},Mercury:{name:"Mercury",abbr:"MER",color:"#ED1C24"},Metlife:{name:"MetLife",abbr:"MET",color:"#0090DA"},Metropolitan:{name:"Metropolitan",abbr:"MTP",color:"#0090DA"},MidContinent:{name:"Mid-Continent",abbr:"MC",color:"#003DA5"},MidwesternIndemnity:{name:"Midwestern Indemnity",abbr:"MWI",color:"#003DA5"},Montgomery:{name:"Montgomery",abbr:"MTG",color:"#1F3864"},MSA:{name:"MSA",abbr:"MSA",color:"#003DA5"},MtWashington:{name:"Mt. Washington",abbr:"MTW",color:"#1F3864"},MutualBenefit:{name:"Mutual Benefit",abbr:"MB",color:"#1F3864"},NatGenPremier:{name:"NatGen Premier",abbr:"NGP",color:"#0033A0"},NationalGeneral:{name:"National General",abbr:"NG",color:"#0033A0"},Nationwide:{name:"Nationwide",abbr:"NW",color:"#204D9B"},NationwideScottsdale:{name:"Nationwide Scottsdale",abbr:"NWS",color:"#204D9B"},NewYorkCentralMutual:{name:"NY Central Mutual",abbr:"NYC",color:"#003DA5"},NJManufacturers:{name:"NJM Insurance",abbr:"NJM",color:"#003DA5"},NJSkylands:{name:"NJ Skylands",abbr:"NJS",color:"#003DA5"},Northstar:{name:"Northstar",abbr:"NST",color:"#1F3864"},Occidental:{name:"Occidental",abbr:"OCC",color:"#1F3864"},OhioCasualty:{name:"Ohio Casualty",abbr:"OHC",color:"#003DA5"},OmahaPC:{name:"Omaha P&C",abbr:"OMA",color:"#003DA5"},OneBeacon:{name:"OneBeacon",abbr:"OB",color:"#003DA5"},OregonMutual:{name:"Oregon Mutual",abbr:"ORE",color:"#003DA5"},Palisades:{name:"Palisades",abbr:"PAL",color:"#1F3864"},PeerlessMontgomery:{name:"Peerless Montgomery",abbr:"PRM",color:"#1F3864"},Pekin:{name:"Pekin",abbr:"PEK",color:"#003DA5"},Pemco:{name:"PEMCO",abbr:"PMC",color:"#0072CE"},PennNational:{name:"Penn National",abbr:"PN",color:"#003DA5"},PlymouthRock:{name:"Plymouth Rock",abbr:"PLR",color:"#003DA5"},PreferredMutual:{name:"Preferred Mutual",abbr:"PFM",color:"#003DA5"},Proformance:{name:"Proformance",abbr:"PRF",color:"#1F3864"},Progressive:{name:"Progressive",abbr:"PRG",color:"#0053BA"},Prudential:{name:"Prudential",abbr:"PRU",color:"#0033A0"},PureHighValue:{name:"PURE",abbr:"PUR",color:"#003DA5"},Republic:{name:"Republic",abbr:"REP",color:"#003DA5"},RockfordMutual:{name:"Rockford Mutual",abbr:"RKF",color:"#1F3864"},RoyalAndSunAlliance:{name:"Royal & SunAlliance",abbr:"RSA",color:"#003DA5"},Safeco:{name:"Safeco",abbr:"SFC",color:"#E4002B"},SECURA:{name:"SECURA",abbr:"SEC",color:"#003DA5"},Selective:{name:"Selective",abbr:"SEL",color:"#003DA5"},SouthernCounty:{name:"Southern County",abbr:"SCM",color:"#1F3864"},SouthernMutual:{name:"Southern Mutual",abbr:"SM",color:"#1F3864"},SouthernTrust:{name:"Southern Trust",abbr:"ST",color:"#1F3864"},StPaulTravelers:{name:"St. Paul Travelers",abbr:"SPT",color:"#C8102E"},StandardMutual:{name:"Standard Mutual",abbr:"STM",color:"#1F3864"},StarCasualty:{name:"Star Casualty",abbr:"SC",color:"#1F3864"},StateAuto:{name:"State Auto",abbr:"SA",color:"#003DA5"},StateFarm:{name:"State Farm",abbr:"SF",color:"#CC0717"},StateFarmFloridaInsuranceCompany:{name:"State Farm Florida",abbr:"SFF",color:"#CC0717"},SunshineStateInsuranceCompany:{name:"Sunshine State",abbr:"SSS",color:"#FFC72C"},Travelers:{name:"Travelers",abbr:"TRV",color:"#C8102E"},Tower:{name:"Tower",abbr:"TWR",color:"#1F3864"},TWFG:{name:"TWFG",abbr:"TWF",color:"#003DA5"},Unigard:{name:"Unigard",abbr:"UNG",color:"#1F3864"},UnitedFireAndCasualty:{name:"United Fire & Casualty",abbr:"UFC",color:"#003DA5"},Unitrin:{name:"Unitrin",abbr:"UTN",color:"#003DA5"},Universal:{name:"Universal",abbr:"UNV",color:"#003DA5"},USAA:{name:"USAA",abbr:"USA",color:"#1A3258"},UticaNational:{name:"Utica National",abbr:"UTC",color:"#003DA5"},Victoria:{name:"Victoria",abbr:"VIC",color:"#1F3864"},Wellington:{name:"Wellington",abbr:"WLG",color:"#1F3864"},WestBend:{name:"West Bend",abbr:"WB",color:"#003DA5"},WesternNational:{name:"Western National",abbr:"WN",color:"#003DA5"},WesternReserveGroup:{name:"Western Reserve",abbr:"WR",color:"#003DA5"},Westfield:{name:"Westfield",abbr:"WF",color:"#F05136"},WhiteMountains:{name:"White Mountains",abbr:"WM",color:"#1F3864"},WilsonMutual:{name:"Wilson Mutual",abbr:"WLM",color:"#1F3864"},Windsor:{name:"Windsor",abbr:"WIN",color:"#1F3864"},Zurich:{name:"Zurich",abbr:"ZUR",color:"#003399"}},Fo=["#0369A1","#1D4ED8","#0F766E","#7C3AED","#B45309","#DC2626","#0891B2","#9333EA"];function Bd(e){return e.replace(/[^A-Za-z0-9]/g,"").slice(0,3).toUpperCase()||"CAR"}function xd(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").trim()}function zd(e){const t=new Set,r=[];return e.forEach((n,o)=>{const a=$d[n]??{name:xd(n),abbr:Bd(n),color:Fo[o%Fo.length]};t.has(a.name)||(t.add(a.name),r.push(a))}),r}function Rd(e,t){if(!e)return[];const r=[];return(t==="Auto"||t==="Bundle")&&Array.isArray(e.PersonalAuto)&&r.push(...e.PersonalAuto),(t==="Home"||t==="Bundle")&&Array.isArray(e.PersonalHome)&&r.push(...e.PersonalHome),zd(r)}function R(e){if(e===!0)return"Yes";if(e===!1)return"No"}function Oe(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 Hd(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=Oe(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=Oe(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=Oe(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=Oe(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=Oe(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=Oe(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,l={};s.first_name&&(l.first_name=s.first_name),s.middle_name&&(l.middle_name=s.middle_name),s.last_name&&(l.last_name=s.last_name),s.date_of_birth&&(l.date_of_birth=Oe(s.date_of_birth)),s.gender&&(l.gender=s.gender),s.marital_status&&(l.marital_status=s.marital_status),s.relationship_to_insured&&(l.relationship_to_insured=s.relationship_to_insured),s.is_registered_owner!==null&&s.is_registered_owner!==void 0&&(l.is_registered_owner=s.is_registered_owner?"Yes":"No"),s.license_state&&(l.license_state=s.license_state),s.license_status&&(l.license_status=s.license_status),s.license_number&&(l.license_number=s.license_number),s.date_first_licensed&&(l.date_first_licensed=Oe(s.date_first_licensed)),s.education_level&&(l.education_level=Xn(s.education_level)),s.occupation&&(l.occupation=eo(s.occupation)),s.industry&&(l.industry=xt(s.industry)),s.employment_status&&(l.employment_status=s.employment_status),s.last_5_years_license_suspended_or_revoked!==null&&s.last_5_years_license_suspended_or_revoked!==void 0&&(l.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&&(l.accident_prevention_course=R(s.accident_prevention_course)),s.accident_prevention_course_date&&(l.accident_prevention_course_date=Oe(s.accident_prevention_course_date)),s.sr22!==null&&s.sr22!==void 0&&(l.sr22=R(s.sr22));const u=s.ssn_display;typeof u=="string"&&(l.ssn_display=u);const d=s.driver_violations;d&&d.length>0&&(l.driver_violations="Yes",l.driver_violations__items=d.map(y=>{const S={};return y.code&&(S.code=y.code),y.occurred_at&&(S.occurred_at=Oe(y.occurred_at)),S}));const p=s.driver_accidents;p&&p.length>0&&(l.driver_accidents="Yes",l.driver_accidents__items=p.map(y=>{const S={};return y.occurred_at&&(S.occurred_at=Oe(y.occurred_at)),y.description&&(S.description=y.description),y.quote_vehicle_id&&(S.quote_vehicle_id=i[y.quote_vehicle_id]??y.quote_vehicle_id),y.property_damage_amount_paid_cents!==null&&y.property_damage_amount_paid_cents!==void 0&&(S.property_damage_amount_paid_cents=y.property_damage_amount_paid_cents),y.personal_injury_amount_paid_cents!==null&&y.personal_injury_amount_paid_cents!==void 0&&(S.personal_injury_amount_paid_cents=y.personal_injury_amount_paid_cents),S}));const v=s.losses;return v&&v.length>0&&(l.losses="Yes",l.losses__items=v.map(y=>{const S={};return y.description&&(S.description=y.description),y.date_of_incident&&(S.date_of_incident=Oe(y.date_of_incident)),y.amount_paid_cents!==null&&y.amount_paid_cents!==void 0&&(S.amount_paid_cents=y.amount_paid_cents),y.quote_vehicle_id&&(S.quote_vehicle_id=i[y.quote_vehicle_id]??y.quote_vehicle_id),S})),l})):r.drivers="No",t.vehicles&&t.vehicles.length>0?(r.vehicles="Yes",r.vehicles__items=t.vehicles.map(a=>{const s=a,l={};s.vin&&(l.vin=s.vin),s.year!==null&&s.year!==void 0&&(l.year=String(s.year)),s.make&&(l.make=s.make),s.model&&(l.model=s.model),s.body_style&&(l.body_style=s.body_style),s.ownership_type&&(l.ownership_type=s.ownership_type),s.usage&&(l.usage=s.usage),s.annual_mileage!==null&&s.annual_mileage!==void 0&&(l.annual_mileage=s.annual_mileage),s.miles_to_work!==null&&s.miles_to_work!==void 0&&(l.miles_to_work=s.miles_to_work),s.percent_to_work!==null&&s.percent_to_work!==void 0&&(l.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&&(l.garaging_address=u.join(", ")),s.new_when_purchased!==null&&s.new_when_purchased!==void 0&&(l.new_when_purchased=R(s.new_when_purchased)),s.purchase_date&&(l.purchase_date=Oe(s.purchase_date)),s.anti_theft_type&&(l.anti_theft_type=s.anti_theft_type),s.passive_restraint_type&&(l.passive_restraint_type=s.passive_restraint_type),s.anti_lock_brakes!==null&&s.anti_lock_brakes!==void 0&&(l.anti_lock_brakes=R(s.anti_lock_brakes)),s.daytime_running_lights!==null&&s.daytime_running_lights!==void 0&&(l.daytime_running_lights=R(s.daytime_running_lights)),s.custom_equipment_value_cents!==null&&s.custom_equipment_value_cents!==void 0&&(l.custom_equipment_value_cents=s.custom_equipment_value_cents),s.cost_new_value_cents!==null&&s.cost_new_value_cents!==void 0&&(l.cost_new_value_cents=s.cost_new_value_cents),s.stated_value_amount_cents!==null&&s.stated_value_amount_cents!==void 0&&(l.stated_value_amount_cents=s.stated_value_amount_cents),s.vehicle_has_modifications!==null&&s.vehicle_has_modifications!==void 0&&(l.vehicle_has_modifications=R(s.vehicle_has_modifications)),s.vehicle_garaged_at_residence!==null&&s.vehicle_garaged_at_residence!==void 0&&(l.vehicle_garaged_at_residence=R(s.vehicle_garaged_at_residence)),s.vehicle_comp_deductible&&(l.vehicle_comp_deductible=s.vehicle_comp_deductible),s.vehicle_coll_deductible&&(l.vehicle_coll_deductible=s.vehicle_coll_deductible),s.vehicle_towing_and_labor&&(l.vehicle_towing_and_labor=s.vehicle_towing_and_labor),s.vehicle_transportation_expense&&(l.vehicle_transportation_expense=s.vehicle_transportation_expense),s.vehicle_full_glass!==null&&s.vehicle_full_glass!==void 0&&(l.vehicle_full_glass=R(s.vehicle_full_glass)),s.vehicle_loan_lease!==null&&s.vehicle_loan_lease!==void 0&&(l.vehicle_loan_lease=R(s.vehicle_loan_lease)),s.coverages&&s.coverages.length>0&&(l.coverages__items=s.coverages.map(d=>{const p={};return d.type&&(p.type=d.type),d.per_person_limit_cents!==null&&d.per_person_limit_cents!==void 0&&(p.per_person_limit_cents=d.per_person_limit_cents),d.per_incident_limit_cents!==null&&d.per_incident_limit_cents!==void 0&&(p.per_incident_limit_cents=d.per_incident_limit_cents),d.per_incident_limit_percent!==null&&d.per_incident_limit_percent!==void 0&&(p.per_incident_limit_percent=d.per_incident_limit_percent),d.per_day_limit_cents!==null&&d.per_day_limit_cents!==void 0&&(p.per_day_limit_cents=d.per_day_limit_cents),d.deductible_cents!==null&&d.deductible_cents!==void 0&&(p.deductible_cents=d.deductible_cents),d.is_declined!==null&&d.is_declined!==void 0&&(p.is_declined=R(d.is_declined)),p})),s.vehicle_lienholders&&s.vehicle_lienholders.length>0&&(l.vehicle_lienholders__items=s.vehicle_lienholders.map(d=>{const p={};return d.name&&(p.name=d.name),d.type&&(p.type=d.type),d.line_1&&(p.line_1=d.line_1),d.line_2&&(p.line_2=d.line_2),d.city&&(p.city=d.city),d.state&&(p.state=d.state),d.postal_code&&(p.postal_code=d.postal_code),d.phone&&(p.phone=d.phone),d.fax&&(p.fax=d.fax),p})),l})):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=Oe(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 Ud=new Set(["Product","Driver","Vehicle"]);function Zd(e){return e?Array.isArray(e.drivers__items)?e.drivers__items.length:Array.isArray(e.drivers)?e.drivers.length:null:null}function $o(e,t){const r=Zd(t),n=e.filter(i=>i.key!=="AutoPolicy"),o=n.length>0?n:e;return o}function Vt(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(p=>{typeof p=="object"&&p!==null&&Object.keys(p).forEach(v=>{o.add(v)})}));for(const[u,d]of Object.entries(e))if(u.endsWith("__items")){const p=u.replace("__items","");if(n.includes(p)){const y=Array.isArray(d)?d.map(S=>Vt(S)):d;t[p]=y}}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=xt(d.industry),d.education_level=Xn(d.education_level),d.occupation=eo(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 p=u;console.log(`[DEBUG_TRANSFORM] Driver ${d}:`,{first_name:p.first_name,gender:p.gender,marital_status:p.marital_status,education_level:p.education_level,industry:p.industry,occupation:p.occupation,sr22:p.sr22,keys:Object.keys(p)})});const l=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 p=Math.min(d,l);t.sale_price_cents=p*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,p=d.amount_paid_cents;if(typeof p!="number"||!Number.isFinite(p))return d;const v=Math.trunc(p),y=Math.min(Math.max(v,0),l);return{...d,amount_paid_cents:y*100}})),t}function Wd(e,t){const r=e.findIndex(o=>o.key===t);return r<0?t:e[r+1]?.key??t}function Bo(e){return e.some(t=>String(t.key)==="BundlePolicy"||String(t.key)==="BundleCustomer")}function xo(e){return Bo(e)?"Bundle":e.some(t=>String(t.key)==="Vehicle"||String(t.key)==="Driver")?"Auto":"Home"}const Gd={Auto:45e3,Home:5e4,Bundle:1e5};function jd(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 Vd(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 Yd({isOpen:e,onClose:t}){const[r,n]=m.useState([]),[o,i]=m.useState(null),a=m.useRef(null);m.useEffect(()=>{a.current=o},[o]);const[s,l]=m.useState(null),[u,d]=m.useState(!1),[p,v]=m.useState(!1),[y,S]=m.useState([]),g=m.useRef(null),[U,x]=m.useState(null),[j,Z]=m.useState(void 0),[H,P]=m.useState(!1),[K,z]=m.useState(null),ne=m.useRef(!1);m.useEffect(()=>{if(!u||p)return;const q=xo(r);let L=!1;const f=[];let A=0;const I=8,k=5e3,W=async()=>{if(L)return;A++;try{const{quote:C}=await ao();if(L)return;const h=C?.appetites??null,_=Rd(h,q);if(_.length>0){S(_);return}}catch(C){console.warn("Provider polling: getQuote failed",C)}if(L||A>=I)return;const G=window.setTimeout(W,k);f.push(G)};return W(),()=>{L=!0,f.forEach(G=>window.clearTimeout(G))}},[u,p,r]);function V(q){const L={SMSVerification:"Verify",Name:"Basic Details",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 f=q.map(I=>({key:I,title:L[I]||I,loadQuestions:async()=>{const k=await Ku(I,a.current??void 0);let W=jd(I,k.questions);return W=Vd(I,W),W}}));if(q.includes("Vehicle")&&q.includes("Driver")&&q.includes("AutoCurrentCarrier")&&q.includes("Customer")){const I=f.findIndex(k=>k.key==="Product");if(I>=0){const k=f.slice(0,I+1),W=f.slice(I+1),G=_=>W.find(w=>w.key===_)??null,C=[G("Vehicle"),G("Driver"),G("AutoCurrentCarrier"),G("Customer")].filter(_=>!!_),h=W.filter(_=>!["Vehicle","Driver","AutoCurrentCarrier","Customer","AutoPolicy"].includes(String(_.key)));f=[...k,...C,...h]}}return f}m.useEffect(()=>{const q=async()=>{try{const L=Zu();if(Er(),L){P(!0),i(L);try{const f=Ut(),A=await ao(f?void 0:L);if(!A||!A.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:I}=A,{stages:k}=await Zt(L),W=V(k);n(W);let G;try{G=Hd(I),x(G)}catch(h){throw new Error(`Failed to transform quote data: ${h instanceof Error?h.message:"Unknown error"}`)}const C=$o(W,G);if(n(C),I.current_stage){const h=I.current_stage==="State"?"Product":I.current_stage,_=C.findIndex(w=>w.key===h);_>=0?Z(_):Z(C.length-1)}else Z(C.length-1)}catch(f){const A=f;if(A.statusCode===404)ro(),i(null);else if(A.statusCode===401){oo();try{const{stages:I}=await Zt(L),k=V(I);n(k);const W=k.findIndex(G=>G.key==="SMSVerification");W>=0&&Z(W)}catch{}}}finally{P(!1)}}else{const{stages:f}=await Zt();n(V(f))}}catch{P(!1)}};e&&!ne.current&&(ne.current=!0,q())},[e]),m.useEffect(()=>{if(!e)return;const{overflow:q}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=q}},[e]);const te=m.useCallback(q=>{q.key==="Escape"&&(go(),t())},[t]);m.useEffect(()=>{if(e)return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[e,te]),m.useEffect(()=>{e||(x(null),Z(void 0),P(!1),d(!1))},[e]),m.useEffect(()=>{e&&yd()},[e]),m.useEffect(()=>{s&&Array.isArray(s)&&Sd({rateCount:s.length})},[s]);const ie=m.useCallback(async()=>{if(!(!U||!o)){z(null),S([]),v(!1),g.current=null,d(!0);try{const q=await ct(Vt(U),!0);if(q.status==="submission_failed"){d(!1),z({message:q.message});return}const{rates:L}=await io();g.current=L,v(!0)}catch{d(!1),z({message:"Oops, something went wrong. Please try again later."})}}},[U,o]),Ee=m.useCallback(()=>{z(null),Z(Math.max(0,r.length-1))},[r.length]);if(!e)return null;const Ie=()=>{go(),t()};return c.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"insurance-modal-title",children:[c.jsx("div",{className:"backdrop","aria-hidden":"true"}),c.jsxs("div",{className:"modal-panel bg-white relative w-full max-w-2xl flex flex-col max-h-[90vh] overflow-hidden",role:"document",children:[c.jsx("button",{onClick:Ie,className:"modal-close-btn absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-xl","aria-label":"Close",type:"button",children:"×"}),!u&&!K&&c.jsx("div",{className:"text-center mb-6",children:c.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's get you the best insurance rates."})}),c.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[K&&c.jsx(Fd,{message:K.message,onRetry:ie,onEdit:Ee}),!K&&u&&(()=>{const q=xo(r);return c.jsx(Pd,{providers:y,totalTime:Gd[q],flow:q,isComplete:p,onComplete:()=>{d(!1),v(!1),S([]),g.current&&(l(g.current),g.current=null)}})})(),!K&&!s&&!u&&c.jsx(c.Fragment,{children:H||r.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"text-slate-600",children:"Loading..."})}):c.jsx(kd,{stages:r,initialValues:U??void 0,initialActive:j,quoteId:o??void 0,onStageComplete:async(q,L)=>{try{const f=Vt(q);let A=o,I=r;const k=I.findIndex(C=>C.key===L),W=I[k],G=Wd(I,L);if(A)if(L==="SMSVerification"){const{isVerified:C,token:h}=await Ju(A,f.sms_code);if(!C)throw new Error("Invalid SMS code");h&&Vu(h),await ct({current_stage:G},!1)}else if(L==="Product"){const{isSupported:C}=await Qu(f.state);if(!C)throw new Error("State is not supported");const h=Ut();await ct({...f,current_stage:G},!1,h?void 0:A)}else{const C=Ut();await ct({...f,current_stage:G},!1,C?void 0:A||void 0)}else{const h=(await qu(f.phone))?.quoteId;if(!h||typeof h!="string"||h.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${h}`);A=h,i(h),Uu(h),await ct({current_stage:G},!1,h)}if(Ud.has(L))try{const{stages:C}=await Zt(A||void 0);I=V(C),I=$o(I,q),n(I)}catch(C){console.warn("Unable to refresh stages after flow-shaping step",C)}return yo({stageKey:L,stageTitle:W?.title??L,stepIndex:k+1,totalSteps:I.length}),{success:!0}}catch(f){return{success:!1,error:f instanceof Error?f.message:"An error occurred"}}},onComplete:async q=>{try{const L=Vt(q);if(!o)throw new Error("Quote ID is required");x(q),S([]),v(!1),g.current=null,d(!0);let f;try{f=await ct(L,!0)}catch(k){throw d(!1),k}if(f.status==="submission_failed")return d(!1),v(!1),g.current=null,z({message:f.message}),{success:!0};try{const{rates:k}=await io();g.current=k,v(!0)}catch(k){throw d(!1),k}const A=r.length,I=r[A-1];return yo({stageKey:I?.key??"unknown",stageTitle:I?.title??"unknown",stepIndex:A,totalSteps:A}),vd(),{success:!0}}catch{return{success:!1,error:"Oops, something went wrong. Please try again later."}}}})})," ",!K&&s&&o&&c.jsx(Md,{rates:s,onBack:()=>l(null),isBundleFlow:Bo(r)})]}),c.jsx("div",{className:"mt-4 pt-4 border-t border-slate-200",children:c.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})})]})]})}function Kd({isOpen:e}){return c.jsx(Yd,{isOpen:e,onClose:()=>{Kt.close()}})}let Re=null,Je=null,Yt=!1;function qd(){Re||(Re=document.createElement("div"),Re.id="insurance-widget-root",document.documentElement.appendChild(Re)),!Je&&Re&&(Je=Uo.createRoot(Re))}function Lr(){qd(),Je&&Je.render(m.createElement(Kd,{isOpen:Yt}))}function Jd(){Je&&Re&&(Je.unmount(),Re.remove()),Je=null,Re=null}const Kt={init:e=>{Yt=!!e?.autoOpen,Lr()},open:()=>{Yt=!0,Lr()},close:()=>{Yt=!1,Lr()},destroy:Jd};typeof window<"u"&&(window.CredifyInsuranceWidget=Kt),De.CredifyInsuranceWidget=Kt,De.default=Kt,Object.defineProperties(De,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
76
76
  //# sourceMappingURL=index.umd.js.map