@getcredify/credify-insurance-widget 1.12.1 → 1.13.4

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.
@@ -84,7 +84,7 @@ Error generating stack: `+a.message+`
84
84
 
85
85
  `)}z.write("payload.value = newResult;"),z.write("return payload;");const ye=z.compile();return(ne,le)=>ye(B,ne,le)};let f;const m=go,_=!Oh.jitless,y=_&&ig.value,b=r.catchall;let w;n._zod.parse=(B,z)=>{w??(w=o.value);const H=B.value;return m(H)?_&&y&&z?.async===!1&&z.jitless!==!0?(f||(f=c(r.shape)),B=f(B,z),b?Gh([],H,B,z,w,n):B):l(B,z):(B.issues.push({expected:"object",code:"invalid_type",input:H,inst:n}),B)}});function D_(n,r,l,o){for(const f of n)if(f.issues.length===0)return r.value=f.value,r;const c=n.filter(f=>!Nr(f));return c.length===1?(r.value=c[0].value,c[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:l,errors:n.map(f=>f.issues.map(m=>Ua(m,o,ka())))}),r)}const qv=G("$ZodUnion",(n,r)=>{it.init(n,r),Ye(n._zod,"optin",()=>r.options.some(c=>c._zod.optin==="optional")?"optional":void 0),Ye(n._zod,"optout",()=>r.options.some(c=>c._zod.optout==="optional")?"optional":void 0),Ye(n._zod,"values",()=>{if(r.options.every(c=>c._zod.values))return new Set(r.options.flatMap(c=>Array.from(c._zod.values)))}),Ye(n._zod,"pattern",()=>{if(r.options.every(c=>c._zod.pattern)){const c=r.options.map(f=>f._zod.pattern);return new RegExp(`^(${c.map(f=>pc(f.source)).join("|")})$`)}});const l=r.options.length===1,o=r.options[0]._zod.run;n._zod.parse=(c,f)=>{if(l)return o(c,f);let m=!1;const _=[];for(const p of r.options){const y=p._zod.run({value:c.value,issues:[]},f);if(y instanceof Promise)_.push(y),m=!0;else{if(y.issues.length===0)return y;_.push(y)}}return m?Promise.all(_).then(p=>D_(p,c,n,f)):D_(_,c,n,f)}}),Vv=G("$ZodIntersection",(n,r)=>{it.init(n,r),n._zod.parse=(l,o)=>{const c=l.value,f=r.left._zod.run({value:c,issues:[]},o),m=r.right._zod.run({value:c,issues:[]},o);return f instanceof Promise||m instanceof Promise?Promise.all([f,m]).then(([p,y])=>R_(l,p,y)):R_(l,f,m)}});function nc(n,r){if(n===r)return{valid:!0,data:n};if(n instanceof Date&&r instanceof Date&&+n==+r)return{valid:!0,data:n};if(Gi(n)&&Gi(r)){const l=Object.keys(r),o=Object.keys(n).filter(f=>l.indexOf(f)!==-1),c={...n,...r};for(const f of o){const m=nc(n[f],r[f]);if(!m.valid)return{valid:!1,mergeErrorPath:[f,...m.mergeErrorPath]};c[f]=m.data}return{valid:!0,data:c}}if(Array.isArray(n)&&Array.isArray(r)){if(n.length!==r.length)return{valid:!1,mergeErrorPath:[]};const l=[];for(let o=0;o<n.length;o++){const c=n[o],f=r[o],m=nc(c,f);if(!m.valid)return{valid:!1,mergeErrorPath:[o,...m.mergeErrorPath]};l.push(m.data)}return{valid:!0,data:l}}return{valid:!1,mergeErrorPath:[]}}function R_(n,r,l){const o=new Map;let c;for(const _ of r.issues)if(_.code==="unrecognized_keys"){c??(c=_);for(const p of _.keys)o.has(p)||o.set(p,{}),o.get(p).l=!0}else n.issues.push(_);for(const _ of l.issues)if(_.code==="unrecognized_keys")for(const p of _.keys)o.has(p)||o.set(p,{}),o.get(p).r=!0;else n.issues.push(_);const f=[...o].filter(([,_])=>_.l&&_.r).map(([_])=>_);if(f.length&&c&&n.issues.push({...c,keys:f}),Nr(n))return n;const m=nc(r.value,l.value);if(!m.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(m.mergeErrorPath)}`);return n.value=m.data,n}const Pv=G("$ZodEnum",(n,r)=>{it.init(n,r);const l=Mh(r.entries),o=new Set(l);n._zod.values=o,n._zod.pattern=new RegExp(`^(${l.filter(c=>lg.has(typeof c)).map(c=>typeof c=="string"?wr(c):c.toString()).join("|")})$`),n._zod.parse=(c,f)=>{const m=c.value;return o.has(m)||c.issues.push({code:"invalid_value",values:l,input:m,inst:n}),c}}),Qv=G("$ZodLiteral",(n,r)=>{if(it.init(n,r),r.values.length===0)throw new Error("Cannot create literal schema with no valid values");const l=new Set(r.values);n._zod.values=l,n._zod.pattern=new RegExp(`^(${r.values.map(o=>typeof o=="string"?wr(o):o?wr(o.toString()):String(o)).join("|")})$`),n._zod.parse=(o,c)=>{const f=o.value;return l.has(f)||o.issues.push({code:"invalid_value",values:r.values,input:f,inst:n}),o}}),Kv=G("$ZodTransform",(n,r)=>{it.init(n,r),n._zod.parse=(l,o)=>{if(o.direction==="backward")throw new Ch(n.constructor.name);const c=r.transform(l.value,l);if(o.async)return(c instanceof Promise?c:Promise.resolve(c)).then(m=>(l.value=m,l));if(c instanceof Promise)throw new Dr;return l.value=c,l}});function w_(n,r){return n.issues.length&&r===void 0?{issues:[],value:void 0}:n}const Fh=G("$ZodOptional",(n,r)=>{it.init(n,r),n._zod.optin="optional",n._zod.optout="optional",Ye(n._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Ye(n._zod,"pattern",()=>{const l=r.innerType._zod.pattern;return l?new RegExp(`^(${pc(l.source)})?$`):void 0}),n._zod.parse=(l,o)=>{if(r.innerType._zod.optin==="optional"){const c=r.innerType._zod.run(l,o);return c instanceof Promise?c.then(f=>w_(f,l.value)):w_(c,l.value)}return l.value===void 0?l:r.innerType._zod.run(l,o)}}),Xv=G("$ZodExactOptional",(n,r)=>{Fh.init(n,r),Ye(n._zod,"values",()=>r.innerType._zod.values),Ye(n._zod,"pattern",()=>r.innerType._zod.pattern),n._zod.parse=(l,o)=>r.innerType._zod.run(l,o)}),Wv=G("$ZodNullable",(n,r)=>{it.init(n,r),Ye(n._zod,"optin",()=>r.innerType._zod.optin),Ye(n._zod,"optout",()=>r.innerType._zod.optout),Ye(n._zod,"pattern",()=>{const l=r.innerType._zod.pattern;return l?new RegExp(`^(${pc(l.source)}|null)$`):void 0}),Ye(n._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),n._zod.parse=(l,o)=>l.value===null?l:r.innerType._zod.run(l,o)}),Jv=G("$ZodDefault",(n,r)=>{it.init(n,r),n._zod.optin="optional",Ye(n._zod,"values",()=>r.innerType._zod.values),n._zod.parse=(l,o)=>{if(o.direction==="backward")return r.innerType._zod.run(l,o);if(l.value===void 0)return l.value=r.defaultValue,l;const c=r.innerType._zod.run(l,o);return c instanceof Promise?c.then(f=>x_(f,r)):x_(c,r)}});function x_(n,r){return n.value===void 0&&(n.value=r.defaultValue),n}const eb=G("$ZodPrefault",(n,r)=>{it.init(n,r),n._zod.optin="optional",Ye(n._zod,"values",()=>r.innerType._zod.values),n._zod.parse=(l,o)=>(o.direction==="backward"||l.value===void 0&&(l.value=r.defaultValue),r.innerType._zod.run(l,o))}),tb=G("$ZodNonOptional",(n,r)=>{it.init(n,r),Ye(n._zod,"values",()=>{const l=r.innerType._zod.values;return l?new Set([...l].filter(o=>o!==void 0)):void 0}),n._zod.parse=(l,o)=>{const c=r.innerType._zod.run(l,o);return c instanceof Promise?c.then(f=>L_(f,n)):L_(c,n)}});function L_(n,r){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:r}),n}const nb=G("$ZodCatch",(n,r)=>{it.init(n,r),Ye(n._zod,"optin",()=>r.innerType._zod.optin),Ye(n._zod,"optout",()=>r.innerType._zod.optout),Ye(n._zod,"values",()=>r.innerType._zod.values),n._zod.parse=(l,o)=>{if(o.direction==="backward")return r.innerType._zod.run(l,o);const c=r.innerType._zod.run(l,o);return c instanceof Promise?c.then(f=>(l.value=f.value,f.issues.length&&(l.value=r.catchValue({...l,error:{issues:f.issues.map(m=>Ua(m,o,ka()))},input:l.value}),l.issues=[]),l)):(l.value=c.value,c.issues.length&&(l.value=r.catchValue({...l,error:{issues:c.issues.map(f=>Ua(f,o,ka()))},input:l.value}),l.issues=[]),l)}}),ab=G("$ZodPipe",(n,r)=>{it.init(n,r),Ye(n._zod,"values",()=>r.in._zod.values),Ye(n._zod,"optin",()=>r.in._zod.optin),Ye(n._zod,"optout",()=>r.out._zod.optout),Ye(n._zod,"propValues",()=>r.in._zod.propValues),n._zod.parse=(l,o)=>{if(o.direction==="backward"){const f=r.out._zod.run(l,o);return f instanceof Promise?f.then(m=>ro(m,r.in,o)):ro(f,r.in,o)}const c=r.in._zod.run(l,o);return c instanceof Promise?c.then(f=>ro(f,r.out,o)):ro(c,r.out,o)}});function ro(n,r,l){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:n.value,issues:n.issues},l)}const rb=G("$ZodReadonly",(n,r)=>{it.init(n,r),Ye(n._zod,"propValues",()=>r.innerType._zod.propValues),Ye(n._zod,"values",()=>r.innerType._zod.values),Ye(n._zod,"optin",()=>r.innerType?._zod?.optin),Ye(n._zod,"optout",()=>r.innerType?._zod?.optout),n._zod.parse=(l,o)=>{if(o.direction==="backward")return r.innerType._zod.run(l,o);const c=r.innerType._zod.run(l,o);return c instanceof Promise?c.then(z_):z_(c)}});function z_(n){return n.value=Object.freeze(n.value),n}const ib=G("$ZodCustom",(n,r)=>{It.init(n,r),it.init(n,r),n._zod.parse=(l,o)=>l,n._zod.check=l=>{const o=l.value,c=r.fn(o);if(c instanceof Promise)return c.then(f=>B_(f,l,o,n));B_(c,l,o,n)}});function B_(n,r,l,o){if(!n){const c={code:"custom",input:l,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(c.params=o._zod.def.params),r.issues.push(Fi(c))}}var k_;class lb{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...l){const o=l[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const l=this._map.get(r);return l&&typeof l=="object"&&"id"in l&&this._idmap.delete(l.id),this._map.delete(r),this}get(r){const l=r._zod.parent;if(l){const o={...this.get(l)??{}};delete o.id;const c={...o,...this._map.get(r)};return Object.keys(c).length?c:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function ob(){return new lb}(k_=globalThis).__zod_globalRegistry??(k_.__zod_globalRegistry=ob());const Ii=globalThis.__zod_globalRegistry;function ub(n,r){return new n({type:"string",...he(r)})}function sb(n,r){return new n({type:"string",format:"email",check:"string_format",abort:!1,...he(r)})}function U_(n,r){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...he(r)})}function cb(n,r){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...he(r)})}function fb(n,r){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...he(r)})}function db(n,r){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...he(r)})}function mb(n,r){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...he(r)})}function _b(n,r){return new n({type:"string",format:"url",check:"string_format",abort:!1,...he(r)})}function hb(n,r){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...he(r)})}function pb(n,r){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...he(r)})}function yb(n,r){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...he(r)})}function gb(n,r){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...he(r)})}function vb(n,r){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...he(r)})}function bb(n,r){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...he(r)})}function Sb(n,r){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...he(r)})}function Ab(n,r){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...he(r)})}function Eb(n,r){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...he(r)})}function Tb(n,r){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...he(r)})}function Cb(n,r){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...he(r)})}function Ob(n,r){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...he(r)})}function Mb(n,r){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...he(r)})}function Nb(n,r){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...he(r)})}function Db(n,r){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...he(r)})}function Rb(n,r){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...he(r)})}function wb(n,r){return new n({type:"string",format:"date",check:"string_format",...he(r)})}function xb(n,r){return new n({type:"string",format:"time",check:"string_format",precision:null,...he(r)})}function Lb(n,r){return new n({type:"string",format:"duration",check:"string_format",...he(r)})}function zb(n,r){return new n({type:"number",coerce:!0,checks:[],...he(r)})}function Bb(n,r){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...he(r)})}function kb(n,r){return new n({type:"boolean",...he(r)})}function Ub(n){return new n({type:"unknown"})}function jb(n,r){return new n({type:"never",...he(r)})}function j_(n,r){return new jh({check:"less_than",...he(r),value:n,inclusive:!1})}function Ps(n,r){return new jh({check:"less_than",...he(r),value:n,inclusive:!0})}function H_(n,r){return new Hh({check:"greater_than",...he(r),value:n,inclusive:!1})}function Qs(n,r){return new Hh({check:"greater_than",...he(r),value:n,inclusive:!0})}function $_(n,r){return new ev({check:"multiple_of",...he(r),value:n})}function Yh(n,r){return new nv({check:"max_length",...he(r),maximum:n})}function bo(n,r){return new av({check:"min_length",...he(r),minimum:n})}function qh(n,r){return new rv({check:"length_equals",...he(r),length:n})}function Hb(n,r){return new iv({check:"string_format",format:"regex",...he(r),pattern:n})}function $b(n){return new lv({check:"string_format",format:"lowercase",...he(n)})}function Ib(n){return new ov({check:"string_format",format:"uppercase",...he(n)})}function Zb(n,r){return new uv({check:"string_format",format:"includes",...he(r),includes:n})}function Gb(n,r){return new sv({check:"string_format",format:"starts_with",...he(r),prefix:n})}function Fb(n,r){return new cv({check:"string_format",format:"ends_with",...he(r),suffix:n})}function Lr(n){return new fv({check:"overwrite",tx:n})}function Yb(n){return Lr(r=>r.normalize(n))}function qb(){return Lr(n=>n.trim())}function Vb(){return Lr(n=>n.toLowerCase())}function Pb(){return Lr(n=>n.toUpperCase())}function Qb(){return Lr(n=>rg(n))}function Kb(n,r,l){return new n({type:"array",element:r,...he(l)})}function Xb(n,r,l){return new n({type:"custom",check:"custom",fn:r,...he(l)})}function Wb(n){const r=Jb(l=>(l.addIssue=o=>{if(typeof o=="string")l.issues.push(Fi(o,l.value,r._zod.def));else{const c=o;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=l.value),c.inst??(c.inst=r),c.continue??(c.continue=!r._zod.def.abort),l.issues.push(Fi(c))}},n(l.value,l)));return r}function Jb(n,r){const l=new It({check:"custom",...he(r)});return l._zod.check=n,l}function Vh(n){let r=n?.target??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Ii,target:r,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function Tt(n,r,l={path:[],schemaPath:[]}){var o;const c=n._zod.def,f=r.seen.get(n);if(f)return f.count++,l.schemaPath.includes(n)&&(f.cycle=l.path),f.schema;const m={schema:{},count:1,cycle:void 0,path:l.path};r.seen.set(n,m);const _=n._zod.toJSONSchema?.();if(_)m.schema=_;else{const b={...l,schemaPath:[...l.schemaPath,n],path:l.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(r,m.schema,b);else{const B=m.schema,z=r.processors[c.type];if(!z)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${c.type}`);z(n,r,B,b)}const w=n._zod.parent;w&&(m.ref||(m.ref=w),Tt(w,r,b),r.seen.get(w).isParent=!0)}const p=r.metadataRegistry.get(n);return p&&Object.assign(m.schema,p),r.io==="input"&&Lt(n)&&(delete m.schema.examples,delete m.schema.default),r.io==="input"&&m.schema._prefault&&((o=m.schema).default??(o.default=m.schema._prefault)),delete m.schema._prefault,r.seen.get(n).schema}function Ph(n,r){const l=n.seen.get(r);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const m of n.seen.entries()){const _=n.metadataRegistry.get(m[0])?.id;if(_){const p=o.get(_);if(p&&p!==m[0])throw new Error(`Duplicate schema id "${_}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(_,m[0])}}const c=m=>{const _=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const w=n.external.registry.get(m[0])?.id,B=n.external.uri??(H=>H);if(w)return{ref:B(w)};const z=m[1].defId??m[1].schema.id??`schema${n.counter++}`;return m[1].defId=z,{defId:z,ref:`${B("__shared")}#/${_}/${z}`}}if(m[1]===l)return{ref:"#"};const y=`#/${_}/`,b=m[1].schema.id??`__schema${n.counter++}`;return{defId:b,ref:y+b}},f=m=>{if(m[1].schema.$ref)return;const _=m[1],{ref:p,defId:y}=c(m);_.def={..._.schema},y&&(_.defId=y);const b=_.schema;for(const w in b)delete b[w];b.$ref=p};if(n.cycles==="throw")for(const m of n.seen.entries()){const _=m[1];if(_.cycle)throw new Error(`Cycle detected: #/${_.cycle?.join("/")}/<root>
86
86
 
87
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const m of n.seen.entries()){const _=m[1];if(r===m[0]){f(m);continue}if(n.external){const y=n.external.registry.get(m[0])?.id;if(r!==m[0]&&y){f(m);continue}}if(n.metadataRegistry.get(m[0])?.id){f(m);continue}if(_.cycle){f(m);continue}if(_.count>1&&n.reused==="ref"){f(m);continue}}}function Qh(n,r){const l=n.seen.get(r);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=m=>{const _=n.seen.get(m);if(_.ref===null)return;const p=_.def??_.schema,y={...p},b=_.ref;if(_.ref=null,b){o(b);const B=n.seen.get(b),z=B.schema;if(z.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(z)):Object.assign(p,z),Object.assign(p,y),m._zod.parent===b)for(const k in p)k==="$ref"||k==="allOf"||k in y||delete p[k];if(z.$ref&&B.def)for(const k in p)k==="$ref"||k==="allOf"||k in B.def&&JSON.stringify(p[k])===JSON.stringify(B.def[k])&&delete p[k]}const w=m._zod.parent;if(w&&w!==b){o(w);const B=n.seen.get(w);if(B?.schema.$ref&&(p.$ref=B.schema.$ref,B.def))for(const z in p)z==="$ref"||z==="allOf"||z in B.def&&JSON.stringify(p[z])===JSON.stringify(B.def[z])&&delete p[z]}n.override({zodSchema:m,jsonSchema:p,path:_.path??[]})};for(const m of[...n.seen.entries()].reverse())o(m[0]);const c={};if(n.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const m=n.external.registry.get(r)?.id;if(!m)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(m)}Object.assign(c,l.def??l.schema);const f=n.external?.defs??{};for(const m of n.seen.entries()){const _=m[1];_.def&&_.defId&&(f[_.defId]=_.def)}n.external||Object.keys(f).length>0&&(n.target==="draft-2020-12"?c.$defs=f:c.definitions=f);try{const m=JSON.parse(JSON.stringify(c));return Object.defineProperty(m,"~standard",{value:{...r["~standard"],jsonSchema:{input:So(r,"input",n.processors),output:So(r,"output",n.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function Lt(n,r){const l=r??{seen:new Set};if(l.seen.has(n))return!1;l.seen.add(n);const o=n._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Lt(o.element,l);if(o.type==="set")return Lt(o.valueType,l);if(o.type==="lazy")return Lt(o.getter(),l);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Lt(o.innerType,l);if(o.type==="intersection")return Lt(o.left,l)||Lt(o.right,l);if(o.type==="record"||o.type==="map")return Lt(o.keyType,l)||Lt(o.valueType,l);if(o.type==="pipe")return Lt(o.in,l)||Lt(o.out,l);if(o.type==="object"){for(const c in o.shape)if(Lt(o.shape[c],l))return!0;return!1}if(o.type==="union"){for(const c of o.options)if(Lt(c,l))return!0;return!1}if(o.type==="tuple"){for(const c of o.items)if(Lt(c,l))return!0;return!!(o.rest&&Lt(o.rest,l))}return!1}const eS=(n,r={})=>l=>{const o=Vh({...l,processors:r});return Tt(n,o),Ph(o,n),Qh(o,n)},So=(n,r,l={})=>o=>{const{libraryOptions:c,target:f}=o??{},m=Vh({...c??{},target:f,io:r,processors:l});return Tt(n,m),Ph(m,n),Qh(m,n)},tS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nS=(n,r,l,o)=>{const c=l;c.type="string";const{minimum:f,maximum:m,format:_,patterns:p,contentEncoding:y}=n._zod.bag;if(typeof f=="number"&&(c.minLength=f),typeof m=="number"&&(c.maxLength=m),_&&(c.format=tS[_]??_,c.format===""&&delete c.format,_==="time"&&delete c.format),y&&(c.contentEncoding=y),p&&p.size>0){const b=[...p];b.length===1?c.pattern=b[0].source:b.length>1&&(c.allOf=[...b.map(w=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},aS=(n,r,l,o)=>{const c=l,{minimum:f,maximum:m,format:_,multipleOf:p,exclusiveMaximum:y,exclusiveMinimum:b}=n._zod.bag;typeof _=="string"&&_.includes("int")?c.type="integer":c.type="number",typeof b=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(c.minimum=b,c.exclusiveMinimum=!0):c.exclusiveMinimum=b),typeof f=="number"&&(c.minimum=f,typeof b=="number"&&r.target!=="draft-04"&&(b>=f?delete c.minimum:delete c.exclusiveMinimum)),typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(c.maximum=y,c.exclusiveMaximum=!0):c.exclusiveMaximum=y),typeof m=="number"&&(c.maximum=m,typeof y=="number"&&r.target!=="draft-04"&&(y<=m?delete c.maximum:delete c.exclusiveMaximum)),typeof p=="number"&&(c.multipleOf=p)},rS=(n,r,l,o)=>{l.type="boolean"},iS=(n,r,l,o)=>{l.not={}},lS=(n,r,l,o)=>{},oS=(n,r,l,o)=>{const c=n._zod.def,f=Mh(c.entries);f.every(m=>typeof m=="number")&&(l.type="number"),f.every(m=>typeof m=="string")&&(l.type="string"),l.enum=f},uS=(n,r,l,o)=>{const c=n._zod.def,f=[];for(const m of c.values)if(m===void 0){if(r.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof m=="bigint"){if(r.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");f.push(Number(m))}else f.push(m);if(f.length!==0)if(f.length===1){const m=f[0];l.type=m===null?"null":typeof m,r.target==="draft-04"||r.target==="openapi-3.0"?l.enum=[m]:l.const=m}else f.every(m=>typeof m=="number")&&(l.type="number"),f.every(m=>typeof m=="string")&&(l.type="string"),f.every(m=>typeof m=="boolean")&&(l.type="boolean"),f.every(m=>m===null)&&(l.type="null"),l.enum=f},sS=(n,r,l,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},cS=(n,r,l,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fS=(n,r,l,o)=>{const c=l,f=n._zod.def,{minimum:m,maximum:_}=n._zod.bag;typeof m=="number"&&(c.minItems=m),typeof _=="number"&&(c.maxItems=_),c.type="array",c.items=Tt(f.element,r,{...o,path:[...o.path,"items"]})},dS=(n,r,l,o)=>{const c=l,f=n._zod.def;c.type="object",c.properties={};const m=f.shape;for(const y in m)c.properties[y]=Tt(m[y],r,{...o,path:[...o.path,"properties",y]});const _=new Set(Object.keys(m)),p=new Set([..._].filter(y=>{const b=f.shape[y]._zod;return r.io==="input"?b.optin===void 0:b.optout===void 0}));p.size>0&&(c.required=Array.from(p)),f.catchall?._zod.def.type==="never"?c.additionalProperties=!1:f.catchall?f.catchall&&(c.additionalProperties=Tt(f.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(c.additionalProperties=!1)},mS=(n,r,l,o)=>{const c=n._zod.def,f=c.inclusive===!1,m=c.options.map((_,p)=>Tt(_,r,{...o,path:[...o.path,f?"oneOf":"anyOf",p]}));f?l.oneOf=m:l.anyOf=m},_S=(n,r,l,o)=>{const c=n._zod.def,f=Tt(c.left,r,{...o,path:[...o.path,"allOf",0]}),m=Tt(c.right,r,{...o,path:[...o.path,"allOf",1]}),_=y=>"allOf"in y&&Object.keys(y).length===1,p=[..._(f)?f.allOf:[f],..._(m)?m.allOf:[m]];l.allOf=p},hS=(n,r,l,o)=>{const c=n._zod.def,f=Tt(c.innerType,r,o),m=r.seen.get(n);r.target==="openapi-3.0"?(m.ref=c.innerType,l.nullable=!0):l.anyOf=[f,{type:"null"}]},pS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType},yS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType,l.default=JSON.parse(JSON.stringify(c.defaultValue))},gS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType,r.io==="input"&&(l._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},vS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType;let m;try{m=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}l.default=m},bS=(n,r,l,o)=>{const c=n._zod.def,f=r.io==="input"?c.in._zod.def.type==="transform"?c.out:c.in:c.out;Tt(f,r,o);const m=r.seen.get(n);m.ref=f},SS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType,l.readOnly=!0},Kh=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType},AS=G("ZodISODateTime",(n,r)=>{Cv.init(n,r),tt.init(n,r)});function ES(n){return Rb(AS,n)}const TS=G("ZodISODate",(n,r)=>{Ov.init(n,r),tt.init(n,r)});function CS(n){return wb(TS,n)}const OS=G("ZodISOTime",(n,r)=>{Mv.init(n,r),tt.init(n,r)});function MS(n){return xb(OS,n)}const NS=G("ZodISODuration",(n,r)=>{Nv.init(n,r),tt.init(n,r)});function DS(n){return Lb(NS,n)}const RS=(n,r)=>{xh.init(n,r),n.name="ZodError",Object.defineProperties(n,{format:{value:l=>yg(n,l)},flatten:{value:l=>pg(n,l)},addIssue:{value:l=>{n.issues.push(l),n.message=JSON.stringify(n.issues,tc,2)}},addIssues:{value:l=>{n.issues.push(...l),n.message=JSON.stringify(n.issues,tc,2)}},isEmpty:{get(){return n.issues.length===0}}})},cn=G("ZodError",RS,{Parent:Error}),wS=gc(cn),xS=vc(cn),LS=Co(cn),zS=Oo(cn),BS=bg(cn),kS=Sg(cn),US=Ag(cn),jS=Eg(cn),HS=Tg(cn),$S=Cg(cn),IS=Og(cn),ZS=Mg(cn),lt=G("ZodType",(n,r)=>(it.init(n,r),Object.assign(n["~standard"],{jsonSchema:{input:So(n,"input"),output:So(n,"output")}}),n.toJSONSchema=eS(n,{}),n.def=r,n.type=r.type,Object.defineProperty(n,"_def",{value:r}),n.check=(...l)=>n.clone(ha(r,{checks:[...r.checks??[],...l.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),n.with=n.check,n.clone=(l,o)=>pa(n,l,o),n.brand=()=>n,n.register=((l,o)=>(l.add(n,o),n)),n.parse=(l,o)=>wS(n,l,o,{callee:n.parse}),n.safeParse=(l,o)=>LS(n,l,o),n.parseAsync=async(l,o)=>xS(n,l,o,{callee:n.parseAsync}),n.safeParseAsync=async(l,o)=>zS(n,l,o),n.spa=n.safeParseAsync,n.encode=(l,o)=>BS(n,l,o),n.decode=(l,o)=>kS(n,l,o),n.encodeAsync=async(l,o)=>US(n,l,o),n.decodeAsync=async(l,o)=>jS(n,l,o),n.safeEncode=(l,o)=>HS(n,l,o),n.safeDecode=(l,o)=>$S(n,l,o),n.safeEncodeAsync=async(l,o)=>IS(n,l,o),n.safeDecodeAsync=async(l,o)=>ZS(n,l,o),n.refine=(l,o)=>n.check(jA(l,o)),n.superRefine=l=>n.check(HA(l)),n.overwrite=l=>n.check(Lr(l)),n.optional=()=>F_(n),n.exactOptional=()=>CA(n),n.nullable=()=>Y_(n),n.nullish=()=>F_(Y_(n)),n.nonoptional=l=>wA(n,l),n.array=()=>_A(n),n.or=l=>Jh([n,l]),n.and=l=>vA(n,l),n.transform=l=>q_(n,EA(l)),n.default=l=>NA(n,l),n.prefault=l=>RA(n,l),n.catch=l=>LA(n,l),n.pipe=l=>q_(n,l),n.readonly=()=>kA(n),n.describe=l=>{const o=n.clone();return Ii.add(o,{description:l}),o},Object.defineProperty(n,"description",{get(){return Ii.get(n)?.description},configurable:!0}),n.meta=(...l)=>{if(l.length===0)return Ii.get(n);const o=n.clone();return Ii.add(o,l[0]),o},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=l=>l(n),n)),Xh=G("_ZodString",(n,r)=>{bc.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(o,c,f)=>nS(n,o,c);const l=n._zod.bag;n.format=l.format??null,n.minLength=l.minimum??null,n.maxLength=l.maximum??null,n.regex=(...o)=>n.check(Hb(...o)),n.includes=(...o)=>n.check(Zb(...o)),n.startsWith=(...o)=>n.check(Gb(...o)),n.endsWith=(...o)=>n.check(Fb(...o)),n.min=(...o)=>n.check(bo(...o)),n.max=(...o)=>n.check(Yh(...o)),n.length=(...o)=>n.check(qh(...o)),n.nonempty=(...o)=>n.check(bo(1,...o)),n.lowercase=o=>n.check($b(o)),n.uppercase=o=>n.check(Ib(o)),n.trim=()=>n.check(qb()),n.normalize=(...o)=>n.check(Yb(...o)),n.toLowerCase=()=>n.check(Vb()),n.toUpperCase=()=>n.check(Pb()),n.slugify=()=>n.check(Qb())}),GS=G("ZodString",(n,r)=>{bc.init(n,r),Xh.init(n,r),n.email=l=>n.check(sb(FS,l)),n.url=l=>n.check(_b(YS,l)),n.jwt=l=>n.check(Db(lA,l)),n.emoji=l=>n.check(hb(qS,l)),n.guid=l=>n.check(U_(I_,l)),n.uuid=l=>n.check(cb(io,l)),n.uuidv4=l=>n.check(fb(io,l)),n.uuidv6=l=>n.check(db(io,l)),n.uuidv7=l=>n.check(mb(io,l)),n.nanoid=l=>n.check(pb(VS,l)),n.guid=l=>n.check(U_(I_,l)),n.cuid=l=>n.check(yb(PS,l)),n.cuid2=l=>n.check(gb(QS,l)),n.ulid=l=>n.check(vb(KS,l)),n.base64=l=>n.check(Ob(aA,l)),n.base64url=l=>n.check(Mb(rA,l)),n.xid=l=>n.check(bb(XS,l)),n.ksuid=l=>n.check(Sb(WS,l)),n.ipv4=l=>n.check(Ab(JS,l)),n.ipv6=l=>n.check(Eb(eA,l)),n.cidrv4=l=>n.check(Tb(tA,l)),n.cidrv6=l=>n.check(Cb(nA,l)),n.e164=l=>n.check(Nb(iA,l)),n.datetime=l=>n.check(ES(l)),n.date=l=>n.check(CS(l)),n.time=l=>n.check(MS(l)),n.duration=l=>n.check(DS(l))});function ma(n){return ub(GS,n)}const tt=G("ZodStringFormat",(n,r)=>{Je.init(n,r),Xh.init(n,r)}),FS=G("ZodEmail",(n,r)=>{pv.init(n,r),tt.init(n,r)}),I_=G("ZodGUID",(n,r)=>{_v.init(n,r),tt.init(n,r)}),io=G("ZodUUID",(n,r)=>{hv.init(n,r),tt.init(n,r)}),YS=G("ZodURL",(n,r)=>{yv.init(n,r),tt.init(n,r)}),qS=G("ZodEmoji",(n,r)=>{gv.init(n,r),tt.init(n,r)}),VS=G("ZodNanoID",(n,r)=>{vv.init(n,r),tt.init(n,r)}),PS=G("ZodCUID",(n,r)=>{bv.init(n,r),tt.init(n,r)}),QS=G("ZodCUID2",(n,r)=>{Sv.init(n,r),tt.init(n,r)}),KS=G("ZodULID",(n,r)=>{Av.init(n,r),tt.init(n,r)}),XS=G("ZodXID",(n,r)=>{Ev.init(n,r),tt.init(n,r)}),WS=G("ZodKSUID",(n,r)=>{Tv.init(n,r),tt.init(n,r)}),JS=G("ZodIPv4",(n,r)=>{Dv.init(n,r),tt.init(n,r)}),eA=G("ZodIPv6",(n,r)=>{Rv.init(n,r),tt.init(n,r)}),tA=G("ZodCIDRv4",(n,r)=>{wv.init(n,r),tt.init(n,r)}),nA=G("ZodCIDRv6",(n,r)=>{xv.init(n,r),tt.init(n,r)}),aA=G("ZodBase64",(n,r)=>{Lv.init(n,r),tt.init(n,r)}),rA=G("ZodBase64URL",(n,r)=>{Bv.init(n,r),tt.init(n,r)}),iA=G("ZodE164",(n,r)=>{kv.init(n,r),tt.init(n,r)}),lA=G("ZodJWT",(n,r)=>{jv.init(n,r),tt.init(n,r)}),Wh=G("ZodNumber",(n,r)=>{Ih.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(o,c,f)=>aS(n,o,c),n.gt=(o,c)=>n.check(H_(o,c)),n.gte=(o,c)=>n.check(Qs(o,c)),n.min=(o,c)=>n.check(Qs(o,c)),n.lt=(o,c)=>n.check(j_(o,c)),n.lte=(o,c)=>n.check(Ps(o,c)),n.max=(o,c)=>n.check(Ps(o,c)),n.int=o=>n.check(Z_(o)),n.safe=o=>n.check(Z_(o)),n.positive=o=>n.check(H_(0,o)),n.nonnegative=o=>n.check(Qs(0,o)),n.negative=o=>n.check(j_(0,o)),n.nonpositive=o=>n.check(Ps(0,o)),n.multipleOf=(o,c)=>n.check($_(o,c)),n.step=(o,c)=>n.check($_(o,c)),n.finite=()=>n;const l=n._zod.bag;n.minValue=Math.max(l.minimum??Number.NEGATIVE_INFINITY,l.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(l.maximum??Number.POSITIVE_INFINITY,l.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(l.format??"").includes("int")||Number.isSafeInteger(l.multipleOf??.5),n.isFinite=!0,n.format=l.format??null}),oA=G("ZodNumberFormat",(n,r)=>{Hv.init(n,r),Wh.init(n,r)});function Z_(n){return Bb(oA,n)}const uA=G("ZodBoolean",(n,r)=>{$v.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>rS(n,l,o)});function sA(n){return kb(uA,n)}const cA=G("ZodUnknown",(n,r)=>{Iv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>lS()});function G_(){return Ub(cA)}const fA=G("ZodNever",(n,r)=>{Zv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>iS(n,l,o)});function dA(n){return jb(fA,n)}const mA=G("ZodArray",(n,r)=>{Gv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>fS(n,l,o,c),n.element=r.element,n.min=(l,o)=>n.check(bo(l,o)),n.nonempty=l=>n.check(bo(1,l)),n.max=(l,o)=>n.check(Yh(l,o)),n.length=(l,o)=>n.check(qh(l,o)),n.unwrap=()=>n.element});function _A(n,r){return Kb(mA,n,r)}const hA=G("ZodObject",(n,r)=>{Yv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>dS(n,l,o,c),Ye(n,"shape",()=>r.shape),n.keyof=()=>Mr(Object.keys(n._zod.def.shape)),n.catchall=l=>n.clone({...n._zod.def,catchall:l}),n.passthrough=()=>n.clone({...n._zod.def,catchall:G_()}),n.loose=()=>n.clone({...n._zod.def,catchall:G_()}),n.strict=()=>n.clone({...n._zod.def,catchall:dA()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=l=>fg(n,l),n.safeExtend=l=>dg(n,l),n.merge=l=>mg(n,l),n.pick=l=>sg(n,l),n.omit=l=>cg(n,l),n.partial=(...l)=>_g(e0,n,l[0]),n.required=(...l)=>hg(t0,n,l[0])});function pA(n,r){const l={type:"object",shape:n??{},...he(r)};return new hA(l)}const yA=G("ZodUnion",(n,r)=>{qv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>mS(n,l,o,c),n.options=r.options});function Jh(n,r){return new yA({type:"union",options:n,...he(r)})}const gA=G("ZodIntersection",(n,r)=>{Vv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>_S(n,l,o,c)});function vA(n,r){return new gA({type:"intersection",left:n,right:r})}const ac=G("ZodEnum",(n,r)=>{Pv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(o,c,f)=>oS(n,o,c),n.enum=r.entries,n.options=Object.values(r.entries);const l=new Set(Object.keys(r.entries));n.extract=(o,c)=>{const f={};for(const m of o)if(l.has(m))f[m]=r.entries[m];else throw new Error(`Key ${m} not found in enum`);return new ac({...r,checks:[],...he(c),entries:f})},n.exclude=(o,c)=>{const f={...r.entries};for(const m of o)if(l.has(m))delete f[m];else throw new Error(`Key ${m} not found in enum`);return new ac({...r,checks:[],...he(c),entries:f})}});function Mr(n,r){const l=Array.isArray(n)?Object.fromEntries(n.map(o=>[o,o])):n;return new ac({type:"enum",entries:l,...he(r)})}const bA=G("ZodLiteral",(n,r)=>{Qv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>uS(n,l,o),n.values=new Set(r.values),Object.defineProperty(n,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function SA(n,r){return new bA({type:"literal",values:Array.isArray(n)?n:[n],...he(r)})}const AA=G("ZodTransform",(n,r)=>{Kv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>cS(n,l),n._zod.parse=(l,o)=>{if(o.direction==="backward")throw new Ch(n.constructor.name);l.addIssue=f=>{if(typeof f=="string")l.issues.push(Fi(f,l.value,r));else{const m=f;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=l.value),m.inst??(m.inst=n),l.issues.push(Fi(m))}};const c=r.transform(l.value,l);return c instanceof Promise?c.then(f=>(l.value=f,l)):(l.value=c,l)}});function EA(n){return new AA({type:"transform",transform:n})}const e0=G("ZodOptional",(n,r)=>{Fh.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>Kh(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function F_(n){return new e0({type:"optional",innerType:n})}const TA=G("ZodExactOptional",(n,r)=>{Xv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>Kh(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function CA(n){return new TA({type:"optional",innerType:n})}const OA=G("ZodNullable",(n,r)=>{Wv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>hS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function Y_(n){return new OA({type:"nullable",innerType:n})}const MA=G("ZodDefault",(n,r)=>{Jv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>yS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function NA(n,r){return new MA({type:"default",innerType:n,get defaultValue(){return typeof r=="function"?r():Dh(r)}})}const DA=G("ZodPrefault",(n,r)=>{eb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>gS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function RA(n,r){return new DA({type:"prefault",innerType:n,get defaultValue(){return typeof r=="function"?r():Dh(r)}})}const t0=G("ZodNonOptional",(n,r)=>{tb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>pS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function wA(n,r){return new t0({type:"nonoptional",innerType:n,...he(r)})}const xA=G("ZodCatch",(n,r)=>{nb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>vS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function LA(n,r){return new xA({type:"catch",innerType:n,catchValue:typeof r=="function"?r:()=>r})}const zA=G("ZodPipe",(n,r)=>{ab.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>bS(n,l,o,c),n.in=r.in,n.out=r.out});function q_(n,r){return new zA({type:"pipe",in:n,out:r})}const BA=G("ZodReadonly",(n,r)=>{rb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>SS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function kA(n){return new BA({type:"readonly",innerType:n})}const UA=G("ZodCustom",(n,r)=>{ib.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>sS(n,l)});function jA(n,r={}){return Xb(UA,n,r)}function HA(n){return Wb(n)}const rc={custom:"custom"};function ht(n){return zb(Wh,n)}const n0=new Date().getUTCFullYear(),lo=ma().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),V_=Jh([SA(""),ma().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),$A=(n,r,l)=>ht({error:`${n} must be a number.`}).min(r,`${n} must be between ${r.toLocaleString()} and ${l.toLocaleString()}.`).max(l,`${n} must be between ${r.toLocaleString()} and ${l.toLocaleString()}.`).int(`${n} must be a whole number.`),Or=(n,r)=>ht({error:`${n} must be a number.`}).min(0,`${n} must be between 0 and ${r.toLocaleString()}.`).max(r,`${n} must be between 0 and ${r.toLocaleString()}.`).int(`${n} must be a whole number.`),oo=(n,r=1600)=>ht({error:`${n} must be a valid 4-digit year.`}).int(`${n} must be a whole number.`).min(r,`${n} should be between ${r} and the current year.`).max(n0,`${n} cannot be in the future.`),uo=n=>ht({error:`${n} must be a number.`}).int(`${n} must be a whole number.`).min(0,`${n} must be between 0 and 99.`).max(99,`${n} must be between 0 and 99.`),ki=(n,r,l=0)=>{const o=Math.pow(10,r)-1,c=o.toLocaleString("en-US"),f=l.toLocaleString("en-US");return ht({error:`${n} must be a number.`}).min(l,`${n}: Value must be between ${f} and ${c}.`).max(o,`${n}: Value must be between ${f} and ${c}.`).int(`${n} must be a whole number.`)},IA={email:ma().trim().min(1,"Required").email("Please enter a valid email address."),phone:ma().trim().min(1,"Required").refine(n=>{let r=n.replace(/\D/g,"");return r.length===11&&r.startsWith("1")&&(r=r.slice(1)),r.length===10},"Please enter a valid 10-digit US phone number."),social_security_number:ma().trim().refine(n=>n===""||/^\d{3}-\d{2}-\d{4}$/.test(n),"Social Security Number must be in the format XXX-XX-XXXX.").optional(),sms_code:ma().trim().min(1,"Required").regex(/^\d{6}$/,"Please enter the 6-digit code."),first_name:lo,last_name:lo,middle_name:V_,co_applicant_first_name:lo,co_applicant_last_name:lo,co_applicant_middle_name:V_,year_built:oo("Year built",1800),year_roof_updated:ht({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:oo("Heating update year"),plumbing_update_year:oo("Plumbing update year"),electrical_update_year:oo("Electrical update year"),total_area_sq_ft:$A("Square footage",1,999999),sale_price_cents:ht({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:uo("Number of years with your prior carrier"),home_continuous_coverage_years:uo("How long you have had continuous home coverage"),household_size:ht({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:ht({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:ki("Replacement cost",9,1),other_structures_coverage:ki("Other structures",9),personal_property_coverage:ki("Personal property",7),loss_of_use_coverage:ki("Loss of use coverage",8),years_at_address:ht({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:ht({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:ht({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:ht({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:ht({error:"Number of families must be a number."}).int("Number of families must be a whole number.").refine(n=>n>=1&&n<=5,{message:"Number of families must be between 1 and 5."}),number_of_dogs:ht({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:ht({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:ki("Amount paid",7),license_number:ma().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:ma().superRefine((n,r)=>{if(typeof n!="string"||n.trim()==="")return;if(/\s/.test(n)){r.addIssue({code:rc.custom,message:"VIN cannot contain spaces."});return}const l=n.trim();/^[A-HJ-NPR-Z0-9]{17}$/i.test(l)||r.addIssue({code:rc.custom,message:"VIN must be exactly 17 letters and numbers (excluding I, O, and Q)."})}),annual_mileage:ht({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:ht({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:Or("Modifications value",9999999),cost_new_value_cents:Or("Cost new value",9999999),stated_value_amount_cents:Or("Stated Value Amount",9999999),property_damage_amount_paid_cents:Or("Property damage amount paid",9999999),personal_injury_amount_paid_cents:Or("Personal injury amount paid",9999999),auto_current_annual_premium_cents:Or("Current annual premium",9999999),auto_prior_years:uo("Years with prior auto carrier"),auto_prior_months:ht({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:uo("Years with continuous auto coverage")};function st(n){return new Date(`${n}T00:00:00Z`)}function Et(){const n=new Date;return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))}function fa(n,r){let l=r.getUTCFullYear()-n.getUTCFullYear();const o=r.getUTCMonth()-n.getUTCMonth();return(o<0||o===0&&r.getUTCDate()<n.getUTCDate())&&l--,l}const a0=[{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:n=>{const r=n.date_of_birth;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":fa(l,Et())<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:n=>{const r=n.co_applicant_date_of_birth;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":fa(l,Et())<16?"Co-applicant can't be under the age of 16.":void 0}},{targetKey:"year_roof_updated",dependsOn:["year_roof_updated","year_built"],validate:n=>{const r=Number(n.year_roof_updated),l=Number(n.year_built);if(isNaN(r))return;const o=isNaN(l)?1e3:l;if(r<o||r>n0)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:n=>{const r=n.move_in_date,l=n.year_built;if(!r||l==null)return;const o=st(String(r));if(isNaN(o.getTime()))return;const c=Number(l);if(!isNaN(c))return o.getUTCFullYear()<c?"Purchase date cannot be prior to the year the building was originally constructed.":void 0}},{targetKey:"date_first_licensed",dependsOn:["date_first_licensed"],validate:n=>{const r=n.date_first_licensed;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Date first licensed cannot be in the future.":void 0}},{targetKey:"date_first_licensed",dependsOn:["date_first_licensed","date_of_birth"],validate:n=>{const r=n.date_first_licensed,l=n.date_of_birth;if(!r||typeof r!="string"||!l||typeof l!="string")return;const o=st(l),c=st(r);if(isNaN(o.getTime())||isNaN(c.getTime()))return;if(c<o)return"Date licensed cannot be before driver date of birth.";const f=new Date(Date.UTC(o.getUTCFullYear()+18,o.getUTCMonth(),o.getUTCDate()));return c<f?"Driver can't be licensed to drive before the age of 18.":void 0}},{targetKey:"occurred_at",dependsOn:["occurred_at"],validate:n=>{const r=n.occurred_at;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Incident date cannot be in the future.":void 0}},{targetKey:"accident_prevention_course_date",dependsOn:["accident_prevention_course_date"],validate:n=>{const r=n.accident_prevention_course_date;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Course date cannot be in the future.":void 0}},{targetKey:"effective_date",dependsOn:["effective_date"],validate:n=>{const r=n.effective_date;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et(),c=new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+3,o.getUTCDate()));if(l<o)return"Insurance start date cannot be in the past.";if(l>c)return"Insurance must begin within 3 months from today."}},{targetKey:"years_at_address",dependsOn:["years_at_address","date_of_birth"],validate:n=>{const r=n.years_at_address,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.years_at_prior_address,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.home_prior_years,l=n.home_continuous_coverage_years;if(r==null||l==null)return;const o=Number(r),c=Number(l);if(!(isNaN(o)||isNaN(c)))return o>c?"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:n=>{const r=n.home_prior_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.home_continuous_coverage_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"Years with continuous home coverage cannot be greater than the Applicant's age.":void 0}},{targetKey:"move_in_date",dependsOn:["move_in_date"],validate:n=>{const r=n.move_in_date;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Purchase date cannot be in the future.":void 0}},{targetKey:"date_of_incident",dependsOn:["date_of_incident"],validate:n=>{const r=n.date_of_incident;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et();return l>o?"Loss date cannot be in the future.":void 0}},{targetKey:"home_prior_expiration_date",dependsOn:["home_prior_expiration_date"],validate:n=>{const r=n.home_prior_expiration_date;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et(),c=new Date(Date.UTC(o.getUTCFullYear()-1,o.getUTCMonth(),o.getUTCDate())),f=new Date(Date.UTC(o.getUTCFullYear()+1,o.getUTCMonth(),o.getUTCDate()));if(l<c||l>f)return"Policy expiration date must be between 1 year ago and 1 year from now."}},{targetKey:"purchase_date",dependsOn:["purchase_date"],validate:n=>{const r=n.purchase_date;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Vehicle purchase date cannot be in the future.":void 0}},{targetKey:"purchase_date",dependsOn:["purchase_date","year"],validate:n=>{const r=n.purchase_date,l=n.year;if(!r||typeof r!="string"||l==null)return;const o=st(r);if(isNaN(o.getTime()))return;const c=Number(l);if(!isNaN(c))return o.getUTCFullYear()<c?"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:n=>{const r=n.auto_prior_expiration_date;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et(),c=new Date(Date.UTC(o.getUTCFullYear()-1,o.getUTCMonth(),o.getUTCDate())),f=new Date(Date.UTC(o.getUTCFullYear()+1,o.getUTCMonth(),o.getUTCDate()));if(l<c||l>f)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:n=>{const r=n.auto_prior_years,l=n.auto_continuous_coverage_years;if(r==null||l==null)return;const o=Number(r),c=Number(l);if(!(isNaN(o)||isNaN(c)))return o>c?"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:n=>{const r=n.auto_prior_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.auto_continuous_coverage_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.vehicle_coll_deductible,l=n.vehicle_comp_deductible;if(!(!r||typeof r!="string"||!l||typeof l!="string")&&l==="NoCoverage"&&r!=="NoCoverage")return"Collision Coverage cannot be chosen if Comprehensive is No Coverage."}},{targetKey:"policy_um",dependsOn:["policy_um","policy_bi"],validate:n=>{const r=n.policy_um,l=n.policy_bi;if(!r||typeof r!="string"||!l||typeof l!="string"||r==="Reject"||l==="Dontknow")return;const o=y=>y.endsWith("CSL"),c=o(r),f=o(l);if(c&&!f)return"A Combined Single Limit cannot be selected for Uninsured/Underinsured Motorist unless a Combined Single Limit has also been selected for Liability.";const m={cov30to60:30,cov50to100:50,cov100to100:100,cov100to300:100,cov250to500:250,cov300to300:300,cov500to500:500,cov100CSL:100,cov300CSL:300,cov500CSL:500},_=m[r],p=m[l];if(_!=null&&p!=null&&_>p)return"Uninsured/Underinsured Motorist Limit value cannot be greater than Bodily Injury Limit value."}},{targetKey:"policy_umpd",dependsOn:["policy_umpd","policy_pd"],validate:n=>{const r=n.policy_umpd,l=n.policy_pd;if(!r||typeof r!="string"||!l||typeof l!="string"||r==="NoCoverage"||l==="Dontknow")return;const o=m=>{if(!m.startsWith("cov"))return null;const _=parseInt(m.replace("cov",""),10);return isNaN(_)?null:_},c=o(r),f=o(l);if(c!=null&&f!=null&&c>f)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:n=>{const r=n.custom_equipment_value_cents,l=n.stated_value_amount_cents;if(r==null||l==null)return;const o=Number(r),c=Number(l);if(!(isNaN(o)||isNaN(c))&&c>0&&o>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 ic(n,r){const l=IA[n];if(!l)return;const o=l.safeParse(r);return o.success?void 0:o.error.issues[0].message}function P_(n){if(/\s/.test(n))return!1;const r=n.trim();return r.length===17&&/^[A-HJ-NPR-Z0-9]{17}$/i.test(r)}function ZA(n,r){const l={};for(const o of a0){if(r?.has(o.targetKey))continue;const c=o.validate(n);c&&(l[o.targetKey]=c)}return l}function lc(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function mo(n,r){return n.key??`${lc(n.question)}-${r}`}function _a(n,r){return r==="number"?n==null||typeof n=="string"&&n.trim()==="":r==="checkbox"?n!==!0:n==null||typeof n=="string"&&n.trim()===""}function Ao(n,r){const l={};n.forEach((f,m)=>{const _=mo(f,m),p=r[_];if(f.required&&_a(p,f.inputType)){l[_]="Required";return}if(!_a(p,f.inputType)){const y=ic(_,p);if(y){l[_]=y;return}}});const o=new Set(Object.keys(l).filter(f=>l[f])),c=ZA(r,o);for(const[f,m]of Object.entries(c))l[f]=m;return l}function GA(n){if(n===""||n===null||n===void 0)return;const r=Number(n);return Number.isNaN(r)?void 0:r}const FA=new Set(["Home","HomeConstruction","HomeFeatures"]),YA=new Set(["HomePolicy","BundlePolicy"]),qA=new Set(["HomeCustomer","BundleCustomer"]);function Sc(n,r){return n==="has_health_insurance_auto_accident"?r!=="BundleCustomer":n==="household_size"?!(r&&FA.has(r)):n==="number_of_mortgagees"?!(r&&YA.has(r)):(n==="has_co_applicant"||n==="co_applicant_middle_name"||n==="co_applicant_relationship")&&r&&qA.has(r)?!1:n==="multi_policy_discount"&&r==="HomePolicy"?!0:VA.has(n)}const VA=new Set(["anti_theft_type","passive_restraint_type","anti_lock_brakes","daytime_running_lights","vehicle_full_glass","vehicle_loan_lease","percent_to_work","stated_value_amount_cents","vehicle_comp_deductible","vehicle_coll_deductible","vehicle_towing_and_labor","vehicle_transportation_expense","accident_prevention_course","driver_accidents","driver_violations","losses","middle_name","ssn_display","has_health_insurance_auto_accident","auto_current_annual_premium_cents","has_co_applicant","co_applicant_middle_name","co_applicant_relationship","tort_threshold","pip_coverage_type","extended_medical","additional_pip","policy_pip_deductible","is_corporation"]),PA={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"},QA={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},KA={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"},XA={Business:"Business",Pleasure:"Pleasure",Farming:"Farming",To_FromWork:"To/From Work",To_FromSchool:"To/From School"},WA={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"},JA={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"},e1={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"},t1={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"},n1={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},a1={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"},r1={cov25000:"25,000",cov35000:"35,000",cov50000:"50,000",cov100000:"100,000",cov200000:"200,000",cov250000:"250,000",cov300000:"300,000",cov500000:"500,000"},i1={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"},l1={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},oc={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",Thousand:"1,000",TwoThousand:"2,000"},r0={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},i0={NoCoverage:"No Coverage",cov20to600:"20/600",cov25to750:"25/750",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500"},l0={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"},o1={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"},u1={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)"},s1={OwnerPrimary:"Owner Primary",OwnerSecondary:"Owner Secondary",OwnerSeasonal:"Owner Seasonal"},c1={Basic:"Basic",Modest:"Modest",Average:"Average",AboveAverage:"Above Average",Expensive:"Expensive",VeryExpensive:"Very Expensive",Opulent:"Opulent"},f1={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"},d1={Slab:"Slab",Basement:"Basement",CrawlSpace:"Crawl Space",PartialBasement:"Partial Basement",PiersPostsPiles:"Piers / Posts / Piles",Open:"Open"},m1={NotOverWater:"No",PartiallyOverWater:"Partially Over Water",FullyOrEntirelyOverWater:"Fully or Entirely Over Water"},_1={One:"1",OneHalf:"1.5",Two:"2",TwoHalf:"2.5",Three:"3",ThreeHalf:"3.5",Four:"4",BiLevel:"Bi-Level",TriLevel:"Tri-Level"},h1={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"},p1={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"},y1={B_Gable:"Gable",C_Hip:"Hip",A_Flat:"Flat",D_Other:"Other"},g1={NotUpdated:"Not Updated",PartialUpdate:"Partial Update",CompleteUpdate:"Complete Update"},v1={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"},b1={AboveGround:"Above Ground",BelowGround:"Below Ground"},S1={Basement:"Below Grade Basement",SplitLevelBasement:"Split Level Basement",WalkoutBasement:"Walkout Basement"},A1={EntirelyCopper:"Entirely Copper",EntirelyGalvanized:"Entirely Galvanized",EntirelyPEX:"Entirely PEX",EntirelyPVC:"Entirely PVC",Polybutylene:"Polybutylene"},E1={TwentyFive:"$25,000",Fifty:"$50,000",OneHundred:"$100,000",TwoHundred:"$200,000",ThreeHundred:"$300,000",FourHundred:"$400,000",FiveHundred:"$500,000"},T1={cov1000:"$1,000",cov2000:"$2,000",cov3000:"$3,000",cov4000:"$4,000",cov5000:"$5,000"},C1={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%"},O1={None:"None",OnePercent:"1%",TwoPercent:"2%",FivePercent:"5%",TenPercent:"10%"},M1={_0_500ft:"0-500 Feet",_501_1000ft:"501-1000 Feet",_1001ftAndGreater:"1001 Feet And Greater"},N1={Lessthan5miles:"Less Than 5 Miles",Over5miles:"Over 5 Miles",NotAvailable:"Not Available"},Q_={"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"},K_={Single:"Single",Married:"Married",Seperated:"Separated",Divorced:"Divorced",Widowed:"Widowed",DomesticPartner:"Domestic Partner"},X_={Female:"Female",Male:"Male"},o0={"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"},D1={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"},R1={Verbal_Threshold:"Limited right to sue",Zero_Threshold:"Unlimited right to sue",Full:"Full",Limited:"Limited"},w1={Primary:"Primary",Secondary:"Secondary"},x1={cov1000:"$1,000",cov10000:"$10,000"},L1={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"},z1={cov250:"$250",cov500:"$500",cov1000:"$1,000",cov2000:"$2,000",cov2500:"$2,500"},B1={"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"]},k1={"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"},W_=B1,u0=k1;function Ac(n,r){if(typeof n!="string")return n;const l=n.trim();if(!l)return n;if(r[l])return l;const o=l.toLowerCase();return Object.keys(r).find(f=>f.toLowerCase()===o||r[f]?.toLowerCase()===o)??n}function Eo(n){return Ac(n,o0)}function s0(n){return Ac(n,l0)}function c0(n){return Ac(n,u0)}function U1(n){return n.trim().toLowerCase()}function J_(n){if(typeof n!="string")return null;const r=n.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!r)return null;const l=Number(r[1]),o=Number(r[2]),c=Number(r[3]);if(!Number.isFinite(l)||!Number.isFinite(o)||!Number.isFinite(c)||o<1||o>12||c<1||c>31)return null;const f=new Date(Date.UTC(l,o-1,c));return f.getUTCFullYear()!==l||f.getUTCMonth()!==o-1||f.getUTCDate()!==c?null:f.getTime()}function Rr(n,r){if(!r.effectiveDateKey||!r.expirationDateKey)return!1;const l=J_(n[r.expirationDateKey]),o=J_(n[r.effectiveDateKey]);return l==null||o==null?!1:l<o}const j1=new Set(["HomePolicy","BundlePolicy"]);function _o(n,r,l){return String(n.key??"")!=="lapse_in_coverage"||!l||!j1.has(l)?!0:r.home_prior_carrier_name!=="NoPriorInsurance"}function Ec(n){let r=null,l=null,o=null;const c=new Set,f=new Set,m=p=>{const y=String(p.key??""),b=U1(String(p.question??""));!r&&(y==="auto_prior_carrier_name"||y==="home_prior_carrier_name"||b.includes("current auto insurance company"))&&(r=y),!l&&(y==="effective_date"||b.includes("when do you need your insurance to begin"))&&(l=y),!o&&(y==="auto_prior_expiration_date"||y==="home_prior_expiration_date"||b.includes("when does the current policy expire"))&&(o=y),(y==="auto_reason_for_no_insurance"||b.includes("reason you are not currently insured")||b.includes("reason for lapse in coverage"))&&c.add(y),(y==="auto_prior_years"||y==="auto_prior_months"||y==="auto_continuous_coverage_years"||y==="auto_prior_expiration_date"||y==="auto_current_annual_premium_cents"||y==="auto_prior_liability_limit")&&f.add(y)};n.forEach(m);const _=p=>{p.forEach(y=>{(y.conditionals??[]).forEach(b=>{const w=b.conditionalQuestions??[];w.forEach(m),_(w)})})};return _(n),{currentCarrierKey:r,effectiveDateKey:l,expirationDateKey:o,noInsuranceReasonKeys:c,hideWhenNoPriorInsuranceKeys:f}}function Yi(n,r){return r.currentCarrierKey==="home_prior_carrier_name"&&n.home_prior_carrier_name==="NoPriorInsurance"&&n.auto_prior_carrier_name!=="NoPriorInsurance"?!1:(r.currentCarrierKey?n[r.currentCarrierKey]:void 0)==="NoPriorInsurance"?!0:!r.effectiveDateKey||!r.expirationDateKey||r.expirationDateKey==="home_prior_expiration_date"&&Rr(n,r)?!1:Rr(n,r)}function ho(n,r,l){const o=String(n.key??"");if(l.noInsuranceReasonKeys.has(o)&&l.currentCarrierKey==="home_prior_carrier_name"&&r.home_prior_carrier_name==="NoPriorInsurance"&&r.auto_prior_carrier_name!=="NoPriorInsurance")return!1;const f=(l.currentCarrierKey?r[l.currentCarrierKey]:void 0)==="NoPriorInsurance";return f&&l.hideWhenNoPriorInsuranceKeys.has(o)?!1:!l.noInsuranceReasonKeys.has(o)||f?!0:Yi(r,l)}function To(n,r){const l=String(n.key??"");return r.noInsuranceReasonKeys.has(l)}const H1=["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"],Tc="credify_quote_id",Cc="credify_auth_token";function $1(n){try{localStorage.setItem(Tc,n)}catch(r){console.error("Failed to save quoteId to localStorage:",r)}}function I1(){try{return localStorage.getItem(Tc)}catch(n){return console.error("Failed to load quoteId from localStorage:",n),null}}function f0(){try{localStorage.removeItem(Tc)}catch(n){console.error("Failed to clear quoteId from localStorage:",n)}}function Z1(n){try{localStorage.setItem(Cc,n)}catch(r){console.error("Failed to save authToken to localStorage:",r)}}function G1(){try{return localStorage.getItem(Cc)}catch(n){return console.error("Failed to load authToken from localStorage:",n),null}}function d0(){try{localStorage.removeItem(Cc)}catch(n){console.error("Failed to clear authToken from localStorage:",n)}}function F1(){f0(),d0()}const pn="https://api.getcredify.com";let xr=null;function Y1(n){xr=n,Z1(n)}function po(){return xr}function uc(){const n=G1();n&&(xr=n)}function m0(){xr=null,d0()}async function yn(n,r){const l={"Content-Type":"application/json"};xr&&(l.Authorization=`Bearer ${xr}`);const o=await fetch(n,{method:"POST",headers:l,body:JSON.stringify(r)});if(!o.ok){let c=`Request failed with status ${o.status}`;try{c=(await o.json()).error||c}catch{c=o.statusText||c}const f=new Error(c);throw f.statusCode=o.status,f}return o}async function q1(n){try{return await n.json()}catch{return{}}}async function V1(n,r){const l=r?{stage:n,quoteId:r}:{stage:n};return await(await yn(`${pn}/get-questions-by-stage`,l)).json()}async function so(n){const r=n?{quoteId:n}:{};return await(await yn(`${pn}/get-stages-for-quote`,r)).json()}async function P1(n){const l=await(await yn(`${pn}/create-quote`,{phone:n})).json();if(!l||typeof l!="object"||!l.quoteId)throw new Error(`Invalid createQuote response: ${JSON.stringify(l)}`);return l}async function Ui(n,r,l){const o={payload:n,getRates:r};l&&typeof l=="string"&&l.trim()!==""&&(o.quoteId=l);const c=await yn(`${pn}/update-quote`,o);return await q1(c)}async function Q1(n,r){return await(await yn(`${pn}/verify-quote`,{quoteId:n,smsCode:r})).json()}async function K1(n){return await(await yn(`${pn}/is-supported-state`,{state:n})).json()}async function X1(){return await(await yn(`${pn}/get-rates`,{})).json()}async function eh(n){const r=n?{quoteId:n}:{};return await(await yn(`${pn}/get-quote`,r)).json()}async function th(n){return(await yn(`${pn}/get-vehicle-options`,n)).json()}async function W1(n){return(await yn(`${pn}/get-vehicle-options`,{...n,action:"vinDecode"})).json()}async function J1(n){const l=await(await yn(`${pn}/request-bind`,{quoteRateId:n})).json();return l&&typeof l=="object"&&"success"in l?l:{success:!0}}const eE=["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible"],No=new Set([...eE,"is_corporation"]);pA({additional_pip:Mr(["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:Mr(["Verbal_Threshold","Zero_Threshold","Full","Limited"]),pip_coverage_type:Mr(["Primary","Secondary"]),extended_medical:Mr(["cov1000","cov10000"]),policy_pip_deductible:Mr(["cov250","cov500","cov1000","cov2000","cov2500"]),has_health_insurance_auto_accident:sA().nullable().optional()}).superRefine((n,r)=>{n.pip_coverage_type==="Secondary"&&n.has_health_insurance_auto_accident!==!0&&r.addIssue({code:rc.custom,path:["pip_coverage_type"],message:"Secondary PIP coverage requires health insurance that covers auto accidents."})});const Ks=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),tE={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"},nh={auto_prior_carrier_name:PA,auto_prior_liability_limit:WA,auto_reason_for_no_insurance:JA,residence_type:QA,home_prior_carrier_name:KA,policy_bi:e1,policy_um:t1,policy_pd:n1,policy_mp:a1,policy_umpd:r1,policy_pip:i1,policy_auto_death_indemnity:l1,vehicle_comp_deductible:oc,vehicle_coll_deductible:oc,vehicle_towing_and_labor:r0,vehicle_transportation_expense:i0,education_level:l0,industry:o0,occupation:u0,usage:XA,architectural_style:o1,dwelling_type:u1,occupancy_type:s1,construction_quality:c1,construction_type:f1,foundation_type:d1,located_over_water:m1,number_of_stories:_1,exterior_wall_type:h1,roof_material_type:p1,roof_shape:y1,roof_updated_type:g1,heating_type:v1,oil_tank_location:b1,basement_type:S1,plumbing_type:A1,personal_liability:E1,dwelling_medical_payments:T1,all_perils_deductible:C1,windstorm_deductible:O1,distance_from_fire_hydrant_ft:M1,distance_from_fire_station_miles:N1,employment_industry:Q_,marital_status:K_,gender:X_,co_applicant_employment_industry:Q_,co_applicant_marital_status:K_,co_applicant_gender:X_,description:D1,tort_threshold:R1,pip_coverage_type:w1,extended_medical:x1,additional_pip:L1,policy_pip_deductible:z1},nE=["OTHER / NOT LISTED"],aE=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],rE=["Other"];function Kt(n){const r=n.getUTCFullYear(),l=String(n.getUTCMonth()+1).padStart(2,"0"),o=String(n.getUTCDate()).padStart(2,"0");return`${r}-${l}-${o}`}function ah(n){const r=n.replace(/\D+/g,"");if(r!=="")return GA(r)}function iE(n){return n==="-"||n==="+"||n==="."||n==="e"||n==="E"}const lE={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},rh=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"]),oE=new Set(["total_area_sq_ft","annual_mileage","miles_to_work","distance_to_coast_miles"]),co={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"},uE={license_number:20};function sE(n){const r=new Date,l=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()));if(n==="effective_date"){const o=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth()+3,l.getUTCDate()));return{min:Kt(l),max:Kt(o)}}if(n==="home_prior_expiration_date"){const o=new Date(Date.UTC(l.getUTCFullYear()-1,l.getUTCMonth(),l.getUTCDate())),c=new Date(Date.UTC(l.getUTCFullYear()+1,l.getUTCMonth(),l.getUTCDate()));return{min:Kt(o),max:Kt(c)}}if(n==="date_of_incident")return{max:Kt(l)};if(n==="move_in_date")return{max:Kt(l)};if(n==="purchase_date")return{max:Kt(l)};if(n==="date_of_birth")return{max:Kt(l)};if(n==="date_first_licensed")return{max:Kt(l)};if(n==="occurred_at")return{max:Kt(l)};if(n==="accident_prevention_course_date")return{max:Kt(l)};if(n==="auto_prior_expiration_date"){const o=new Date(Date.UTC(l.getUTCFullYear()-1,l.getUTCMonth(),l.getUTCDate())),c=new Date(Date.UTC(l.getUTCFullYear()+1,l.getUTCMonth(),l.getUTCDate()));return{min:Kt(o),max:Kt(c)}}return{}}const cE=new Set(["Disabled","Retired","Unemployed","Other"]);function Xs(n,r,l){const o=String(n.key??"");if(o!=="occupation"&&o!=="co_applicant_occupation"||o==="co_applicant_occupation")return!0;const c=Rt(r,l,"industry"),f=Rt(r,l,"employment_industry"),m=String(c??f??"").trim();return!cE.has(m)}function _0(n){const r=n.state??n.State??n.state??n.State??"";if(typeof r!="string"||!r.trim())return!1;const l=r.trim().toLowerCase();return l==="nj"||l==="n.j."||l==="n.j"||l==="new jersey"}function Ws(n,r){const l=String(n.key??"");return No.has(l)?_0(r):!0}function fE(n,r){const l=String(n??""),o=No.has(l)||l==="has_health_insurance_auto_accident"||l==="is_corporation";return _0(r)&&o}function Js(n,r,l,o){return!(!Sc(n,o)||fE(n,l))}function yo(n){return n.inputType!=="radio"||!n.options||n.options.length!==1||n.options[0]!=="Yes"?!1:(n.conditionals??[]).some(l=>l.conditionalQuestionsAllowMultiple&&l.conditionalType==="equals"&&l.conditionalValue==="Yes")}function ih(n,r){return yo(n)?"Yes":r}function lh(n){return typeof n=="number"&&Number.isFinite(n)?n:typeof n=="string"&&n.trim()!==""&&!Number.isNaN(Number(n))?Number(n):null}function oh(n){if(n instanceof Date&&!Number.isNaN(n.getTime()))return n.getTime();if(typeof n=="string"){const r=Date.parse(n);return Number.isNaN(r)?null:r}return null}function uh(n,r){const l=lh(n),o=lh(r);if(l!=null&&o!=null)return l-o;const c=oh(n),f=oh(r);return c!=null&&f!=null?c-f:n==null||r==null?null:String(n).localeCompare(String(r))}function dE(n,r){return Array.isArray(n)?n.some(l=>l===r):typeof n=="string"?r!=null&&n.includes(String(r)):!1}function ji(n,r,l){switch(r){case"equals":return n===l;case"notEquals":return n!==l&&n!==""&&n!=null;case"lessThan":{const o=uh(n,l);return o!=null&&o<0}case"greaterThan":{const o=uh(n,l);return o!=null&&o>0}case"contains":return dE(n,l);case"startsWith":return n!=null&&l!=null&&String(n).startsWith(String(l));case"endsWith":return n!=null&&l!=null&&String(n).endsWith(String(l));default:return!1}}function Zi(n,r){return r.reduce((l,o)=>l?.[o],n)}function hn(n,r,l){if(r.length===0)return n;const[o,...c]=r;if(c.length===0){if(typeof o=="number"){const y=(Array.isArray(n)?n:[]).slice();return y[o]=l,y}return{...n,[o]:l}}const f=n?.[o],m=typeof c[0]=="number"?Array.isArray(f)?f:[]:f&&typeof f=="object"?f:{},_=hn(m,c,l);if(typeof o=="number"){const y=(Array.isArray(n)?n:[]).slice();return y[o]=_,y}return{...n,[o]:_}}function Rt(n,r,l){return Zi(n,[...r??[],l])}function Dt(n,r,l,o){return hn(n,[...r??[],l],o)}function mE(n,r){return n?.length?`${n.join("-")}-${r}`:r}const _E="__items",fo=n=>`${n}${_E}`;function Ht(n){return n==null?"":typeof n=="string"?n:String(n)}function sh(n){return n==null?"":typeof n=="number"&&Number.isFinite(n)||typeof n=="string"?n:""}function hE(n){return n==null?"":typeof n=="string"||typeof n=="number"?n:String(n)}function pE({questions:n,initialValues:r,controlledValues:l,onChangeValues:o,onSubmit:c,quoteId:f,widgetStageKey:m}){const _=j.useMemo(()=>mc(n),[n]),p=j.useMemo(()=>Ec(_),[_]),y=j.useMemo(()=>m==="BundlePolicy"?!0:_.some(C=>String(C.key)==="home_prior_carrier_name")&&_.some(C=>String(C.key)==="driver_vehicle_assignments"),[m,_]),b=j.useMemo(()=>{const C={};return r&&Object.assign(C,r),C},[r]),[w,B]=j.useState(b);j.useEffect(()=>{B(b)},[b]);const[z,H]=j.useState({}),k=j.useMemo(()=>({...z,...l??w}),[z,l,w]);j.useEffect(()=>{l&&H(C=>({...C,...l}))},[l]);const[oe,ue]=j.useState({}),ye=j.useRef(new Map),ne=j.useRef(new Set),[,le]=j.useState({}),[Q,pe]=j.useState({}),ee=j.useRef(!1);j.useEffect(()=>{!f||ee.current||!_.some(O=>O.key==="year"||O.key==="make"||O.key==="model"||O.key==="body_style")||(ee.current=!0,th({quoteId:f}).catch(()=>{}))},[f,_]);const[Ee,ge]=j.useState({}),[re,ae]=j.useState({}),se=j.useCallback(async(C,O)=>{if(!f||!P_(O))return;const A=C?C.join("-"):"_root";ge(U=>({...U,[A]:!0})),ae(U=>({...U,[A]:null}));try{const U=await W1({quoteId:f,vin:O});if(U.error){ae(q=>({...q,[A]:U.error}));return}let I=k;U.year&&(I=Dt(I,C,"year",String(U.year))),U.make&&(I=Dt(I,C,"make",U.make)),U.model&&(I=Dt(I,C,"model",U.model)),U.bodyStyle&&(I=Dt(I,C,"body_style",U.bodyStyle)),l&&o?o(I):B(I),H(I),ye.current.clear(),ne.current.clear(),le({})}catch{ae(U=>({...U,[A]:"VIN lookup failed — please enter vehicle details manually"}))}finally{ge(U=>({...U,[A]:!1}))}},[f,k,l,o]),Me=j.useCallback((C,O)=>{if(!f)return;const A=`${O.year}|${O.make??""}|${O.model??""}`,U=O.model?"bodyStyles":O.make?"models":"makes",I=`${C}:${U}`,q=ye.current.get(A);if(q)return q[U]??[];ne.current.has(A)||(ne.current.add(A),queueMicrotask(()=>{pe(ie=>({...ie,[I]:!0})),th({quoteId:f,...O}).then(ie=>{ye.current.set(A,ie),le(X=>({...X,[I]:ie[U]??[]}))}).catch(()=>{ye.current.set(A,{}),le(ie=>({...ie,[I]:[]}))}).finally(()=>{ne.current.delete(A),pe(ie=>({...ie,[I]:!1}))})}))},[f]);function fe(C,O,A){return{...C?Zi(k,C)??{}:k,[O]:A}}function J(C,O){const A=a0.filter(I=>I.targetKey===C||I.dependsOn.includes(C)),U={[C]:void 0};for(const I of A){const q=I.validate(O);I.targetKey in U?q!==void 0&&(U[I.targetKey]=q):U[I.targetKey]=q}ue(I=>({...I,...U}))}const v=(C,O,A)=>{const U=Rt(k,A,C);if(_a(U,O)){oe[C]&&ue(q=>({...q,[C]:void 0}));return}const I=ic(C,U);if(I){ue(q=>({...q,[C]:I}));return}J(C,fe(A,C,U))};j.useEffect(()=>{let C=k,O=!1;_.forEach(A=>{if(!yo(A))return;const U=String(A.key);Rt(C,void 0,U)!=="Yes"&&(C=Dt(C,void 0,U,"Yes"),O=!0)}),O&&(l&&o?o(C):B(C),H(C))},[_,k,l,o]);function N(C,O){const A=C.key;if((A==="relationship_to_insured"||A==="is_registered_owner")&&O){const K=O[O.length-1];if(typeof K=="number"&&K===0)return null}if((A==="purchase_date"||A==="cost_new_value_cents")&&O)return null;if(A==="custom_equipment_value_cents"&&O){const K=Rt(k,O,"vehicle_has_modifications");if(K!=="Yes"&&K!==!0)return null}const U=A==="auto_reason_for_no_insurance"&&p.currentCarrierKey?k[p.currentCarrierKey]==="NoPriorInsurance"?"Reason you are not currently insured":"Reason for lapse in coverage":C.question,I=C.hint,q=Rt(k,O,A),ie=To(C,p)?Yi(k,p):C.required,X=oe[A],ce=K=>{let P=Dt(k,O,A,K);if(C.inputType==="radio"&&C.conditionals){const W=C.conditionals??[];for(const Ce of W){const de=Rt(k,O,A),Te=ji(de,Ce.conditionalType,Ce.conditionalValue),_e=ji(K,Ce.conditionalType,Ce.conditionalValue);if(Te&&!_e&&Ce.conditionalQuestionsAllowMultiple){const ke=Ce.conditionalQuestions??[];if(ke.length>0){const De=fo(A);P=hn(P,[...O??[],De],[]);const Ie=(je,Oe)=>{je.forEach(Re=>{(Re.conditionals??[]).forEach(Ze=>{if(Ze.conditionalQuestionsAllowMultiple){const Ue=fo(Re.key);P=hn(P,[...Oe,Ue],[])}const ct=Ze.conditionalQuestions??[];ct.length>0&&Ie(ct,Oe)})})};Ie(ke,[...O??[],De])}}}}l&&o?o(P):B(P),H(P)};if(A==="vehicle_policy_selections"){const K=k.vehicles__items??[],P=k.drivers__items??[];if(K.length===0)return g.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles first to configure coverage selections."},A);const W=k.driver_vehicle_assignments??{},Ce=P.length>1,de=Oe=>Object.entries(Oe).map(([Re,nt])=>({value:Re,label:nt})),Te=de(oc),_e=de(r0),ke=de(i0),De=(Oe,Re,nt)=>{const Ze=hn(k,["vehicles__items",Oe,Re],nt);l&&o?o(Ze):B(Ze),H(Ze)},Ie=(Oe,Re,nt)=>{const Ze={...W},ct=`v${Oe}`;Ze[ct]={...Ze[ct]??{}},Ze[ct][`d${Re}`]=nt;const Ue=hn(k,["driver_vehicle_assignments"],Ze);l&&o?o(Ue):B(Ue),H(Ue)},je=Oe=>{if(!Ce)return null;const Re=W[`v${Oe}`];if(!Re)return null;const nt=P.map((Ue,Xe)=>Re[`d${Xe}`]??0),Ze=nt.filter(Ue=>Ue>0);if(Ze.length>=2&&Ze.every(Ue=>Ue===Ze[0])&&Ze[0]===50)return`Assignments for Vehicle ${Oe+1} cannot be 50 percent for both Drivers.`;const ct=nt.reduce((Ue,Xe)=>Ue+Xe,0);return ct>0&&ct!==100?`Driver percentages for this vehicle must add up to 100% (currently ${ct}%).`:null};return g.jsx("div",{children:K.map((Oe,Re)=>{const nt=[Oe.year,Oe.make,Oe.model].filter(Boolean).join(" ")||`Vehicle ${Re+1}`,Ze=je(Re),ct=Ue=>typeof Oe[Ue]=="string"?Oe[Ue]:"";return g.jsxs("fieldset",{style:{border:`1px solid ${Ze?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[g.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:nt}),g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px"},children:[g.jsx(Bi,{id:`veh-${Re}-comp`,label:"Comprehensive deductible",required:!0,placeholder:"Select...",options:Te,value:ct("vehicle_comp_deductible"),onChange:Ue=>De(Re,"vehicle_comp_deductible",Ue.currentTarget.value)}),g.jsx(Bi,{id:`veh-${Re}-coll`,label:"Collision deductible",required:!0,placeholder:"Select...",options:Te,value:ct("vehicle_coll_deductible"),onChange:Ue=>De(Re,"vehicle_coll_deductible",Ue.currentTarget.value)}),g.jsx(Bi,{id:`veh-${Re}-tow`,label:"Towing and Labor",required:!0,placeholder:"Select...",options:_e,value:ct("vehicle_towing_and_labor"),onChange:Ue=>De(Re,"vehicle_towing_and_labor",Ue.currentTarget.value)}),g.jsx(Bi,{id:`veh-${Re}-trans`,label:"Transportation expense",required:!0,placeholder:"Select...",options:ke,value:ct("vehicle_transportation_expense"),onChange:Ue=>De(Re,"vehicle_transportation_expense",Ue.currentTarget.value)})]}),Ce&&g.jsxs("div",{style:{marginTop:"16px"},children:[g.jsx("p",{style:{fontWeight:600,margin:"0 0 8px"},children:"Drivers usage (%)"}),g.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:P.map((Ue,Xe)=>{const Wt=[Ue.first_name,Ue.last_name].filter(Boolean).join(" ")||`Driver ${Xe+1}`,Ct=W[`v${Re}`]?.[`d${Xe}`];return g.jsx("div",{style:{flex:"0 0 140px"},children:g.jsx(Ys,{id:`assignment-v${Re}-d${Xe}`,label:`${Wt} %`,value:Ct??"",min:0,max:100,step:1,inputMode:"numeric",onChange:zr=>{const wt=zr.currentTarget.value.replace(/\D+/g,"");Ie(Re,Xe,wt===""?0:Math.min(100,parseInt(wt,10)))}})},`${Re}-${Xe}`)})}),Ze&&g.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:Ze})]})]},Re)})},A)}if(A==="driver_vehicle_assignments"){const K=k.vehicles__items??[],P=k.drivers__items??[];if(y&&P.length<=1)return null;if(K.length===0||P.length===0)return g.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},A);const W=k.driver_vehicle_assignments??{},Ce=(Te,_e,ke)=>{const De={...W},Ie=`v${Te}`;De[Ie]={...De[Ie]??{}},De[Ie][`d${_e}`]=ke,ce(De)},de=Te=>{if(P.length<2)return null;const _e=W[`v${Te}`];if(!_e)return null;const ke=P.map((je,Oe)=>_e[`d${Oe}`]??0),De=ke.filter(je=>je>0);if(De.length>=2&&De.every(je=>je===De[0])&&De[0]===50)return`Assignments for Vehicle ${Te+1} cannot be 50 percent for both Drivers.`;const Ie=ke.reduce((je,Oe)=>je+Oe,0);return Ie>0&&Ie!==100?`Driver percentages for this vehicle must add up to 100% (currently ${Ie}%).`:null};return g.jsxs("div",{children:[g.jsx("h4",{style:{marginBottom:"12px"},children:U}),K.map((Te,_e)=>{const ke=[Te.year,Te.make,Te.model].filter(Boolean).join(" ")||`Vehicle ${_e+1}`,De=de(_e);return g.jsxs("fieldset",{style:{border:`1px solid ${De?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[g.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:ke}),g.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:P.map((Ie,je)=>{const Oe=[Ie.first_name,Ie.last_name].filter(Boolean).join(" ")||`Driver ${je+1}`,Re=W[`v${_e}`]?.[`d${je}`];return g.jsx("div",{style:{flex:"0 0 140px"},children:g.jsx(Ys,{id:`assignment-v${_e}-d${je}`,label:`${Oe} %`,value:Re??"",min:0,max:100,step:1,inputMode:"numeric",onChange:nt=>{const Ze=nt.currentTarget.value.replace(/\D+/g,"");Ce(_e,je,Ze===""?0:Math.min(100,parseInt(Ze,10)))}})},`${_e}-${je}`)})}),De&&g.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:De})]},_e)})]},A)}switch(C.inputType){case"text":{if(A==="vin"&&f){const K=O?O.join("-"):"_root",P=Ee[K]??!1,W=re[K]??null,Ce=[I?`${A}-hint`:null,X?`${A}-error`:null,W?`${A}-vin-error`:null].filter(Boolean).join(" ");return g.jsxs("div",{children:[g.jsx(Xt,{id:A,label:U,hint:I,error:X,required:ie,children:g.jsxs("div",{className:"flex items-end gap-2",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsx("input",{id:A,className:`form-input ${X?"input-error":""}`,"aria-invalid":!!X,"aria-describedby":Ce||void 0,"aria-required":ie||void 0,required:ie,value:Ht(q),maxLength:17,onChange:de=>ce(de.currentTarget.value),onBlur:()=>v(A,"text",O),autoComplete:co[A],type:"text"})}),g.jsx("button",{type:"button",disabled:P||!P_(Ht(q)),className:"btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",onClick:()=>se(O,Ht(q)),children:P?"Looking up...":"Verify VIN"})]})}),W&&g.jsx("p",{id:`${A}-vin-error`,className:"text-sm text-red-600 mt-1",children:W})]},A)}if(A==="sms_code"){const K=Ht(q);return g.jsx(Fs,{id:A,label:U,hint:I,value:K,inputMode:"numeric",pattern:"[0-9]*",maxLength:6,onChange:P=>{const W=P.currentTarget.value.replace(/\D+/g,"").slice(0,6);ce(W)},onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X,autoComplete:co[A]},A)}return A==="license_number"?g.jsx(Fs,{id:A,label:U,hint:I,value:Ht(q),onChange:K=>ce(K.currentTarget.value.replace(/[^A-Z0-9]/gi,"").slice(0,20)),onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X,autoComplete:"off",maxLength:20},A):A==="social_security_number"?g.jsx(Fy,{id:A,label:U,hint:I,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X},A):g.jsx(Fs,{id:A,label:U,hint:I,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X,autoComplete:co[A],maxLength:uE[A]},A)}case"email":return g.jsx(Yy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"email",O),"aria-required":ie||void 0,error:X},A);case"password":return g.jsx(Py,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"password",O),"aria-required":ie||void 0,error:X},A);case"tel":return g.jsxs(g.Fragment,{children:[g.jsx(qy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"tel",O),"aria-required":ie||void 0,error:X},A),A==="phone"&&g.jsxs("div",{className:"mt-3 text-xs text-slate-600 space-y-1",children:[g.jsx("p",{children:"By entering your phone number, you agree to receive a one-time SMS from Credify Insurance with a verification code."}),g.jsx("p",{children:"Message & data rates may apply. One message per request."}),g.jsxs("p",{children:["See our"," ",g.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","and"," ",g.jsx("a",{href:"https://getcredify.com",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Terms of Service"}),"."]})]})]});case"url":return g.jsx(Vy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"url",O),"aria-required":ie||void 0,error:X},A);case"number":{const K=lE[A];return rh.has(A)||oE.has(A)?g.jsx(Gy,{id:A,label:U,hint:I,value:sh(q),isCurrency:rh.has(A),maxDigits:K,onChange:P=>ce(ah(P.currentTarget.value)),onBlur:()=>v(A,"number",O),"aria-required":ie||void 0,error:X},A):g.jsx(Ys,{id:A,label:U,hint:I,value:sh(q),inputMode:"numeric",pattern:"[0-9]*",onKeyDown:P=>{if(iE(P.key)){P.preventDefault();return}K!==void 0&&/^\d$/.test(P.key)&&String(P.currentTarget.value).replace(/\D/g,"").length>=K&&P.preventDefault()},onChange:P=>{let W=P.currentTarget.value;K!==void 0&&(W=W.slice(0,K)),ce(ah(W))},onBlur:()=>v(A,"number",O),"aria-required":ie||void 0,error:X},A)}case"textarea":return g.jsx(Qy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"textarea",O),"aria-required":ie||void 0,error:X,rows:4},A);case"date":{const{min:K,max:P}=sE(A);return g.jsx(Ky,{id:A,label:U,hint:I,value:Ht(q),min:K,max:P,onChange:W=>{const Ce=W.currentTarget.value;ce(Ce),!_a(Ce,"date")&&!ic(A,Ce)&&J(A,fe(O,A,Ce))},onBlur:()=>v(A,"date",O),"aria-required":ie||void 0,error:X,autoComplete:co[A]},A)}case"checkbox":{if(C.options){const K=Array.isArray(q)?q:[];return g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"form-label",children:[U,ie&&g.jsx("span",{className:"text-red-600 ml-1",children:"*"})]}),g.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:C.options.map(P=>{const W=`${A}-${lc(P)}`,Ce=K.includes(P);return g.jsx(T_,{id:W,label:P,checked:Ce,onChange:de=>{const Te=new Set(K);de.currentTarget.checked?Te.add(P):Te.delete(P),ce(Array.from(Te))},"aria-required":ie||void 0},W)})}),X&&g.jsx("p",{className:"mt-1 text-sm text-red-600",children:X})]},A)}return g.jsx(T_,{id:A,label:ie?`${U} *`:U,checked:!!q,onChange:K=>ce(K.currentTarget.checked),"aria-required":ie||void 0},A)}case"radio":{if(yo(C))return null;const K=C.options??[],P=O&&O.length>0?`${A}__${O.join("__")}`:A;return g.jsx(Wy,{legend:U,legendClassName:ie?"legend-required":void 0,children:K.map(W=>g.jsx(Xy,{name:P,value:W,checked:q===W,onChange:()=>{ce(W),J(A,fe(O,A,W))},children:nh[A]?.[W]??W},`${A}-${lc(W)}`))},A)}case"select":{let K=C.options??[];A==="quote_vehicle_id"&&(K=l?.vehicles__items?.map(de=>de.vin)??[]);let P=!1,W;if(A==="make"||A==="model"||A==="body_style"){const de=O?O.join("-"):"_root",Te=Rt(k,O,"year"),_e=typeof Te=="number"?Te:Number(Te);if(A==="make"){const ke=`${de}:makes`;if(!_e||!Number.isFinite(_e))P=!0,W="Select a year first";else{const De=Me(de,{year:_e});De&&De.length>0?K=De:Q[ke]?(P=!0,W="Loading makes..."):K=[...H1]}}else if(A==="model"){const ke=`${de}:models`,De=String(Rt(k,O,"make")??"");if(!De)P=!0,W="Select a make first";else if(_e&&Number.isFinite(_e)){const Ie=Me(de,{year:_e,make:De});Ie&&Ie.length>0?K=Ie:Q[ke]?(P=!0,W="Loading models..."):K=[...nE]}typeof q=="string"&&q&&!K.includes(q)&&(K=[q,...K])}else{const ke=`${de}:bodyStyles`,De=String(Rt(k,O,"make")??""),Ie=String(Rt(k,O,"model")??"");if(!Ie)P=!0,W="Select a model first";else if(_e&&Number.isFinite(_e)&&De){const je=Me(de,{year:_e,make:De,model:Ie});je&&je.length>0?K=je:Q[ke]?(P=!0,W="Loading body styles..."):K=[...aE]}typeof q=="string"&&q&&!K.includes(q)&&(K=[q,...K])}}if(A==="occupation"||A==="co_applicant_occupation"){const de=A==="co_applicant_occupation"?"co_applicant_employment_industry":void 0,Te=de?void 0:Rt(k,O,"industry"),_e=Rt(k,O,de??"employment_industry"),De=String(Eo(Te??_e)??"").trim();K=[...W_[De]??rE],typeof q=="string"&&q&&!K.includes(q)&&(K=[q,...K])}const Ce=mE(O,A);return g.jsx(Bi,{id:Ce,label:W?`${U} — ${W}`:U,"aria-required":ie||void 0,error:X,disabled:P,value:hE(q),onChange:de=>{const Te=de.currentTarget.value;if(A!=="year"&&A!=="make"&&A!=="model"&&A!=="industry"&&A!=="employment_industry"&&A!=="co_applicant_employment_industry"){ce(Te),J(A,fe(O,A,Te));return}let _e=Dt(k,O,A,Te);if(A==="year")_e=Dt(_e,O,"make",""),_e=Dt(_e,O,"model",""),_e=Dt(_e,O,"body_style","");else if(A==="make")_e=Dt(_e,O,"model",""),_e=Dt(_e,O,"body_style","");else if(A==="model")_e=Dt(_e,O,"body_style","");else if(A==="industry"||A==="employment_industry")_e=Dt(_e,O,"occupation","");else if(A==="co_applicant_employment_industry"){const De=String(Eo(Te)??"").trim(),Ie=W_[De]??[],je=Ie.find(Oe=>Oe===De)??Ie[0]??"";_e=Dt(_e,O,"co_applicant_occupation",je??"")}l&&o?o(_e):B(_e),H(_e);const ke=O?Zi(_e,O)??{}:_e;J(A,{...ke,[A]:Te})},placeholder:W??"Select an option",options:K.map(de=>({value:de,label:nh[A]?.[de]??tE[de]??de}))},Ce)}case"address":return g.jsx(ng,{id:A,label:U,value:Ht(q),onChange:(K,P)=>{let W=Dt(k,O,A,K);const Ce=P?.state??(typeof K=="string"?K.match(/,\s*([A-Z]{2})\s+\d{5}\b/)?.[1]:void 0);if(Ce){const de=O?[...O,"state"]:["state"];W=hn(W,de,Ce)}l&&o?o(W):B(W),H(W)},onBlur:()=>v(A,"address",O),required:ie,"aria-required":ie||void 0,error:X},A);default:return null}}function F(C,O){return C.map((A,U)=>{const I=String(A.key);if(!ho(A,k,p)||!Xs(A,k,O)||!Ws(A,k)||!_o(A,k,m))return null;if(Js(I,A,k,m)){const P=p.currentCarrierKey?k[p.currentCarrierKey]:void 0;if(!(P&&P!=="NoPriorInsurance"&&Rr(k,p)&&Ks.has(I)))return null}const q=N(A,O),ie=A.conditionals??[];if(!ie.length)return m==="BundlePolicy"&&I==="policy_bi"?g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold mt-6 mb-3",children:"Vehicle Coverage Information"}),q]},`wrap-${I}-${U}`):g.jsx("div",{children:q},`wrap-${I}-${U}`);const X=ih(A,Rt(k,O,I)),ce=ie.filter(P=>ji(X,P.conditionalType,P.conditionalValue)),K=ce.length>1&&!ce.some(P=>P.conditionalQuestionsAllowMultiple)?ce.slice(0,1):ce;return g.jsxs("div",{children:[q,K.map((P,W)=>{const Ce=P.conditionalQuestions??[];if(!Ce.length)return null;if(!P.conditionalQuestionsAllowMultiple)return g.jsx("div",{className:"mt-3",children:F(Ce,O)},`branch-${I}-${W}`);const de=fo(I),Te=Zi(k,[...O??[],de])??[],_e=Math.max(1,Te.length||1),ke=()=>{const je=hn(k,[...O??[],de,Te.length],{});l&&o?o(je):B(je),H(je)},De=()=>{const je=Te.slice(0,Math.max(0,Te.length-1)),Oe=hn(k,[...O??[],de],je);l&&o?o(Oe):B(Oe),H(Oe)},Ie=`${I}__c${W}`;return g.jsxs("div",{className:"mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),g.jsxs("div",{className:"space-x-2",children:[g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:ke,children:"Add another"}),_e>1&&g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:De,children:"Remove last"})]})]}),Array.from({length:_e}).map((je,Oe)=>{const Re=[...O??[],de,Oe],nt=`${Ie}__i${Oe}`,Ze=Te[Oe]??{},ct=I==="drivers",Wt=ct?`Driver #${Oe+1}`:I==="vehicles"?`Vehicle #${Oe+1}`:I==="home_losses"||I==="losses"?`Loss #${Oe+1}`:`Entry #${Oe+1}`,zr=ct&&typeof Ze.ssn_display=="string"&&Ze.ssn_display?` — ${Ze.ssn_display}`:"";return g.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[g.jsxs("div",{className:"text-sm font-semibold mb-2",children:[Wt,zr]}),Ce.map(wt=>{const Br=String(wt.key);if(!ho(wt,k,p)||!Xs(wt,k,Re)||!Ws(wt,k)||!_o(wt,k,m))return null;if(Js(Br,wt,k,m)){const gn=p.currentCarrierKey?k[p.currentCarrierKey]:void 0;if(!(gn&&gn!=="NoPriorInsurance"&&Rr(k,p)&&Ks.has(Br)))return null}return g.jsxs("div",{className:"mt-3",children:[N(wt,Re),(()=>{const gn=wt.conditionals??[];if(!gn.length)return null;const ya=Rt(k,Re,wt.key),Jt=gn.filter(Zt=>ji(ya,Zt.conditionalType,Zt.conditionalValue));return(Jt.length>1&&!Jt.some(Zt=>Zt.conditionalQuestionsAllowMultiple)?Jt.slice(0,1):Jt).map((Zt,Ur)=>{const $a=Zt.conditionalQuestions??[];if(!$a.length)return null;if(!Zt.conditionalQuestionsAllowMultiple)return g.jsx("div",{className:"mt-3",children:F($a,Re)},`nested-${nt}-${Ur}`);const ga=fo(wt.key),$n=Zi(k,[...Re,ga])??[],In=Math.max(1,$n.length||1),Do=()=>{const Tn=hn(k,[...Re,ga,$n.length],{});l&&o?o(Tn):B(Tn),H(Tn)},qi=()=>{const Tn=$n.slice(0,Math.max(0,$n.length-1)),fn=hn(k,[...Re,ga],Tn);l&&o?o(fn):B(fn),H(fn)};return g.jsxs("div",{className:"mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),g.jsxs("div",{className:"space-x-2",children:[g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Do,children:"Add another"}),In>1&&g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:qi,children:"Remove last"})]})]}),Array.from({length:In}).map((Tn,fn)=>{const jr=[...Re,ga,fn];return g.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[g.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",fn+1]}),F($a,jr)]},`nested-item-${nt}-${Ur}-${fn}`)})]},`nested-repeat-${nt}-${Ur}`)})})()]},`${nt}-${Br}`)})]},`group-${nt}`)})]},`branch-${I}-${W}`)})]},`wrap-${I}-${U}`)})}const V=j.useMemo(()=>{const C=[],O=(A,U)=>{A.forEach(I=>{if(!ho(I,k,p)||!Xs(I,k,U)||!Ws(I,k)||!_o(I,k,m))return;const q=String(I.key);if(Js(q,I,k,m)){const P=p.currentCarrierKey?k[p.currentCarrierKey]:void 0;if(!(P&&P!=="NoPriorInsurance"&&Rr(k,p)&&Ks.has(q)))return}yo(I)||C.push(I);const ie=I.conditionals??[];if(!ie.length)return;const X=ih(I,Rt(k,U,q)),ce=ie.filter(P=>ji(X,P.conditionalType,P.conditionalValue));(ce.length>1&&!ce.some(P=>P.conditionalQuestionsAllowMultiple)?ce.slice(0,1):ce).forEach(P=>{const W=P.conditionalQuestions??[];W.length&&(P.conditionalQuestionsAllowMultiple||O(W,U))})})};return O(_),C},[_,k,p,m]);function S(C){C.preventDefault();const O=Yi(k,p),A=V.map(I=>To(I,p)?{...I,required:O}:I),U=Ao(A,k);if(ue(U),Object.keys(U).length>0){const I=V.findIndex(q=>U[q.key]);I>=0&&document.getElementById(V[I].key)?.focus();return}c(k)}return g.jsx("form",{className:"space-y-6 px-1",onSubmit:S,noValidate:!0,children:F(_)})}const yE="GTM-NK8LGHTQ";function gE(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function Ha(n,r={}){gE().push({event:n,credifyWidget:{...r,containerId:yE}})}function vE(){Ha("credify_widget_opened")}function ch(){Ha("credify_widget_closed")}function bE(n){Ha("credify_widget_stage_viewed",n)}function fh(n){Ha("credify_widget_stage_completed",n)}function SE(){Ha("credify_widget_flow_completed")}function AE(n){Ha("credify_widget_rates_viewed",n??{})}function EE(){Ha("credify_widget_rates_back")}function TE(n,r){const l=String(n.key??"");if(!No.has(l))return!0;const o=r.state??r.State??r.state??r.State??"";if(typeof o!="string"||!o.trim())return!1;const c=o.trim().toLowerCase();return c==="nj"||c==="n.j."||c==="n.j"||c==="new jersey"}function CE(n){const r=n.state??n.State??n.state??n.State??"";if(typeof r!="string"||!r.trim())return!1;const l=r.trim().toLowerCase();return l==="nj"||l==="n.j."||l==="n.j"||l==="new jersey"}function OE(n,r){const l=String(n??""),o=No.has(l)||l==="has_health_insurance_auto_accident"||l==="is_corporation";return CE(r)&&o}const h0=new Set(["Disabled","Retired","Unemployed","Other"]);function ME(n,r){const l=String(n.key??"");if(l==="co_applicant_occupation"||l!=="occupation")return!0;const o=r.industry,c=r.employment_industry,f=String(o??c??"").trim();return!h0.has(f)}function NE(n,r){const l=String(n.key??"");if(l==="co_applicant_occupation"||l!=="occupation")return!0;const o=r.industry,c=r.employment_industry,f=String(o??c??"").trim();return!h0.has(f)}function p0(n){return n.inputType!=="radio"||!n.options||n.options.length!==1||n.options[0]!=="Yes"?!1:(n.conditionals??[]).some(l=>l.conditionalQuestionsAllowMultiple&&l.conditionalType==="equals"&&l.conditionalValue==="Yes")}function y0(n,r){return p0(n)?"Yes":r}function dh(n){return typeof n=="number"&&Number.isFinite(n)?n:typeof n=="string"&&n.trim()!==""&&!Number.isNaN(Number(n))?Number(n):null}function mh(n){if(n instanceof Date&&!Number.isNaN(n.getTime()))return n.getTime();if(typeof n=="string"){const r=Date.parse(n);return Number.isNaN(r)?null:r}return null}function _h(n,r){const l=dh(n),o=dh(r);if(l!=null&&o!=null)return l-o;const c=mh(n),f=mh(r);return c!=null&&f!=null?c-f:n==null||r==null?null:String(n).localeCompare(String(r))}function DE(n,r){return Array.isArray(n)?n.some(l=>l===r):typeof n=="string"?r!=null&&n.includes(String(r)):!1}function g0(n,r,l){switch(r){case"equals":return n===l;case"notEquals":return n!==l&&n!==""&&n!=null;case"lessThan":{const o=_h(n,l);return o!=null&&o<0}case"greaterThan":{const o=_h(n,l);return o!=null&&o>0}case"contains":return DE(n,l);case"startsWith":return n!=null&&l!=null&&String(n).startsWith(String(l));case"endsWith":return n!=null&&l!=null&&String(n).endsWith(String(l));default:return!1}}const RE=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]);function hh(n,r,l){const o=mc([...n]),c=Ec(o),f=[],m=_=>{_.forEach(p=>{if(!ho(p,r,c)||!ME(p,r)||!TE(p,r)||!_o(p,r,l))return;const y=String(p.key);if(Sc(y,l)&&!OE(y,r)){const H=c.currentCarrierKey?r[c.currentCarrierKey]:void 0;if(!(H&&H!=="NoPriorInsurance"&&Rr(r,c)&&RE.has(y)))return}p0(p)||f.push(p);const b=y0(p,r[y]),w=p.conditionals??[];if(!w.length)return;const B=w.filter(H=>g0(b,H.conditionalType,H.conditionalValue));(B.length>1&&!B.some(H=>H.conditionalQuestionsAllowMultiple)?B.slice(0,1):B).forEach(H=>{const k=H.conditionalQuestions??[];k.length&&(H.conditionalQuestionsAllowMultiple||m(k))})})};return m(o),f}const v0="__items",sc=n=>`${n}${v0}`;function wE(n,r){if(n.key==="relationship_to_insured"||n.key==="is_registered_owner"){const l=r[r.length-1];return typeof l=="number"&&l===0}return!1}function cc(n,r,l=[],o=void 0){for(const c of n){const f=String(c.key),m=y0(c,r[f]),_=c.conditionals??[];if(!_.length)continue;const p=_.filter(b=>g0(m,b.conditionalType,b.conditionalValue)),y=p.length>1&&!p.some(b=>b.conditionalQuestionsAllowMultiple)?p.slice(0,1):p;for(const b of y){const w=b.conditionalQuestions??[];if(!w.length)continue;if(!b.conditionalQuestionsAllowMultiple){if(cc(w,r,l,o))return!0;continue}const B=r[sc(f)]??[];if(B.length===0)return!0;for(const[z,H]of B.entries()){const k=[...l,sc(f),z],oe=w.filter(ye=>!(wE(ye,k)||Sc(String(ye.key),o)||!NE(ye,H))),ue=Ao(oe,H);if(Object.values(ue).some(Boolean)||cc(w,H,k,o))return!0}}}return!1}function ph(n,r,l){return cc(n,r,[],l)}function yh(n){const r=n.vehicles__items??[];if(!Array.isArray(r)||r.length===0)return!1;for(const l of r)if(_a(l.vehicle_comp_deductible,"select")||_a(l.vehicle_coll_deductible,"select")||_a(l.vehicle_towing_and_labor,"select")||_a(l.vehicle_transportation_expense,"select"))return!0;return!1}function xE({stages:n,onStageComplete:r,onComplete:l,initialValues:o,initialActive:c,quoteId:f}){const[m,_]=j.useState(c??0),[p,y]=j.useState(o??{}),[b,w]=j.useState({}),[B,z]=j.useState(!1),[H,k]=j.useState(!1),[oe,ue]=j.useState(null),ye=j.useRef([]),ne=j.useRef(n),le=Array.isArray(n)&&n.length>0,Q=le?Math.min(m,n.length-1):0,pe=le?n[Q]:null,ee=pe?.key??null;j.useEffect(()=>{c!==void 0&&_(c)},[c]),ne.current=n;const Ee=j.useMemo(()=>!!(Q>=n.length-1||n.slice(Q+1).every(N=>N.key==="AutoPolicy")&&(p.drivers__items??[]).length<=1),[Q,n,p]);j.useEffect(()=>{le&&m>=n.length&&_(n.length-1)},[m,n.length,le]),j.useEffect(()=>{const v=ye.current[Q];v&&v.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[Q]),j.useEffect(()=>{o!==void 0&&y(o)},[o]),j.useEffect(()=>{if(!pe||!ee){z(!1),ue(null);return}if(b[ee]){z(!1),ue(null);return}let v=!1;return z(!0),ue(null),Promise.resolve(pe.loadQuestions()).then(N=>{if(!v){if(!Array.isArray(N))throw new Error(`loadQuestions("${ee}") did not return an array`);w(F=>({...F,[ee]:N}))}}).catch(N=>{v||ue(`Failed to load stage "${pe?.title??""}": ${N?.message??"Unknown error"}`)}).finally(()=>{v||z(!1)}),()=>{v=!0}},[pe,ee,b]);const ge=ee?b[ee]:void 0,re=j.useMemo(()=>Ec(mc(ge??[])),[ge]);j.useEffect(()=>{pe&&ee&&ge&&bE({stageKey:ee,stageTitle:pe.title??ee,stepIndex:m+1,totalSteps:n.length})},[ee,m,n.length,pe,ge]);const ae=j.useMemo(()=>{if(!ge)return{};const v={};(V=>{const S=[],C=O=>{O.forEach((A,U)=>{const I=mo(A,U);S.push(I);const q=sc(I);S.push(q),(A.conditionals??[]).forEach(X=>{const ce=X.conditionalQuestions??[];ce.length>0&&C(ce)})})};return C(V),S})(ge).forEach(V=>{V in p&&(v[V]=p[V])});for(const V of["state","State","address","product"])V in p&&(v[V]=p[V]);for(const[V,S]of Object.entries(p))V.endsWith(v0)&&!(V in v)&&(v[V]=S);return v},[ge,p]),se=v=>{y(N=>({...N,...v}))},Me=()=>{_(v=>v>0?v-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},fe=async()=>{if(!ge||!pe||B||oe||H)return;const v=hh(ge,ae,ee??void 0),N=Yi(p,re),F=v.map(X=>To(X,re)?{...X,required:N}:X),V=Ao(F,ae),S=new Set(F.map((X,ce)=>mo(X,ce))),C=Object.entries(V).some(([X,ce])=>ce&&S.has(X)),O=ph(ge,p,ee??void 0),U=v.some(X=>String(X.key??"")==="vehicle_policy_selections")?yh(p):!1,I=p.driver_vehicle_assignments,q=p.drivers__items??[];let ie=!1;if(I&&q.length>=2){const X=p.vehicles__items??[];for(let ce=0;ce<X.length;ce++){const K=I[`v${ce}`];if(!K)continue;const P=q.map((de,Te)=>K[`d${Te}`]??0),W=P.filter(de=>de>0);if(W.length>=2&&W.every(de=>de===50)){ie=!0;break}const Ce=P.reduce((de,Te)=>de+Te,0);if(Ce>0&&Ce!==100){ie=!0;break}}}if(!(C||O||U||ie)){k(!0);try{const X=Ee,{success:ce,error:K}=X?await l(p,ee??""):await r(ae,ee??"");if(!ce){ue(K??"An error occurred");return}if(!X){const P=ne.current,W=P.findIndex(de=>de.key===ee),Ce=W>=0?Math.min(W+1,P.length-1):Math.min(m+1,P.length-1);_(Ce)}}finally{k(!1)}}},J=j.useMemo(()=>{if(!ge||B||oe||H)return!0;const v=hh(ge,ae,ee??void 0),N=Yi(p,re),F=v.map(X=>To(X,re)?{...X,required:N}:X),V=Ao(F,ae),S=new Set(F.map((X,ce)=>mo(X,ce))),C=Object.entries(V).some(([X,ce])=>ce&&S.has(X)),O=ph(ge,p,ee??void 0),U=v.some(X=>String(X.key??"")==="vehicle_policy_selections")?yh(p):!1,I=p.driver_vehicle_assignments,q=p.drivers__items??[];let ie=!1;if(I&&q.length>=2){const X=p.vehicles__items??[];for(let ce=0;ce<X.length;ce++){const K=I[`v${ce}`];if(!K)continue;const P=q.map((de,Te)=>K[`d${Te}`]??0),W=P.filter(de=>de>0);if(W.length>=2&&W.every(de=>de===50)){ie=!0;break}const Ce=P.reduce((de,Te)=>de+Te,0);if(Ce>0&&Ce!==100){ie=!0;break}}}return C||O||U||ie},[ge,ae,p,B,oe,H,re,ee]);return le?g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"form-wizard-steps-header flex items-center justify-between gap-4",children:[g.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:n.flatMap((v,N)=>[g.jsx("li",{ref:F=>{ye.current[N]=F},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${N<Q?"bg-blue-600 text-white border-blue-600":N===Q?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:v.title},v.key??`stage-${N}`),...N<n.length-1?[g.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${v.key??N}`)]:[]])}),g.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[Q+1," / ",n.length]})]}),g.jsxs("div",{children:[B&&g.jsx("div",{className:"text-slate-500",children:"Loading…"}),pe&&g.jsx(pE,{questions:ge??[],controlledValues:ae,onChangeValues:se,onSubmit:()=>fe(),quoteId:f,widgetStageKey:ee??void 0},pe.key)]}),!B&&oe&&g.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[g.jsx("div",{children:oe}),pe&&g.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{w(v=>{if(!ee)return v;const N={...v};return delete N[ee],N})},children:"Retry"})]}),g.jsxs("div",{className:Q>0?"grid grid-cols-2 gap-3":"",children:[Q>0&&g.jsx("button",{type:"button",onClick:Me,disabled:B,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Back"}),g.jsxs("button",{type:"button","data-widget-ctrl":"next",onClick:fe,disabled:J,className:["form-wizard-next-btn",Q>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:[H&&g.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:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.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"})]}),Ee?"Finish":"Next"]})]})]}):g.jsx("div",{className:"text-slate-600",children:"Loading..."})}const LE=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),b0={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},gh=["PersonalHome","PersonalAuto","Flood","ExcessFlood"],Hi="rounded-2xl border-2 border-blue-300 bg-blue-50/30 p-4 shadow-blue-100/60 ring-1 ring-blue-100",$i="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",vh="w-full max-w-md min-w-0 sm:max-w-[calc((100%-1rem)/2)]",zE="rounded-2xl border-2 border-transparent p-4";function bh({onBack:n}){const r=()=>{EE(),n?.()};return g.jsx("button",{type:"button",onClick:r,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 da({rate:n,status:r,onRequestBind:l,disabled:o,featured:c=!1,showLobLabel:f=!0,showFeaturedBadge:m,className:_}){const p=Number.isFinite(n.term_months)&&n.term_months>0?n.term_months:1,b=(n.monthly_premium_cents!=null?n.monthly_premium_cents:Math.round((n.premium_cents||0)/p))/100,w=LE.format(b),B=r==="loading",z=r==="success",H=!!o||B||z,k=!!(n.effective_date&&n.policy_end_date),oe=n.lob?b0[n.lob]||n.lob:null,ue=m??c;return g.jsxs("div",{className:`flex w-full flex-col rounded-xl bg-white p-6 shadow-sm transition hover:shadow-md ${c?"border-2 border-blue-300 shadow-blue-100/60 ring-1 ring-blue-100":"border border-slate-200"}${_?` ${_}`:""}`,children:[f&&oe&&g.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-slate-500",children:oe}),ue&&g.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"}),g.jsxs("div",{className:"mb-4 flex flex-col items-start gap-2",children:[n.carrier_logo_base64?g.jsx("img",{src:`data:image/png;base64,${n.carrier_logo_base64}`,alt:n.carrier_name,className:"h-12 w-auto max-w-full object-contain"}):g.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:n.carrier_name.charAt(0).toUpperCase()}),g.jsx("h4",{className:"w-full break-words text-left font-semibold text-slate-900",children:n.carrier_name})]}),g.jsx("div",{className:"mb-2",children:g.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:[w,g.jsx("span",{className:"ml-1 text-sm font-medium text-slate-500",children:"/month"})]})}),k&&g.jsx("div",{className:"mb-2",children:g.jsxs("p",{className:"text-xs text-slate-500",children:["Effective ",n.effective_date," - ",n.policy_end_date]})}),n.carrier_quote_id&&g.jsx("div",{className:"mb-4",children:g.jsxs("p",{className:"text-xs text-slate-400",children:["Quote ID: ",n.carrier_quote_id]})}),g.jsxs("div",{className:"mt-auto pt-4",children:[g.jsx("button",{type:"button",onClick:l,disabled:H,className:`rates-bind-btn w-full rounded-full px-4 py-2.5 text-sm font-semibold transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 disabled:cursor-not-allowed ${z?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:B?"Requesting…":z?"Requested":"Request Bind"}),r==="error"&&g.jsx("p",{className:"mt-2 text-xs text-red-600",children:"Something went wrong. Please try again."}),r==="success"&&g.jsx("p",{className:"mt-2 text-xs text-emerald-600",children:"We received your bind request."})]})]})}function BE({rates:n,onBack:r,isBundleFlow:l=!1}){const o=Array.isArray(n)?n:[],c=o.length>0,[f,m]=j.useState({}),[_,p]=j.useState("admitted"),[y,b]=j.useState(!1),w=j.useMemo(()=>o.some(v=>v.lob==="PersonalAuto"),[o]),B=j.useMemo(()=>o.some(v=>v.lob==="PersonalHome"),[o]),z=j.useMemo(()=>{if(!l)return[];const v=[];return w&&v.push("PersonalAuto"),B&&v.push("PersonalHome"),v},[l,w,B]),H=j.useMemo(()=>{const v=new Set;for(const N of o){const F=N.lob??null;F&&f[N.quote_rate_id]==="success"&&v.add(F)}return v},[o,f]),k=j.useMemo(()=>Object.values(f).some(v=>v==="success"),[f]),oe=j.useMemo(()=>y?!0:!l||z.length===0?k:z.every(v=>H.has(v)),[y,l,k,z,H]),ue=j.useMemo(()=>c?o.filter(v=>(v.admitted_status??"admitted")==="admitted"):[],[o,c]),ye=j.useMemo(()=>c?o.filter(v=>v.admitted_status==="non_admitted"):[],[o,c]),ne=ue.length,le=ye.length,Q=ne+le>0;j.useEffect(()=>{Q&&_==="admitted"&&ne===0&&le>0&&p("non_admitted")},[_,ne,le,Q]);const pe=j.useMemo(()=>Q?_==="admitted"?ue:ye:[],[Q,_,ue,ye]);j.useEffect(()=>{uc()},[]),j.useEffect(()=>{!oe||y||(F1(),m0(),b(!0))},[oe,y]);const ee=j.useMemo(()=>{if(pe.length===0)return[];if(!pe.some(V=>V.lob))return[{lob:null,title:"Rates",rates:[...pe].sort((S,C)=>{const O=Number.isFinite(S.term_months)&&S.term_months>0?S.term_months:1,A=Number.isFinite(C.term_months)&&C.term_months>0?C.term_months:1,U=S.monthly_premium_cents??Math.round((S.premium_cents||0)/O),I=C.monthly_premium_cents??Math.round((C.premium_cents||0)/A);return U-I})}];const N=new Map;for(const V of pe){const S=V.lob||"_other",C=N.get(S);C?C.push(V):N.set(S,[V])}return[...N.entries()].sort(([V],[S])=>{const C=gh.indexOf(V),O=gh.indexOf(S);return(C===-1?999:C)-(O===-1?999:O)}).map(([V,S])=>({lob:V,title:b0[V]??V,rates:[...S].sort((C,O)=>{const A=Number.isFinite(C.term_months)&&C.term_months>0?C.term_months:1,U=Number.isFinite(O.term_months)&&O.term_months>0?O.term_months:1,I=C.monthly_premium_cents??Math.round((C.premium_cents||0)/A),q=O.monthly_premium_cents??Math.round((O.premium_cents||0)/U);return I-q})}))},[pe]),Ee=j.useMemo(()=>{if(!l)return[];const v=o.some(V=>V.lob==="PersonalAuto"),N=o.some(V=>V.lob==="PersonalHome"),F=[];return v||F.push("Sorry, no rates found for Personal Auto."),N||F.push("Sorry, no rates found for Homeowners."),F},[l,o]);if(!Q)return g.jsxs("section",{className:"mt-8",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),g.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Sorry, no rates are available at this time."}),r&&g.jsx(bh,{onBack:r})]});const ge=async v=>{m(N=>({...N,[v]:"loading"}));try{if(uc(),!po())throw new Error("Authentication required. Please verify your phone number first.");if(!((await J1(v))?.success!==!1))throw new Error("Request failed");m(S=>({...S,[v]:"success"}))}catch{m(N=>({...N,[v]:"error"}))}},re=ee.find(v=>v.lob==="PersonalAuto"),ae=ee.find(v=>v.lob==="PersonalHome"),se=!!(re?.rates.length&&ae?.rates.length),Me=ee.filter(v=>!se||v.lob!=="PersonalAuto"&&v.lob!=="PersonalHome"),fe=se&&re&&ae?[{rate:re.rates[0]},{rate:ae.rates[0]}]:[],J=fe.length===1;return g.jsxs("section",{className:"mt-8",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),Ee.length>0&&g.jsx("div",{className:"mt-3 space-y-1",children:Ee.map(v=>g.jsx("p",{className:"text-sm text-slate-600",children:v},v))}),g.jsx("div",{className:"mt-4 border-b border-slate-200",children:g.jsxs("div",{className:"flex items-center gap-6",children:[g.jsxs("button",{type:"button",onClick:()=>p("admitted"),className:`border-b-2 px-1 py-2 text-sm font-semibold transition ${_==="admitted"?"border-cyan-500 text-slate-900":"border-transparent text-slate-500 hover:text-slate-800"}`,children:["Admitted (",ne,")"]}),g.jsxs("button",{type:"button",onClick:()=>p("non_admitted"),className:`border-b-2 px-1 py-2 text-sm font-semibold transition ${_==="non_admitted"?"border-cyan-500 text-slate-900":"border-transparent text-slate-500 hover:text-slate-800"}`,children:["Non-admitted (",le,")"]})]})}),pe.length===0&&g.jsx("p",{className:"mt-4 text-sm text-slate-500",children:_==="admitted"?"Sorry, no admitted rates are available at this time.":"Sorry, no non-admitted rates are available at this time."}),pe.length>0&&se&&re&&ae&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:J?"mt-6 flex justify-center":"mt-6",children:g.jsxs("div",{className:J?`w-full max-w-md ${Hi}`:Hi,children:[g.jsx("div",{className:$i,children:"Featured Bundle"}),g.jsx("div",{className:J?"grid justify-items-center gap-4":"grid gap-4 sm:grid-cols-2",children:fe.map(({rate:v})=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:v,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:f[v.quote_rate_id]??"idle",disabled:oe||(l?!!(v.lob&&z.includes(v.lob)&&H.has(v.lob)):k),onRequestBind:()=>ge(v.quote_rate_id)})},v.quote_rate_id))})]})}),re.rates.length>1&&g.jsxs("div",{className:"mt-6",children:[g.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",re.title," Options"]}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:re.rates.slice(1).map(v=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:v,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:f[v.quote_rate_id]??"idle",disabled:oe||(l?!!(v.lob&&z.includes(v.lob)&&H.has(v.lob)):k),onRequestBind:()=>ge(v.quote_rate_id)})},v.quote_rate_id))})]}),ae.rates.length>1&&g.jsxs("div",{className:"mt-6",children:[g.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",ae.title," Options"]}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:ae.rates.slice(1).map(v=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:v,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:f[v.quote_rate_id]??"idle",disabled:oe||(l?!!(v.lob&&z.includes(v.lob)&&H.has(v.lob)):k),onRequestBind:()=>ge(v.quote_rate_id)})},v.quote_rate_id))})]})]}),pe.length>0&&Me.map(v=>{const[N,...F]=v.rates;return g.jsxs("div",{className:"mt-6",children:[g.jsx("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:v.title}),F.length===0?g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:g.jsx("div",{className:"col-span-full flex justify-center",children:g.jsxs("div",{className:`${vh} ${Hi}`,children:[g.jsx("div",{className:$i,children:"Featured"}),g.jsx(da,{rate:N,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[N.quote_rate_id]??"idle",disabled:oe||(l?!!(N.lob&&z.includes(N.lob)&&H.has(N.lob)):k),onRequestBind:()=>ge(N.quote_rate_id)})]})})}):F.length===1?g.jsxs("div",{className:"grid items-stretch gap-4 sm:grid-cols-2",children:[g.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${Hi}`,children:[g.jsx("div",{className:$i,children:"Featured"}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:g.jsx(da,{rate:N,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[N.quote_rate_id]??"idle",onRequestBind:()=>ge(N.quote_rate_id),disabled:oe||(l?!!(N.lob&&z.includes(N.lob)&&H.has(N.lob)):k),className:"h-full min-h-0"})})]}),g.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${zE}`,children:[g.jsx("div",{className:`${$i} pointer-events-none invisible shrink-0`,"aria-hidden":!0,children:"Featured"}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:g.jsx(da,{rate:F[0],featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[F[0].quote_rate_id]??"idle",onRequestBind:()=>ge(F[0].quote_rate_id),disabled:oe||(l?!!(F[0].lob&&z.includes(F[0].lob)&&H.has(F[0].lob)):k),className:"h-full min-h-0"})})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:g.jsx("div",{className:"col-span-full flex justify-center",children:g.jsxs("div",{className:`${vh} ${Hi}`,children:[g.jsx("div",{className:$i,children:"Featured"}),g.jsx(da,{rate:N,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[N.quote_rate_id]??"idle",disabled:oe||(l?!!(N.lob&&z.includes(N.lob)&&H.has(N.lob)):k),onRequestBind:()=>ge(N.quote_rate_id)})]})})}),g.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:F.map(V=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:V,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[V.quote_rate_id]??"idle",disabled:oe||(l?!!(V.lob&&z.includes(V.lob)&&H.has(V.lob)):k),onRequestBind:()=>ge(V.quote_rate_id)})},V.quote_rate_id))})]})]},v.lob??"all")}),r&&g.jsx(bh,{onBack:r})]})}const ec=["Validating your details...","Checking underwriting rules...","Applying eligible discounts...","Reviewing your risk profile...","Calculating premium...","Check complete"],Sh={Auto:{label:"Auto Policy",icon:"🚗",accent:"#0369A1"},Home:{label:"Home Policy",icon:"🏠",accent:"#059669"},Bundle:{label:"Home + Auto Bundle",icon:"🔗",accent:"#7C3AED"}},kE=8e3;function UE({progress:n,color:r,size:l=80}){const o=(l-10)/2,c=2*Math.PI*o,f=c-n/100*c;return g.jsxs("svg",{width:l,height:l,style:{transform:"rotate(-90deg)"},children:[g.jsx("circle",{cx:l/2,cy:l/2,r:o,fill:"none",stroke:"#F1F5F9",strokeWidth:6}),g.jsx("circle",{cx:l/2,cy:l/2,r:o,fill:"none",stroke:r,strokeWidth:6,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.2s linear"}})]})}function jE({providers:n=[],totalTime:r=6e4,flow:l="Auto",isComplete:o=!1,onComplete:c}){const f=Sh[l]??Sh.Auto,m=n.length>0?kE:r,[_,p]=j.useState(0),[y,b]=j.useState(0),[w,B]=j.useState(0),[z,H]=j.useState(0),[k,oe]=j.useState(!0),ue=j.useRef(o),ye=j.useRef(c),ne=j.useRef(_),le=j.useRef(n.length),Q=j.useRef(!1),pe=j.useRef(!1);j.useEffect(()=>{ue.current=o},[o]),j.useEffect(()=>{ye.current=c},[c]),j.useEffect(()=>{ne.current=_},[_]),j.useEffect(()=>{le.current=n.length,n.length>0&&(pe.current=!1,p(0),b(0),B(0),H(0),oe(!0))},[n.length]),j.useEffect(()=>{if(n.length===0){ue.current&&!Q.current&&(Q.current=!0,ye.current?.());return}pe.current=!1;const re=100,ae=100/(m/re),se=setInterval(()=>{B(Me=>{if(pe.current||Q.current)return Me;const fe=Me+ae;return fe<100?fe:(pe.current=!0,setTimeout(()=>{if(ue.current){if(Q.current)return;Q.current=!0,ye.current?.();return}const v=ne.current===le.current-1;oe(!1),setTimeout(()=>{v?(p(0),b(N=>N+1)):p(N=>N+1),B(0),H(0),oe(!0)},300)},400),100)})},re);return()=>clearInterval(se)},[_,m,n.length]),j.useEffect(()=>{if(n.length===0)return;const re=Math.floor(m/ec.length),ae=setInterval(()=>H(se=>Math.min(se+1,ec.length-1)),re);return()=>clearInterval(ae)},[_,m,n.length]);const ee=n.length===0,Ee=ee?null:n[Math.min(_,n.length-1)],ge=y>0;return g.jsxs(g.Fragment,{children:[g.jsx("style",{children:`
87
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const m of n.seen.entries()){const _=m[1];if(r===m[0]){f(m);continue}if(n.external){const y=n.external.registry.get(m[0])?.id;if(r!==m[0]&&y){f(m);continue}}if(n.metadataRegistry.get(m[0])?.id){f(m);continue}if(_.cycle){f(m);continue}if(_.count>1&&n.reused==="ref"){f(m);continue}}}function Qh(n,r){const l=n.seen.get(r);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=m=>{const _=n.seen.get(m);if(_.ref===null)return;const p=_.def??_.schema,y={...p},b=_.ref;if(_.ref=null,b){o(b);const B=n.seen.get(b),z=B.schema;if(z.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(z)):Object.assign(p,z),Object.assign(p,y),m._zod.parent===b)for(const k in p)k==="$ref"||k==="allOf"||k in y||delete p[k];if(z.$ref&&B.def)for(const k in p)k==="$ref"||k==="allOf"||k in B.def&&JSON.stringify(p[k])===JSON.stringify(B.def[k])&&delete p[k]}const w=m._zod.parent;if(w&&w!==b){o(w);const B=n.seen.get(w);if(B?.schema.$ref&&(p.$ref=B.schema.$ref,B.def))for(const z in p)z==="$ref"||z==="allOf"||z in B.def&&JSON.stringify(p[z])===JSON.stringify(B.def[z])&&delete p[z]}n.override({zodSchema:m,jsonSchema:p,path:_.path??[]})};for(const m of[...n.seen.entries()].reverse())o(m[0]);const c={};if(n.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const m=n.external.registry.get(r)?.id;if(!m)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(m)}Object.assign(c,l.def??l.schema);const f=n.external?.defs??{};for(const m of n.seen.entries()){const _=m[1];_.def&&_.defId&&(f[_.defId]=_.def)}n.external||Object.keys(f).length>0&&(n.target==="draft-2020-12"?c.$defs=f:c.definitions=f);try{const m=JSON.parse(JSON.stringify(c));return Object.defineProperty(m,"~standard",{value:{...r["~standard"],jsonSchema:{input:So(r,"input",n.processors),output:So(r,"output",n.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function Lt(n,r){const l=r??{seen:new Set};if(l.seen.has(n))return!1;l.seen.add(n);const o=n._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Lt(o.element,l);if(o.type==="set")return Lt(o.valueType,l);if(o.type==="lazy")return Lt(o.getter(),l);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Lt(o.innerType,l);if(o.type==="intersection")return Lt(o.left,l)||Lt(o.right,l);if(o.type==="record"||o.type==="map")return Lt(o.keyType,l)||Lt(o.valueType,l);if(o.type==="pipe")return Lt(o.in,l)||Lt(o.out,l);if(o.type==="object"){for(const c in o.shape)if(Lt(o.shape[c],l))return!0;return!1}if(o.type==="union"){for(const c of o.options)if(Lt(c,l))return!0;return!1}if(o.type==="tuple"){for(const c of o.items)if(Lt(c,l))return!0;return!!(o.rest&&Lt(o.rest,l))}return!1}const eS=(n,r={})=>l=>{const o=Vh({...l,processors:r});return Tt(n,o),Ph(o,n),Qh(o,n)},So=(n,r,l={})=>o=>{const{libraryOptions:c,target:f}=o??{},m=Vh({...c??{},target:f,io:r,processors:l});return Tt(n,m),Ph(m,n),Qh(m,n)},tS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nS=(n,r,l,o)=>{const c=l;c.type="string";const{minimum:f,maximum:m,format:_,patterns:p,contentEncoding:y}=n._zod.bag;if(typeof f=="number"&&(c.minLength=f),typeof m=="number"&&(c.maxLength=m),_&&(c.format=tS[_]??_,c.format===""&&delete c.format,_==="time"&&delete c.format),y&&(c.contentEncoding=y),p&&p.size>0){const b=[...p];b.length===1?c.pattern=b[0].source:b.length>1&&(c.allOf=[...b.map(w=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},aS=(n,r,l,o)=>{const c=l,{minimum:f,maximum:m,format:_,multipleOf:p,exclusiveMaximum:y,exclusiveMinimum:b}=n._zod.bag;typeof _=="string"&&_.includes("int")?c.type="integer":c.type="number",typeof b=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(c.minimum=b,c.exclusiveMinimum=!0):c.exclusiveMinimum=b),typeof f=="number"&&(c.minimum=f,typeof b=="number"&&r.target!=="draft-04"&&(b>=f?delete c.minimum:delete c.exclusiveMinimum)),typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(c.maximum=y,c.exclusiveMaximum=!0):c.exclusiveMaximum=y),typeof m=="number"&&(c.maximum=m,typeof y=="number"&&r.target!=="draft-04"&&(y<=m?delete c.maximum:delete c.exclusiveMaximum)),typeof p=="number"&&(c.multipleOf=p)},rS=(n,r,l,o)=>{l.type="boolean"},iS=(n,r,l,o)=>{l.not={}},lS=(n,r,l,o)=>{},oS=(n,r,l,o)=>{const c=n._zod.def,f=Mh(c.entries);f.every(m=>typeof m=="number")&&(l.type="number"),f.every(m=>typeof m=="string")&&(l.type="string"),l.enum=f},uS=(n,r,l,o)=>{const c=n._zod.def,f=[];for(const m of c.values)if(m===void 0){if(r.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof m=="bigint"){if(r.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");f.push(Number(m))}else f.push(m);if(f.length!==0)if(f.length===1){const m=f[0];l.type=m===null?"null":typeof m,r.target==="draft-04"||r.target==="openapi-3.0"?l.enum=[m]:l.const=m}else f.every(m=>typeof m=="number")&&(l.type="number"),f.every(m=>typeof m=="string")&&(l.type="string"),f.every(m=>typeof m=="boolean")&&(l.type="boolean"),f.every(m=>m===null)&&(l.type="null"),l.enum=f},sS=(n,r,l,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},cS=(n,r,l,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fS=(n,r,l,o)=>{const c=l,f=n._zod.def,{minimum:m,maximum:_}=n._zod.bag;typeof m=="number"&&(c.minItems=m),typeof _=="number"&&(c.maxItems=_),c.type="array",c.items=Tt(f.element,r,{...o,path:[...o.path,"items"]})},dS=(n,r,l,o)=>{const c=l,f=n._zod.def;c.type="object",c.properties={};const m=f.shape;for(const y in m)c.properties[y]=Tt(m[y],r,{...o,path:[...o.path,"properties",y]});const _=new Set(Object.keys(m)),p=new Set([..._].filter(y=>{const b=f.shape[y]._zod;return r.io==="input"?b.optin===void 0:b.optout===void 0}));p.size>0&&(c.required=Array.from(p)),f.catchall?._zod.def.type==="never"?c.additionalProperties=!1:f.catchall?f.catchall&&(c.additionalProperties=Tt(f.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(c.additionalProperties=!1)},mS=(n,r,l,o)=>{const c=n._zod.def,f=c.inclusive===!1,m=c.options.map((_,p)=>Tt(_,r,{...o,path:[...o.path,f?"oneOf":"anyOf",p]}));f?l.oneOf=m:l.anyOf=m},_S=(n,r,l,o)=>{const c=n._zod.def,f=Tt(c.left,r,{...o,path:[...o.path,"allOf",0]}),m=Tt(c.right,r,{...o,path:[...o.path,"allOf",1]}),_=y=>"allOf"in y&&Object.keys(y).length===1,p=[..._(f)?f.allOf:[f],..._(m)?m.allOf:[m]];l.allOf=p},hS=(n,r,l,o)=>{const c=n._zod.def,f=Tt(c.innerType,r,o),m=r.seen.get(n);r.target==="openapi-3.0"?(m.ref=c.innerType,l.nullable=!0):l.anyOf=[f,{type:"null"}]},pS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType},yS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType,l.default=JSON.parse(JSON.stringify(c.defaultValue))},gS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType,r.io==="input"&&(l._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},vS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType;let m;try{m=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}l.default=m},bS=(n,r,l,o)=>{const c=n._zod.def,f=r.io==="input"?c.in._zod.def.type==="transform"?c.out:c.in:c.out;Tt(f,r,o);const m=r.seen.get(n);m.ref=f},SS=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType,l.readOnly=!0},Kh=(n,r,l,o)=>{const c=n._zod.def;Tt(c.innerType,r,o);const f=r.seen.get(n);f.ref=c.innerType},AS=G("ZodISODateTime",(n,r)=>{Cv.init(n,r),tt.init(n,r)});function ES(n){return Rb(AS,n)}const TS=G("ZodISODate",(n,r)=>{Ov.init(n,r),tt.init(n,r)});function CS(n){return wb(TS,n)}const OS=G("ZodISOTime",(n,r)=>{Mv.init(n,r),tt.init(n,r)});function MS(n){return xb(OS,n)}const NS=G("ZodISODuration",(n,r)=>{Nv.init(n,r),tt.init(n,r)});function DS(n){return Lb(NS,n)}const RS=(n,r)=>{xh.init(n,r),n.name="ZodError",Object.defineProperties(n,{format:{value:l=>yg(n,l)},flatten:{value:l=>pg(n,l)},addIssue:{value:l=>{n.issues.push(l),n.message=JSON.stringify(n.issues,tc,2)}},addIssues:{value:l=>{n.issues.push(...l),n.message=JSON.stringify(n.issues,tc,2)}},isEmpty:{get(){return n.issues.length===0}}})},cn=G("ZodError",RS,{Parent:Error}),wS=gc(cn),xS=vc(cn),LS=Co(cn),zS=Oo(cn),BS=bg(cn),kS=Sg(cn),US=Ag(cn),jS=Eg(cn),HS=Tg(cn),$S=Cg(cn),IS=Og(cn),ZS=Mg(cn),lt=G("ZodType",(n,r)=>(it.init(n,r),Object.assign(n["~standard"],{jsonSchema:{input:So(n,"input"),output:So(n,"output")}}),n.toJSONSchema=eS(n,{}),n.def=r,n.type=r.type,Object.defineProperty(n,"_def",{value:r}),n.check=(...l)=>n.clone(ha(r,{checks:[...r.checks??[],...l.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),n.with=n.check,n.clone=(l,o)=>pa(n,l,o),n.brand=()=>n,n.register=((l,o)=>(l.add(n,o),n)),n.parse=(l,o)=>wS(n,l,o,{callee:n.parse}),n.safeParse=(l,o)=>LS(n,l,o),n.parseAsync=async(l,o)=>xS(n,l,o,{callee:n.parseAsync}),n.safeParseAsync=async(l,o)=>zS(n,l,o),n.spa=n.safeParseAsync,n.encode=(l,o)=>BS(n,l,o),n.decode=(l,o)=>kS(n,l,o),n.encodeAsync=async(l,o)=>US(n,l,o),n.decodeAsync=async(l,o)=>jS(n,l,o),n.safeEncode=(l,o)=>HS(n,l,o),n.safeDecode=(l,o)=>$S(n,l,o),n.safeEncodeAsync=async(l,o)=>IS(n,l,o),n.safeDecodeAsync=async(l,o)=>ZS(n,l,o),n.refine=(l,o)=>n.check(jA(l,o)),n.superRefine=l=>n.check(HA(l)),n.overwrite=l=>n.check(Lr(l)),n.optional=()=>F_(n),n.exactOptional=()=>CA(n),n.nullable=()=>Y_(n),n.nullish=()=>F_(Y_(n)),n.nonoptional=l=>wA(n,l),n.array=()=>_A(n),n.or=l=>Jh([n,l]),n.and=l=>vA(n,l),n.transform=l=>q_(n,EA(l)),n.default=l=>NA(n,l),n.prefault=l=>RA(n,l),n.catch=l=>LA(n,l),n.pipe=l=>q_(n,l),n.readonly=()=>kA(n),n.describe=l=>{const o=n.clone();return Ii.add(o,{description:l}),o},Object.defineProperty(n,"description",{get(){return Ii.get(n)?.description},configurable:!0}),n.meta=(...l)=>{if(l.length===0)return Ii.get(n);const o=n.clone();return Ii.add(o,l[0]),o},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=l=>l(n),n)),Xh=G("_ZodString",(n,r)=>{bc.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(o,c,f)=>nS(n,o,c);const l=n._zod.bag;n.format=l.format??null,n.minLength=l.minimum??null,n.maxLength=l.maximum??null,n.regex=(...o)=>n.check(Hb(...o)),n.includes=(...o)=>n.check(Zb(...o)),n.startsWith=(...o)=>n.check(Gb(...o)),n.endsWith=(...o)=>n.check(Fb(...o)),n.min=(...o)=>n.check(bo(...o)),n.max=(...o)=>n.check(Yh(...o)),n.length=(...o)=>n.check(qh(...o)),n.nonempty=(...o)=>n.check(bo(1,...o)),n.lowercase=o=>n.check($b(o)),n.uppercase=o=>n.check(Ib(o)),n.trim=()=>n.check(qb()),n.normalize=(...o)=>n.check(Yb(...o)),n.toLowerCase=()=>n.check(Vb()),n.toUpperCase=()=>n.check(Pb()),n.slugify=()=>n.check(Qb())}),GS=G("ZodString",(n,r)=>{bc.init(n,r),Xh.init(n,r),n.email=l=>n.check(sb(FS,l)),n.url=l=>n.check(_b(YS,l)),n.jwt=l=>n.check(Db(lA,l)),n.emoji=l=>n.check(hb(qS,l)),n.guid=l=>n.check(U_(I_,l)),n.uuid=l=>n.check(cb(io,l)),n.uuidv4=l=>n.check(fb(io,l)),n.uuidv6=l=>n.check(db(io,l)),n.uuidv7=l=>n.check(mb(io,l)),n.nanoid=l=>n.check(pb(VS,l)),n.guid=l=>n.check(U_(I_,l)),n.cuid=l=>n.check(yb(PS,l)),n.cuid2=l=>n.check(gb(QS,l)),n.ulid=l=>n.check(vb(KS,l)),n.base64=l=>n.check(Ob(aA,l)),n.base64url=l=>n.check(Mb(rA,l)),n.xid=l=>n.check(bb(XS,l)),n.ksuid=l=>n.check(Sb(WS,l)),n.ipv4=l=>n.check(Ab(JS,l)),n.ipv6=l=>n.check(Eb(eA,l)),n.cidrv4=l=>n.check(Tb(tA,l)),n.cidrv6=l=>n.check(Cb(nA,l)),n.e164=l=>n.check(Nb(iA,l)),n.datetime=l=>n.check(ES(l)),n.date=l=>n.check(CS(l)),n.time=l=>n.check(MS(l)),n.duration=l=>n.check(DS(l))});function ma(n){return ub(GS,n)}const tt=G("ZodStringFormat",(n,r)=>{Je.init(n,r),Xh.init(n,r)}),FS=G("ZodEmail",(n,r)=>{pv.init(n,r),tt.init(n,r)}),I_=G("ZodGUID",(n,r)=>{_v.init(n,r),tt.init(n,r)}),io=G("ZodUUID",(n,r)=>{hv.init(n,r),tt.init(n,r)}),YS=G("ZodURL",(n,r)=>{yv.init(n,r),tt.init(n,r)}),qS=G("ZodEmoji",(n,r)=>{gv.init(n,r),tt.init(n,r)}),VS=G("ZodNanoID",(n,r)=>{vv.init(n,r),tt.init(n,r)}),PS=G("ZodCUID",(n,r)=>{bv.init(n,r),tt.init(n,r)}),QS=G("ZodCUID2",(n,r)=>{Sv.init(n,r),tt.init(n,r)}),KS=G("ZodULID",(n,r)=>{Av.init(n,r),tt.init(n,r)}),XS=G("ZodXID",(n,r)=>{Ev.init(n,r),tt.init(n,r)}),WS=G("ZodKSUID",(n,r)=>{Tv.init(n,r),tt.init(n,r)}),JS=G("ZodIPv4",(n,r)=>{Dv.init(n,r),tt.init(n,r)}),eA=G("ZodIPv6",(n,r)=>{Rv.init(n,r),tt.init(n,r)}),tA=G("ZodCIDRv4",(n,r)=>{wv.init(n,r),tt.init(n,r)}),nA=G("ZodCIDRv6",(n,r)=>{xv.init(n,r),tt.init(n,r)}),aA=G("ZodBase64",(n,r)=>{Lv.init(n,r),tt.init(n,r)}),rA=G("ZodBase64URL",(n,r)=>{Bv.init(n,r),tt.init(n,r)}),iA=G("ZodE164",(n,r)=>{kv.init(n,r),tt.init(n,r)}),lA=G("ZodJWT",(n,r)=>{jv.init(n,r),tt.init(n,r)}),Wh=G("ZodNumber",(n,r)=>{Ih.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(o,c,f)=>aS(n,o,c),n.gt=(o,c)=>n.check(H_(o,c)),n.gte=(o,c)=>n.check(Qs(o,c)),n.min=(o,c)=>n.check(Qs(o,c)),n.lt=(o,c)=>n.check(j_(o,c)),n.lte=(o,c)=>n.check(Ps(o,c)),n.max=(o,c)=>n.check(Ps(o,c)),n.int=o=>n.check(Z_(o)),n.safe=o=>n.check(Z_(o)),n.positive=o=>n.check(H_(0,o)),n.nonnegative=o=>n.check(Qs(0,o)),n.negative=o=>n.check(j_(0,o)),n.nonpositive=o=>n.check(Ps(0,o)),n.multipleOf=(o,c)=>n.check($_(o,c)),n.step=(o,c)=>n.check($_(o,c)),n.finite=()=>n;const l=n._zod.bag;n.minValue=Math.max(l.minimum??Number.NEGATIVE_INFINITY,l.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(l.maximum??Number.POSITIVE_INFINITY,l.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(l.format??"").includes("int")||Number.isSafeInteger(l.multipleOf??.5),n.isFinite=!0,n.format=l.format??null}),oA=G("ZodNumberFormat",(n,r)=>{Hv.init(n,r),Wh.init(n,r)});function Z_(n){return Bb(oA,n)}const uA=G("ZodBoolean",(n,r)=>{$v.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>rS(n,l,o)});function sA(n){return kb(uA,n)}const cA=G("ZodUnknown",(n,r)=>{Iv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>lS()});function G_(){return Ub(cA)}const fA=G("ZodNever",(n,r)=>{Zv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>iS(n,l,o)});function dA(n){return jb(fA,n)}const mA=G("ZodArray",(n,r)=>{Gv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>fS(n,l,o,c),n.element=r.element,n.min=(l,o)=>n.check(bo(l,o)),n.nonempty=l=>n.check(bo(1,l)),n.max=(l,o)=>n.check(Yh(l,o)),n.length=(l,o)=>n.check(qh(l,o)),n.unwrap=()=>n.element});function _A(n,r){return Kb(mA,n,r)}const hA=G("ZodObject",(n,r)=>{Yv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>dS(n,l,o,c),Ye(n,"shape",()=>r.shape),n.keyof=()=>Mr(Object.keys(n._zod.def.shape)),n.catchall=l=>n.clone({...n._zod.def,catchall:l}),n.passthrough=()=>n.clone({...n._zod.def,catchall:G_()}),n.loose=()=>n.clone({...n._zod.def,catchall:G_()}),n.strict=()=>n.clone({...n._zod.def,catchall:dA()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=l=>fg(n,l),n.safeExtend=l=>dg(n,l),n.merge=l=>mg(n,l),n.pick=l=>sg(n,l),n.omit=l=>cg(n,l),n.partial=(...l)=>_g(e0,n,l[0]),n.required=(...l)=>hg(t0,n,l[0])});function pA(n,r){const l={type:"object",shape:n??{},...he(r)};return new hA(l)}const yA=G("ZodUnion",(n,r)=>{qv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>mS(n,l,o,c),n.options=r.options});function Jh(n,r){return new yA({type:"union",options:n,...he(r)})}const gA=G("ZodIntersection",(n,r)=>{Vv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>_S(n,l,o,c)});function vA(n,r){return new gA({type:"intersection",left:n,right:r})}const ac=G("ZodEnum",(n,r)=>{Pv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(o,c,f)=>oS(n,o,c),n.enum=r.entries,n.options=Object.values(r.entries);const l=new Set(Object.keys(r.entries));n.extract=(o,c)=>{const f={};for(const m of o)if(l.has(m))f[m]=r.entries[m];else throw new Error(`Key ${m} not found in enum`);return new ac({...r,checks:[],...he(c),entries:f})},n.exclude=(o,c)=>{const f={...r.entries};for(const m of o)if(l.has(m))delete f[m];else throw new Error(`Key ${m} not found in enum`);return new ac({...r,checks:[],...he(c),entries:f})}});function Mr(n,r){const l=Array.isArray(n)?Object.fromEntries(n.map(o=>[o,o])):n;return new ac({type:"enum",entries:l,...he(r)})}const bA=G("ZodLiteral",(n,r)=>{Qv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>uS(n,l,o),n.values=new Set(r.values),Object.defineProperty(n,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function SA(n,r){return new bA({type:"literal",values:Array.isArray(n)?n:[n],...he(r)})}const AA=G("ZodTransform",(n,r)=>{Kv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>cS(n,l),n._zod.parse=(l,o)=>{if(o.direction==="backward")throw new Ch(n.constructor.name);l.addIssue=f=>{if(typeof f=="string")l.issues.push(Fi(f,l.value,r));else{const m=f;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=l.value),m.inst??(m.inst=n),l.issues.push(Fi(m))}};const c=r.transform(l.value,l);return c instanceof Promise?c.then(f=>(l.value=f,l)):(l.value=c,l)}});function EA(n){return new AA({type:"transform",transform:n})}const e0=G("ZodOptional",(n,r)=>{Fh.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>Kh(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function F_(n){return new e0({type:"optional",innerType:n})}const TA=G("ZodExactOptional",(n,r)=>{Xv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>Kh(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function CA(n){return new TA({type:"optional",innerType:n})}const OA=G("ZodNullable",(n,r)=>{Wv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>hS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function Y_(n){return new OA({type:"nullable",innerType:n})}const MA=G("ZodDefault",(n,r)=>{Jv.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>yS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function NA(n,r){return new MA({type:"default",innerType:n,get defaultValue(){return typeof r=="function"?r():Dh(r)}})}const DA=G("ZodPrefault",(n,r)=>{eb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>gS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function RA(n,r){return new DA({type:"prefault",innerType:n,get defaultValue(){return typeof r=="function"?r():Dh(r)}})}const t0=G("ZodNonOptional",(n,r)=>{tb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>pS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function wA(n,r){return new t0({type:"nonoptional",innerType:n,...he(r)})}const xA=G("ZodCatch",(n,r)=>{nb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>vS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function LA(n,r){return new xA({type:"catch",innerType:n,catchValue:typeof r=="function"?r:()=>r})}const zA=G("ZodPipe",(n,r)=>{ab.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>bS(n,l,o,c),n.in=r.in,n.out=r.out});function q_(n,r){return new zA({type:"pipe",in:n,out:r})}const BA=G("ZodReadonly",(n,r)=>{rb.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>SS(n,l,o,c),n.unwrap=()=>n._zod.def.innerType});function kA(n){return new BA({type:"readonly",innerType:n})}const UA=G("ZodCustom",(n,r)=>{ib.init(n,r),lt.init(n,r),n._zod.processJSONSchema=(l,o,c)=>sS(n,l)});function jA(n,r={}){return Xb(UA,n,r)}function HA(n){return Wb(n)}const rc={custom:"custom"};function ht(n){return zb(Wh,n)}const n0=new Date().getUTCFullYear(),lo=ma().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),V_=Jh([SA(""),ma().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),$A=(n,r,l)=>ht({error:`${n} must be a number.`}).min(r,`${n} must be between ${r.toLocaleString()} and ${l.toLocaleString()}.`).max(l,`${n} must be between ${r.toLocaleString()} and ${l.toLocaleString()}.`).int(`${n} must be a whole number.`),Or=(n,r)=>ht({error:`${n} must be a number.`}).min(0,`${n} must be between 0 and ${r.toLocaleString()}.`).max(r,`${n} must be between 0 and ${r.toLocaleString()}.`).int(`${n} must be a whole number.`),oo=(n,r=1600)=>ht({error:`${n} must be a valid 4-digit year.`}).int(`${n} must be a whole number.`).min(r,`${n} should be between ${r} and the current year.`).max(n0,`${n} cannot be in the future.`),uo=n=>ht({error:`${n} must be a number.`}).int(`${n} must be a whole number.`).min(0,`${n} must be between 0 and 99.`).max(99,`${n} must be between 0 and 99.`),ki=(n,r,l=0)=>{const o=Math.pow(10,r)-1,c=o.toLocaleString("en-US"),f=l.toLocaleString("en-US");return ht({error:`${n} must be a number.`}).min(l,`${n}: Value must be between ${f} and ${c}.`).max(o,`${n}: Value must be between ${f} and ${c}.`).int(`${n} must be a whole number.`)},IA={email:ma().trim().min(1,"Required").email("Please enter a valid email address."),phone:ma().trim().min(1,"Required").refine(n=>{let r=n.replace(/\D/g,"");return r.length===11&&r.startsWith("1")&&(r=r.slice(1)),r.length===10},"Please enter a valid 10-digit US phone number."),social_security_number:ma().trim().refine(n=>n===""||/^\d{3}-\d{2}-\d{4}$/.test(n),"Social Security Number must be in the format XXX-XX-XXXX.").optional(),sms_code:ma().trim().min(1,"Required").regex(/^\d{6}$/,"Please enter the 6-digit code."),first_name:lo,last_name:lo,middle_name:V_,co_applicant_first_name:lo,co_applicant_last_name:lo,co_applicant_middle_name:V_,year_built:oo("Year built",1800),year_roof_updated:ht({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:oo("Heating update year"),plumbing_update_year:oo("Plumbing update year"),electrical_update_year:oo("Electrical update year"),total_area_sq_ft:$A("Square footage",1,999999),sale_price_cents:ht({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:uo("Number of years with your prior carrier"),home_continuous_coverage_years:uo("How long you have had continuous home coverage"),household_size:ht({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:ht({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:ki("Replacement cost",9,1),other_structures_coverage:ki("Other structures",9),personal_property_coverage:ki("Personal property",7),loss_of_use_coverage:ki("Loss of use coverage",8),years_at_address:ht({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:ht({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:ht({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:ht({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:ht({error:"Number of families must be a number."}).int("Number of families must be a whole number.").refine(n=>n>=1&&n<=5,{message:"Number of families must be between 1 and 5."}),number_of_dogs:ht({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:ht({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:ki("Amount paid",7),license_number:ma().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:ma().superRefine((n,r)=>{if(typeof n!="string"||n.trim()==="")return;if(/\s/.test(n)){r.addIssue({code:rc.custom,message:"VIN cannot contain spaces."});return}const l=n.trim();/^[A-HJ-NPR-Z0-9]{17}$/i.test(l)||r.addIssue({code:rc.custom,message:"VIN must be exactly 17 letters and numbers (excluding I, O, and Q)."})}),annual_mileage:ht({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:ht({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:Or("Modifications value",9999999),cost_new_value_cents:Or("Cost new value",9999999),stated_value_amount_cents:Or("Stated Value Amount",9999999),property_damage_amount_paid_cents:Or("Property damage amount paid",9999999),personal_injury_amount_paid_cents:Or("Personal injury amount paid",9999999),auto_current_annual_premium_cents:Or("Current annual premium",9999999),auto_prior_years:uo("Years with prior auto carrier"),auto_prior_months:ht({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:uo("Years with continuous auto coverage")};function st(n){return new Date(`${n}T00:00:00Z`)}function Et(){const n=new Date;return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))}function fa(n,r){let l=r.getUTCFullYear()-n.getUTCFullYear();const o=r.getUTCMonth()-n.getUTCMonth();return(o<0||o===0&&r.getUTCDate()<n.getUTCDate())&&l--,l}const a0=[{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:n=>{const r=n.date_of_birth;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":fa(l,Et())<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:n=>{const r=n.co_applicant_date_of_birth;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":fa(l,Et())<16?"Co-applicant can't be under the age of 16.":void 0}},{targetKey:"year_roof_updated",dependsOn:["year_roof_updated","year_built"],validate:n=>{const r=Number(n.year_roof_updated),l=Number(n.year_built);if(isNaN(r))return;const o=isNaN(l)?1e3:l;if(r<o||r>n0)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:n=>{const r=n.move_in_date,l=n.year_built;if(!r||l==null)return;const o=st(String(r));if(isNaN(o.getTime()))return;const c=Number(l);if(!isNaN(c))return o.getUTCFullYear()<c?"Purchase date cannot be prior to the year the building was originally constructed.":void 0}},{targetKey:"date_first_licensed",dependsOn:["date_first_licensed"],validate:n=>{const r=n.date_first_licensed;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Date first licensed cannot be in the future.":void 0}},{targetKey:"date_first_licensed",dependsOn:["date_first_licensed","date_of_birth"],validate:n=>{const r=n.date_first_licensed,l=n.date_of_birth;if(!r||typeof r!="string"||!l||typeof l!="string")return;const o=st(l),c=st(r);if(isNaN(o.getTime())||isNaN(c.getTime()))return;if(c<o)return"Date licensed cannot be before driver date of birth.";const f=new Date(Date.UTC(o.getUTCFullYear()+18,o.getUTCMonth(),o.getUTCDate()));return c<f?"Driver can't be licensed to drive before the age of 18.":void 0}},{targetKey:"occurred_at",dependsOn:["occurred_at"],validate:n=>{const r=n.occurred_at;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Incident date cannot be in the future.":void 0}},{targetKey:"accident_prevention_course_date",dependsOn:["accident_prevention_course_date"],validate:n=>{const r=n.accident_prevention_course_date;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Course date cannot be in the future.":void 0}},{targetKey:"effective_date",dependsOn:["effective_date"],validate:n=>{const r=n.effective_date;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et(),c=new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+3,o.getUTCDate()));if(l<o)return"Insurance start date cannot be in the past.";if(l>c)return"Insurance must begin within 3 months from today."}},{targetKey:"years_at_address",dependsOn:["years_at_address","date_of_birth"],validate:n=>{const r=n.years_at_address,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.years_at_prior_address,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.home_prior_years,l=n.home_continuous_coverage_years;if(r==null||l==null)return;const o=Number(r),c=Number(l);if(!(isNaN(o)||isNaN(c)))return o>c?"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:n=>{const r=n.home_prior_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.home_continuous_coverage_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"Years with continuous home coverage cannot be greater than the Applicant's age.":void 0}},{targetKey:"move_in_date",dependsOn:["move_in_date"],validate:n=>{const r=n.move_in_date;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Purchase date cannot be in the future.":void 0}},{targetKey:"date_of_incident",dependsOn:["date_of_incident"],validate:n=>{const r=n.date_of_incident;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et();return l>o?"Loss date cannot be in the future.":void 0}},{targetKey:"home_prior_expiration_date",dependsOn:["home_prior_expiration_date"],validate:n=>{const r=n.home_prior_expiration_date;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et(),c=new Date(Date.UTC(o.getUTCFullYear()-1,o.getUTCMonth(),o.getUTCDate())),f=new Date(Date.UTC(o.getUTCFullYear()+1,o.getUTCMonth(),o.getUTCDate()));if(l<c||l>f)return"Policy expiration date must be between 1 year ago and 1 year from now."}},{targetKey:"purchase_date",dependsOn:["purchase_date"],validate:n=>{const r=n.purchase_date;if(!r||typeof r!="string")return;const l=st(r);return isNaN(l.getTime())?"Invalid date.":l>Et()?"Vehicle purchase date cannot be in the future.":void 0}},{targetKey:"purchase_date",dependsOn:["purchase_date","year"],validate:n=>{const r=n.purchase_date,l=n.year;if(!r||typeof r!="string"||l==null)return;const o=st(r);if(isNaN(o.getTime()))return;const c=Number(l);if(!isNaN(c))return o.getUTCFullYear()<c?"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:n=>{const r=n.auto_prior_expiration_date;if(!r||typeof r!="string")return;const l=st(r);if(isNaN(l.getTime()))return"Invalid date.";const o=Et(),c=new Date(Date.UTC(o.getUTCFullYear()-1,o.getUTCMonth(),o.getUTCDate())),f=new Date(Date.UTC(o.getUTCFullYear()+1,o.getUTCMonth(),o.getUTCDate()));if(l<c||l>f)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:n=>{const r=n.auto_prior_years,l=n.auto_continuous_coverage_years;if(r==null||l==null)return;const o=Number(r),c=Number(l);if(!(isNaN(o)||isNaN(c)))return o>c?"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:n=>{const r=n.auto_prior_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.auto_continuous_coverage_years,l=n.date_of_birth;if(r==null||l==null||typeof l!="string")return;const o=Number(r);if(isNaN(o))return;const c=st(l);if(isNaN(c.getTime()))return;const f=fa(c,Et());return o>f?"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:n=>{const r=n.vehicle_coll_deductible,l=n.vehicle_comp_deductible;if(!(!r||typeof r!="string"||!l||typeof l!="string")&&l==="NoCoverage"&&r!=="NoCoverage")return"Collision Coverage cannot be chosen if Comprehensive is No Coverage."}},{targetKey:"policy_um",dependsOn:["policy_um","policy_bi"],validate:n=>{const r=n.policy_um,l=n.policy_bi;if(!r||typeof r!="string"||!l||typeof l!="string"||r==="Reject"||l==="Dontknow")return;const o=y=>y.endsWith("CSL"),c=o(r),f=o(l);if(c&&!f)return"A Combined Single Limit cannot be selected for Uninsured/Underinsured Motorist unless a Combined Single Limit has also been selected for Liability.";const m={cov30to60:30,cov50to100:50,cov100to100:100,cov100to300:100,cov250to500:250,cov300to300:300,cov500to500:500,cov100CSL:100,cov300CSL:300,cov500CSL:500},_=m[r],p=m[l];if(_!=null&&p!=null&&_>p)return"Uninsured/Underinsured Motorist Limit value cannot be greater than Bodily Injury Limit value."}},{targetKey:"policy_umpd",dependsOn:["policy_umpd","policy_pd"],validate:n=>{const r=n.policy_umpd,l=n.policy_pd;if(!r||typeof r!="string"||!l||typeof l!="string"||r==="NoCoverage"||l==="Dontknow")return;const o=m=>{if(!m.startsWith("cov"))return null;const _=parseInt(m.replace("cov",""),10);return isNaN(_)?null:_},c=o(r),f=o(l);if(c!=null&&f!=null&&c>f)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:n=>{const r=n.custom_equipment_value_cents,l=n.stated_value_amount_cents;if(r==null||l==null)return;const o=Number(r),c=Number(l);if(!(isNaN(o)||isNaN(c))&&c>0&&o>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 ic(n,r){const l=IA[n];if(!l)return;const o=l.safeParse(r);return o.success?void 0:o.error.issues[0].message}function P_(n){if(/\s/.test(n))return!1;const r=n.trim();return r.length===17&&/^[A-HJ-NPR-Z0-9]{17}$/i.test(r)}function ZA(n,r){const l={};for(const o of a0){if(r?.has(o.targetKey))continue;const c=o.validate(n);c&&(l[o.targetKey]=c)}return l}function lc(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function mo(n,r){return n.key??`${lc(n.question)}-${r}`}function _a(n,r){return r==="number"?n==null||typeof n=="string"&&n.trim()==="":r==="checkbox"?n!==!0:n==null||typeof n=="string"&&n.trim()===""}function Ao(n,r){const l={};n.forEach((f,m)=>{const _=mo(f,m),p=r[_];if(f.required&&_a(p,f.inputType)){l[_]="Required";return}if(!_a(p,f.inputType)){const y=ic(_,p);if(y){l[_]=y;return}}});const o=new Set(Object.keys(l).filter(f=>l[f])),c=ZA(r,o);for(const[f,m]of Object.entries(c))l[f]=m;return l}function GA(n){if(n===""||n===null||n===void 0)return;const r=Number(n);return Number.isNaN(r)?void 0:r}const FA=new Set(["Home","HomeConstruction","HomeFeatures"]),YA=new Set(["HomePolicy","BundlePolicy"]),qA=new Set(["HomeCustomer","BundleCustomer"]);function Sc(n,r){return n==="has_health_insurance_auto_accident"?r!=="BundleCustomer":n==="household_size"?!(r&&FA.has(r)):n==="number_of_mortgagees"?!(r&&YA.has(r)):(n==="has_co_applicant"||n==="co_applicant_middle_name"||n==="co_applicant_relationship")&&r&&qA.has(r)?!1:n==="multi_policy_discount"&&r==="HomePolicy"?!0:VA.has(n)}const VA=new Set(["anti_theft_type","passive_restraint_type","anti_lock_brakes","daytime_running_lights","vehicle_full_glass","vehicle_loan_lease","percent_to_work","stated_value_amount_cents","vehicle_comp_deductible","vehicle_coll_deductible","vehicle_towing_and_labor","vehicle_transportation_expense","accident_prevention_course","driver_accidents","driver_violations","losses","middle_name","ssn_display","has_health_insurance_auto_accident","auto_current_annual_premium_cents","has_co_applicant","co_applicant_middle_name","co_applicant_relationship","tort_threshold","pip_coverage_type","extended_medical","additional_pip","policy_pip_deductible","is_corporation"]),PA={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"},QA={OwnHome:"Own Home",OwnCondo:"Own Condo",RentHome:"Rent Home",RentCondo:"Rent Condo",RentApartment:"Rent Apartment",LiveWithParents:"Live With Parents"},KA={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"},XA={Business:"Business",Pleasure:"Pleasure",Farming:"Farming",To_FromWork:"To/From Work",To_FromSchool:"To/From School"},WA={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"},JA={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"},e1={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"},t1={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"},n1={Dontknow:"Don't know",cov25000:"25,000",cov50000:"50,000",cov100000:"100,000",cov250000:"250,000",cov500000:"500,000"},a1={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"},r1={cov25000:"25,000",cov35000:"35,000",cov50000:"50,000",cov100000:"100,000",cov200000:"200,000",cov250000:"250,000",cov300000:"300,000",cov500000:"500,000"},i1={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"},l1={NoCoverage:"No Coverage",cov5000:"5,000",cov10000:"10,000"},oc={NoCoverage:"No Coverage",Zero:"0",Fifty:"50",Hundred:"100",TwoHunderd:"200",TwoHundredfifty:"250",FiveHundred:"500",Thousand:"1,000",TwoThousand:"2,000"},r0={NoCoverage:"No Coverage",TwentyFive:"25",Forty:"40",Fifty:"50",SeventyFive:"75",Eighty:"80",Hundred:"100",TwelveHundred:"120",TwoHundred:"200",Unlimited:"Unlimited"},i0={NoCoverage:"No Coverage",cov20to600:"20/600",cov25to750:"25/750",cov30to900:"30/900",cov40to1200:"40/1,200",cov50to1500:"50/1,500"},l0={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"},o1={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"},u1={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)"},s1={OwnerPrimary:"Owner Primary",OwnerSecondary:"Owner Secondary",OwnerSeasonal:"Owner Seasonal"},c1={Basic:"Basic",Modest:"Modest",Average:"Average",AboveAverage:"Above Average",Expensive:"Expensive",VeryExpensive:"Very Expensive",Opulent:"Opulent"},f1={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"},d1={Slab:"Slab",Basement:"Basement",CrawlSpace:"Crawl Space",PartialBasement:"Partial Basement",PiersPostsPiles:"Piers / Posts / Piles",Open:"Open"},m1={NotOverWater:"No",PartiallyOverWater:"Partially Over Water",FullyOrEntirelyOverWater:"Fully or Entirely Over Water"},_1={One:"1",OneHalf:"1.5",Two:"2",TwoHalf:"2.5",Three:"3",ThreeHalf:"3.5",Four:"4",BiLevel:"Bi-Level",TriLevel:"Tri-Level"},h1={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"},p1={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"},y1={B_Gable:"Gable",C_Hip:"Hip",A_Flat:"Flat",D_Other:"Other"},g1={NotUpdated:"Not Updated",PartialUpdate:"Partial Update",CompleteUpdate:"Complete Update"},v1={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"},b1={AboveGround:"Above Ground",BelowGround:"Below Ground"},S1={Basement:"Below Grade Basement",SplitLevelBasement:"Split Level Basement",WalkoutBasement:"Walkout Basement"},A1={EntirelyCopper:"Entirely Copper",EntirelyGalvanized:"Entirely Galvanized",EntirelyPEX:"Entirely PEX",EntirelyPVC:"Entirely PVC",Polybutylene:"Polybutylene"},E1={TwentyFive:"$25,000",Fifty:"$50,000",OneHundred:"$100,000",TwoHundred:"$200,000",ThreeHundred:"$300,000",FourHundred:"$400,000",FiveHundred:"$500,000"},T1={cov1000:"$1,000",cov2000:"$2,000",cov3000:"$3,000",cov4000:"$4,000",cov5000:"$5,000"},C1={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%"},O1={None:"None",OnePercent:"1%",TwoPercent:"2%",FivePercent:"5%",TenPercent:"10%"},M1={_0_500ft:"0-500 Feet",_501_1000ft:"501-1000 Feet",_1001ftAndGreater:"1001 Feet And Greater"},N1={Lessthan5miles:"Less Than 5 Miles",Over5miles:"Over 5 Miles",NotAvailable:"Not Available"},Q_={"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"},K_={Single:"Single",Married:"Married",Seperated:"Separated",Divorced:"Divorced",Widowed:"Widowed",DomesticPartner:"Domestic Partner"},X_={Female:"Female",Male:"Male"},o0={"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"},D1={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"},R1={Verbal_Threshold:"Limited right to sue",Zero_Threshold:"Unlimited right to sue",Full:"Full",Limited:"Limited"},w1={Primary:"Primary",Secondary:"Secondary"},x1={cov1000:"$1,000",cov10000:"$10,000"},L1={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"},z1={cov250:"$250",cov500:"$500",cov1000:"$1,000",cov2000:"$2,000",cov2500:"$2,500"},B1={"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"]},k1={"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"},W_=B1,u0=k1;function Ac(n,r){if(typeof n!="string")return n;const l=n.trim();if(!l)return n;if(r[l])return l;const o=l.toLowerCase();return Object.keys(r).find(f=>f.toLowerCase()===o||r[f]?.toLowerCase()===o)??n}function Eo(n){return Ac(n,o0)}function s0(n){return Ac(n,l0)}function c0(n){return Ac(n,u0)}function U1(n){return n.trim().toLowerCase()}function J_(n){if(typeof n!="string")return null;const r=n.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!r)return null;const l=Number(r[1]),o=Number(r[2]),c=Number(r[3]);if(!Number.isFinite(l)||!Number.isFinite(o)||!Number.isFinite(c)||o<1||o>12||c<1||c>31)return null;const f=new Date(Date.UTC(l,o-1,c));return f.getUTCFullYear()!==l||f.getUTCMonth()!==o-1||f.getUTCDate()!==c?null:f.getTime()}function Rr(n,r){if(!r.effectiveDateKey||!r.expirationDateKey)return!1;const l=J_(n[r.expirationDateKey]),o=J_(n[r.effectiveDateKey]);return l==null||o==null?!1:l<o}const j1=new Set(["HomePolicy","BundlePolicy"]);function _o(n,r,l){return String(n.key??"")!=="lapse_in_coverage"||!l||!j1.has(l)?!0:r.home_prior_carrier_name!=="NoPriorInsurance"}function Ec(n){let r=null,l=null,o=null;const c=new Set,f=new Set,m=p=>{const y=String(p.key??""),b=U1(String(p.question??""));!r&&(y==="auto_prior_carrier_name"||y==="home_prior_carrier_name"||b.includes("current auto insurance company"))&&(r=y),!l&&(y==="effective_date"||b.includes("when do you need your insurance to begin"))&&(l=y),!o&&(y==="auto_prior_expiration_date"||y==="home_prior_expiration_date"||b.includes("when does the current policy expire"))&&(o=y),(y==="auto_reason_for_no_insurance"||b.includes("reason you are not currently insured")||b.includes("reason for lapse in coverage"))&&c.add(y),(y==="auto_prior_years"||y==="auto_prior_months"||y==="auto_continuous_coverage_years"||y==="auto_prior_expiration_date"||y==="auto_current_annual_premium_cents"||y==="auto_prior_liability_limit")&&f.add(y)};n.forEach(m);const _=p=>{p.forEach(y=>{(y.conditionals??[]).forEach(b=>{const w=b.conditionalQuestions??[];w.forEach(m),_(w)})})};return _(n),{currentCarrierKey:r,effectiveDateKey:l,expirationDateKey:o,noInsuranceReasonKeys:c,hideWhenNoPriorInsuranceKeys:f}}function Yi(n,r){return r.currentCarrierKey==="home_prior_carrier_name"&&n.home_prior_carrier_name==="NoPriorInsurance"&&n.auto_prior_carrier_name!=="NoPriorInsurance"?!1:(r.currentCarrierKey?n[r.currentCarrierKey]:void 0)==="NoPriorInsurance"?!0:!r.effectiveDateKey||!r.expirationDateKey||r.expirationDateKey==="home_prior_expiration_date"&&Rr(n,r)?!1:Rr(n,r)}function ho(n,r,l){const o=String(n.key??"");if(l.noInsuranceReasonKeys.has(o)&&l.currentCarrierKey==="home_prior_carrier_name"&&r.home_prior_carrier_name==="NoPriorInsurance"&&r.auto_prior_carrier_name!=="NoPriorInsurance")return!1;const f=(l.currentCarrierKey?r[l.currentCarrierKey]:void 0)==="NoPriorInsurance";return f&&l.hideWhenNoPriorInsuranceKeys.has(o)?!1:!l.noInsuranceReasonKeys.has(o)||f?!0:Yi(r,l)}function To(n,r){const l=String(n.key??"");return r.noInsuranceReasonKeys.has(l)}const H1=["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"],Tc="credify_quote_id",Cc="credify_auth_token";function $1(n){try{localStorage.setItem(Tc,n)}catch(r){console.error("Failed to save quoteId to localStorage:",r)}}function I1(){try{return localStorage.getItem(Tc)}catch(n){return console.error("Failed to load quoteId from localStorage:",n),null}}function f0(){try{localStorage.removeItem(Tc)}catch(n){console.error("Failed to clear quoteId from localStorage:",n)}}function Z1(n){try{localStorage.setItem(Cc,n)}catch(r){console.error("Failed to save authToken to localStorage:",r)}}function G1(){try{return localStorage.getItem(Cc)}catch(n){return console.error("Failed to load authToken from localStorage:",n),null}}function d0(){try{localStorage.removeItem(Cc)}catch(n){console.error("Failed to clear authToken from localStorage:",n)}}function F1(){f0(),d0()}const pn="https://api.getcredify.com";let xr=null;function Y1(n){xr=n,Z1(n)}function po(){return xr}function uc(){const n=G1();n&&(xr=n)}function m0(){xr=null,d0()}async function yn(n,r){const l={"Content-Type":"application/json"};xr&&(l.Authorization=`Bearer ${xr}`);const o=await fetch(n,{method:"POST",headers:l,body:JSON.stringify(r)});if(!o.ok){let c=`Request failed with status ${o.status}`;try{c=(await o.json()).error||c}catch{c=o.statusText||c}const f=new Error(c);throw f.statusCode=o.status,f}return o}async function q1(n){try{return await n.json()}catch{return{}}}async function V1(n,r){const l=r?{stage:n,quoteId:r}:{stage:n};return await(await yn(`${pn}/get-questions-by-stage`,l)).json()}async function so(n){const r=n?{quoteId:n}:{};return await(await yn(`${pn}/get-stages-for-quote`,r)).json()}async function P1(n){const l=await(await yn(`${pn}/create-quote`,{phone:n})).json();if(!l||typeof l!="object"||!l.quoteId)throw new Error(`Invalid createQuote response: ${JSON.stringify(l)}`);return l}async function Ui(n,r,l){const o={payload:n,getRates:r};l&&typeof l=="string"&&l.trim()!==""&&(o.quoteId=l);const c=await yn(`${pn}/update-quote`,o);return await q1(c)}async function Q1(n,r){return await(await yn(`${pn}/verify-quote`,{quoteId:n,smsCode:r})).json()}async function K1(n){return await(await yn(`${pn}/is-supported-state`,{state:n})).json()}async function X1(){return await(await yn(`${pn}/get-rates`,{})).json()}async function eh(n){const r=n?{quoteId:n}:{};return await(await yn(`${pn}/get-quote`,r)).json()}async function th(n){return(await yn(`${pn}/get-vehicle-options`,n)).json()}async function W1(n){return(await yn(`${pn}/get-vehicle-options`,{...n,action:"vinDecode"})).json()}async function J1(n){const l=await(await yn(`${pn}/request-bind`,{quoteRateId:n})).json();return l&&typeof l=="object"&&"success"in l?l:{success:!0}}const eE=["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible"],No=new Set([...eE,"is_corporation"]);pA({additional_pip:Mr(["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:Mr(["Verbal_Threshold","Zero_Threshold","Full","Limited"]),pip_coverage_type:Mr(["Primary","Secondary"]),extended_medical:Mr(["cov1000","cov10000"]),policy_pip_deductible:Mr(["cov250","cov500","cov1000","cov2000","cov2500"]),has_health_insurance_auto_accident:sA().nullable().optional()}).superRefine((n,r)=>{n.pip_coverage_type==="Secondary"&&n.has_health_insurance_auto_accident!==!0&&r.addIssue({code:rc.custom,path:["pip_coverage_type"],message:"Secondary PIP coverage requires health insurance that covers auto accidents."})});const Ks=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),tE={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"},nh={auto_prior_carrier_name:PA,auto_prior_liability_limit:WA,auto_reason_for_no_insurance:JA,residence_type:QA,home_prior_carrier_name:KA,policy_bi:e1,policy_um:t1,policy_pd:n1,policy_mp:a1,policy_umpd:r1,policy_pip:i1,policy_auto_death_indemnity:l1,vehicle_comp_deductible:oc,vehicle_coll_deductible:oc,vehicle_towing_and_labor:r0,vehicle_transportation_expense:i0,education_level:l0,industry:o0,occupation:u0,usage:XA,architectural_style:o1,dwelling_type:u1,occupancy_type:s1,construction_quality:c1,construction_type:f1,foundation_type:d1,located_over_water:m1,number_of_stories:_1,exterior_wall_type:h1,roof_material_type:p1,roof_shape:y1,roof_updated_type:g1,heating_type:v1,oil_tank_location:b1,basement_type:S1,plumbing_type:A1,personal_liability:E1,dwelling_medical_payments:T1,all_perils_deductible:C1,windstorm_deductible:O1,distance_from_fire_hydrant_ft:M1,distance_from_fire_station_miles:N1,employment_industry:Q_,marital_status:K_,gender:X_,co_applicant_employment_industry:Q_,co_applicant_marital_status:K_,co_applicant_gender:X_,description:D1,tort_threshold:R1,pip_coverage_type:w1,extended_medical:x1,additional_pip:L1,policy_pip_deductible:z1},nE=["OTHER / NOT LISTED"],aE=["SEDAN","SUV","COUPE","HATCHBACK","PICKUP","VAN","WAGON","OTHER"],rE=["Other"];function Kt(n){const r=n.getUTCFullYear(),l=String(n.getUTCMonth()+1).padStart(2,"0"),o=String(n.getUTCDate()).padStart(2,"0");return`${r}-${l}-${o}`}function ah(n){const r=n.replace(/\D+/g,"");if(r!=="")return GA(r)}function iE(n){return n==="-"||n==="+"||n==="."||n==="e"||n==="E"}const lE={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},rh=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"]),oE=new Set(["total_area_sq_ft","annual_mileage","miles_to_work","distance_to_coast_miles"]),co={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"},uE={license_number:20};function sE(n){const r=new Date,l=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()));if(n==="effective_date"){const o=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth()+3,l.getUTCDate()));return{min:Kt(l),max:Kt(o)}}if(n==="home_prior_expiration_date"){const o=new Date(Date.UTC(l.getUTCFullYear()-1,l.getUTCMonth(),l.getUTCDate())),c=new Date(Date.UTC(l.getUTCFullYear()+1,l.getUTCMonth(),l.getUTCDate()));return{min:Kt(o),max:Kt(c)}}if(n==="date_of_incident")return{max:Kt(l)};if(n==="move_in_date")return{max:Kt(l)};if(n==="purchase_date")return{max:Kt(l)};if(n==="date_of_birth")return{max:Kt(l)};if(n==="date_first_licensed")return{max:Kt(l)};if(n==="occurred_at")return{max:Kt(l)};if(n==="accident_prevention_course_date")return{max:Kt(l)};if(n==="auto_prior_expiration_date"){const o=new Date(Date.UTC(l.getUTCFullYear()-1,l.getUTCMonth(),l.getUTCDate())),c=new Date(Date.UTC(l.getUTCFullYear()+1,l.getUTCMonth(),l.getUTCDate()));return{min:Kt(o),max:Kt(c)}}return{}}const cE=new Set(["Disabled","Retired","Unemployed","Other"]);function Xs(n,r,l){const o=String(n.key??"");if(o!=="occupation"&&o!=="co_applicant_occupation"||o==="co_applicant_occupation")return!0;const c=Rt(r,l,"industry"),f=Rt(r,l,"employment_industry"),m=String(c??f??"").trim();return!cE.has(m)}function _0(n){const r=n.state??n.State??n.state??n.State??"";if(typeof r!="string"||!r.trim())return!1;const l=r.trim().toLowerCase();return l==="nj"||l==="n.j."||l==="n.j"||l==="new jersey"}function Ws(n,r){const l=String(n.key??"");return No.has(l)?_0(r):!0}function fE(n,r){const l=String(n??""),o=No.has(l)||l==="has_health_insurance_auto_accident"||l==="is_corporation";return _0(r)&&o}function Js(n,r,l,o){return!(!Sc(n,o)||fE(n,l))}function yo(n){return n.inputType!=="radio"||!n.options||n.options.length!==1||n.options[0]!=="Yes"?!1:(n.conditionals??[]).some(l=>l.conditionalQuestionsAllowMultiple&&l.conditionalType==="equals"&&l.conditionalValue==="Yes")}function ih(n,r){return yo(n)?"Yes":r}function lh(n){return typeof n=="number"&&Number.isFinite(n)?n:typeof n=="string"&&n.trim()!==""&&!Number.isNaN(Number(n))?Number(n):null}function oh(n){if(n instanceof Date&&!Number.isNaN(n.getTime()))return n.getTime();if(typeof n=="string"){const r=Date.parse(n);return Number.isNaN(r)?null:r}return null}function uh(n,r){const l=lh(n),o=lh(r);if(l!=null&&o!=null)return l-o;const c=oh(n),f=oh(r);return c!=null&&f!=null?c-f:n==null||r==null?null:String(n).localeCompare(String(r))}function dE(n,r){return Array.isArray(n)?n.some(l=>l===r):typeof n=="string"?r!=null&&n.includes(String(r)):!1}function ji(n,r,l){switch(r){case"equals":return n===l;case"notEquals":return n!==l&&n!==""&&n!=null;case"lessThan":{const o=uh(n,l);return o!=null&&o<0}case"greaterThan":{const o=uh(n,l);return o!=null&&o>0}case"contains":return dE(n,l);case"startsWith":return n!=null&&l!=null&&String(n).startsWith(String(l));case"endsWith":return n!=null&&l!=null&&String(n).endsWith(String(l));default:return!1}}function Zi(n,r){return r.reduce((l,o)=>l?.[o],n)}function hn(n,r,l){if(r.length===0)return n;const[o,...c]=r;if(c.length===0){if(typeof o=="number"){const y=(Array.isArray(n)?n:[]).slice();return y[o]=l,y}return{...n,[o]:l}}const f=n?.[o],m=typeof c[0]=="number"?Array.isArray(f)?f:[]:f&&typeof f=="object"?f:{},_=hn(m,c,l);if(typeof o=="number"){const y=(Array.isArray(n)?n:[]).slice();return y[o]=_,y}return{...n,[o]:_}}function Rt(n,r,l){return Zi(n,[...r??[],l])}function Dt(n,r,l,o){return hn(n,[...r??[],l],o)}function mE(n,r){return n?.length?`${n.join("-")}-${r}`:r}const _E="__items",fo=n=>`${n}${_E}`;function Ht(n){return n==null?"":typeof n=="string"?n:String(n)}function sh(n){return n==null?"":typeof n=="number"&&Number.isFinite(n)||typeof n=="string"?n:""}function hE(n){return n==null?"":typeof n=="string"||typeof n=="number"?n:String(n)}function pE({questions:n,initialValues:r,controlledValues:l,onChangeValues:o,onSubmit:c,quoteId:f,widgetStageKey:m}){const _=j.useMemo(()=>mc(n),[n]),p=j.useMemo(()=>Ec(_),[_]),y=j.useMemo(()=>m==="BundlePolicy"?!0:_.some(C=>String(C.key)==="home_prior_carrier_name")&&_.some(C=>String(C.key)==="driver_vehicle_assignments"),[m,_]),b=j.useMemo(()=>{const C={};return r&&Object.assign(C,r),C},[r]),[w,B]=j.useState(b);j.useEffect(()=>{B(b)},[b]);const[z,H]=j.useState({}),k=j.useMemo(()=>({...z,...l??w}),[z,l,w]);j.useEffect(()=>{l&&H(C=>({...C,...l}))},[l]);const[oe,ue]=j.useState({}),ye=j.useRef(new Map),ne=j.useRef(new Set),[,le]=j.useState({}),[Q,pe]=j.useState({}),ee=j.useRef(!1);j.useEffect(()=>{!f||ee.current||!_.some(O=>O.key==="year"||O.key==="make"||O.key==="model"||O.key==="body_style")||(ee.current=!0,th({quoteId:f}).catch(()=>{}))},[f,_]);const[Ee,ge]=j.useState({}),[re,ae]=j.useState({}),se=j.useCallback(async(C,O)=>{if(!f||!P_(O))return;const A=C?C.join("-"):"_root";ge(U=>({...U,[A]:!0})),ae(U=>({...U,[A]:null}));try{const U=await W1({quoteId:f,vin:O});if(U.error){ae(q=>({...q,[A]:U.error}));return}let I=k;U.year&&(I=Dt(I,C,"year",String(U.year))),U.make&&(I=Dt(I,C,"make",U.make)),U.model&&(I=Dt(I,C,"model",U.model)),U.bodyStyle&&(I=Dt(I,C,"body_style",U.bodyStyle)),l&&o?o(I):B(I),H(I),ye.current.clear(),ne.current.clear(),le({})}catch{ae(U=>({...U,[A]:"VIN lookup failed — please enter vehicle details manually"}))}finally{ge(U=>({...U,[A]:!1}))}},[f,k,l,o]),Me=j.useCallback((C,O)=>{if(!f)return;const A=`${O.year}|${O.make??""}|${O.model??""}`,U=O.model?"bodyStyles":O.make?"models":"makes",I=`${C}:${U}`,q=ye.current.get(A);if(q)return q[U]??[];ne.current.has(A)||(ne.current.add(A),queueMicrotask(()=>{pe(ie=>({...ie,[I]:!0})),th({quoteId:f,...O}).then(ie=>{ye.current.set(A,ie),le(X=>({...X,[I]:ie[U]??[]}))}).catch(()=>{ye.current.set(A,{}),le(ie=>({...ie,[I]:[]}))}).finally(()=>{ne.current.delete(A),pe(ie=>({...ie,[I]:!1}))})}))},[f]);function fe(C,O,A){return{...C?Zi(k,C)??{}:k,[O]:A}}function J(C,O){const A=a0.filter(I=>I.targetKey===C||I.dependsOn.includes(C)),U={[C]:void 0};for(const I of A){const q=I.validate(O);I.targetKey in U?q!==void 0&&(U[I.targetKey]=q):U[I.targetKey]=q}ue(I=>({...I,...U}))}const v=(C,O,A)=>{const U=Rt(k,A,C);if(_a(U,O)){oe[C]&&ue(q=>({...q,[C]:void 0}));return}const I=ic(C,U);if(I){ue(q=>({...q,[C]:I}));return}J(C,fe(A,C,U))};j.useEffect(()=>{let C=k,O=!1;_.forEach(A=>{if(!yo(A))return;const U=String(A.key);Rt(C,void 0,U)!=="Yes"&&(C=Dt(C,void 0,U,"Yes"),O=!0)}),O&&(l&&o?o(C):B(C),H(C))},[_,k,l,o]);function N(C,O){const A=C.key;if((A==="relationship_to_insured"||A==="is_registered_owner")&&O){const K=O[O.length-1];if(typeof K=="number"&&K===0)return null}if((A==="purchase_date"||A==="cost_new_value_cents")&&O)return null;if(A==="custom_equipment_value_cents"&&O){const K=Rt(k,O,"vehicle_has_modifications");if(K!=="Yes"&&K!==!0)return null}const U=A==="auto_reason_for_no_insurance"&&p.currentCarrierKey?k[p.currentCarrierKey]==="NoPriorInsurance"?"Reason you are not currently insured":"Reason for lapse in coverage":C.question,I=C.hint,q=Rt(k,O,A),ie=To(C,p)?Yi(k,p):C.required,X=oe[A],ce=K=>{let P=Dt(k,O,A,K);if(C.inputType==="radio"&&C.conditionals){const W=C.conditionals??[];for(const Ce of W){const de=Rt(k,O,A),Te=ji(de,Ce.conditionalType,Ce.conditionalValue),_e=ji(K,Ce.conditionalType,Ce.conditionalValue);if(Te&&!_e&&Ce.conditionalQuestionsAllowMultiple){const ke=Ce.conditionalQuestions??[];if(ke.length>0){const De=fo(A);P=hn(P,[...O??[],De],[]);const Ie=(je,Oe)=>{je.forEach(Re=>{(Re.conditionals??[]).forEach(Ze=>{if(Ze.conditionalQuestionsAllowMultiple){const Ue=fo(Re.key);P=hn(P,[...Oe,Ue],[])}const ct=Ze.conditionalQuestions??[];ct.length>0&&Ie(ct,Oe)})})};Ie(ke,[...O??[],De])}}}}l&&o?o(P):B(P),H(P)};if(A==="vehicle_policy_selections"){const K=k.vehicles__items??[],P=k.drivers__items??[];if(K.length===0)return g.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles first to configure coverage selections."},A);const W=k.driver_vehicle_assignments??{},Ce=P.length>1,de=Oe=>Object.entries(Oe).map(([Re,nt])=>({value:Re,label:nt})),Te=de(oc),_e=de(r0),ke=de(i0),De=(Oe,Re,nt)=>{const Ze=hn(k,["vehicles__items",Oe,Re],nt);l&&o?o(Ze):B(Ze),H(Ze)},Ie=(Oe,Re,nt)=>{const Ze={...W},ct=`v${Oe}`;Ze[ct]={...Ze[ct]??{}},Ze[ct][`d${Re}`]=nt;const Ue=hn(k,["driver_vehicle_assignments"],Ze);l&&o?o(Ue):B(Ue),H(Ue)},je=Oe=>{if(!Ce)return null;const Re=W[`v${Oe}`];if(!Re)return null;const nt=P.map((Ue,Xe)=>Re[`d${Xe}`]??0),Ze=nt.filter(Ue=>Ue>0);if(Ze.length>=2&&Ze.every(Ue=>Ue===Ze[0])&&Ze[0]===50)return`Assignments for Vehicle ${Oe+1} cannot be 50 percent for both Drivers.`;const ct=nt.reduce((Ue,Xe)=>Ue+Xe,0);return ct>0&&ct!==100?`Driver percentages for this vehicle must add up to 100% (currently ${ct}%).`:null};return g.jsx("div",{children:K.map((Oe,Re)=>{const nt=[Oe.year,Oe.make,Oe.model].filter(Boolean).join(" ")||`Vehicle ${Re+1}`,Ze=je(Re),ct=Ue=>typeof Oe[Ue]=="string"?Oe[Ue]:"";return g.jsxs("fieldset",{style:{border:`1px solid ${Ze?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[g.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:nt}),g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px"},children:[g.jsx(Bi,{id:`veh-${Re}-comp`,label:"Comprehensive deductible",required:!0,placeholder:"Select...",options:Te,value:ct("vehicle_comp_deductible"),onChange:Ue=>De(Re,"vehicle_comp_deductible",Ue.currentTarget.value)}),g.jsx(Bi,{id:`veh-${Re}-coll`,label:"Collision deductible",required:!0,placeholder:"Select...",options:Te,value:ct("vehicle_coll_deductible"),onChange:Ue=>De(Re,"vehicle_coll_deductible",Ue.currentTarget.value)}),g.jsx(Bi,{id:`veh-${Re}-tow`,label:"Towing and Labor",required:!0,placeholder:"Select...",options:_e,value:ct("vehicle_towing_and_labor"),onChange:Ue=>De(Re,"vehicle_towing_and_labor",Ue.currentTarget.value)}),g.jsx(Bi,{id:`veh-${Re}-trans`,label:"Transportation expense",required:!0,placeholder:"Select...",options:ke,value:ct("vehicle_transportation_expense"),onChange:Ue=>De(Re,"vehicle_transportation_expense",Ue.currentTarget.value)})]}),Ce&&g.jsxs("div",{style:{marginTop:"16px"},children:[g.jsx("p",{style:{fontWeight:600,margin:"0 0 8px"},children:"Drivers usage (%)"}),g.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:P.map((Ue,Xe)=>{const Wt=[Ue.first_name,Ue.last_name].filter(Boolean).join(" ")||`Driver ${Xe+1}`,Ct=W[`v${Re}`]?.[`d${Xe}`];return g.jsx("div",{style:{flex:"0 0 140px"},children:g.jsx(Ys,{id:`assignment-v${Re}-d${Xe}`,label:`${Wt} %`,value:Ct??"",min:0,max:100,step:1,inputMode:"numeric",onChange:zr=>{const wt=zr.currentTarget.value.replace(/\D+/g,"");Ie(Re,Xe,wt===""?0:Math.min(100,parseInt(wt,10)))}})},`${Re}-${Xe}`)})}),Ze&&g.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:Ze})]})]},Re)})},A)}if(A==="driver_vehicle_assignments"){const K=k.vehicles__items??[],P=k.drivers__items??[];if(y&&P.length<=1)return null;if(K.length===0||P.length===0)return g.jsx("p",{style:{color:"#666",fontStyle:"italic"},children:"Add vehicles and drivers first to configure driver usage percentages."},A);const W=k.driver_vehicle_assignments??{},Ce=(Te,_e,ke)=>{const De={...W},Ie=`v${Te}`;De[Ie]={...De[Ie]??{}},De[Ie][`d${_e}`]=ke,ce(De)},de=Te=>{if(P.length<2)return null;const _e=W[`v${Te}`];if(!_e)return null;const ke=P.map((je,Oe)=>_e[`d${Oe}`]??0),De=ke.filter(je=>je>0);if(De.length>=2&&De.every(je=>je===De[0])&&De[0]===50)return`Assignments for Vehicle ${Te+1} cannot be 50 percent for both Drivers.`;const Ie=ke.reduce((je,Oe)=>je+Oe,0);return Ie>0&&Ie!==100?`Driver percentages for this vehicle must add up to 100% (currently ${Ie}%).`:null};return g.jsxs("div",{children:[g.jsx("h4",{style:{marginBottom:"12px"},children:U}),K.map((Te,_e)=>{const ke=[Te.year,Te.make,Te.model].filter(Boolean).join(" ")||`Vehicle ${_e+1}`,De=de(_e);return g.jsxs("fieldset",{style:{border:`1px solid ${De?"#dc3545":"#ddd"}`,borderRadius:"8px",padding:"16px",marginBottom:"16px"},children:[g.jsx("legend",{style:{fontWeight:600,padding:"0 8px"},children:ke}),g.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px"},children:P.map((Ie,je)=>{const Oe=[Ie.first_name,Ie.last_name].filter(Boolean).join(" ")||`Driver ${je+1}`,Re=W[`v${_e}`]?.[`d${je}`];return g.jsx("div",{style:{flex:"0 0 140px"},children:g.jsx(Ys,{id:`assignment-v${_e}-d${je}`,label:`${Oe} %`,value:Re??"",min:0,max:100,step:1,inputMode:"numeric",onChange:nt=>{const Ze=nt.currentTarget.value.replace(/\D+/g,"");Ce(_e,je,Ze===""?0:Math.min(100,parseInt(Ze,10)))}})},`${_e}-${je}`)})}),De&&g.jsx("p",{style:{color:"#dc3545",fontSize:"0.85rem",marginTop:"8px",marginBottom:0},children:De})]},_e)})]},A)}switch(C.inputType){case"text":{if(A==="vin"&&f){const K=O?O.join("-"):"_root",P=Ee[K]??!1,W=re[K]??null,Ce=[I?`${A}-hint`:null,X?`${A}-error`:null,W?`${A}-vin-error`:null].filter(Boolean).join(" ");return g.jsxs("div",{children:[g.jsx(Xt,{id:A,label:U,hint:I,error:X,required:ie,children:g.jsxs("div",{className:"flex items-end gap-2",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsx("input",{id:A,className:`form-input ${X?"input-error":""}`,"aria-invalid":!!X,"aria-describedby":Ce||void 0,"aria-required":ie||void 0,required:ie,value:Ht(q),maxLength:17,onChange:de=>ce(de.currentTarget.value),onBlur:()=>v(A,"text",O),autoComplete:co[A],type:"text"})}),g.jsx("button",{type:"button",disabled:P||!P_(Ht(q)),className:"btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",onClick:()=>se(O,Ht(q)),children:P?"Looking up...":"Verify VIN"})]})}),W&&g.jsx("p",{id:`${A}-vin-error`,className:"text-sm text-red-600 mt-1",children:W})]},A)}if(A==="sms_code"){const K=Ht(q);return g.jsx(Fs,{id:A,label:U,hint:I,value:K,inputMode:"numeric",pattern:"[0-9]*",maxLength:6,onChange:P=>{const W=P.currentTarget.value.replace(/\D+/g,"").slice(0,6);ce(W)},onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X,autoComplete:co[A]},A)}return A==="license_number"?g.jsx(Fs,{id:A,label:U,hint:I,value:Ht(q),onChange:K=>ce(K.currentTarget.value.replace(/[^A-Z0-9]/gi,"").slice(0,20)),onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X,autoComplete:"off",maxLength:20},A):A==="social_security_number"?g.jsx(Fy,{id:A,label:U,hint:I,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X},A):g.jsx(Fs,{id:A,label:U,hint:I,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"text",O),"aria-required":ie||void 0,error:X,autoComplete:co[A],maxLength:uE[A]},A)}case"email":return g.jsx(Yy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"email",O),"aria-required":ie||void 0,error:X},A);case"password":return g.jsx(Py,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"password",O),"aria-required":ie||void 0,error:X},A);case"tel":return g.jsxs(g.Fragment,{children:[g.jsx(qy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"tel",O),"aria-required":ie||void 0,error:X},A),A==="phone"&&g.jsxs("div",{className:"mt-3 text-xs text-slate-600 space-y-1",children:[g.jsx("p",{children:"By entering your phone number, you agree to receive a one-time SMS from Credify Insurance with a verification code."}),g.jsx("p",{children:"Message & data rates may apply. One message per request."}),g.jsxs("p",{children:["See our"," ",g.jsx("a",{href:"https://getcredify.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"credify-link-underline",children:"Privacy Policy"})," ","and"," ",g.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 g.jsx(Vy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"url",O),"aria-required":ie||void 0,error:X},A);case"number":{const K=lE[A];return rh.has(A)||oE.has(A)?g.jsx(Gy,{id:A,label:U,hint:I,value:sh(q),isCurrency:rh.has(A),maxDigits:K,onChange:P=>ce(ah(P.currentTarget.value)),onBlur:()=>v(A,"number",O),"aria-required":ie||void 0,error:X},A):g.jsx(Ys,{id:A,label:U,hint:I,value:sh(q),inputMode:"numeric",pattern:"[0-9]*",onKeyDown:P=>{if(iE(P.key)){P.preventDefault();return}K!==void 0&&/^\d$/.test(P.key)&&String(P.currentTarget.value).replace(/\D/g,"").length>=K&&P.preventDefault()},onChange:P=>{let W=P.currentTarget.value;K!==void 0&&(W=W.slice(0,K)),ce(ah(W))},onBlur:()=>v(A,"number",O),"aria-required":ie||void 0,error:X},A)}case"textarea":return g.jsx(Qy,{id:A,label:U,value:Ht(q),onChange:K=>ce(K.currentTarget.value),onBlur:()=>v(A,"textarea",O),"aria-required":ie||void 0,error:X,rows:4},A);case"date":{const{min:K,max:P}=sE(A);return g.jsx(Ky,{id:A,label:U,hint:I,value:Ht(q),min:K,max:P,onChange:W=>{const Ce=W.currentTarget.value;ce(Ce),!_a(Ce,"date")&&!ic(A,Ce)&&J(A,fe(O,A,Ce))},onBlur:()=>v(A,"date",O),"aria-required":ie||void 0,error:X,autoComplete:co[A]},A)}case"checkbox":{if(C.options){const K=Array.isArray(q)?q:[];return g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"form-label",children:[U,ie&&g.jsx("span",{className:"text-red-600 ml-1",children:"*"})]}),g.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:C.options.map(P=>{const W=`${A}-${lc(P)}`,Ce=K.includes(P);return g.jsx(T_,{id:W,label:P,checked:Ce,onChange:de=>{const Te=new Set(K);de.currentTarget.checked?Te.add(P):Te.delete(P),ce(Array.from(Te))},"aria-required":ie||void 0},W)})}),X&&g.jsx("p",{className:"mt-1 text-sm text-red-600",children:X})]},A)}return g.jsx(T_,{id:A,label:ie?`${U} *`:U,checked:!!q,onChange:K=>ce(K.currentTarget.checked),"aria-required":ie||void 0},A)}case"radio":{if(yo(C))return null;const K=C.options??[],P=O&&O.length>0?`${A}__${O.join("__")}`:A;return g.jsx(Wy,{legend:U,legendClassName:ie?"legend-required":void 0,children:K.map(W=>g.jsx(Xy,{name:P,value:W,checked:q===W,onChange:()=>{ce(W),J(A,fe(O,A,W))},children:nh[A]?.[W]??W},`${A}-${lc(W)}`))},A)}case"select":{let K=C.options??[];A==="quote_vehicle_id"&&(K=l?.vehicles__items?.map(de=>de.vin)??[]);let P=!1,W;if(A==="make"||A==="model"||A==="body_style"){const de=O?O.join("-"):"_root",Te=Rt(k,O,"year"),_e=typeof Te=="number"?Te:Number(Te);if(A==="make"){const ke=`${de}:makes`;if(!_e||!Number.isFinite(_e))P=!0,W="Select a year first";else{const De=Me(de,{year:_e});De&&De.length>0?K=De:Q[ke]?(P=!0,W="Loading makes..."):K=[...H1]}}else if(A==="model"){const ke=`${de}:models`,De=String(Rt(k,O,"make")??"");if(!De)P=!0,W="Select a make first";else if(_e&&Number.isFinite(_e)){const Ie=Me(de,{year:_e,make:De});Ie&&Ie.length>0?K=Ie:Q[ke]?(P=!0,W="Loading models..."):K=[...nE]}typeof q=="string"&&q&&!K.includes(q)&&(K=[q,...K])}else{const ke=`${de}:bodyStyles`,De=String(Rt(k,O,"make")??""),Ie=String(Rt(k,O,"model")??"");if(!Ie)P=!0,W="Select a model first";else if(_e&&Number.isFinite(_e)&&De){const je=Me(de,{year:_e,make:De,model:Ie});je&&je.length>0?K=je:Q[ke]?(P=!0,W="Loading body styles..."):K=[...aE]}typeof q=="string"&&q&&!K.includes(q)&&(K=[q,...K])}}if(A==="occupation"||A==="co_applicant_occupation"){const de=A==="co_applicant_occupation"?"co_applicant_employment_industry":void 0,Te=de?void 0:Rt(k,O,"industry"),_e=Rt(k,O,de??"employment_industry"),De=String(Eo(Te??_e)??"").trim();K=[...W_[De]??rE],typeof q=="string"&&q&&!K.includes(q)&&(K=[q,...K])}const Ce=mE(O,A);return g.jsx(Bi,{id:Ce,label:W?`${U} — ${W}`:U,"aria-required":ie||void 0,error:X,disabled:P,value:hE(q),onChange:de=>{const Te=de.currentTarget.value;if(A!=="year"&&A!=="make"&&A!=="model"&&A!=="industry"&&A!=="employment_industry"&&A!=="co_applicant_employment_industry"){ce(Te),J(A,fe(O,A,Te));return}let _e=Dt(k,O,A,Te);if(A==="year")_e=Dt(_e,O,"make",""),_e=Dt(_e,O,"model",""),_e=Dt(_e,O,"body_style","");else if(A==="make")_e=Dt(_e,O,"model",""),_e=Dt(_e,O,"body_style","");else if(A==="model")_e=Dt(_e,O,"body_style","");else if(A==="industry"||A==="employment_industry")_e=Dt(_e,O,"occupation","");else if(A==="co_applicant_employment_industry"){const De=String(Eo(Te)??"").trim(),Ie=W_[De]??[],je=Ie.find(Oe=>Oe===De)??Ie[0]??"";_e=Dt(_e,O,"co_applicant_occupation",je??"")}l&&o?o(_e):B(_e),H(_e);const ke=O?Zi(_e,O)??{}:_e;J(A,{...ke,[A]:Te})},placeholder:W??"Select an option",options:K.map(de=>({value:de,label:nh[A]?.[de]??tE[de]??de}))},Ce)}case"address":return g.jsx(ng,{id:A,label:U,value:Ht(q),onChange:(K,P)=>{let W=Dt(k,O,A,K);const Ce=P?.state??(typeof K=="string"?K.match(/,\s*([A-Z]{2})\s+\d{5}\b/)?.[1]:void 0);if(Ce){const de=O?[...O,"state"]:["state"];W=hn(W,de,Ce)}l&&o?o(W):B(W),H(W)},onBlur:()=>v(A,"address",O),required:ie,"aria-required":ie||void 0,error:X},A);default:return null}}function F(C,O){return C.map((A,U)=>{const I=String(A.key);if(!ho(A,k,p)||!Xs(A,k,O)||!Ws(A,k)||!_o(A,k,m))return null;if(Js(I,A,k,m)){const P=p.currentCarrierKey?k[p.currentCarrierKey]:void 0;if(!(P&&P!=="NoPriorInsurance"&&Rr(k,p)&&Ks.has(I)))return null}const q=N(A,O),ie=A.conditionals??[];if(!ie.length)return m==="BundlePolicy"&&I==="policy_bi"?g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold mt-6 mb-3",children:"Vehicle Coverage Information"}),q]},`wrap-${I}-${U}`):g.jsx("div",{children:q},`wrap-${I}-${U}`);const X=ih(A,Rt(k,O,I)),ce=ie.filter(P=>ji(X,P.conditionalType,P.conditionalValue)),K=ce.length>1&&!ce.some(P=>P.conditionalQuestionsAllowMultiple)?ce.slice(0,1):ce;return g.jsxs("div",{children:[q,K.map((P,W)=>{const Ce=P.conditionalQuestions??[];if(!Ce.length)return null;if(!P.conditionalQuestionsAllowMultiple)return g.jsx("div",{className:"mt-3",children:F(Ce,O)},`branch-${I}-${W}`);const de=fo(I),Te=Zi(k,[...O??[],de])??[],_e=Math.max(1,Te.length||1),ke=()=>{const je=hn(k,[...O??[],de,Te.length],{});l&&o?o(je):B(je),H(je)},De=()=>{const je=Te.slice(0,Math.max(0,Te.length-1)),Oe=hn(k,[...O??[],de],je);l&&o?o(Oe):B(Oe),H(Oe)},Ie=`${I}__c${W}`;return g.jsxs("div",{className:"mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),g.jsxs("div",{className:"space-x-2",children:[g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:ke,children:"Add another"}),_e>1&&g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:De,children:"Remove last"})]})]}),Array.from({length:_e}).map((je,Oe)=>{const Re=[...O??[],de,Oe],nt=`${Ie}__i${Oe}`,Ze=Te[Oe]??{},ct=I==="drivers",Wt=ct?`Driver #${Oe+1}`:I==="vehicles"?`Vehicle #${Oe+1}`:I==="home_losses"||I==="losses"?`Loss #${Oe+1}`:`Entry #${Oe+1}`,zr=ct&&typeof Ze.ssn_display=="string"&&Ze.ssn_display?` — ${Ze.ssn_display}`:"";return g.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[g.jsxs("div",{className:"text-sm font-semibold mb-2",children:[Wt,zr]}),Ce.map(wt=>{const Br=String(wt.key);if(!ho(wt,k,p)||!Xs(wt,k,Re)||!Ws(wt,k)||!_o(wt,k,m))return null;if(Js(Br,wt,k,m)){const gn=p.currentCarrierKey?k[p.currentCarrierKey]:void 0;if(!(gn&&gn!=="NoPriorInsurance"&&Rr(k,p)&&Ks.has(Br)))return null}return g.jsxs("div",{className:"mt-3",children:[N(wt,Re),(()=>{const gn=wt.conditionals??[];if(!gn.length)return null;const ya=Rt(k,Re,wt.key),Jt=gn.filter(Zt=>ji(ya,Zt.conditionalType,Zt.conditionalValue));return(Jt.length>1&&!Jt.some(Zt=>Zt.conditionalQuestionsAllowMultiple)?Jt.slice(0,1):Jt).map((Zt,Ur)=>{const $a=Zt.conditionalQuestions??[];if(!$a.length)return null;if(!Zt.conditionalQuestionsAllowMultiple)return g.jsx("div",{className:"mt-3",children:F($a,Re)},`nested-${nt}-${Ur}`);const ga=fo(wt.key),$n=Zi(k,[...Re,ga])??[],In=Math.max(1,$n.length||1),Do=()=>{const Tn=hn(k,[...Re,ga,$n.length],{});l&&o?o(Tn):B(Tn),H(Tn)},qi=()=>{const Tn=$n.slice(0,Math.max(0,$n.length-1)),fn=hn(k,[...Re,ga],Tn);l&&o?o(fn):B(fn),H(fn)};return g.jsxs("div",{className:"mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("div",{className:"text-sm font-medium opacity-75",children:"Add one or more entries"}),g.jsxs("div",{className:"space-x-2",children:[g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:Do,children:"Add another"}),In>1&&g.jsx("button",{type:"button",className:"btn-outline px-3 py-1",onClick:qi,children:"Remove last"})]})]}),Array.from({length:In}).map((Tn,fn)=>{const jr=[...Re,ga,fn];return g.jsxs("div",{className:"rounded-lg border p-3 mb-3",children:[g.jsxs("div",{className:"text-sm font-semibold mb-2",children:["Entry #",fn+1]}),F($a,jr)]},`nested-item-${nt}-${Ur}-${fn}`)})]},`nested-repeat-${nt}-${Ur}`)})})()]},`${nt}-${Br}`)})]},`group-${nt}`)})]},`branch-${I}-${W}`)})]},`wrap-${I}-${U}`)})}const V=j.useMemo(()=>{const C=[],O=(A,U)=>{A.forEach(I=>{if(!ho(I,k,p)||!Xs(I,k,U)||!Ws(I,k)||!_o(I,k,m))return;const q=String(I.key);if(Js(q,I,k,m)){const P=p.currentCarrierKey?k[p.currentCarrierKey]:void 0;if(!(P&&P!=="NoPriorInsurance"&&Rr(k,p)&&Ks.has(q)))return}yo(I)||C.push(I);const ie=I.conditionals??[];if(!ie.length)return;const X=ih(I,Rt(k,U,q)),ce=ie.filter(P=>ji(X,P.conditionalType,P.conditionalValue));(ce.length>1&&!ce.some(P=>P.conditionalQuestionsAllowMultiple)?ce.slice(0,1):ce).forEach(P=>{const W=P.conditionalQuestions??[];W.length&&(P.conditionalQuestionsAllowMultiple||O(W,U))})})};return O(_),C},[_,k,p,m]);function S(C){C.preventDefault();const O=Yi(k,p),A=V.map(I=>To(I,p)?{...I,required:O}:I),U=Ao(A,k);if(ue(U),Object.keys(U).length>0){const I=V.findIndex(q=>U[q.key]);I>=0&&document.getElementById(V[I].key)?.focus();return}c(k)}return g.jsx("form",{className:"space-y-6 px-1",onSubmit:S,noValidate:!0,children:F(_)})}const yE="GTM-NK8LGHTQ";function gE(){return typeof window>"u"?[]:(window.dataLayer=window.dataLayer??[],window.dataLayer)}function Ha(n,r={}){gE().push({event:n,credifyWidget:{...r,containerId:yE}})}function vE(){Ha("credify_widget_opened")}function ch(){Ha("credify_widget_closed")}function bE(n){Ha("credify_widget_stage_viewed",n)}function fh(n){Ha("credify_widget_stage_completed",n)}function SE(){Ha("credify_widget_flow_completed")}function AE(n){Ha("credify_widget_rates_viewed",n??{})}function EE(){Ha("credify_widget_rates_back")}function TE(n,r){const l=String(n.key??"");if(!No.has(l))return!0;const o=r.state??r.State??r.state??r.State??"";if(typeof o!="string"||!o.trim())return!1;const c=o.trim().toLowerCase();return c==="nj"||c==="n.j."||c==="n.j"||c==="new jersey"}function CE(n){const r=n.state??n.State??n.state??n.State??"";if(typeof r!="string"||!r.trim())return!1;const l=r.trim().toLowerCase();return l==="nj"||l==="n.j."||l==="n.j"||l==="new jersey"}function OE(n,r){const l=String(n??""),o=No.has(l)||l==="has_health_insurance_auto_accident"||l==="is_corporation";return CE(r)&&o}const h0=new Set(["Disabled","Retired","Unemployed","Other"]);function ME(n,r){const l=String(n.key??"");if(l==="co_applicant_occupation"||l!=="occupation")return!0;const o=r.industry,c=r.employment_industry,f=String(o??c??"").trim();return!h0.has(f)}function NE(n,r){const l=String(n.key??"");if(l==="co_applicant_occupation"||l!=="occupation")return!0;const o=r.industry,c=r.employment_industry,f=String(o??c??"").trim();return!h0.has(f)}function p0(n){return n.inputType!=="radio"||!n.options||n.options.length!==1||n.options[0]!=="Yes"?!1:(n.conditionals??[]).some(l=>l.conditionalQuestionsAllowMultiple&&l.conditionalType==="equals"&&l.conditionalValue==="Yes")}function y0(n,r){return p0(n)?"Yes":r}function dh(n){return typeof n=="number"&&Number.isFinite(n)?n:typeof n=="string"&&n.trim()!==""&&!Number.isNaN(Number(n))?Number(n):null}function mh(n){if(n instanceof Date&&!Number.isNaN(n.getTime()))return n.getTime();if(typeof n=="string"){const r=Date.parse(n);return Number.isNaN(r)?null:r}return null}function _h(n,r){const l=dh(n),o=dh(r);if(l!=null&&o!=null)return l-o;const c=mh(n),f=mh(r);return c!=null&&f!=null?c-f:n==null||r==null?null:String(n).localeCompare(String(r))}function DE(n,r){return Array.isArray(n)?n.some(l=>l===r):typeof n=="string"?r!=null&&n.includes(String(r)):!1}function g0(n,r,l){switch(r){case"equals":return n===l;case"notEquals":return n!==l&&n!==""&&n!=null;case"lessThan":{const o=_h(n,l);return o!=null&&o<0}case"greaterThan":{const o=_h(n,l);return o!=null&&o>0}case"contains":return DE(n,l);case"startsWith":return n!=null&&l!=null&&String(n).startsWith(String(l));case"endsWith":return n!=null&&l!=null&&String(n).endsWith(String(l));default:return!1}}const RE=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]);function hh(n,r,l){const o=mc([...n]),c=Ec(o),f=[],m=_=>{_.forEach(p=>{if(!ho(p,r,c)||!ME(p,r)||!TE(p,r)||!_o(p,r,l))return;const y=String(p.key);if(Sc(y,l)&&!OE(y,r)){const H=c.currentCarrierKey?r[c.currentCarrierKey]:void 0;if(!(H&&H!=="NoPriorInsurance"&&Rr(r,c)&&RE.has(y)))return}p0(p)||f.push(p);const b=y0(p,r[y]),w=p.conditionals??[];if(!w.length)return;const B=w.filter(H=>g0(b,H.conditionalType,H.conditionalValue));(B.length>1&&!B.some(H=>H.conditionalQuestionsAllowMultiple)?B.slice(0,1):B).forEach(H=>{const k=H.conditionalQuestions??[];k.length&&(H.conditionalQuestionsAllowMultiple||m(k))})})};return m(o),f}const v0="__items",sc=n=>`${n}${v0}`;function wE(n,r){if(n.key==="relationship_to_insured"||n.key==="is_registered_owner"){const l=r[r.length-1];return typeof l=="number"&&l===0}return!1}function cc(n,r,l=[],o=void 0){for(const c of n){const f=String(c.key),m=y0(c,r[f]),_=c.conditionals??[];if(!_.length)continue;const p=_.filter(b=>g0(m,b.conditionalType,b.conditionalValue)),y=p.length>1&&!p.some(b=>b.conditionalQuestionsAllowMultiple)?p.slice(0,1):p;for(const b of y){const w=b.conditionalQuestions??[];if(!w.length)continue;if(!b.conditionalQuestionsAllowMultiple){if(cc(w,r,l,o))return!0;continue}const B=r[sc(f)]??[];if(B.length===0)return!0;for(const[z,H]of B.entries()){const k=[...l,sc(f),z],oe=w.filter(ye=>!(wE(ye,k)||Sc(String(ye.key),o)||!NE(ye,H))),ue=Ao(oe,H);if(Object.values(ue).some(Boolean)||cc(w,H,k,o))return!0}}}return!1}function ph(n,r,l){return cc(n,r,[],l)}function yh(n){const r=n.vehicles__items??[];if(!Array.isArray(r)||r.length===0)return!1;for(const l of r)if(_a(l.vehicle_comp_deductible,"select")||_a(l.vehicle_coll_deductible,"select")||_a(l.vehicle_towing_and_labor,"select")||_a(l.vehicle_transportation_expense,"select"))return!0;return!1}function xE({stages:n,onStageComplete:r,onComplete:l,initialValues:o,initialActive:c,quoteId:f}){const[m,_]=j.useState(c??0),[p,y]=j.useState(o??{}),[b,w]=j.useState({}),[B,z]=j.useState(!1),[H,k]=j.useState(!1),[oe,ue]=j.useState(null),ye=j.useRef([]),ne=j.useRef(n),le=Array.isArray(n)&&n.length>0,Q=le?Math.min(m,n.length-1):0,pe=le?n[Q]:null,ee=pe?.key??null;j.useEffect(()=>{c!==void 0&&_(c)},[c]),ne.current=n;const Ee=j.useMemo(()=>!!(Q>=n.length-1||n.slice(Q+1).every(N=>N.key==="AutoPolicy")&&(p.drivers__items??[]).length<=1),[Q,n,p]);j.useEffect(()=>{le&&m>=n.length&&_(n.length-1)},[m,n.length,le]),j.useEffect(()=>{const v=ye.current[Q];v&&v.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[Q]),j.useEffect(()=>{o!==void 0&&y(o)},[o]),j.useEffect(()=>{if(!pe||!ee){z(!1),ue(null);return}if(b[ee]){z(!1),ue(null);return}let v=!1;return z(!0),ue(null),Promise.resolve(pe.loadQuestions()).then(N=>{if(!v){if(!Array.isArray(N))throw new Error(`loadQuestions("${ee}") did not return an array`);w(F=>({...F,[ee]:N}))}}).catch(N=>{v||ue(`Failed to load stage "${pe?.title??""}": ${N?.message??"Unknown error"}`)}).finally(()=>{v||z(!1)}),()=>{v=!0}},[pe,ee,b]);const ge=ee?b[ee]:void 0,re=j.useMemo(()=>Ec(mc(ge??[])),[ge]);j.useEffect(()=>{pe&&ee&&ge&&bE({stageKey:ee,stageTitle:pe.title??ee,stepIndex:m+1,totalSteps:n.length})},[ee,m,n.length,pe,ge]);const ae=j.useMemo(()=>{if(!ge)return{};const v={};(V=>{const S=[],C=O=>{O.forEach((A,U)=>{const I=mo(A,U);S.push(I);const q=sc(I);S.push(q),(A.conditionals??[]).forEach(X=>{const ce=X.conditionalQuestions??[];ce.length>0&&C(ce)})})};return C(V),S})(ge).forEach(V=>{V in p&&(v[V]=p[V])});for(const V of["state","State","address","product"])V in p&&(v[V]=p[V]);for(const[V,S]of Object.entries(p))V.endsWith(v0)&&!(V in v)&&(v[V]=S);return v},[ge,p]),se=v=>{y(N=>({...N,...v}))},Me=()=>{_(v=>v>0?v-1:0),document.querySelector(".panel-body")?.scrollTo({top:0,behavior:"instant"})},fe=async()=>{if(!ge||!pe||B||oe||H)return;const v=hh(ge,ae,ee??void 0),N=Yi(p,re),F=v.map(X=>To(X,re)?{...X,required:N}:X),V=Ao(F,ae),S=new Set(F.map((X,ce)=>mo(X,ce))),C=Object.entries(V).some(([X,ce])=>ce&&S.has(X)),O=ph(ge,p,ee??void 0),U=v.some(X=>String(X.key??"")==="vehicle_policy_selections")?yh(p):!1,I=p.driver_vehicle_assignments,q=p.drivers__items??[];let ie=!1;if(I&&q.length>=2){const X=p.vehicles__items??[];for(let ce=0;ce<X.length;ce++){const K=I[`v${ce}`];if(!K)continue;const P=q.map((de,Te)=>K[`d${Te}`]??0),W=P.filter(de=>de>0);if(W.length>=2&&W.every(de=>de===50)){ie=!0;break}const Ce=P.reduce((de,Te)=>de+Te,0);if(Ce>0&&Ce!==100){ie=!0;break}}}if(!(C||O||U||ie)){k(!0);try{const X=Ee,{success:ce,error:K}=X?await l(p,ee??""):await r(ae,ee??"");if(!ce){ue(K??"An error occurred");return}if(!X){const P=ne.current,W=P.findIndex(de=>de.key===ee),Ce=W>=0?Math.min(W+1,P.length-1):Math.min(m+1,P.length-1);_(Ce)}}finally{k(!1)}}},J=j.useMemo(()=>{if(!ge||B||oe||H)return!0;const v=hh(ge,ae,ee??void 0),N=Yi(p,re),F=v.map(X=>To(X,re)?{...X,required:N}:X),V=Ao(F,ae),S=new Set(F.map((X,ce)=>mo(X,ce))),C=Object.entries(V).some(([X,ce])=>ce&&S.has(X)),O=ph(ge,p,ee??void 0),U=v.some(X=>String(X.key??"")==="vehicle_policy_selections")?yh(p):!1,I=p.driver_vehicle_assignments,q=p.drivers__items??[];let ie=!1;if(I&&q.length>=2){const X=p.vehicles__items??[];for(let ce=0;ce<X.length;ce++){const K=I[`v${ce}`];if(!K)continue;const P=q.map((de,Te)=>K[`d${Te}`]??0),W=P.filter(de=>de>0);if(W.length>=2&&W.every(de=>de===50)){ie=!0;break}const Ce=P.reduce((de,Te)=>de+Te,0);if(Ce>0&&Ce!==100){ie=!0;break}}}return C||O||U||ie},[ge,ae,p,B,oe,H,re,ee]);return le?g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"form-wizard-steps-header flex items-center justify-between gap-4",children:[g.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:n.flatMap((v,N)=>[g.jsx("li",{ref:F=>{ye.current[N]=F},className:`form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${N<Q?"bg-blue-600 text-white border-blue-600":N===Q?"border-blue-600 text-blue-600 bg-white":"border-slate-200 text-slate-600"}`,children:v.title},v.key??`stage-${N}`),...N<n.length-1?[g.jsx("li",{className:"form-wizard-step-arrow text-slate-400 flex-shrink-0",children:"→"},`arrow-${v.key??N}`)]:[]])}),g.jsxs("div",{className:"form-wizard-step-counter text-sm text-slate-500 flex-shrink-0",children:[Q+1," / ",n.length]})]}),g.jsxs("div",{children:[B&&g.jsx("div",{className:"text-slate-500",children:"Loading…"}),pe&&g.jsx(pE,{questions:ge??[],controlledValues:ae,onChangeValues:se,onSubmit:()=>fe(),quoteId:f,widgetStageKey:ee??void 0},pe.key)]}),!B&&oe&&g.jsxs("div",{className:"text-red-600 text-sm -mt-4",children:[g.jsx("div",{children:oe}),pe&&g.jsx("button",{type:"button",className:"credify-retry-btn underline mt-1 font-bold",onClick:()=>{w(v=>{if(!ee)return v;const N={...v};return delete N[ee],N})},children:"Retry"})]}),g.jsxs("div",{className:Q>0?"grid grid-cols-2 gap-3":"",children:[Q>0&&g.jsx("button",{type:"button",onClick:Me,disabled:B,className:"credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",children:"Back"}),g.jsxs("button",{type:"button","data-widget-ctrl":"next",onClick:fe,disabled:J,className:["form-wizard-next-btn",Q>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:[H&&g.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:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.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"})]}),Ee?"Finish":"Next"]})]})]}):g.jsx("div",{className:"text-slate-600",children:"Loading..."})}const LE=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),b0={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},gh=["PersonalHome","PersonalAuto","Flood","ExcessFlood"],Hi="rounded-2xl border-2 border-blue-300 bg-blue-50/30 p-4 shadow-blue-100/60 ring-1 ring-blue-100",$i="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",vh="w-full max-w-md min-w-0 sm:max-w-[calc((100%-1rem)/2)]",zE="rounded-2xl border-2 border-transparent p-4";function bh({onBack:n}){const r=()=>{EE(),n?.()};return g.jsx("button",{type:"button",onClick:r,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 da({rate:n,status:r,onRequestBind:l,disabled:o,featured:c=!1,showLobLabel:f=!0,showFeaturedBadge:m,className:_}){const p=Number.isFinite(n.term_months)&&n.term_months>0?n.term_months:1,b=(n.monthly_premium_cents!=null?n.monthly_premium_cents:Math.round((n.premium_cents||0)/p))/100,w=LE.format(b),B=r==="loading",z=r==="success",H=!!o||B||z,k=!!(n.effective_date&&n.policy_end_date),oe=n.lob?b0[n.lob]||n.lob:null,ue=m??c;return g.jsxs("div",{className:`flex w-full flex-col rounded-xl bg-white p-6 shadow-sm transition hover:shadow-md ${c?"border-2 border-blue-300 shadow-blue-100/60 ring-1 ring-blue-100":"border border-slate-200"}${_?` ${_}`:""}`,children:[f&&oe&&g.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-slate-500",children:oe}),ue&&g.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"}),g.jsxs("div",{className:"mb-4 flex flex-col items-start gap-2",children:[n.carrier_logo_base64?g.jsx("img",{src:`data:image/png;base64,${n.carrier_logo_base64}`,alt:n.carrier_name,className:"h-12 w-auto max-w-full object-contain"}):g.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:n.carrier_name.charAt(0).toUpperCase()}),g.jsx("h4",{className:"w-full break-words text-left font-semibold text-slate-900",children:n.carrier_name})]}),g.jsx("div",{className:"mb-2",children:g.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:[w,g.jsx("span",{className:"ml-1 text-sm font-medium text-slate-500",children:"/month"})]})}),k&&g.jsx("div",{className:"mb-2",children:g.jsxs("p",{className:"text-xs text-slate-500",children:["Effective ",n.effective_date," - ",n.policy_end_date]})}),n.carrier_quote_id&&g.jsx("div",{className:"mb-4",children:g.jsxs("p",{className:"text-xs text-slate-400",children:["Quote ID: ",n.carrier_quote_id]})}),g.jsxs("div",{className:"mt-auto pt-4",children:[g.jsx("button",{type:"button",onClick:l,disabled:H,className:`rates-bind-btn w-full rounded-full px-4 py-2.5 text-sm font-semibold transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 disabled:cursor-not-allowed ${z?"rates-bind-btn-requested":"hover:bg-blue-600/90 disabled:bg-slate-300 disabled:text-slate-500"}`,children:B?"Requesting…":z?"Requested":"Request Bind"}),r==="error"&&g.jsx("p",{className:"mt-2 text-xs text-red-600",children:"Something went wrong. Please try again."}),r==="success"&&g.jsx("p",{className:"mt-2 text-xs text-emerald-600",children:"We received your bind request."})]})]})}function BE({rates:n,onBack:r,isBundleFlow:l=!1}){const o=Array.isArray(n)?n:[],c=o.length>0,[f,m]=j.useState({}),[_,p]=j.useState("admitted"),[y,b]=j.useState(!1),w=j.useMemo(()=>o.some(v=>v.lob==="PersonalAuto"),[o]),B=j.useMemo(()=>o.some(v=>v.lob==="PersonalHome"),[o]),z=j.useMemo(()=>{if(!l)return[];const v=[];return w&&v.push("PersonalAuto"),B&&v.push("PersonalHome"),v},[l,w,B]),H=j.useMemo(()=>{const v=new Set;for(const N of o){const F=N.lob??null;F&&f[N.quote_rate_id]==="success"&&v.add(F)}return v},[o,f]),k=j.useMemo(()=>Object.values(f).some(v=>v==="success"),[f]),oe=j.useMemo(()=>y?!0:!l||z.length===0?k:z.every(v=>H.has(v)),[y,l,k,z,H]),ue=j.useMemo(()=>c?o.filter(v=>(v.admitted_status??"admitted")==="admitted"):[],[o,c]),ye=j.useMemo(()=>c?o.filter(v=>v.admitted_status==="non_admitted"):[],[o,c]),ne=ue.length,le=ye.length,Q=ne+le>0;j.useEffect(()=>{Q&&_==="admitted"&&ne===0&&le>0&&p("non_admitted")},[_,ne,le,Q]);const pe=j.useMemo(()=>Q?_==="admitted"?ue:ye:[],[Q,_,ue,ye]);j.useEffect(()=>{uc()},[]),j.useEffect(()=>{!oe||y||(F1(),m0(),b(!0))},[oe,y]);const ee=j.useMemo(()=>{if(pe.length===0)return[];if(!pe.some(V=>V.lob))return[{lob:null,title:"Rates",rates:[...pe].sort((S,C)=>{const O=Number.isFinite(S.term_months)&&S.term_months>0?S.term_months:1,A=Number.isFinite(C.term_months)&&C.term_months>0?C.term_months:1,U=S.monthly_premium_cents??Math.round((S.premium_cents||0)/O),I=C.monthly_premium_cents??Math.round((C.premium_cents||0)/A);return U-I})}];const N=new Map;for(const V of pe){const S=V.lob||"_other",C=N.get(S);C?C.push(V):N.set(S,[V])}return[...N.entries()].sort(([V],[S])=>{const C=gh.indexOf(V),O=gh.indexOf(S);return(C===-1?999:C)-(O===-1?999:O)}).map(([V,S])=>({lob:V,title:b0[V]??V,rates:[...S].sort((C,O)=>{const A=Number.isFinite(C.term_months)&&C.term_months>0?C.term_months:1,U=Number.isFinite(O.term_months)&&O.term_months>0?O.term_months:1,I=C.monthly_premium_cents??Math.round((C.premium_cents||0)/A),q=O.monthly_premium_cents??Math.round((O.premium_cents||0)/U);return I-q})}))},[pe]),Ee=j.useMemo(()=>{if(!l)return[];const v=o.some(V=>V.lob==="PersonalAuto"),N=o.some(V=>V.lob==="PersonalHome"),F=[];return v||F.push("Sorry, no rates found for Personal Auto."),N||F.push("Sorry, no rates found for Homeowners."),F},[l,o]);if(!Q)return g.jsxs("section",{className:"mt-8",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),g.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Sorry, no rates are available at this time."}),r&&g.jsx(bh,{onBack:r})]});const ge=async v=>{m(N=>({...N,[v]:"loading"}));try{if(uc(),!po())throw new Error("Authentication required. Please verify your phone number first.");if(!((await J1(v))?.success!==!1))throw new Error("Request failed");m(S=>({...S,[v]:"success"}))}catch{m(N=>({...N,[v]:"error"}))}},re=ee.find(v=>v.lob==="PersonalAuto"),ae=ee.find(v=>v.lob==="PersonalHome"),se=!!(re?.rates.length&&ae?.rates.length),Me=ee.filter(v=>!se||v.lob!=="PersonalAuto"&&v.lob!=="PersonalHome"),fe=se&&re&&ae?[{rate:re.rates[0]},{rate:ae.rates[0]}]:[],J=fe.length===1;return g.jsxs("section",{className:"mt-8",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Rates"}),Ee.length>0&&g.jsx("div",{className:"mt-3 space-y-1",children:Ee.map(v=>g.jsx("p",{className:"text-sm text-slate-600",children:v},v))}),g.jsx("div",{className:"mt-4 border-b border-slate-200",children:g.jsxs("div",{className:"flex items-center gap-6",children:[g.jsxs("button",{type:"button",onClick:()=>p("admitted"),className:`border-b-2 px-1 py-2 text-sm font-semibold transition ${_==="admitted"?"border-cyan-500 text-slate-900":"border-transparent text-slate-500 hover:text-slate-800"}`,children:["Admitted (",ne,")"]}),g.jsxs("button",{type:"button",onClick:()=>p("non_admitted"),className:`border-b-2 px-1 py-2 text-sm font-semibold transition ${_==="non_admitted"?"border-cyan-500 text-slate-900":"border-transparent text-slate-500 hover:text-slate-800"}`,children:["Non-admitted (",le,")"]})]})}),pe.length===0&&g.jsx("p",{className:"mt-4 text-sm text-slate-500",children:_==="admitted"?"Sorry, no admitted rates are available at this time.":"Sorry, no non-admitted rates are available at this time."}),pe.length>0&&se&&re&&ae&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:J?"mt-6 flex justify-center":"mt-6",children:g.jsxs("div",{className:J?`w-full max-w-md ${Hi}`:Hi,children:[g.jsx("div",{className:$i,children:"Featured Bundle"}),g.jsx("div",{className:J?"grid justify-items-center gap-4":"grid gap-4 sm:grid-cols-2",children:fe.map(({rate:v})=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:v,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:f[v.quote_rate_id]??"idle",disabled:oe||(l?!!(v.lob&&z.includes(v.lob)&&H.has(v.lob)):k),onRequestBind:()=>ge(v.quote_rate_id)})},v.quote_rate_id))})]})}),re.rates.length>1&&g.jsxs("div",{className:"mt-6",children:[g.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",re.title," Options"]}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:re.rates.slice(1).map(v=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:v,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:f[v.quote_rate_id]??"idle",disabled:oe||(l?!!(v.lob&&z.includes(v.lob)&&H.has(v.lob)):k),onRequestBind:()=>ge(v.quote_rate_id)})},v.quote_rate_id))})]}),ae.rates.length>1&&g.jsxs("div",{className:"mt-6",children:[g.jsxs("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:["More ",ae.title," Options"]}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:ae.rates.slice(1).map(v=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:v,featured:!1,showLobLabel:!0,showFeaturedBadge:!1,status:f[v.quote_rate_id]??"idle",disabled:oe||(l?!!(v.lob&&z.includes(v.lob)&&H.has(v.lob)):k),onRequestBind:()=>ge(v.quote_rate_id)})},v.quote_rate_id))})]})]}),pe.length>0&&Me.map(v=>{const[N,...F]=v.rates;return g.jsxs("div",{className:"mt-6",children:[g.jsx("h4",{className:"mb-3 text-base font-semibold text-slate-800",children:v.title}),F.length===0?g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:g.jsx("div",{className:"col-span-full flex justify-center",children:g.jsxs("div",{className:`${vh} ${Hi}`,children:[g.jsx("div",{className:$i,children:"Featured"}),g.jsx(da,{rate:N,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[N.quote_rate_id]??"idle",disabled:oe||(l?!!(N.lob&&z.includes(N.lob)&&H.has(N.lob)):k),onRequestBind:()=>ge(N.quote_rate_id)})]})})}):F.length===1?g.jsxs("div",{className:"grid items-stretch gap-4 sm:grid-cols-2",children:[g.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${Hi}`,children:[g.jsx("div",{className:$i,children:"Featured"}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:g.jsx(da,{rate:N,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[N.quote_rate_id]??"idle",onRequestBind:()=>ge(N.quote_rate_id),disabled:oe||(l?!!(N.lob&&z.includes(N.lob)&&H.has(N.lob)):k),className:"h-full min-h-0"})})]}),g.jsxs("div",{className:`flex h-full min-h-0 w-full min-w-0 flex-col ${zE}`,children:[g.jsx("div",{className:`${$i} pointer-events-none invisible shrink-0`,"aria-hidden":!0,children:"Featured"}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:g.jsx(da,{rate:F[0],featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[F[0].quote_rate_id]??"idle",onRequestBind:()=>ge(F[0].quote_rate_id),disabled:oe||(l?!!(F[0].lob&&z.includes(F[0].lob)&&H.has(F[0].lob)):k),className:"h-full min-h-0"})})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:g.jsx("div",{className:"col-span-full flex justify-center",children:g.jsxs("div",{className:`${vh} ${Hi}`,children:[g.jsx("div",{className:$i,children:"Featured"}),g.jsx(da,{rate:N,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[N.quote_rate_id]??"idle",disabled:oe||(l?!!(N.lob&&z.includes(N.lob)&&H.has(N.lob)):k),onRequestBind:()=>ge(N.quote_rate_id)})]})})}),g.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:F.map(V=>g.jsx("div",{className:"mx-auto w-full min-w-0 max-w-md",children:g.jsx(da,{rate:V,featured:!1,showLobLabel:v.lob==null,showFeaturedBadge:!1,status:f[V.quote_rate_id]??"idle",disabled:oe||(l?!!(V.lob&&z.includes(V.lob)&&H.has(V.lob)):k),onRequestBind:()=>ge(V.quote_rate_id)})},V.quote_rate_id))})]})]},v.lob??"all")}),r&&g.jsx(bh,{onBack:r})]})}const ec=["Validating your details...","Checking underwriting rules...","Applying eligible discounts...","Reviewing your risk profile...","Calculating premium...","Check complete"],Sh={Auto:{label:"Auto Policy",icon:"🚗",accent:"#0369A1"},Home:{label:"Home Policy",icon:"🏠",accent:"#059669"},Bundle:{label:"Home + Auto Bundle",icon:"🔗",accent:"#7C3AED"}},kE=8e3;function UE({progress:n,color:r,size:l=80}){const o=(l-10)/2,c=2*Math.PI*o,f=c-n/100*c;return g.jsxs("svg",{width:l,height:l,style:{transform:"rotate(-90deg)"},children:[g.jsx("circle",{cx:l/2,cy:l/2,r:o,fill:"none",stroke:"#F1F5F9",strokeWidth:6}),g.jsx("circle",{cx:l/2,cy:l/2,r:o,fill:"none",stroke:r,strokeWidth:6,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.2s linear"}})]})}function jE({providers:n=[],totalTime:r=6e4,flow:l="Auto",isComplete:o=!1,onComplete:c}){const f=Sh[l]??Sh.Auto,m=n.length>0?kE:r,[_,p]=j.useState(0),[y,b]=j.useState(0),[w,B]=j.useState(0),[z,H]=j.useState(0),[k,oe]=j.useState(!0),ue=j.useRef(o),ye=j.useRef(c),ne=j.useRef(_),le=j.useRef(n.length),Q=j.useRef(!1),pe=j.useRef(!1);j.useEffect(()=>{ue.current=o},[o]),j.useEffect(()=>{ye.current=c},[c]),j.useEffect(()=>{ne.current=_},[_]),j.useEffect(()=>{le.current=n.length,n.length>0&&(pe.current=!1,p(0),b(0),B(0),H(0),oe(!0))},[n.length]),j.useEffect(()=>{if(n.length===0){ue.current&&!Q.current&&(Q.current=!0,ye.current?.());return}pe.current=!1;const re=100,ae=100/(m/re),se=setInterval(()=>{B(Me=>{if(pe.current||Q.current)return Me;const fe=Me+ae;return fe<100?fe:(pe.current=!0,setTimeout(()=>{if(ue.current){if(Q.current)return;Q.current=!0,ye.current?.();return}const v=ne.current===le.current-1;oe(!1),setTimeout(()=>{v?(p(0),b(N=>N+1)):p(N=>N+1),B(0),H(0),oe(!0)},300)},400),100)})},re);return()=>clearInterval(se)},[_,m,n.length]),j.useEffect(()=>{if(n.length===0)return;const re=Math.floor(m/ec.length),ae=setInterval(()=>H(se=>Math.min(se+1,ec.length-1)),re);return()=>clearInterval(ae)},[_,m,n.length]);const ee=n.length===0,Ee=ee?null:n[Math.min(_,n.length-1)],ge=y>0;return g.jsxs(g.Fragment,{children:[g.jsx("style",{children:`
88
88
  @keyframes providerPulse {
89
89
  0%, 100% { transform: scale(1); }
90
90
  50% { transform: scale(1.05); }
@@ -119,5 +119,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
119
119
  .iq-status-text {
120
120
  animation: statusFadeIn 0.25s ease forwards;
121
121
  }
122
- `}),g.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:g.jsxs("div",{style:{width:"100%",maxWidth:560},children:[g.jsxs("div",{style:{textAlign:"center",marginBottom:40},children:[g.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,background:f.accent+"12",border:`1px solid ${f.accent}30`,borderRadius:100,padding:"6px 16px",marginBottom:16},children:[g.jsx("span",{style:{fontSize:14},children:f.icon}),g.jsx("span",{style:{fontSize:12,fontWeight:700,color:f.accent,letterSpacing:"0.1em",textTransform:"uppercase"},children:f.label})]}),g.jsx("h1",{style:{fontSize:26,fontWeight:700,color:"#0F172A",margin:0,letterSpacing:"-0.02em",lineHeight:1.3},children:ee?"Connecting to top carriers":"Fetching your best rates"}),g.jsx("p",{style:{fontSize:14,color:"#64748B",marginTop:8,marginBottom:0},children:ee?"Identifying the carriers eligible for your quote...":ge?"Still gathering — a few carriers are taking a little longer...":"We're reaching out to multiple insurers on your behalf"})]}),g.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:32},children:ee?g.jsx("div",{style:{display:"flex",gap:20},children:[0,1,2,3,4].map(re=>g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6},children:[g.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${re*.12}s`}}),g.jsx("div",{style:{width:40,height:8,borderRadius:4,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${re*.12}s`}})]},`skeleton-${re}`))}):Ee?g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[g.jsxs("div",{style:{width:64,height:64,borderRadius:18,background:Ee.color+"18",border:`2px solid ${Ee.color}`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:16,color:Ee.color,position:"relative",animation:"providerPulse 1.8s ease-in-out infinite"},children:[Ee.abbr,g.jsx("div",{style:{position:"absolute",inset:-5,borderRadius:22,border:`2px solid ${Ee.color}`,pointerEvents:"none",animation:"ringPulse 1.6s ease-in-out infinite"}})]}),g.jsx("span",{style:{fontSize:13,fontWeight:600,color:Ee.color,letterSpacing:"0.04em"},children:Ee.name})]}):null}),g.jsxs("div",{className:`iq-card-fade ${k?"iq-card-visible":"iq-card-hidden"}`,style:{background:"#FFFFFF",borderRadius:24,border:"1px solid #E2E8F0",padding:32},children:[g.jsx("div",{style:{display:"flex",alignItems:"center",gap:20,marginBottom:28},children:ee||!Ee?g.jsxs("div",{style:{flex:1,textAlign:"center",padding:"8px 0"},children:[g.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 6px"},children:"Please wait"}),g.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:"Checking eligible providers"}),g.jsx("p",{style:{fontSize:13,color:"#64748B",margin:0},children:"Reviewing your details against our carrier network"})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{style:{position:"relative",flexShrink:0},children:[g.jsx(UE,{progress:w,color:Ee.color,size:80}),g.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsxs("span",{style:{fontSize:14,fontWeight:700,color:Ee.color},children:[Math.round(w),"%"]})})]}),g.jsxs("div",{style:{flex:1},children:[g.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 4px"},children:ge?"Still checking":"Now checking"}),g.jsx("h2",{style:{fontSize:20,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:Ee.name}),g.jsx("p",{className:"iq-status-text",style:{fontSize:13,color:"#64748B",margin:0},children:ec[z]},`${_}-${z}`)]})]})}),g.jsxs("div",{children:[g.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.08em",textTransform:"uppercase",margin:"0 0 8px"},children:ee?"Initializing":"Gathering quotes"}),g.jsx("div",{style:{height:6,background:"#F1F5F9",borderRadius:100,overflow:"hidden"},children:g.jsx("div",{style:{height:"100%",width:"35%",background:f.accent,borderRadius:100,animation:"shimmerSlide 1.4s ease-in-out infinite"}})})]})]})]})})]})}const HE={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"}},Ah=["#0369A1","#1D4ED8","#0F766E","#7C3AED","#B45309","#DC2626","#0891B2","#9333EA"];function $E(n){return n.replace(/[^A-Za-z0-9]/g,"").slice(0,3).toUpperCase()||"CAR"}function IE(n){return n.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").trim()}function ZE(n){const r=new Set,l=[];return n.forEach((o,c)=>{const m=HE[o]??{name:IE(o),abbr:$E(o),color:Ah[c%Ah.length]};r.has(m.name)||(r.add(m.name),l.push(m))}),l}function GE(n,r){if(!n)return[];const l=[];return(r==="Auto"||r==="Bundle")&&Array.isArray(n.PersonalAuto)&&l.push(...n.PersonalAuto),(r==="Home"||r==="Bundle")&&Array.isArray(n.PersonalHome)&&l.push(...n.PersonalHome),ZE(l)}function Se(n){if(n===!0)return"Yes";if(n===!1)return"No"}function $t(n){if(n)try{const r=typeof n=="string"?new Date(n):n;return isNaN(r.getTime())?void 0:r.toISOString().split("T")[0]}catch{return}}function FE(n){const r=n,l={};r.phone&&(l.phone=r.phone),r.first_name&&(l.first_name=r.first_name),r.last_name&&(l.last_name=r.last_name),r.email&&(l.email=r.email),r.date_of_birth&&(l.date_of_birth=$t(r.date_of_birth)),r.product&&(l.product=r.product),r.state&&(l.state=r.state);const o=[];r.line_1&&o.push(r.line_1),r.line_2&&o.push(r.line_2),r.city&&o.push(r.city),r.state&&o.push(r.state),r.postal_code&&o.push(r.postal_code),o.length>0&&(l.address=o.join(", ")),r.years_at_address!==null&&r.years_at_address!==void 0&&(l.years_at_address=r.years_at_address),r.months_at_address!==null&&r.months_at_address!==void 0&&(l.months_at_address=r.months_at_address),r.move_in_date&&(l.move_in_date=$t(r.move_in_date));const c=[];r.prior_line_1&&c.push(r.prior_line_1),r.prior_line_2&&c.push(r.prior_line_2),r.prior_city&&c.push(r.prior_city),r.prior_state&&c.push(r.prior_state),r.prior_postal_code&&c.push(r.prior_postal_code),c.length>0&&(l.prior_address=c.join(", ")),r.years_at_prior_address!==null&&r.years_at_prior_address!==void 0&&(l.years_at_prior_address=r.years_at_prior_address),r.is_mailing_address_different!==null&&r.is_mailing_address_different!==void 0&&(l.is_mailing_address_different=Se(r.is_mailing_address_different)),r.mailing_address&&(l.mailing_address=r.mailing_address),r.effective_date&&(l.effective_date=$t(r.effective_date)),r.auto_has_prior_insurance!==null&&r.auto_has_prior_insurance!==void 0&&(l.auto_has_prior_insurance=Se(r.auto_has_prior_insurance)),r.auto_prior_expiration_date&&(l.auto_prior_expiration_date=$t(r.auto_prior_expiration_date)),r.auto_prior_carrier_name&&(l.auto_prior_carrier_name=r.auto_prior_carrier_name),r.auto_prior_liability_limit&&(l.auto_prior_liability_limit=r.auto_prior_liability_limit),r.auto_reason_for_no_insurance&&(l.auto_reason_for_no_insurance=r.auto_reason_for_no_insurance),r.auto_prior_years!==null&&r.auto_prior_years!==void 0&&(l.auto_prior_years=r.auto_prior_years),r.auto_prior_months!==null&&r.auto_prior_months!==void 0&&(l.auto_prior_months=r.auto_prior_months),r.auto_continuous_coverage_years!==null&&r.auto_continuous_coverage_years!==void 0&&(l.auto_continuous_coverage_years=r.auto_continuous_coverage_years),r.auto_cancelled_declined_refused_to_renew!==null&&r.auto_cancelled_declined_refused_to_renew!==void 0&&(l.auto_cancelled_declined_refused_to_renew=Se(r.auto_cancelled_declined_refused_to_renew)),r.auto_current_annual_premium_cents!==null&&r.auto_current_annual_premium_cents!==void 0&&(l.auto_current_annual_premium_cents=r.auto_current_annual_premium_cents),r.policy_bi&&(l.policy_bi=r.policy_bi),r.policy_um&&(l.policy_um=r.policy_um),r.policy_pd&&(l.policy_pd=r.policy_pd),r.policy_mp&&(l.policy_mp=r.policy_mp),r.policy_umpd&&(l.policy_umpd=r.policy_umpd),r.policy_pip&&(l.policy_pip=r.policy_pip),r.policy_auto_death_indemnity&&(l.policy_auto_death_indemnity=r.policy_auto_death_indemnity),r.driver_vehicle_assignments&&(l.driver_vehicle_assignments=r.driver_vehicle_assignments),r.home_has_prior_insurance!==null&&r.home_has_prior_insurance!==void 0&&(l.home_has_prior_insurance=Se(r.home_has_prior_insurance)),r.home_prior_expiration_date&&(l.home_prior_expiration_date=$t(r.home_prior_expiration_date)),r.home_prior_carrier_name&&(l.home_prior_carrier_name=r.home_prior_carrier_name),r.home_prior_years!==null&&r.home_prior_years!==void 0&&(l.home_prior_years=r.home_prior_years),r.home_continuous_coverage_years!==null&&r.home_continuous_coverage_years!==void 0&&(l.home_continuous_coverage_years=r.home_continuous_coverage_years),r.property_insurance_cancelled!==null&&r.property_insurance_cancelled!==void 0&&(l.property_insurance_cancelled=Se(r.property_insurance_cancelled)),r.lapse_in_coverage!==null&&r.lapse_in_coverage!==void 0&&(l.lapse_in_coverage=Se(r.lapse_in_coverage)),r.year_built!==null&&r.year_built!==void 0&&(l.year_built=r.year_built),r.number_of_units!==null&&r.number_of_units!==void 0&&(l.number_of_units=r.number_of_units),r.number_of_stories!==null&&r.number_of_stories!==void 0&&(l.number_of_stories=r.number_of_stories),r.number_of_beds!==null&&r.number_of_beds!==void 0&&(l.number_of_beds=r.number_of_beds),r.number_of_full_baths!==null&&r.number_of_full_baths!==void 0&&(l.number_of_full_baths=r.number_of_full_baths),r.number_of_partial_baths!==null&&r.number_of_partial_baths!==void 0&&(l.number_of_partial_baths=r.number_of_partial_baths),r.under_construction!==null&&r.under_construction!==void 0&&(l.under_construction=Se(r.under_construction)),r.distance_from_fire_hydrant_ft&&(l.distance_from_fire_hydrant_ft=r.distance_from_fire_hydrant_ft),r.distance_from_fire_station_miles&&(l.distance_from_fire_station_miles=r.distance_from_fire_station_miles),r.architectural_style&&(l.architectural_style=r.architectural_style),r.dwelling_type&&(l.dwelling_type=r.dwelling_type),r.construction_quality&&(l.construction_quality=r.construction_quality),r.located_over_water!==null&&r.located_over_water!==void 0&&(l.located_over_water=r.located_over_water),r.construction_type&&(l.construction_type=r.construction_type),r.exterior_wall_type&&(l.exterior_wall_type=r.exterior_wall_type),r.foundation_type&&(l.foundation_type=r.foundation_type),r.roof_material_type&&(l.roof_material_type=r.roof_material_type),r.roof_shape&&(l.roof_shape=r.roof_shape),r.roof_updated_type&&(l.roof_updated_type=r.roof_updated_type),r.year_roof_updated!==null&&r.year_roof_updated!==void 0&&(l.year_roof_updated=r.year_roof_updated),r.mit_credit_form!==null&&r.mit_credit_form!==void 0&&(l.mit_credit_form=Se(r.mit_credit_form)),r.storm_shutters!==null&&r.storm_shutters!==void 0&&(l.storm_shutters=Se(r.storm_shutters)),r.heating_type&&(l.heating_type=r.heating_type),r.oil_tank_location&&(l.oil_tank_location=r.oil_tank_location),r.heating_fuel_type&&(l.heating_fuel_type=r.heating_fuel_type),r.number_of_fireplaces!==null&&r.number_of_fireplaces!==void 0&&(l.number_of_fireplaces=r.number_of_fireplaces),r.basement_type&&(l.basement_type=r.basement_type),r.parking_type&&(l.parking_type=r.parking_type),r.number_of_parking_spaces!==null&&r.number_of_parking_spaces!==void 0&&(l.number_of_parking_spaces=r.number_of_parking_spaces),r.plumbing_type&&(l.plumbing_type=r.plumbing_type),r.pool_type&&(l.pool_type=r.pool_type),r.total_area_sq_ft!==null&&r.total_area_sq_ft!==void 0&&(l.total_area_sq_ft=r.total_area_sq_ft),r.parcel_area_sq_ft!==null&&r.parcel_area_sq_ft!==void 0&&(l.parcel_area_sq_ft=r.parcel_area_sq_ft),r.residence_type&&(l.residence_type=r.residence_type),r.usage_type&&(l.usage_type=r.usage_type),r.household_size!==null&&r.household_size!==void 0&&(l.household_size=r.household_size),r.number_of_mortgagees!==null&&r.number_of_mortgagees!==void 0&&(l.number_of_mortgagees=r.number_of_mortgagees),r.has_dog!==null&&r.has_dog!==void 0&&(l.has_dog=Se(r.has_dog)),r.dog_breed_type&&(l.dog_breed_type=r.dog_breed_type),r.number_of_dogs!==null&&r.number_of_dogs!==void 0&&(l.number_of_dogs=r.number_of_dogs),r.has_vicious_animals!==null&&r.has_vicious_animals!==void 0&&(l.has_vicious_animals=Se(r.has_vicious_animals)),r.has_business_on_premises!==null&&r.has_business_on_premises!==void 0&&(l.has_business_on_premises=Se(r.has_business_on_premises)),r.business_class&&(l.business_class=r.business_class),r.occupancy_type&&(l.occupancy_type=r.occupancy_type),r.short_term_rental!==null&&r.short_term_rental!==void 0&&(l.short_term_rental=Se(r.short_term_rental)),r.sale_price_cents!==null&&r.sale_price_cents!==void 0&&(l.sale_price_cents=Math.round(Number(r.sale_price_cents)/100)),r.number_of_families!==null&&r.number_of_families!==void 0&&(l.number_of_families=r.number_of_families),r.number_of_units_in_firewall!==null&&r.number_of_units_in_firewall!==void 0&&(l.number_of_units_in_firewall=r.number_of_units_in_firewall),r.heating_update_yn!==null&&r.heating_update_yn!==void 0&&(l.heating_update_yn=Se(r.heating_update_yn)),r.heating_update_type&&(l.heating_update_type=r.heating_update_type),r.heating_update_year!==null&&r.heating_update_year!==void 0&&(l.heating_update_year=r.heating_update_year),r.plumbing_update_yn!==null&&r.plumbing_update_yn!==void 0&&(l.plumbing_update_yn=Se(r.plumbing_update_yn)),r.plumbing_update_type&&(l.plumbing_update_type=r.plumbing_update_type),r.plumbing_update_year!==null&&r.plumbing_update_year!==void 0&&(l.plumbing_update_year=r.plumbing_update_year),r.electrical_update_yn!==null&&r.electrical_update_yn!==void 0&&(l.electrical_update_yn=Se(r.electrical_update_yn)),r.electrical_update_type&&(l.electrical_update_type=r.electrical_update_type),r.electrical_update_year!==null&&r.electrical_update_year!==void 0&&(l.electrical_update_year=r.electrical_update_year),r.electric_circuit_breaker!==null&&r.electric_circuit_breaker!==void 0&&(l.electric_circuit_breaker=Se(r.electric_circuit_breaker)),r.dwelling_replacement_cost!==null&&r.dwelling_replacement_cost!==void 0&&(l.dwelling_replacement_cost=r.dwelling_replacement_cost),r.other_structures_coverage!==null&&r.other_structures_coverage!==void 0&&(l.other_structures_coverage=r.other_structures_coverage),r.personal_property_coverage!==null&&r.personal_property_coverage!==void 0&&(l.personal_property_coverage=r.personal_property_coverage),r.loss_of_use_coverage!==null&&r.loss_of_use_coverage!==void 0&&(l.loss_of_use_coverage=r.loss_of_use_coverage),r.personal_liability&&(l.personal_liability=r.personal_liability),r.dwelling_medical_payments&&(l.dwelling_medical_payments=r.dwelling_medical_payments),r.all_perils_deductible&&(l.all_perils_deductible=r.all_perils_deductible),r.windstorm_deductible&&(l.windstorm_deductible=r.windstorm_deductible),r.has_garage!==null&&r.has_garage!==void 0&&(l.has_garage=Se(r.has_garage)),r.has_pool!==null&&r.has_pool!==void 0&&(l.has_pool=Se(r.has_pool)),r.has_trampoline!==null&&r.has_trampoline!==void 0&&(l.has_trampoline=Se(r.has_trampoline)),r.gender&&(l.gender=r.gender),r.marital_status&&(l.marital_status=r.marital_status),r.employment_industry&&(l.employment_industry=r.employment_industry),r.occupation&&(l.occupation=r.occupation),r.has_co_applicant!==null&&r.has_co_applicant!==void 0&&(l.has_co_applicant=Se(r.has_co_applicant)),r.co_applicant_first_name&&(l.co_applicant_first_name=r.co_applicant_first_name),r.co_applicant_middle_name&&(l.co_applicant_middle_name=r.co_applicant_middle_name),r.co_applicant_last_name&&(l.co_applicant_last_name=r.co_applicant_last_name),r.co_applicant_gender&&(l.co_applicant_gender=r.co_applicant_gender),r.co_applicant_marital_status&&(l.co_applicant_marital_status=r.co_applicant_marital_status),r.co_applicant_relationship&&(l.co_applicant_relationship=r.co_applicant_relationship),r.co_applicant_date_of_birth&&(l.co_applicant_date_of_birth=$t(r.co_applicant_date_of_birth)),r.co_applicant_employment_industry&&(l.co_applicant_employment_industry=r.co_applicant_employment_industry),r.co_applicant_occupation&&(l.co_applicant_occupation=r.co_applicant_occupation),r.retiree_discount!==null&&r.retiree_discount!==void 0&&(l.retiree_discount=Se(r.retiree_discount)),r.gated_community_discount!==null&&r.gated_community_discount!==void 0&&(l.gated_community_discount=Se(r.gated_community_discount)),r.multi_policy_discount!==null&&r.multi_policy_discount!==void 0&&(l.multi_policy_discount=Se(r.multi_policy_discount)),r.non_smoker_discount!==null&&r.non_smoker_discount!==void 0&&(l.non_smoker_discount=Se(r.non_smoker_discount)),r.first_time_buyer_discount!==null&&r.first_time_buyer_discount!==void 0&&(l.first_time_buyer_discount=Se(r.first_time_buyer_discount)),r.fire_detection_system!==null&&r.fire_detection_system!==void 0&&(l.fire_detection_system=Se(r.fire_detection_system)),r.burglar_alarm_system!==null&&r.burglar_alarm_system!==void 0&&(l.burglar_alarm_system=Se(r.burglar_alarm_system)),r.burglar_alarm_system_type&&(l.burglar_alarm_system_type=r.burglar_alarm_system_type),r.smoke_detectors!==null&&r.smoke_detectors!==void 0&&(l.smoke_detectors=Se(r.smoke_detectors)),r.sprinkler_system!==null&&r.sprinkler_system!==void 0&&(l.sprinkler_system=Se(r.sprinkler_system)),r.sprinkler_system_type&&(l.sprinkler_system_type=r.sprinkler_system_type),r.gas_leakage_detector!==null&&r.gas_leakage_detector!==void 0&&(l.gas_leakage_detector=Se(r.gas_leakage_detector)),r.deadbolt_locks!==null&&r.deadbolt_locks!==void 0&&(l.deadbolt_locks=Se(r.deadbolt_locks)),r.fire_extinguisher!==null&&r.fire_extinguisher!==void 0&&(l.fire_extinguisher=Se(r.fire_extinguisher)),r.order_credit_authorized!==null&&r.order_credit_authorized!==void 0&&(l.order_credit_authorized=Se(r.order_credit_authorized)),r.has_health_insurance_auto_accident!==null&&r.has_health_insurance_auto_accident!==void 0&&(l.has_health_insurance_auto_accident=Se(r.has_health_insurance_auto_accident)),r.is_corporation!==null&&r.is_corporation!==void 0&&(l.is_corporation=Se(r.is_corporation)),r.named_insured_foreclosure_repo_bankruptcy!==null&&r.named_insured_foreclosure_repo_bankruptcy!==void 0&&(l.named_insured_foreclosure_repo_bankruptcy=Se(r.named_insured_foreclosure_repo_bankruptcy)),r.named_insured_convicted_insurance_fraud!==null&&r.named_insured_convicted_insurance_fraud!==void 0&&(l.named_insured_convicted_insurance_fraud=Se(r.named_insured_convicted_insurance_fraud));const f={};if(r.vehicles)for(const m of r.vehicles)m.quote_vehicle_id&&m.vin&&(f[m.quote_vehicle_id]=m.vin);return r.drivers&&r.drivers.length>0?(l.drivers="Yes",l.drivers__items=r.drivers.map(m=>{const _=m,p={};_.first_name&&(p.first_name=_.first_name),_.middle_name&&(p.middle_name=_.middle_name),_.last_name&&(p.last_name=_.last_name),_.date_of_birth&&(p.date_of_birth=$t(_.date_of_birth)),_.gender&&(p.gender=_.gender),_.marital_status&&(p.marital_status=_.marital_status),_.relationship_to_insured&&(p.relationship_to_insured=_.relationship_to_insured),_.is_registered_owner!==null&&_.is_registered_owner!==void 0&&(p.is_registered_owner=_.is_registered_owner?"Yes":"No"),_.license_state&&(p.license_state=_.license_state),_.license_status&&(p.license_status=_.license_status),_.license_number&&(p.license_number=_.license_number),_.date_first_licensed&&(p.date_first_licensed=$t(_.date_first_licensed)),_.education_level&&(p.education_level=s0(_.education_level)),_.occupation&&(p.occupation=c0(_.occupation)),_.industry&&(p.industry=Eo(_.industry)),_.employment_status&&(p.employment_status=_.employment_status),_.last_5_years_license_suspended_or_revoked!==null&&_.last_5_years_license_suspended_or_revoked!==void 0&&(p.last_5_years_license_suspended_or_revoked=Se(_.last_5_years_license_suspended_or_revoked)),_.accident_prevention_course!==null&&_.accident_prevention_course!==void 0&&(p.accident_prevention_course=Se(_.accident_prevention_course)),_.accident_prevention_course_date&&(p.accident_prevention_course_date=$t(_.accident_prevention_course_date)),_.sr22!==null&&_.sr22!==void 0&&(p.sr22=Se(_.sr22));const y=_.ssn_display;typeof y=="string"&&(p.ssn_display=y);const b=_.driver_violations;b&&b.length>0&&(p.driver_violations="Yes",p.driver_violations__items=b.map(z=>{const H={};return z.code&&(H.code=z.code),z.occurred_at&&(H.occurred_at=$t(z.occurred_at)),H}));const w=_.driver_accidents;w&&w.length>0&&(p.driver_accidents="Yes",p.driver_accidents__items=w.map(z=>{const H={};return z.occurred_at&&(H.occurred_at=$t(z.occurred_at)),z.description&&(H.description=z.description),z.quote_vehicle_id&&(H.quote_vehicle_id=f[z.quote_vehicle_id]??z.quote_vehicle_id),z.property_damage_amount_paid_cents!==null&&z.property_damage_amount_paid_cents!==void 0&&(H.property_damage_amount_paid_cents=z.property_damage_amount_paid_cents),z.personal_injury_amount_paid_cents!==null&&z.personal_injury_amount_paid_cents!==void 0&&(H.personal_injury_amount_paid_cents=z.personal_injury_amount_paid_cents),H}));const B=_.losses;return B&&B.length>0&&(p.losses="Yes",p.losses__items=B.map(z=>{const H={};return z.description&&(H.description=z.description),z.date_of_incident&&(H.date_of_incident=$t(z.date_of_incident)),z.amount_paid_cents!==null&&z.amount_paid_cents!==void 0&&(H.amount_paid_cents=z.amount_paid_cents),z.quote_vehicle_id&&(H.quote_vehicle_id=f[z.quote_vehicle_id]??z.quote_vehicle_id),H})),p})):l.drivers="No",r.vehicles&&r.vehicles.length>0?(l.vehicles="Yes",l.vehicles__items=r.vehicles.map(m=>{const _=m,p={};_.vin&&(p.vin=_.vin),_.year!==null&&_.year!==void 0&&(p.year=String(_.year)),_.make&&(p.make=_.make),_.model&&(p.model=_.model),_.body_style&&(p.body_style=_.body_style),_.ownership_type&&(p.ownership_type=_.ownership_type),_.usage&&(p.usage=_.usage),_.annual_mileage!==null&&_.annual_mileage!==void 0&&(p.annual_mileage=_.annual_mileage),_.miles_to_work!==null&&_.miles_to_work!==void 0&&(p.miles_to_work=_.miles_to_work),_.percent_to_work!==null&&_.percent_to_work!==void 0&&(p.percent_to_work=_.percent_to_work);const y=[];return _.garaging_address_line_1&&y.push(_.garaging_address_line_1),_.garaging_address_line_2&&y.push(_.garaging_address_line_2),_.garaging_address_city&&y.push(_.garaging_address_city),_.garaging_address_state&&y.push(_.garaging_address_state),_.garaging_address_postal_code&&y.push(_.garaging_address_postal_code),y.length>0&&(p.garaging_address=y.join(", ")),_.new_when_purchased!==null&&_.new_when_purchased!==void 0&&(p.new_when_purchased=Se(_.new_when_purchased)),_.purchase_date&&(p.purchase_date=$t(_.purchase_date)),_.anti_theft_type&&(p.anti_theft_type=_.anti_theft_type),_.passive_restraint_type&&(p.passive_restraint_type=_.passive_restraint_type),_.anti_lock_brakes!==null&&_.anti_lock_brakes!==void 0&&(p.anti_lock_brakes=Se(_.anti_lock_brakes)),_.daytime_running_lights!==null&&_.daytime_running_lights!==void 0&&(p.daytime_running_lights=Se(_.daytime_running_lights)),_.custom_equipment_value_cents!==null&&_.custom_equipment_value_cents!==void 0&&(p.custom_equipment_value_cents=_.custom_equipment_value_cents),_.cost_new_value_cents!==null&&_.cost_new_value_cents!==void 0&&(p.cost_new_value_cents=_.cost_new_value_cents),_.stated_value_amount_cents!==null&&_.stated_value_amount_cents!==void 0&&(p.stated_value_amount_cents=_.stated_value_amount_cents),_.vehicle_has_modifications!==null&&_.vehicle_has_modifications!==void 0&&(p.vehicle_has_modifications=Se(_.vehicle_has_modifications)),_.vehicle_garaged_at_residence!==null&&_.vehicle_garaged_at_residence!==void 0&&(p.vehicle_garaged_at_residence=Se(_.vehicle_garaged_at_residence)),_.vehicle_comp_deductible&&(p.vehicle_comp_deductible=_.vehicle_comp_deductible),_.vehicle_coll_deductible&&(p.vehicle_coll_deductible=_.vehicle_coll_deductible),_.vehicle_towing_and_labor&&(p.vehicle_towing_and_labor=_.vehicle_towing_and_labor),_.vehicle_transportation_expense&&(p.vehicle_transportation_expense=_.vehicle_transportation_expense),_.vehicle_full_glass!==null&&_.vehicle_full_glass!==void 0&&(p.vehicle_full_glass=Se(_.vehicle_full_glass)),_.vehicle_loan_lease!==null&&_.vehicle_loan_lease!==void 0&&(p.vehicle_loan_lease=Se(_.vehicle_loan_lease)),_.coverages&&_.coverages.length>0&&(p.coverages__items=_.coverages.map(b=>{const w={};return b.type&&(w.type=b.type),b.per_person_limit_cents!==null&&b.per_person_limit_cents!==void 0&&(w.per_person_limit_cents=b.per_person_limit_cents),b.per_incident_limit_cents!==null&&b.per_incident_limit_cents!==void 0&&(w.per_incident_limit_cents=b.per_incident_limit_cents),b.per_incident_limit_percent!==null&&b.per_incident_limit_percent!==void 0&&(w.per_incident_limit_percent=b.per_incident_limit_percent),b.per_day_limit_cents!==null&&b.per_day_limit_cents!==void 0&&(w.per_day_limit_cents=b.per_day_limit_cents),b.deductible_cents!==null&&b.deductible_cents!==void 0&&(w.deductible_cents=b.deductible_cents),b.is_declined!==null&&b.is_declined!==void 0&&(w.is_declined=Se(b.is_declined)),w})),_.vehicle_lienholders&&_.vehicle_lienholders.length>0&&(p.vehicle_lienholders__items=_.vehicle_lienholders.map(b=>{const w={};return b.name&&(w.name=b.name),b.type&&(w.type=b.type),b.line_1&&(w.line_1=b.line_1),b.line_2&&(w.line_2=b.line_2),b.city&&(w.city=b.city),b.state&&(w.state=b.state),b.postal_code&&(w.postal_code=b.postal_code),b.phone&&(w.phone=b.phone),b.fax&&(w.fax=b.fax),w})),p})):l.vehicles="No",r.losses&&r.losses.length>0&&(l.home_losses="Yes",l.home_losses__items=r.losses.map(m=>{const _={};return m.description&&(_.description=m.description),m.date_of_incident&&(_.date_of_incident=$t(m.date_of_incident)),m.amount_paid_cents!==null&&m.amount_paid_cents!==void 0&&(_.amount_paid_cents=Math.round(Number(m.amount_paid_cents)/100)),_})),l}const YE=new Set(["Product","Driver","Vehicle"]);function qE(n){return n?Array.isArray(n.drivers__items)?n.drivers__items.length:Array.isArray(n.drivers)?n.drivers.length:null:null}function Eh(n,r){const l=qE(r),o=n.filter(f=>f.key!=="AutoPolicy"),c=o.length>0?o:n;return c}function fc(n){const r={},l=y=>{if(typeof y=="string"){if(y==="Yes")return!0;if(y==="No")return!1}return y},o=Object.keys(n).filter(y=>!y.includes("__items")),c=new Set,f=new Set;for(const[y,b]of Object.entries(n))y.endsWith("__items")&&Array.isArray(b)&&(f.add(y.replace("__items","")),b.forEach(w=>{typeof w=="object"&&w!==null&&Object.keys(w).forEach(B=>{c.add(B)})}));for(const[y,b]of Object.entries(n))if(y.endsWith("__items")){const w=y.replace("__items","");if(o.includes(w)){const z=Array.isArray(b)?b.map(H=>fc(H)):b;r[w]=z}}else if(!y.includes("__items")){if(f.has(y))continue;c.has(y)||(r[y]=l(b))}const m=r.auto_prior_carrier_name;if(typeof m=="string"&&m.trim()!==""){const y=m==="NoPriorInsurance";r.auto_has_prior_insurance=!y,y&&(delete r.auto_prior_years,delete r.auto_prior_months,delete r.auto_prior_expiration_date,delete r.auto_prior_liability_limit,delete r.auto_continuous_coverage_years,delete r.auto_cancelled_declined_refused_to_renew,delete r.auto_current_annual_premium_cents)}const _=r.home_prior_carrier_name;if(typeof _=="string"&&_.trim()!==""){const y=_==="NoPriorInsurance";r.home_has_prior_insurance=!y,y&&(delete r.home_prior_years,delete r.home_continuous_coverage_years,delete r.home_prior_expiration_date,delete r.property_insurance_cancelled)}Array.isArray(r.drivers)&&(r.drivers=r.drivers.map(y=>{if(!y||typeof y!="object")return y;const b={...y};return b.industry=Eo(b.industry),b.education_level=s0(b.education_level),b.occupation=c0(b.occupation),b})),console.log("[DEBUG_TRANSFORM] transformed.drivers type:",typeof r.drivers,"isArray:",Array.isArray(r.drivers),Array.isArray(r.drivers)?`count=${r.drivers.length}`:`value=${JSON.stringify(r.drivers)?.slice(0,100)}`),Array.isArray(r.drivers)&&r.drivers.forEach((y,b)=>{const w=y;console.log(`[DEBUG_TRANSFORM] Driver ${b}:`,{first_name:w.first_name,gender:w.gender,marital_status:w.marital_status,education_level:w.education_level,industry:w.industry,occupation:w.occupation,sr22:w.sr22,keys:Object.keys(w)})});const p=21474836;if("sale_price_cents"in r){const y=r.sale_price_cents;if(typeof y=="number"&&Number.isFinite(y)){const b=Math.trunc(y);if(b>=1){const w=Math.min(b,p);r.sale_price_cents=w*100}}}return Array.isArray(r.home_losses)&&(r.home_losses=r.home_losses.map(y=>{if(!y||typeof y!="object")return y;const b=y,w=b.amount_paid_cents;if(typeof w!="number"||!Number.isFinite(w))return b;const B=Math.trunc(w),z=Math.min(Math.max(B,0),p);return{...b,amount_paid_cents:z*100}})),r}function VE(n,r){const l=n.findIndex(c=>c.key===r);return l<0?r:n[l+1]?.key??r}function S0(n){return n.some(r=>String(r.key)==="BundlePolicy"||String(r.key)==="BundleCustomer")}function Th(n){return S0(n)?"Bundle":n.some(r=>String(r.key)==="Vehicle"||String(r.key)==="Driver")?"Auto":"Home"}const PE={Auto:45e3,Home:5e4,Bundle:1e5};function QE(n,r){if(n!=="AutoCurrentCarrier")return r;const l=r.some(f=>String(f.key)==="auto_cancelled_declined_refused_to_renew"),o=r.some(f=>String(f.key)==="vehicle_policy_selections"),c=[...r];return l||c.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}),o||c.push({question:"Vehicle coverage selections",inputType:"custom",key:"vehicle_policy_selections",required:!1}),c}function KE(n,r){if(n!=="Vehicle")return r;const l=o=>o.map(c=>{const f=c.conditionals?.map(m=>{const _=m.conditionalQuestions??[];return _.length?{...m,conditionalQuestions:l(_)}:m});return String(c.key)!=="vin"?f?{...c,conditionals:f}:c:{...c,required:!1,...f?{conditionals:f}:{}}});return l(r)}function XE({isOpen:n,onClose:r}){const[l,o]=j.useState([]),[c,f]=j.useState(null),m=j.useRef(null);j.useEffect(()=>{m.current=c},[c]);const[_,p]=j.useState(null),[y,b]=j.useState(!1),[w,B]=j.useState(!1),[z,H]=j.useState([]),k=j.useRef(null),[oe,ue]=j.useState(null),[ye,ne]=j.useState(void 0),[le,Q]=j.useState(!1),pe=j.useRef(!1);j.useEffect(()=>{if(!y||w)return;const re=Th(l);let ae=!1;const se=[];let Me=0;const fe=8,J=5e3,v=async()=>{if(ae)return;Me++;try{const{quote:F}=await eh();if(ae)return;const V=F?.appetites??null,S=GE(V,re);if(S.length>0){H(S);return}}catch(F){console.warn("Provider polling: getQuote failed",F)}if(ae||Me>=fe)return;const N=window.setTimeout(v,J);se.push(N)};return v(),()=>{ae=!0,se.forEach(N=>window.clearTimeout(N))}},[y,w,l]);function ee(re){const ae={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 se=re.map(fe=>({key:fe,title:ae[fe]||fe,loadQuestions:async()=>{const J=await V1(fe,m.current??void 0);let v=QE(fe,J.questions);return v=KE(fe,v),v}}));if(re.includes("Vehicle")&&re.includes("Driver")&&re.includes("AutoCurrentCarrier")&&re.includes("Customer")){const fe=se.findIndex(J=>J.key==="Product");if(fe>=0){const J=se.slice(0,fe+1),v=se.slice(fe+1),N=S=>v.find(C=>C.key===S)??null,F=[N("Vehicle"),N("Driver"),N("AutoCurrentCarrier"),N("Customer")].filter(S=>!!S),V=v.filter(S=>!["Vehicle","Driver","AutoCurrentCarrier","Customer","AutoPolicy"].includes(String(S.key)));se=[...J,...F,...V]}}return se}j.useEffect(()=>{const re=async()=>{try{const ae=I1();if(uc(),ae){Q(!0),f(ae);try{const se=po(),Me=await eh(se?void 0:ae);if(!Me||!Me.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:fe}=Me,{stages:J}=await so(ae),v=ee(J);o(v);let N;try{N=FE(fe),ue(N)}catch(V){throw new Error(`Failed to transform quote data: ${V instanceof Error?V.message:"Unknown error"}`)}const F=Eh(v,N);if(o(F),fe.current_stage){const V=fe.current_stage==="State"?"Product":fe.current_stage,S=F.findIndex(C=>C.key===V);S>=0?ne(S):ne(F.length-1)}else ne(F.length-1)}catch(se){const Me=se;if(Me.statusCode===404)f0(),f(null);else if(Me.statusCode===401){m0();try{const{stages:fe}=await so(ae),J=ee(fe);o(J);const v=J.findIndex(N=>N.key==="SMSVerification");v>=0&&ne(v)}catch{}}}finally{Q(!1)}}else{const{stages:se}=await so();o(ee(se))}}catch{Q(!1)}};n&&!pe.current&&(pe.current=!0,re())},[n]),j.useEffect(()=>{if(!n)return;const{overflow:re}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=re}},[n]);const Ee=j.useCallback(re=>{re.key==="Escape"&&(ch(),r())},[r]);if(j.useEffect(()=>{if(n)return window.addEventListener("keydown",Ee),()=>window.removeEventListener("keydown",Ee)},[n,Ee]),j.useEffect(()=>{n||(ue(null),ne(void 0),Q(!1),b(!1))},[n]),j.useEffect(()=>{n&&vE()},[n]),j.useEffect(()=>{_&&Array.isArray(_)&&AE({rateCount:_.length})},[_]),!n)return null;const ge=()=>{ch(),r()};return g.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"insurance-modal-title",children:[g.jsx("div",{className:"backdrop","aria-hidden":"true"}),g.jsxs("div",{className:"modal-panel bg-white relative w-full max-w-2xl flex flex-col max-h-[90vh] overflow-hidden",role:"document",children:[g.jsx("button",{onClick:ge,className:"modal-close-btn absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-xl","aria-label":"Close",type:"button",children:"×"}),!y&&g.jsx("div",{className:"text-center mb-6",children:g.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's get you the best insurance rates."})}),g.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[y&&(()=>{const re=Th(l);return g.jsx(jE,{providers:z,totalTime:PE[re],flow:re,isComplete:w,onComplete:()=>{b(!1),B(!1),H([]),k.current&&(p(k.current),k.current=null)}})})(),!_&&!y&&g.jsx(g.Fragment,{children:le||l.length===0?g.jsx("div",{className:"flex items-center justify-center py-12",children:g.jsx("div",{className:"text-slate-600",children:"Loading..."})}):g.jsx(xE,{stages:l,initialValues:oe??void 0,initialActive:ye,quoteId:c??void 0,onStageComplete:async(re,ae)=>{try{const se=fc(re);let Me=c,fe=l;const J=fe.findIndex(F=>F.key===ae),v=fe[J],N=VE(fe,ae);if(Me)if(ae==="SMSVerification"){const{isVerified:F,token:V}=await Q1(Me,se.sms_code);if(!F)throw new Error("Invalid SMS code");V&&Y1(V),await Ui({current_stage:N},!1)}else if(ae==="Product"){const{isSupported:F}=await K1(se.state);if(!F)throw new Error("State is not supported");const V=po();await Ui({...se,current_stage:N},!1,V?void 0:Me)}else{const F=po();await Ui({...se,current_stage:N},!1,F?void 0:Me||void 0)}else{const V=(await P1(se.phone))?.quoteId;if(!V||typeof V!="string"||V.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${V}`);Me=V,f(V),$1(V),await Ui({current_stage:N},!1,V)}if(YE.has(ae))try{const{stages:F}=await so(Me||void 0);fe=ee(F),fe=Eh(fe,re),o(fe)}catch(F){console.warn("Unable to refresh stages after flow-shaping step",F)}return fh({stageKey:ae,stageTitle:v?.title??ae,stepIndex:J+1,totalSteps:fe.length}),{success:!0}}catch(se){return{success:!1,error:se instanceof Error?se.message:"An error occurred"}}},onComplete:async re=>{try{const ae=fc(re);if(!c)throw new Error("Quote ID is required");ue(re),H([]),B(!1),k.current=null,b(!0);try{await Ui(ae,!0);const{rates:fe}=await X1();k.current=fe,B(!0)}catch(fe){throw b(!1),fe}const se=l.length,Me=l[se-1];return fh({stageKey:Me?.key??"unknown",stageTitle:Me?.title??"unknown",stepIndex:se,totalSteps:se}),SE(),{success:!0}}catch{return{success:!1,error:"Oops, something went wrong. Please try again later."}}}})})," ",_&&c&&g.jsx(BE,{rates:_,onBack:()=>p(null),isBundleFlow:S0(l)})]}),g.jsx("div",{className:"mt-4 pt-4 border-t border-slate-200",children:g.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})})]})]})}function WE(){const[n,r]=j.useState(!1),l=j.useCallback(c=>{window.parent&&window.parent!==window&&window.parent.postMessage({type:c,source:"credify-insurance-widget"},"*")},[]);j.useEffect(()=>{const c=f=>{if(f.data?.source==="credify-insurance-widget")switch(f.data.type){case"open":r(!0),l("opened");break;case"close":r(!1),l("closed");break;case"init":l("ready");break}};return window.addEventListener("message",c),l("ready"),()=>{window.removeEventListener("message",c)}},[l]);const o=j.useCallback(()=>{r(!1),l("closed")},[l]);return g.jsx(XE,{isOpen:n,onClose:o})}Zy.createRoot(document.getElementById("root")).render(g.jsx(j.StrictMode,{children:g.jsx(WE,{})}));
123
- //# sourceMappingURL=iframe-CxjbazII.js.map
122
+ `}),g.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:g.jsxs("div",{style:{width:"100%",maxWidth:560},children:[g.jsxs("div",{style:{textAlign:"center",marginBottom:40},children:[g.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,background:f.accent+"12",border:`1px solid ${f.accent}30`,borderRadius:100,padding:"6px 16px",marginBottom:16},children:[g.jsx("span",{style:{fontSize:14},children:f.icon}),g.jsx("span",{style:{fontSize:12,fontWeight:700,color:f.accent,letterSpacing:"0.1em",textTransform:"uppercase"},children:f.label})]}),g.jsx("h1",{style:{fontSize:26,fontWeight:700,color:"#0F172A",margin:0,letterSpacing:"-0.02em",lineHeight:1.3},children:ee?"Connecting to top carriers":"Fetching your best rates"}),g.jsx("p",{style:{fontSize:14,color:"#64748B",marginTop:8,marginBottom:0},children:ee?"Identifying the carriers eligible for your quote...":ge?"Still gathering — a few carriers are taking a little longer...":"We're reaching out to multiple insurers on your behalf"})]}),g.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:32},children:ee?g.jsx("div",{style:{display:"flex",gap:20},children:[0,1,2,3,4].map(re=>g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6},children:[g.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${re*.12}s`}}),g.jsx("div",{style:{width:40,height:8,borderRadius:4,background:"#E2E8F0",animation:"skeletonPulse 1.4s ease-in-out infinite",animationDelay:`${re*.12}s`}})]},`skeleton-${re}`))}):Ee?g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[g.jsxs("div",{style:{width:64,height:64,borderRadius:18,background:Ee.color+"18",border:`2px solid ${Ee.color}`,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:16,color:Ee.color,position:"relative",animation:"providerPulse 1.8s ease-in-out infinite"},children:[Ee.abbr,g.jsx("div",{style:{position:"absolute",inset:-5,borderRadius:22,border:`2px solid ${Ee.color}`,pointerEvents:"none",animation:"ringPulse 1.6s ease-in-out infinite"}})]}),g.jsx("span",{style:{fontSize:13,fontWeight:600,color:Ee.color,letterSpacing:"0.04em"},children:Ee.name})]}):null}),g.jsxs("div",{className:`iq-card-fade ${k?"iq-card-visible":"iq-card-hidden"}`,style:{background:"#FFFFFF",borderRadius:24,border:"1px solid #E2E8F0",padding:32},children:[g.jsx("div",{style:{display:"flex",alignItems:"center",gap:20,marginBottom:28},children:ee||!Ee?g.jsxs("div",{style:{flex:1,textAlign:"center",padding:"8px 0"},children:[g.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 6px"},children:"Please wait"}),g.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:"Checking eligible providers"}),g.jsx("p",{style:{fontSize:13,color:"#64748B",margin:0},children:"Reviewing your details against our carrier network"})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{style:{position:"relative",flexShrink:0},children:[g.jsx(UE,{progress:w,color:Ee.color,size:80}),g.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsxs("span",{style:{fontSize:14,fontWeight:700,color:Ee.color},children:[Math.round(w),"%"]})})]}),g.jsxs("div",{style:{flex:1},children:[g.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.1em",textTransform:"uppercase",margin:"0 0 4px"},children:ge?"Still checking":"Now checking"}),g.jsx("h2",{style:{fontSize:20,fontWeight:700,color:"#0F172A",margin:"0 0 6px",letterSpacing:"-0.02em"},children:Ee.name}),g.jsx("p",{className:"iq-status-text",style:{fontSize:13,color:"#64748B",margin:0},children:ec[z]},`${_}-${z}`)]})]})}),g.jsxs("div",{children:[g.jsx("p",{style:{fontSize:11,fontWeight:700,color:"#94A3B8",letterSpacing:"0.08em",textTransform:"uppercase",margin:"0 0 8px"},children:ee?"Initializing":"Gathering quotes"}),g.jsx("div",{style:{height:6,background:"#F1F5F9",borderRadius:100,overflow:"hidden"},children:g.jsx("div",{style:{height:"100%",width:"35%",background:f.accent,borderRadius:100,animation:"shimmerSlide 1.4s ease-in-out infinite"}})})]})]})]})})]})}const HE={SafecoPersonal:{name:"Safeco",abbr:"SFC",color:"#0F337A"},AssuranceAmerica:{name:"Assurance America",abbr:"AA",color:"#2768B5"},CommonWealthCasualty:{name:"Commonwealth Casualty",abbr:"CW",color:"#2D69EC"},Alinsco:{name:"Alinsco",abbr:"AL",color:"#20395D"},ACORDBOLTPersonalAuto:{name:"Bolt Auto",abbr:"BLT",color:"#1F2937"},ACORDBOLTPersonalHome:{name:"Bolt Home",abbr:"BLT",color:"#1F2937"},TwentyFirstCentury:{name:"21st Century",abbr:"21C",color:"#B2392A"},ACentral:{name:"A-Central",abbr:"ACT",color:"#EAAD1D"},AAA:{name:"AAA",abbr:"AAA",color:"#DB461C"},AARP:{name:"AARP",abbr:"ARP",color:"#DB4724"},Acadia:{name:"Acadia",abbr:"ACD",color:"#386B61"},Ace:{name:"ACE",abbr:"ACE",color:"#457D48"},Acuity:{name:"Acuity",abbr:"ACU",color:"#D74630"},AdirondackInsExchange:{name:"Adirondack",abbr:"ADK",color:"#1F5490"},Aegis:{name:"Aegis",abbr:"AEG",color:"#1A4675"},AIC:{name:"AIC",abbr:"AIC",color:"#508F47"},AIG:{name:"AIG",abbr:"AIG",color:"#223572"},AlfaAlliance:{name:"Alfa Alliance",abbr:"ALF",color:"#C13D17"},AllianzOfAmerica:{name:"Allianz",abbr:"ALZ",color:"#003781"},AllianzOfAmericaJefferson:{name:"Allianz Jefferson",abbr:"ALZ",color:"#003781"},Allied:{name:"Allied",abbr:"ALD",color:"#0047BB"},Allmerica:{name:"Allmerica",abbr:"ALM",color:"#003DA5"},Allstate:{name:"Allstate",abbr:"ALS",color:"#002F87"},AmericaFirst:{name:"America First",abbr:"AMF",color:"#003DA5"},AmericanCommerce:{name:"American Commerce",abbr:"ACM",color:"#003DA5"},AmericanFamily:{name:"American Family",abbr:"AMF",color:"#0033A0"},Amica:{name:"Amica",abbr:"AMI",color:"#003DA5"},Ameriprise:{name:"Ameriprise",abbr:"AMP",color:"#003DA5"},ASILloyds:{name:"ASI Lloyds",abbr:"ASI",color:"#003DA5"},Assurant:{name:"Assurant",abbr:"ASR",color:"#0033A0"},AtlasGeneralAgency:{name:"Atlas General",abbr:"ATL",color:"#1F3864"},AustinMutual:{name:"Austin Mutual",abbr:"AUS",color:"#1F3864"},Autoone:{name:"AutoOne",abbr:"AON",color:"#003DA5"},AutoOwners:{name:"Auto-Owners",abbr:"AO",color:"#C8102E"},BadgerMutual:{name:"Badger Mutual",abbr:"BDG",color:"#003DA5"},Balboa:{name:"Balboa",abbr:"BAL",color:"#1F3864"},Bamboo:{name:"Bamboo",abbr:"BMB",color:"#0F4C3A"},Bankers:{name:"Bankers",abbr:"BNK",color:"#1F3864"},BeaconNational:{name:"Beacon National",abbr:"BCN",color:"#003DA5"},BrethernMutual:{name:"Brethren Mutual",abbr:"BRT",color:"#1F3864"},BristolWest:{name:"Bristol West",abbr:"BW",color:"#003DA5"},BunkerHill:{name:"Bunker Hill",abbr:"BHL",color:"#1F3864"},CapitalInsuranceGroup:{name:"Capital Insurance",abbr:"CIG",color:"#003DA5"},Celina:{name:"Celina",abbr:"CEL",color:"#1F3864"},CentralMutualOfOH:{name:"Central Mutual",abbr:"CMO",color:"#003DA5"},Chubb:{name:"Chubb",abbr:"CHB",color:"#000000"},ChubbInsurance:{name:"Chubb",abbr:"CHB",color:"#000000"},Cincinnati:{name:"Cincinnati",abbr:"CIN",color:"#003DA5"},Citizens:{name:"Citizens",abbr:"CTZ",color:"#003DA5"},Clearcover:{name:"Clearcover",abbr:"CC",color:"#00B5E2"},CNA:{name:"CNA",abbr:"CNA",color:"#CC3232"},ColonialPenn:{name:"Colonial Penn",abbr:"CPN",color:"#0072CE"},ColoradoCasualty:{name:"Colorado Casualty",abbr:"COC",color:"#1F3864"},Columbia:{name:"Columbia",abbr:"CLM",color:"#003DA5"},CommerceWest:{name:"Commerce West",abbr:"CMW",color:"#003DA5"},CommonwealthCasualty:{name:"Commonwealth Casualty",abbr:"CW",color:"#1F3864"},ConstitutionalCasualty:{name:"Constitutional Casualty",abbr:"CON",color:"#1F3864"},Cornerstone:{name:"Cornerstone",abbr:"CRN",color:"#1F3864"},Countrywide:{name:"Countrywide",abbr:"CTW",color:"#003DA5"},CSE:{name:"CSE",abbr:"CSE",color:"#003DA5"},Cumberland:{name:"Cumberland",abbr:"CMB",color:"#1F3864"},Cypress:{name:"Cypress",abbr:"CYP",color:"#0F4C3A"},Dairyland:{name:"Dairyland",abbr:"DL",color:"#0072CE"},Deerbrook:{name:"Deerbrook",abbr:"DBK",color:"#1F3864"},Direct:{name:"Direct",abbr:"DIR",color:"#D52B1E"},Donegal:{name:"Donegal",abbr:"DON",color:"#003DA5"},Drive:{name:"Drive",abbr:"DRV",color:"#1F3864"},Electric:{name:"Electric",abbr:"ELC",color:"#003DA5"},EMC:{name:"EMC",abbr:"EMC",color:"#003DA5"},Encompass:{name:"Encompass",abbr:"ENC",color:"#002F87"},Erie:{name:"Erie",abbr:"ERI",color:"#005FAC"},Esurance:{name:"Esurance",abbr:"ESU",color:"#00A6CE"},ExcelsiorInsuranceCompany:{name:"Excelsior",abbr:"EXC",color:"#1F3864"},Explorer:{name:"Explorer",abbr:"EXP",color:"#1F3864"},FairPlan:{name:"FAIR Plan",abbr:"FPN",color:"#1F3864"},FarmBureau:{name:"Farm Bureau",abbr:"FB",color:"#00843D"},Farmers:{name:"Farmers",abbr:"FRM",color:"#1C428B"},Fidelity:{name:"Fidelity",abbr:"FID",color:"#00833F"},FiremansFund:{name:"Fireman's Fund",abbr:"FF",color:"#E31837"},FirstAmerican:{name:"First American",abbr:"FAM",color:"#003DA5"},Foremost:{name:"Foremost",abbr:"FOR",color:"#E31837"},ForemostInsuranceCompany:{name:"Foremost",abbr:"FOR",color:"#E31837"},Geico:{name:"GEICO",abbr:"GEI",color:"#0F4293"},GeneralCasualty:{name:"General Casualty",abbr:"GC",color:"#1F3864"},GermantownMutual:{name:"Germantown Mutual",abbr:"GTM",color:"#1F3864"},GMAC:{name:"GMAC",abbr:"GMA",color:"#003DA5"},Grange:{name:"Grange",abbr:"GRG",color:"#003DA5"},GreatAmerican:{name:"Great American",abbr:"GA",color:"#003DA5"},Grinnell:{name:"Grinnell Mutual",abbr:"GRN",color:"#E31837"},GuideOne:{name:"GuideOne",abbr:"GO",color:"#0072CE"},Hanover:{name:"Hanover",abbr:"HAN",color:"#003DA5"},Harbor:{name:"Harbor",abbr:"HBR",color:"#1F3864"},Harleysville:{name:"Harleysville",abbr:"HRL",color:"#003DA5"},Hartford:{name:"The Hartford",abbr:"HFD",color:"#7F1734"},HartfordOMNI:{name:"Hartford OMNI",abbr:"HOM",color:"#7F1734"},HastingsMutual:{name:"Hastings Mutual",abbr:"HST",color:"#1F3864"},HawkeyeSecurity:{name:"Hawkeye Security",abbr:"HWK",color:"#1F3864"},HDI:{name:"HDI",abbr:"HDI",color:"#00563F"},HippoInsuranceCompany:{name:"Hippo",abbr:"HPO",color:"#00C9A7"},HomeownersOfAmerica:{name:"Homeowners of America",abbr:"HOA",color:"#003DA5"},Homesite:{name:"Homesite",abbr:"HMS",color:"#0033A0"},HoraceMann:{name:"Horace Mann",abbr:"HM",color:"#003DA5"},HoustonGeneral:{name:"Houston General",abbr:"HG",color:"#1F3864"},IFA:{name:"IFA",abbr:"IFA",color:"#003DA5"},ImperialCasualty:{name:"Imperial Casualty",abbr:"IMP",color:"#1F3864"},Indiana:{name:"Indiana Insurance",abbr:"IND",color:"#003DA5"},IndianaFarmers:{name:"Indiana Farmers",abbr:"IFM",color:"#00843D"},Infinity:{name:"Infinity",abbr:"INF",color:"#E31837"},Insurequest:{name:"Insurequest",abbr:"INQ",color:"#1F3864"},Integon:{name:"Integon",abbr:"ITG",color:"#003DA5"},Integrity:{name:"Integrity",abbr:"ITY",color:"#1F3864"},Kemper:{name:"Kemper",abbr:"KMP",color:"#0033A0"},LibertyMutual:{name:"Liberty Mutual",abbr:"LM",color:"#FFD000"},LibertyNorthwest:{name:"Liberty Northwest",abbr:"LNW",color:"#FFD000"},Lloyds:{name:"Lloyd's",abbr:"LLY",color:"#003DA5"},MainStreetAmerica:{name:"Main Street America",abbr:"MSA",color:"#003DA5"},Mapfre:{name:"MAPFRE",abbr:"MAP",color:"#E31837"},MarkelInsuranceCompany:{name:"Markel",abbr:"MKL",color:"#003DA5"},Mendota:{name:"Mendota",abbr:"MND",color:"#1F3864"},MerchantsGroup:{name:"Merchants Group",abbr:"MRC",color:"#003DA5"},Mercury:{name:"Mercury",abbr:"MER",color:"#ED1C24"},Metlife:{name:"MetLife",abbr:"MET",color:"#0090DA"},Metropolitan:{name:"Metropolitan",abbr:"MTP",color:"#0090DA"},MidContinent:{name:"Mid-Continent",abbr:"MC",color:"#003DA5"},MidwesternIndemnity:{name:"Midwestern Indemnity",abbr:"MWI",color:"#003DA5"},Montgomery:{name:"Montgomery",abbr:"MTG",color:"#1F3864"},MSA:{name:"MSA",abbr:"MSA",color:"#003DA5"},MtWashington:{name:"Mt. Washington",abbr:"MTW",color:"#1F3864"},MutualBenefit:{name:"Mutual Benefit",abbr:"MB",color:"#1F3864"},NatGenPremier:{name:"NatGen Premier",abbr:"NGP",color:"#0033A0"},NationalGeneral:{name:"National General",abbr:"NG",color:"#0033A0"},Nationwide:{name:"Nationwide",abbr:"NW",color:"#204D9B"},NationwideScottsdale:{name:"Nationwide Scottsdale",abbr:"NWS",color:"#204D9B"},NewYorkCentralMutual:{name:"NY Central Mutual",abbr:"NYC",color:"#003DA5"},NJManufacturers:{name:"NJM Insurance",abbr:"NJM",color:"#003DA5"},NJSkylands:{name:"NJ Skylands",abbr:"NJS",color:"#003DA5"},Northstar:{name:"Northstar",abbr:"NST",color:"#1F3864"},Occidental:{name:"Occidental",abbr:"OCC",color:"#1F3864"},OhioCasualty:{name:"Ohio Casualty",abbr:"OHC",color:"#003DA5"},OmahaPC:{name:"Omaha P&C",abbr:"OMA",color:"#003DA5"},OneBeacon:{name:"OneBeacon",abbr:"OB",color:"#003DA5"},OregonMutual:{name:"Oregon Mutual",abbr:"ORE",color:"#003DA5"},Palisades:{name:"Palisades",abbr:"PAL",color:"#1F3864"},PeerlessMontgomery:{name:"Peerless Montgomery",abbr:"PRM",color:"#1F3864"},Pekin:{name:"Pekin",abbr:"PEK",color:"#003DA5"},Pemco:{name:"PEMCO",abbr:"PMC",color:"#0072CE"},PennNational:{name:"Penn National",abbr:"PN",color:"#003DA5"},PlymouthRock:{name:"Plymouth Rock",abbr:"PLR",color:"#003DA5"},PreferredMutual:{name:"Preferred Mutual",abbr:"PFM",color:"#003DA5"},Proformance:{name:"Proformance",abbr:"PRF",color:"#1F3864"},Progressive:{name:"Progressive",abbr:"PRG",color:"#0053BA"},Prudential:{name:"Prudential",abbr:"PRU",color:"#0033A0"},PureHighValue:{name:"PURE",abbr:"PUR",color:"#003DA5"},Republic:{name:"Republic",abbr:"REP",color:"#003DA5"},RockfordMutual:{name:"Rockford Mutual",abbr:"RKF",color:"#1F3864"},RoyalAndSunAlliance:{name:"Royal & SunAlliance",abbr:"RSA",color:"#003DA5"},Safeco:{name:"Safeco",abbr:"SFC",color:"#E4002B"},SECURA:{name:"SECURA",abbr:"SEC",color:"#003DA5"},Selective:{name:"Selective",abbr:"SEL",color:"#003DA5"},SouthernCounty:{name:"Southern County",abbr:"SCM",color:"#1F3864"},SouthernMutual:{name:"Southern Mutual",abbr:"SM",color:"#1F3864"},SouthernTrust:{name:"Southern Trust",abbr:"ST",color:"#1F3864"},StPaulTravelers:{name:"St. Paul Travelers",abbr:"SPT",color:"#C8102E"},StandardMutual:{name:"Standard Mutual",abbr:"STM",color:"#1F3864"},StarCasualty:{name:"Star Casualty",abbr:"SC",color:"#1F3864"},StateAuto:{name:"State Auto",abbr:"SA",color:"#003DA5"},StateFarm:{name:"State Farm",abbr:"SF",color:"#CC0717"},StateFarmFloridaInsuranceCompany:{name:"State Farm Florida",abbr:"SFF",color:"#CC0717"},SunshineStateInsuranceCompany:{name:"Sunshine State",abbr:"SSS",color:"#FFC72C"},Travelers:{name:"Travelers",abbr:"TRV",color:"#C8102E"},Tower:{name:"Tower",abbr:"TWR",color:"#1F3864"},TWFG:{name:"TWFG",abbr:"TWF",color:"#003DA5"},Unigard:{name:"Unigard",abbr:"UNG",color:"#1F3864"},UnitedFireAndCasualty:{name:"United Fire & Casualty",abbr:"UFC",color:"#003DA5"},Unitrin:{name:"Unitrin",abbr:"UTN",color:"#003DA5"},Universal:{name:"Universal",abbr:"UNV",color:"#003DA5"},USAA:{name:"USAA",abbr:"USA",color:"#1A3258"},UticaNational:{name:"Utica National",abbr:"UTC",color:"#003DA5"},Victoria:{name:"Victoria",abbr:"VIC",color:"#1F3864"},Wellington:{name:"Wellington",abbr:"WLG",color:"#1F3864"},WestBend:{name:"West Bend",abbr:"WB",color:"#003DA5"},WesternNational:{name:"Western National",abbr:"WN",color:"#003DA5"},WesternReserveGroup:{name:"Western Reserve",abbr:"WR",color:"#003DA5"},Westfield:{name:"Westfield",abbr:"WF",color:"#F05136"},WhiteMountains:{name:"White Mountains",abbr:"WM",color:"#1F3864"},WilsonMutual:{name:"Wilson Mutual",abbr:"WLM",color:"#1F3864"},Windsor:{name:"Windsor",abbr:"WIN",color:"#1F3864"},Zurich:{name:"Zurich",abbr:"ZUR",color:"#003399"}},Ah=["#0369A1","#1D4ED8","#0F766E","#7C3AED","#B45309","#DC2626","#0891B2","#9333EA"];function $E(n){return n.replace(/[^A-Za-z0-9]/g,"").slice(0,3).toUpperCase()||"CAR"}function IE(n){return n.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").trim()}function ZE(n){const r=new Set,l=[];return n.forEach((o,c)=>{const m=HE[o]??{name:IE(o),abbr:$E(o),color:Ah[c%Ah.length]};r.has(m.name)||(r.add(m.name),l.push(m))}),l}function GE(n,r){if(!n)return[];const l=[];return(r==="Auto"||r==="Bundle")&&Array.isArray(n.PersonalAuto)&&l.push(...n.PersonalAuto),(r==="Home"||r==="Bundle")&&Array.isArray(n.PersonalHome)&&l.push(...n.PersonalHome),ZE(l)}function Se(n){if(n===!0)return"Yes";if(n===!1)return"No"}function $t(n){if(n)try{const r=typeof n=="string"?new Date(n):n;return isNaN(r.getTime())?void 0:r.toISOString().split("T")[0]}catch{return}}function FE(n){const r=n,l={};r.phone&&(l.phone=r.phone),r.first_name&&(l.first_name=r.first_name),r.last_name&&(l.last_name=r.last_name),r.email&&(l.email=r.email),r.date_of_birth&&(l.date_of_birth=$t(r.date_of_birth)),r.product&&(l.product=r.product),r.state&&(l.state=r.state);const o=[];r.line_1&&o.push(r.line_1),r.line_2&&o.push(r.line_2),r.city&&o.push(r.city),r.state&&o.push(r.state),r.postal_code&&o.push(r.postal_code),o.length>0&&(l.address=o.join(", ")),r.years_at_address!==null&&r.years_at_address!==void 0&&(l.years_at_address=r.years_at_address),r.months_at_address!==null&&r.months_at_address!==void 0&&(l.months_at_address=r.months_at_address),r.move_in_date&&(l.move_in_date=$t(r.move_in_date));const c=[];r.prior_line_1&&c.push(r.prior_line_1),r.prior_line_2&&c.push(r.prior_line_2),r.prior_city&&c.push(r.prior_city),r.prior_state&&c.push(r.prior_state),r.prior_postal_code&&c.push(r.prior_postal_code),c.length>0&&(l.prior_address=c.join(", ")),r.years_at_prior_address!==null&&r.years_at_prior_address!==void 0&&(l.years_at_prior_address=r.years_at_prior_address),r.is_mailing_address_different!==null&&r.is_mailing_address_different!==void 0&&(l.is_mailing_address_different=Se(r.is_mailing_address_different)),r.mailing_address&&(l.mailing_address=r.mailing_address),r.effective_date&&(l.effective_date=$t(r.effective_date)),r.auto_has_prior_insurance!==null&&r.auto_has_prior_insurance!==void 0&&(l.auto_has_prior_insurance=Se(r.auto_has_prior_insurance)),r.auto_prior_expiration_date&&(l.auto_prior_expiration_date=$t(r.auto_prior_expiration_date)),r.auto_prior_carrier_name&&(l.auto_prior_carrier_name=r.auto_prior_carrier_name),r.auto_prior_liability_limit&&(l.auto_prior_liability_limit=r.auto_prior_liability_limit),r.auto_reason_for_no_insurance&&(l.auto_reason_for_no_insurance=r.auto_reason_for_no_insurance),r.auto_prior_years!==null&&r.auto_prior_years!==void 0&&(l.auto_prior_years=r.auto_prior_years),r.auto_prior_months!==null&&r.auto_prior_months!==void 0&&(l.auto_prior_months=r.auto_prior_months),r.auto_continuous_coverage_years!==null&&r.auto_continuous_coverage_years!==void 0&&(l.auto_continuous_coverage_years=r.auto_continuous_coverage_years),r.auto_cancelled_declined_refused_to_renew!==null&&r.auto_cancelled_declined_refused_to_renew!==void 0&&(l.auto_cancelled_declined_refused_to_renew=Se(r.auto_cancelled_declined_refused_to_renew)),r.auto_current_annual_premium_cents!==null&&r.auto_current_annual_premium_cents!==void 0&&(l.auto_current_annual_premium_cents=r.auto_current_annual_premium_cents),r.policy_bi&&(l.policy_bi=r.policy_bi),r.policy_um&&(l.policy_um=r.policy_um),r.policy_pd&&(l.policy_pd=r.policy_pd),r.policy_mp&&(l.policy_mp=r.policy_mp),r.policy_umpd&&(l.policy_umpd=r.policy_umpd),r.policy_pip&&(l.policy_pip=r.policy_pip),r.policy_auto_death_indemnity&&(l.policy_auto_death_indemnity=r.policy_auto_death_indemnity),r.driver_vehicle_assignments&&(l.driver_vehicle_assignments=r.driver_vehicle_assignments),r.home_has_prior_insurance!==null&&r.home_has_prior_insurance!==void 0&&(l.home_has_prior_insurance=Se(r.home_has_prior_insurance)),r.home_prior_expiration_date&&(l.home_prior_expiration_date=$t(r.home_prior_expiration_date)),r.home_prior_carrier_name&&(l.home_prior_carrier_name=r.home_prior_carrier_name),r.home_prior_years!==null&&r.home_prior_years!==void 0&&(l.home_prior_years=r.home_prior_years),r.home_continuous_coverage_years!==null&&r.home_continuous_coverage_years!==void 0&&(l.home_continuous_coverage_years=r.home_continuous_coverage_years),r.property_insurance_cancelled!==null&&r.property_insurance_cancelled!==void 0&&(l.property_insurance_cancelled=Se(r.property_insurance_cancelled)),r.lapse_in_coverage!==null&&r.lapse_in_coverage!==void 0&&(l.lapse_in_coverage=Se(r.lapse_in_coverage)),r.year_built!==null&&r.year_built!==void 0&&(l.year_built=r.year_built),r.number_of_units!==null&&r.number_of_units!==void 0&&(l.number_of_units=r.number_of_units),r.number_of_stories!==null&&r.number_of_stories!==void 0&&(l.number_of_stories=r.number_of_stories),r.number_of_beds!==null&&r.number_of_beds!==void 0&&(l.number_of_beds=r.number_of_beds),r.number_of_full_baths!==null&&r.number_of_full_baths!==void 0&&(l.number_of_full_baths=r.number_of_full_baths),r.number_of_partial_baths!==null&&r.number_of_partial_baths!==void 0&&(l.number_of_partial_baths=r.number_of_partial_baths),r.under_construction!==null&&r.under_construction!==void 0&&(l.under_construction=Se(r.under_construction)),r.distance_from_fire_hydrant_ft&&(l.distance_from_fire_hydrant_ft=r.distance_from_fire_hydrant_ft),r.distance_from_fire_station_miles&&(l.distance_from_fire_station_miles=r.distance_from_fire_station_miles),r.architectural_style&&(l.architectural_style=r.architectural_style),r.dwelling_type&&(l.dwelling_type=r.dwelling_type),r.construction_quality&&(l.construction_quality=r.construction_quality),r.located_over_water!==null&&r.located_over_water!==void 0&&(l.located_over_water=r.located_over_water),r.construction_type&&(l.construction_type=r.construction_type),r.exterior_wall_type&&(l.exterior_wall_type=r.exterior_wall_type),r.foundation_type&&(l.foundation_type=r.foundation_type),r.roof_material_type&&(l.roof_material_type=r.roof_material_type),r.roof_shape&&(l.roof_shape=r.roof_shape),r.roof_updated_type&&(l.roof_updated_type=r.roof_updated_type),r.year_roof_updated!==null&&r.year_roof_updated!==void 0&&(l.year_roof_updated=r.year_roof_updated),r.mit_credit_form!==null&&r.mit_credit_form!==void 0&&(l.mit_credit_form=Se(r.mit_credit_form)),r.storm_shutters!==null&&r.storm_shutters!==void 0&&(l.storm_shutters=Se(r.storm_shutters)),r.heating_type&&(l.heating_type=r.heating_type),r.oil_tank_location&&(l.oil_tank_location=r.oil_tank_location),r.heating_fuel_type&&(l.heating_fuel_type=r.heating_fuel_type),r.number_of_fireplaces!==null&&r.number_of_fireplaces!==void 0&&(l.number_of_fireplaces=r.number_of_fireplaces),r.basement_type&&(l.basement_type=r.basement_type),r.parking_type&&(l.parking_type=r.parking_type),r.number_of_parking_spaces!==null&&r.number_of_parking_spaces!==void 0&&(l.number_of_parking_spaces=r.number_of_parking_spaces),r.plumbing_type&&(l.plumbing_type=r.plumbing_type),r.pool_type&&(l.pool_type=r.pool_type),r.total_area_sq_ft!==null&&r.total_area_sq_ft!==void 0&&(l.total_area_sq_ft=r.total_area_sq_ft),r.parcel_area_sq_ft!==null&&r.parcel_area_sq_ft!==void 0&&(l.parcel_area_sq_ft=r.parcel_area_sq_ft),r.residence_type&&(l.residence_type=r.residence_type),r.usage_type&&(l.usage_type=r.usage_type),r.household_size!==null&&r.household_size!==void 0&&(l.household_size=r.household_size),r.number_of_mortgagees!==null&&r.number_of_mortgagees!==void 0&&(l.number_of_mortgagees=r.number_of_mortgagees),r.has_dog!==null&&r.has_dog!==void 0&&(l.has_dog=Se(r.has_dog)),r.dog_breed_type&&(l.dog_breed_type=r.dog_breed_type),r.number_of_dogs!==null&&r.number_of_dogs!==void 0&&(l.number_of_dogs=r.number_of_dogs),r.has_vicious_animals!==null&&r.has_vicious_animals!==void 0&&(l.has_vicious_animals=Se(r.has_vicious_animals)),r.has_business_on_premises!==null&&r.has_business_on_premises!==void 0&&(l.has_business_on_premises=Se(r.has_business_on_premises)),r.business_class&&(l.business_class=r.business_class),r.occupancy_type&&(l.occupancy_type=r.occupancy_type),r.short_term_rental!==null&&r.short_term_rental!==void 0&&(l.short_term_rental=Se(r.short_term_rental)),r.sale_price_cents!==null&&r.sale_price_cents!==void 0&&(l.sale_price_cents=Math.round(Number(r.sale_price_cents)/100)),r.number_of_families!==null&&r.number_of_families!==void 0&&(l.number_of_families=r.number_of_families),r.number_of_units_in_firewall!==null&&r.number_of_units_in_firewall!==void 0&&(l.number_of_units_in_firewall=r.number_of_units_in_firewall),r.heating_update_yn!==null&&r.heating_update_yn!==void 0&&(l.heating_update_yn=Se(r.heating_update_yn)),r.heating_update_type&&(l.heating_update_type=r.heating_update_type),r.heating_update_year!==null&&r.heating_update_year!==void 0&&(l.heating_update_year=r.heating_update_year),r.plumbing_update_yn!==null&&r.plumbing_update_yn!==void 0&&(l.plumbing_update_yn=Se(r.plumbing_update_yn)),r.plumbing_update_type&&(l.plumbing_update_type=r.plumbing_update_type),r.plumbing_update_year!==null&&r.plumbing_update_year!==void 0&&(l.plumbing_update_year=r.plumbing_update_year),r.electrical_update_yn!==null&&r.electrical_update_yn!==void 0&&(l.electrical_update_yn=Se(r.electrical_update_yn)),r.electrical_update_type&&(l.electrical_update_type=r.electrical_update_type),r.electrical_update_year!==null&&r.electrical_update_year!==void 0&&(l.electrical_update_year=r.electrical_update_year),r.electric_circuit_breaker!==null&&r.electric_circuit_breaker!==void 0&&(l.electric_circuit_breaker=Se(r.electric_circuit_breaker)),r.dwelling_replacement_cost!==null&&r.dwelling_replacement_cost!==void 0&&(l.dwelling_replacement_cost=r.dwelling_replacement_cost),r.other_structures_coverage!==null&&r.other_structures_coverage!==void 0&&(l.other_structures_coverage=r.other_structures_coverage),r.personal_property_coverage!==null&&r.personal_property_coverage!==void 0&&(l.personal_property_coverage=r.personal_property_coverage),r.loss_of_use_coverage!==null&&r.loss_of_use_coverage!==void 0&&(l.loss_of_use_coverage=r.loss_of_use_coverage),r.personal_liability&&(l.personal_liability=r.personal_liability),r.dwelling_medical_payments&&(l.dwelling_medical_payments=r.dwelling_medical_payments),r.all_perils_deductible&&(l.all_perils_deductible=r.all_perils_deductible),r.windstorm_deductible&&(l.windstorm_deductible=r.windstorm_deductible),r.has_garage!==null&&r.has_garage!==void 0&&(l.has_garage=Se(r.has_garage)),r.has_pool!==null&&r.has_pool!==void 0&&(l.has_pool=Se(r.has_pool)),r.has_trampoline!==null&&r.has_trampoline!==void 0&&(l.has_trampoline=Se(r.has_trampoline)),r.gender&&(l.gender=r.gender),r.marital_status&&(l.marital_status=r.marital_status),r.employment_industry&&(l.employment_industry=r.employment_industry),r.occupation&&(l.occupation=r.occupation),r.has_co_applicant!==null&&r.has_co_applicant!==void 0&&(l.has_co_applicant=Se(r.has_co_applicant)),r.co_applicant_first_name&&(l.co_applicant_first_name=r.co_applicant_first_name),r.co_applicant_middle_name&&(l.co_applicant_middle_name=r.co_applicant_middle_name),r.co_applicant_last_name&&(l.co_applicant_last_name=r.co_applicant_last_name),r.co_applicant_gender&&(l.co_applicant_gender=r.co_applicant_gender),r.co_applicant_marital_status&&(l.co_applicant_marital_status=r.co_applicant_marital_status),r.co_applicant_relationship&&(l.co_applicant_relationship=r.co_applicant_relationship),r.co_applicant_date_of_birth&&(l.co_applicant_date_of_birth=$t(r.co_applicant_date_of_birth)),r.co_applicant_employment_industry&&(l.co_applicant_employment_industry=r.co_applicant_employment_industry),r.co_applicant_occupation&&(l.co_applicant_occupation=r.co_applicant_occupation),r.retiree_discount!==null&&r.retiree_discount!==void 0&&(l.retiree_discount=Se(r.retiree_discount)),r.gated_community_discount!==null&&r.gated_community_discount!==void 0&&(l.gated_community_discount=Se(r.gated_community_discount)),r.multi_policy_discount!==null&&r.multi_policy_discount!==void 0&&(l.multi_policy_discount=Se(r.multi_policy_discount)),r.non_smoker_discount!==null&&r.non_smoker_discount!==void 0&&(l.non_smoker_discount=Se(r.non_smoker_discount)),r.first_time_buyer_discount!==null&&r.first_time_buyer_discount!==void 0&&(l.first_time_buyer_discount=Se(r.first_time_buyer_discount)),r.fire_detection_system!==null&&r.fire_detection_system!==void 0&&(l.fire_detection_system=Se(r.fire_detection_system)),r.burglar_alarm_system!==null&&r.burglar_alarm_system!==void 0&&(l.burglar_alarm_system=Se(r.burglar_alarm_system)),r.burglar_alarm_system_type&&(l.burglar_alarm_system_type=r.burglar_alarm_system_type),r.smoke_detectors!==null&&r.smoke_detectors!==void 0&&(l.smoke_detectors=Se(r.smoke_detectors)),r.sprinkler_system!==null&&r.sprinkler_system!==void 0&&(l.sprinkler_system=Se(r.sprinkler_system)),r.sprinkler_system_type&&(l.sprinkler_system_type=r.sprinkler_system_type),r.gas_leakage_detector!==null&&r.gas_leakage_detector!==void 0&&(l.gas_leakage_detector=Se(r.gas_leakage_detector)),r.deadbolt_locks!==null&&r.deadbolt_locks!==void 0&&(l.deadbolt_locks=Se(r.deadbolt_locks)),r.fire_extinguisher!==null&&r.fire_extinguisher!==void 0&&(l.fire_extinguisher=Se(r.fire_extinguisher)),r.order_credit_authorized!==null&&r.order_credit_authorized!==void 0&&(l.order_credit_authorized=Se(r.order_credit_authorized)),r.has_health_insurance_auto_accident!==null&&r.has_health_insurance_auto_accident!==void 0&&(l.has_health_insurance_auto_accident=Se(r.has_health_insurance_auto_accident)),r.is_corporation!==null&&r.is_corporation!==void 0&&(l.is_corporation=Se(r.is_corporation)),r.named_insured_foreclosure_repo_bankruptcy!==null&&r.named_insured_foreclosure_repo_bankruptcy!==void 0&&(l.named_insured_foreclosure_repo_bankruptcy=Se(r.named_insured_foreclosure_repo_bankruptcy)),r.named_insured_convicted_insurance_fraud!==null&&r.named_insured_convicted_insurance_fraud!==void 0&&(l.named_insured_convicted_insurance_fraud=Se(r.named_insured_convicted_insurance_fraud));const f={};if(r.vehicles)for(const m of r.vehicles)m.quote_vehicle_id&&m.vin&&(f[m.quote_vehicle_id]=m.vin);return r.drivers&&r.drivers.length>0?(l.drivers="Yes",l.drivers__items=r.drivers.map(m=>{const _=m,p={};_.first_name&&(p.first_name=_.first_name),_.middle_name&&(p.middle_name=_.middle_name),_.last_name&&(p.last_name=_.last_name),_.date_of_birth&&(p.date_of_birth=$t(_.date_of_birth)),_.gender&&(p.gender=_.gender),_.marital_status&&(p.marital_status=_.marital_status),_.relationship_to_insured&&(p.relationship_to_insured=_.relationship_to_insured),_.is_registered_owner!==null&&_.is_registered_owner!==void 0&&(p.is_registered_owner=_.is_registered_owner?"Yes":"No"),_.license_state&&(p.license_state=_.license_state),_.license_status&&(p.license_status=_.license_status),_.license_number&&(p.license_number=_.license_number),_.date_first_licensed&&(p.date_first_licensed=$t(_.date_first_licensed)),_.education_level&&(p.education_level=s0(_.education_level)),_.occupation&&(p.occupation=c0(_.occupation)),_.industry&&(p.industry=Eo(_.industry)),_.employment_status&&(p.employment_status=_.employment_status),_.last_5_years_license_suspended_or_revoked!==null&&_.last_5_years_license_suspended_or_revoked!==void 0&&(p.last_5_years_license_suspended_or_revoked=Se(_.last_5_years_license_suspended_or_revoked)),_.accident_prevention_course!==null&&_.accident_prevention_course!==void 0&&(p.accident_prevention_course=Se(_.accident_prevention_course)),_.accident_prevention_course_date&&(p.accident_prevention_course_date=$t(_.accident_prevention_course_date)),_.sr22!==null&&_.sr22!==void 0&&(p.sr22=Se(_.sr22));const y=_.ssn_display;typeof y=="string"&&(p.ssn_display=y);const b=_.driver_violations;b&&b.length>0&&(p.driver_violations="Yes",p.driver_violations__items=b.map(z=>{const H={};return z.code&&(H.code=z.code),z.occurred_at&&(H.occurred_at=$t(z.occurred_at)),H}));const w=_.driver_accidents;w&&w.length>0&&(p.driver_accidents="Yes",p.driver_accidents__items=w.map(z=>{const H={};return z.occurred_at&&(H.occurred_at=$t(z.occurred_at)),z.description&&(H.description=z.description),z.quote_vehicle_id&&(H.quote_vehicle_id=f[z.quote_vehicle_id]??z.quote_vehicle_id),z.property_damage_amount_paid_cents!==null&&z.property_damage_amount_paid_cents!==void 0&&(H.property_damage_amount_paid_cents=z.property_damage_amount_paid_cents),z.personal_injury_amount_paid_cents!==null&&z.personal_injury_amount_paid_cents!==void 0&&(H.personal_injury_amount_paid_cents=z.personal_injury_amount_paid_cents),H}));const B=_.losses;return B&&B.length>0&&(p.losses="Yes",p.losses__items=B.map(z=>{const H={};return z.description&&(H.description=z.description),z.date_of_incident&&(H.date_of_incident=$t(z.date_of_incident)),z.amount_paid_cents!==null&&z.amount_paid_cents!==void 0&&(H.amount_paid_cents=z.amount_paid_cents),z.quote_vehicle_id&&(H.quote_vehicle_id=f[z.quote_vehicle_id]??z.quote_vehicle_id),H})),p})):l.drivers="No",r.vehicles&&r.vehicles.length>0?(l.vehicles="Yes",l.vehicles__items=r.vehicles.map(m=>{const _=m,p={};_.vin&&(p.vin=_.vin),_.year!==null&&_.year!==void 0&&(p.year=String(_.year)),_.make&&(p.make=_.make),_.model&&(p.model=_.model),_.body_style&&(p.body_style=_.body_style),_.ownership_type&&(p.ownership_type=_.ownership_type),_.usage&&(p.usage=_.usage),_.annual_mileage!==null&&_.annual_mileage!==void 0&&(p.annual_mileage=_.annual_mileage),_.miles_to_work!==null&&_.miles_to_work!==void 0&&(p.miles_to_work=_.miles_to_work),_.percent_to_work!==null&&_.percent_to_work!==void 0&&(p.percent_to_work=_.percent_to_work);const y=[];return _.garaging_address_line_1&&y.push(_.garaging_address_line_1),_.garaging_address_line_2&&y.push(_.garaging_address_line_2),_.garaging_address_city&&y.push(_.garaging_address_city),_.garaging_address_state&&y.push(_.garaging_address_state),_.garaging_address_postal_code&&y.push(_.garaging_address_postal_code),y.length>0&&(p.garaging_address=y.join(", ")),_.new_when_purchased!==null&&_.new_when_purchased!==void 0&&(p.new_when_purchased=Se(_.new_when_purchased)),_.purchase_date&&(p.purchase_date=$t(_.purchase_date)),_.anti_theft_type&&(p.anti_theft_type=_.anti_theft_type),_.passive_restraint_type&&(p.passive_restraint_type=_.passive_restraint_type),_.anti_lock_brakes!==null&&_.anti_lock_brakes!==void 0&&(p.anti_lock_brakes=Se(_.anti_lock_brakes)),_.daytime_running_lights!==null&&_.daytime_running_lights!==void 0&&(p.daytime_running_lights=Se(_.daytime_running_lights)),_.custom_equipment_value_cents!==null&&_.custom_equipment_value_cents!==void 0&&(p.custom_equipment_value_cents=_.custom_equipment_value_cents),_.cost_new_value_cents!==null&&_.cost_new_value_cents!==void 0&&(p.cost_new_value_cents=_.cost_new_value_cents),_.stated_value_amount_cents!==null&&_.stated_value_amount_cents!==void 0&&(p.stated_value_amount_cents=_.stated_value_amount_cents),_.vehicle_has_modifications!==null&&_.vehicle_has_modifications!==void 0&&(p.vehicle_has_modifications=Se(_.vehicle_has_modifications)),_.vehicle_garaged_at_residence!==null&&_.vehicle_garaged_at_residence!==void 0&&(p.vehicle_garaged_at_residence=Se(_.vehicle_garaged_at_residence)),_.vehicle_comp_deductible&&(p.vehicle_comp_deductible=_.vehicle_comp_deductible),_.vehicle_coll_deductible&&(p.vehicle_coll_deductible=_.vehicle_coll_deductible),_.vehicle_towing_and_labor&&(p.vehicle_towing_and_labor=_.vehicle_towing_and_labor),_.vehicle_transportation_expense&&(p.vehicle_transportation_expense=_.vehicle_transportation_expense),_.vehicle_full_glass!==null&&_.vehicle_full_glass!==void 0&&(p.vehicle_full_glass=Se(_.vehicle_full_glass)),_.vehicle_loan_lease!==null&&_.vehicle_loan_lease!==void 0&&(p.vehicle_loan_lease=Se(_.vehicle_loan_lease)),_.coverages&&_.coverages.length>0&&(p.coverages__items=_.coverages.map(b=>{const w={};return b.type&&(w.type=b.type),b.per_person_limit_cents!==null&&b.per_person_limit_cents!==void 0&&(w.per_person_limit_cents=b.per_person_limit_cents),b.per_incident_limit_cents!==null&&b.per_incident_limit_cents!==void 0&&(w.per_incident_limit_cents=b.per_incident_limit_cents),b.per_incident_limit_percent!==null&&b.per_incident_limit_percent!==void 0&&(w.per_incident_limit_percent=b.per_incident_limit_percent),b.per_day_limit_cents!==null&&b.per_day_limit_cents!==void 0&&(w.per_day_limit_cents=b.per_day_limit_cents),b.deductible_cents!==null&&b.deductible_cents!==void 0&&(w.deductible_cents=b.deductible_cents),b.is_declined!==null&&b.is_declined!==void 0&&(w.is_declined=Se(b.is_declined)),w})),_.vehicle_lienholders&&_.vehicle_lienholders.length>0&&(p.vehicle_lienholders__items=_.vehicle_lienholders.map(b=>{const w={};return b.name&&(w.name=b.name),b.type&&(w.type=b.type),b.line_1&&(w.line_1=b.line_1),b.line_2&&(w.line_2=b.line_2),b.city&&(w.city=b.city),b.state&&(w.state=b.state),b.postal_code&&(w.postal_code=b.postal_code),b.phone&&(w.phone=b.phone),b.fax&&(w.fax=b.fax),w})),p})):l.vehicles="No",r.losses&&r.losses.length>0&&(l.home_losses="Yes",l.home_losses__items=r.losses.map(m=>{const _={};return m.description&&(_.description=m.description),m.date_of_incident&&(_.date_of_incident=$t(m.date_of_incident)),m.amount_paid_cents!==null&&m.amount_paid_cents!==void 0&&(_.amount_paid_cents=Math.round(Number(m.amount_paid_cents)/100)),_})),l}const YE=new Set(["Product","Driver","Vehicle"]);function qE(n){return n?Array.isArray(n.drivers__items)?n.drivers__items.length:Array.isArray(n.drivers)?n.drivers.length:null:null}function Eh(n,r){const l=qE(r),o=n.filter(f=>f.key!=="AutoPolicy"),c=o.length>0?o:n;return c}function fc(n){const r={},l=y=>{if(typeof y=="string"){if(y==="Yes")return!0;if(y==="No")return!1}return y},o=Object.keys(n).filter(y=>!y.includes("__items")),c=new Set,f=new Set;for(const[y,b]of Object.entries(n))y.endsWith("__items")&&Array.isArray(b)&&(f.add(y.replace("__items","")),b.forEach(w=>{typeof w=="object"&&w!==null&&Object.keys(w).forEach(B=>{c.add(B)})}));for(const[y,b]of Object.entries(n))if(y.endsWith("__items")){const w=y.replace("__items","");if(o.includes(w)){const z=Array.isArray(b)?b.map(H=>fc(H)):b;r[w]=z}}else if(!y.includes("__items")){if(f.has(y))continue;c.has(y)||(r[y]=l(b))}const m=r.auto_prior_carrier_name;if(typeof m=="string"&&m.trim()!==""){const y=m==="NoPriorInsurance";r.auto_has_prior_insurance=!y,y&&(delete r.auto_prior_years,delete r.auto_prior_months,delete r.auto_prior_expiration_date,delete r.auto_prior_liability_limit,delete r.auto_continuous_coverage_years,delete r.auto_cancelled_declined_refused_to_renew,delete r.auto_current_annual_premium_cents)}const _=r.home_prior_carrier_name;if(typeof _=="string"&&_.trim()!==""){const y=_==="NoPriorInsurance";r.home_has_prior_insurance=!y,y&&(delete r.home_prior_years,delete r.home_continuous_coverage_years,delete r.home_prior_expiration_date,delete r.property_insurance_cancelled)}Array.isArray(r.drivers)&&(r.drivers=r.drivers.map(y=>{if(!y||typeof y!="object")return y;const b={...y};return b.industry=Eo(b.industry),b.education_level=s0(b.education_level),b.occupation=c0(b.occupation),b})),console.log("[DEBUG_TRANSFORM] transformed.drivers type:",typeof r.drivers,"isArray:",Array.isArray(r.drivers),Array.isArray(r.drivers)?`count=${r.drivers.length}`:`value=${JSON.stringify(r.drivers)?.slice(0,100)}`),Array.isArray(r.drivers)&&r.drivers.forEach((y,b)=>{const w=y;console.log(`[DEBUG_TRANSFORM] Driver ${b}:`,{first_name:w.first_name,gender:w.gender,marital_status:w.marital_status,education_level:w.education_level,industry:w.industry,occupation:w.occupation,sr22:w.sr22,keys:Object.keys(w)})});const p=21474836;if("sale_price_cents"in r){const y=r.sale_price_cents;if(typeof y=="number"&&Number.isFinite(y)){const b=Math.trunc(y);if(b>=1){const w=Math.min(b,p);r.sale_price_cents=w*100}}}return Array.isArray(r.home_losses)&&(r.home_losses=r.home_losses.map(y=>{if(!y||typeof y!="object")return y;const b=y,w=b.amount_paid_cents;if(typeof w!="number"||!Number.isFinite(w))return b;const B=Math.trunc(w),z=Math.min(Math.max(B,0),p);return{...b,amount_paid_cents:z*100}})),r}function VE(n,r){const l=n.findIndex(c=>c.key===r);return l<0?r:n[l+1]?.key??r}function S0(n){return n.some(r=>String(r.key)==="BundlePolicy"||String(r.key)==="BundleCustomer")}function Th(n){return S0(n)?"Bundle":n.some(r=>String(r.key)==="Vehicle"||String(r.key)==="Driver")?"Auto":"Home"}const PE={Auto:45e3,Home:5e4,Bundle:1e5};function QE(n,r){if(n!=="AutoCurrentCarrier")return r;const l=r.some(f=>String(f.key)==="auto_cancelled_declined_refused_to_renew"),o=r.some(f=>String(f.key)==="vehicle_policy_selections"),c=[...r];return l||c.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}),o||c.push({question:"Vehicle coverage selections",inputType:"custom",key:"vehicle_policy_selections",required:!1}),c}function KE(n,r){if(n!=="Vehicle")return r;const l=o=>o.map(c=>{const f=c.conditionals?.map(m=>{const _=m.conditionalQuestions??[];return _.length?{...m,conditionalQuestions:l(_)}:m});return String(c.key)!=="vin"?f?{...c,conditionals:f}:c:{...c,required:!1,...f?{conditionals:f}:{}}});return l(r)}function XE({isOpen:n,onClose:r}){const[l,o]=j.useState([]),[c,f]=j.useState(null),m=j.useRef(null);j.useEffect(()=>{m.current=c},[c]);const[_,p]=j.useState(null),[y,b]=j.useState(!1),[w,B]=j.useState(!1),[z,H]=j.useState([]),k=j.useRef(null),[oe,ue]=j.useState(null),[ye,ne]=j.useState(void 0),[le,Q]=j.useState(!1),pe=j.useRef(!1);j.useEffect(()=>{if(!y||w)return;const re=Th(l);let ae=!1;const se=[];let Me=0;const fe=8,J=5e3,v=async()=>{if(ae)return;Me++;try{const{quote:F}=await eh();if(ae)return;const V=F?.appetites??null,S=GE(V,re);if(S.length>0){H(S);return}}catch(F){console.warn("Provider polling: getQuote failed",F)}if(ae||Me>=fe)return;const N=window.setTimeout(v,J);se.push(N)};return v(),()=>{ae=!0,se.forEach(N=>window.clearTimeout(N))}},[y,w,l]);function ee(re){const ae={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 se=re.map(fe=>({key:fe,title:ae[fe]||fe,loadQuestions:async()=>{const J=await V1(fe,m.current??void 0);let v=QE(fe,J.questions);return v=KE(fe,v),v}}));if(re.includes("Vehicle")&&re.includes("Driver")&&re.includes("AutoCurrentCarrier")&&re.includes("Customer")){const fe=se.findIndex(J=>J.key==="Product");if(fe>=0){const J=se.slice(0,fe+1),v=se.slice(fe+1),N=S=>v.find(C=>C.key===S)??null,F=[N("Vehicle"),N("Driver"),N("AutoCurrentCarrier"),N("Customer")].filter(S=>!!S),V=v.filter(S=>!["Vehicle","Driver","AutoCurrentCarrier","Customer","AutoPolicy"].includes(String(S.key)));se=[...J,...F,...V]}}return se}j.useEffect(()=>{const re=async()=>{try{const ae=I1();if(uc(),ae){Q(!0),f(ae);try{const se=po(),Me=await eh(se?void 0:ae);if(!Me||!Me.quote)throw new Error("Invalid response from getQuote: missing quote data");const{quote:fe}=Me,{stages:J}=await so(ae),v=ee(J);o(v);let N;try{N=FE(fe),ue(N)}catch(V){throw new Error(`Failed to transform quote data: ${V instanceof Error?V.message:"Unknown error"}`)}const F=Eh(v,N);if(o(F),fe.current_stage){const V=fe.current_stage==="State"?"Product":fe.current_stage,S=F.findIndex(C=>C.key===V);S>=0?ne(S):ne(F.length-1)}else ne(F.length-1)}catch(se){const Me=se;if(Me.statusCode===404)f0(),f(null);else if(Me.statusCode===401){m0();try{const{stages:fe}=await so(ae),J=ee(fe);o(J);const v=J.findIndex(N=>N.key==="SMSVerification");v>=0&&ne(v)}catch{}}}finally{Q(!1)}}else{const{stages:se}=await so();o(ee(se))}}catch{Q(!1)}};n&&!pe.current&&(pe.current=!0,re())},[n]),j.useEffect(()=>{if(!n)return;const{overflow:re}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=re}},[n]);const Ee=j.useCallback(re=>{re.key==="Escape"&&(ch(),r())},[r]);if(j.useEffect(()=>{if(n)return window.addEventListener("keydown",Ee),()=>window.removeEventListener("keydown",Ee)},[n,Ee]),j.useEffect(()=>{n||(ue(null),ne(void 0),Q(!1),b(!1))},[n]),j.useEffect(()=>{n&&vE()},[n]),j.useEffect(()=>{_&&Array.isArray(_)&&AE({rateCount:_.length})},[_]),!n)return null;const ge=()=>{ch(),r()};return g.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"insurance-modal-title",children:[g.jsx("div",{className:"backdrop","aria-hidden":"true"}),g.jsxs("div",{className:"modal-panel bg-white relative w-full max-w-2xl flex flex-col max-h-[90vh] overflow-hidden",role:"document",children:[g.jsx("button",{onClick:ge,className:"modal-close-btn absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-xl","aria-label":"Close",type:"button",children:"×"}),!y&&g.jsx("div",{className:"text-center mb-6",children:g.jsx("h2",{id:"insurance-modal-title",className:"h1-title",children:"Let's get you the best insurance rates."})}),g.jsxs("div",{className:"panel-body flex-1 min-h-0 overflow-y-auto",children:[y&&(()=>{const re=Th(l);return g.jsx(jE,{providers:z,totalTime:PE[re],flow:re,isComplete:w,onComplete:()=>{b(!1),B(!1),H([]),k.current&&(p(k.current),k.current=null)}})})(),!_&&!y&&g.jsx(g.Fragment,{children:le||l.length===0?g.jsx("div",{className:"flex items-center justify-center py-12",children:g.jsx("div",{className:"text-slate-600",children:"Loading..."})}):g.jsx(xE,{stages:l,initialValues:oe??void 0,initialActive:ye,quoteId:c??void 0,onStageComplete:async(re,ae)=>{try{const se=fc(re);let Me=c,fe=l;const J=fe.findIndex(F=>F.key===ae),v=fe[J],N=VE(fe,ae);if(Me)if(ae==="SMSVerification"){const{isVerified:F,token:V}=await Q1(Me,se.sms_code);if(!F)throw new Error("Invalid SMS code");V&&Y1(V),await Ui({current_stage:N},!1)}else if(ae==="Product"){const{isSupported:F}=await K1(se.state);if(!F)throw new Error("State is not supported");const V=po();await Ui({...se,current_stage:N},!1,V?void 0:Me)}else{const F=po();await Ui({...se,current_stage:N},!1,F?void 0:Me||void 0)}else{const V=(await P1(se.phone))?.quoteId;if(!V||typeof V!="string"||V.trim()==="")throw new Error(`Failed to create quote - invalid quoteId returned: ${V}`);Me=V,f(V),$1(V),await Ui({current_stage:N},!1,V)}if(YE.has(ae))try{const{stages:F}=await so(Me||void 0);fe=ee(F),fe=Eh(fe,re),o(fe)}catch(F){console.warn("Unable to refresh stages after flow-shaping step",F)}return fh({stageKey:ae,stageTitle:v?.title??ae,stepIndex:J+1,totalSteps:fe.length}),{success:!0}}catch(se){return{success:!1,error:se instanceof Error?se.message:"An error occurred"}}},onComplete:async re=>{try{const ae=fc(re);if(!c)throw new Error("Quote ID is required");ue(re),H([]),B(!1),k.current=null,b(!0);try{await Ui(ae,!0);const{rates:fe}=await X1();k.current=fe,B(!0)}catch(fe){throw b(!1),fe}const se=l.length,Me=l[se-1];return fh({stageKey:Me?.key??"unknown",stageTitle:Me?.title??"unknown",stepIndex:se,totalSteps:se}),SE(),{success:!0}}catch{return{success:!1,error:"Oops, something went wrong. Please try again later."}}}})})," ",_&&c&&g.jsx(BE,{rates:_,onBack:()=>p(null),isBundleFlow:S0(l)})]}),g.jsx("div",{className:"mt-4 pt-4 border-t border-slate-200",children:g.jsx("p",{className:"text-center text-sm text-slate-500",children:"Insurance products offered through Credify Corporation, a licensed insurance agency."})})]})]})}function WE(){const[n,r]=j.useState(!1),l=j.useCallback(c=>{window.parent&&window.parent!==window&&window.parent.postMessage({type:c,source:"credify-insurance-widget"},"*")},[]);j.useEffect(()=>{const c=f=>{if(f.data?.source==="credify-insurance-widget")switch(f.data.type){case"open":r(!0),l("opened");break;case"close":r(!1),l("closed");break;case"init":l("ready");break}};return window.addEventListener("message",c),l("ready"),()=>{window.removeEventListener("message",c)}},[l]);const o=j.useCallback(()=>{r(!1),l("closed")},[l]);return g.jsx(XE,{isOpen:n,onClose:o})}Zy.createRoot(document.getElementById("root")).render(g.jsx(j.StrictMode,{children:g.jsx(WE,{})}));
123
+ //# sourceMappingURL=iframe-oNlz8aW7.js.map