@getcredify/credify-insurance-widget 1.16.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/assets/iframe-fjayzn6o.js +123 -0
- package/dist/iframe/assets/iframe-fjayzn6o.js.map +1 -0
- package/dist/iframe/iframe.html +1 -1
- package/dist/index.es.js +2511 -2397
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +13 -13
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/iframe/assets/iframe-CVotjjht.js +0 -123
- package/dist/iframe/assets/iframe-CVotjjht.js.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
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-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,h){typeof exports=="object"&&typeof module<"u"?h(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"],h):(De=typeof globalThis<"u"?globalThis:De||self,h(De.CredifyInsuranceWidget={},De.React,De.ReactDOM,De.React))})(this,(function(De,h,jo,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 xr(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 Vo({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[v,g]=h.useState(""),C=h.useRef(null);h.useEffect(()=>{if(a==null||a===""){g("");return}const z=String(a).replace(/\D/g,"");g(xr(z,u))},[a,u]);const p=z=>{let K=z.target.value.replace(/\D/g,"");d!==void 0&&(K=K.slice(0,d)),g(xr(K,u));const R={...z,currentTarget:{...z.currentTarget,value:K},target:{...z.target,value:K}};s?.(R)},Y=z=>{if(["-","+",".","e","E"].includes(z.key)){z.preventDefault();return}if(d!==void 0&&/^\d$/.test(z.key)&&z.currentTarget.value.replace(/\D/g,"").length>=d){z.preventDefault();return}l?.(z)};return c.jsx(Me,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsx("input",{ref:C,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:p,onKeyDown:Y,...m})})}function zr(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 Yo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...l}){const[u,d]=h.useState(""),m=h.useRef(null);h.useEffect(()=>{const g=a.replace(/\D/g,"").slice(0,9);d(zr(g))},[a]);const v=g=>{const C=g.target.value,p=g.target.selectionStart??0,Y=C.replace(/\D/g,"").slice(0,9),z=zr(Y);d(z);const K={...g,currentTarget:{...g.currentTarget,value:z},target:{...g.target,value:z}};s?.(K),setTimeout(()=>{if(m.current){const R=C.slice(0,p).replace(/\D/g,"").length;let H=R;R>5?H+=2:R>3&&(H+=1),m.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: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: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 Ko({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 qo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...l}){const[u,d]=h.useState(""),m=h.useRef(null),v=h.useRef(0);h.useEffect(()=>{if(!a){d("");return}let C=rr(a);C.length===11&&C.startsWith("1")&&(C=C.slice(1));const p=C.slice(0,10);d(tr(p))},[a]);const g=C=>{const p=C.target,Y=p.value;v.current=p.selectionStart||0;const K=rr(Y).slice(0,10),R=tr(K);d(R);const H=K.length===10?`+1${K}`:K,B={...C,currentTarget:{...C.currentTarget,value:H},target:{...C.target,value:H}};s?.(B),setTimeout(()=>{if(m.current){const G=Y.slice(0,v.current),Z=rr(G),le=tr(Z),F=Math.min(le.length,R.length);m.current.setSelectionRange(F,F)}},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: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:g,...l})]})})}function Jo({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 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:"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 Xo({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 ei({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 Rr({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 ti({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 ri({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 ut({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(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}),m?l:s?.map(v=>c.jsx("option",{value:v.value,disabled:v.disabled,children:v.label},v.value))]})})}const ni="AIzaSyDjLdKLxoa-maLNGAyq_I_2r_Fe_TzFikw";function oi(){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=${ni}&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 ii(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 ai({id:e,label:t,hint:r,error:n,required:o,className:i,onChange:a,onPlaceSelect:s,value:l,...u}){const d=h.useRef(null),m=h.useRef(null),v=h.useRef(null),g=h.useRef(null),[C,p]=h.useState(!0),[Y,z]=h.useState(l||""),[K,R]=h.useState([]),[H,B]=h.useState(!1),[G,Z]=h.useState(-1),le=h.useRef([]),F=h.useRef(!1),se=h.useRef(-1);h.useEffect(()=>{le.current=K},[K]),h.useEffect(()=>{F.current=H},[H]),h.useEffect(()=>{se.current=G},[G]),h.useEffect(()=>{l!==void 0&&z(String(l))},[l]);const ee=h.useRef(null);h.useEffect(()=>{if(!d.current)return;let M=!0;return oi().then(()=>{!M||!d.current||(m.current=new google.maps.places.AutocompleteService,v.current=new google.maps.places.PlacesService(document.createElement("div")),p(!1))}).catch(f=>{console.error("Error loading Google Maps:",f),p(!1)}),()=>{M=!1,ee.current&&clearTimeout(ee.current)}},[]);const Te=M=>{const f=M.target.value;if(z(f),a?.(f),ee.current&&clearTimeout(ee.current),f.length<3){R([]),B(!1);return}ee.current=setTimeout(()=>{m.current&&m.current.getPlacePredictions({input:f,types:["address"]},(b,L)=>{L===google.maps.places.PlacesServiceStatus.OK&&b?(R(b),B(!0),Z(-1)):(R([]),B(!1))})},300)},te=M=>{if(!F.current||le.current.length===0){M.key==="Escape"&&(B(!1),F.current=!1);return}switch(M.key){case"ArrowDown":M.preventDefault(),Z(f=>{const b=f<le.current.length-1?f+1:f;return se.current=b,b});break;case"ArrowUp":M.preventDefault(),Z(f=>{const b=f>0?f-1:-1;return se.current=b,b});break;case"Enter":M.preventDefault(),se.current>=0&&se.current<le.current.length&&J(le.current[se.current]);break;case"Escape":M.preventDefault(),B(!1),F.current=!1;break}};h.useEffect(()=>{const M=f=>{g.current&&!g.current.contains(f.target)&&d.current&&!d.current.contains(f.target)&&(B(!1),F.current=!1)};if(H)return document.addEventListener("mousedown",M),()=>{document.removeEventListener("mousedown",M)}},[H]);const J=M=>{v.current&&v.current.getDetails({placeId:M.place_id,fields:["address_components","formatted_address","geometry"]},(f,b)=>{if(b===google.maps.places.PlacesServiceStatus.OK&&f){const L=f.formatted_address||"";z(L),B(!1),R([]),F.current=!1;const O=ii(f);a?.(L,O),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:Y,onChange:Te,onKeyDown:te,"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:C||u.disabled,...u}),C&&c.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading address suggestions..."}),H&&K.length>0&&c.jsx("div",{ref:g,className:"absolute z-50 w-full mt-1 bg-white border border-slate-200 rounded-lg shadow-lg max-h-60 overflow-y-auto",role:"listbox",children:K.map((M,f)=>c.jsxs("div",{className:`px-4 py-3 cursor-pointer transition-colors ${f===G?"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===G,onClick:()=>J(M),onMouseEnter:()=>Z(f),children:[c.jsx("div",{className:"font-medium text-slate-900",children:M.structured_formatting.main_text}),M.structured_formatting.secondary_text&&c.jsx("div",{className:"text-sm text-slate-500 mt-0.5",children:M.structured_formatting.secondary_text})]},M.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,m)=>{const v=d.conditionalQuestions?t(d.conditionalQuestions,[...n,`${s}__c${m}`]):void 0;return{...d,conditionalQuestions:v}});return{...o,key:s,conditionals:u}});return t(e,[])}function S(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 v=d[m];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 Hr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Ur={};function Ve(e){return Ur}function Zr(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 si(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 Wr=Symbol("evaluating");function ae(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Wr)return n===void 0&&(n=Wr,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 Gr(e){return JSON.stringify(e)}function ci(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ct(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const li=ir(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function dt(e){if(Ct(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Ct(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Vr(e){return dt(e)?{...e}:Array.isArray(e)?[...e]:e}const ui=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 P(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 di(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _i={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 fi(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 mi(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 pi(e,t){if(!dt(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 hi(e,t){if(!dt(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 gi(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 yi(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 bi(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 Yr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function wt(e){return typeof e=="string"?e:e?.message}function Ke(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=wt(e.inst?._zod.def?.error?.(e))??wt(t?.error?.(e))??wt(r.customError?.(e))??wt(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 _t(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Kr=(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})},qr=S("$ZodError",Kr),Jr=S("$ZodError",Kr,{Parent:Error});function vi(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 Si(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 jr(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 jr(s,o?.callee),s}return a.value},Et=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??qr)(i.issues.map(a=>Ke(a,o,Ve())))}:{success:!0,data:i.value}},Ai=Et(Jr),Tt=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}},Ci=Tt(Jr),wi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return lr(e)(t,r,o)},Ei=e=>(t,r,n)=>lr(e)(t,r,n),Ti=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ur(e)(t,r,o)},Ni=e=>async(t,r,n)=>ur(e)(t,r,n),ki=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Et(e)(t,r,o)},Oi=e=>(t,r,n)=>Et(e)(t,r,n),Ii=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Tt(e)(t,r,o)},Mi=e=>async(t,r,n)=>Tt(e)(t,r,n),Li=/^[cC][^\s-]{8,}$/,Di=/^[0-9a-z]+$/,Pi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fi=/^[0-9a-vA-V]{20}$/,$i=/^[A-Za-z0-9]{27}$/,Bi=/^[a-zA-Z0-9_-]{21}$/,xi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zi=/^([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)$/,Ri=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Hi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ui(){return new RegExp(Hi,"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])$/,Wi=/^(([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}|:))$/,Gi=/^((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])$/,ji=/^(([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])$/,Vi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xr=/^[A-Za-z0-9_-]*$/,Yi=/^\+[1-9]\d{6,14}$/,en="(?:(?:\\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])))",Ki=new RegExp(`^${en}$`);function tn(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 qi(e){return new RegExp(`^${tn(e)}$`)}function Ji(e){const t=tn({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(`^${en}T(?:${n})$`)}const Qi=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Xi=/^-?\d+$/,ea=/^-?\d+(?:\.\d+)?$/,ta=/^(?:true|false)$/i,ra=/^[^A-Z]*$/,na=/^[^a-z]*$/,ke=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rn={number:"number",bigint:"bigint",object:"date"},nn=S("$ZodCheckLessThan",(e,t)=>{ke.init(e,t);const r=rn[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})}}),on=S("$ZodCheckGreaterThan",(e,t)=>{ke.init(e,t);const r=rn[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})}}),oa=S("$ZodCheckMultipleOf",(e,t)=>{ke.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):si(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})}}),ia=S("$ZodCheckNumberFormat",(e,t)=>{ke.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=_i[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=Xi)}),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})}}),aa=S("$ZodCheckMaxLength",(e,t)=>{var r;ke.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})}}),sa=S("$ZodCheckMinLength",(e,t)=>{var r;ke.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})}}),ca=S("$ZodCheckLengthEquals",(e,t)=>{var r;ke.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})}}),Nt=S("$ZodCheckStringFormat",(e,t)=>{var r,n;ke.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=()=>{})}),la=S("$ZodCheckRegex",(e,t)=>{Nt.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})}}),ua=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ra),Nt.init(e,t)}),da=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=na),Nt.init(e,t)}),_a=S("$ZodCheckIncludes",(e,t)=>{ke.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})}}),fa=S("$ZodCheckStartsWith",(e,t)=>{ke.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})}}),ma=S("$ZodCheckEndsWith",(e,t)=>{ke.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})}}),pa=S("$ZodCheckOverwrite",(e,t)=>{ke.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class ha{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(`
|
|
2
|
+
(function(){if(typeof $e>"u")var $e={env:{}}})();(function($e,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):($e=typeof globalThis<"u"?globalThis:$e||self,m($e.CredifyInsuranceWidget={},$e.React,$e.ReactDOM,$e.React))})(this,(function($e,m,Vo,c){"use strict";function De({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 tr({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(De,{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 Ur(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 Yo({id:e,label:t,hint:r,error:n,required:o,className:i,value:a,onChange:s,onKeyDown:l,isCurrency:u=!1,maxDigits:_,...p}){const[v,g]=m.useState(""),C=m.useRef(null);m.useEffect(()=>{if(a==null||a===""){g("");return}const R=String(a).replace(/\D/g,"");g(Ur(R,u))},[a,u]);const h=R=>{let Y=R.target.value.replace(/\D/g,"");_!==void 0&&(Y=Y.slice(0,_)),g(Ur(Y,u));const H={...R,currentTarget:{...R.currentTarget,value:Y},target:{...R.target,value:Y}};s?.(H)},V=R=>{if(["-","+",".","e","E"].includes(R.key)){R.preventDefault();return}if(_!==void 0&&/^\d$/.test(R.key)&&R.currentTarget.value.replace(/\D/g,"").length>=_){R.preventDefault();return}l?.(R)};return c.jsx(De,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsx("input",{ref:C,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:h,onKeyDown:V,...p})})}function Zr(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 Ko({id:e,label:t,hint:r,error:n,required:o,className:i,value:a="",onChange:s,...l}){const[u,_]=m.useState(""),p=m.useRef(null);m.useEffect(()=>{const g=a.replace(/\D/g,"").slice(0,9);_(Zr(g))},[a]);const v=g=>{const C=g.target.value,h=g.target.selectionStart??0,V=C.replace(/\D/g,"").slice(0,9),R=Zr(V);_(R);const Y={...g,currentTarget:{...g.currentTarget,value:R},target:{...g.target,value:R}};s?.(Y),setTimeout(()=>{if(p.current){const H=C.slice(0,h).replace(/\D/g,"").length;let U=H;H>5?U+=2:H>3&&(U+=1),p.current.setSelectionRange(U,U)}},0)};return c.jsx(De,{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 rr({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(De,{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 qo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(De,{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 nr(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 or(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,_]=m.useState(""),p=m.useRef(null),v=m.useRef(0);m.useEffect(()=>{if(!a){_("");return}let C=or(a);C.length===11&&C.startsWith("1")&&(C=C.slice(1));const h=C.slice(0,10);_(nr(h))},[a]);const g=C=>{const h=C.target,V=h.value;v.current=h.selectionStart||0;const Y=or(V).slice(0,10),H=nr(Y);_(H);const U=Y.length===10?`+1${Y}`:Y,B={...C,currentTarget:{...C.currentTarget,value:U},target:{...C.target,value:U}};s?.(B),setTimeout(()=>{if(p.current){const j=V.slice(0,v.current),Z=or(j),oe=nr(Z),F=Math.min(oe.length,H.length);p.current.setSelectionRange(F,F)}},0)};return c.jsx(De,{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:g,...l})]})})}function Qo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(De,{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 Xo({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(De,{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 ei({id:e,label:t,hint:r,error:n,required:o,className:i,rows:a=4,...s}){return c.jsx(De,{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 ti({id:e,label:t,hint:r,error:n,required:o,className:i,...a}){return c.jsx(De,{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 ir({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 ri({onChoose:e,isSubmitting:t=!1}){const[r,n]=m.useState(!1),o=!r||t;return c.jsxs("div",{className:"communications-consent","data-testid":"communications-consent",children:[c.jsx("h3",{className:"text-lg font-semibold text-text-primary mb-3",children:"Communications Consent"}),c.jsx(ir,{id:"communications-consent-checkbox",className:"communications-consent-checkbox",checked:r,onChange:i=>n(i.target.checked),disabled:t,label:"I consent to communications from Credify Corporation (licensed insurance agency) and my selected carrier(s) at my phone number and email address provided. This includes support (including AI agents), carrier quote/service contact, auto-shopping/reshopping at renewal, notifications about policy renewal dates and other goods and services, and claims management."}),c.jsxs("div",{className:"text-sm text-slate-600 mt-4 space-y-2",children:[c.jsx("p",{children:"These may use automated systems, emails or texts. Message & data rates may apply. Reply STOP to opt out of SMS."}),c.jsx("p",{children:"Consent is not required to receive quotes or purchase insurance."})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-6",children:[c.jsx("button",{type:"button","data-testid":"communications-consent-decline",onClick:()=>e(!1),disabled:t,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition disabled:opacity-50 disabled:cursor-not-allowed",children:"I Do Not Consent"}),c.jsxs("button",{type:"button","data-testid":"communications-consent-accept",onClick:()=>e(!0),disabled:o,className:["form-wizard-next-btn","h-12 rounded-full text-white transition","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center justify-center gap-2",o?"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:[t&&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"})]}),"I Consent"]})]})]})}function ni({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 oi({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 mt({id:e,label:t,hint:r,error:n,required:o,className:i,placeholder:a,options:s,children:l,...u}){const _=[r?`${e}-hint`:null,n?`${e}-error`:null].filter(Boolean).join(" ")||void 0,p=!!l;return c.jsx(De,{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":_,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 ii="AIzaSyDjLdKLxoa-maLNGAyq_I_2r_Fe_TzFikw";function ai(){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=${ii}&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 si(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 ci({id:e,label:t,hint:r,error:n,required:o,className:i,onChange:a,onPlaceSelect:s,value:l,...u}){const _=m.useRef(null),p=m.useRef(null),v=m.useRef(null),g=m.useRef(null),[C,h]=m.useState(!0),[V,R]=m.useState(l||""),[Y,H]=m.useState([]),[U,B]=m.useState(!1),[j,Z]=m.useState(-1),oe=m.useRef([]),F=m.useRef(!1),ie=m.useRef(-1);m.useEffect(()=>{oe.current=Y},[Y]),m.useEffect(()=>{F.current=U},[U]),m.useEffect(()=>{ie.current=j},[j]),m.useEffect(()=>{l!==void 0&&R(String(l))},[l]);const Q=m.useRef(null);m.useEffect(()=>{if(!_.current)return;let J=!0;return ai().then(()=>{!J||!_.current||(p.current=new google.maps.places.AutocompleteService,v.current=new google.maps.places.PlacesService(document.createElement("div")),h(!1))}).catch(f=>{console.error("Error loading Google Maps:",f),h(!1)}),()=>{J=!1,Q.current&&clearTimeout(Q.current)}},[]);const Te=J=>{const f=J.target.value;if(R(f),a?.(f),Q.current&&clearTimeout(Q.current),f.length<3){H([]),B(!1);return}Q.current=setTimeout(()=>{p.current&&p.current.getPlacePredictions({input:f,types:["address"]},(k,L)=>{L===google.maps.places.PlacesServiceStatus.OK&&k?(H(k),B(!0),Z(-1)):(H([]),B(!1))})},300)},ye=J=>{if(!F.current||oe.current.length===0){J.key==="Escape"&&(B(!1),F.current=!1);return}switch(J.key){case"ArrowDown":J.preventDefault(),Z(f=>{const k=f<oe.current.length-1?f+1:f;return ie.current=k,k});break;case"ArrowUp":J.preventDefault(),Z(f=>{const k=f>0?f-1:-1;return ie.current=k,k});break;case"Enter":J.preventDefault(),ie.current>=0&&ie.current<oe.current.length&&Ae(oe.current[ie.current]);break;case"Escape":J.preventDefault(),B(!1),F.current=!1;break}};m.useEffect(()=>{const J=f=>{g.current&&!g.current.contains(f.target)&&_.current&&!_.current.contains(f.target)&&(B(!1),F.current=!1)};if(U)return document.addEventListener("mousedown",J),()=>{document.removeEventListener("mousedown",J)}},[U]);const Ae=J=>{v.current&&v.current.getDetails({placeId:J.place_id,fields:["address_components","formatted_address","geometry"]},(f,k)=>{if(k===google.maps.places.PlacesServiceStatus.OK&&f){const L=f.formatted_address||"";R(L),B(!1),H([]),F.current=!1;const O=si(f);a?.(L,O),s?.(f)}})};return c.jsx(De,{id:e,label:t,hint:r,error:n,required:o,className:i,children:c.jsxs("div",{className:"relative",children:[c.jsx("input",{ref:_,id:e,type:"text",className:`form-input ${n?"input-error":""}`,value:V,onChange:Te,onKeyDown:ye,"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:C||u.disabled,...u}),C&&c.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading address suggestions..."}),U&&Y.length>0&&c.jsx("div",{ref:g,className:"absolute z-50 w-full mt-1 bg-white border border-slate-200 rounded-lg shadow-lg max-h-60 overflow-y-auto",role:"listbox",children:Y.map((J,f)=>c.jsxs("div",{className:`px-4 py-3 cursor-pointer transition-colors ${f===j?"bg-blue-50 text-slate-900":"bg-white text-slate-900 hover:bg-slate-50"} ${f<Y.length-1?"border-b border-slate-100":""}`,role:"option","aria-selected":f===j,onClick:()=>Ae(J),onMouseEnter:()=>Z(f),children:[c.jsx("div",{className:"font-medium text-slate-900",children:J.structured_formatting.main_text}),J.structured_formatting.secondary_text&&c.jsx("div",{className:"text-sm text-slate-500 mt-0.5",children:J.structured_formatting.secondary_text})]},J.place_id))})]})})}function ar(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((_,p)=>{const v=_.conditionalQuestions?t(_.conditionalQuestions,[...n,`${s}__c${p}`]):void 0;return{..._,conditionalQuestions:v}});return{...o,key:s,conditionals:u}});return t(e,[])}function S(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,_=Object.keys(u);for(let p=0;p<_.length;p++){const v=_[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 _ of u._zod.deferred)_();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 ot extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Wr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Gr={};function Ke(e){return Gr}function jr(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 sr(e,t){return typeof t=="bigint"?t.toString():t}function cr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function lr(e){return e==null}function ur(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function li(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 Vr=Symbol("evaluating");function ne(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Vr)return n===void 0&&(n=Vr,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function qe(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 Yr(e){return JSON.stringify(e)}function ui(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Kr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const di=cr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function pt(e){if(Tt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function qr(e){return pt(e)?{...e}:Array.isArray(e)?[...e]:e}const _i=new Set(["string","number","symbol"]);function it(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function We(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 fi(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const mi={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 pi(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 qe(this,"shape",a),a},checks:[]});return We(e,i)}function hi(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 qe(this,"shape",a),a},checks:[]});return We(e,i)}function gi(e,t){if(!pt(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 qe(this,"shape",i),i}});return We(e,o)}function yi(e,t){if(!pt(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 qe(this,"shape",n),n}});return We(e,r)}function bi(e,t){const r=Ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return qe(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return We(e,r)}function vi(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 qe(this,"shape",l),l},checks:[]});return We(t,a)}function Si(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 qe(this,"shape",i),i}});return We(t,n)}function at(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 Nt(e){return typeof e=="string"?e:e?.message}function Je(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=Nt(e.inst?._zod.def?.error?.(e))??Nt(t?.error?.(e))??Nt(r.customError?.(e))??Nt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function dr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ht(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Qr=(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,sr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xr=S("$ZodError",Qr),en=S("$ZodError",Qr,{Parent:Error});function Ai(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 Ci(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 _r=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 ot;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>Je(l,i,Ke())));throw Kr(s,o?.callee),s}return a.value},fr=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=>Je(l,i,Ke())));throw Kr(s,o?.callee),s}return a.value},kt=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 ot;return i.issues.length?{success:!1,error:new(e??Xr)(i.issues.map(a=>Je(a,o,Ke())))}:{success:!0,data:i.value}},wi=kt(en),Ot=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=>Je(a,o,Ke())))}:{success:!0,data:i.value}},Ei=Ot(en),Ti=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return _r(e)(t,r,o)},Ni=e=>(t,r,n)=>_r(e)(t,r,n),ki=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return fr(e)(t,r,o)},Oi=e=>async(t,r,n)=>fr(e)(t,r,n),Ii=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kt(e)(t,r,o)},Mi=e=>(t,r,n)=>kt(e)(t,r,n),Li=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ot(e)(t,r,o)},Di=e=>async(t,r,n)=>Ot(e)(t,r,n),Pi=/^[cC][^\s-]{8,}$/,Fi=/^[0-9a-z]+$/,$i=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xi=/^[0-9a-vA-V]{20}$/,Bi=/^[A-Za-z0-9]{27}$/,zi=/^[a-zA-Z0-9_-]{21}$/,Ri=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hi=/^([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})$/,tn=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)$/,Ui=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Wi(){return new RegExp(Zi,"u")}const Gi=/^(?:(?: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])$/,ji=/^(([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}|:))$/,Vi=/^((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])$/,Yi=/^(([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])$/,Ki=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rn=/^[A-Za-z0-9_-]*$/,qi=/^\+[1-9]\d{6,14}$/,nn="(?:(?:\\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])))",Ji=new RegExp(`^${nn}$`);function on(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 Qi(e){return new RegExp(`^${on(e)}$`)}function Xi(e){const t=on({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(`^${nn}T(?:${n})$`)}const ea=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ta=/^-?\d+$/,ra=/^-?\d+(?:\.\d+)?$/,na=/^(?:true|false)$/i,oa=/^[^A-Z]*$/,ia=/^[^a-z]*$/,Oe=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),an={number:"number",bigint:"bigint",object:"date"},sn=S("$ZodCheckLessThan",(e,t)=>{Oe.init(e,t);const r=an[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})}}),cn=S("$ZodCheckGreaterThan",(e,t)=>{Oe.init(e,t);const r=an[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})}}),aa=S("$ZodCheckMultipleOf",(e,t)=>{Oe.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):li(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})}}),sa=S("$ZodCheckNumberFormat",(e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=mi[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=ta)}),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})}}),ca=S("$ZodCheckMaxLength",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!lr(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=dr(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),la=S("$ZodCheckMinLength",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!lr(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=dr(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ua=S("$ZodCheckLengthEquals",(e,t)=>{var r;Oe.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!lr(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=dr(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})}}),It=S("$ZodCheckStringFormat",(e,t)=>{var r,n;Oe.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=()=>{})}),da=S("$ZodCheckRegex",(e,t)=>{It.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})}}),_a=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=oa),It.init(e,t)}),fa=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ia),It.init(e,t)}),ma=S("$ZodCheckIncludes",(e,t)=>{Oe.init(e,t);const r=it(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})}}),pa=S("$ZodCheckStartsWith",(e,t)=>{Oe.init(e,t);const r=new RegExp(`^${it(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})}}),ha=S("$ZodCheckEndsWith",(e,t)=>{Oe.init(e,t);const r=new RegExp(`.*${it(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})}}),ga=S("$ZodCheckOverwrite",(e,t)=>{Oe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class ya{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
|
|
5
|
-
if (${
|
|
4
|
+
`))}}const ba={major:4,minor:3,patch:6},_e=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ba;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=at(a),_;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,g=p._zod.check(a);if(g instanceof Promise&&l?.async===!1)throw new ot;if(_||g instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await g,a.issues.length!==v&&(u||(u=at(a,v)))});else{if(a.issues.length===v)continue;u||(u=at(a,v))}}return _?_.then(()=>a):a},i=(a,s,l)=>{if(at(a))return a.aborted=!0,a;const u=o(s,n,l);if(u instanceof Promise){if(l.async===!1)throw new ot;return u.then(_=>e._zod.parse(_,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(_=>i(_,a,s)):i(u,a,s)}const l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new ot;return l.then(u=>o(u,n,s))}return o(l,n,s)}}ne(e,"~standard",()=>({validate:o=>{try{const i=wi(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ei(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),mr=S("$ZodString",(e,t)=>{_e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ea(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),le=S("$ZodStringFormat",(e,t)=>{It.init(e,t),mr.init(e,t)}),va=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Hi),le.init(e,t)}),Sa=S("$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=tn(n))}else t.pattern??(t.pattern=tn());le.init(e,t)}),Aa=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ui),le.init(e,t)}),Ca=S("$ZodURL",(e,t)=>{le.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),wa=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Wi()),le.init(e,t)}),Ea=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=zi),le.init(e,t)}),Ta=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Pi),le.init(e,t)}),Na=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Fi),le.init(e,t)}),ka=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=$i),le.init(e,t)}),Oa=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xi),le.init(e,t)}),Ia=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Bi),le.init(e,t)}),Ma=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xi(t)),le.init(e,t)}),La=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ji),le.init(e,t)}),Da=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Qi(t)),le.init(e,t)}),Pa=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ri),le.init(e,t)}),Fa=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gi),le.init(e,t),e._zod.bag.format="ipv4"}),$a=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ji),le.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),xa=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Vi),le.init(e,t)}),Ba=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yi),le.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,i]=n;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ln(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const za=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ki),le.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ln(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ra(e){if(!rn.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ln(r)}const Ha=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rn),le.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ra(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ua=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=qi),le.init(e,t)});function Za(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 Wa=S("$ZodJWT",(e,t)=>{le.init(e,t),e._zod.check=r=>{Za(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),un=S("$ZodNumber",(e,t)=>{_e.init(e,t),e._zod.pattern=e._zod.bag.pattern??ra,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}}),Ga=S("$ZodNumberFormat",(e,t)=>{sa.init(e,t),un.init(e,t)}),ja=S("$ZodBoolean",(e,t)=>{_e.init(e,t),e._zod.pattern=na,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}}),Va=S("$ZodUnknown",(e,t)=>{_e.init(e,t),e._zod.parse=r=>r}),Ya=S("$ZodNever",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function dn(e,t,r){e.issues.length&&t.issues.push(...Jr(r,e.issues)),t.value[r]=e.value}const Ka=S("$ZodArray",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const s=o[a],l=t.element._zod.run({value:s,issues:[]},n);l instanceof Promise?i.push(l.then(u=>dn(u,r,a))):dn(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Mt(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 _n(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=fi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function fn(e,t,r,n,o,i){const a=[],s=o.keySet,l=o.catchall._zod,u=l.def.type,_=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(g=>Mt(g,r,p,t,_))):Mt(v,r,p,t,_)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const qa=S("$ZodObject",(e,t)=>{if(_e.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=cr(()=>_n(t));ne(e._zod,"propValues",()=>{const s=t.shape,l={};for(const u in s){const _=s[u]._zod;if(_.values){l[u]??(l[u]=new Set);for(const p of _.values)l[u].add(p)}}return l});const o=Tt,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 _=[],p=a.shape;for(const v of a.keys){const g=p[v],C=g._zod.optout==="optional",h=g._zod.run({value:u[v],issues:[]},l);h instanceof Promise?_.push(h.then(V=>Mt(V,s,v,u,C))):Mt(h,s,v,u,C)}return i?fn(_,u,s,l,n.value,e):_.length?Promise.all(_).then(()=>s):s}}),Ja=S("$ZodObjectJIT",(e,t)=>{qa.init(e,t);const r=e._zod.parse,n=cr(()=>_n(t)),o=v=>{const g=new ya(["shape","payload","ctx"]),C=n.value,h=H=>{const U=Yr(H);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};g.write("const input = payload.value;");const V=Object.create(null);let R=0;for(const H of C.keys)V[H]=`key_${R++}`;g.write("const newResult = {};");for(const H of C.keys){const U=V[H],B=Yr(H),Z=v[H]?._zod?.optout==="optional";g.write(`const ${U} = ${h(H)};`),Z?g.write(`
|
|
5
|
+
if (${U}.issues.length) {
|
|
6
6
|
if (${B} in input) {
|
|
7
|
-
payload.issues = payload.issues.concat(${
|
|
7
|
+
payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
|
|
8
8
|
...iss,
|
|
9
9
|
path: iss.path ? [${B}, ...iss.path] : [${B}]
|
|
10
10
|
})));
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (${
|
|
14
|
+
if (${U}.value === undefined) {
|
|
15
15
|
if (${B} in input) {
|
|
16
16
|
newResult[${B}] = undefined;
|
|
17
17
|
}
|
|
18
18
|
} else {
|
|
19
|
-
newResult[${B}] = ${
|
|
19
|
+
newResult[${B}] = ${U}.value;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
`):g.write(`
|
|
23
|
-
if (${
|
|
24
|
-
payload.issues = payload.issues.concat(${
|
|
23
|
+
if (${U}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
|
|
25
25
|
...iss,
|
|
26
26
|
path: iss.path ? [${B}, ...iss.path] : [${B}]
|
|
27
27
|
})));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
if (${
|
|
30
|
+
if (${U}.value === undefined) {
|
|
31
31
|
if (${B} in input) {
|
|
32
32
|
newResult[${B}] = undefined;
|
|
33
33
|
}
|
|
34
34
|
} else {
|
|
35
|
-
newResult[${B}] = ${
|
|
35
|
+
newResult[${B}] = ${U}.value;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
`)}g.write("payload.value = newResult;"),g.write("return payload;");const K=g.compile();return(R,H)=>K(v,R,H)};let i;const a=Ct,s=!Ur.jitless,u=s&&li.value,d=t.catchall;let m;e._zod.parse=(v,g)=>{m??(m=n.value);const C=v.value;return a(C)?s&&u&&g?.async===!1&&g.jitless!==!0?(i||(i=o(t.shape)),v=i(v,g),d?un([],C,v,g,m,e):v):r(v,g):(v.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),v)}});function dn(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 qa=S("$ZodUnion",(e,t)=>{he.init(e,t),ae(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ae(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ae(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ae(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=>dn(l,o,e,i)):dn(s,o,e,i)}}),Ja=S("$ZodIntersection",(e,t)=>{he.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])=>_n(r,l,u)):_n(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(dt(e)&&dt(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 _n(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 Qa=S("$ZodEnum",(e,t)=>{he.init(e,t);const r=Zr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>ui.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}}),Xa=S("$ZodLiteral",(e,t)=>{if(he.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}}),es=S("$ZodTransform",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Hr(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 fn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const mn=S("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ae(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=>fn(i,r.value)):fn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ts=S("$ZodExactOptional",(e,t)=>{mn.init(e,t),ae(e._zod,"values",()=>t.innerType._zod.values),ae(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),rs=S("$ZodNullable",(e,t)=>{he.init(e,t),ae(e._zod,"optin",()=>t.innerType._zod.optin),ae(e._zod,"optout",()=>t.innerType._zod.optout),ae(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${sr(r.source)}|null)$`):void 0}),ae(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)}),ns=S("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",ae(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=>pn(i,t)):pn(o,t)}});function pn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const os=S("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",ae(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))}),is=S("$ZodNonOptional",(e,t)=>{he.init(e,t),ae(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=>hn(i,e)):hn(o,e)}});function hn(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 as=S("$ZodCatch",(e,t)=>{he.init(e,t),ae(e._zod,"optin",()=>t.innerType._zod.optin),ae(e._zod,"optout",()=>t.innerType._zod.optout),ae(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)}}),ss=S("$ZodPipe",(e,t)=>{he.init(e,t),ae(e._zod,"values",()=>t.in._zod.values),ae(e._zod,"optin",()=>t.in._zod.optin),ae(e._zod,"optout",()=>t.out._zod.optout),ae(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=>Ot(a,t.in,n)):Ot(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ot(i,t.out,n)):Ot(o,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const cs=S("$ZodReadonly",(e,t)=>{he.init(e,t),ae(e._zod,"propValues",()=>t.innerType._zod.propValues),ae(e._zod,"values",()=>t.innerType._zod.values),ae(e._zod,"optin",()=>t.innerType?._zod?.optin),ae(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(gn):gn(o)}});function gn(e){return e.value=Object.freeze(e.value),e}const ls=S("$ZodCustom",(e,t)=>{ke.init(e,t),he.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=>yn(i,r,n,e));yn(o,r,n,e)}});function yn(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(_t(o))}}var bn;class us{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 ds(){return new us}(bn=globalThis).__zod_globalRegistry??(bn.__zod_globalRegistry=ds());const ft=globalThis.__zod_globalRegistry;function _s(e,t){return new e({type:"string",...P(t)})}function fs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...P(t)})}function vn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...P(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...P(t)})}function ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(t)})}function ys(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...P(t)})}function bs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...P(t)})}function vs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(t)})}function Ss(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...P(t)})}function As(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(t)})}function Cs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...P(t)})}function ws(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...P(t)})}function Es(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(t)})}function Ts(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(t)})}function Ns(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(t)})}function ks(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(t)})}function Os(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(t)})}function Is(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...P(t)})}function Ms(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...P(t)})}function Ls(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...P(t)})}function Ds(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...P(t)})}function Ps(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(t)})}function Fs(e,t){return new e({type:"string",format:"date",check:"string_format",...P(t)})}function $s(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...P(t)})}function Bs(e,t){return new e({type:"string",format:"duration",check:"string_format",...P(t)})}function xs(e,t){return new e({type:"number",coerce:!0,checks:[],...P(t)})}function zs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...P(t)})}function Rs(e,t){return new e({type:"boolean",...P(t)})}function Hs(e){return new e({type:"unknown"})}function Us(e,t){return new e({type:"never",...P(t)})}function Sn(e,t){return new nn({check:"less_than",...P(t),value:e,inclusive:!1})}function fr(e,t){return new nn({check:"less_than",...P(t),value:e,inclusive:!0})}function An(e,t){return new on({check:"greater_than",...P(t),value:e,inclusive:!1})}function mr(e,t){return new on({check:"greater_than",...P(t),value:e,inclusive:!0})}function Cn(e,t){return new oa({check:"multiple_of",...P(t),value:e})}function wn(e,t){return new aa({check:"max_length",...P(t),maximum:e})}function It(e,t){return new sa({check:"min_length",...P(t),minimum:e})}function En(e,t){return new ca({check:"length_equals",...P(t),length:e})}function Zs(e,t){return new la({check:"string_format",format:"regex",...P(t),pattern:e})}function Ws(e){return new ua({check:"string_format",format:"lowercase",...P(e)})}function Gs(e){return new da({check:"string_format",format:"uppercase",...P(e)})}function js(e,t){return new _a({check:"string_format",format:"includes",...P(t),includes:e})}function Vs(e,t){return new fa({check:"string_format",format:"starts_with",...P(t),prefix:e})}function Ys(e,t){return new ma({check:"string_format",format:"ends_with",...P(t),suffix:e})}function nt(e){return new pa({check:"overwrite",tx:e})}function Ks(e){return nt(t=>t.normalize(e))}function qs(){return nt(e=>e.trim())}function Js(){return nt(e=>e.toLowerCase())}function Qs(){return nt(e=>e.toUpperCase())}function Xs(){return nt(e=>ci(e))}function ec(e,t,r){return new e({type:"array",element:t,...P(r)})}function tc(e,t,r){return new e({type:"custom",check:"custom",fn:t,...P(r)})}function rc(e){const t=nc(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(_t(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(_t(o))}},e(r.value,r)));return t}function nc(e,t){const r=new ke({check:"custom",...P(t)});return r._zod.check=e,r}function Tn(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??ft,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 v=a.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,v,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 Nn(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,v=e.external.uri??(C=>C);if(m)return{ref:v(m)};const g=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=g,{defId:g,ref:`${v("__shared")}#/${s}/${g}`}}if(a[1]===r)return{ref:"#"};const u=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=a=>{if(a[1].schema.$ref)return;const s=a[1],{ref: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
|
+
`)}g.write("payload.value = newResult;"),g.write("return payload;");const Y=g.compile();return(H,U)=>Y(v,H,U)};let i;const a=Tt,s=!Gr.jitless,u=s&&di.value,_=t.catchall;let p;e._zod.parse=(v,g)=>{p??(p=n.value);const C=v.value;return a(C)?s&&u&&g?.async===!1&&g.jitless!==!0?(i||(i=o(t.shape)),v=i(v,g),_?fn([],C,v,g,p,e):v):r(v,g):(v.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),v)}});function mn(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=>!at(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=>Je(a,n,Ke())))}),t)}const Qa=S("$ZodUnion",(e,t)=>{_e.init(e,t),ne(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ne(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ne(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ne(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>ur(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=>mn(l,o,e,i)):mn(s,o,e,i)}}),Xa=S("$ZodIntersection",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,i=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,u])=>pn(r,l,u)):pn(r,i,a)}});function pr(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(pt(e)&&pt(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=pr(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=pr(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 pn(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}),at(e))return e;const a=pr(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 es=S("$ZodEnum",(e,t)=>{_e.init(e,t);const r=jr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>_i.has(typeof o)).map(o=>typeof o=="string"?it(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}}),ts=S("$ZodLiteral",(e,t)=>{if(_e.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?it(n):n?it(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}}),rs=S("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Wr(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 ot;return r.value=o,r}});function hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const gn=S("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${ur(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=>hn(i,r.value)):hn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ns=S("$ZodExactOptional",(e,t)=>{gn.init(e,t),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),os=S("$ZodNullable",(e,t)=>{_e.init(e,t),ne(e._zod,"optin",()=>t.innerType._zod.optin),ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${ur(r.source)}|null)$`):void 0}),ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),is=S("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>yn(i,t)):yn(o,t)}});function yn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const as=S("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ss=S("$ZodNonOptional",(e,t)=>{_e.init(e,t),ne(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>bn(i,e)):bn(o,e)}});function bn(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 cs=S("$ZodCatch",(e,t)=>{_e.init(e,t),ne(e._zod,"optin",()=>t.innerType._zod.optin),ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Je(a,n,Ke()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Je(i,n,Ke()))},input:r.value}),r.issues=[]),r)}}),ls=S("$ZodPipe",(e,t)=>{_e.init(e,t),ne(e._zod,"values",()=>t.in._zod.values),ne(e._zod,"optin",()=>t.in._zod.optin),ne(e._zod,"optout",()=>t.out._zod.optout),ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(a=>Lt(a,t.in,n)):Lt(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Lt(i,t.out,n)):Lt(o,t.out,n)}});function Lt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const us=S("$ZodReadonly",(e,t)=>{_e.init(e,t),ne(e._zod,"propValues",()=>t.innerType._zod.propValues),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"optin",()=>t.innerType?._zod?.optin),ne(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(vn):vn(o)}});function vn(e){return e.value=Object.freeze(e.value),e}const ds=S("$ZodCustom",(e,t)=>{Oe.init(e,t),_e.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Sn(i,r,n,e));Sn(o,r,n,e)}});function Sn(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(ht(o))}}var An;class _s{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 fs(){return new _s}(An=globalThis).__zod_globalRegistry??(An.__zod_globalRegistry=fs());const gt=globalThis.__zod_globalRegistry;function ms(e,t){return new e({type:"string",...D(t)})}function ps(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D(t)})}function Cn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D(t)})}function ys(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D(t)})}function bs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D(t)})}function vs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D(t)})}function Ss(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D(t)})}function As(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D(t)})}function Cs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D(t)})}function ws(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D(t)})}function Es(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D(t)})}function Ts(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D(t)})}function Ns(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D(t)})}function ks(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D(t)})}function Os(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D(t)})}function Is(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D(t)})}function Ms(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D(t)})}function Ls(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D(t)})}function Ds(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D(t)})}function Ps(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D(t)})}function Fs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D(t)})}function $s(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D(t)})}function xs(e,t){return new e({type:"string",format:"date",check:"string_format",...D(t)})}function Bs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D(t)})}function zs(e,t){return new e({type:"string",format:"duration",check:"string_format",...D(t)})}function Rs(e,t){return new e({type:"number",coerce:!0,checks:[],...D(t)})}function Hs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...D(t)})}function Us(e,t){return new e({type:"boolean",...D(t)})}function Zs(e){return new e({type:"unknown"})}function Ws(e,t){return new e({type:"never",...D(t)})}function wn(e,t){return new sn({check:"less_than",...D(t),value:e,inclusive:!1})}function hr(e,t){return new sn({check:"less_than",...D(t),value:e,inclusive:!0})}function En(e,t){return new cn({check:"greater_than",...D(t),value:e,inclusive:!1})}function gr(e,t){return new cn({check:"greater_than",...D(t),value:e,inclusive:!0})}function Tn(e,t){return new aa({check:"multiple_of",...D(t),value:e})}function Nn(e,t){return new ca({check:"max_length",...D(t),maximum:e})}function Dt(e,t){return new la({check:"min_length",...D(t),minimum:e})}function kn(e,t){return new ua({check:"length_equals",...D(t),length:e})}function Gs(e,t){return new da({check:"string_format",format:"regex",...D(t),pattern:e})}function js(e){return new _a({check:"string_format",format:"lowercase",...D(e)})}function Vs(e){return new fa({check:"string_format",format:"uppercase",...D(e)})}function Ys(e,t){return new ma({check:"string_format",format:"includes",...D(t),includes:e})}function Ks(e,t){return new pa({check:"string_format",format:"starts_with",...D(t),prefix:e})}function qs(e,t){return new ha({check:"string_format",format:"ends_with",...D(t),suffix:e})}function st(e){return new ga({check:"overwrite",tx:e})}function Js(e){return st(t=>t.normalize(e))}function Qs(){return st(e=>e.trim())}function Xs(){return st(e=>e.toLowerCase())}function ec(){return st(e=>e.toUpperCase())}function tc(){return st(e=>ui(e))}function rc(e,t,r){return new e({type:"array",element:t,...D(r)})}function nc(e,t,r){return new e({type:"custom",check:"custom",fn:t,...D(r)})}function oc(e){const t=ic(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ht(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(ht(o))}},e(r.value,r)));return t}function ic(e,t){const r=new Oe({check:"custom",...D(t)});return r._zod.check=e,r}function On(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??gt,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 _={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,_);else{const v=a.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,v,_)}const p=e._zod.parent;p&&(a.ref||(a.ref=p),ve(p,t,_),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Ne(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 In(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??(C=>C);if(p)return{ref:v(p)};const g=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=g,{defId:g,ref:`${v("__shared")}#/${s}/${g}`}}if(a[1]===r)return{ref:"#"};const u=`#/${s}/`,_=a[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:u+_}},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 _=s.schema;for(const p in _)delete _[p];_.$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 kn(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),g=v.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,u),a._zod.parent===d)for(const p in l)p==="$ref"||p==="allOf"||p in u||delete l[p];if(g.$ref&&v.def)for(const p in l)p==="$ref"||p==="allOf"||p in v.def&&JSON.stringify(l[p])===JSON.stringify(v.def[p])&&delete l[p]}const m=a._zod.parent;if(m&&m!==d){n(m);const v=e.seen.get(m);if(v?.schema.$ref&&(l.$ref=v.schema.$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]}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:Mt(t,"input",e.processors),output:Mt(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 oc=(e,t={})=>r=>{const n=Tn({...r,processors:t});return Se(e,n),Nn(n,e),kn(n,e)},Mt=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},a=Tn({...o??{},target:i,io:t,processors:r});return Se(e,a),Nn(a,e),kn(a,e)},ic={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ac=(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=ic[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}))])}},sc=(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)},cc=(e,t,r,n)=>{r.type="boolean"},lc=(e,t,r,n)=>{r.not={}},uc=(e,t,r,n)=>{},dc=(e,t,r,n)=>{const o=e._zod.def,i=Zr(o.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},_c=(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},fc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pc=(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"]})},hc=(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)},gc=(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},yc=(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},bc=(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"}]},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},Sc=(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))},Ac=(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)))},Cc=(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},wc=(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},Ec=(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},On=(e,t,r,n)=>{const o=e._zod.def;Se(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Tc=S("ZodISODateTime",(e,t)=>{Oa.init(e,t),me.init(e,t)});function Nc(e){return Ps(Tc,e)}const kc=S("ZodISODate",(e,t)=>{Ia.init(e,t),me.init(e,t)});function Oc(e){return Fs(kc,e)}const Ic=S("ZodISOTime",(e,t)=>{Ma.init(e,t),me.init(e,t)});function Mc(e){return $s(Ic,e)}const Lc=S("ZodISODuration",(e,t)=>{La.init(e,t),me.init(e,t)});function Dc(e){return Bs(Lc,e)}const Pe=S("ZodError",(e,t)=>{qr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Si(e,r)},flatten:{value:r=>vi(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}),Pc=lr(Pe),Fc=ur(Pe),$c=Et(Pe),Bc=Tt(Pe),xc=wi(Pe),zc=Ei(Pe),Rc=Ti(Pe),Hc=Ni(Pe),Uc=ki(Pe),Zc=Oi(Pe),Wc=Ii(Pe),Gc=Mi(Pe),ge=S("ZodType",(e,t)=>(he.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Mt(e,"input"),output:Mt(e,"output")}}),e.toJSONSchema=oc(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)=>Pc(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>$c(e,r,n),e.parseAsync=async(r,n)=>Fc(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Bc(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>xc(e,r,n),e.decode=(r,n)=>zc(e,r,n),e.encodeAsync=async(r,n)=>Rc(e,r,n),e.decodeAsync=async(r,n)=>Hc(e,r,n),e.safeEncode=(r,n)=>Uc(e,r,n),e.safeDecode=(r,n)=>Zc(e,r,n),e.safeEncodeAsync=async(r,n)=>Wc(e,r,n),e.safeDecodeAsync=async(r,n)=>Gc(e,r,n),e.refine=(r,n)=>e.check(Hl(r,n)),e.superRefine=r=>e.check(Ul(r)),e.overwrite=r=>e.check(nt(r)),e.optional=()=>Bn(e),e.exactOptional=()=>kl(e),e.nullable=()=>xn(e),e.nullish=()=>Bn(xn(e)),e.nonoptional=r=>Pl(e,r),e.array=()=>gl(e),e.or=r=>Fn([e,r]),e.and=r=>Al(e,r),e.transform=r=>Rn(e,Tl(r)),e.default=r=>Ml(e,r),e.prefault=r=>Dl(e,r),e.catch=r=>$l(e,r),e.pipe=r=>Rn(e,r),e.readonly=()=>zl(e),e.describe=r=>{const n=e.clone();return ft.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return ft.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ft.get(e);const n=e.clone();return ft.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),In=S("_ZodString",(e,t)=>{dr.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,o,i)=>ac(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(js(...n)),e.startsWith=(...n)=>e.check(Vs(...n)),e.endsWith=(...n)=>e.check(Ys(...n)),e.min=(...n)=>e.check(It(...n)),e.max=(...n)=>e.check(wn(...n)),e.length=(...n)=>e.check(En(...n)),e.nonempty=(...n)=>e.check(It(1,...n)),e.lowercase=n=>e.check(Ws(n)),e.uppercase=n=>e.check(Gs(n)),e.trim=()=>e.check(qs()),e.normalize=(...n)=>e.check(Ks(...n)),e.toLowerCase=()=>e.check(Js()),e.toUpperCase=()=>e.check(Qs()),e.slugify=()=>e.check(Xs())}),jc=S("ZodString",(e,t)=>{dr.init(e,t),In.init(e,t),e.email=r=>e.check(fs(Vc,r)),e.url=r=>e.check(ys(Yc,r)),e.jwt=r=>e.check(Ds(ll,r)),e.emoji=r=>e.check(bs(Kc,r)),e.guid=r=>e.check(vn(Mn,r)),e.uuid=r=>e.check(ms(Lt,r)),e.uuidv4=r=>e.check(ps(Lt,r)),e.uuidv6=r=>e.check(hs(Lt,r)),e.uuidv7=r=>e.check(gs(Lt,r)),e.nanoid=r=>e.check(vs(qc,r)),e.guid=r=>e.check(vn(Mn,r)),e.cuid=r=>e.check(Ss(Jc,r)),e.cuid2=r=>e.check(As(Qc,r)),e.ulid=r=>e.check(Cs(Xc,r)),e.base64=r=>e.check(Is(al,r)),e.base64url=r=>e.check(Ms(sl,r)),e.xid=r=>e.check(ws(el,r)),e.ksuid=r=>e.check(Es(tl,r)),e.ipv4=r=>e.check(Ts(rl,r)),e.ipv6=r=>e.check(Ns(nl,r)),e.cidrv4=r=>e.check(ks(ol,r)),e.cidrv6=r=>e.check(Os(il,r)),e.e164=r=>e.check(Ls(cl,r)),e.datetime=r=>e.check(Nc(r)),e.date=r=>e.check(Oc(r)),e.time=r=>e.check(Mc(r)),e.duration=r=>e.check(Dc(r))});function Ze(e){return _s(jc,e)}const me=S("ZodStringFormat",(e,t)=>{fe.init(e,t),In.init(e,t)}),Vc=S("ZodEmail",(e,t)=>{va.init(e,t),me.init(e,t)}),Mn=S("ZodGUID",(e,t)=>{ya.init(e,t),me.init(e,t)}),Lt=S("ZodUUID",(e,t)=>{ba.init(e,t),me.init(e,t)}),Yc=S("ZodURL",(e,t)=>{Sa.init(e,t),me.init(e,t)}),Kc=S("ZodEmoji",(e,t)=>{Aa.init(e,t),me.init(e,t)}),qc=S("ZodNanoID",(e,t)=>{Ca.init(e,t),me.init(e,t)}),Jc=S("ZodCUID",(e,t)=>{wa.init(e,t),me.init(e,t)}),Qc=S("ZodCUID2",(e,t)=>{Ea.init(e,t),me.init(e,t)}),Xc=S("ZodULID",(e,t)=>{Ta.init(e,t),me.init(e,t)}),el=S("ZodXID",(e,t)=>{Na.init(e,t),me.init(e,t)}),tl=S("ZodKSUID",(e,t)=>{ka.init(e,t),me.init(e,t)}),rl=S("ZodIPv4",(e,t)=>{Da.init(e,t),me.init(e,t)}),nl=S("ZodIPv6",(e,t)=>{Pa.init(e,t),me.init(e,t)}),ol=S("ZodCIDRv4",(e,t)=>{Fa.init(e,t),me.init(e,t)}),il=S("ZodCIDRv6",(e,t)=>{$a.init(e,t),me.init(e,t)}),al=S("ZodBase64",(e,t)=>{Ba.init(e,t),me.init(e,t)}),sl=S("ZodBase64URL",(e,t)=>{za.init(e,t),me.init(e,t)}),cl=S("ZodE164",(e,t)=>{Ra.init(e,t),me.init(e,t)}),ll=S("ZodJWT",(e,t)=>{Ua.init(e,t),me.init(e,t)}),Ln=S("ZodNumber",(e,t)=>{sn.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,o,i)=>sc(e,n,o),e.gt=(n,o)=>e.check(An(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(Sn(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(Dn(n)),e.safe=n=>e.check(Dn(n)),e.positive=n=>e.check(An(0,n)),e.nonnegative=n=>e.check(mr(0,n)),e.negative=n=>e.check(Sn(0,n)),e.nonpositive=n=>e.check(fr(0,n)),e.multipleOf=(n,o)=>e.check(Cn(n,o)),e.step=(n,o)=>e.check(Cn(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}),ul=S("ZodNumberFormat",(e,t)=>{Za.init(e,t),Ln.init(e,t)});function Dn(e){return zs(ul,e)}const dl=S("ZodBoolean",(e,t)=>{Wa.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cc(e,r,n)});function _l(e){return Rs(dl,e)}const fl=S("ZodUnknown",(e,t)=>{Ga.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>uc()});function Pn(){return Hs(fl)}const ml=S("ZodNever",(e,t)=>{ja.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lc(e,r,n)});function pl(e){return Us(ml,e)}const hl=S("ZodArray",(e,t)=>{Va.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pc(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(It(r,n)),e.nonempty=r=>e.check(It(1,r)),e.max=(r,n)=>e.check(wn(r,n)),e.length=(r,n)=>e.check(En(r,n)),e.unwrap=()=>e.element});function gl(e,t){return ec(hl,e,t)}const yl=S("ZodObject",(e,t)=>{Ka.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hc(e,r,n,o),ae(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:Pn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pn()}),e.strict=()=>e.clone({...e._zod.def,catchall:pl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pi(e,r),e.safeExtend=r=>hi(e,r),e.merge=r=>gi(e,r),e.pick=r=>fi(e,r),e.omit=r=>mi(e,r),e.partial=(...r)=>yi($n,e,r[0]),e.required=(...r)=>bi(zn,e,r[0])});function bl(e,t){const r={type:"object",shape:e??{},...P(t)};return new yl(r)}const vl=S("ZodUnion",(e,t)=>{qa.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gc(e,r,n,o),e.options=t.options});function Fn(e,t){return new vl({type:"union",options:e,...P(t)})}const Sl=S("ZodIntersection",(e,t)=>{Ja.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yc(e,r,n,o)});function Al(e,t){return new Sl({type:"intersection",left:e,right:t})}const pr=S("ZodEnum",(e,t)=>{Qa.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,o,i)=>dc(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:[],...P(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:[],...P(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,...P(t)})}const Cl=S("ZodLiteral",(e,t)=>{Xa.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_c(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 wl(e,t){return new Cl({type:"literal",values:Array.isArray(e)?e:[e],...P(t)})}const El=S("ZodTransform",(e,t)=>{es.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mc(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Hr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(_t(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(_t(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Tl(e){return new El({type:"transform",transform:e})}const $n=S("ZodOptional",(e,t)=>{mn.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>On(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Bn(e){return new $n({type:"optional",innerType:e})}const Nl=S("ZodExactOptional",(e,t)=>{ts.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>On(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function kl(e){return new Nl({type:"optional",innerType:e})}const Ol=S("ZodNullable",(e,t)=>{rs.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new Ol({type:"nullable",innerType:e})}const Il=S("ZodDefault",(e,t)=>{ns.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ml(e,t){return new Il({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Vr(t)}})}const Ll=S("ZodPrefault",(e,t)=>{os.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ac(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Dl(e,t){return new Ll({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Vr(t)}})}const zn=S("ZodNonOptional",(e,t)=>{is.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Pl(e,t){return new zn({type:"nonoptional",innerType:e,...P(t)})}const Fl=S("ZodCatch",(e,t)=>{as.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $l(e,t){return new Fl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Bl=S("ZodPipe",(e,t)=>{ss.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wc(e,r,n,o),e.in=t.in,e.out=t.out});function Rn(e,t){return new Bl({type:"pipe",in:e,out:t})}const xl=S("ZodReadonly",(e,t)=>{cs.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ec(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function zl(e){return new xl({type:"readonly",innerType:e})}const Rl=S("ZodCustom",(e,t)=>{ls.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fc(e,r)});function Hl(e,t={}){return tc(Rl,e,t)}function Ul(e){return rc(e)}const hr={custom:"custom"};function ve(e){return xs(Ln,e)}const Zl=["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible"],Wl=new Set([...Zl,"is_corporation"]);bl({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:_l().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 Dt(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 Hn(e){return e?Dt(e.state??e.State):!1}function Un(e,t,r){return e==="has_health_insurance_auto_accident"?t==="BundleCustomer"?!1:!Hn(r):Wl.has(e)?!Hn(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"]),Zn=new Date().getUTCFullYear(),Pt=Ze().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),Wn=Fn([wl(""),Ze().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),Kl=(e,t,r)=>ve({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)=>ve({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.`),Ft=(e,t=1600)=>ve({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.`),$t=e=>ve({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.`),mt=(e,t,r=0)=>{const n=Math.pow(10,t)-1,o=n.toLocaleString("en-US"),i=r.toLocaleString("en-US");return ve({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.`)},ql={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:Pt,last_name:Pt,middle_name:Wn,co_applicant_first_name:Pt,co_applicant_last_name:Pt,co_applicant_middle_name:Wn,year_built:Ft("Year built",1800),year_roof_updated:ve({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:Ft("Heating update year"),plumbing_update_year:Ft("Plumbing update year"),electrical_update_year:Ft("Electrical update year"),total_area_sq_ft:Kl("Square footage",1,999999),sale_price_cents:ve({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:$t("Number of years with your prior carrier"),home_continuous_coverage_years:$t("How long you have had continuous home coverage"),household_size:ve({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:ve({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:mt("Replacement cost",9,1),other_structures_coverage:mt("Other structures",9),personal_property_coverage:mt("Personal property",7),loss_of_use_coverage:mt("Loss of use coverage",8),years_at_address:ve({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:ve({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:ve({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:ve({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:ve({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:ve({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:ve({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:mt("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:ve({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:ve({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:$t("Years with prior auto carrier"),auto_prior_months:ve({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:$t("Years with continuous auto coverage")};function ye(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 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 Gn=[{targetKey:"social_security_number",dependsOn:["social_security_number","state"],validate:e=>{if(!("social_security_number"in e)||!Dt(e.state))return;const t=e.social_security_number;return(typeof t=="string"?t.trim():"")===""?"Social Security Number is required in New Jersey.":void 0}},{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:e=>{const t=e.date_of_birth;if(!t||typeof t!="string")return;const r=ye(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":We(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=ye(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":We(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=ye(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=ye(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=ye(r),o=ye(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=ye(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=ye(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=ye(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=ye(r);if(isNaN(o.getTime()))return;const i=We(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=ye(r);if(isNaN(o.getTime()))return;const i=We(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=ye(r);if(isNaN(o.getTime()))return;const i=We(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=ye(r);if(isNaN(o.getTime()))return;const i=We(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=ye(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=ye(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=ye(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=ye(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=ye(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=ye(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=ye(r);if(isNaN(o.getTime()))return;const i=We(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=ye(r);if(isNaN(o.getTime()))return;const i=We(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 gr(e,t){const r=ql[e];if(!r)return;const n=r.safeParse(t);return n.success?void 0:n.error.issues[0].message}function jn(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 Jl(e,t){const r={};for(const n of Gn){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 pt(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 Bt(e,t){const r={};e.forEach((a,s)=>{const l=pt(a,s),u=t[l];if(a.required&&Ge(u,a.inputType)){r[l]="Required";return}if(!Ge(u,a.inputType)){const d=gr(l,u);if(d){r[l]=d;return}}});const n={...t};e.forEach((a,s)=>{const l=pt(a,s);l in n||(n[l]="")});const o=new Set(Object.keys(r).filter(a=>r[a])),i=Jl(n,o);for(const[a,s]of Object.entries(i))r[a]=s;return r}function Ql(e){if(e===""||e===null||e===void 0)return;const t=Number(e);return Number.isNaN(t)?void 0:t}const Xl={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"},eu={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},tu={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"},ru={Business:"Business",Pleasure:"Pleasure",Farming:"Farming",To_FromWork:"To/From Work",To_FromSchool:"To/From School"},nu={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"},ou={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"},iu={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"},au={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"},su={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},cu={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"},lu={cov25000:"25,000",cov35000:"35,000",cov50000:"50,000",cov100000:"100,000",cov200000:"200,000",cov250000:"250,000",cov300000:"300,000",cov500000:"500,000"},uu={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"},du={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},br={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",Thousand:"1,000",TwoThousand:"2,000"},xt={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},_u=["NoCoverage","TwentyFive","Fifty","SeventyFive","Hundred","TwoHundred","Unlimited"],Vn={NoCoverage:"No Coverage",cov20to600:"20/600",cov25to750:"25/750",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500"},Yn={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"},fu={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"},mu={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)"},pu={OwnerPrimary:"Owner Primary",OwnerSecondary:"Owner Secondary",OwnerSeasonal:"Owner Seasonal"},hu={Basic:"Basic",Modest:"Modest",Average:"Average",AboveAverage:"Above Average",Expensive:"Expensive",VeryExpensive:"Very Expensive",Opulent:"Opulent"},gu={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"},yu={Slab:"Slab",Basement:"Basement",CrawlSpace:"Crawl Space",PartialBasement:"Partial Basement",PiersPostsPiles:"Piers / Posts / Piles",Open:"Open"},bu={NotOverWater:"No",PartiallyOverWater:"Partially Over Water",FullyOrEntirelyOverWater:"Fully or Entirely Over Water"},vu={One:"1",OneHalf:"1.5",Two:"2",TwoHalf:"2.5",Three:"3",ThreeHalf:"3.5",Four:"4",BiLevel:"Bi-Level",TriLevel:"Tri-Level"},Su={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"},Au={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"},Cu={B_Gable:"Gable",C_Hip:"Hip",A_Flat:"Flat",D_Other:"Other"},wu={NotUpdated:"Not Updated",PartialUpdate:"Partial Update",CompleteUpdate:"Complete Update"},Eu={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"},Tu={AboveGround:"Above Ground",BelowGround:"Below Ground"},Nu={Basement:"Below Grade Basement",SplitLevelBasement:"Split Level Basement",WalkoutBasement:"Walkout Basement"},ku={EntirelyCopper:"Entirely Copper",EntirelyGalvanized:"Entirely Galvanized",EntirelyPEX:"Entirely PEX",EntirelyPVC:"Entirely PVC",Polybutylene:"Polybutylene"},Ou={TwentyFive:"$25,000",Fifty:"$50,000",OneHundred:"$100,000",TwoHundred:"$200,000",ThreeHundred:"$300,000",FourHundred:"$400,000",FiveHundred:"$500,000"},Iu={cov1000:"$1,000",cov2000:"$2,000",cov3000:"$3,000",cov4000:"$4,000",cov5000:"$5,000"},Mu={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%"},Lu={None:"None",OnePercent:"1%",TwoPercent:"2%",FivePercent:"5%",TenPercent:"10%"},Du={_0_500ft:"0-500 Feet",_501_1000ft:"501-1000 Feet",_1001ftAndGreater:"1001 Feet And Greater"},Pu={Lessthan5miles:"Less Than 5 Miles",Over5miles:"Over 5 Miles",NotAvailable:"Not Available"},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"},qn={Single:"Single",Married:"Married",Seperated:"Separated",Divorced:"Divorced",Widowed:"Widowed",DomesticPartner:"Domestic Partner"},Jn={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"},Fu={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"},$u={Verbal_Threshold:"Limited right to sue",Zero_Threshold:"Unlimited right to sue",Full:"Full",Limited:"Limited"},Bu={Primary:"Primary",Secondary:"Secondary"},xu={cov1000:"$1,000",cov10000:"$10,000"},zu={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"},Ru={cov250:"$250",cov500:"$500",cov1000:"$1,000",cov2000:"$2,000",cov2500:"$2,500"},Hu={"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"]},Uu={"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"},Xn=Hu,eo=Uu;function vr(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 zt(e){return vr(e,Qn)}function to(e){return vr(e,Yn)}function ro(e){return vr(e,eo)}function Zu(e){return e.trim().toLowerCase()}function no(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=no(e[t.expirationDateKey]),n=no(e[t.effectiveDateKey]);return r==null||n==null?!1:r<n}const Wu=new Set(["HomePolicy","BundlePolicy"]);function Rt(e,t,r){return String(e.key??"")!=="lapse_in_coverage"||!r||!Wu.has(r)?!0:t.home_prior_carrier_name!=="NoPriorInsurance"}function Sr(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 m=d.conditionalQuestions??[];m.forEach(a),s(m)})})};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 Ht(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 Ut(e,t){const r=String(e.key??"");return t.noInsuranceReasonKeys.has(r)}const Gu=["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"],Ar="credify_quote_id",Cr="credify_auth_token";function ju(e){try{localStorage.setItem(Ar,e)}catch(t){console.error("Failed to save quoteId to localStorage:",t)}}function Vu(){try{return localStorage.getItem(Ar)}catch(e){return console.error("Failed to load quoteId from localStorage:",e),null}}function oo(){try{localStorage.removeItem(Ar)}catch(e){console.error("Failed to clear quoteId from localStorage:",e)}}function Yu(e){try{localStorage.setItem(Cr,e)}catch(t){console.error("Failed to save authToken to localStorage:",t)}}function Ku(){try{return localStorage.getItem(Cr)}catch(e){return console.error("Failed to load authToken from localStorage:",e),null}}function io(){try{localStorage.removeItem(Cr)}catch(e){console.error("Failed to clear authToken from localStorage:",e)}}function qu(){oo(),io()}const Fe="https://api.getcredify.com";let st=null;function Ju(e){st=e,Yu(e)}function Zt(){return st}function wr(){const e=Ku();e&&(st=e)}function ao(){st=null,io()}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 Qu(e){try{return await e.json()}catch{return{}}}async function Xu(e,t){const r=t?{stage:e,quoteId:t}:{stage:e};return await(await $e(`${Fe}/get-questions-by-stage`,r)).json()}async function Wt(e){const t=e?{quoteId:e}:{};return await(await $e(`${Fe}/get-stages-for-quote`,t)).json()}async function ed(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 gt(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 Qu(o);return!i||typeof i!="object"||!("status"in i)||i.status==null?{status:"success"}:i}async function td(e,t){return await(await $e(`${Fe}/verify-quote`,{quoteId:e,smsCode:t})).json()}async function rd(e){return await(await $e(`${Fe}/is-supported-state`,{state:e})).json()}async function so(){return await(await $e(`${Fe}/get-rates`,{})).json()}async function co(e){const t=e?{quoteId:e}:{};return await(await $e(`${Fe}/get-quote`,t)).json()}async function lo(e){return(await $e(`${Fe}/get-vehicle-options`,e)).json()}async function nd(e){return(await $e(`${Fe}/get-vehicle-options`,{...e,action:"vinDecode"})).json()}async function od(e){const r=await(await $e(`${Fe}/request-bind`,{quoteRateId:e})).json();return r&&typeof r=="object"&&"success"in r?r:{success:!0}}const Er=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),id={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"},uo={auto_prior_carrier_name:Xl,auto_prior_liability_limit:nu,auto_reason_for_no_insurance:ou,residence_type:eu,home_prior_carrier_name:tu,policy_bi:iu,policy_um:au,policy_pd:su,policy_mp:cu,policy_umpd:lu,policy_pip:uu,policy_auto_death_indemnity:du,vehicle_comp_deductible:br,vehicle_coll_deductible:br,vehicle_towing_and_labor:xt,vehicle_transportation_expense:Vn,education_level:Yn,industry:Qn,occupation:eo,usage:ru,architectural_style:fu,dwelling_type:mu,occupancy_type:pu,construction_quality:hu,construction_type:gu,foundation_type:yu,located_over_water:bu,number_of_stories:vu,exterior_wall_type:Su,roof_material_type:Au,roof_shape:Cu,roof_updated_type:wu,heating_type:Eu,oil_tank_location:Tu,basement_type:Nu,plumbing_type:ku,personal_liability:Ou,dwelling_medical_payments:Iu,all_perils_deductible:Mu,windstorm_deductible:Lu,distance_from_fire_hydrant_ft:Du,distance_from_fire_station_miles:Pu,employment_industry:Kn,marital_status:qn,gender:Jn,co_applicant_employment_industry:Kn,co_applicant_marital_status:qn,co_applicant_gender:Jn,description:Fu,tort_threshold:$u,pip_coverage_type:Bu,extended_medical:xu,additional_pip:zu,policy_pip_deductible:Ru},ad=["OTHER / NOT LISTED"],sd=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],cd=["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 _o(e){const t=e.replace(/\D+/g,"");if(t!=="")return Ql(t)}function ld(e){return e==="-"||e==="+"||e==="."||e==="e"||e==="E"}const ud={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},fo=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"]),dd=new Set(["total_area_sq_ft","annual_mileage","miles_to_work","distance_to_coast_miles"]),Gt={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"},_d={license_number:20};function fd(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 md=new Set(["Disabled","Retired","Unemployed","Other"]);function Tr(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!md.has(a)}function Nr(e,t,r,n){return Un(e,n,r)}function jt(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 mo(e,t){return jt(e)?"Yes":t}function po(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function ho(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 go(e,t){const r=po(e),n=po(t);if(r!=null&&n!=null)return r-n;const o=ho(e),i=ho(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function pd(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function yt(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=go(e,r);return n!=null&&n<0}case"greaterThan":{const n=go(e,r);return n!=null&&n>0}case"contains":return pd(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 bt(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 Ce(e,t,r){return bt(e,[...t??[],r])}function we(e,t,r,n){return Be(e,[...t??[],r],n)}function hd(e,t){return e?.length?`${e.join("-")}-${t}`:t}const gd="__items",Vt=e=>`${e}${gd}`;function Oe(e){return e==null?"":typeof e=="string"?e:String(e)}function yo(e){return e==null?"":typeof e=="number"&&Number.isFinite(e)||typeof e=="string"?e:""}function yd(e){return e==null?"":typeof e=="string"||typeof e=="number"?e:String(e)}function bd({questions:e,initialValues:t,controlledValues:r,onChangeValues:n,onSubmit:o,quoteId:i,widgetStageKey:a}){const s=h.useMemo(()=>nr(e),[e]),l=h.useMemo(()=>Sr(s),[s]),u=h.useMemo(()=>a==="BundlePolicy"?!0:s.some(A=>String(A.key)==="home_prior_carrier_name")&&s.some(A=>String(A.key)==="driver_vehicle_assignments"),[a,s]),d=h.useMemo(()=>{const A={};return t&&Object.assign(A,t),A},[t]),[m,v]=h.useState(d);h.useEffect(()=>{v(d)},[d]);const[g,C]=h.useState({}),p=h.useMemo(()=>({...g,...r??m}),[g,r,m]);h.useEffect(()=>{r&&C(A=>({...A,...r}))},[r]);const[Y,z]=h.useState({}),K=h.useRef(new Map),R=h.useRef(new Set),[,H]=h.useState({}),[B,G]=h.useState({}),Z=h.useRef(!1);h.useEffect(()=>{!i||Z.current||!s.some(y=>y.key==="year"||y.key==="make"||y.key==="model"||y.key==="body_style")||(Z.current=!0,lo({quoteId:i}).catch(()=>{}))},[i,s]);const[le,F]=h.useState({}),[se,ee]=h.useState({}),Te=h.useCallback(async(A,y)=>{if(!i||!jn(y))return;const _=A?A.join("-"):"_root";F(w=>({...w,[_]:!0})),ee(w=>({...w,[_]:null}));try{const w=await nd({quoteId:i,vin:y});if(w.error){ee(k=>({...k,[_]:w.error}));return}let E=p;w.year&&(E=we(E,A,"year",String(w.year))),w.make&&(E=we(E,A,"make",w.make)),w.model&&(E=we(E,A,"model",w.model)),w.bodyStyle&&(E=we(E,A,"body_style",w.bodyStyle)),r&&n?n(E):v(E),C(E),K.current.clear(),R.current.clear(),H({})}catch{ee(w=>({...w,[_]:"VIN lookup failed — please enter vehicle details manually"}))}finally{F(w=>({...w,[_]:!1}))}},[i,p,r,n]),te=h.useCallback(A=>{const y=`${A.year}|${A.make??""}|${A.model??""}`,_=A.model?"bodyStyles":A.make?"models":"makes",w=K.current.get(y);return w?w[_]??[]:void 0},[]),J=h.useCallback((A,y)=>{if(!i)return;const _=`${y.year}|${y.make??""}|${y.model??""}`,w=y.model?"bodyStyles":y.make?"models":"makes",E=`${A}:${w}`;K.current.has(_)||R.current.has(_)||(R.current.add(_),G(k=>({...k,[E]:!0})),lo({quoteId:i,...y}).then(k=>{K.current.set(_,k),H(D=>({...D,[E]:k[w]??[]}))}).catch(()=>{K.current.set(_,{}),H(k=>({...k,[E]:[]}))}).finally(()=>{R.current.delete(_),G(k=>({...k,[E]:!1}))}))},[i]);function M(A,y,_){const w=p,E=A?bt(p,A)??{}:w;return A?{state:w.state,...E,[y]:_}:{...E,[y]:_}}function f(A,y){const _=Gn.filter(E=>E.targetKey===A||E.dependsOn.includes(A)),w={[A]:void 0};for(const E of _){const k=E.validate(y);E.targetKey in w?k!==void 0&&(w[E.targetKey]=k):w[E.targetKey]=k}z(E=>({...E,...w}))}const b=(A,y,_)=>{const w=Ce(p,_,A);if(Ge(w,y)){Y[A]&&z(k=>({...k,[A]:void 0}));return}const E=gr(A,w);if(E){z(k=>({...k,[A]:E}));return}f(A,M(_,A,w))};h.useEffect(()=>{let A=p,y=!1;s.forEach(_=>{if(!jt(_))return;const w=String(_.key);Ce(A,void 0,w)!=="Yes"&&(A=we(A,void 0,w,"Yes"),y=!0)}),y&&(r&&n?n(A):v(A),C(A))},[s,p,r,n]);function L(A,y){const _=A.key;if((_==="relationship_to_insured"||_==="is_registered_owner")&&y){const T=y[y.length-1];if(typeof T=="number"&&T===0)return null}if((_==="purchase_date"||_==="cost_new_value_cents")&&y)return null;if(_==="custom_equipment_value_cents"&&y){const T=Ce(p,y,"vehicle_has_modifications");if(T!=="Yes"&&T!==!0)return null}const w=_==="auto_reason_for_no_insurance"&&l.currentCarrierKey?p[l.currentCarrierKey]==="NoPriorInsurance"?"Reason you are not currently insured":"Reason for lapse in coverage":A.question,E=A.hint,k=Ce(p,y,_),D=Ut(A,l)?ht(p,l):_==="social_security_number"&&Dt(p.state??p.State)?!0:A.required,V=Y[_],re=T=>{let N=we(p,y,_,T);if(A.inputType==="radio"&&A.conditionals){const I=A.conditionals??[];for(const x of I){const ie=Ce(p,y,_),ue=yt(ie,x.conditionalType,x.conditionalValue),Q=yt(T,x.conditionalType,x.conditionalValue);if(ue&&!Q&&x.conditionalQuestionsAllowMultiple){const de=x.conditionalQuestions??[];if(de.length>0){const $=Vt(_);N=Be(N,[...y??[],$],[]);const ce=(X,oe)=>{X.forEach(q=>{(q.conditionals??[]).forEach(be=>{if(be.conditionalQuestionsAllowMultiple){const Ne=Vt(q.key);N=Be(N,[...oe,Ne],[])}const pe=be.conditionalQuestions??[];pe.length>0&&ce(pe,oe)})})};ce(de,[...y??[],$])}}}}r&&n?n(N):v(N),C(N)};if(_==="vehicle_policy_selections"){const T=p.vehicles__items??[],N=p.drivers__items??[];if(T.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles first to configure coverage selections."},_);const I=p.driver_vehicle_assignments??{},x=N.length>1,ie=q=>Object.entries(q).map(([ne,be])=>({value:ne,label:be})),ue=ie(br),Q=Dt(p.state??p.State)?Object.fromEntries(_u.filter(q=>q in xt).map(q=>[q,xt[q]])):xt,de=ie(Q),$=ie(Vn),ce=(q,ne,be)=>{const pe=Be(p,["vehicles__items",q,ne],be);r&&n?n(pe):v(pe),C(pe)},X=(q,ne,be)=>{const pe={...I},Ne=`v${q}`;pe[Ne]={...pe[Ne]??{}},pe[Ne][`d${ne}`]=be;const _e=Be(p,["driver_vehicle_assignments"],pe);r&&n?n(_e):v(_e),C(_e)},oe=q=>{if(!x)return null;const ne=I[`v${q}`];if(!ne)return null;const be=N.map((_e,xe)=>ne[`d${xe}`]??0),pe=be.filter(_e=>_e>0);if(pe.length>=2&&pe.every(_e=>_e===pe[0])&&pe[0]===50)return`Assignments for Vehicle ${q+1} cannot be 50 percent for both Drivers.`;const Ne=be.reduce((_e,xe)=>_e+xe,0);return Ne>0&&Ne!==100?`Driver percentages for this vehicle must add up to 100% (currently ${Ne}%).`:null};return c.jsx("div",{children:T.map((q,ne)=>{const be=[q.year,q.make,q.model].filter(Boolean).join(" ")||`Vehicle ${ne+1}`,pe=oe(ne),Ne=_e=>typeof q[_e]=="string"?q[_e]:"";return c.jsxs("fieldset",{style:{border:`1px solid ${pe?"#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(ut,{id:`veh-${ne}-comp`,label:"Comprehensive deductible",required:!0,placeholder:"Select...",options:ue,value:Ne("vehicle_comp_deductible"),onChange:_e=>ce(ne,"vehicle_comp_deductible",_e.currentTarget.value)}),c.jsx(ut,{id:`veh-${ne}-coll`,label:"Collision deductible",required:!0,placeholder:"Select...",options:ue,value:Ne("vehicle_coll_deductible"),onChange:_e=>ce(ne,"vehicle_coll_deductible",_e.currentTarget.value)}),c.jsx(ut,{id:`veh-${ne}-tow`,label:"Towing and Labor",required:!0,placeholder:"Select...",options:de,value:Ne("vehicle_towing_and_labor"),onChange:_e=>ce(ne,"vehicle_towing_and_labor",_e.currentTarget.value)}),c.jsx(ut,{id:`veh-${ne}-trans`,label:"Transportation expense",required:!0,placeholder:"Select...",options:$,value:Ne("vehicle_transportation_expense"),onChange:_e=>ce(ne,"vehicle_transportation_expense",_e.currentTarget.value)})]}),x&&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:N.map((_e,xe)=>{const Zo=[_e.first_name,_e.last_name].filter(Boolean).join(" ")||`Driver ${xe+1}`,Fr=I[`v${ne}`]?.[`d${xe}`];return c.jsx("div",{style:{flex:"0 0 140px"},children:c.jsx(er,{id:`assignment-v${ne}-d${xe}`,label:`${Zo} %`,value:Fr??"",min:0,max:100,step:1,inputMode:"numeric",onChange:ze=>{const ct=ze.currentTarget.value.replace(/\D+/g,"");X(ne,xe,ct===""?0:Math.min(100,parseInt(ct,10)))}})},`${ne}-${xe}`)})}),pe&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:pe})]})]},ne)})},_)}if(_==="driver_vehicle_assignments"){const T=p.vehicles__items??[],N=p.drivers__items??[];if(u&&N.length<=1)return null;if(T.length===0||N.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},_);const I=p.driver_vehicle_assignments??{},x=(ue,Q,de)=>{const $={...I},ce=`v${ue}`;$[ce]={...$[ce]??{}},$[ce][`d${Q}`]=de,re($)},ie=ue=>{if(N.length<2)return null;const Q=I[`v${ue}`];if(!Q)return null;const de=N.map((X,oe)=>Q[`d${oe}`]??0),$=de.filter(X=>X>0);if($.length>=2&&$.every(X=>X===$[0])&&$[0]===50)return`Assignments for Vehicle ${ue+1} cannot be 50 percent for both Drivers.`;const ce=de.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}),T.map((ue,Q)=>{const de=[ue.year,ue.make,ue.model].filter(Boolean).join(" ")||`Vehicle ${Q+1}`,$=ie(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:de}),c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:N.map((ce,X)=>{const oe=[ce.first_name,ce.last_name].filter(Boolean).join(" ")||`Driver ${X+1}`,q=I[`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:q??"",min:0,max:100,step:1,inputMode:"numeric",onChange:ne=>{const be=ne.currentTarget.value.replace(/\D+/g,"");x(Q,X,be===""?0:Math.min(100,parseInt(be,10)))}})},`${Q}-${X}`)})}),$&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:$})]},Q)})]},_)}switch(A.inputType){case"text":{if(_==="vin"&&i){const T=y?y.join("-"):"_root",N=le[T]??!1,I=se[T]??null,x=[E?`${_}-hint`:null,V?`${_}-error`:null,I?`${_}-vin-error`:null].filter(Boolean).join(" ");return c.jsxs("div",{children:[c.jsx(Me,{id:_,label:w,hint:E,error:V,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 ${V?"input-error":""}`,"aria-invalid":!!V,"aria-describedby":x||void 0,"aria-required":D||void 0,required:D,value:Oe(k),maxLength:17,onChange:ie=>re(ie.currentTarget.value),onBlur:()=>b(_,"text",y),autoComplete:Gt[_],type:"text"})}),c.jsx("button",{type:"button",disabled:N||!jn(Oe(k)),className:"btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",onClick:()=>Te(y,Oe(k)),children:N?"Looking up...":"Verify VIN"})]})}),I&&c.jsx("p",{id:`${_}-vin-error`,className:"text-sm text-red-600 mt-1",children:I})]},_)}if(_==="sms_code"){const T=Oe(k);return c.jsx(Xt,{id:_,label:w,hint:E,value:T,inputMode:"numeric",pattern:"[0-9]*",maxLength:6,onChange:N=>{const I=N.currentTarget.value.replace(/\D+/g,"").slice(0,6);re(I)},onBlur:()=>b(_,"text",y),"aria-required":D||void 0,error:V,autoComplete:Gt[_]},_)}return _==="license_number"?c.jsx(Xt,{id:_,label:w,hint:E,value:Oe(k),onChange:T=>re(T.currentTarget.value.replace(/[^A-Z0-9]/gi,"").slice(0,20)),onBlur:()=>b(_,"text",y),"aria-required":D||void 0,error:V,autoComplete:"off",maxLength:20},_):_==="social_security_number"?c.jsx(Yo,{id:_,label:w,hint:E,value:Oe(k),onChange:T=>re(T.currentTarget.value),onBlur:()=>b(_,"text",y),"aria-required":D||void 0,error:V},_):c.jsx(Xt,{id:_,label:w,hint:E,value:Oe(k),onChange:T=>re(T.currentTarget.value),onBlur:()=>b(_,"text",y),"aria-required":D||void 0,error:V,autoComplete:Gt[_],maxLength:_d[_]},_)}case"email":return c.jsx(Ko,{id:_,label:w,value:Oe(k),onChange:T=>re(T.currentTarget.value),onBlur:()=>b(_,"email",y),"aria-required":D||void 0,error:V},_);case"password":return c.jsx(Qo,{id:_,label:w,value:Oe(k),onChange:T=>re(T.currentTarget.value),onBlur:()=>b(_,"password",y),"aria-required":D||void 0,error:V},_);case"tel":return c.jsxs(c.Fragment,{children:[c.jsx(qo,{id:_,label:w,value:Oe(k),onChange:T=>re(T.currentTarget.value),onBlur:()=>b(_,"tel",y),"aria-required":D||void 0,error:V},_),_==="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:w,value:Oe(k),onChange:T=>re(T.currentTarget.value),onBlur:()=>b(_,"url",y),"aria-required":D||void 0,error:V},_);case"number":{const T=ud[_];return fo.has(_)||dd.has(_)?c.jsx(Vo,{id:_,label:w,hint:E,value:yo(k),isCurrency:fo.has(_),maxDigits:T,onChange:N=>re(_o(N.currentTarget.value)),onBlur:()=>b(_,"number",y),"aria-required":D||void 0,error:V},_):c.jsx(er,{id:_,label:w,hint:E,value:yo(k),inputMode:"numeric",pattern:"[0-9]*",onKeyDown:N=>{if(ld(N.key)){N.preventDefault();return}T!==void 0&&/^\d$/.test(N.key)&&String(N.currentTarget.value).replace(/\D/g,"").length>=T&&N.preventDefault()},onChange:N=>{let I=N.currentTarget.value;T!==void 0&&(I=I.slice(0,T)),re(_o(I))},onBlur:()=>b(_,"number",y),"aria-required":D||void 0,error:V},_)}case"textarea":return c.jsx(Xo,{id:_,label:w,value:Oe(k),onChange:T=>re(T.currentTarget.value),onBlur:()=>b(_,"textarea",y),"aria-required":D||void 0,error:V,rows:4},_);case"date":{const{min:T,max:N}=fd(_);return c.jsx(ei,{id:_,label:w,hint:E,value:Oe(k),min:T,max:N,onChange:I=>{const x=I.currentTarget.value;re(x),!Ge(x,"date")&&!gr(_,x)&&f(_,M(y,_,x))},onBlur:()=>b(_,"date",y),"aria-required":D||void 0,error:V,autoComplete:Gt[_]},_)}case"checkbox":{if(A.options){const T=Array.isArray(k)?k:[];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:A.options.map(N=>{const I=`${_}-${yr(N)}`,x=T.includes(N);return c.jsx(Rr,{id:I,label:N,checked:x,onChange:ie=>{const ue=new Set(T);ie.currentTarget.checked?ue.add(N):ue.delete(N),re(Array.from(ue))},"aria-required":D||void 0},I)})}),V&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:V})]},_)}return c.jsx(Rr,{id:_,label:D?`${w} *`:w,checked:!!k,onChange:T=>re(T.currentTarget.checked),"aria-required":D||void 0},_)}case"radio":{if(jt(A))return null;const T=A.options??[],N=y&&y.length>0?`${_}__${y.join("__")}`:_;return c.jsx(ri,{legend:w,legendClassName:D?"legend-required":void 0,children:T.map(I=>c.jsx(ti,{name:N,value:I,checked:k===I,onChange:()=>{re(I),f(_,M(y,_,I))},children:uo[_]?.[I]??I},`${_}-${yr(I)}`))},_)}case"select":{let T=A.options??[];_==="quote_vehicle_id"&&(T=r?.vehicles__items?.map(Q=>Q.vin)??[]);let N=!1,I,x,ie;if(_==="year"||_==="make"||_==="model"||_==="body_style"){const Q=y?y.join("-"):"_root";le[Q]&&(N=!0,I="Looking up VIN...")}if(!N&&(_==="make"||_==="model"||_==="body_style")){const Q=y?y.join("-"):"_root";ie=Q;const de=Ce(p,y,"year"),$=typeof de=="number"?de:Number(de);if(_==="make"){const ce=`${Q}:makes`;if(!$||!Number.isFinite($))N=!0,I="Select a year first";else{x={year:$};const X=te(x);X&&X.length>0?T=X:B[ce]?(N=!0,I="Loading makes..."):T=[...Gu]}}else if(_==="model"){const ce=`${Q}:models`,X=String(Ce(p,y,"make")??"");if(!X)N=!0,I="Select a make first";else if($&&Number.isFinite($)){x={year:$,make:X};const oe=te(x);oe&&oe.length>0?T=oe:B[ce]?(N=!0,I="Loading models..."):T=[...ad]}typeof k=="string"&&k&&!T.includes(k)&&(T=[k,...T])}else{const ce=`${Q}:bodyStyles`,X=String(Ce(p,y,"make")??""),oe=String(Ce(p,y,"model")??"");if(!oe)N=!0,I="Select a model first";else if($&&Number.isFinite($)&&X){x={year:$,make:X,model:oe};const q=te(x);q&&q.length>0?T=q:B[ce]?(N=!0,I="Loading body styles..."):T=[...sd]}typeof k=="string"&&k&&!T.includes(k)&&(T=[k,...T])}}if(_==="occupation"||_==="co_applicant_occupation"){const Q=_==="co_applicant_occupation"?"co_applicant_employment_industry":void 0,de=Q?void 0:Ce(p,y,"industry"),$=Ce(p,y,Q??"employment_industry"),X=String(zt(de??$)??"").trim();T=[...Xn[X]??cd],typeof k=="string"&&k&&!T.includes(k)&&(T=[k,...T])}const ue=hd(y,_);return c.jsx(ut,{id:ue,label:I?`${w} — ${I}`:w,"aria-required":D||void 0,error:V,disabled:N,value:yd(k),onChange:Q=>{const de=Q.currentTarget.value;if(_!=="year"&&_!=="make"&&_!=="model"&&_!=="industry"&&_!=="employment_industry"&&_!=="co_applicant_employment_industry"){re(de),f(_,M(y,_,de));return}let $=we(p,y,_,de);if(_==="year")$=we($,y,"make",""),$=we($,y,"model",""),$=we($,y,"body_style","");else if(_==="make")$=we($,y,"model",""),$=we($,y,"body_style","");else if(_==="model")$=we($,y,"body_style","");else if(_==="industry"||_==="employment_industry")$=we($,y,"occupation","");else if(_==="co_applicant_employment_industry"){const X=String(zt(de)??"").trim(),oe=Xn[X]??[],q=oe.find(ne=>ne===X)??oe[0]??"";$=we($,y,"co_applicant_occupation",q??"")}r&&n?n($):v($),C($);const ce=y?bt($,y)??{}:$;f(_,{...ce,[_]:de})},placeholder:I??"Select an option",onFocus:x&&ie?()=>J(ie,x):void 0,options:T.map(Q=>({value:Q,label:uo[_]?.[Q]??id[Q]??Q}))},ue)}case"address":return c.jsx(ai,{id:_,label:w,value:Oe(k),onChange:(T,N)=>{let I=we(p,y,_,T);const x=N?.state??(typeof T=="string"?T.match(/,\s*([A-Z]{2})\s+\d{5}\b/)?.[1]:void 0);if(x){const ie=y?[...y,"state"]:["state"];I=Be(I,ie,x)}r&&n?n(I):v(I),C(I)},onBlur:()=>b(_,"address",y),required:D,"aria-required":D||void 0,error:V},_);default:return null}}function O(A,y){return A.map((_,w)=>{const E=String(_.key);if(!Ht(_,p,l)||!Tr(_,p,y)||!Rt(_,p,a))return null;if(Nr(E,_,p,a)){const N=l.currentCarrierKey?p[l.currentCarrierKey]:void 0;if(!(N&&N!=="NoPriorInsurance"&&at(p,l)&&Er.has(E)))return null}const k=L(_,y),D=_.conditionals??[];if(!D.length)return a==="BundlePolicy"&&E==="policy_bi"?c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mt-6 mb-3",children:"Vehicle Coverage Information"}),k]},`wrap-${E}-${w}`):c.jsx("div",{children:k},`wrap-${E}-${w}`);const V=mo(_,Ce(p,y,E)),re=D.filter(N=>yt(V,N.conditionalType,N.conditionalValue)),T=re.length>1&&!re.some(N=>N.conditionalQuestionsAllowMultiple)?re.slice(0,1):re;return c.jsxs("div",{children:[k,T.map((N,I)=>{const x=N.conditionalQuestions??[];if(!x.length)return null;if(!N.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:O(x,y)},`branch-${E}-${I}`);const ie=Vt(E),ue=bt(p,[...y??[],ie])??[],Q=Math.max(1,ue.length||1),de=()=>{const X=Be(p,[...y??[],ie,ue.length],{});r&&n?n(X):v(X),C(X)},$=()=>{const X=ue.slice(0,Math.max(0,ue.length-1)),oe=Be(p,[...y??[],ie],X);r&&n?n(oe):v(oe),C(oe)},ce=`${E}__c${I}`;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:de,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 q=[...y??[],ie,oe],ne=`${ce}__i${oe}`,be=ue[oe]??{},pe=E==="drivers",xe=pe?`Driver #${oe+1}`:E==="vehicles"?`Vehicle #${oe+1}`:E==="home_losses"||E==="losses"?`Loss #${oe+1}`:`Entry #${oe+1}`,Fr=pe&&typeof be.ssn_display=="string"&&be.ssn_display?` — ${be.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,Fr]}),x.map(ze=>{const ct=String(ze.key);if(!Ht(ze,p,l)||!Tr(ze,p,q)||!Rt(ze,p,a))return null;if(Nr(ct,ze,p,a)){const At=l.currentCarrierKey?p[l.currentCarrierKey]:void 0;if(!(At&&At!=="NoPriorInsurance"&&at(p,l)&&Er.has(ct)))return null}return c.jsxs("div",{className:"mt-3",children:[L(ze,q),(()=>{const At=ze.conditionals??[];if(!At.length)return null;const Wo=Ce(p,q,ze.key),qt=At.filter(Qe=>yt(Wo,Qe.conditionalType,Qe.conditionalValue));return(qt.length>1&&!qt.some(Qe=>Qe.conditionalQuestionsAllowMultiple)?qt.slice(0,1):qt).map((Qe,$r)=>{const Br=Qe.conditionalQuestions??[];if(!Br.length)return null;if(!Qe.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:O(Br,q)},`nested-${ne}-${$r}`);const Jt=Vt(ze.key),Qt=bt(p,[...q,Jt])??[],Go=Math.max(1,Qt.length||1),Xd=()=>{const lt=Be(p,[...q,Jt,Qt.length],{});r&&n?n(lt):v(lt),C(lt)},e_=()=>{const lt=Qt.slice(0,Math.max(0,Qt.length-1)),Xe=Be(p,[...q,Jt],lt);r&&n?n(Xe):v(Xe),C(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:Xd,children:"Add another"}),Go>1&&c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:e_,children:"Remove last"})]})]}),Array.from({length:Go}).map((lt,Xe)=>{const t_=[...q,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]}),O(Br,t_)]},`nested-item-${ne}-${$r}-${Xe}`)})]},`nested-repeat-${ne}-${$r}`)})})()]},`${ne}-${ct}`)})]},`group-${ne}`)})]},`branch-${E}-${I}`)})]},`wrap-${E}-${w}`)})}const j=h.useMemo(()=>{const A=[],y=(_,w)=>{_.forEach(E=>{if(!Ht(E,p,l)||!Tr(E,p,w)||!Rt(E,p,a))return;const k=String(E.key);if(Nr(k,E,p,a)){const N=l.currentCarrierKey?p[l.currentCarrierKey]:void 0;if(!(N&&N!=="NoPriorInsurance"&&at(p,l)&&Er.has(k)))return}jt(E)||A.push(E);const D=E.conditionals??[];if(!D.length)return;const V=mo(E,Ce(p,w,k)),re=D.filter(N=>yt(V,N.conditionalType,N.conditionalValue));(re.length>1&&!re.some(N=>N.conditionalQuestionsAllowMultiple)?re.slice(0,1):re).forEach(N=>{const I=N.conditionalQuestions??[];I.length&&(N.conditionalQuestionsAllowMultiple||y(I,w))})})};return y(s),A},[s,p,l,a]);function W(A){A.preventDefault();const y=ht(p,l),_=j.map(E=>Ut(E,l)?{...E,required:y}:E),w=Bt(_,p);if(z(w),Object.keys(w).length>0){const E=j.findIndex(k=>w[k.key]);E>=0&&document.getElementById(j[E].key)?.focus();return}o(p)}return c.jsx("form",{className:"space-y-6 px-1",onSubmit:W,noValidate:!0,children:O(s)})}const vd="GTM-NK8LGHTQ";function Sd(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function qe(e,t={}){Sd().push({event:e,credifyWidget:{...t,containerId:vd}})}function Ad(){qe("credify_widget_opened")}function bo(){qe("credify_widget_closed")}function Cd(e){qe("credify_widget_stage_viewed",e)}function vo(e){qe("credify_widget_stage_completed",e)}function wd(){qe("credify_widget_flow_completed")}function Ed(e){qe("credify_widget_rates_viewed",e??{})}function Td(){qe("credify_widget_rates_back")}const So=new Set(["Disabled","Retired","Unemployed","Other"]);function Nd(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!So.has(i)}function kd(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!So.has(i)}function Ao(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 Co(e,t){return Ao(e)?"Yes":t}function wo(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function Eo(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 To(e,t){const r=wo(e),n=wo(t);if(r!=null&&n!=null)return r-n;const o=Eo(e),i=Eo(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function Od(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function No(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=To(e,r);return n!=null&&n<0}case"greaterThan":{const n=To(e,r);return n!=null&&n>0}case"contains":return Od(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 Id=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]);function kr(e,t,r){const n=nr([...e]),o=Sr(n),i=[],a=s=>{s.forEach(l=>{if(!Ht(l,t,o)||!Nd(l,t)||!Rt(l,t,r))return;const u=String(l.key);if(Un(u,r,t)){const C=o.currentCarrierKey?t[o.currentCarrierKey]:void 0;if(!(C&&C!=="NoPriorInsurance"&&at(t,o)&&Id.has(u)))return}Ao(l)||i.push(l);const d=Co(l,t[u]),m=l.conditionals??[];if(!m.length)return;const v=m.filter(C=>No(d,C.conditionalType,C.conditionalValue));(v.length>1&&!v.some(C=>C.conditionalQuestionsAllowMultiple)?v.slice(0,1):v).forEach(C=>{const p=C.conditionalQuestions??[];p.length&&(C.conditionalQuestionsAllowMultiple||a(p))})})};return a(n),i}const ko="__items",Or=e=>`${e}${ko}`;function Md(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,o=t){for(const i of e){const a=String(i.key),s=Co(i,t[a]),l=i.conditionals??[];if(!l.length)continue;const u=l.filter(m=>No(s,m.conditionalType,m.conditionalValue)),d=u.length>1&&!u.some(m=>m.conditionalQuestionsAllowMultiple)?u.slice(0,1):u;for(const m of d){const v=m.conditionalQuestions??[];if(!v.length)continue;if(!m.conditionalQuestionsAllowMultiple){if(Ir(v,t,r,n,o))return!0;continue}const g=t[Or(a)]??[];if(g.length===0)return!0;for(const[C,p]of g.entries()){const Y=[...r,Or(a),C],z=kr(v,p,n).filter(H=>!(Md(H,Y)||!kd(H,p))),K={state:o.state,...p},R=Bt(z,K);if(Object.values(R).some(Boolean)||Ir(v,p,Y,n,o))return!0}}}return!1}function Oo(e,t,r){return Ir(e,t,[],r,t)}function Io(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 Ld({stages:e,onStageComplete:t,onComplete:r,initialValues:n,initialActive:o,quoteId:i}){const[a,s]=h.useState(o??0),[l,u]=h.useState(n??{}),[d,m]=h.useState({}),[v,g]=h.useState(!1),[C,p]=h.useState(!1),[Y,z]=h.useState(null),K=h.useRef([]),R=h.useRef(e),H=Array.isArray(e)&&e.length>0,B=H?Math.min(a,e.length-1):0,G=H?e[B]:null,Z=G?.key??null;h.useEffect(()=>{o!==void 0&&s(o)},[o]),R.current=e;const le=h.useMemo(()=>!!(B>=e.length-1||e.slice(B+1).every(b=>b.key==="AutoPolicy")&&(l.drivers__items??[]).length<=1),[B,e,l]);h.useEffect(()=>{H&&a>=e.length&&s(e.length-1)},[a,e.length,H]),h.useEffect(()=>{const f=K.current[B];f&&f.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[B]),h.useEffect(()=>{n!==void 0&&u(n)},[n]),h.useEffect(()=>{if(!G||!Z){g(!1),z(null);return}if(d[Z]){g(!1),z(null);return}let f=!1;return g(!0),z(null),Promise.resolve(G.loadQuestions()).then(b=>{if(!f){if(!Array.isArray(b))throw new Error(`loadQuestions("${Z}") did not return an array`);m(L=>({...L,[Z]:b}))}}).catch(b=>{f||z(`Failed to load stage "${G?.title??""}": ${b?.message??"Unknown error"}`)}).finally(()=>{f||g(!1)}),()=>{f=!0}},[G,Z,d]);const F=Z?d[Z]:void 0,se=h.useMemo(()=>Sr(nr(F??[])),[F]);h.useEffect(()=>{G&&Z&&F&&Cd({stageKey:Z,stageTitle:G.title??Z,stepIndex:a+1,totalSteps:e.length})},[Z,a,e.length,G,F]);const ee=h.useMemo(()=>{if(!F)return{};const f={};(O=>{const j=[],W=A=>{A.forEach((y,_)=>{const w=pt(y,_);j.push(w);const E=Or(w);j.push(E),(y.conditionals??[]).forEach(D=>{const V=D.conditionalQuestions??[];V.length>0&&W(V)})})};return W(O),j})(F).forEach(O=>{O in l&&(f[O]=l[O])});for(const O of["state","State","address","product"])O in l&&(f[O]=l[O]);for(const[O,j]of Object.entries(l))O.endsWith(ko)&&!(O in f)&&(f[O]=j);return f},[F,l]),Te=f=>{u(b=>({...b,...f}))},te=()=>{s(f=>f>0?f-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},J=async()=>{if(!F||!G||v||Y||C)return;const f=kr(F,ee,Z??void 0),b=ht(l,se),L=f.map(D=>Ut(D,se)?{...D,required:b}:D),O=Bt(L,ee),j=new Set(L.map((D,V)=>pt(D,V))),W=Object.entries(O).some(([D,V])=>V&&j.has(D)),A=Oo(F,l,Z??void 0),_=f.some(D=>String(D.key??"")==="vehicle_policy_selections")?Io(l):!1,w=l.driver_vehicle_assignments,E=l.drivers__items??[];let k=!1;if(w&&E.length>=2){const D=l.vehicles__items??[];for(let V=0;V<D.length;V++){const re=w[`v${V}`];if(!re)continue;const T=E.map((x,ie)=>re[`d${ie}`]??0),N=T.filter(x=>x>0);if(N.length>=2&&N.every(x=>x===50)){k=!0;break}const I=T.reduce((x,ie)=>x+ie,0);if(I>0&&I!==100){k=!0;break}}}if(!(W||A||_||k)){p(!0);try{const D=le,{success:V,error:re}=D?await r(l,Z??""):await t(ee,Z??"");if(!V){z(re??"An error occurred");return}if(!D){const T=R.current,N=T.findIndex(x=>x.key===Z),I=N>=0?Math.min(N+1,T.length-1):Math.min(a+1,T.length-1);s(I)}}finally{p(!1)}}},M=h.useMemo(()=>{if(!F||v||Y||C)return!0;const f=kr(F,ee,Z??void 0),b=ht(l,se),L=f.map(D=>Ut(D,se)?{...D,required:b}:D),O=Bt(L,ee),j=new Set(L.map((D,V)=>pt(D,V))),W=Object.entries(O).some(([D,V])=>V&&j.has(D)),A=Oo(F,l,Z??void 0),_=f.some(D=>String(D.key??"")==="vehicle_policy_selections")?Io(l):!1,w=l.driver_vehicle_assignments,E=l.drivers__items??[];let k=!1;if(w&&E.length>=2){const D=l.vehicles__items??[];for(let V=0;V<D.length;V++){const re=w[`v${V}`];if(!re)continue;const T=E.map((x,ie)=>re[`d${ie}`]??0),N=T.filter(x=>x>0);if(N.length>=2&&N.every(x=>x===50)){k=!0;break}const I=T.reduce((x,ie)=>x+ie,0);if(I>0&&I!==100){k=!0;break}}}return W||A||_||k},[F,ee,l,v,Y,C,se,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,b)=>[c.jsx("li",{ref:L=>{K.current[b]=L},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${b<B?"bg-blue-600 text-white border-blue-600":b===B?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:f.title},f.key??`stage-${b}`),...b<e.length-1?[c.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${f.key??b}`)]:[]])}),c.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[B+1," / ",e.length]})]}),c.jsxs("div",{children:[v&&c.jsx("div",{className:"text-slate-500",children:"Loading…"}),G&&c.jsx(bd,{questions:F??[],controlledValues:ee,onChangeValues:Te,onSubmit:()=>J(),quoteId:i,widgetStageKey:Z??void 0},G.key)]}),!v&&Y&&c.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[c.jsx("div",{children:Y}),G&&c.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{m(f=>{if(!Z)return f;const b={...f};return delete b[Z],b})},children:"Retry"})]}),c.jsxs("div",{className:B>0?"grid grid-cols-2 gap-3":"",children:[B>0&&c.jsx("button",{type:"button",onClick:te,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:J,disabled:M,className:["form-wizard-next-btn",B>0?"":"w-full","h-12 rounded-full text-white transition","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center justify-center gap-2",M?"bg-gray-300":"bg-blue-600 hover:bg-blue-600/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 bg-primary hover:bg-primary/90 focus-visible:ring-primary/40"].join(" "),children:[C&&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"})]}),le?"Finish":"Next"]})]})]}):c.jsx("div",{className:"text-slate-600",children:"Loading..."})}const Mo={SafecoPersonal:{name:"Safeco",abbr:"SFC",color:"#0F337A"},SafecoPersoanl:{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"}},Lo=["#0369A1","#1D4ED8","#0F766E","#7C3AED","#B45309","#DC2626","#0891B2","#9333EA"];function Dd(e){return e.replace(/[^A-Za-z0-9]/g,"").slice(0,3).toUpperCase()||"CAR"}function Do(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").trim()}function Mr(e){if(!e)return e;const t=Mo[e];return t?t.name:Do(e)}function Pd(e){const t=new Set,r=[];return e.forEach((n,o)=>{const a=Mo[n]??{name:Do(n),abbr:Dd(n),color:Lo[o%Lo.length]};t.has(a.name)||(t.add(a.name),r.push(a))}),r}function Fd(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),Pd(r)}const $d=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),Po={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},Fo=["PersonalHome","PersonalAuto","Flood","ExcessFlood"],vt="rounded-2xl border-2 border-blue-300 bg-blue-50/30 p-4 shadow-blue-100/60 ring-1 ring-blue-100",St="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",$o="w-full max-w-md min-w-0 sm:max-w-[calc((100%-1rem)/2)]",Bd="rounded-2xl border-2 border-transparent p-4";function Bo({onBack:e}){const t=()=>{Td(),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,m=$d.format(d),v=t==="loading",g=t==="success",C=!!n||v||g,p=!!(e.effective_date&&e.policy_end_date),Y=e.lob?Po[e.lob]||e.lob:null,z=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}),z&&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:Mr(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:Mr(e.carrier_name).charAt(0).toUpperCase()}),c.jsx("h4",{className:"w-full break-words text-left font-semibold text-slate-900",children:Mr(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"})]})}),p&&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:C,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 ${g?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:v?"Requesting…":g?"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 xd({rates:e,onBack:t,isBundleFlow:r=!1}){const n=Array.isArray(e)?e:[],o=n.length>0,[i,a]=h.useState({}),[s,l]=h.useState("admitted"),[u,d]=h.useState(!1),m=h.useMemo(()=>n.some(f=>f.lob==="PersonalAuto"),[n]),v=h.useMemo(()=>n.some(f=>f.lob==="PersonalHome"),[n]),g=h.useMemo(()=>{if(!r)return[];const f=[];return m&&f.push("PersonalAuto"),v&&f.push("PersonalHome"),f},[r,m,v]),C=h.useMemo(()=>{const f=new Set;for(const b of n){const L=b.lob??null;L&&i[b.quote_rate_id]==="success"&&f.add(L)}return f},[n,i]),p=h.useMemo(()=>Object.values(i).some(f=>f==="success"),[i]),Y=h.useMemo(()=>u?!0:!r||g.length===0?p:g.every(f=>C.has(f)),[u,r,p,g,C]),z=h.useMemo(()=>o?n.filter(f=>(f.admitted_status??"admitted")==="admitted"):[],[n,o]),K=h.useMemo(()=>o?n.filter(f=>f.admitted_status==="non_admitted"):[],[n,o]),R=z.length,H=K.length,B=R+H>0;h.useEffect(()=>{B&&s==="admitted"&&R===0&&H>0&&l("non_admitted")},[s,R,H,B]);const G=h.useMemo(()=>B?s==="admitted"?z:K:[],[B,s,z,K]);h.useEffect(()=>{wr()},[]),h.useEffect(()=>{!Y||u||(qu(),ao(),d(!0))},[Y,u]);const Z=h.useMemo(()=>{if(G.length===0)return[];if(!G.some(O=>O.lob))return[{lob:null,title:"Rates",rates:[...G].sort((j,W)=>{const A=Number.isFinite(j.term_months)&&j.term_months>0?j.term_months:1,y=Number.isFinite(W.term_months)&&W.term_months>0?W.term_months:1,_=j.monthly_premium_cents??Math.round((j.premium_cents||0)/A),w=W.monthly_premium_cents??Math.round((W.premium_cents||0)/y);return _-w})}];const b=new Map;for(const O of G){const j=O.lob||"_other",W=b.get(j);W?W.push(O):b.set(j,[O])}return[...b.entries()].sort(([O],[j])=>{const W=Fo.indexOf(O),A=Fo.indexOf(j);return(W===-1?999:W)-(A===-1?999:A)}).map(([O,j])=>({lob:O,title:Po[O]??O,rates:[...j].sort((W,A)=>{const y=Number.isFinite(W.term_months)&&W.term_months>0?W.term_months:1,_=Number.isFinite(A.term_months)&&A.term_months>0?A.term_months:1,w=W.monthly_premium_cents??Math.round((W.premium_cents||0)/y),E=A.monthly_premium_cents??Math.round((A.premium_cents||0)/_);return w-E})}))},[G]),le=h.useMemo(()=>{if(!r)return[];const f=n.some(O=>O.lob==="PersonalAuto"),b=n.some(O=>O.lob==="PersonalHome"),L=[];return f||L.push("Sorry, no rates found for Personal Auto."),b||L.push("Sorry, no rates found for Homeowners."),L},[r,n]);if(!B)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(Bo,{onBack:t})]});const F=async f=>{a(b=>({...b,[f]:"loading"}));try{if(wr(),!Zt())throw new Error("Authentication required. Please verify your phone number first.");if(!((await od(f))?.success!==!1))throw new Error("Request failed");a(j=>({...j,[f]:"success"}))}catch{a(b=>({...b,[f]:"error"}))}},se=Z.find(f=>f.lob==="PersonalAuto"),ee=Z.find(f=>f.lob==="PersonalHome"),Te=!!(se?.rates.length&&ee?.rates.length),te=Z.filter(f=>!Te||f.lob!=="PersonalAuto"&&f.lob!=="PersonalHome"),J=Te&&se&&ee?[{rate:se.rates[0]},{rate:ee.rates[0]}]:[],M=J.length===1;return c.jsxs("section",{className:"mt-8",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),le.length>0&&c.jsx("div",{className:"mt-3 space-y-1",children:le.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 (",R,")"]}),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,")"]})]})}),G.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."}),G.length>0&&Te&&se&&ee&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:M?"mt-6 flex justify-center":"mt-6",children:c.jsxs("div",{className:M?`w-full max-w-md ${vt}`:vt,children:[c.jsx("div",{className:St,children:"Featured Bundle"}),c.jsx("div",{className:M?"grid justify-items-center gap-4":"grid gap-4 sm:grid-cols-2",children:J.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:Y||(r?!!(f.lob&&g.includes(f.lob)&&C.has(f.lob)):p),onRequestBind:()=>F(f.quote_rate_id)})},f.quote_rate_id))})]})}),se.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 ",se.title," Options"]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:se.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:Y||(r?!!(f.lob&&g.includes(f.lob)&&C.has(f.lob)):p),onRequestBind:()=>F(f.quote_rate_id)})},f.quote_rate_id))})]}),ee.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 ",ee.title," Options"]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:ee.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:Y||(r?!!(f.lob&&g.includes(f.lob)&&C.has(f.lob)):p),onRequestBind:()=>F(f.quote_rate_id)})},f.quote_rate_id))})]})]}),G.length>0&&te.map(f=>{const[b,...L]=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}),L.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:`${$o} ${vt}`,children:[c.jsx("div",{className:St,children:"Featured"}),c.jsx(je,{rate:b,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[b.quote_rate_id]??"idle",disabled:Y||(r?!!(b.lob&&g.includes(b.lob)&&C.has(b.lob)):p),onRequestBind:()=>F(b.quote_rate_id)})]})})}):L.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 ${vt}`,children:[c.jsx("div",{className:St,children:"Featured"}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:c.jsx(je,{rate:b,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[b.quote_rate_id]??"idle",onRequestBind:()=>F(b.quote_rate_id),disabled:Y||(r?!!(b.lob&&g.includes(b.lob)&&C.has(b.lob)):p),className:"h-full min-h-0"})})]}),c.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${Bd}`,children:[c.jsx("div",{className:`${St} 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:L[0],featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[L[0].quote_rate_id]??"idle",onRequestBind:()=>F(L[0].quote_rate_id),disabled:Y||(r?!!(L[0].lob&&g.includes(L[0].lob)&&C.has(L[0].lob)):p),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:`${$o} ${vt}`,children:[c.jsx("div",{className:St,children:"Featured"}),c.jsx(je,{rate:b,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[b.quote_rate_id]??"idle",disabled:Y||(r?!!(b.lob&&g.includes(b.lob)&&C.has(b.lob)):p),onRequestBind:()=>F(b.quote_rate_id)})]})})}),c.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:L.map(O=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(je,{rate:O,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[O.quote_rate_id]??"idle",disabled:Y||(r?!!(O.lob&&g.includes(O.lob)&&C.has(O.lob)):p),onRequestBind:()=>F(O.quote_rate_id)})},O.quote_rate_id))})]})]},f.lob??"all")}),t&&c.jsx(Bo,{onBack:t})]})}const Lr=["Validating your details...","Checking underwriting rules...","Applying eligible discounts...","Reviewing your risk profile...","Calculating premium...","Check complete"],xo={Auto:{label:"Auto Policy",icon:"🚗",accent:"#0369A1"},Home:{label:"Home Policy",icon:"🏠",accent:"#059669"},Bundle:{label:"Home + Auto Bundle",icon:"🔗",accent:"#7C3AED"}},zo={Auto:6e4,Home:9e4,Bundle:12e4};function zd({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 Rd({providers:e=[],totalTime:t=6e4,flow:r="Auto",isComplete:n=!1,onComplete:o}){const i=xo[r]??xo.Auto,a=zo[r]??zo.Auto,s=e.length>0?Math.floor(a/e.length):t,[l,u]=h.useState(0),[d,m]=h.useState(0),[v,g]=h.useState(0),[C,p]=h.useState(0),[Y,z]=h.useState(!0),K=h.useRef(n),R=h.useRef(o),H=h.useRef(l),B=h.useRef(e.length),G=h.useRef(!1),Z=h.useRef(!1);h.useEffect(()=>{K.current=n,n&&e.length===0&&!G.current&&(G.current=!0,R.current?.())},[n,e.length]),h.useEffect(()=>{R.current=o},[o]),h.useEffect(()=>{H.current=l},[l]),h.useEffect(()=>{B.current=e.length,e.length>0&&(Z.current=!1,u(0),m(0),g(0),p(0),z(!0))},[e.length]),h.useEffect(()=>{if(e.length===0){K.current&&!G.current&&(G.current=!0,R.current?.());return}Z.current=!1;const ee=100,Te=100/(s/ee),te=setInterval(()=>{g(J=>{if(Z.current||G.current)return J;const M=J+Te;return M<100?M:(Z.current=!0,setTimeout(()=>{if(K.current){if(G.current)return;G.current=!0,R.current?.();return}const b=H.current===B.current-1;z(!1),setTimeout(()=>{b?(u(0),m(L=>L+1)):u(L=>L+1),g(0),p(0),z(!0)},300)},400),100)})},ee);return()=>clearInterval(te)},[l,s,e.length]),h.useEffect(()=>{if(e.length===0)return;const ee=Math.floor(s/Lr.length),Te=setInterval(()=>p(te=>Math.min(te+1,Lr.length-1)),ee);return()=>clearInterval(Te)},[l,s,e.length]);const le=e.length===0,F=le?null:e[Math.min(l,e.length-1)],se=d>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 Mn(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},_=s.ref;if(s.ref=null,_){n(_);const v=e.seen.get(_),g=v.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,u),a._zod.parent===_)for(const h in l)h==="$ref"||h==="allOf"||h in u||delete l[h];if(g.$ref&&v.def)for(const h in l)h==="$ref"||h==="allOf"||h in v.def&&JSON.stringify(l[h])===JSON.stringify(v.def[h])&&delete l[h]}const p=a._zod.parent;if(p&&p!==_){n(p);const v=e.seen.get(p);if(v?.schema.$ref&&(l.$ref=v.schema.$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]}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:Pt(t,"input",e.processors),output:Pt(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ne(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 Ne(n.element,r);if(n.type==="set")return Ne(n.valueType,r);if(n.type==="lazy")return Ne(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 Ne(n.innerType,r);if(n.type==="intersection")return Ne(n.left,r)||Ne(n.right,r);if(n.type==="record"||n.type==="map")return Ne(n.keyType,r)||Ne(n.valueType,r);if(n.type==="pipe")return Ne(n.in,r)||Ne(n.out,r);if(n.type==="object"){for(const o in n.shape)if(Ne(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(Ne(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(Ne(o,r))return!0;return!!(n.rest&&Ne(n.rest,r))}return!1}const ac=(e,t={})=>r=>{const n=On({...r,processors:t});return ve(e,n),In(n,e),Mn(n,e)},Pt=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},a=On({...o??{},target:i,io:t,processors:r});return ve(e,a),In(a,e),Mn(a,e)},sc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cc=(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=sc[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){const _=[...l];_.length===1?o.pattern=_[0].source:_.length>1&&(o.allOf=[..._.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},lc=(e,t,r,n)=>{const o=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:_}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof _=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=_,o.exclusiveMinimum=!0):o.exclusiveMinimum=_),typeof i=="number"&&(o.minimum=i,typeof _=="number"&&t.target!=="draft-04"&&(_>=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)},uc=(e,t,r,n)=>{r.type="boolean"},dc=(e,t,r,n)=>{r.not={}},_c=(e,t,r,n)=>{},fc=(e,t,r,n)=>{const o=e._zod.def,i=jr(o.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},mc=(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},pc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hc=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},gc=(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"]})},yc=(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 _=i.shape[u]._zod;return t.io==="input"?_.optin===void 0:_.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)},bc=(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},vc=(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},Sc=(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"}]},Ac=(e,t,r,n)=>{const o=e._zod.def;ve(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Cc=(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))},wc=(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)))},Ec=(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},Tc=(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},Nc=(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},Ln=(e,t,r,n)=>{const o=e._zod.def;ve(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},kc=S("ZodISODateTime",(e,t)=>{Ma.init(e,t),de.init(e,t)});function Oc(e){return $s(kc,e)}const Ic=S("ZodISODate",(e,t)=>{La.init(e,t),de.init(e,t)});function Mc(e){return xs(Ic,e)}const Lc=S("ZodISOTime",(e,t)=>{Da.init(e,t),de.init(e,t)});function Dc(e){return Bs(Lc,e)}const Pc=S("ZodISODuration",(e,t)=>{Pa.init(e,t),de.init(e,t)});function Fc(e){return zs(Pc,e)}const xe=S("ZodError",(e,t)=>{Xr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ci(e,r)},flatten:{value:r=>Ai(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,sr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,sr,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),$c=_r(xe),xc=fr(xe),Bc=kt(xe),zc=Ot(xe),Rc=Ti(xe),Hc=Ni(xe),Uc=ki(xe),Zc=Oi(xe),Wc=Ii(xe),Gc=Mi(xe),jc=Li(xe),Vc=Di(xe),fe=S("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Pt(e,"input"),output:Pt(e,"output")}}),e.toJSONSchema=ac(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)=>We(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>$c(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Bc(e,r,n),e.parseAsync=async(r,n)=>xc(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>zc(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Rc(e,r,n),e.decode=(r,n)=>Hc(e,r,n),e.encodeAsync=async(r,n)=>Uc(e,r,n),e.decodeAsync=async(r,n)=>Zc(e,r,n),e.safeEncode=(r,n)=>Wc(e,r,n),e.safeDecode=(r,n)=>Gc(e,r,n),e.safeEncodeAsync=async(r,n)=>jc(e,r,n),e.safeDecodeAsync=async(r,n)=>Vc(e,r,n),e.refine=(r,n)=>e.check(Zl(r,n)),e.superRefine=r=>e.check(Wl(r)),e.overwrite=r=>e.check(st(r)),e.optional=()=>Rn(e),e.exactOptional=()=>Il(e),e.nullable=()=>Hn(e),e.nullish=()=>Rn(Hn(e)),e.nonoptional=r=>$l(e,r),e.array=()=>bl(e),e.or=r=>Bn([e,r]),e.and=r=>wl(e,r),e.transform=r=>Zn(e,kl(r)),e.default=r=>Dl(e,r),e.prefault=r=>Fl(e,r),e.catch=r=>Bl(e,r),e.pipe=r=>Zn(e,r),e.readonly=()=>Hl(e),e.describe=r=>{const n=e.clone();return gt.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return gt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return gt.get(e);const n=e.clone();return gt.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Dn=S("_ZodString",(e,t)=>{mr.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>cc(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(Gs(...n)),e.includes=(...n)=>e.check(Ys(...n)),e.startsWith=(...n)=>e.check(Ks(...n)),e.endsWith=(...n)=>e.check(qs(...n)),e.min=(...n)=>e.check(Dt(...n)),e.max=(...n)=>e.check(Nn(...n)),e.length=(...n)=>e.check(kn(...n)),e.nonempty=(...n)=>e.check(Dt(1,...n)),e.lowercase=n=>e.check(js(n)),e.uppercase=n=>e.check(Vs(n)),e.trim=()=>e.check(Qs()),e.normalize=(...n)=>e.check(Js(...n)),e.toLowerCase=()=>e.check(Xs()),e.toUpperCase=()=>e.check(ec()),e.slugify=()=>e.check(tc())}),Yc=S("ZodString",(e,t)=>{mr.init(e,t),Dn.init(e,t),e.email=r=>e.check(ps(Kc,r)),e.url=r=>e.check(vs(qc,r)),e.jwt=r=>e.check(Fs(dl,r)),e.emoji=r=>e.check(Ss(Jc,r)),e.guid=r=>e.check(Cn(Pn,r)),e.uuid=r=>e.check(hs(Ft,r)),e.uuidv4=r=>e.check(gs(Ft,r)),e.uuidv6=r=>e.check(ys(Ft,r)),e.uuidv7=r=>e.check(bs(Ft,r)),e.nanoid=r=>e.check(As(Qc,r)),e.guid=r=>e.check(Cn(Pn,r)),e.cuid=r=>e.check(Cs(Xc,r)),e.cuid2=r=>e.check(ws(el,r)),e.ulid=r=>e.check(Es(tl,r)),e.base64=r=>e.check(Ls(cl,r)),e.base64url=r=>e.check(Ds(ll,r)),e.xid=r=>e.check(Ts(rl,r)),e.ksuid=r=>e.check(Ns(nl,r)),e.ipv4=r=>e.check(ks(ol,r)),e.ipv6=r=>e.check(Os(il,r)),e.cidrv4=r=>e.check(Is(al,r)),e.cidrv6=r=>e.check(Ms(sl,r)),e.e164=r=>e.check(Ps(ul,r)),e.datetime=r=>e.check(Oc(r)),e.date=r=>e.check(Mc(r)),e.time=r=>e.check(Dc(r)),e.duration=r=>e.check(Fc(r))});function Ge(e){return ms(Yc,e)}const de=S("ZodStringFormat",(e,t)=>{le.init(e,t),Dn.init(e,t)}),Kc=S("ZodEmail",(e,t)=>{Aa.init(e,t),de.init(e,t)}),Pn=S("ZodGUID",(e,t)=>{va.init(e,t),de.init(e,t)}),Ft=S("ZodUUID",(e,t)=>{Sa.init(e,t),de.init(e,t)}),qc=S("ZodURL",(e,t)=>{Ca.init(e,t),de.init(e,t)}),Jc=S("ZodEmoji",(e,t)=>{wa.init(e,t),de.init(e,t)}),Qc=S("ZodNanoID",(e,t)=>{Ea.init(e,t),de.init(e,t)}),Xc=S("ZodCUID",(e,t)=>{Ta.init(e,t),de.init(e,t)}),el=S("ZodCUID2",(e,t)=>{Na.init(e,t),de.init(e,t)}),tl=S("ZodULID",(e,t)=>{ka.init(e,t),de.init(e,t)}),rl=S("ZodXID",(e,t)=>{Oa.init(e,t),de.init(e,t)}),nl=S("ZodKSUID",(e,t)=>{Ia.init(e,t),de.init(e,t)}),ol=S("ZodIPv4",(e,t)=>{Fa.init(e,t),de.init(e,t)}),il=S("ZodIPv6",(e,t)=>{$a.init(e,t),de.init(e,t)}),al=S("ZodCIDRv4",(e,t)=>{xa.init(e,t),de.init(e,t)}),sl=S("ZodCIDRv6",(e,t)=>{Ba.init(e,t),de.init(e,t)}),cl=S("ZodBase64",(e,t)=>{za.init(e,t),de.init(e,t)}),ll=S("ZodBase64URL",(e,t)=>{Ha.init(e,t),de.init(e,t)}),ul=S("ZodE164",(e,t)=>{Ua.init(e,t),de.init(e,t)}),dl=S("ZodJWT",(e,t)=>{Wa.init(e,t),de.init(e,t)}),Fn=S("ZodNumber",(e,t)=>{un.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>lc(e,n,o),e.gt=(n,o)=>e.check(En(n,o)),e.gte=(n,o)=>e.check(gr(n,o)),e.min=(n,o)=>e.check(gr(n,o)),e.lt=(n,o)=>e.check(wn(n,o)),e.lte=(n,o)=>e.check(hr(n,o)),e.max=(n,o)=>e.check(hr(n,o)),e.int=n=>e.check($n(n)),e.safe=n=>e.check($n(n)),e.positive=n=>e.check(En(0,n)),e.nonnegative=n=>e.check(gr(0,n)),e.negative=n=>e.check(wn(0,n)),e.nonpositive=n=>e.check(hr(0,n)),e.multipleOf=(n,o)=>e.check(Tn(n,o)),e.step=(n,o)=>e.check(Tn(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}),_l=S("ZodNumberFormat",(e,t)=>{Ga.init(e,t),Fn.init(e,t)});function $n(e){return Hs(_l,e)}const fl=S("ZodBoolean",(e,t)=>{ja.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>uc(e,r,n)});function ml(e){return Us(fl,e)}const pl=S("ZodUnknown",(e,t)=>{Va.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_c()});function xn(){return Zs(pl)}const hl=S("ZodNever",(e,t)=>{Ya.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dc(e,r,n)});function gl(e){return Ws(hl,e)}const yl=S("ZodArray",(e,t)=>{Ka.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gc(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(Dt(r,n)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(r,n)=>e.check(Nn(r,n)),e.length=(r,n)=>e.check(kn(r,n)),e.unwrap=()=>e.element});function bl(e,t){return rc(yl,e,t)}const vl=S("ZodObject",(e,t)=>{Ja.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yc(e,r,n,o),ne(e,"shape",()=>t.shape),e.keyof=()=>ct(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xn()}),e.loose=()=>e.clone({...e._zod.def,catchall:xn()}),e.strict=()=>e.clone({...e._zod.def,catchall:gl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>gi(e,r),e.safeExtend=r=>yi(e,r),e.merge=r=>bi(e,r),e.pick=r=>pi(e,r),e.omit=r=>hi(e,r),e.partial=(...r)=>vi(zn,e,r[0]),e.required=(...r)=>Si(Un,e,r[0])});function Sl(e,t){const r={type:"object",shape:e??{},...D(t)};return new vl(r)}const Al=S("ZodUnion",(e,t)=>{Qa.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bc(e,r,n,o),e.options=t.options});function Bn(e,t){return new Al({type:"union",options:e,...D(t)})}const Cl=S("ZodIntersection",(e,t)=>{Xa.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vc(e,r,n,o)});function wl(e,t){return new Cl({type:"intersection",left:e,right:t})}const yr=S("ZodEnum",(e,t)=>{es.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(n,o,i)=>fc(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 yr({...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 yr({...t,checks:[],...D(o),entries:i})}});function ct(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new yr({type:"enum",entries:r,...D(t)})}const El=S("ZodLiteral",(e,t)=>{ts.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mc(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 Tl(e,t){return new El({type:"literal",values:Array.isArray(e)?e:[e],...D(t)})}const Nl=S("ZodTransform",(e,t)=>{rs.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hc(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Wr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(ht(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(ht(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function kl(e){return new Nl({type:"transform",transform:e})}const zn=S("ZodOptional",(e,t)=>{gn.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ln(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Rn(e){return new zn({type:"optional",innerType:e})}const Ol=S("ZodExactOptional",(e,t)=>{ns.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ln(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Il(e){return new Ol({type:"optional",innerType:e})}const Ml=S("ZodNullable",(e,t)=>{os.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Hn(e){return new Ml({type:"nullable",innerType:e})}const Ll=S("ZodDefault",(e,t)=>{is.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Dl(e,t){return new Ll({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():qr(t)}})}const Pl=S("ZodPrefault",(e,t)=>{as.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Fl(e,t){return new Pl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():qr(t)}})}const Un=S("ZodNonOptional",(e,t)=>{ss.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ac(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function $l(e,t){return new Un({type:"nonoptional",innerType:e,...D(t)})}const xl=S("ZodCatch",(e,t)=>{cs.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ec(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Bl(e,t){return new xl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const zl=S("ZodPipe",(e,t)=>{ls.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tc(e,r,n,o),e.in=t.in,e.out=t.out});function Zn(e,t){return new zl({type:"pipe",in:e,out:t})}const Rl=S("ZodReadonly",(e,t)=>{us.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Hl(e){return new Rl({type:"readonly",innerType:e})}const Ul=S("ZodCustom",(e,t)=>{ds.init(e,t),fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pc(e,r)});function Zl(e,t={}){return nc(Ul,e,t)}function Wl(e){return oc(e)}const br={custom:"custom"};function he(e){return Rs(Fn,e)}const Gl=["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible"],jl=new Set([...Gl,"is_corporation"]);Sl({additional_pip:ct(["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:ct(["Verbal_Threshold","Zero_Threshold"]),pip_coverage_type:ct(["Primary","Secondary"]),extended_medical:ct(["cov1000","cov10000"]),policy_pip_deductible:ct(["cov250","cov500","cov1000","cov2000","cov2500"]),has_health_insurance_auto_accident:ml().nullable().optional()}).superRefine((e,t)=>{e.pip_coverage_type==="Secondary"&&e.has_health_insurance_auto_accident!==!0&&t.addIssue({code:br.custom,path:["pip_coverage_type"],message:"Secondary PIP coverage requires health insurance that covers auto accidents."})});const Vl=new Set(["Home","HomeConstruction","HomeFeatures"]),Yl=new Set(["HomePolicy","BundlePolicy"]),Kl=new Set(["HomeCustomer","BundleCustomer"]);function $t(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?$t(e.state??e.State):!1}function Gn(e,t,r){return e==="has_health_insurance_auto_accident"?t==="BundleCustomer"?!1:!Wn(r):jl.has(e)?!Wn(r):e==="household_size"?!(t&&Vl.has(t)):e==="number_of_mortgagees"?!(t&&Yl.has(t)):(e==="has_co_applicant"||e==="co_applicant_middle_name"||e==="co_applicant_relationship")&&t&&Kl.has(t)?!1:e==="multi_policy_discount"&&t==="HomePolicy"?!0:ql.has(e)}const ql=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"]),jn=new Date().getUTCFullYear(),xt=Ge().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),Vn=Bn([Tl(""),Ge().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),Jl=(e,t,r)=>he({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.`),lt=(e,t)=>he({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.`),Bt=(e,t=1600)=>he({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(jn,`${e} cannot be in the future.`),zt=e=>he({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.`),yt=(e,t,r=0)=>{const n=Math.pow(10,t)-1,o=n.toLocaleString("en-US"),i=r.toLocaleString("en-US");return he({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.`)},Ql={email:Ge().trim().min(1,"Required").email("Please enter a valid email address."),phone:Ge().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:Ge().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:Ge().trim().min(1,"Required").regex(/^\d{6}$/,"Please enter the 6-digit code."),first_name:xt,last_name:xt,middle_name:Vn,co_applicant_first_name:xt,co_applicant_last_name:xt,co_applicant_middle_name:Vn,year_built:Bt("Year built",1800),year_roof_updated:he({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:Bt("Heating update year"),plumbing_update_year:Bt("Plumbing update year"),electrical_update_year:Bt("Electrical update year"),total_area_sq_ft:Jl("Square footage",1,999999),sale_price_cents:he({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:zt("Number of years with your prior carrier"),home_continuous_coverage_years:zt("How long you have had continuous home coverage"),household_size:he({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:he({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:yt("Replacement cost",9,1),other_structures_coverage:yt("Other structures",9),personal_property_coverage:yt("Personal property",7),loss_of_use_coverage:yt("Loss of use coverage",8),years_at_address:he({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:he({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:he({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:he({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:he({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:he({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:he({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:yt("Amount paid",7),license_number:Ge().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:Ge().superRefine((e,t)=>{if(typeof e!="string"||e.trim()==="")return;if(/\s/.test(e)){t.addIssue({code:br.custom,message:"VIN cannot contain spaces."});return}const r=e.trim();/^[A-HJ-NPR-Z0-9]{17}$/i.test(r)||t.addIssue({code:br.custom,message:"VIN must be exactly 17 letters and numbers (excluding I, O, and Q)."})}),annual_mileage:he({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:he({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:lt("Modifications value",9999999),cost_new_value_cents:lt("Cost new value",9999999),stated_value_amount_cents:lt("Stated Value Amount",9999999),property_damage_amount_paid_cents:lt("Property damage amount paid",9999999),personal_injury_amount_paid_cents:lt("Personal injury amount paid",9999999),auto_current_annual_premium_cents:lt("Current annual premium",9999999),auto_prior_years:zt("Years with prior auto carrier"),auto_prior_months:he({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:zt("Years with continuous auto coverage")};function me(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 je(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 Yn=[{targetKey:"social_security_number",dependsOn:["social_security_number","state"],validate:e=>{if(!("social_security_number"in e)||!$t(e.state))return;const t=e.social_security_number;return(typeof t=="string"?t.trim():"")===""?"Social Security Number is required in New Jersey.":void 0}},{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:e=>{const t=e.date_of_birth;if(!t||typeof t!="string")return;const r=me(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":je(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=me(t);return isNaN(r.getTime())?"Invalid date.":r.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":je(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>jn)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=me(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=me(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=me(r),o=me(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=me(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=me(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=me(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=me(r);if(isNaN(o.getTime()))return;const i=je(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=me(r);if(isNaN(o.getTime()))return;const i=je(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=me(r);if(isNaN(o.getTime()))return;const i=je(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=me(r);if(isNaN(o.getTime()))return;const i=je(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=me(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=me(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=me(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=me(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=me(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=me(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=me(r);if(isNaN(o.getTime()))return;const i=je(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=me(r);if(isNaN(o.getTime()))return;const i=je(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 vr(e,t){const r=Ql[e];if(!r)return;const n=r.safeParse(t);return n.success?void 0:n.error.issues[0].message}function Kn(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 Xl(e,t){const r={};for(const n of Yn){if(t?.has(n.targetKey))continue;const o=n.validate(e);o&&(r[n.targetKey]=o)}return r}function Sr(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function bt(e,t){return e.key??`${Sr(e.question)}-${t}`}function Ve(e,t){return t==="number"?e==null||typeof e=="string"&&e.trim()==="":t==="checkbox"?e!==!0:e==null||typeof e=="string"&&e.trim()===""}function Rt(e,t){const r={};e.forEach((a,s)=>{const l=bt(a,s),u=t[l];if(a.required&&Ve(u,a.inputType)){r[l]="Required";return}if(!Ve(u,a.inputType)){const _=vr(l,u);if(_){r[l]=_;return}}});const n={...t};e.forEach((a,s)=>{const l=bt(a,s);l in n||(n[l]="")});const o=new Set(Object.keys(r).filter(a=>r[a])),i=Xl(n,o);for(const[a,s]of Object.entries(i))r[a]=s;return r}function eu(e){if(e===""||e===null||e===void 0)return;const t=Number(e);return Number.isNaN(t)?void 0:t}const tu={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"},ru={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},nu={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"},ou={Business:"Business",Pleasure:"Pleasure",Farming:"Farming",To_FromWork:"To/From Work",To_FromSchool:"To/From School"},iu={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"},au={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"},su={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"},cu={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"},lu={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},uu={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"},du={cov25000:"25,000",cov35000:"35,000",cov50000:"50,000",cov100000:"100,000",cov200000:"200,000",cov250000:"250,000",cov300000:"300,000",cov500000:"500,000"},_u={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"},fu={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},Ar={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",SeventyFiveHundred:"750",Thousand:"1,000",TwoThousand:"2,000"},mu=["NoCoverage","Zero","Fifty","Hundred","TwoHunderd","TwoHundredfifty","FiveHundred","SeventyFiveHundred","Thousand","TwoThousand"],pu=["NoCoverage","Zero","Fifty","Hundred","TwoHunderd","TwoHundredfifty","FiveHundred","Thousand","TwoThousand"],Cr={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},hu=["NoCoverage","TwentyFive","Fifty","SeventyFive","Hundred","TwoHundred","Unlimited"],qn={NoCoverage:"No Coverage",cov20to600:"20/600",cov25to750:"25/750",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500",cov100to3000:"100/3,000"},gu=["NoCoverage","cov20to600","cov25to750","cov30to900","cov40to1200","cov50to1500","cov100to3000"],yu=["NoCoverage","cov20to600","cov30to900","cov40to1200","cov50to1500"],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"},bu={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"},vu={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"},Au={Basic:"Basic",Modest:"Modest",Average:"Average",AboveAverage:"Above Average",Expensive:"Expensive",VeryExpensive:"Very Expensive",Opulent:"Opulent"},Cu={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"},wu={Slab:"Slab",Basement:"Basement",CrawlSpace:"Crawl Space",PartialBasement:"Partial Basement",PiersPostsPiles:"Piers / Posts / Piles",Open:"Open"},Eu={NotOverWater:"No",PartiallyOverWater:"Partially Over Water",FullyOrEntirelyOverWater:"Fully or Entirely Over Water"},Tu={One:"1",OneHalf:"1.5",Two:"2",TwoHalf:"2.5",Three:"3",ThreeHalf:"3.5",Four:"4",BiLevel:"Bi-Level",TriLevel:"Tri-Level"},Nu={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"},ku={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"},Ou={B_Gable:"Gable",C_Hip:"Hip",A_Flat:"Flat",D_Other:"Other"},Iu={NotUpdated:"Not Updated",PartialUpdate:"Partial Update",CompleteUpdate:"Complete Update"},Mu={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"},Lu={AboveGround:"Above Ground",BelowGround:"Below Ground"},Du={Basement:"Below Grade Basement",SplitLevelBasement:"Split Level Basement",WalkoutBasement:"Walkout Basement"},Pu={EntirelyCopper:"Entirely Copper",EntirelyGalvanized:"Entirely Galvanized",EntirelyPEX:"Entirely PEX",EntirelyPVC:"Entirely PVC",Polybutylene:"Polybutylene"},Fu={TwentyFive:"$25,000",Fifty:"$50,000",OneHundred:"$100,000",TwoHundred:"$200,000",ThreeHundred:"$300,000",FourHundred:"$400,000",FiveHundred:"$500,000"},$u={cov1000:"$1,000",cov2000:"$2,000",cov3000:"$3,000",cov4000:"$4,000",cov5000:"$5,000"},xu={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%"},Bu={None:"None",OnePercent:"1%",TwoPercent:"2%",FivePercent:"5%",TenPercent:"10%"},zu={_0_500ft:"0-500 Feet",_501_1000ft:"501-1000 Feet",_1001ftAndGreater:"1001 Feet And Greater"},Ru={Lessthan5miles:"Less Than 5 Miles",Over5miles:"Over 5 Miles",NotAvailable:"Not Available"},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"},Xn={Single:"Single",Married:"Married",Seperated:"Separated",Divorced:"Divorced",Widowed:"Widowed",DomesticPartner:"Domestic Partner"},eo={Female:"Female",Male:"Male"},to={"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"},Hu={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"},Uu={Verbal_Threshold:"Limited right to sue",Zero_Threshold:"Unlimited right to sue"},Zu={Primary:"Primary",Secondary:"Secondary"},Wu={cov1000:"$1,000",cov10000:"$10,000"},Gu={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"},ju={cov250:"$250",cov500:"$500",cov1000:"$1,000",cov2000:"$2,000",cov2500:"$2,500"},Vu={"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"]},Yu={"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"},ro=Vu,no=Yu;function wr(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 Ht(e){return wr(e,to)}function oo(e){return wr(e,Jn)}function io(e){return wr(e,no)}function Ku(e){return e.trim().toLowerCase()}function ao(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 ut(e,t){if(!t.effectiveDateKey||!t.expirationDateKey)return!1;const r=ao(e[t.expirationDateKey]),n=ao(e[t.effectiveDateKey]);return r==null||n==null?!1:r<n}const qu=new Set(["HomePolicy","BundlePolicy"]);function Ut(e,t,r){return String(e.key??"")!=="lapse_in_coverage"||!r||!qu.has(r)?!0:t.home_prior_carrier_name!=="NoPriorInsurance"}function Er(e){let t=null,r=null,n=null;const o=new Set,i=new Set,a=l=>{const u=String(l.key??""),_=Ku(String(l.question??""));!t&&(u==="auto_prior_carrier_name"||u==="home_prior_carrier_name"||_.includes("current auto insurance company"))&&(t=u),!r&&(u==="effective_date"||_.includes("when do you need your insurance to begin"))&&(r=u),!n&&(u==="auto_prior_expiration_date"||u==="home_prior_expiration_date"||_.includes("when does the current policy expire"))&&(n=u),(u==="auto_reason_for_no_insurance"||_.includes("reason you are not currently insured")||_.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(_=>{const p=_.conditionalQuestions??[];p.forEach(a),s(p)})})};return s(e),{currentCarrierKey:t,effectiveDateKey:r,expirationDateKey:n,noInsuranceReasonKeys:o,hideWhenNoPriorInsuranceKeys:i}}function vt(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"&&ut(e,t)?!1:ut(e,t)}function Zt(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:vt(t,r)}function Wt(e,t){const r=String(e.key??"");return t.noInsuranceReasonKeys.has(r)}const Ju=["ACURA","ALFA ROMEO","ASTON MARTIN","AUDI","BENTLEY","BMW","BUGATTI","BUICK","CADILLAC","CHEVROLET","CHRYSLER","CRUISE","DODGE","FERRARI","FIAT","FORD","FREIGHTLINER","GENESIS","GLOBAL ELECTRIC MOTORS","GMC","HONDA","HYUNDAI","INFINITI","JAGUAR","JEEP","KARMA AUTOMOTIVE","KIA","LAMBORGHINI","LAND ROVER","LEXUS","LINCOLN","LOTUS","MASERATI","MAZDA","MCLAREN AUTOMOTIVE","MERCEDES-BENZ","MINI","MITSUBISHI","NISSAN","POLESTAR","PORSCHE","RAM","ROLLS-ROYCE","SUBARU","TESLA","TOYOTA","VOLKSWAGEN","VOLVO"],Tr="credify_quote_id",Nr="credify_auth_token";function Qu(e){try{localStorage.setItem(Tr,e)}catch(t){console.error("Failed to save quoteId to localStorage:",t)}}function Xu(){try{return localStorage.getItem(Tr)}catch(e){return console.error("Failed to load quoteId from localStorage:",e),null}}function so(){try{localStorage.removeItem(Tr)}catch(e){console.error("Failed to clear quoteId from localStorage:",e)}}function ed(e){try{localStorage.setItem(Nr,e)}catch(t){console.error("Failed to save authToken to localStorage:",t)}}function td(){try{return localStorage.getItem(Nr)}catch(e){return console.error("Failed to load authToken from localStorage:",e),null}}function co(){try{localStorage.removeItem(Nr)}catch(e){console.error("Failed to clear authToken from localStorage:",e)}}function rd(){so(),co()}const Be="https://api.getcredify.com";let dt=null;function nd(e){dt=e,ed(e)}function Gt(){return dt}function kr(){const e=td();e&&(dt=e)}function lo(){dt=null,co()}async function ze(e,t){const r={"Content-Type":"application/json"};dt&&(r.Authorization=`Bearer ${dt}`);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 od(e){try{return await e.json()}catch{return{}}}async function id(e,t){const r=t?{stage:e,quoteId:t}:{stage:e};return await(await ze(`${Be}/get-questions-by-stage`,r)).json()}async function jt(e){const t=e?{quoteId:e}:{};return await(await ze(`${Be}/get-stages-for-quote`,t)).json()}async function ad(e){const r=await(await ze(`${Be}/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 St(e,t,r){const n={payload:e,getRates:t};r&&typeof r=="string"&&r.trim()!==""&&(n.quoteId=r);const o=await ze(`${Be}/update-quote`,n),i=await od(o);return!i||typeof i!="object"||!("status"in i)||i.status==null?{status:"success"}:i}async function sd(e,t){return await(await ze(`${Be}/verify-quote`,{quoteId:e,smsCode:t})).json()}async function cd(e){return await(await ze(`${Be}/is-supported-state`,{state:e})).json()}async function uo(){return await(await ze(`${Be}/get-rates`,{})).json()}async function _o(e){const t=e?{quoteId:e}:{};return await(await ze(`${Be}/get-quote`,t)).json()}async function fo(e){return(await ze(`${Be}/get-vehicle-options`,e)).json()}async function ld(e){return(await ze(`${Be}/get-vehicle-options`,{...e,action:"vinDecode"})).json()}async function ud(e){const r=await(await ze(`${Be}/request-bind`,{quoteRateId:e})).json();return r&&typeof r=="object"&&"success"in r?r:{success:!0}}const Or=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),dd={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"},mo={auto_prior_carrier_name:tu,auto_prior_liability_limit:iu,auto_reason_for_no_insurance:au,residence_type:ru,home_prior_carrier_name:nu,policy_bi:su,policy_um:cu,policy_pd:lu,policy_mp:uu,policy_umpd:du,policy_pip:_u,policy_auto_death_indemnity:fu,vehicle_comp_deductible:Ar,vehicle_coll_deductible:Ar,vehicle_towing_and_labor:Cr,vehicle_transportation_expense:qn,education_level:Jn,industry:to,occupation:no,usage:ou,architectural_style:bu,dwelling_type:vu,occupancy_type:Su,construction_quality:Au,construction_type:Cu,foundation_type:wu,located_over_water:Eu,number_of_stories:Tu,exterior_wall_type:Nu,roof_material_type:ku,roof_shape:Ou,roof_updated_type:Iu,heating_type:Mu,oil_tank_location:Lu,basement_type:Du,plumbing_type:Pu,personal_liability:Fu,dwelling_medical_payments:$u,all_perils_deductible:xu,windstorm_deductible:Bu,distance_from_fire_hydrant_ft:zu,distance_from_fire_station_miles:Ru,employment_industry:Qn,marital_status:Xn,gender:eo,co_applicant_employment_industry:Qn,co_applicant_marital_status:Xn,co_applicant_gender:eo,description:Hu,tort_threshold:Uu,pip_coverage_type:Zu,extended_medical:Wu,additional_pip:Gu,policy_pip_deductible:ju},_d=["OTHER / NOT LISTED"],fd=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],md=["Other"];function Pe(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 po(e){const t=e.replace(/\D+/g,"");if(t!=="")return eu(t)}function pd(e){return e==="-"||e==="+"||e==="."||e==="e"||e==="E"}const hd={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},ho=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"]),gd=new Set(["total_area_sq_ft","annual_mileage","miles_to_work","distance_to_coast_miles"]),Vt={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"},yd={license_number:20};function bd(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:Pe(r),max:Pe(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:Pe(n),max:Pe(o)}}if(e==="date_of_incident")return{max:Pe(r)};if(e==="move_in_date")return{max:Pe(r)};if(e==="purchase_date")return{max:Pe(r)};if(e==="date_of_birth")return{max:Pe(r)};if(e==="date_first_licensed")return{max:Pe(r)};if(e==="occurred_at")return{max:Pe(r)};if(e==="accident_prevention_course_date")return{max:Pe(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:Pe(n),max:Pe(o)}}return{}}const vd=new Set(["Disabled","Retired","Unemployed","Other"]);function Ir(e,t,r){const n=String(e.key??"");if(n!=="occupation"&&n!=="co_applicant_occupation"||n==="co_applicant_occupation")return!0;const o=we(t,r,"industry"),i=we(t,r,"employment_industry"),a=String(o??i??"").trim();return!vd.has(a)}function Mr(e,t,r,n){return Gn(e,n,r)}function Yt(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 go(e,t){return Yt(e)?"Yes":t}function yo(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function bo(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 vo(e,t){const r=yo(e),n=yo(t);if(r!=null&&n!=null)return r-n;const o=bo(e),i=bo(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function Sd(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function At(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=vo(e,r);return n!=null&&n<0}case"greaterThan":{const n=vo(e,r);return n!=null&&n>0}case"contains":return Sd(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 Ct(e,t){return t.reduce((r,n)=>r?.[n],e)}function Re(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=Re(a,o,r);if(typeof n=="number"){const u=(Array.isArray(e)?e:[]).slice();return u[n]=s,u}return{...e,[n]:s}}function we(e,t,r){return Ct(e,[...t??[],r])}function Ee(e,t,r,n){return Re(e,[...t??[],r],n)}function Ad(e,t){return e?.length?`${e.join("-")}-${t}`:t}const Cd="__items",Kt=e=>`${e}${Cd}`;function Ie(e){return e==null?"":typeof e=="string"?e:String(e)}function So(e){return e==null?"":typeof e=="number"&&Number.isFinite(e)||typeof e=="string"?e:""}function wd(e){return e==null?"":typeof e=="string"||typeof e=="number"?e:String(e)}function Ed({questions:e,initialValues:t,controlledValues:r,onChangeValues:n,onSubmit:o,quoteId:i,widgetStageKey:a}){const s=m.useMemo(()=>ar(e),[e]),l=m.useMemo(()=>Er(s),[s]),u=m.useMemo(()=>a==="BundlePolicy"?!0:s.some(b=>String(b.key)==="home_prior_carrier_name")&&s.some(b=>String(b.key)==="driver_vehicle_assignments"),[a,s]),_=m.useMemo(()=>{const b={};return t&&Object.assign(b,t),b},[t]),[p,v]=m.useState(_);m.useEffect(()=>{v(_)},[_]);const[g,C]=m.useState({}),h=m.useMemo(()=>({...g,...r??p}),[g,r,p]);m.useEffect(()=>{r&&C(b=>({...b,...r}))},[r]);const[V,R]=m.useState({}),Y=m.useRef(new Map),H=m.useRef(new Set),[,U]=m.useState({}),[B,j]=m.useState({}),Z=m.useRef(!1);m.useEffect(()=>{!i||Z.current||!s.some(y=>y.key==="year"||y.key==="make"||y.key==="model"||y.key==="body_style")||(Z.current=!0,fo({quoteId:i}).catch(()=>{}))},[i,s]);const[oe,F]=m.useState({}),[ie,Q]=m.useState({}),Te=m.useCallback(async(b,y)=>{if(!i||!Kn(y))return;const d=b?b.join("-"):"_root";F(w=>({...w,[d]:!0})),Q(w=>({...w,[d]:null}));try{const w=await ld({quoteId:i,vin:y});if(w.error){Q(E=>({...E,[d]:w.error}));return}let A=h;w.year&&(A=Ee(A,b,"year",String(w.year))),w.make&&(A=Ee(A,b,"make",w.make)),w.model&&(A=Ee(A,b,"model",w.model)),w.bodyStyle&&(A=Ee(A,b,"body_style",w.bodyStyle)),r&&n?n(A):v(A),C(A),Y.current.clear(),H.current.clear(),U({})}catch{Q(w=>({...w,[d]:"VIN lookup failed — please enter vehicle details manually"}))}finally{F(w=>({...w,[d]:!1}))}},[i,h,r,n]),ye=m.useCallback(b=>{const y=`${b.year}|${b.make??""}|${b.model??""}`,d=b.model?"bodyStyles":b.make?"models":"makes",w=Y.current.get(y);return w?w[d]??[]:void 0},[]),Ae=m.useCallback((b,y)=>{if(!i)return;const d=`${y.year}|${y.make??""}|${y.model??""}`,w=y.model?"bodyStyles":y.make?"models":"makes",A=`${b}:${w}`;Y.current.has(d)||H.current.has(d)||(H.current.add(d),j(E=>({...E,[A]:!0})),fo({quoteId:i,...y}).then(E=>{Y.current.set(d,E),U(I=>({...I,[A]:E[w]??[]}))}).catch(()=>{Y.current.set(d,{}),U(E=>({...E,[A]:[]}))}).finally(()=>{H.current.delete(d),j(E=>({...E,[A]:!1}))}))},[i]);function J(b,y,d){const w=h,A=b?Ct(h,b)??{}:w;return b?{state:w.state,...A,[y]:d}:{...A,[y]:d}}function f(b,y){const d=Yn.filter(A=>A.targetKey===b||A.dependsOn.includes(b)),w={[b]:void 0};for(const A of d){const E=A.validate(y);A.targetKey in w?E!==void 0&&(w[A.targetKey]=E):w[A.targetKey]=E}R(A=>({...A,...w}))}const k=(b,y,d)=>{const w=we(h,d,b);if(Ve(w,y)){V[b]&&R(E=>({...E,[b]:void 0}));return}const A=vr(b,w);if(A){R(E=>({...E,[b]:A}));return}f(b,J(d,b,w))};m.useEffect(()=>{let b=h,y=!1;s.forEach(d=>{if(!Yt(d))return;const w=String(d.key);we(b,void 0,w)!=="Yes"&&(b=Ee(b,void 0,w,"Yes"),y=!0)}),y&&(r&&n?n(b):v(b),C(b))},[s,h,r,n]);function L(b,y){const d=b.key;if((d==="relationship_to_insured"||d==="is_registered_owner")&&y){const T=y[y.length-1];if(typeof T=="number"&&T===0)return null}if((d==="purchase_date"||d==="cost_new_value_cents")&&y)return null;if(d==="custom_equipment_value_cents"&&y){const T=we(h,y,"vehicle_has_modifications");if(T!=="Yes"&&T!==!0)return null}const w=d==="auto_reason_for_no_insurance"&&l.currentCarrierKey?h[l.currentCarrierKey]==="NoPriorInsurance"?"Reason you are not currently insured":"Reason for lapse in coverage":b.question,A=b.hint,E=we(h,y,d),I=Wt(b,l)?vt(h,l):d==="social_security_number"&&$t(h.state??h.State)?!0:b.required,x=V[d],K=T=>{let N=Ee(h,y,d,T);if(b.inputType==="radio"&&b.conditionals){const M=b.conditionals??[];for(const z of M){const re=we(h,y,d),se=At(re,z.conditionalType,z.conditionalValue),q=At(T,z.conditionalType,z.conditionalValue);if(se&&!q&&z.conditionalQuestionsAllowMultiple){const ue=z.conditionalQuestions??[];if(ue.length>0){const P=Kt(d);N=Re(N,[...y??[],P],[]);const ce=(X,te)=>{X.forEach(pe=>{(pe.conditionals??[]).forEach(He=>{if(He.conditionalQuestionsAllowMultiple){const ge=Kt(pe.key);N=Re(N,[...te,ge],[])}const et=He.conditionalQuestions??[];et.length>0&&ce(et,te)})})};ce(ue,[...y??[],P])}}}}r&&n?n(N):v(N),C(N)};if(d==="vehicle_policy_selections"){const T=h.vehicles__items??[],N=h.drivers__items??[];if(T.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles first to configure coverage selections."},d);const M=h.driver_vehicle_assignments??{},z=N.length>1,re=ge=>Object.entries(ge).map(([ae,Ce])=>({value:ae,label:Ce})),se=$t(h.state??h.State),q=(ge,ae)=>Object.fromEntries(ge.filter(Ce=>Ce in ae).map(Ce=>[Ce,ae[Ce]])),P=re(q(se?mu:pu,Ar)),ce=se?q(hu,Cr):Cr,X=re(ce),pe=re(q(se?gu:yu,qn)),ke=(ge,ae,Ce)=>{const be=Re(h,["vehicles__items",ge,ae],Ce);r&&n?n(be):v(be),C(be)},He=(ge,ae,Ce)=>{const be={...M},Le=`v${ge}`;be[Le]={...be[Le]??{}},be[Le][`d${ae}`]=Ce;const ee=Re(h,["driver_vehicle_assignments"],be);r&&n?n(ee):v(ee),C(ee)},et=ge=>{if(!z)return null;const ae=M[`v${ge}`];if(!ae)return null;const Ce=N.map((ee,Fe)=>ae[`d${Fe}`]??0),be=Ce.filter(ee=>ee>0);if(be.length>=2&&be.every(ee=>ee===be[0])&&be[0]===50)return`Assignments for Vehicle ${ge+1} cannot be 50 percent for both Drivers.`;const Le=Ce.reduce((ee,Fe)=>ee+Fe,0);return Le>0&&Le!==100?`Driver percentages for this vehicle must add up to 100% (currently ${Le}%).`:null};return c.jsx("div",{children:T.map((ge,ae)=>{const Ce=[ge.year,ge.make,ge.model].filter(Boolean).join(" ")||`Vehicle ${ae+1}`,be=et(ae),Le=ee=>typeof ge[ee]=="string"?ge[ee]:"";return c.jsxs("fieldset",{style:{border:`1px solid ${be?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[c.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:Ce}),c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px"},children:[c.jsx(mt,{id:`veh-${ae}-comp`,label:"Comprehensive deductible",required:!0,placeholder:"Select...",options:P,value:Le("vehicle_comp_deductible"),onChange:ee=>ke(ae,"vehicle_comp_deductible",ee.currentTarget.value)}),c.jsx(mt,{id:`veh-${ae}-coll`,label:"Collision deductible",required:!0,placeholder:"Select...",options:P,value:Le("vehicle_coll_deductible"),onChange:ee=>ke(ae,"vehicle_coll_deductible",ee.currentTarget.value)}),c.jsx(mt,{id:`veh-${ae}-tow`,label:"Towing and Labor",required:!0,placeholder:"Select...",options:X,value:Le("vehicle_towing_and_labor"),onChange:ee=>ke(ae,"vehicle_towing_and_labor",ee.currentTarget.value)}),c.jsx(mt,{id:`veh-${ae}-trans`,label:"Transportation expense",required:!0,placeholder:"Select...",options:pe,value:Le("vehicle_transportation_expense"),onChange:ee=>ke(ae,"vehicle_transportation_expense",ee.currentTarget.value)})]}),z&&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:N.map((ee,Fe)=>{const tt=[ee.first_name,ee.last_name].filter(Boolean).join(" ")||`Driver ${Fe+1}`,Qt=M[`v${ae}`]?.[`d${Fe}`];return c.jsx("div",{style:{flex:"0 0 140px"},children:c.jsx(rr,{id:`assignment-v${ae}-d${Fe}`,label:`${tt} %`,value:Qt??"",min:0,max:100,step:1,inputMode:"numeric",onChange:_t=>{const zr=_t.currentTarget.value.replace(/\D+/g,"");He(ae,Fe,zr===""?0:Math.min(100,parseInt(zr,10)))}})},`${ae}-${Fe}`)})}),be&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:be})]})]},ae)})},d)}if(d==="driver_vehicle_assignments"){const T=h.vehicles__items??[],N=h.drivers__items??[];if(u&&N.length<=1)return null;if(T.length===0||N.length===0)return c.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},d);const M=h.driver_vehicle_assignments??{},z=(se,q,ue)=>{const P={...M},ce=`v${se}`;P[ce]={...P[ce]??{}},P[ce][`d${q}`]=ue,K(P)},re=se=>{if(N.length<2)return null;const q=M[`v${se}`];if(!q)return null;const ue=N.map((X,te)=>q[`d${te}`]??0),P=ue.filter(X=>X>0);if(P.length>=2&&P.every(X=>X===P[0])&&P[0]===50)return`Assignments for Vehicle ${se+1} cannot be 50 percent for both Drivers.`;const ce=ue.reduce((X,te)=>X+te,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}),T.map((se,q)=>{const ue=[se.year,se.make,se.model].filter(Boolean).join(" ")||`Vehicle ${q+1}`,P=re(q);return c.jsxs("fieldset",{style:{border:`1px solid ${P?"#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:N.map((ce,X)=>{const te=[ce.first_name,ce.last_name].filter(Boolean).join(" ")||`Driver ${X+1}`,pe=M[`v${q}`]?.[`d${X}`];return c.jsx("div",{style:{flex:"0 0 140px"},children:c.jsx(rr,{id:`assignment-v${q}-d${X}`,label:`${te} %`,value:pe??"",min:0,max:100,step:1,inputMode:"numeric",onChange:ke=>{const He=ke.currentTarget.value.replace(/\D+/g,"");z(q,X,He===""?0:Math.min(100,parseInt(He,10)))}})},`${q}-${X}`)})}),P&&c.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:P})]},q)})]},d)}switch(b.inputType){case"text":{if(d==="vin"&&i){const T=y?y.join("-"):"_root",N=oe[T]??!1,M=ie[T]??null,z=[A?`${d}-hint`:null,x?`${d}-error`:null,M?`${d}-vin-error`:null].filter(Boolean).join(" ");return c.jsxs("div",{children:[c.jsx(De,{id:d,label:w,hint:A,error:x,required:I,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:d,className:`form-input ${x?"input-error":""}`,"aria-invalid":!!x,"aria-describedby":z||void 0,"aria-required":I||void 0,required:I,value:Ie(E),maxLength:17,onChange:re=>K(re.currentTarget.value),onBlur:()=>k(d,"text",y),autoComplete:Vt[d],type:"text"})}),c.jsx("button",{type:"button",disabled:N||!Kn(Ie(E)),className:"btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",onClick:()=>Te(y,Ie(E)),children:N?"Looking up...":"Verify VIN"})]})}),M&&c.jsx("p",{id:`${d}-vin-error`,className:"text-sm text-red-600 mt-1",children:M})]},d)}if(d==="sms_code"){const T=Ie(E);return c.jsx(tr,{id:d,label:w,hint:A,value:T,inputMode:"numeric",pattern:"[0-9]*",maxLength:6,onChange:N=>{const M=N.currentTarget.value.replace(/\D+/g,"").slice(0,6);K(M)},onBlur:()=>k(d,"text",y),"aria-required":I||void 0,error:x,autoComplete:Vt[d]},d)}return d==="license_number"?c.jsx(tr,{id:d,label:w,hint:A,value:Ie(E),onChange:T=>K(T.currentTarget.value.replace(/[^A-Z0-9]/gi,"").slice(0,20)),onBlur:()=>k(d,"text",y),"aria-required":I||void 0,error:x,autoComplete:"off",maxLength:20},d):d==="social_security_number"?c.jsx(Ko,{id:d,label:w,hint:A,value:Ie(E),onChange:T=>K(T.currentTarget.value),onBlur:()=>k(d,"text",y),"aria-required":I||void 0,error:x},d):c.jsx(tr,{id:d,label:w,hint:A,value:Ie(E),onChange:T=>K(T.currentTarget.value),onBlur:()=>k(d,"text",y),"aria-required":I||void 0,error:x,autoComplete:Vt[d],maxLength:yd[d]},d)}case"email":return c.jsx(qo,{id:d,label:w,value:Ie(E),onChange:T=>K(T.currentTarget.value),onBlur:()=>k(d,"email",y),"aria-required":I||void 0,error:x},d);case"password":return c.jsx(Xo,{id:d,label:w,value:Ie(E),onChange:T=>K(T.currentTarget.value),onBlur:()=>k(d,"password",y),"aria-required":I||void 0,error:x},d);case"tel":return c.jsxs(c.Fragment,{children:[c.jsx(Jo,{id:d,label:w,value:Ie(E),onChange:T=>K(T.currentTarget.value),onBlur:()=>k(d,"tel",y),"aria-required":I||void 0,error:x},d),d==="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(Qo,{id:d,label:w,value:Ie(E),onChange:T=>K(T.currentTarget.value),onBlur:()=>k(d,"url",y),"aria-required":I||void 0,error:x},d);case"number":{const T=hd[d];return ho.has(d)||gd.has(d)?c.jsx(Yo,{id:d,label:w,hint:A,value:So(E),isCurrency:ho.has(d),maxDigits:T,onChange:N=>K(po(N.currentTarget.value)),onBlur:()=>k(d,"number",y),"aria-required":I||void 0,error:x},d):c.jsx(rr,{id:d,label:w,hint:A,value:So(E),inputMode:"numeric",pattern:"[0-9]*",onKeyDown:N=>{if(pd(N.key)){N.preventDefault();return}T!==void 0&&/^\d$/.test(N.key)&&String(N.currentTarget.value).replace(/\D/g,"").length>=T&&N.preventDefault()},onChange:N=>{let M=N.currentTarget.value;T!==void 0&&(M=M.slice(0,T)),K(po(M))},onBlur:()=>k(d,"number",y),"aria-required":I||void 0,error:x},d)}case"textarea":return c.jsx(ei,{id:d,label:w,value:Ie(E),onChange:T=>K(T.currentTarget.value),onBlur:()=>k(d,"textarea",y),"aria-required":I||void 0,error:x,rows:4},d);case"date":{const{min:T,max:N}=bd(d);return c.jsx(ti,{id:d,label:w,hint:A,value:Ie(E),min:T,max:N,onChange:M=>{const z=M.currentTarget.value;K(z),!Ve(z,"date")&&!vr(d,z)&&f(d,J(y,d,z))},onBlur:()=>k(d,"date",y),"aria-required":I||void 0,error:x,autoComplete:Vt[d]},d)}case"checkbox":{if(b.options){const T=Array.isArray(E)?E:[];return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"form-label",children:[w,I&&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:b.options.map(N=>{const M=`${d}-${Sr(N)}`,z=T.includes(N);return c.jsx(ir,{id:M,label:N,checked:z,onChange:re=>{const se=new Set(T);re.currentTarget.checked?se.add(N):se.delete(N),K(Array.from(se))},"aria-required":I||void 0},M)})}),x&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:x})]},d)}return c.jsx(ir,{id:d,label:I?`${w} *`:w,checked:!!E,onChange:T=>K(T.currentTarget.checked),"aria-required":I||void 0},d)}case"radio":{if(Yt(b))return null;const T=b.options??[],N=y&&y.length>0?`${d}__${y.join("__")}`:d;return c.jsx(oi,{legend:w,legendClassName:I?"legend-required":void 0,children:T.map(M=>c.jsx(ni,{name:N,value:M,checked:E===M,onChange:()=>{K(M),f(d,J(y,d,M))},children:mo[d]?.[M]??M},`${d}-${Sr(M)}`))},d)}case"select":{let T=b.options??[];d==="quote_vehicle_id"&&(T=r?.vehicles__items?.map(q=>q.vin)??[]);let N=!1,M,z,re;if(d==="year"||d==="make"||d==="model"||d==="body_style"){const q=y?y.join("-"):"_root";oe[q]&&(N=!0,M="Looking up VIN...")}if(!N&&(d==="make"||d==="model"||d==="body_style")){const q=y?y.join("-"):"_root";re=q;const ue=we(h,y,"year"),P=typeof ue=="number"?ue:Number(ue);if(d==="make"){const ce=`${q}:makes`;if(!P||!Number.isFinite(P))N=!0,M="Select a year first";else{z={year:P};const X=ye(z);X&&X.length>0?T=X:B[ce]?(N=!0,M="Loading makes..."):T=[...Ju]}}else if(d==="model"){const ce=`${q}:models`,X=String(we(h,y,"make")??"");if(!X)N=!0,M="Select a make first";else if(P&&Number.isFinite(P)){z={year:P,make:X};const te=ye(z);te&&te.length>0?T=te:B[ce]?(N=!0,M="Loading models..."):T=[..._d]}typeof E=="string"&&E&&!T.includes(E)&&(T=[E,...T])}else{const ce=`${q}:bodyStyles`,X=String(we(h,y,"make")??""),te=String(we(h,y,"model")??"");if(!te)N=!0,M="Select a model first";else if(P&&Number.isFinite(P)&&X){z={year:P,make:X,model:te};const pe=ye(z);pe&&pe.length>0?T=pe:B[ce]?(N=!0,M="Loading body styles..."):T=[...fd]}typeof E=="string"&&E&&!T.includes(E)&&(T=[E,...T])}}if(d==="occupation"||d==="co_applicant_occupation"){const q=d==="co_applicant_occupation"?"co_applicant_employment_industry":void 0,ue=q?void 0:we(h,y,"industry"),P=we(h,y,q??"employment_industry"),X=String(Ht(ue??P)??"").trim();T=[...ro[X]??md],typeof E=="string"&&E&&!T.includes(E)&&(T=[E,...T])}const se=Ad(y,d);return c.jsx(mt,{id:se,label:M?`${w} — ${M}`:w,"aria-required":I||void 0,error:x,disabled:N,value:wd(E),onChange:q=>{const ue=q.currentTarget.value;if(d!=="year"&&d!=="make"&&d!=="model"&&d!=="industry"&&d!=="employment_industry"&&d!=="co_applicant_employment_industry"){K(ue),f(d,J(y,d,ue));return}let P=Ee(h,y,d,ue);if(d==="year")P=Ee(P,y,"make",""),P=Ee(P,y,"model",""),P=Ee(P,y,"body_style","");else if(d==="make")P=Ee(P,y,"model",""),P=Ee(P,y,"body_style","");else if(d==="model")P=Ee(P,y,"body_style","");else if(d==="industry"||d==="employment_industry")P=Ee(P,y,"occupation","");else if(d==="co_applicant_employment_industry"){const X=String(Ht(ue)??"").trim(),te=ro[X]??[],pe=te.find(ke=>ke===X)??te[0]??"";P=Ee(P,y,"co_applicant_occupation",pe??"")}r&&n?n(P):v(P),C(P);const ce=y?Ct(P,y)??{}:P;f(d,{...ce,[d]:ue})},placeholder:M??"Select an option",onFocus:z&&re?()=>Ae(re,z):void 0,options:T.map(q=>({value:q,label:mo[d]?.[q]??dd[q]??q}))},se)}case"address":return c.jsx(ci,{id:d,label:w,value:Ie(E),onChange:(T,N)=>{let M=Ee(h,y,d,T);const z=N?.state??(typeof T=="string"?T.match(/,\s*([A-Z]{2})\s+\d{5}\b/)?.[1]:void 0);if(z){const re=y?[...y,"state"]:["state"];M=Re(M,re,z)}r&&n?n(M):v(M),C(M)},onBlur:()=>k(d,"address",y),required:I,"aria-required":I||void 0,error:x},d);default:return null}}function O(b,y){return b.map((d,w)=>{const A=String(d.key);if(!Zt(d,h,l)||!Ir(d,h,y)||!Ut(d,h,a))return null;if(Mr(A,d,h,a)){const N=l.currentCarrierKey?h[l.currentCarrierKey]:void 0;if(!(N&&N!=="NoPriorInsurance"&&ut(h,l)&&Or.has(A)))return null}const E=L(d,y),I=d.conditionals??[];if(!I.length)return a==="BundlePolicy"&&A==="policy_bi"?c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mt-6 mb-3",children:"Vehicle Coverage Information"}),E]},`wrap-${A}-${w}`):c.jsx("div",{children:E},`wrap-${A}-${w}`);const x=go(d,we(h,y,A)),K=I.filter(N=>At(x,N.conditionalType,N.conditionalValue)),T=K.length>1&&!K.some(N=>N.conditionalQuestionsAllowMultiple)?K.slice(0,1):K;return c.jsxs("div",{children:[E,T.map((N,M)=>{const z=N.conditionalQuestions??[];if(!z.length)return null;if(!N.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:O(z,y)},`branch-${A}-${M}`);const re=Kt(A),se=Ct(h,[...y??[],re])??[],q=Math.max(1,se.length||1),ue=()=>{const X=Re(h,[...y??[],re,se.length],{});r&&n?n(X):v(X),C(X)},P=()=>{const X=se.slice(0,Math.max(0,se.length-1)),te=Re(h,[...y??[],re],X);r&&n?n(te):v(te),C(te)},ce=`${A}__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:P,children:"Remove last"})]})]}),Array.from({length:q}).map((X,te)=>{const pe=[...y??[],re,te],ke=`${ce}__i${te}`,He=se[te]??{},et=A==="drivers",Ce=et?`Driver #${te+1}`:A==="vehicles"?`Vehicle #${te+1}`:A==="home_losses"||A==="losses"?`Loss #${te+1}`:`Entry #${te+1}`,Le=et&&typeof He.ssn_display=="string"&&He.ssn_display?` — ${He.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:[Ce,Le]}),z.map(ee=>{const Fe=String(ee.key);if(!Zt(ee,h,l)||!Ir(ee,h,pe)||!Ut(ee,h,a))return null;if(Mr(Fe,ee,h,a)){const tt=l.currentCarrierKey?h[l.currentCarrierKey]:void 0;if(!(tt&&tt!=="NoPriorInsurance"&&ut(h,l)&&Or.has(Fe)))return null}return c.jsxs("div",{className:"mt-3",children:[L(ee,pe),(()=>{const tt=ee.conditionals??[];if(!tt.length)return null;const Qt=we(h,pe,ee.key),_t=tt.filter(rt=>At(Qt,rt.conditionalType,rt.conditionalValue));return(_t.length>1&&!_t.some(rt=>rt.conditionalQuestionsAllowMultiple)?_t.slice(0,1):_t).map((rt,Rr)=>{const Hr=rt.conditionalQuestions??[];if(!Hr.length)return null;if(!rt.conditionalQuestionsAllowMultiple)return c.jsx("div",{className:"mt-3",children:O(Hr,pe)},`nested-${ke}-${Rr}`);const Xt=Kt(ee.key),er=Ct(h,[...pe,Xt])??[],jo=Math.max(1,er.length||1),i_=()=>{const ft=Re(h,[...pe,Xt,er.length],{});r&&n?n(ft):v(ft),C(ft)},a_=()=>{const ft=er.slice(0,Math.max(0,er.length-1)),nt=Re(h,[...pe,Xt],ft);r&&n?n(nt):v(nt),C(nt)};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:i_,children:"Add another"}),jo>1&&c.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:a_,children:"Remove last"})]})]}),Array.from({length:jo}).map((ft,nt)=>{const s_=[...pe,Xt,nt];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 #",nt+1]}),O(Hr,s_)]},`nested-item-${ke}-${Rr}-${nt}`)})]},`nested-repeat-${ke}-${Rr}`)})})()]},`${ke}-${Fe}`)})]},`group-${ke}`)})]},`branch-${A}-${M}`)})]},`wrap-${A}-${w}`)})}const $=m.useMemo(()=>{const b=[],y=(d,w)=>{d.forEach(A=>{if(!Zt(A,h,l)||!Ir(A,h,w)||!Ut(A,h,a))return;const E=String(A.key);if(Mr(E,A,h,a)){const N=l.currentCarrierKey?h[l.currentCarrierKey]:void 0;if(!(N&&N!=="NoPriorInsurance"&&ut(h,l)&&Or.has(E)))return}Yt(A)||b.push(A);const I=A.conditionals??[];if(!I.length)return;const x=go(A,we(h,w,E)),K=I.filter(N=>At(x,N.conditionalType,N.conditionalValue));(K.length>1&&!K.some(N=>N.conditionalQuestionsAllowMultiple)?K.slice(0,1):K).forEach(N=>{const M=N.conditionalQuestions??[];M.length&&(N.conditionalQuestionsAllowMultiple||y(M,w))})})};return y(s),b},[s,h,l,a]);function W(b){b.preventDefault();const y=vt(h,l),d=$.map(A=>Wt(A,l)?{...A,required:y}:A),w=Rt(d,h);if(R(w),Object.keys(w).length>0){const A=$.findIndex(E=>w[E.key]);A>=0&&document.getElementById($[A].key)?.focus();return}o(h)}return c.jsx("form",{className:"space-y-6 px-1",onSubmit:W,noValidate:!0,children:O(s)})}const Td="GTM-NK8LGHTQ";function Nd(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function Qe(e,t={}){Nd().push({event:e,credifyWidget:{...t,containerId:Td}})}function kd(){Qe("credify_widget_opened")}function Ao(){Qe("credify_widget_closed")}function Od(e){Qe("credify_widget_stage_viewed",e)}function Co(e){Qe("credify_widget_stage_completed",e)}function Id(){Qe("credify_widget_flow_completed")}function Md(e){Qe("credify_widget_rates_viewed",e??{})}function Ld(){Qe("credify_widget_rates_back")}const wo=new Set(["Disabled","Retired","Unemployed","Other"]);function Dd(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!wo.has(i)}function Pd(e,t){const r=String(e.key??"");if(r==="co_applicant_occupation"||r!=="occupation")return!0;const n=t.industry,o=t.employment_industry,i=String(n??o??"").trim();return!wo.has(i)}function Eo(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 To(e,t){return Eo(e)?"Yes":t}function No(e){return typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null}function ko(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 Oo(e,t){const r=No(e),n=No(t);if(r!=null&&n!=null)return r-n;const o=ko(e),i=ko(t);return o!=null&&i!=null?o-i:e==null||t==null?null:String(e).localeCompare(String(t))}function Fd(e,t){return Array.isArray(e)?e.some(r=>r===t):typeof e=="string"?t!=null&&e.includes(String(t)):!1}function Io(e,t,r){switch(t){case"equals":return e===r;case"notEquals":return e!==r&&e!==""&&e!=null;case"lessThan":{const n=Oo(e,r);return n!=null&&n<0}case"greaterThan":{const n=Oo(e,r);return n!=null&&n>0}case"contains":return Fd(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 $d=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]);function Lr(e,t,r){const n=ar([...e]),o=Er(n),i=[],a=s=>{s.forEach(l=>{if(!Zt(l,t,o)||!Dd(l,t)||!Ut(l,t,r))return;const u=String(l.key);if(Gn(u,r,t)){const C=o.currentCarrierKey?t[o.currentCarrierKey]:void 0;if(!(C&&C!=="NoPriorInsurance"&&ut(t,o)&&$d.has(u)))return}Eo(l)||i.push(l);const _=To(l,t[u]),p=l.conditionals??[];if(!p.length)return;const v=p.filter(C=>Io(_,C.conditionalType,C.conditionalValue));(v.length>1&&!v.some(C=>C.conditionalQuestionsAllowMultiple)?v.slice(0,1):v).forEach(C=>{const h=C.conditionalQuestions??[];h.length&&(C.conditionalQuestionsAllowMultiple||a(h))})})};return a(n),i}const Mo="__items",Dr=e=>`${e}${Mo}`;function xd(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 Pr(e,t,r=[],n=void 0,o=t){for(const i of e){const a=String(i.key),s=To(i,t[a]),l=i.conditionals??[];if(!l.length)continue;const u=l.filter(p=>Io(s,p.conditionalType,p.conditionalValue)),_=u.length>1&&!u.some(p=>p.conditionalQuestionsAllowMultiple)?u.slice(0,1):u;for(const p of _){const v=p.conditionalQuestions??[];if(!v.length)continue;if(!p.conditionalQuestionsAllowMultiple){if(Pr(v,t,r,n,o))return!0;continue}const g=t[Dr(a)]??[];if(g.length===0)return!0;for(const[C,h]of g.entries()){const V=[...r,Dr(a),C],R=Lr(v,h,n).filter(U=>!(xd(U,V)||!Pd(U,h))),Y={state:o.state,...h},H=Rt(R,Y);if(Object.values(H).some(Boolean)||Pr(v,h,V,n,o))return!0}}}return!1}function Lo(e,t,r){return Pr(e,t,[],r,t)}function Do(e){const t=e.vehicles__items??[];if(!Array.isArray(t)||t.length===0)return!1;for(const r of t)if(Ve(r.vehicle_comp_deductible,"select")||Ve(r.vehicle_coll_deductible,"select")||Ve(r.vehicle_towing_and_labor,"select")||Ve(r.vehicle_transportation_expense,"select"))return!0;return!1}function Bd({stages:e,onStageComplete:t,onComplete:r,initialValues:n,initialActive:o,quoteId:i}){const[a,s]=m.useState(o??0),[l,u]=m.useState(n??{}),[_,p]=m.useState({}),[v,g]=m.useState(!1),[C,h]=m.useState(!1),[V,R]=m.useState(null),Y=m.useRef([]),H=m.useRef(e),U=Array.isArray(e)&&e.length>0,B=U?Math.min(a,e.length-1):0,j=U?e[B]:null,Z=j?.key??null;m.useEffect(()=>{o!==void 0&&s(o)},[o]),H.current=e;const oe=m.useMemo(()=>!!(B>=e.length-1||e.slice(B+1).every(k=>k.key==="AutoPolicy")&&(l.drivers__items??[]).length<=1),[B,e,l]);m.useEffect(()=>{U&&a>=e.length&&s(e.length-1)},[a,e.length,U]),m.useEffect(()=>{const f=Y.current[B];f&&f.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[B]),m.useEffect(()=>{n!==void 0&&u(n)},[n]),m.useEffect(()=>{if(!j||!Z){g(!1),R(null);return}if(_[Z]){g(!1),R(null);return}let f=!1;return g(!0),R(null),Promise.resolve(j.loadQuestions()).then(k=>{if(!f){if(!Array.isArray(k))throw new Error(`loadQuestions("${Z}") did not return an array`);p(L=>({...L,[Z]:k}))}}).catch(k=>{f||R(`Failed to load stage "${j?.title??""}": ${k?.message??"Unknown error"}`)}).finally(()=>{f||g(!1)}),()=>{f=!0}},[j,Z,_]);const F=Z?_[Z]:void 0,ie=m.useMemo(()=>Er(ar(F??[])),[F]);m.useEffect(()=>{j&&Z&&F&&Od({stageKey:Z,stageTitle:j.title??Z,stepIndex:a+1,totalSteps:e.length})},[Z,a,e.length,j,F]);const Q=m.useMemo(()=>{if(!F)return{};const f={};(O=>{const $=[],W=b=>{b.forEach((y,d)=>{const w=bt(y,d);$.push(w);const A=Dr(w);$.push(A),(y.conditionals??[]).forEach(I=>{const x=I.conditionalQuestions??[];x.length>0&&W(x)})})};return W(O),$})(F).forEach(O=>{O in l&&(f[O]=l[O])});for(const O of["state","State","address","product"])O in l&&(f[O]=l[O]);for(const[O,$]of Object.entries(l))O.endsWith(Mo)&&!(O in f)&&(f[O]=$);return f},[F,l]),Te=f=>{u(k=>({...k,...f}))},ye=()=>{s(f=>f>0?f-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},Ae=async()=>{if(!F||!j||v||V||C)return;const f=Lr(F,Q,Z??void 0),k=vt(l,ie),L=f.map(I=>Wt(I,ie)?{...I,required:k}:I),O=Rt(L,Q),$=new Set(L.map((I,x)=>bt(I,x))),W=Object.entries(O).some(([I,x])=>x&&$.has(I)),b=Lo(F,l,Z??void 0),d=f.some(I=>String(I.key??"")==="vehicle_policy_selections")?Do(l):!1,w=l.driver_vehicle_assignments,A=l.drivers__items??[];let E=!1;if(w&&A.length>=2){const I=l.vehicles__items??[];for(let x=0;x<I.length;x++){const K=w[`v${x}`];if(!K)continue;const T=A.map((z,re)=>K[`d${re}`]??0),N=T.filter(z=>z>0);if(N.length>=2&&N.every(z=>z===50)){E=!0;break}const M=T.reduce((z,re)=>z+re,0);if(M>0&&M!==100){E=!0;break}}}if(!(W||b||d||E)){h(!0);try{const I=oe,{success:x,error:K}=I?await r(l,Z??""):await t(Q,Z??"");if(!x){R(K??"An error occurred");return}if(!I){const T=H.current,N=T.findIndex(z=>z.key===Z),M=N>=0?Math.min(N+1,T.length-1):Math.min(a+1,T.length-1);s(M)}}finally{h(!1)}}},J=m.useMemo(()=>{if(!F||v||V||C)return!0;const f=Lr(F,Q,Z??void 0),k=vt(l,ie),L=f.map(I=>Wt(I,ie)?{...I,required:k}:I),O=Rt(L,Q),$=new Set(L.map((I,x)=>bt(I,x))),W=Object.entries(O).some(([I,x])=>x&&$.has(I)),b=Lo(F,l,Z??void 0),d=f.some(I=>String(I.key??"")==="vehicle_policy_selections")?Do(l):!1,w=l.driver_vehicle_assignments,A=l.drivers__items??[];let E=!1;if(w&&A.length>=2){const I=l.vehicles__items??[];for(let x=0;x<I.length;x++){const K=w[`v${x}`];if(!K)continue;const T=A.map((z,re)=>K[`d${re}`]??0),N=T.filter(z=>z>0);if(N.length>=2&&N.every(z=>z===50)){E=!0;break}const M=T.reduce((z,re)=>z+re,0);if(M>0&&M!==100){E=!0;break}}}return W||b||d||E},[F,Q,l,v,V,C,ie,Z]);return U?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,k)=>[c.jsx("li",{ref:L=>{Y.current[k]=L},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${k<B?"bg-blue-600 text-white border-blue-600":k===B?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:f.title},f.key??`stage-${k}`),...k<e.length-1?[c.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${f.key??k}`)]:[]])}),c.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[B+1," / ",e.length]})]}),c.jsxs("div",{children:[v&&c.jsx("div",{className:"text-slate-500",children:"Loading…"}),j&&c.jsx(Ed,{questions:F??[],controlledValues:Q,onChangeValues:Te,onSubmit:()=>Ae(),quoteId:i,widgetStageKey:Z??void 0},j.key)]}),!v&&V&&c.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[c.jsx("div",{children:V}),j&&c.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{p(f=>{if(!Z)return f;const k={...f};return delete k[Z],k})},children:"Retry"})]}),c.jsxs("div",{className:B>0?"grid grid-cols-2 gap-3":"",children:[B>0&&c.jsx("button",{type:"button",onClick:ye,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:Ae,disabled:J,className:["form-wizard-next-btn",B>0?"":"w-full","h-12 rounded-full text-white transition","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center justify-center gap-2",J?"bg-gray-300":"bg-blue-600 hover:bg-blue-600/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 bg-primary hover:bg-primary/90 focus-visible:ring-primary/40"].join(" "),children:[C&&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"})]}),oe?"Finish":"Next"]})]})]}):c.jsx("div",{className:"text-slate-600",children:"Loading..."})}const Po={SafecoPersonal:{name:"Safeco",abbr:"SFC",color:"#0F337A"},SafecoPersoanl:{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 zd(e){return e.replace(/[^A-Za-z0-9]/g,"").slice(0,3).toUpperCase()||"CAR"}function $o(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").trim()}function Fr(e){if(!e)return e;const t=Po[e];return t?t.name:$o(e)}function Rd(e){const t=new Set,r=[];return e.forEach((n,o)=>{const a=Po[n]??{name:$o(n),abbr:zd(n),color:Fo[o%Fo.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)}const Ud=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),xo={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},Bo=["PersonalHome","PersonalAuto","Flood","ExcessFlood"],wt="rounded-2xl border-2 border-blue-300 bg-blue-50/30 p-4 shadow-blue-100/60 ring-1 ring-blue-100",Et="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",zo="w-full max-w-md min-w-0 sm:max-w-[calc((100%-1rem)/2)]",Zd="rounded-2xl border-2 border-transparent p-4";function Ro({onBack:e}){const t=()=>{Ld(),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 Ye({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,_=(e.monthly_premium_cents!=null?e.monthly_premium_cents:Math.round((e.premium_cents||0)/l))/100,p=Ud.format(_),v=t==="loading",g=t==="success",C=!!n||v||g,h=!!(e.effective_date&&e.policy_end_date),V=e.lob?xo[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&&V&&c.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-slate-500",children:V}),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:Fr(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:Fr(e.carrier_name).charAt(0).toUpperCase()}),c.jsx("h4",{className:"w-full break-words text-left font-semibold text-slate-900",children:Fr(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"})]})}),h&&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:C,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 ${g?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:v?"Requesting…":g?"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 Wd({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,_]=m.useState(!1),p=m.useMemo(()=>n.some(f=>f.lob==="PersonalAuto"),[n]),v=m.useMemo(()=>n.some(f=>f.lob==="PersonalHome"),[n]),g=m.useMemo(()=>{if(!r)return[];const f=[];return p&&f.push("PersonalAuto"),v&&f.push("PersonalHome"),f},[r,p,v]),C=m.useMemo(()=>{const f=new Set;for(const k of n){const L=k.lob??null;L&&i[k.quote_rate_id]==="success"&&f.add(L)}return f},[n,i]),h=m.useMemo(()=>Object.values(i).some(f=>f==="success"),[i]),V=m.useMemo(()=>u?!0:!r||g.length===0?h:g.every(f=>C.has(f)),[u,r,h,g,C]),R=m.useMemo(()=>o?n.filter(f=>(f.admitted_status??"admitted")==="admitted"):[],[n,o]),Y=m.useMemo(()=>o?n.filter(f=>f.admitted_status==="non_admitted"):[],[n,o]),H=R.length,U=Y.length,B=H+U>0;m.useEffect(()=>{B&&s==="admitted"&&H===0&&U>0&&l("non_admitted")},[s,H,U,B]);const j=m.useMemo(()=>B?s==="admitted"?R:Y:[],[B,s,R,Y]);m.useEffect(()=>{kr()},[]),m.useEffect(()=>{!V||u||(rd(),lo(),_(!0))},[V,u]);const Z=m.useMemo(()=>{if(j.length===0)return[];if(!j.some(O=>O.lob))return[{lob:null,title:"Rates",rates:[...j].sort(($,W)=>{const b=Number.isFinite($.term_months)&&$.term_months>0?$.term_months:1,y=Number.isFinite(W.term_months)&&W.term_months>0?W.term_months:1,d=$.monthly_premium_cents??Math.round(($.premium_cents||0)/b),w=W.monthly_premium_cents??Math.round((W.premium_cents||0)/y);return d-w})}];const k=new Map;for(const O of j){const $=O.lob||"_other",W=k.get($);W?W.push(O):k.set($,[O])}return[...k.entries()].sort(([O],[$])=>{const W=Bo.indexOf(O),b=Bo.indexOf($);return(W===-1?999:W)-(b===-1?999:b)}).map(([O,$])=>({lob:O,title:xo[O]??O,rates:[...$].sort((W,b)=>{const y=Number.isFinite(W.term_months)&&W.term_months>0?W.term_months:1,d=Number.isFinite(b.term_months)&&b.term_months>0?b.term_months:1,w=W.monthly_premium_cents??Math.round((W.premium_cents||0)/y),A=b.monthly_premium_cents??Math.round((b.premium_cents||0)/d);return w-A})}))},[j]),oe=m.useMemo(()=>{if(!r)return[];const f=n.some(O=>O.lob==="PersonalAuto"),k=n.some(O=>O.lob==="PersonalHome"),L=[];return f||L.push("Sorry, no rates found for Personal Auto."),k||L.push("Sorry, no rates found for Homeowners."),L},[r,n]);if(!B)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(Ro,{onBack:t})]});const F=async f=>{a(k=>({...k,[f]:"loading"}));try{if(kr(),!Gt())throw new Error("Authentication required. Please verify your phone number first.");if(!((await ud(f))?.success!==!1))throw new Error("Request failed");a($=>({...$,[f]:"success"}))}catch{a(k=>({...k,[f]:"error"}))}},ie=Z.find(f=>f.lob==="PersonalAuto"),Q=Z.find(f=>f.lob==="PersonalHome"),Te=!!(ie?.rates.length&&Q?.rates.length),ye=Z.filter(f=>!Te||f.lob!=="PersonalAuto"&&f.lob!=="PersonalHome"),Ae=Te&&ie&&Q?[{rate:ie.rates[0]},{rate:Q.rates[0]}]:[],J=Ae.length===1;return c.jsxs("section",{className:"mt-8",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),oe.length>0&&c.jsx("div",{className:"mt-3 space-y-1",children:oe.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 (",H,")"]}),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 (",U,")"]})]})}),j.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."}),j.length>0&&Te&&ie&&Q&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:J?"mt-6 flex justify-center":"mt-6",children:c.jsxs("div",{className:J?`w-full max-w-md ${wt}`:wt,children:[c.jsx("div",{className:Et,children:"Featured Bundle"}),c.jsx("div",{className:J?"grid justify-items-center gap-4":"grid gap-4 sm:grid-cols-2",children:Ae.map(({rate:f})=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(Ye,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:V||(r?!!(f.lob&&g.includes(f.lob)&&C.has(f.lob)):h),onRequestBind:()=>F(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(Ye,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:V||(r?!!(f.lob&&g.includes(f.lob)&&C.has(f.lob)):h),onRequestBind:()=>F(f.quote_rate_id)})},f.quote_rate_id))})]}),Q.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 ",Q.title," Options"]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:Q.rates.slice(1).map(f=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(Ye,{rate:f,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:i[f.quote_rate_id]??"idle",disabled:V||(r?!!(f.lob&&g.includes(f.lob)&&C.has(f.lob)):h),onRequestBind:()=>F(f.quote_rate_id)})},f.quote_rate_id))})]})]}),j.length>0&&ye.map(f=>{const[k,...L]=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}),L.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:`${zo} ${wt}`,children:[c.jsx("div",{className:Et,children:"Featured"}),c.jsx(Ye,{rate:k,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[k.quote_rate_id]??"idle",disabled:V||(r?!!(k.lob&&g.includes(k.lob)&&C.has(k.lob)):h),onRequestBind:()=>F(k.quote_rate_id)})]})})}):L.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 ${wt}`,children:[c.jsx("div",{className:Et,children:"Featured"}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:c.jsx(Ye,{rate:k,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[k.quote_rate_id]??"idle",onRequestBind:()=>F(k.quote_rate_id),disabled:V||(r?!!(k.lob&&g.includes(k.lob)&&C.has(k.lob)):h),className:"h-full min-h-0"})})]}),c.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${Zd}`,children:[c.jsx("div",{className:`${Et} 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(Ye,{rate:L[0],featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[L[0].quote_rate_id]??"idle",onRequestBind:()=>F(L[0].quote_rate_id),disabled:V||(r?!!(L[0].lob&&g.includes(L[0].lob)&&C.has(L[0].lob)):h),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:`${zo} ${wt}`,children:[c.jsx("div",{className:Et,children:"Featured"}),c.jsx(Ye,{rate:k,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[k.quote_rate_id]??"idle",disabled:V||(r?!!(k.lob&&g.includes(k.lob)&&C.has(k.lob)):h),onRequestBind:()=>F(k.quote_rate_id)})]})})}),c.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:L.map(O=>c.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:c.jsx(Ye,{rate:O,featured:!1,showLobLabel:f.lob==null,showFeaturedBadge:!1,status:i[O.quote_rate_id]??"idle",disabled:V||(r?!!(O.lob&&g.includes(O.lob)&&C.has(O.lob)):h),onRequestBind:()=>F(O.quote_rate_id)})},O.quote_rate_id))})]})]},f.lob??"all")}),t&&c.jsx(Ro,{onBack:t})]})}const $r=["Validating your details...","Checking underwriting rules...","Applying eligible discounts...","Reviewing your risk profile...","Calculating premium...","Check complete"],Ho={Auto:{label:"Auto Policy",icon:"🚗",accent:"#0369A1"},Home:{label:"Home Policy",icon:"🏠",accent:"#059669"},Bundle:{label:"Home + Auto Bundle",icon:"🔗",accent:"#7C3AED"}},Uo={Auto:6e4,Home:9e4,Bundle:12e4};function Gd({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 jd({providers:e=[],totalTime:t=6e4,flow:r="Auto",isComplete:n=!1,onComplete:o}){const i=Ho[r]??Ho.Auto,a=Uo[r]??Uo.Auto,s=e.length>0?Math.floor(a/e.length):t,[l,u]=m.useState(0),[_,p]=m.useState(0),[v,g]=m.useState(0),[C,h]=m.useState(0),[V,R]=m.useState(!0),Y=m.useRef(n),H=m.useRef(o),U=m.useRef(l),B=m.useRef(e.length),j=m.useRef(!1),Z=m.useRef(!1);m.useEffect(()=>{Y.current=n,n&&e.length===0&&!j.current&&(j.current=!0,H.current?.())},[n,e.length]),m.useEffect(()=>{H.current=o},[o]),m.useEffect(()=>{U.current=l},[l]),m.useEffect(()=>{B.current=e.length,e.length>0&&(Z.current=!1,u(0),p(0),g(0),h(0),R(!0))},[e.length]),m.useEffect(()=>{if(e.length===0){Y.current&&!j.current&&(j.current=!0,H.current?.());return}Z.current=!1;const Q=100,Te=100/(s/Q),ye=setInterval(()=>{g(Ae=>{if(Z.current||j.current)return Ae;const J=Ae+Te;return J<100?J:(Z.current=!0,setTimeout(()=>{if(Y.current){if(j.current)return;j.current=!0,H.current?.();return}const k=U.current===B.current-1;R(!1),setTimeout(()=>{k?(u(0),p(L=>L+1)):u(L=>L+1),g(0),h(0),R(!0)},300)},400),100)})},Q);return()=>clearInterval(ye)},[l,s,e.length]),m.useEffect(()=>{if(e.length===0)return;const Q=Math.floor(s/$r.length),Te=setInterval(()=>h(ye=>Math.min(ye+1,$r.length-1)),Q);return()=>clearInterval(Te)},[l,s,e.length]);const oe=e.length===0,F=oe?null:e[Math.min(l,e.length-1)],ie=_>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:le?"Connecting to top carriers":"Fetching your best rates"}),c.jsx("p",{style:{fontSize:14,color:"#64748B",marginTop:8,marginBottom:0},children:le?"Identifying the carriers eligible for your quote...":se?"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:le?c.jsx("div",{style:{display:"flex",gap:20},children:[0,1,2,3,4].map(ee=>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:`${ee*.12}s`}}),c.jsx("div",{style:{width:40,height:8,borderRadius:4,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${ee*.12}s`}})]},`skeleton-${ee}`))}):F?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("div",{style:{width:64,height:64,borderRadius:18,background:F.color+"18",border:`2px solid ${F.color}`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:16,color:F.color,position:"relative",animation:"providerPulse 1.8s ease-in-out infinite"},children:[F.abbr,c.jsx("div",{style:{position:"absolute",inset:-5,borderRadius:22,border:`2px solid ${F.color}`,pointerEvents:"none",animation:"ringPulse 1.6s ease-in-out infinite"}})]}),c.jsx("span",{style:{fontSize:13,fontWeight:600,color:F.color,letterSpacing:"0.04em"},children:F.name})]}):null}),c.jsxs("div",{className:`iq-card-fade ${Y?"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:le||!F?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(zd,{progress:v,color:F.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:F.color},children:[Math.round(v),"%"]})})]}),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:se?"Still checking":"Now checking"}),c.jsx("h2",{style:{fontSize:20,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:F.name}),c.jsx("p",{className:"iq-status-text",style:{fontSize:13,color:"#64748B",margin:0},children:Lr[C]},`${l}-${C}`)]})]})}),c.jsxs("div",{children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.08em",textTransform:"uppercase",margin:"0 0 8px"},children:le?"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 Hd({onGoBack:e}){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:"Sorry, quote submission failed"}),c.jsx("p",{className:"mt-2 text-sm text-red-700",children:"We ran into an issue submitting your quote. Our team will investigate and get back to you soon."})]}),c.jsx("div",{className:"mt-5",children:c.jsx("button",{type:"button",onClick:e,className:"h-12 w-full rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Go back"})})]})}function U(e){if(e===!0)return"Yes";if(e===!1)return"No"}function Ie(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=Ie(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=Ie(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=Ie(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=Ie(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=Ie(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=Ie(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=Ie(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=Ie(s.date_first_licensed)),s.education_level&&(l.education_level=to(s.education_level)),s.occupation&&(l.occupation=ro(s.occupation)),s.industry&&(l.industry=zt(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=Ie(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(g=>{const C={};return g.code&&(C.code=g.code),g.occurred_at&&(C.occurred_at=Ie(g.occurred_at)),C}));const m=s.driver_accidents;m&&m.length>0&&(l.driver_accidents="Yes",l.driver_accidents__items=m.map(g=>{const C={};return g.occurred_at&&(C.occurred_at=Ie(g.occurred_at)),g.description&&(C.description=g.description),g.quote_vehicle_id&&(C.quote_vehicle_id=i[g.quote_vehicle_id]??g.quote_vehicle_id),g.property_damage_amount_paid_cents!==null&&g.property_damage_amount_paid_cents!==void 0&&(C.property_damage_amount_paid_cents=g.property_damage_amount_paid_cents),g.personal_injury_amount_paid_cents!==null&&g.personal_injury_amount_paid_cents!==void 0&&(C.personal_injury_amount_paid_cents=g.personal_injury_amount_paid_cents),C}));const v=s.losses;return v&&v.length>0&&(l.losses="Yes",l.losses__items=v.map(g=>{const C={};return g.description&&(C.description=g.description),g.date_of_incident&&(C.date_of_incident=Ie(g.date_of_incident)),g.amount_paid_cents!==null&&g.amount_paid_cents!==void 0&&(C.amount_paid_cents=g.amount_paid_cents),g.quote_vehicle_id&&(C.quote_vehicle_id=i[g.quote_vehicle_id]??g.quote_vehicle_id),C})),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=Ie(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=Ie(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 Ro(e,t){const r=Wd(t),n=e.filter(i=>i.key!=="AutoPolicy"),o=n.length>0?n:e;return o}function Dr(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(v=>{o.add(v)})}));for(const[u,d]of Object.entries(e))if(u.endsWith("__items")){const m=u.replace("__items","");if(n.includes(m)){const g=Array.isArray(d)?d.map(C=>Dr(C)):d;t[m]=g}}else if(!u.includes("__items")){if(i.has(u))continue;o.has(u)||(t[u]=r(d))}const a=t.auto_prior_carrier_name;if(typeof a=="string"&&a.trim()!==""){const u=a==="NoPriorInsurance";t.auto_has_prior_insurance=!u,u&&(delete t.auto_prior_years,delete t.auto_prior_months,delete t.auto_prior_expiration_date,delete t.auto_prior_liability_limit,delete t.auto_continuous_coverage_years,delete t.auto_cancelled_declined_refused_to_renew,delete t.auto_current_annual_premium_cents)}const s=t.home_prior_carrier_name;if(typeof s=="string"&&s.trim()!==""){const u=s==="NoPriorInsurance";t.home_has_prior_insurance=!u,u&&(delete t.home_prior_years,delete t.home_continuous_coverage_years,delete t.home_prior_expiration_date,delete t.property_insurance_cancelled)}Array.isArray(t.drivers)&&(t.drivers=t.drivers.map(u=>{if(!u||typeof u!="object")return u;const d={...u};return d.industry=zt(d.industry),d.education_level=to(d.education_level),d.occupation=ro(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 v=Math.trunc(m),g=Math.min(Math.max(v,0),l);return{...d,amount_paid_cents:g*100}})),t}function Gd(e,t){const r=e.findIndex(o=>o.key===t);return r<0?t:e[r+1]?.key??t}function Ho(e){return e.some(t=>String(t.key)==="BundlePolicy"||String(t.key)==="BundleCustomer")}function Uo(e){return Ho(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]=h.useState([]),[o,i]=h.useState(null),a=h.useRef(null);h.useEffect(()=>{a.current=o},[o]);const[s,l]=h.useState(null),[u,d]=h.useState(!1),[m,v]=h.useState(!1),[g,C]=h.useState([]),p=h.useRef(null),[Y,z]=h.useState(null),[K,R]=h.useState(void 0),[H,B]=h.useState(!1),[G,Z]=h.useState(null),le=h.useRef(!1);h.useEffect(()=>{if(!u||m)return;const te=Uo(r);let J=!1;const M=[];let f=0,b=0;const L=24,O=3,j=5e3;let W=!1;const A=async()=>{if(J)return;f++;try{const{quote:_}=await co();if(J)return;if(b=0,!W){const E=_?.appetites??null,k=Fd(E,te);k.length>0&&(C(k),W=!0)}const w=_?.rates_status??null;if(w==="completed"){const{rates:E}=await so();if(J)return;p.current=E,v(!0);return}if(w==="no_rates"){p.current=[],v(!0);return}if(w==="failed"){Z({message:"submission_failed"}),d(!1);return}}catch(_){if(b++,console.warn("Provider polling: getQuote failed",{attempt:f,consecutiveFailures:b,error:_}),b>=O){Z({message:"submission_failed"}),d(!1);return}}if(J)return;if(f>=L){Z({message:"submission_failed"}),d(!1);return}const y=window.setTimeout(A,j);M.push(y)};return A(),()=>{J=!0,M.forEach(y=>window.clearTimeout(y))}},[u,m,r]);function F(te){const J={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 M=te.map(b=>({key:b,title:J[b]||b,loadQuestions:async()=>{const L=await Xu(b,a.current??void 0);let O=Vd(b,L.questions);return O=Yd(b,O),O}}));if(te.includes("Vehicle")&&te.includes("Driver")&&te.includes("AutoCurrentCarrier")&&te.includes("Customer")){const b=M.findIndex(L=>L.key==="Product");if(b>=0){const L=M.slice(0,b+1),O=M.slice(b+1),j=y=>O.find(_=>_.key===y)??null,W=[j("Vehicle"),j("Driver"),j("AutoCurrentCarrier"),j("Customer")].filter(y=>!!y),A=O.filter(y=>!["Vehicle","Driver","AutoCurrentCarrier","Customer","AutoPolicy"].includes(String(y.key)));M=[...L,...W,...A]}}return M}h.useEffect(()=>{const te=async()=>{try{const J=Vu();if(wr(),J){B(!0),i(J);try{const M=Zt(),f=await co(M?void 0:J);if(!f||!f.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:b}=f,{stages:L}=await Wt(J),O=F(L);n(O);let j;try{j=Ud(b),z(j)}catch(A){throw new Error(`Failed to transform quote data: ${A instanceof Error?A.message:"Unknown error"}`)}const W=Ro(O,j);if(n(W),b.current_stage){const A=b.current_stage==="State"?"Product":b.current_stage,y=W.findIndex(_=>_.key===A);y>=0?R(y):R(W.length-1)}else R(W.length-1)}catch(M){const f=M;if(f.statusCode===404)oo(),i(null);else if(f.statusCode===401){ao();try{const{stages:b}=await Wt(J),L=F(b);n(L);const O=L.findIndex(j=>j.key==="SMSVerification");O>=0&&R(O)}catch{}}}finally{B(!1)}}else{const{stages:M}=await Wt();n(F(M))}}catch{B(!1)}};e&&!le.current&&(le.current=!0,te())},[e]),h.useEffect(()=>{if(!e)return;const{overflow:te}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=te}},[e]);const se=h.useCallback(te=>{te.key==="Escape"&&(bo(),t())},[t]);h.useEffect(()=>{if(e)return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[e,se]),h.useEffect(()=>{e||(z(null),R(void 0),B(!1),d(!1))},[e]),h.useEffect(()=>{e&&Ad()},[e]),h.useEffect(()=>{s&&Array.isArray(s)&&Ed({rateCount:s.length})},[s]);const ee=h.useCallback(()=>{Z(null),R(Math.max(0,r.length-1))},[r.length]);if(!e)return null;const Te=()=>{bo(),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:Te,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&&!G&&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:[G&&c.jsx(Hd,{onGoBack:ee}),!G&&u&&(()=>{const te=Uo(r);return c.jsx(Rd,{providers:g,totalTime:jd[te],flow:te,isComplete:m,onComplete:()=>{d(!1),v(!1),C([]),p.current&&(l(p.current),p.current=null)}})})(),!G&&!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(Ld,{stages:r,initialValues:Y??void 0,initialActive:K,quoteId:o??void 0,onStageComplete:async(te,J)=>{try{const M=Dr(te);let f=o,b=r;const L=b.findIndex(W=>W.key===J),O=b[L],j=Gd(b,J);if(f)if(J==="SMSVerification"){const{isVerified:W,token:A}=await td(f,M.sms_code);if(!W)throw new Error("Invalid SMS code");A&&Ju(A),await gt({current_stage:j},!1)}else if(J==="Product"){const{isSupported:W}=await rd(M.state);if(!W)throw new Error("State is not supported");const A=Zt();await gt({...M,current_stage:j},!1,A?void 0:f)}else{const W=Zt();await gt({...M,current_stage:j},!1,W?void 0:f||void 0)}else{const A=(await ed(M.phone))?.quoteId;if(!A||typeof A!="string"||A.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${A}`);f=A,i(A),ju(A),await gt({current_stage:j},!1,A)}if(Zd.has(J))try{const{stages:W}=await Wt(f||void 0);b=F(W),b=Ro(b,te),n(b)}catch(W){console.warn("Unable to refresh stages after flow-shaping step",W)}return vo({stageKey:J,stageTitle:O?.title??J,stepIndex:L+1,totalSteps:b.length}),{success:!0}}catch(M){return{success:!1,error:M instanceof Error?M.message:"An error occurred"}}},onComplete:async te=>{try{const J=Dr(te);if(!o)throw new Error("Quote ID is required");z(te),C([]),v(!1),p.current=null,d(!0);let M;try{M=await gt(J,!0)}catch(L){throw d(!1),L}if(M.status==="submission_failed")return d(!1),v(!1),p.current=null,Z({message:M.message}),{success:!0};if(M.status==="success")try{const{rates:L}=await so();p.current=L,v(!0)}catch(L){throw d(!1),L}const f=r.length,b=r[f-1];return vo({stageKey:b?.key??"unknown",stageTitle:b?.title??"unknown",stepIndex:f,totalSteps:f}),wd(),{success:!0}}catch{return{success:!1,error:"Oops, something went wrong. Please try again later."}}}})})," ",!G&&s&&o&&c.jsx(xd,{rates:s,onBack:()=>l(null),isBundleFlow:Ho(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:()=>{Kt.close()}})}let Re=null,Je=null,Yt=!1;function Jd(){Re||(Re=document.createElement("div"),Re.id="insurance-widget-root",document.documentElement.appendChild(Re)),!Je&&Re&&(Je=jo.createRoot(Re))}function Pr(){Jd(),Je&&Je.render(h.createElement(qd,{isOpen:Yt}))}function Qd(){Je&&Re&&(Je.unmount(),Re.remove()),Je=null,Re=null}const Kt={init:e=>{Yt=!!e?.autoOpen,Pr()},open:()=>{Yt=!0,Pr()},close:()=>{Yt=!1,Pr()},destroy:Qd};typeof window<"u"&&(window.CredifyInsuranceWidget=Kt),De.CredifyInsuranceWidget=Kt,De.default=Kt,Object.defineProperties(De,{__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:oe?"Connecting to top carriers":"Fetching your best rates"}),c.jsx("p",{style:{fontSize:14,color:"#64748B",marginTop:8,marginBottom:0},children:oe?"Identifying the carriers eligible for your quote...":ie?"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:oe?c.jsx("div",{style:{display:"flex",gap:20},children:[0,1,2,3,4].map(Q=>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:`${Q*.12}s`}}),c.jsx("div",{style:{width:40,height:8,borderRadius:4,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${Q*.12}s`}})]},`skeleton-${Q}`))}):F?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c.jsxs("div",{style:{width:64,height:64,borderRadius:18,background:F.color+"18",border:`2px solid ${F.color}`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:16,color:F.color,position:"relative",animation:"providerPulse 1.8s ease-in-out infinite"},children:[F.abbr,c.jsx("div",{style:{position:"absolute",inset:-5,borderRadius:22,border:`2px solid ${F.color}`,pointerEvents:"none",animation:"ringPulse 1.6s ease-in-out infinite"}})]}),c.jsx("span",{style:{fontSize:13,fontWeight:600,color:F.color,letterSpacing:"0.04em"},children:F.name})]}):null}),c.jsxs("div",{className:`iq-card-fade ${V?"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:oe||!F?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(Gd,{progress:v,color:F.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:F.color},children:[Math.round(v),"%"]})})]}),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:ie?"Still checking":"Now checking"}),c.jsx("h2",{style:{fontSize:20,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:F.name}),c.jsx("p",{className:"iq-status-text",style:{fontSize:13,color:"#64748B",margin:0},children:$r[C]},`${l}-${C}`)]})]})}),c.jsxs("div",{children:[c.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.08em",textTransform:"uppercase",margin:"0 0 8px"},children:oe?"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 Vd({onGoBack:e}){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:"Sorry, quote submission failed"}),c.jsx("p",{className:"mt-2 text-sm text-red-700",children:"We ran into an issue submitting your quote. Our team will investigate and get back to you soon."})]}),c.jsx("div",{className:"mt-5",children:c.jsx("button",{type:"button",onClick:e,className:"h-12 w-full rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Go back"})})]})}function G(e){if(e===!0)return"Yes";if(e===!1)return"No"}function Me(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 Yd(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=Me(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=Me(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=G(t.is_mailing_address_different)),t.mailing_address&&(r.mailing_address=t.mailing_address),t.effective_date&&(r.effective_date=Me(t.effective_date)),t.auto_has_prior_insurance!==null&&t.auto_has_prior_insurance!==void 0&&(r.auto_has_prior_insurance=G(t.auto_has_prior_insurance)),t.auto_prior_expiration_date&&(r.auto_prior_expiration_date=Me(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=G(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=G(t.home_has_prior_insurance)),t.home_prior_expiration_date&&(r.home_prior_expiration_date=Me(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=G(t.property_insurance_cancelled)),t.lapse_in_coverage!==null&&t.lapse_in_coverage!==void 0&&(r.lapse_in_coverage=G(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=G(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=G(t.mit_credit_form)),t.storm_shutters!==null&&t.storm_shutters!==void 0&&(r.storm_shutters=G(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=G(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=G(t.has_vicious_animals)),t.has_business_on_premises!==null&&t.has_business_on_premises!==void 0&&(r.has_business_on_premises=G(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=G(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=G(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=G(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=G(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=G(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=G(t.has_garage)),t.has_pool!==null&&t.has_pool!==void 0&&(r.has_pool=G(t.has_pool)),t.has_trampoline!==null&&t.has_trampoline!==void 0&&(r.has_trampoline=G(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=G(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=Me(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=G(t.retiree_discount)),t.gated_community_discount!==null&&t.gated_community_discount!==void 0&&(r.gated_community_discount=G(t.gated_community_discount)),t.multi_policy_discount!==null&&t.multi_policy_discount!==void 0&&(r.multi_policy_discount=G(t.multi_policy_discount)),t.non_smoker_discount!==null&&t.non_smoker_discount!==void 0&&(r.non_smoker_discount=G(t.non_smoker_discount)),t.first_time_buyer_discount!==null&&t.first_time_buyer_discount!==void 0&&(r.first_time_buyer_discount=G(t.first_time_buyer_discount)),t.fire_detection_system!==null&&t.fire_detection_system!==void 0&&(r.fire_detection_system=G(t.fire_detection_system)),t.burglar_alarm_system!==null&&t.burglar_alarm_system!==void 0&&(r.burglar_alarm_system=G(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=G(t.smoke_detectors)),t.sprinkler_system!==null&&t.sprinkler_system!==void 0&&(r.sprinkler_system=G(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=G(t.gas_leakage_detector)),t.deadbolt_locks!==null&&t.deadbolt_locks!==void 0&&(r.deadbolt_locks=G(t.deadbolt_locks)),t.fire_extinguisher!==null&&t.fire_extinguisher!==void 0&&(r.fire_extinguisher=G(t.fire_extinguisher)),t.order_credit_authorized!==null&&t.order_credit_authorized!==void 0&&(r.order_credit_authorized=G(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=G(t.has_health_insurance_auto_accident)),t.is_corporation!==null&&t.is_corporation!==void 0&&(r.is_corporation=G(t.is_corporation)),t.named_insured_foreclosure_repo_bankruptcy!==null&&t.named_insured_foreclosure_repo_bankruptcy!==void 0&&(r.named_insured_foreclosure_repo_bankruptcy=G(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=G(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=Me(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=Me(s.date_first_licensed)),s.education_level&&(l.education_level=oo(s.education_level)),s.occupation&&(l.occupation=io(s.occupation)),s.industry&&(l.industry=Ht(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=G(s.last_5_years_license_suspended_or_revoked)),s.accident_prevention_course!==null&&s.accident_prevention_course!==void 0&&(l.accident_prevention_course=G(s.accident_prevention_course)),s.accident_prevention_course_date&&(l.accident_prevention_course_date=Me(s.accident_prevention_course_date)),s.sr22!==null&&s.sr22!==void 0&&(l.sr22=G(s.sr22));const u=s.ssn_display;typeof u=="string"&&(l.ssn_display=u);const _=s.driver_violations;_&&_.length>0&&(l.driver_violations="Yes",l.driver_violations__items=_.map(g=>{const C={};return g.code&&(C.code=g.code),g.occurred_at&&(C.occurred_at=Me(g.occurred_at)),C}));const p=s.driver_accidents;p&&p.length>0&&(l.driver_accidents="Yes",l.driver_accidents__items=p.map(g=>{const C={};return g.occurred_at&&(C.occurred_at=Me(g.occurred_at)),g.description&&(C.description=g.description),g.quote_vehicle_id&&(C.quote_vehicle_id=i[g.quote_vehicle_id]??g.quote_vehicle_id),g.property_damage_amount_paid_cents!==null&&g.property_damage_amount_paid_cents!==void 0&&(C.property_damage_amount_paid_cents=g.property_damage_amount_paid_cents),g.personal_injury_amount_paid_cents!==null&&g.personal_injury_amount_paid_cents!==void 0&&(C.personal_injury_amount_paid_cents=g.personal_injury_amount_paid_cents),C}));const v=s.losses;return v&&v.length>0&&(l.losses="Yes",l.losses__items=v.map(g=>{const C={};return g.description&&(C.description=g.description),g.date_of_incident&&(C.date_of_incident=Me(g.date_of_incident)),g.amount_paid_cents!==null&&g.amount_paid_cents!==void 0&&(C.amount_paid_cents=g.amount_paid_cents),g.quote_vehicle_id&&(C.quote_vehicle_id=i[g.quote_vehicle_id]??g.quote_vehicle_id),C})),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=G(s.new_when_purchased)),s.purchase_date&&(l.purchase_date=Me(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=G(s.anti_lock_brakes)),s.daytime_running_lights!==null&&s.daytime_running_lights!==void 0&&(l.daytime_running_lights=G(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=G(s.vehicle_has_modifications)),s.vehicle_garaged_at_residence!==null&&s.vehicle_garaged_at_residence!==void 0&&(l.vehicle_garaged_at_residence=G(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=G(s.vehicle_full_glass)),s.vehicle_loan_lease!==null&&s.vehicle_loan_lease!==void 0&&(l.vehicle_loan_lease=G(s.vehicle_loan_lease)),s.coverages&&s.coverages.length>0&&(l.coverages__items=s.coverages.map(_=>{const p={};return _.type&&(p.type=_.type),_.per_person_limit_cents!==null&&_.per_person_limit_cents!==void 0&&(p.per_person_limit_cents=_.per_person_limit_cents),_.per_incident_limit_cents!==null&&_.per_incident_limit_cents!==void 0&&(p.per_incident_limit_cents=_.per_incident_limit_cents),_.per_incident_limit_percent!==null&&_.per_incident_limit_percent!==void 0&&(p.per_incident_limit_percent=_.per_incident_limit_percent),_.per_day_limit_cents!==null&&_.per_day_limit_cents!==void 0&&(p.per_day_limit_cents=_.per_day_limit_cents),_.deductible_cents!==null&&_.deductible_cents!==void 0&&(p.deductible_cents=_.deductible_cents),_.is_declined!==null&&_.is_declined!==void 0&&(p.is_declined=G(_.is_declined)),p})),s.vehicle_lienholders&&s.vehicle_lienholders.length>0&&(l.vehicle_lienholders__items=s.vehicle_lienholders.map(_=>{const p={};return _.name&&(p.name=_.name),_.type&&(p.type=_.type),_.line_1&&(p.line_1=_.line_1),_.line_2&&(p.line_2=_.line_2),_.city&&(p.city=_.city),_.state&&(p.state=_.state),_.postal_code&&(p.postal_code=_.postal_code),_.phone&&(p.phone=_.phone),_.fax&&(p.fax=_.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=Me(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 Kd=new Set(["Product","Driver","Vehicle"]);function qd(e){return e?Array.isArray(e.drivers__items)?e.drivers__items.length:Array.isArray(e.drivers)?e.drivers.length:null:null}function Zo(e,t){const r=qd(t),n=e.filter(i=>i.key!=="AutoPolicy"),o=n.length>0?n:e;return o}function xr(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,_]of Object.entries(e))u.endsWith("__items")&&Array.isArray(_)&&(i.add(u.replace("__items","")),_.forEach(p=>{typeof p=="object"&&p!==null&&Object.keys(p).forEach(v=>{o.add(v)})}));for(const[u,_]of Object.entries(e))if(u.endsWith("__items")){const p=u.replace("__items","");if(n.includes(p)){const g=Array.isArray(_)?_.map(C=>xr(C)):_;t[p]=g}}else if(!u.includes("__items")){if(i.has(u))continue;o.has(u)||(t[u]=r(_))}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 _={...u};return _.industry=Ht(_.industry),_.education_level=oo(_.education_level),_.occupation=io(_.occupation),_})),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,_)=>{const p=u;console.log(`[DEBUG_TRANSFORM] Driver ${_}:`,{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 _=Math.trunc(u);if(_>=1){const p=Math.min(_,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 _=u,p=_.amount_paid_cents;if(typeof p!="number"||!Number.isFinite(p))return _;const v=Math.trunc(p),g=Math.min(Math.max(v,0),l);return{..._,amount_paid_cents:g*100}})),t}function Jd(e,t){const r=e.findIndex(o=>o.key===t);return r<0?t:e[r+1]?.key??t}function Wo(e){return e.some(t=>String(t.key)==="BundlePolicy"||String(t.key)==="BundleCustomer")}function Go(e){return Wo(e)?"Bundle":e.some(t=>String(t.key)==="Vehicle"||String(t.key)==="Driver")?"Auto":"Home"}const Qd={Auto:45e3,Home:5e4,Bundle:1e5};function Xd(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 e_(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 t_({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,_]=m.useState(!1),[p,v]=m.useState(!1),[g,C]=m.useState([]),h=m.useRef(null),[V,R]=m.useState(null),[Y,H]=m.useState(void 0),[U,B]=m.useState(!1),[j,Z]=m.useState(null),[oe,F]=m.useState(null),[ie,Q]=m.useState(!1),Te=m.useRef(!1);m.useEffect(()=>{if(!u||p)return;const L=Go(r);let O=!1;const $=[];let W=0,b=0;const y=24,d=3,w=5e3;let A=!1;const E=async()=>{if(O)return;W++;try{const{quote:x}=await _o();if(O)return;if(b=0,!A){const T=x?.appetites??null,N=Hd(T,L);N.length>0&&(C(N),A=!0)}const K=x?.rates_status??null;if(K==="completed"){const{rates:T}=await uo();if(O)return;h.current=T,v(!0);return}if(K==="no_rates"){h.current=[],v(!0);return}if(K==="failed"){Z({message:"submission_failed"}),_(!1);return}}catch(x){if(b++,console.warn("Provider polling: getQuote failed",{attempt:W,consecutiveFailures:b,error:x}),b>=d){Z({message:"submission_failed"}),_(!1);return}}if(O)return;if(W>=y){Z({message:"submission_failed"}),_(!1);return}const I=window.setTimeout(E,w);$.push(I)};return E(),()=>{O=!0,$.forEach(I=>window.clearTimeout(I))}},[u,p,r]);function ye(L){const O={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 $=L.map(b=>({key:b,title:O[b]||b,loadQuestions:async()=>{const y=await id(b,a.current??void 0);let d=Xd(b,y.questions);return d=e_(b,d),d}}));if(L.includes("Vehicle")&&L.includes("Driver")&&L.includes("AutoCurrentCarrier")&&L.includes("Customer")){const b=$.findIndex(y=>y.key==="Product");if(b>=0){const y=$.slice(0,b+1),d=$.slice(b+1),w=I=>d.find(x=>x.key===I)??null,A=[w("Vehicle"),w("Driver"),w("AutoCurrentCarrier"),w("Customer")].filter(I=>!!I),E=d.filter(I=>!["Vehicle","Driver","AutoCurrentCarrier","Customer","AutoPolicy"].includes(String(I.key)));$=[...y,...A,...E]}}return $}m.useEffect(()=>{const L=async()=>{try{const O=Xu();if(kr(),O){B(!0),i(O);try{const $=Gt(),W=await _o($?void 0:O);if(!W||!W.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:b}=W,{stages:y}=await jt(O),d=ye(y);n(d);let w;try{w=Yd(b),R(w)}catch(E){throw new Error(`Failed to transform quote data: ${E instanceof Error?E.message:"Unknown error"}`)}const A=Zo(d,w);if(n(A),b.current_stage){const E=b.current_stage==="State"?"Product":b.current_stage,I=A.findIndex(x=>x.key===E);I>=0?H(I):H(A.length-1)}else H(A.length-1)}catch($){const W=$;if(W.statusCode===404)so(),i(null);else if(W.statusCode===401){lo();try{const{stages:b}=await jt(O),y=ye(b);n(y);const d=y.findIndex(w=>w.key==="SMSVerification");d>=0&&H(d)}catch{}}}finally{B(!1)}}else{const{stages:$}=await jt();n(ye($))}}catch{B(!1)}};e&&!Te.current&&(Te.current=!0,L())},[e]),m.useEffect(()=>{if(!e)return;const{overflow:L}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=L}},[e]);const Ae=m.useCallback(L=>{L.key==="Escape"&&(Ao(),t())},[t]);m.useEffect(()=>{if(e)return window.addEventListener("keydown",Ae),()=>window.removeEventListener("keydown",Ae)},[e,Ae]),m.useEffect(()=>{e||(R(null),H(void 0),B(!1),_(!1),F(null),Q(!1))},[e]),m.useEffect(()=>{e&&kd()},[e]),m.useEffect(()=>{s&&Array.isArray(s)&&Md({rateCount:s.length})},[s]);const J=m.useCallback(()=>{Z(null),H(Math.max(0,r.length-1))},[r.length]),f=m.useCallback(async L=>{if(!(!oe||!o||ie)){Q(!0);try{const $={...xr(oe.allValues),communications_consent:L};C([]),v(!1),h.current=null,_(!0),F(null);let W;try{W=await St($,!0)}catch(d){throw _(!1),d}if(W.status==="submission_failed"){_(!1),v(!1),h.current=null,Z({message:W.message});return}if(W.status==="success")try{const{rates:d}=await uo();h.current=d,v(!0)}catch(d){throw _(!1),d}const b=r.length,y=r[b-1];Co({stageKey:y?.key??"unknown",stageTitle:y?.title??"unknown",stepIndex:b,totalSteps:b}),Id()}catch{_(!1),Z({message:"Oops, something went wrong. Please try again later."})}finally{Q(!1)}}},[oe,o,ie,r]);if(!e)return null;const k=()=>{Ao(),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:k,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&&!j&&c.jsx("div",{className:"text-center mb-6",children:c.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's shop multiple leading carriers for you."})}),c.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[j&&c.jsx(Vd,{onGoBack:J}),!j&&u&&(()=>{const L=Go(r);return c.jsx(jd,{providers:g,totalTime:Qd[L],flow:L,isComplete:p,onComplete:()=>{_(!1),v(!1),C([]),h.current&&(l(h.current),h.current=null)}})})(),!j&&!u&&oe&&c.jsx(ri,{onChoose:f,isSubmitting:ie}),!j&&!s&&!u&&!oe&&c.jsx(c.Fragment,{children:U||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(Bd,{stages:r,initialValues:V??void 0,initialActive:Y,quoteId:o??void 0,onStageComplete:async(L,O)=>{try{const $=xr(L);let W=o,b=r;const y=b.findIndex(A=>A.key===O),d=b[y],w=Jd(b,O);if(W)if(O==="SMSVerification"){const{isVerified:A,token:E}=await sd(W,$.sms_code);if(!A)throw new Error("Invalid SMS code");E&&nd(E),await St({current_stage:w},!1)}else if(O==="Product"){const{isSupported:A}=await cd($.state);if(!A)throw new Error("State is not supported");const E=Gt();await St({...$,current_stage:w},!1,E?void 0:W)}else{const A=Gt();await St({...$,current_stage:w},!1,A?void 0:W||void 0)}else{const E=(await ad($.phone))?.quoteId;if(!E||typeof E!="string"||E.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${E}`);W=E,i(E),Qu(E),await St({current_stage:w},!1,E)}if(Kd.has(O))try{const{stages:A}=await jt(W||void 0);b=ye(A),b=Zo(b,L),n(b)}catch(A){console.warn("Unable to refresh stages after flow-shaping step",A)}return Co({stageKey:O,stageTitle:d?.title??O,stepIndex:y+1,totalSteps:b.length}),{success:!0}}catch($){return{success:!1,error:$ instanceof Error?$.message:"An error occurred"}}},onComplete:async L=>o?(R(L),F({allValues:L}),{success:!0}):{success:!1,error:"Oops, something went wrong. Please try again later."}})})," ",!j&&s&&o&&c.jsx(Wd,{rates:s,onBack:()=>l(null),isBundleFlow:Wo(r)})]}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-200 space-y-1",children:[c.jsxs("p",{className:"text-center text-sm text-slate-500",children:["Credify Corporation – Texas #3309669."," ",c.jsx("a",{href:"https://getcredify.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","|"," ",c.jsx("a",{href:"https://getcredify.com/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Terms of Service"})]}),c.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})]})]})]})}function r_({isOpen:e}){return c.jsx(t_,{isOpen:e,onClose:()=>{Jt.close()}})}let Ue=null,Xe=null,qt=!1;function n_(){Ue||(Ue=document.createElement("div"),Ue.id="insurance-widget-root",document.documentElement.appendChild(Ue)),!Xe&&Ue&&(Xe=Vo.createRoot(Ue))}function Br(){n_(),Xe&&Xe.render(m.createElement(r_,{isOpen:qt}))}function o_(){Xe&&Ue&&(Xe.unmount(),Ue.remove()),Xe=null,Ue=null}const Jt={init:e=>{qt=!!e?.autoOpen,Br()},open:()=>{qt=!0,Br()},close:()=>{qt=!1,Br()},destroy:o_};typeof window<"u"&&(window.CredifyInsuranceWidget=Jt),$e.CredifyInsuranceWidget=Jt,$e.default=Jt,Object.defineProperties($e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
76
76
|
//# sourceMappingURL=index.umd.js.map
|