@getcredify/credify-insurance-widget 1.41.0 → 1.42.0

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.
Files changed (65) hide show
  1. package/README.md +91 -0
  2. package/dist/address-BEVwov8q-C8G87tij.js +59 -0
  3. package/dist/api-C7f0dnt7.js +51 -0
  4. package/dist/car-B0hJrE0Z.js +26 -0
  5. package/dist/check-Dfh9u4c0.js +15 -0
  6. package/dist/copy-applicant-offer-B-BIN2o5-BX-QE7Ao.js +56 -0
  7. package/dist/copy-from-record-BNP6CFFR-Bcb9EW-a.js +189 -0
  8. package/dist/core-Po4qPIof-fZL0sXdW.js +417 -0
  9. package/dist/coverageDerivation-CV2ORogj-CAthw76f.js +76 -0
  10. package/dist/credify-insurance-widget.css +1 -1
  11. package/dist/{fixtures-ijbZ16Zg-CD1k11fg.js → fixtures-ijbZ16Zg-Csnryzo8.js} +1 -1
  12. package/dist/household-prefill-DVLBBva1-GGgzEdDL.js +151 -0
  13. package/dist/householdPrefill-DLm3pxFH-B34UGBGP.js +111 -0
  14. package/dist/iframe/assets/address-BEVwov8q-BpbNiia-.js +1 -0
  15. package/dist/iframe/assets/car-DkfXVYz0.js +6 -0
  16. package/dist/iframe/assets/check-l6TGSrXO.js +6 -0
  17. package/dist/iframe/assets/copy-applicant-offer-B-BIN2o5-cs-SCWuH.js +1 -0
  18. package/dist/iframe/assets/copy-from-record-BNP6CFFR-BtCRUQRw.js +6 -0
  19. package/dist/iframe/assets/core-Po4qPIof-jDmdAxP7.js +16 -0
  20. package/dist/iframe/assets/coverageDerivation-CV2ORogj-DhQFAhwv.js +1 -0
  21. package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DO_r0-z3.js +1 -0
  22. package/dist/iframe/assets/{fixtures-ijbZ16Zg-Bj-DhqkB.js → fixtures-ijbZ16Zg-CUQxYANz.js} +1 -1
  23. package/dist/iframe/assets/household-prefill-DVLBBva1-DTK1EHT0.js +1 -0
  24. package/dist/iframe/assets/householdPrefill-DLm3pxFH-BM54Rqyd.js +6 -0
  25. package/dist/iframe/assets/iframe-BImWklE9.js +107 -0
  26. package/dist/iframe/assets/iframe-Bl0qTZgO.css +1 -0
  27. package/dist/iframe/assets/index-CNb9AhPB.js +6 -0
  28. package/dist/iframe/assets/intake-review-panel-B7rXvRvm-wNGntinn.js +1 -0
  29. package/dist/iframe/assets/{mockJump-CL8w249w-D4zKPVys.js → mockJump-DpXrnQUq-DKyp2H5R.js} +1 -1
  30. package/dist/iframe/assets/payload-JXpCaeS6-CcfrGvLo.js +1 -0
  31. package/dist/iframe/assets/question-list-ChcBzofd-D5ZVofFR.js +317 -0
  32. package/dist/iframe/assets/rates-panel-BaIzEqX6-GSsykLkc.js +17 -0
  33. package/dist/iframe/assets/review-panel-DYCuhwdo-CyBebe6T.js +6 -0
  34. package/dist/iframe/assets/stage-Bpq1A5xB-CwZgWOhp.js +1 -0
  35. package/dist/iframe/assets/types-LUGvo5ic-CB-wcgK3.js +1 -0
  36. package/dist/iframe/assets/validation-DRqHT-u7-pY2KjHw4.js +3 -0
  37. package/dist/iframe/assets/vehicleCoverage-BPJaWQyg-DBJ_jL3e.js +1 -0
  38. package/dist/iframe/assets/visibility-hEdBjgi7-_AUGO8E2.js +1 -0
  39. package/dist/iframe/iframe.html +2 -2
  40. package/dist/index-CQXR1Un8.js +354 -0
  41. package/dist/index.d.ts +17 -1
  42. package/dist/index.es.js +4 -4
  43. package/dist/index.umd.js +105 -115
  44. package/dist/intake-review-panel-B7rXvRvm-CDyR-rVg.js +186 -0
  45. package/dist/{mockJump-CL8w249w-KvYoZQMN.js → mockJump-DpXrnQUq-BaitU9aZ.js} +1 -1
  46. package/dist/payload-JXpCaeS6-pjITtvlm.js +128 -0
  47. package/dist/question-list-ChcBzofd-fVRN9fTl.js +6505 -0
  48. package/dist/rates-panel-BaIzEqX6-BULjKxqz.js +1001 -0
  49. package/dist/review-panel-DYCuhwdo-BImR4S06.js +903 -0
  50. package/dist/stage-Bpq1A5xB-Cphc07aC.js +197 -0
  51. package/dist/types-LUGvo5ic-CiVRcsV9.js +9 -0
  52. package/dist/utils/assets.d.ts +12 -0
  53. package/dist/utils/branding.d.ts +21 -0
  54. package/dist/utils/partner.d.ts +32 -0
  55. package/dist/utils/support/bland.d.ts +5 -0
  56. package/dist/validation-DRqHT-u7-CL2m7f4k.js +2852 -0
  57. package/dist/vehicleCoverage-BPJaWQyg-g7bBFmro.js +144 -0
  58. package/dist/visibility-hEdBjgi7-WW4BVjmf.js +198 -0
  59. package/dist/widget-BUAzkBEK.js +13061 -0
  60. package/package.json +2 -2
  61. package/dist/api-RBpxlUxA.js +0 -51
  62. package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DkeMmMY0.js +0 -1
  63. package/dist/iframe/assets/iframe-CfQAC0Hv.js +0 -494
  64. package/dist/iframe/assets/iframe-DFqQdMHv.css +0 -1
  65. package/dist/widget-BEY4lY4B.js +0 -27319
@@ -0,0 +1,17 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/iframe-BImWklE9.js","assets/iframe-Bl0qTZgO.css"])))=>i.map(i=>d[i]);
2
+ import{m as ee,t as Le,r as n,_ as xe,b as e,f as j,T as De,h as E,n as w,o as J,p as D,q as He,g as he,s as Fe,v as Oe,K as fe,w as ze,J as Me,x as Be,y as pe,z as We,P as Ve,B as Ye}from"./iframe-BImWklE9.js";import{g as Ue,A as Ke,k as Qe,j as Ge,S as X,u as g,p as k,y as Je,m as je,W as ge,H as Xe,h as Ze,b as es}from"./core-Po4qPIof-jDmdAxP7.js";import{C as ss}from"./check-l6TGSrXO.js";import{C as ts}from"./car-DkfXVYz0.js";/**
3
+ * @license lucide-react v0.562.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */const ds=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],cs=ee("copy",ds);/**
8
+ * @license lucide-react v0.562.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */const as=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],rs=ee("link-2",as);/**
13
+ * @license lucide-react v0.562.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */const ls=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],ye=ee("phone",ls);var ns=2500,is=t=>{if(!t)return null;let c=Math.round((Date.parse(t)-Date.now())/864e5);return!Number.isFinite(c)||c<1?null:c===1?"It works for 1 more day.":`It works for the next ${c} days.`},os=({quoteId:t})=>{let[c,o]=n.useState({kind:"pending"}),[r,m]=n.useState(!1),q=n.useRef(null),l=n.useRef(!1);n.useEffect(()=>{l.current||(l.current=!0,(async()=>{try{let[{issueResumeLink:x},{buildResumeUrl:h}]=await Promise.all([xe(()=>import("./iframe-BImWklE9.js").then(b=>b.a3),__vite__mapDeps([0,1])),xe(()=>import("./iframe-BImWklE9.js").then(b=>b.a2),__vite__mapDeps([0,1])).then(b=>b.u)]),{resumeToken:C,expiresAt:F}=await x(t??void 0);o({kind:"ready",url:h(C),expiresAt:F})}catch{o({kind:"unavailable"})}})())},[t]),n.useEffect(()=>{if(!r)return;let x=setTimeout(()=>m(!1),ns);return()=>clearTimeout(x)},[r]);let u=n.useCallback(async x=>{q.current?.select();try{await navigator.clipboard.writeText(x),m(!0)}catch{m(!1)}},[]);if(c.kind!=="ready")return null;let v=is(c.expiresAt);return e.jsx("div",{"data-credify-resume-link":!0,className:"cds-mt-6 cds-rounded-xl cds-border cds-border-border cds-bg-surface-muted cds-p-4",children:e.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[e.jsx(rs,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-fg"}),e.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[e.jsx("h3",{className:"cds-text-sm cds-font-bold cds-text-fg",children:"Want to think it over?"}),e.jsxs("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:["Save this link and open it on any device to come back to these quotes.",v?` ${v}`:""]}),e.jsxs("div",{className:"cds-mt-3 cds-flex cds-flex-col cds-gap-2 sm:cds-flex-row",children:[e.jsx("input",{ref:q,type:"text",readOnly:!0,value:c.url,"aria-label":"Link back to your quotes",onFocus:x=>x.currentTarget.select(),className:`cds-min-w-0 cds-flex-1 cds-rounded-lg cds-border cds-border-input cds-bg-surface-elevated cds-px-3 cds-py-2 cds-text-xs cds-text-fg-muted ${j}`}),e.jsxs("button",{type:"button",onClick:()=>void u(c.url),className:`cds-inline-flex cds-shrink-0 cds-items-center cds-justify-center cds-gap-1.5 cds-rounded-lg cds-border cds-border-primary cds-px-4 cds-py-2 cds-text-sm cds-font-semibold cds-text-fg cds-transition-colors hover:cds-bg-primary hover:cds-text-primary-foreground ${j}`,children:[e.jsx(r?ss:cs,{"aria-hidden":"true",className:"cds-h-4 cds-w-4"}),r?"Copied":"Copy link"]})]}),e.jsx("p",{"aria-live":"polite",className:"sr-only",children:r?"Link copied to clipboard":""}),e.jsx("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:"Anyone with this link can see your quote, so keep it to yourself. You'll still confirm by text message before anything is submitted to a carrier."})]})]})})},ws=Le({RatesPanel:()=>ys}),ms=3e3,us=33e4,Z=t=>`$${(t/100).toLocaleString("en-US",{maximumFractionDigits:0})}`,xs=t=>t.split(/\s+/).filter(Boolean).slice(0,2).map(c=>c[0]?.toUpperCase()??"").join(""),hs=[{market:"admitted",label:"Admitted"},{market:"non_admitted",label:"Non-admitted"},{market:"not_quoted",label:"Not quoted"}],L=t=>({tab:`rates-tab-${t}`,panel:`rates-panel-${t}`}),Ne=({rate:t,size:c})=>{let o=g(t.carrier_name),r=c==="sm"?"cds-h-9 cds-w-9":"cds-h-10 cds-w-10";return t.carrier_logo_base64?e.jsx("img",{src:`data:image/png;base64,${t.carrier_logo_base64}`,alt:o,className:`${r} cds-rounded cds-object-contain`}):e.jsx("span",{"aria-hidden":"true",className:`cds-flex ${r} cds-shrink-0 cds-items-center cds-justify-center cds-rounded cds-bg-primary/10 cds-text-sm cds-font-bold cds-text-fg`,children:xs(o)})},be={PersonalAuto:"Personal Auto",PersonalHome:"Homeowners"},fs={PersonalHome:Xe,PersonalAuto:ts,Flood:ge,ExcessFlood:ge},H=({lob:t,size:c="md"})=>{let o=t&&fs[t]||X,r=c==="sm"?"cds-h-5 cds-w-5":"cds-h-7 cds-w-7",m=c==="sm"?"cds-h-3 cds-w-3":"cds-h-4 cds-w-4";return e.jsx("span",{"aria-hidden":"true",className:`cds-inline-flex ${r} cds-shrink-0 cds-items-center cds-justify-center cds-rounded-full cds-bg-accent/15 cds-ring-1 cds-ring-inset cds-ring-ring/25`,children:e.jsx(o,{className:`${m} cds-text-accent`,strokeWidth:2.5})})},ps=({rate:t,showLob:c,isSelected:o,isRequested:r,lobLocked:m,onSelect:q})=>{let l=g(t.carrier_name),u=es(t),v=c?k(t.lob):null,x=t.effective_date&&t.policy_end_date?`${t.effective_date} – ${t.policy_end_date}`:t.effective_date;return e.jsxs("div",{className:`cds-rounded-xl cds-border cds-bg-surface-elevated cds-p-4 ${r?"cds-border-accent cds-ring-2 ring-emerald-500/30":o?"cds-border-accent cds-ring-2 cds-ring-ring/30":"cds-border-border"} ${m?"cds-opacity-60":""}`,children:[v?e.jsxs("p",{className:"cds-mb-2 cds-flex cds-items-center cds-gap-1.5 cds-text-xs cds-font-semibold cds-uppercase cds-tracking-wide cds-text-fg",children:[e.jsx(H,{lob:t.lob,size:"sm"}),v]}):null,e.jsxs("div",{className:"cds-flex cds-items-center cds-gap-3",children:[e.jsx(Ne,{rate:t,size:"md"}),e.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[e.jsx("p",{className:"cds-truncate cds-font-bold cds-text-fg",children:l}),e.jsxs("p",{className:"cds-text-xs cds-text-fg-muted",children:[Z(t.premium_cents)," for ",t.term_months," months"]}),t.admitted_status==="non_admitted"?e.jsx("p",{className:"cds-mt-1 cds-inline-block cds-rounded cds-bg-warning-surface cds-px-1.5 cds-py-0.5 cds-text-[11px] cds-font-semibold cds-text-warning-foreground",children:"Surplus lines"}):null]}),e.jsxs("div",{className:"cds-text-right",children:[e.jsx("p",{className:"cds-text-xl cds-font-extrabold cds-text-fg",children:Z(je(t))}),e.jsx("p",{className:"cds-text-xs cds-text-fg-muted",children:"/mo"})]})]}),x?e.jsxs("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:["Effective ",x]}):null,u.length?e.jsx("dl",{className:"cds-mt-3 cds-space-y-1 cds-border-t cds-border-border cds-pt-3 cds-text-xs",children:u.map((h,C)=>e.jsxs("div",{className:"cds-flex cds-justify-between cds-gap-2",children:[e.jsx("dt",{className:"cds-text-fg-muted",children:h.label}),e.jsx("dd",{className:"cds-text-right cds-font-semibold cds-text-fg",children:h.value})]},`${h.label}-${C}`))}):null,t.carrier_quote_id?e.jsxs("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:["Carrier quote ID: ",t.carrier_quote_id]}):null,r?e.jsx("p",{className:"cds-mt-3 cds-rounded-lg cds-bg-highlight cds-px-4 cds-py-2 cds-text-center cds-text-sm cds-font-bold cds-text-accent",children:"Request sent"}):m?e.jsxs("p",{className:"cds-mt-3 cds-text-center cds-text-xs cds-text-fg-muted",children:["You already have a request in for ",k(t.lob)??"this line","."]}):e.jsx("button",{type:"button",onClick:q,className:`cds-mt-3 cds-w-full cds-rounded-lg cds-border cds-border-accent cds-px-4 cds-py-2 cds-text-sm cds-font-bold cds-text-fg hover:cds-bg-highlight ${j}`,children:o?"Selected":"Continue with this quote"})]})},gs=({rate:t})=>{let c=(t.decline_reasons??[]).filter(Boolean),o=t.decline_category?.trim();return e.jsxs("div",{className:"cds-flex cds-gap-3 cds-rounded-xl cds-border cds-border-border cds-bg-surface-elevated cds-p-4",children:[e.jsx(Ne,{rate:t,size:"sm"}),e.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[e.jsx("p",{className:"cds-font-bold cds-text-fg",children:g(t.carrier_name)}),o?e.jsx("p",{className:"cds-mt-0.5 cds-text-xs cds-font-semibold cds-uppercase cds-tracking-wide cds-text-fg-muted",children:o}):null,c.length?e.jsx("ul",{className:"cds-mt-2 cds-list-outside cds-list-disc cds-space-y-1 cds-pl-5 cds-text-sm cds-text-fg-muted",children:c.map((r,m)=>e.jsx("li",{children:r},`${r}-${m}`))}):e.jsx("p",{className:"cds-mt-2 cds-text-sm cds-text-fg-muted",children:"This carrier did not return a quote."})]})]})},T=({quoteId:t})=>t?e.jsxs("div",{className:"cds-mt-6 cds-inline-block cds-rounded-lg cds-border cds-border-border cds-bg-surface-muted cds-px-4 cds-py-2.5 cds-text-center",children:[e.jsx("p",{className:"cds-text-xs cds-text-fg-muted",children:"Reference ID"}),e.jsx("p",{className:"cds-mt-0.5 cds-select-all cds-font-mono cds-text-sm cds-font-semibold cds-text-fg",children:t})]}):null,K=({heading:t,body:c,quoteId:o})=>e.jsxs("div",{className:"cds-py-6 cds-text-center",children:[e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:t}),e.jsx("p",{className:"cds-mb-6 cds-text-fg-muted",children:c}),e.jsxs("a",{href:D,onClick:()=>J("phone_call_click",{placement:"quote_rates_fallback",phone:w}),className:`cds-inline-flex cds-items-center cds-gap-2 cds-rounded-xl cds-bg-accent cds-px-8 cds-py-3.5 cds-text-base cds-font-bold cds-text-primary-foreground hover:cds-bg-accent ${j}`,children:[e.jsx(ye,{"aria-hidden":"true",className:"cds-h-4 cds-w-4"}),"Call ",w]}),e.jsx("div",{children:e.jsx(T,{quoteId:o})})]}),bs={Auto:["PersonalAuto"],Home:["PersonalHome"],Bundle:["PersonalAuto","PersonalHome"]},A=t=>t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`,Q=t=>t.lob??"_other",G=(t,c)=>{let o=new Set(c.map(r=>r.lob));return[...new Set(t.filter(r=>Ze(r)!=="not_quoted").map(r=>r.lob).filter(r=>!!r))].filter(r=>!o.has(r))},js=({appetites:t,product:c})=>{let o=bs[c]??Object.keys(t??{}),r=[...new Set(o.flatMap(m=>t?.[m]??[]).map(g))].slice(0,8);return r.length?e.jsxs("p",{className:"cds-mt-4 cds-text-sm cds-text-fg-muted",children:["Checking ",r.join(", "),r.length>=8?" and more":"","…"]}):null},ys=({product:t,quoteId:c,describeField:o,onFixAnswers:r,onRetry:m,onBound:q})=>{let[l,u]=n.useState({kind:"polling"}),[v,x]=n.useState(null),[h,C]=n.useState(),[F,b]=n.useState({}),[y,_e]=n.useState([]),[ke,ve]=n.useState(!1),[O,se]=n.useState(""),[we,S]=n.useState(),[z,te]=n.useState(!1),[I,M]=n.useState(0),[de,ce]=n.useState(!1),[B,ae]=n.useState(!1),[qe,re]=n.useState(),$=n.useRef(0),W=n.useCallback(()=>{$.current+=1;let s=$.current,d=Date.now(),a=async()=>{if(s===$.current){try{let{quote:i}=await Fe(c??void 0);if(s!==$.current)return;C(i);let U=i?.rates_status;if(U==="completed"){let{rates:P}=await Oe(c??void 0);if(s!==$.current)return;let R=P??[];u(R.length?{kind:"ready",rates:R}:{kind:"no_rates"});return}if(U==="no_rates"){u({kind:"no_rates"});return}if(U==="failed"){let P=i?.last_validation_errors??[];if(i?.last_failure_code==="BOLT_VALIDATION"&&P.length){u({kind:"validation_failed",errors:P,message:i?.rates_failure_message??void 0});return}let R=i?.last_failure_code==="UNHANDLED"||i?.last_failure_code==="DISPATCH"||i?.last_failure_code==="BOLT_RATES";u({kind:"failed",retryable:R,message:i?.rates_failure_message??void 0}),fe(Error(i?.rates_failure_message||`Rating failed: ${i?.last_failure_code??"unknown"}`),{phase:"rates_failed",product:t,quoteId:c,failureCode:i?.last_failure_code});return}}catch(i){ze("rates poll failed",{status:Me(i)})}if(Date.now()-d>=us){u({kind:"failed",retryable:!0}),fe(Error("Rating timed out before returning a result"),{phase:"rates_timeout",product:t,quoteId:c});return}setTimeout(()=>void a(),ms)}};a()},[c,t]);n.useEffect(()=>(W(),()=>{$.current+=1}),[W]),n.useEffect(()=>{if(I<=0)return;let s=setTimeout(()=>M(d=>d-1),1e3);return()=>clearTimeout(s)},[I]);let f=n.useMemo(()=>Ue(l.kind==="ready"?l.rates:[]),[l]),le=s=>Array.isArray(s)?s.filter(d=>d&&typeof d=="object"):[],$e=n.useMemo(()=>l.kind==="validation_failed"?Ke(l.errors,{describeField:o,vehicles:le(h?.vehicles),drivers:le(h?.drivers)}):void 0,[l,o,h]),p=v??(f.admitted.length?"admitted":f.non_admitted.length?"non_admitted":f.not_quoted.length?"not_quoted":"admitted"),ne=async(s,d)=>{if(!c)return;u({kind:"verify",rate:s,rates:d}),S(void 0),se("");let a=String(h?.phone??"");try{await We(c,a),M(60)}catch(i){i instanceof pe&&i.statusCode===429?M(i.retryAfterSeconds??60):S("We could not text your code. Try again in a moment.")}},Ae=async(s,d)=>{if(!(!c||z)){te(!0),S(void 0);try{let{isVerified:a}=await Be(c,O);if(!a){S("That code did not match. Check it and try again.");return}u({kind:"ready",rates:d.length?d:[s]}),ve(!0),b(i=>({...i,[Q(s)]:s.quote_rate_id}))}catch(a){S(a instanceof pe&&a.statusCode===429?"Too many attempts. Request a new code.":"We could not verify that code. Please try again.")}finally{te(!1)}}},ie=s=>{Ve(),u({kind:"bound",rates:s}),q?.(s)},Ce=async s=>{if(B||!s.length)return;ae(!0),re(void 0);try{await Ye(s.map(a=>a.quote_rate_id),!0)}catch{re(s.length>1?"We could not submit those requests. Please call us and we will finish them for you.":"We could not submit that request. Please call us and we will finish it for you.");return}finally{ae(!1)}let d=[...y,...s];if(_e(d),b({}),G(l.kind==="ready"?l.rates:[],d).length){ce(!1);return}ie(d)};if(l.kind==="polling")return e.jsxs("div",{className:"cds-py-10 cds-text-center","aria-live":"polite",children:[e.jsx("div",{className:"cds-mx-auto cds-mb-6 cds-h-10 cds-w-10 cds-animate-spin cds-rounded-full cds-border-4 cds-border-accent cds-border-t-transparent","aria-hidden":"true"}),e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"Getting your quotes…"}),e.jsx("p",{className:"cds-text-fg-muted",children:"Please keep this window open while we run your details through our carriers. This usually takes a minute or two."}),e.jsx("p",{className:"cds-mt-2 cds-text-fg-muted",children:"If you get disconnected, your progress is saved in this browser — reopen this page and you'll pick up where you left off. Thanks for your patience."}),e.jsx(js,{appetites:h?.appetites,product:t})]});if(l.kind==="validation_failed"){let s=$e;return!s||s.isOpaque?e.jsx(K,{heading:"Let's finish this one together",body:"The carrier needs a couple of details we can't collect online. An agent can sort it out with you in a few minutes.",quoteId:c}):e.jsxs("div",{className:"cds-py-6",children:[e.jsxs("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-warning cds-bg-warning-surface cds-p-4",children:[e.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[e.jsx(De,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-warning"}),e.jsxs("div",{children:[e.jsx("h2",{className:"cds-text-lg cds-font-bold cds-text-fg",children:"A few answers need another look"}),e.jsx("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:"The carrier couldn't price your quote until these are sorted. It only takes a minute."})]})]}),e.jsx("div",{className:"cds-mt-4 cds-space-y-4",children:s.groups.map(d=>e.jsxs("div",{children:[e.jsx("p",{className:"cds-text-sm cds-font-bold cds-text-fg",children:d.heading}),d.sharedMessage?e.jsxs("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:[d.sharedMessage," ",e.jsx("span",{className:"cds-font-semibold",children:Qe(d.labels)}),"."]}):e.jsx("ul",{className:"cds-mt-1 cds-list-outside cds-list-disc cds-space-y-1 cds-pl-5 cds-text-sm cds-text-fg-muted",children:d.issues.map(a=>e.jsx("li",{children:Ge(a)},`${a.label??""}-${a.message}`))})]},d.id))}),s.otherCount?e.jsxs("p",{className:"cds-mt-4 cds-text-xs cds-text-fg-muted",children:["The carrier flagged ",s.otherCount," other ",s.otherCount===1?"detail":"details"," we'll check with you if it still won't price."]}):null]}),e.jsx(E,{onClick:()=>r(l.errors),children:"Fix my answers"}),e.jsxs("p",{className:"cds-mt-4 cds-text-center cds-text-sm cds-text-fg-muted",children:["Or call"," ",e.jsx("a",{href:D,onClick:()=>J("phone_call_click",{placement:"quote_rates_validation",phone:w}),className:"cds-font-semibold cds-text-fg cds-underline",children:w})," ","and an agent will finish it with you."]}),e.jsx("div",{className:"cds-text-center",children:e.jsx(T,{quoteId:c})})]})}if(l.kind==="failed")return e.jsx("div",{className:"cds-py-6",children:l.retryable?e.jsxs("div",{className:"cds-text-center",children:[e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"That took longer than expected"}),e.jsx("p",{className:"cds-mb-6 cds-text-fg-muted",children:l.message??"Our carrier connection hiccuped. One more try usually does it."}),e.jsx(E,{onClick:()=>{u({kind:"polling"}),m().then(s=>{s&&W()})},children:"Try again"}),e.jsxs("p",{className:"cds-mt-4 cds-text-sm cds-text-fg-muted",children:["Or call"," ",e.jsx("a",{href:D,className:"cds-font-semibold cds-text-fg cds-underline",children:w})," ","and an agent will pull them for you."]}),e.jsx(T,{quoteId:c})]}):e.jsx(K,{heading:"Let's get your quotes another way",body:"A licensed agent can pull your quotes over the phone in a few minutes — no waiting.",quoteId:c})});if(l.kind==="no_rates")return e.jsx(K,{heading:"No online offers for this one",body:"That happens with some homes and vehicles. An agent has access to carriers that don't quote online.",quoteId:c});if(l.kind==="verify"){let{rate:s,rates:d}=l;return e.jsxs("div",{className:"cds-py-6",children:[e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"Verify your number"}),e.jsxs("p",{className:"cds-mb-6 cds-text-fg-muted",children:["We texted a 6-digit code to confirm it's you before we send your ",s.carrier_name," request."]}),e.jsx("label",{htmlFor:"sms-code",className:"cds-mb-1 cds-block cds-text-sm cds-font-semibold cds-text-fg",children:"Verification code"}),e.jsx("input",{id:"sms-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,value:O,onChange:a=>se(a.target.value.replace(/\D/g,"").slice(0,6)),className:`${He} cds-tracking-[0.4em]`}),e.jsx(he,{message:we}),e.jsx(E,{disabled:O.length!==6||z,onClick:()=>void Ae(s,d),children:z?"Verifying…":"Verify and continue"}),e.jsx("button",{type:"button",disabled:I>0,onClick:()=>void ne(s,d),className:`cds-mt-3 cds-w-full cds-rounded-lg cds-px-4 cds-py-2 cds-text-sm cds-font-semibold cds-text-fg cds-underline disabled:cds-no-underline disabled:cds-opacity-60 ${j}`,children:I>0?`Resend code in ${I}s`:"Resend code"})]})}if(l.kind==="bound"){let s=l.rates.length===1?l.rates[0]:void 0;return e.jsxs("div",{className:"cds-py-10 cds-text-center",children:[e.jsx(X,{"aria-hidden":"true",className:"cds-mx-auto cds-mb-4 cds-h-12 cds-w-12 cds-text-accent"}),e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"You're all set"}),s?e.jsxs("p",{className:"cds-text-fg-muted",children:["A licensed agent is finalizing your ",g(s.carrier_name)," policy and will call you shortly to confirm the details."]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"cds-mb-4 cds-text-fg-muted",children:"A licensed agent is finalizing these policies and will call you shortly to confirm the details."}),e.jsx("ul",{className:"cds-mx-auto cds-max-w-sm cds-space-y-2 cds-text-left",children:l.rates.map(d=>e.jsxs("li",{className:"cds-flex cds-items-center cds-gap-2 cds-rounded-lg cds-border cds-border-border cds-bg-surface-elevated cds-p-3 cds-text-sm",children:[e.jsx(H,{lob:d.lob}),e.jsxs("span",{children:[e.jsx("span",{className:"cds-font-bold cds-text-fg",children:g(d.carrier_name)}),k(d.lob)?e.jsxs("span",{className:"cds-text-fg-muted",children:[" — ",k(d.lob)]}):null]})]},d.quote_rate_id))})]}),e.jsx(T,{quoteId:c}),e.jsxs("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:["Quote this if you call us about ",l.rates.length>1?"these requests":"this request","."]})]})}let V=new Set(y.map(s=>s.quote_rate_id)),Se=new Set(y.map(s=>s.lob)),oe=s=>F[Q(s)]===s.quote_rate_id,N=l.rates.filter(s=>oe(s)&&!V.has(s.quote_rate_id)),Ie=ke,Y=G(l.rates,y),Te=G(l.rates,[]).length>1,me=Y.filter(s=>!N.some(d=>d.lob===s)),_=hs.filter(s=>s.market!=="not_quoted"||f.not_quoted.length>0),Pe=f.admitted.length+f.non_admitted.length,Re=Je(p==="not_quoted"?f.not_quoted:f[p],{sortBy:p==="not_quoted"?"carrier":"premium"}),ue=t==="Bundle"?[{lob:"PersonalAuto",label:be.PersonalAuto},{lob:"PersonalHome",label:be.PersonalHome}].filter(({lob:s})=>!l.rates.some(d=>d.lob===s)):[],Ee=s=>{let d=s.key==="ArrowRight"?1:s.key==="ArrowLeft"?-1:0,a=s.key==="Home"?_[0]:s.key==="End"?_[_.length-1]:d?_[(_.findIndex(i=>i.market===p)+d+_.length)%_.length]:void 0;a&&(s.preventDefault(),x(a.market),setTimeout(()=>document.getElementById(L(a.market).tab)?.focus(),0))};return e.jsxs("div",{className:"cds-py-2",children:[e.jsx("h2",{className:"cds-mb-1 cds-text-2xl cds-font-bold cds-text-fg",children:"Your quotes"}),e.jsx("p",{className:"cds-mb-4 cds-text-sm cds-text-fg-muted",children:"Real prices from our carriers, based on the answers you gave."}),ue.length?e.jsx("div",{className:"cds-mb-4 cds-space-y-1",children:ue.map(({lob:s,label:d})=>e.jsxs("p",{className:"cds-text-sm cds-text-fg-muted",children:["Sorry, no rates found for ",d,"."]},s))}):null,y.length>0&&Y.length>0?e.jsxs("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-accent cds-bg-highlight cds-p-4",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[e.jsx(X,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-accent"}),e.jsxs("div",{children:[e.jsxs("h3",{className:"cds-text-sm cds-font-bold cds-text-fg",children:["We've sent your ",A(y.map(s=>k(s.lob)??g(s.carrier_name)))," request to"," ",A(y.map(s=>g(s.carrier_name)))]}),e.jsxs("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:["You can still add ",A(Y.map(s=>k(s)??s))," — pick a quote above and we'll send that one too. You won't need another verification code."]})]})]}),e.jsx("button",{type:"button",onClick:()=>ie(y),className:`cds-mt-3 cds-text-sm cds-font-semibold cds-text-fg cds-underline ${j}`,children:"No thanks, I'm done"})]}):null,e.jsx("div",{className:"cds-mb-4 -cds-mx-1 cds-overflow-x-auto cds-border-b cds-border-border cds-px-1",children:e.jsx("div",{className:"cds-flex cds-items-center cds-gap-4 sm:cds-gap-6",role:"tablist","aria-label":"Rate market type",children:_.map(s=>{let d=s.market===p,a=L(s.market);return e.jsxs("button",{id:a.tab,type:"button",role:"tab","aria-selected":d,"aria-controls":a.panel,tabIndex:d?0:-1,onClick:()=>x(s.market),onKeyDown:Ee,className:`cds-whitespace-nowrap cds-border-b-2 cds-px-1 cds-py-2 cds-text-xs cds-font-semibold cds-transition-colors sm:cds-text-sm ${j} ${d?"cds-border-accent cds-text-fg":"cds-border-transparent cds-text-fg-muted hover:cds-text-fg"}`,children:[s.label," (",f[s.market].length,")"]},s.market)})})}),e.jsxs("div",{id:L(p).panel,role:"tabpanel","aria-labelledby":L(p).tab,tabIndex:0,className:`cds-mb-6 cds-outline-none ${j}`,children:[p==="admitted"&&!f.admitted.length?e.jsx("p",{className:"cds-text-sm cds-text-fg-muted",children:"No admitted-market carriers priced this quote."}):null,p==="non_admitted"&&!f.non_admitted.length?e.jsx("p",{className:"cds-text-sm cds-text-fg-muted",children:"No surplus-lines carriers priced this quote."}):null,p==="not_quoted"?e.jsx("p",{className:"cds-mb-3 cds-text-sm cds-text-fg-muted",children:"These carriers looked at your details and passed. Their reasons are below."}):null,Re.map((s,d)=>e.jsxs("div",{className:"cds-mb-5 last:cds-mb-0",children:[d?e.jsx("div",{"aria-hidden":"true",className:"cds-mb-5 cds-h-px cds-bg-gradient-to-r cds-from-transparent cds-via-brand-accent/40 cds-to-transparent"}):null,s.lob?e.jsxs("h3",{className:"cds-mb-2 cds-flex cds-items-center cds-gap-2 cds-text-sm cds-font-bold cds-uppercase cds-tracking-wide cds-text-fg",children:[e.jsx(H,{lob:s.lob}),s.title]}):null,e.jsx("ul",{className:"cds-space-y-3",children:s.rates.map(a=>p==="not_quoted"?e.jsx("li",{children:e.jsx(gs,{rate:a})},a.quote_rate_id):e.jsx("li",{children:e.jsx(ps,{rate:a,showLob:!s.lob,isSelected:oe(a),isRequested:V.has(a.quote_rate_id),lobLocked:!V.has(a.quote_rate_id)&&Se.has(a.lob),onSelect:()=>Ie?b(i=>({...i,[Q(a)]:a.quote_rate_id})):void ne(a,l.rates)})},a.quote_rate_id))})]},s.lob??"all"))]}),Pe?null:e.jsxs("div",{className:"cds-mb-6 cds-rounded-xl cds-border cds-border-border cds-bg-surface-muted cds-p-4 cds-text-center",children:[e.jsx("p",{className:"cds-mb-3 cds-text-sm cds-text-fg-muted",children:"No carrier priced this one online. An agent has access to carriers that don't quote on the web."}),e.jsxs("a",{href:D,onClick:()=>J("phone_call_click",{placement:"quote_rates_all_declined",phone:w}),className:`cds-inline-flex cds-items-center cds-gap-2 cds-rounded-xl cds-bg-accent cds-px-6 cds-py-3 cds-text-sm cds-font-bold cds-text-primary-foreground hover:cds-bg-accent ${j}`,children:[e.jsx(ye,{"aria-hidden":"true",className:"cds-h-4 cds-w-4"}),"Call ",w]}),e.jsx("div",{children:e.jsx(T,{quoteId:c})})]}),N.length?e.jsxs("div",{className:"cds-rounded-xl cds-border cds-border-border cds-bg-surface-muted cds-p-4",children:[e.jsxs("h3",{className:"cds-mb-2 cds-text-sm cds-font-bold cds-text-fg",children:["Finish with ",A(N.map(s=>g(s.carrier_name)))]}),Te?e.jsx("ul",{className:"cds-mb-3 cds-space-y-1",children:N.map(s=>e.jsxs("li",{className:"cds-flex cds-justify-between cds-gap-2 cds-text-xs",children:[e.jsxs("span",{className:"cds-flex cds-items-center cds-gap-1.5 cds-text-fg-muted",children:[e.jsx(H,{lob:s.lob,size:"sm"}),k(s.lob)??"Policy"]}),e.jsxs("span",{className:"cds-text-right cds-font-semibold cds-text-fg",children:[g(s.carrier_name)," · ",Z(je(s)),"/mo"]})]},s.quote_rate_id))}):null,e.jsxs("label",{className:"cds-mb-3 cds-flex cds-cursor-pointer cds-items-start cds-gap-2 cds-text-xs cds-text-fg-muted",children:[e.jsx("input",{type:"checkbox",checked:de,onChange:s=>ce(s.target.checked),className:"cds-mt-0.5"}),e.jsxs("span",{children:["I acknowledge the"," ",e.jsx("a",{href:"/privacy-policy",className:"cds-font-semibold cds-text-fg cds-underline",children:"Privacy Notice"})," ","and authorize Credify to share my information with"," ",e.jsx("span",{className:"cds-font-semibold",children:A(N.map(s=>g(s.carrier_name)))})," to complete my"," ",N.length>1?"applications":"application","."]})]}),me.length?e.jsxs("p",{className:"cds-mb-3 cds-text-xs cds-text-fg-muted",children:["You haven't picked a ",A(me.map(s=>k(s)??s))," quote yet — choose one above to request both together, or go ahead and we'll ask about it after."]}):null,e.jsx(he,{message:qe}),e.jsx(E,{disabled:!de||B,onClick:()=>void Ce(N),children:B?"Submitting…":N.length>1?"Request these policies":"Request this policy"})]}):null,e.jsx(os,{quoteId:c}),e.jsx("p",{className:"cds-mt-6 cds-text-xs cds-leading-relaxed cds-text-fg-muted",children:"Quotes are estimates based on the information provided and are subject to carrier underwriting. Final premiums may differ."})]})};export{ws as n,os as r,ys as t};
@@ -0,0 +1,6 @@
1
+ var ge=n=>{throw TypeError(n)};var Ce=(n,o,e)=>o.has(n)||ge("Cannot "+e);var R=(n,o,e)=>(Ce(n,o,"read from private field"),e?e.call(n):o.get(n)),ve=(n,o,e)=>o.has(n)?ge("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(n):o.set(n,e),J=(n,o,e,t)=>(Ce(n,o,"write to private field"),t?t.call(n,e):o.set(n,e),e);import{m as qe,r as l,C as T,b as c,F as V,t as He,e as ee,d as be,f as Ae,g as Be,G as Fe}from"./iframe-BImWklE9.js";import{o as Ge,n as Ue,r as We}from"./stage-Bpq1A5xB-CwZgWOhp.js";import{c as K,P as $,a as we,u as te,b as Re,d as Ye,e as Je,C as Qe}from"./index-CNb9AhPB.js";/**
2
+ * @license lucide-react v0.562.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Xe=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ze=qe("pencil",Xe);var et=Object.defineProperty,y=(n,o)=>et(n,"name",{value:o,configurable:!0});function je(n){const o=n+"CollectionProvider",[e,t]=K(o),[r,s]=e(o,{collectionRef:{current:null},itemMap:new Map}),i=y(v=>{const{scope:g,children:I}=v,A=l.useRef(null),u=l.useRef(new Map).current;return c.jsx(r,{scope:g,itemMap:u,collectionRef:A,children:I})},"CollectionProvider");i.displayName=o;const d=n+"CollectionSlot",f=V(d),p=l.forwardRef((v,g)=>{const{scope:I,children:A}=v,u=s(d,I),m=T(g,u.collectionRef);return c.jsx(f,{ref:m,children:A})});p.displayName=d;const a=n+"CollectionItemSlot",h="data-radix-collection-item",x=V(a),j=l.forwardRef((v,g)=>{const{scope:I,children:A,...u}=v,m=l.useRef(null),O=T(g,m),N=s(a,I);return l.useEffect(()=>(N.itemMap.set(m,{ref:m,...u}),()=>void N.itemMap.delete(m))),c.jsx(x,{[h]:"",ref:O,children:A})});j.displayName=a;function C(v){const g=s(n+"CollectionConsumer",v);return l.useCallback(()=>{const A=g.collectionRef.current;if(!A)return[];const u=Array.from(A.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((N,_)=>u.indexOf(N.ref.current)-u.indexOf(_.ref.current))},[g.collectionRef,g.itemMap])}return y(C,"useCollection"),[{Provider:i,Slot:p,ItemSlot:j},C,t]}y(je,"createCollection");var ye=new WeakMap,b,P,Q=(P=class extends Map{constructor(e){super(e);ve(this,b);J(this,b,[...super.keys()]),ye.set(this,!0)}set(e,t){return ye.get(this)&&(this.has(e)?R(this,b)[R(this,b).indexOf(e)]=e:R(this,b).push(e)),super.set(e,t),this}insert(e,t,r){const s=this.has(t),i=R(this,b).length,d=oe(e);let f=d>=0?d:i+d;const p=f<0||f>=i?-1:f;if(p===this.size||s&&p===this.size-1||p===-1)return this.set(t,r),this;const a=this.size+(s?0:1);d<0&&f++;const h=[...R(this,b)];let x,j=!1;for(let C=f;C<a;C++)if(f===C){let v=h[C];h[C]===t&&(v=h[C+1]),s&&this.delete(t),x=this.get(v),this.set(t,r)}else{!j&&h[C-1]===t&&(j=!0);const v=h[j?C:C-1],g=x;x=this.get(v),this.delete(v),this.set(v,g)}return this}with(e,t,r){const s=new P(this);return s.insert(e,t,r),s}before(e){const t=R(this,b).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){const s=R(this,b).indexOf(e);return s===-1?this:this.insert(s,t,r)}after(e){let t=R(this,b).indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,r){const s=R(this,b).indexOf(e);return s===-1?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return J(this,b,[]),super.clear()}delete(e){const t=super.delete(e);return t&&R(this,b).splice(R(this,b).indexOf(e),1),t}deleteAt(e){const t=this.keyAt(e);return t!==void 0?this.delete(t):!1}at(e){const t=z(R(this,b),e);if(t!==void 0)return this.get(t)}entryAt(e){const t=z(R(this,b),e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return R(this,b).indexOf(e)}keyAt(e){return z(R(this,b),e)}from(e,t){const r=this.indexOf(e);if(r===-1)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){const r=this.indexOf(e);if(r===-1)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(const s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(const s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return-1}filter(e,t){const r=[];let s=0;for(const i of this)Reflect.apply(e,t,[i,s,this])&&r.push(i),s++;return new P(r)}map(e,t){const r=[];let s=0;for(const i of this)r.push([i[0],Reflect.apply(e,t,[i,s,this])]),s++;return new P(r)}reduce(...e){const[t,r]=e;let s=0,i=r??this.at(0);for(const d of this)s===0&&e.length===1?i=d:i=Reflect.apply(t,this,[i,d,s,this]),s++;return i}reduceRight(...e){const[t,r]=e;let s=r??this.at(-1);for(let i=this.size-1;i>=0;i--){const d=this.at(i);i===this.size-1&&e.length===1?s=d:s=Reflect.apply(t,this,[s,d,i,this])}return s}toSorted(e){const t=[...this.entries()].sort(e);return new P(t)}toReversed(){const e=new P;for(let t=this.size-1;t>=0;t--){const r=this.keyAt(t),s=this.get(r);e.set(r,s)}return e}toSpliced(...e){const t=[...this.entries()];return t.splice(...e),new P(t)}slice(e,t){const r=new P;let s=this.size-1;if(e===void 0)return r;e<0&&(e=e+this.size),t!==void 0&&t>0&&(s=t-1);for(let i=e;i<=s;i++){const d=this.keyAt(i),f=this.get(d);r.set(d,f)}return r}every(e,t){let r=0;for(const s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(const s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}},b=new WeakMap,y(P,"OrderedDict"),P);function z(n,o){if("at"in Array.prototype)return Array.prototype.at.call(n,o);const e=Ne(n,o);return e===-1?void 0:n[e]}y(z,"at");function Ne(n,o){const e=n.length,t=oe(o),r=t>=0?t:e+t;return r<0||r>=e?-1:r}y(Ne,"toSafeIndex");function oe(n){return n!==n||n===0?0:Math.trunc(n)}y(oe,"toSafeInteger");function tt(n){const o=n+"CollectionProvider",[e,t]=K(o),[r,s]=e(o,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Q,setItemMap:y(()=>{},"setItemMap")}),i=y(({state:u,...m})=>u?c.jsx(f,{...m,state:u}):c.jsx(d,{...m}),"CollectionProvider");i.displayName=o;const d=y(u=>{const m=g();return c.jsx(f,{...u,state:m})},"CollectionInit");d.displayName=o+"Init";const f=y(u=>{const{scope:m,children:O,state:N}=u,_=l.useRef(null),[E,w]=l.useState(null),G=T(_,w),[U,W]=N;return l.useEffect(()=>{if(!E)return;const D=Se(()=>{});return D.observe(E,{childList:!0,subtree:!0}),()=>{D.disconnect()}},[E]),c.jsx(r,{scope:m,itemMap:U,setItemMap:W,collectionRef:G,collectionRefObject:_,collectionElement:E,children:O})},"CollectionProviderImpl");f.displayName=o+"Impl";const p=n+"CollectionSlot",a=V(p),h=l.forwardRef((u,m)=>{const{scope:O,children:N}=u,_=s(p,O),E=T(m,_.collectionRef);return c.jsx(a,{ref:E,children:N})});h.displayName=p;const x=n+"CollectionItemSlot",j="data-radix-collection-item",C=V(x),v=l.forwardRef((u,m)=>{const{scope:O,children:N,..._}=u,E=l.useRef(null),[w,G]=l.useState(null),U=T(m,E,G),W=s(x,O),{setItemMap:D}=W,Y=l.useRef(_);_e(Y.current,_)||(Y.current=_);const me=Y.current;return l.useEffect(()=>{const xe=me;return D(M=>w?M.has(w)?M.set(w,{...xe,element:w}).toSorted(X):(M.set(w,{...xe,element:w}),M.toSorted(X)):M),()=>{D(M=>!w||!M.has(w)?M:(M.delete(w),new Q(M)))}},[w,me,D]),c.jsx(C,{[j]:"",ref:U,children:N})});v.displayName=x;function g(){return l.useState(new Q)}y(g,"useInitCollection");function I(u){const{itemMap:m}=s(n+"CollectionConsumer",u);return m}return y(I,"useCollection"),[{Provider:i,Slot:h,ItemSlot:v},{createCollectionScope:t,useCollection:I,useInitCollection:g}]}y(tt,"createCollection");function _e(n,o){if(n===o)return!0;if(typeof n!="object"||typeof o!="object"||n==null||o==null)return!1;const e=Object.keys(n),t=Object.keys(o);if(e.length!==t.length)return!1;for(const r of e)if(!Object.prototype.hasOwnProperty.call(o,r)||n[r]!==o[r])return!1;return!0}y(_e,"shallowEqual");function Pe(n,o){return!!(o.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}y(Pe,"isElementPreceding");function X(n,o){return!n[1].element||!o[1].element?0:Pe(n[1].element,o[1].element)?-1:1}y(X,"sortByDocumentPosition");function Se(n){return new MutationObserver(e=>{for(const t of e)if(t.type==="childList"){n();return}})}y(Se,"getChildListObserver");var ot=Object.defineProperty,nt=(n,o)=>ot(n,"name",{value:o,configurable:!0}),st=l.createContext(void 0);function Oe(n){const o=l.useContext(st);return n||o||"ltr"}nt(Oe,"useDirection");var rt=Object.defineProperty,L=(n,o)=>rt(n,"name",{value:o,configurable:!0}),ne="Collapsible",[ct,Ee]=K(ne),[it,se]=ct(ne),lt=l.forwardRef(L(function(o,e){const{__scopeCollapsible:t,open:r,defaultOpen:s,disabled:i,onOpenChange:d,...f}=o,[p,a]=te({prop:r,defaultProp:s??!1,onChange:d,caller:ne});return c.jsx(it,{scope:t,disabled:i,contentId:Re(),open:p,onOpenToggle:l.useCallback(()=>a(h=>!h),[a]),children:c.jsx($.div,{"data-state":q(p),"data-disabled":i?"":void 0,...f,ref:e})})},"Collapsible")),at="CollapsibleTrigger",dt=l.forwardRef(L(function(o,e){const{__scopeCollapsible:t,...r}=o,s=se(at,t);return c.jsx($.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":q(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:we(o.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),Me="CollapsibleContent",ut=l.forwardRef(L(function(o,e){const{forceMount:t,...r}=o,s=se(Me,o.__scopeCollapsible);return c.jsx(Ye,{present:t||s.open,children:({present:i})=>c.jsx(ft,{...r,ref:e,present:i})})},"CollapsibleContent")),ft=l.forwardRef(L(function(o,e){const{__scopeCollapsible:t,present:r,children:s,...i}=o,d=se(Me,t),[f,p]=l.useState(r),a=l.useRef(null),h=T(e,a),x=l.useRef(0),j=x.current,C=l.useRef(0),v=C.current,g=d.open||f,I=l.useRef(g),A=l.useRef(void 0);return l.useEffect(()=>{const u=requestAnimationFrame(()=>I.current=!1);return()=>cancelAnimationFrame(u)},[]),Je(()=>{const u=a.current;if(u){A.current=A.current||{transitionDuration:u.style.transitionDuration,animationName:u.style.animationName},u.style.transitionDuration="0s",u.style.animationName="none";const m=u.getBoundingClientRect();x.current=m.height,C.current=m.width,I.current||(u.style.transitionDuration=A.current.transitionDuration,u.style.animationName=A.current.animationName),p(r)}},[d.open,r]),c.jsx($.div,{"data-state":q(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!g,...i,ref:h,style:{"--radix-collapsible-content-height":j?`${j}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...o.style},children:g&&s})},"CollapsibleContentImpl"));function q(n){return n?"open":"closed"}L(q,"getState");var pt=lt,ht=dt,mt=ut,xt=Object.defineProperty,S=(n,o)=>xt(n,"name",{value:o,configurable:!0}),k="Accordion",gt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[re,Ct,vt]=je(k),[H,qt]=K(k,[vt,Ee]),ce=Ee(),bt=l.forwardRef(S(function(o,e){const{type:t,...r}=o,s=r,i=r;return c.jsx(re.Provider,{scope:o.__scopeAccordion,children:t==="multiple"?c.jsx(wt,{...i,ref:e}):c.jsx(At,{...s,ref:e})})},"Accordion")),[ke,yt]=H(k),[Te,It]=H(k,{collapsible:!1}),At=l.forwardRef(S(function(o,e){const{value:t,defaultValue:r,onValueChange:s=S(()=>{},"onValueChange"),collapsible:i=!1,...d}=o,[f,p]=te({prop:t,defaultProp:r??"",onChange:s,caller:k});return c.jsx(ke,{scope:o.__scopeAccordion,value:l.useMemo(()=>f?[f]:[],[f]),onItemOpen:p,onItemClose:l.useCallback(()=>i&&p(""),[i,p]),children:c.jsx(Te,{scope:o.__scopeAccordion,collapsible:i,children:c.jsx(De,{...d,ref:e})})})},"AccordionImplSingle")),wt=l.forwardRef(S(function(o,e){const{value:t,defaultValue:r,onValueChange:s=S(()=>{},"onValueChange"),...i}=o,[d,f]=te({prop:t,defaultProp:r??[],onChange:s,caller:k}),p=l.useCallback(h=>f((x=[])=>[...x,h]),[f]),a=l.useCallback(h=>f((x=[])=>x.filter(j=>j!==h)),[f]);return c.jsx(ke,{scope:o.__scopeAccordion,value:d,onItemOpen:p,onItemClose:a,children:c.jsx(Te,{scope:o.__scopeAccordion,collapsible:!0,children:c.jsx(De,{...i,ref:e})})})},"AccordionImplMultiple")),[Rt,B]=H(k),De=l.forwardRef(S(function(o,e){const{__scopeAccordion:t,disabled:r,dir:s,orientation:i="vertical",...d}=o,f=l.useRef(null),p=T(f,e),a=Ct(t),x=Oe(s)==="ltr",j=we(o.onKeyDown,C=>{if(!gt.includes(C.key))return;const v=C.target,g=a().filter(w=>!w.ref.current?.disabled),I=g.findIndex(w=>w.ref.current===v),A=g.length;if(I===-1)return;C.preventDefault();let u=I;const m=0,O=A-1,N=S(()=>{u=I+1,u>O&&(u=m)},"moveNext"),_=S(()=>{u=I-1,u<m&&(u=O)},"movePrev");switch(C.key){case"Home":u=m;break;case"End":u=O;break;case"ArrowRight":i==="horizontal"&&(x?N():_());break;case"ArrowDown":i==="vertical"&&N();break;case"ArrowLeft":i==="horizontal"&&(x?_():N());break;case"ArrowUp":i==="vertical"&&_();break}const E=u%A;g[E].ref.current?.focus()});return c.jsx(Rt,{scope:t,disabled:r,direction:s,orientation:i,children:c.jsx(re.Slot,{scope:t,children:c.jsx($.div,{...d,"data-orientation":i,ref:p,onKeyDown:r?void 0:j})})})},"AccordionImpl")),Z="AccordionItem",[jt,ie]=H(Z),Nt=l.forwardRef(S(function(o,e){const{__scopeAccordion:t,value:r,...s}=o,i=B(Z,t),d=yt(Z,t),f=ce(t),p=Re(),a=r&&d.value.includes(r)||!1,h=i.disabled||o.disabled;return c.jsx(jt,{scope:t,open:a,disabled:h,triggerId:p,children:c.jsx(pt,{"data-orientation":i.orientation,"data-state":le(a),...f,...s,ref:e,disabled:h,open:a,onOpenChange:x=>{x?d.onItemOpen(r):d.onItemClose(r)}})})},"AccordionItem")),_t="AccordionHeader",Pt=l.forwardRef(S(function(o,e){const{__scopeAccordion:t,...r}=o,s=B(k,t),i=ie(_t,t);return c.jsx($.h3,{"data-orientation":s.orientation,"data-state":le(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})},"AccordionHeader")),Ie="AccordionTrigger",St=l.forwardRef(S(function(o,e){const{__scopeAccordion:t,...r}=o,s=B(k,t),i=ie(Ie,t),d=It(Ie,t),f=ce(t);return c.jsx(re.ItemSlot,{scope:t,children:c.jsx(ht,{"aria-disabled":i.open&&!d.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...f,...r,ref:e})})},"AccordionTrigger")),Ot="AccordionContent",Et=l.forwardRef(S(function(o,e){const{__scopeAccordion:t,...r}=o,s=B(k,t),i=ie(Ot,t),d=ce(t);return c.jsx(mt,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...d,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...o.style}})},"AccordionContent"));function le(n){return n?"open":"closed"}S(le,"getState");var Mt=bt,kt=Nt,Tt=Pt,$e=St,Le=Et,ze=Mt,ae=l.forwardRef(({className:n,...o},e)=>c.jsx(kt,{ref:e,className:ee("cds-border-b cds-border-border",n),...o}));ae.displayName="AccordionItem";var de=l.forwardRef(({className:n,children:o,...e},t)=>c.jsx(Tt,{className:"cds-flex",children:c.jsxs($e,{ref:t,className:ee("cds-flex cds-flex-1 cds-items-center cds-justify-between cds-py-4 cds-text-left cds-font-medium cds-text-fg cds-transition-all hover:cds-underline focus-visible:cds-outline-none focus-visible:cds-ring-2 focus-visible:cds-ring-ring [&[data-state=open]>svg]:cds-rotate-180",n),...e,children:[o,c.jsx(Qe,{className:"cds-h-4 cds-w-4 cds-shrink-0 cds-text-fg-muted cds-transition-transform cds-duration-200"})]})}));de.displayName=$e.displayName;var ue=l.forwardRef(({className:n,children:o,...e},t)=>c.jsx(Le,{ref:t,className:"cds-overflow-hidden cds-text-sm cds-text-fg data-[state=closed]:cds-animate-accordion-up data-[state=open]:cds-animate-accordion-down",...e,children:c.jsx("div",{className:ee("cds-pb-4 cds-pt-0",n),children:o})}));ue.displayName=Le.displayName;var Dt=He({GroupEntries:()=>he,ReviewEditButton:()=>Ve,ReviewPanel:()=>Ke,RowList:()=>F,sectionClass:()=>fe,sectionHeadingClass:()=>pe}),fe="cds-mb-4 cds-rounded-xl cds-border cds-border-border cds-bg-surface-elevated cds-p-4",pe="cds-text-sm cds-font-bold cds-uppercase cds-tracking-wide cds-text-fg",$t=n=>{let o=n.label.replace(/s$/i,"").toLowerCase();return`${n.entries.length} ${n.entries.length===1?o:`${o}s`}`},F=({rows:n})=>c.jsx("dl",{className:"cds-space-y-1 cds-text-sm",children:n.map(o=>c.jsxs("div",{className:"cds-flex cds-justify-between cds-gap-4",children:[c.jsx("dt",{className:"cds-min-w-0 cds-flex-1 cds-text-fg-muted",children:o.label}),c.jsx("dd",{"data-credify-redact":!0,className:"cds-max-w-[55%] cds-text-right cds-font-semibold cds-text-fg",children:o.value})]},o.key))}),Ve=({label:n,onClick:o})=>c.jsxs("button",{type:"button",onClick:o,"aria-label":`Edit ${n}`,className:`cds-inline-flex cds-items-center cds-gap-1 cds-rounded cds-px-2 cds-py-1 cds-text-xs cds-font-semibold cds-text-fg hover:cds-bg-highlight ${Ae}`,children:[c.jsx(Ze,{"aria-hidden":"true",className:"cds-h-3.5 cds-w-3.5"}),"Edit"]}),Ke=({stages:n,questionsByStage:o,values:e,busy:t,error:r,suppressedKeys:s,onEditStage:i,onConfirm:d})=>{let f=n.map(a=>{let h=o[a]??[];return{stage:a,rows:We({questions:h,values:e,stageKey:a,suppressedKeys:s}),groups:Ue({questions:h,values:e,stageKey:a,suppressedKeys:s}),validation:Ge({questions:h,values:e,stageKey:a})}}),p=f.filter(a=>!a.validation.isValid);return c.jsxs("div",{className:"cds-py-2",children:[c.jsx("h2",{className:"cds-mb-1 cds-text-2xl cds-font-bold cds-text-fg",children:"Review your answers"}),c.jsx("p",{className:"cds-mb-5 cds-text-sm cds-text-fg-muted",children:"Carriers price from exactly this — a quick check now avoids surprises later."}),p.length?c.jsxs("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-warning cds-bg-warning-surface cds-p-4",children:[c.jsxs("h3",{className:"cds-mb-2 cds-text-sm cds-font-bold cds-text-fg",children:[p.length===1?"One section needs":`${p.length} sections need`," attention"]}),c.jsx("ul",{className:"cds-space-y-1 cds-text-sm cds-text-fg-muted",children:p.map(a=>c.jsxs("li",{children:[c.jsx("button",{type:"button",onClick:()=>i(a.stage),className:`cds-font-semibold cds-text-fg cds-underline ${Ae}`,children:be(a.stage).short}),": ",a.validation.issues[0],a.validation.issues.length>1?` (+${a.validation.issues.length-1} more)`:""]},a.stage))})]}):null,f.filter(a=>a.rows.length>0||a.groups.length>0).map(a=>{let h=be(a.stage).short;return c.jsxs("section",{className:fe,children:[c.jsxs("div",{className:"cds-mb-2 cds-flex cds-items-center cds-justify-between",children:[c.jsx("h3",{className:pe,children:h}),c.jsx(Ve,{label:h,onClick:()=>i(a.stage)})]}),a.rows.length?c.jsx(F,{rows:a.rows}):null,a.groups.map(x=>c.jsx(he,{group:x},x.groupKey))]},a.stage)}),c.jsx(Be,{message:r}),c.jsx(Fe,{disabled:p.length>0,busy:t,onChoose:d}),c.jsx("p",{className:"cds-mt-3 cds-text-xs cds-text-fg-muted",children:"Either choice takes you to your quotes. Submitting runs a soft credit inquiry with the carriers you authorized. It does not affect your credit score."})]})},he=({group:n})=>n.entries.length?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"cds-mb-1 cds-text-sm cds-text-fg-muted",children:$t(n)}),c.jsx(ze,{type:"multiple",children:n.entries.map((o,e)=>c.jsxs(ae,{value:`${n.groupKey}-${e}`,className:"cds-border-border last:cds-border-b-0",children:[c.jsx(de,{className:"cds-py-2 cds-text-sm cds-font-semibold cds-text-fg hover:cds-no-underline",children:o.name}),c.jsx(ue,{className:"cds-pb-3 cds-pt-0",children:c.jsx(F,{rows:o.rows})})]},`${n.groupKey}-${e}`))})]}):c.jsxs("p",{className:"cds-text-sm cds-text-fg-muted",children:["No ",n.label.toLowerCase()," added yet."]});const Ht=Object.freeze(Object.defineProperty({__proto__:null,a:fe,c:ue,i:Dt,l:ae,n:Ke,o:pe,r:F,s:ze,t:he,u:de},Symbol.toStringTag,{value:"Module"}));export{he as D,Ze as P,pe as S,Ht as r,F as w,fe as x};
@@ -0,0 +1 @@
1
+ import{t as O,i as V,k as x,H as D,u as F}from"./iframe-BImWklE9.js";import{t as q,n as g}from"./types-LUGvo5ic-CB-wcgK3.js";import{k as d,j as f,n as L,u as P,c as R,d as U,A as j}from"./visibility-hEdBjgi7-_AUGO8E2.js";import{k as A}from"./validation-DRqHT-u7-pY2KjHw4.js";import{t as $,l as Y,a as H,o as Q,i as K,f as I,n as M,r as B}from"./vehicleCoverage-BPJaWQyg-DBJ_jL3e.js";var C=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"]),W=new Set(["total_area_sq_ft","annual_mileage","miles_to_work","distance_to_coast_miles"]),G=s=>C.has(s),Z=s=>C.has(s)||W.has(s),z=(s,e)=>{let r=String(s??"").replace(/\D/g,"");if(!r)return"";let t=Number(r);if(!Number.isFinite(t))return"";let o=t.toLocaleString("en-US");return e?`$${o}`:o},pe=O({STAGES_BY_PRODUCT:()=>F,ZIP_FIRST_PAINT_CACHE_KEY:()=>D,ZIP_FIRST_PAINT_QUESTIONS:()=>x,itemScope:()=>w,reviewGroupsForStage:()=>le,reviewRowsForStage:()=>oe,stageSlice:()=>te,validateStage:()=>se}),J=["ssn_display"],w=(s,e)=>{let r={...s,...e};for(let t of J)t in e||delete r[t];return r},X=(s,e,r)=>{let t=w(s,e);for(let o of r)o.key in e?t[o.key]=e[o.key]:delete t[o.key];return t},ee={vehicles:"Vehicle",drivers:"Driver",driver_accidents:"Accident",driver_violations:"Violation",losses:"Loss",home_losses:"Loss"},h=s=>ee[s]??"Entry",b=(s,e,r,t)=>{let o=(l,i)=>{l.forEach(a=>{let u=P(a);if(u){let n=R(a)||i[a.key]===u.conditionalValue;t(a.key,u.conditionalQuestions??[],n)}U(a,i).forEach(n=>{n.conditionalQuestionsAllowMultiple||o(n.conditionalQuestions??[],i)})})};o(L(s),e)},se=({questions:s,values:e,stageKey:r})=>{let t=d(s,e,r),o=A(t,e),l=[],i=[];for(let[a,u]of Object.entries(o)){let n=t.find(c=>c.key===a);i.push(`${n?.question??a}: ${u}`)}if(b(s,e,r,(a,u,n)=>{if(!n)return;let c=f(e,a);if(!c.length){i.push(`Add at least one ${h(a).toLowerCase()}.`),o[g(a)]=`Add at least one ${h(a).toLowerCase()}.`;return}c.forEach((y,p)=>{let _=j(u,y,e,r,p),N=A(_,X(e,y,_)),m={};for(let k of _){let v=N[k.key];v&&(m[k.key]=v,i.push(`${h(a)} ${p+1} — ${k.question}: ${v}`))}Object.keys(m).length&&l.push({groupKey:a,index:p,errorsByKey:m})})}),t.some(a=>a.key==="vehicle_policy_selections")){let a=f(e,"vehicles"),u=new Map;for(let y of Y(a))u.set(y.index,{...y.errorsByKey}),i.push(`Vehicle ${y.index+1} — coverage selections are incomplete.`);let n=H(e),c=f(e,"drivers").length;a.forEach((y,p)=>{let _=Q(n,p,c);_&&(u.set(p,{...u.get(p)??{},[$]:_}),i.push(`Vehicle ${p+1} — ${_}`))});for(let[y,p]of u)l.push({groupKey:"vehicles",index:y,errorsByKey:p})}return{errorsByKey:o,itemErrors:l,issues:i,isValid:Object.keys(o).length===0&&l.length===0}},E=s=>Object.values(s).every(e=>e==null||String(e).trim()===""),te=(s,e,r)=>{let t={};for(let l of d(s,e,r))l.key in e&&(t[l.key]=e[l.key]);b(s,e,r,(l,i,a)=>{let u=g(l);if(!a||!(u in e))return;let n=f(e,l),c=n.filter(y=>!E(y));!c.length&&n.length||(t[u]=c,t[l]=e[l]??"Yes")});let o=g("vehicles");return d(s,e,r).some(l=>l.key==="vehicle_policy_selections")&&o in e&&!(o in t)&&(t[o]=f(e,"vehicles").filter(l=>!E(l)),t.vehicles=e.vehicles??"Yes","driver_vehicle_assignments"in e&&(t[$]=e[$])),t},re=(s,e)=>[s.first_name,s.last_name].map(r=>String(r??"").trim()).filter(Boolean).join(" ")||`Driver ${e+1}`,ie=(s,e,r)=>s==="vehicles"?I(e,r):s==="drivers"?re(e,r):`${h(s)} ${r+1}`,le=({questions:s,values:e,stageKey:r,suppressedKeys:t})=>{let o=[];return b(s,e,r,(l,i,a)=>{if(!a)return;let u=f(e,l).map((n,c)=>{let y=w(e,n),p=j(i,n,e,r,c);return{name:ie(l,n,c),rows:p.filter(_=>!_.key.endsWith(q)).filter(_=>!t?.has(_.key)).map(_=>({key:`${l}__${c}__${_.key}`,label:_.question,value:S(_,n[_.key],y)}))}});o.push({groupKey:l,label:l.replace(/_/g," ").replace(/^./,n=>n.toUpperCase()),entries:u})}),o},T=s=>{let e=String(s??"").replace(/\D/g,"");return e.length>=4?e.slice(-4):null},S=(s,e,r)=>{if(s.key==="social_security_number"){let t=T(e)??T(r.ssn_display);return t?`•••–••–${t}`:"—"}return e==null||e===""?"—":e===!0?"Yes":e===!1?"No":Array.isArray(e)?`${e.length} added`:s.inputType==="select"||s.inputType==="radio"?V(s.key,String(e)):s.inputType==="number"&&Z(s.key)&&z(e,G(s.key))||String(e)},ae=s=>({question:B[s],key:s,required:!0,inputType:"select"}),oe=({questions:s,values:e,stageKey:r,suppressedKeys:t})=>{let o=d(s,e,r),l=o.filter(i=>!i.key.endsWith(q)).filter(i=>i.key!==K).filter(i=>!t?.has(i.key)).map(i=>({key:i.key,label:i.question,value:S(i,e[i.key],e)}));return o.some(i=>i.key==="vehicle_policy_selections")&&f(e,"vehicles").forEach((i,a)=>{let u=I(i,a);for(let n of M)l.push({key:`${K}__${a}__${n}`,label:`${u} — ${B[n]}`,value:S(ae(n),i[n],e)})}),l};export{pe as a,W as c,Z as d,te as i,z as l,le as n,se as o,oe as r,C as s,w as t,G as u};
@@ -0,0 +1 @@
1
+ var e="__items",r=t=>`${t}${e}`;export{r as n,e as t};
@@ -0,0 +1,3 @@
1
+ import{_ as _t}from"./visibility-hEdBjgi7-_AUGO8E2.js";var he;function u(e,t,r){function n(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);const l=i.prototype,f=Object.keys(l);for(let m=0;m<f.length;m++){const b=f[m];b in s||(s[b]=l[b].bind(s))}}const o=r?.Parent??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function i(s){var c;const l=r?.Parent?new a:this;n(l,s),(c=l._zod).deferred??(c.deferred=[]);for(const f of l._zod.deferred)f();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class R extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Fe extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(he=globalThis).__zod_globalConfig??(he.__zod_globalConfig={});const gt=globalThis.__zod_globalConfig;function P(e){return gt}function oe(e,t){return typeof t=="bigint"?t.toString():t}function ce(e){return e==null}function le(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function bt(e,t){const r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}const _e=Symbol("evaluating");function p(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_e)return n===void 0&&(n=_e,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function vt(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function yt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Je="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ge(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ie(e){if(ge(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(ge(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ve(e){return ie(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function F(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wt(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function d(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const zt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function U(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function $t(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function kt(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function V(e){return typeof e=="string"?e:e?.message}function E(e,t,r){const n=e.message?e.message:V(e.inst?._zod.def?.error?.(e))??V(t?.error?.(e))??V(r.customError?.(e))??V(r.localeError?.(e))??"Invalid input",{inst:o,continue:a,input:i,...s}=e;return s.path??(s.path=[]),s.message=n,t?.reportInput&&(s.input=i),s}function de(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function J(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Ye=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,oe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=u("$ZodError",Ye),We=u("$ZodError",Ye,{Parent:Error});function Zt(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function St(e,t=r=>r.message){const r={_errors:[]},n=(o,a=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>n({issues:s},[...a,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...a,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...a,...i.path]);else{const s=[...a,...i.path];if(s.length===0)r._errors.push(t(i));else{let c=r,l=0;for(;l<s.length;){const f=s[l];l===s.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(t(i))):c[f]=c[f]||{_errors:[]},c=c[f],l++}}}};return n(e),r}const fe=e=>(t,r,n,o)=>{const a=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new R;if(i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>E(c,a,P())));throw Je(s,o?.callee),s}return i.value},me=e=>async(t,r,n,o)=>{const a=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>E(c,a,P())));throw Je(s,o?.callee),s}return i.value},H=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new R;return a.issues.length?{success:!1,error:new(e??Ke)(a.issues.map(i=>E(i,o,P())))}:{success:!0,data:a.value}},Ot=H(We),Q=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>E(i,o,P())))}:{success:!0,data:a.value}},It=Q(We),Nt=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return fe(e)(t,r,o)},Tt=e=>(t,r,n)=>fe(e)(t,r,n),Pt=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return me(e)(t,r,o)},Et=e=>async(t,r,n)=>me(e)(t,r,n),At=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return H(e)(t,r,o)},Ct=e=>(t,r,n)=>H(e)(t,r,n),Dt=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Q(e)(t,r,o)},Ut=e=>async(t,r,n)=>Q(e)(t,r,n),Rt=/^[cC][0-9a-z]{6,}$/,xt=/^[0-9a-z]+$/,jt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mt=/^[0-9a-vA-V]{20}$/,Lt=/^[A-Za-z0-9]{27}$/,Ft=/^[a-zA-Z0-9_-]{21}$/,Jt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,be=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Yt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Wt(){return new RegExp(Kt,"u")}const qt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Bt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Xt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ht=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qe=/^[A-Za-z0-9_-]*$/,Qt=/^https?$/,er=/^\+[1-9]\d{6,14}$/,Ge="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tr=new RegExp(`^${Ge}$`);function Be(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rr(e){return new RegExp(`^${Be(e)}$`)}function nr(e){const t=Be({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ge}T(?:${n})$`)}const or=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ir=/^-?\d+$/,ar=/^-?\d+(?:\.\d+)?$/,sr=/^[^A-Z]*$/,ur=/^[^a-z]*$/,Z=u("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Xe={number:"number",bigint:"bigint",object:"date"},He=u("$ZodCheckLessThan",(e,t)=>{Z.init(e,t);const r=Xe[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,a=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qe=u("$ZodCheckGreaterThan",(e,t)=>{Z.init(e,t);const r=Xe[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,a=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cr=u("$ZodCheckMultipleOf",(e,t)=>{Z.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):bt(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),lr=u("$ZodCheckNumberFormat",(e,t)=>{Z.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,a]=zt[t.format];e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,s.minimum=o,s.maximum=a,r&&(s.pattern=ir)}),e._zod.check=i=>{const s=i.value;if(r){if(!Number.isInteger(s)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?i.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<o&&i.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>a&&i.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),dr=u("$ZodCheckMaxLength",(e,t)=>{var r;Z.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ce(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const i=de(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fr=u("$ZodCheckMinLength",(e,t)=>{var r;Z.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ce(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=de(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),mr=u("$ZodCheckLengthEquals",(e,t)=>{var r;Z.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ce(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,a=o.length;if(a===t.length)return;const i=de(o),s=a>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ee=u("$ZodCheckStringFormat",(e,t)=>{var r,n;Z.init(e,t),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),pr=u("$ZodCheckRegex",(e,t)=>{ee.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hr=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=sr),ee.init(e,t)}),_r=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ur),ee.init(e,t)}),gr=u("$ZodCheckIncludes",(e,t)=>{Z.init(e,t);const r=F(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),br=u("$ZodCheckStartsWith",(e,t)=>{Z.init(e,t);const r=new RegExp(`^${F(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),vr=u("$ZodCheckEndsWith",(e,t)=>{Z.init(e,t);const r=new RegExp(`.*${F(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),yr=u("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),wr={major:4,minor:4,patch:3},y=u("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wr;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const a of o._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,s,c)=>{let l=U(i),f;for(const m of s){if(m._zod.def.when){if($t(i)||!m._zod.def.when(i))continue}else if(l)continue;const b=i.issues.length,h=m._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new R;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,i.issues.length!==b&&(l||(l=U(i,b)))});else{if(i.issues.length===b)continue;l||(l=U(i,b))}}return f?f.then(()=>i):i},a=(i,s,c)=>{if(U(i))return i.aborted=!0,i;const l=o(s,n,c);if(l instanceof Promise){if(c.async===!1)throw new R;return l.then(f=>e._zod.parse(f,c))}return e._zod.parse(l,c)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if(s.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(f=>a(f,i,s)):a(l,i,s)}const c=e._zod.parse(i,s);if(c instanceof Promise){if(s.async===!1)throw new R;return c.then(l=>o(l,n,s))}return o(c,n,s)}}p(e,"~standard",()=>({validate:o=>{try{const a=Ot(e,o);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return It(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),pe=u("$ZodString",(e,t)=>{y.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??or(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),_=u("$ZodStringFormat",(e,t)=>{ee.init(e,t),pe.init(e,t)}),zr=u("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Vt),_.init(e,t)}),$r=u("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=be(n))}else t.pattern??(t.pattern=be());_.init(e,t)}),kr=u("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Yt),_.init(e,t)}),Zr=u("$ZodURL",(e,t)=>{_.init(e,t),e._zod.check=r=>{try{const n=r.value.trim();if(!t.normalize&&t.protocol?.source===Qt.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Sr=u("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Wt()),_.init(e,t)}),Or=u("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ft),_.init(e,t)}),Ir=u("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Rt),_.init(e,t)}),Nr=u("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xt),_.init(e,t)}),Tr=u("$ZodULID",(e,t)=>{t.pattern??(t.pattern=jt),_.init(e,t)}),Pr=u("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mt),_.init(e,t)}),Er=u("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Lt),_.init(e,t)}),Ar=u("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nr(t)),_.init(e,t)}),Cr=u("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tr),_.init(e,t)}),Dr=u("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=rr(t)),_.init(e,t)}),Ur=u("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Jt),_.init(e,t)}),Rr=u("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qt),_.init(e,t),e._zod.bag.format="ipv4"}),xr=u("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Gt),_.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),jr=u("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Bt),_.init(e,t)}),Mr=u("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Xt),_.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,a]=n;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function et(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Lr=u("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ht),_.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{et(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Fr(e){if(!qe.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return et(r)}const Jr=u("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=qe),_.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Fr(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Vr=u("$ZodE164",(e,t)=>{t.pattern??(t.pattern=er),_.init(e,t)});function Yr(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Kr=u("$ZodJWT",(e,t)=>{_.init(e,t),e._zod.check=r=>{Yr(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tt=u("$ZodNumber",(e,t)=>{y.init(e,t),e._zod.pattern=e._zod.bag.pattern??ar,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),r}}),Wr=u("$ZodNumberFormat",(e,t)=>{lr.init(e,t),tt.init(e,t)});function ve(e,t,r){e.issues.length&&t.issues.push(...kt(r,e.issues)),t.value[r]=e.value}const qr=u("$ZodArray",(e,t)=>{y.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const a=[];for(let i=0;i<o.length;i++){const s=o[i],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?a.push(c.then(l=>ve(l,r,i))):ve(c,r,i)}return a.length?Promise.all(a).then(()=>r):r}});function ye(e,t,r,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!U(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(i=>E(i,n,P())))}),t)}const Gr=u("$ZodUnion",(e,t)=>{y.init(e,t),p(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),p(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),p(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),p(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>le(o.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let a=!1;const i=[];for(const s of t.options){const c=s._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)i.push(c),a=!0;else{if(c.issues.length===0)return c;i.push(c)}}return a?Promise.all(i).then(s=>ye(s,n,e,o)):ye(i,n,e,o)}}),Br=u("$ZodIntersection",(e,t)=>{y.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,a=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,l])=>we(r,c,l)):we(r,a,i)}});function ae(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ie(e)&&ie(t)){const r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};for(const a of n){const i=ae(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],a=t[n],i=ae(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function we(e,t,r){const n=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(s);const a=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&o&&e.issues.push({...o,keys:a}),U(e))return e;const i=ae(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Xr=u("$ZodLiteral",(e,t)=>{if(y.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?F(n):n?F(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{const a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),Hr=u("$ZodTransform",(e,t)=>{y.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fe(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new R;return r.value=o,r.fallback=!0,r}});function ze(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const rt=u("$ZodOptional",(e,t)=>{y.init(e,t),e._zod.optin="optional",e._zod.optout="optional",p(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${le(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=r.value,a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(i=>ze(i,o)):ze(a,o)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Qr=u("$ZodExactOptional",(e,t)=>{rt.init(e,t),p(e._zod,"values",()=>t.innerType._zod.values),p(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),en=u("$ZodNullable",(e,t)=>{y.init(e,t),p(e._zod,"optin",()=>t.innerType._zod.optin),p(e._zod,"optout",()=>t.innerType._zod.optout),p(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${le(r.source)}|null)$`):void 0}),p(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),tn=u("$ZodDefault",(e,t)=>{y.init(e,t),e._zod.optin="optional",p(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>$e(a,t)):$e(o,t)}});function $e(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const rn=u("$ZodPrefault",(e,t)=>{y.init(e,t),e._zod.optin="optional",p(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),nn=u("$ZodNonOptional",(e,t)=>{y.init(e,t),p(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>ke(a,e)):ke(o,e)}});function ke(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const on=u("$ZodCatch",(e,t)=>{y.init(e,t),e._zod.optin="optional",p(e._zod,"optout",()=>t.innerType._zod.optout),p(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(i=>E(i,n,P()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>E(a,n,P()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),an=u("$ZodPipe",(e,t)=>{y.init(e,t),p(e._zod,"values",()=>t.in._zod.values),p(e._zod,"optin",()=>t.in._zod.optin),p(e._zod,"optout",()=>t.out._zod.optout),p(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(r,n);return a instanceof Promise?a.then(i=>Y(i,t.in,n)):Y(a,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>Y(a,t.out,n)):Y(o,t.out,n)}});function Y(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const sn=u("$ZodReadonly",(e,t)=>{y.init(e,t),p(e._zod,"propValues",()=>t.innerType._zod.propValues),p(e._zod,"values",()=>t.innerType._zod.values),p(e._zod,"optin",()=>t.innerType?._zod?.optin),p(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Ze):Ze(o)}});function Ze(e){return e.value=Object.freeze(e.value),e}const un=u("$ZodCustom",(e,t)=>{Z.init(e,t),y.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(a=>Se(a,r,n,e));Se(o,r,n,e)}});function Se(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(J(o))}}var Oe;class cn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ln(){return new cn}(Oe=globalThis).__zod_globalRegistry??(Oe.__zod_globalRegistry=ln());const L=globalThis.__zod_globalRegistry;function dn(e,t){return new e({type:"string",...d(t)})}function nt(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...d(t)})}function Ie(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...d(t)})}function fn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...d(t)})}function mn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...d(t)})}function pn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...d(t)})}function hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...d(t)})}function _n(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...d(t)})}function gn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...d(t)})}function bn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...d(t)})}function vn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...d(t)})}function yn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...d(t)})}function wn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...d(t)})}function zn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...d(t)})}function $n(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...d(t)})}function kn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...d(t)})}function Zn(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...d(t)})}function Sn(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...d(t)})}function On(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...d(t)})}function In(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...d(t)})}function Nn(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...d(t)})}function Tn(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...d(t)})}function Pn(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...d(t)})}function En(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...d(t)})}function An(e,t){return new e({type:"string",format:"date",check:"string_format",...d(t)})}function Cn(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...d(t)})}function Dn(e,t){return new e({type:"string",format:"duration",check:"string_format",...d(t)})}function Un(e,t){return new e({type:"number",coerce:!0,checks:[],...d(t)})}function Rn(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...d(t)})}function Ne(e,t){return new He({check:"less_than",...d(t),value:e,inclusive:!1})}function re(e,t){return new He({check:"less_than",...d(t),value:e,inclusive:!0})}function Te(e,t){return new Qe({check:"greater_than",...d(t),value:e,inclusive:!1})}function ne(e,t){return new Qe({check:"greater_than",...d(t),value:e,inclusive:!0})}function Pe(e,t){return new cr({check:"multiple_of",...d(t),value:e})}function ot(e,t){return new dr({check:"max_length",...d(t),maximum:e})}function B(e,t){return new fr({check:"min_length",...d(t),minimum:e})}function it(e,t){return new mr({check:"length_equals",...d(t),length:e})}function xn(e,t){return new pr({check:"string_format",format:"regex",...d(t),pattern:e})}function jn(e){return new hr({check:"string_format",format:"lowercase",...d(e)})}function Mn(e){return new _r({check:"string_format",format:"uppercase",...d(e)})}function Ln(e,t){return new gr({check:"string_format",format:"includes",...d(t),includes:e})}function Fn(e,t){return new br({check:"string_format",format:"starts_with",...d(t),prefix:e})}function Jn(e,t){return new vr({check:"string_format",format:"ends_with",...d(t),suffix:e})}function j(e){return new yr({check:"overwrite",tx:e})}function Vn(e){return j(t=>t.normalize(e))}function Yn(){return j(e=>e.trim())}function Kn(){return j(e=>e.toLowerCase())}function Wn(){return j(e=>e.toUpperCase())}function qn(){return j(e=>yt(e))}function Gn(e,t,r){return new e({type:"array",element:t,...d(r)})}function Bn(e,t,r){return new e({type:"custom",check:"custom",fn:t,...d(r)})}function Xn(e,t){const r=Hn(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(J(o,n.value,r._zod.def));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(J(a))}},e(n.value,n)),t);return r}function Hn(e,t){const r=new Z({check:"custom",...d(t)});return r._zod.check=e,r}function at(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??L,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function k(e,t,r={path:[],schemaPath:[]}){var n;const o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{const f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const b=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,b,f)}const m=e._zod.parent;m&&(i.ref||(i.ref=m),k(m,t,f),t.seen.get(m).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&$(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function st(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const i of e.seen.entries()){const s=e.metadataRegistry.get(i[0])?.id;if(s){const c=n.get(s);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,i[0])}}const o=i=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(i[0])?.id,b=e.external.uri??(z=>z);if(m)return{ref:b(m)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${b("__shared")}#/${s}/${h}`}}if(i[1]===r)return{ref:"#"};const l=`#/${s}/`,f=i[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+f}},a=i=>{if(i[1].schema.$ref)return;const s=i[1],{ref:c,defId:l}=o(i);s.def={...s.schema},l&&(s.defId=l);const f=s.schema;for(const m in f)delete f[m];f.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const s=i[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
2
+
3
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const s=i[1];if(t===i[0]){a(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){a(i);continue}}if(e.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&e.reused==="ref"){a(i);continue}}}function ut(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const c=e.seen.get(s);if(c.ref===null)return;const l=c.def??c.schema,f={...l},m=c.ref;if(c.ref=null,m){n(m);const h=e.seen.get(m),z=h.schema;if(z.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(z)):Object.assign(l,z),Object.assign(l,f),s._zod.parent===m)for(const O in l)O==="$ref"||O==="allOf"||O in f||delete l[O];if(z.$ref&&h.def)for(const O in l)O==="$ref"||O==="allOf"||O in h.def&&JSON.stringify(l[O])===JSON.stringify(h.def[O])&&delete l[O]}const b=s._zod.parent;if(b&&b!==m){n(b);const h=e.seen.get(b);if(h?.schema.$ref&&(l.$ref=h.schema.$ref,h.def))for(const z in l)z==="$ref"||z==="allOf"||z in h.def&&JSON.stringify(l[z])===JSON.stringify(h.def[z])&&delete l[z]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};for(const s of[...e.seen.entries()].reverse())n(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,r.def??r.schema);const a=e.metadataRegistry.get(t)?.id;a!==void 0&&o.id===a&&delete o.id;const i=e.external?.defs??{};for(const s of e.seen.entries()){const c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:X(t,"input",e.processors),output:X(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function $(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return $(n.element,r);if(n.type==="set")return $(n.valueType,r);if(n.type==="lazy")return $(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return $(n.innerType,r);if(n.type==="intersection")return $(n.left,r)||$(n.right,r);if(n.type==="record"||n.type==="map")return $(n.keyType,r)||$(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:$(n.in,r)||$(n.out,r);if(n.type==="object"){for(const o in n.shape)if($(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if($(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if($(o,r))return!0;return!!(n.rest&&$(n.rest,r))}return!1}const Qn=(e,t={})=>r=>{const n=at({...r,processors:t});return k(e,n),st(n,e),ut(n,e)},X=(e,t,r={})=>n=>{const{libraryOptions:o,target:a}=n??{},i=at({...o??{},target:a,io:t,processors:r});return k(e,i),st(i,e),ut(i,e)},eo={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},to=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:a,maximum:i,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(o.minLength=a),typeof i=="number"&&(o.maxLength=i),s&&(o.format=eo[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const f=[...c];f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},ro=(e,t,r,n)=>{const o=r,{minimum:a,maximum:i,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:f}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number";const m=typeof f=="number"&&f>=(a??Number.NEGATIVE_INFINITY),b=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";m?h?(o.minimum=f,o.exclusiveMinimum=!0):o.exclusiveMinimum=f:typeof a=="number"&&(o.minimum=a),b?h?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},no=(e,t,r,n)=>{const o=e._zod.def,a=[];for(const i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(i))}else a.push(i);if(a.length!==0)if(a.length===1){const i=a[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else a.every(i=>typeof i=="number")&&(r.type="number"),a.every(i=>typeof i=="string")&&(r.type="string"),a.every(i=>typeof i=="boolean")&&(r.type="boolean"),a.every(i=>i===null)&&(r.type="null"),r.enum=a},oo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},io=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ao=(e,t,r,n)=>{const o=r,a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=k(a.element,t,{...n,path:[...n.path,"items"]})},so=(e,t,r,n)=>{const o=e._zod.def,a=o.inclusive===!1,i=o.options.map((s,c)=>k(s,t,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=i:r.anyOf=i},uo=(e,t,r,n)=>{const o=e._zod.def,a=k(o.left,t,{...n,path:[...n.path,"allOf",0]}),i=k(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];r.allOf=c},co=(e,t,r,n)=>{const o=e._zod.def,a=k(o.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},lo=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},fo=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},mo=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},po=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},ho=(e,t,r,n)=>{const o=e._zod.def,a=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?o.out:o.in:o.out;k(i,t,n);const s=t.seen.get(e);s.ref=i},_o=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType,r.readOnly=!0},ct=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const a=t.seen.get(e);a.ref=o.innerType},go=u("ZodISODateTime",(e,t)=>{Ar.init(e,t),g.init(e,t)});function bo(e){return En(go,e)}const vo=u("ZodISODate",(e,t)=>{Cr.init(e,t),g.init(e,t)});function yo(e){return An(vo,e)}const wo=u("ZodISOTime",(e,t)=>{Dr.init(e,t),g.init(e,t)});function zo(e){return Cn(wo,e)}const $o=u("ZodISODuration",(e,t)=>{Ur.init(e,t),g.init(e,t)});function ko(e){return Dn($o,e)}const Zo=(e,t)=>{Ke.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>St(e,r)},flatten:{value:r=>Zt(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,oe,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,oe,2)}},isEmpty:{get(){return e.issues.length===0}}})},S=u("ZodError",Zo,{Parent:Error}),So=fe(S),Oo=me(S),Io=H(S),No=Q(S),To=Nt(S),Po=Tt(S),Eo=Pt(S),Ao=Et(S),Co=At(S),Do=Ct(S),Uo=Dt(S),Ro=Ut(S),Ee=new WeakMap;function te(e,t,r){const n=Object.getPrototypeOf(e);let o=Ee.get(n);if(o||(o=new Set,Ee.set(n,o)),!o.has(t)){o.add(t);for(const a in r){const i=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const s=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}const w=u("ZodType",(e,t)=>(y.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:X(e,"input"),output:X(e,"output")}}),e.toJSONSchema=Qn(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>So(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Io(e,r,n),e.parseAsync=async(r,n)=>Oo(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>No(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>To(e,r,n),e.decode=(r,n)=>Po(e,r,n),e.encodeAsync=async(r,n)=>Eo(e,r,n),e.decodeAsync=async(r,n)=>Ao(e,r,n),e.safeEncode=(r,n)=>Co(e,r,n),e.safeDecode=(r,n)=>Do(e,r,n),e.safeEncodeAsync=async(r,n)=>Uo(e,r,n),e.safeDecodeAsync=async(r,n)=>Ro(e,r,n),te(e,"ZodType",{check(...r){const n=this.def;return this.clone(vt(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return wt(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Ii(r,n))},superRefine(r,n){return this.check(Ni(r,n))},overwrite(r){return this.check(j(r))},optional(){return De(this)},exactOptional(){return pi(this)},nullable(){return Ue(this)},nullish(){return De(Ue(this))},nonoptional(r){return wi(this,r)},array(){return oi(this)},or(r){return mt([this,r])},and(r){return si(this,r)},transform(r){return Re(this,di(r))},default(r){return gi(this,r)},prefault(r){return vi(this,r)},catch(r){return $i(this,r)},pipe(r){return Re(this,r)},readonly(){return Si(this)},describe(r){const n=this.clone();return L.add(n,{description:r}),n},meta(...r){if(r.length===0)return L.get(this);const n=this.clone();return L.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return L.get(e)?.description},configurable:!0}),e)),lt=u("_ZodString",(e,t)=>{pe.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,o,a)=>to(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,te(e,"_ZodString",{regex(...n){return this.check(xn(...n))},includes(...n){return this.check(Ln(...n))},startsWith(...n){return this.check(Fn(...n))},endsWith(...n){return this.check(Jn(...n))},min(...n){return this.check(B(...n))},max(...n){return this.check(ot(...n))},length(...n){return this.check(it(...n))},nonempty(...n){return this.check(B(1,...n))},lowercase(n){return this.check(jn(n))},uppercase(n){return this.check(Mn(n))},trim(){return this.check(Yn())},normalize(...n){return this.check(Vn(...n))},toLowerCase(){return this.check(Kn())},toUpperCase(){return this.check(Wn())},slugify(){return this.check(qn())}})}),xo=u("ZodString",(e,t)=>{pe.init(e,t),lt.init(e,t),e.email=r=>e.check(nt(dt,r)),e.url=r=>e.check(_n(Mo,r)),e.jwt=r=>e.check(Pn(ti,r)),e.emoji=r=>e.check(gn(Lo,r)),e.guid=r=>e.check(Ie(Ae,r)),e.uuid=r=>e.check(fn(K,r)),e.uuidv4=r=>e.check(mn(K,r)),e.uuidv6=r=>e.check(pn(K,r)),e.uuidv7=r=>e.check(hn(K,r)),e.nanoid=r=>e.check(bn(Fo,r)),e.guid=r=>e.check(Ie(Ae,r)),e.cuid=r=>e.check(vn(Jo,r)),e.cuid2=r=>e.check(yn(Vo,r)),e.ulid=r=>e.check(wn(Yo,r)),e.base64=r=>e.check(In(Ho,r)),e.base64url=r=>e.check(Nn(Qo,r)),e.xid=r=>e.check(zn(Ko,r)),e.ksuid=r=>e.check($n(Wo,r)),e.ipv4=r=>e.check(kn(qo,r)),e.ipv6=r=>e.check(Zn(Go,r)),e.cidrv4=r=>e.check(Sn(Bo,r)),e.cidrv6=r=>e.check(On(Xo,r)),e.e164=r=>e.check(Tn(ei,r)),e.datetime=r=>e.check(bo(r)),e.date=r=>e.check(yo(r)),e.time=r=>e.check(zo(r)),e.duration=r=>e.check(ko(r))});function T(e){return dn(xo,e)}const g=u("ZodStringFormat",(e,t)=>{_.init(e,t),lt.init(e,t)}),dt=u("ZodEmail",(e,t)=>{kr.init(e,t),g.init(e,t)});function jo(e){return nt(dt,e)}const Ae=u("ZodGUID",(e,t)=>{zr.init(e,t),g.init(e,t)}),K=u("ZodUUID",(e,t)=>{$r.init(e,t),g.init(e,t)}),Mo=u("ZodURL",(e,t)=>{Zr.init(e,t),g.init(e,t)}),Lo=u("ZodEmoji",(e,t)=>{Sr.init(e,t),g.init(e,t)}),Fo=u("ZodNanoID",(e,t)=>{Or.init(e,t),g.init(e,t)}),Jo=u("ZodCUID",(e,t)=>{Ir.init(e,t),g.init(e,t)}),Vo=u("ZodCUID2",(e,t)=>{Nr.init(e,t),g.init(e,t)}),Yo=u("ZodULID",(e,t)=>{Tr.init(e,t),g.init(e,t)}),Ko=u("ZodXID",(e,t)=>{Pr.init(e,t),g.init(e,t)}),Wo=u("ZodKSUID",(e,t)=>{Er.init(e,t),g.init(e,t)}),qo=u("ZodIPv4",(e,t)=>{Rr.init(e,t),g.init(e,t)}),Go=u("ZodIPv6",(e,t)=>{xr.init(e,t),g.init(e,t)}),Bo=u("ZodCIDRv4",(e,t)=>{jr.init(e,t),g.init(e,t)}),Xo=u("ZodCIDRv6",(e,t)=>{Mr.init(e,t),g.init(e,t)}),Ho=u("ZodBase64",(e,t)=>{Lr.init(e,t),g.init(e,t)}),Qo=u("ZodBase64URL",(e,t)=>{Jr.init(e,t),g.init(e,t)}),ei=u("ZodE164",(e,t)=>{Vr.init(e,t),g.init(e,t)}),ti=u("ZodJWT",(e,t)=>{Kr.init(e,t),g.init(e,t)}),ft=u("ZodNumber",(e,t)=>{tt.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,o,a)=>ro(e,n,o),te(e,"ZodNumber",{gt(n,o){return this.check(Te(n,o))},gte(n,o){return this.check(ne(n,o))},min(n,o){return this.check(ne(n,o))},lt(n,o){return this.check(Ne(n,o))},lte(n,o){return this.check(re(n,o))},max(n,o){return this.check(re(n,o))},int(n){return this.check(Ce(n))},safe(n){return this.check(Ce(n))},positive(n){return this.check(Te(0,n))},nonnegative(n){return this.check(ne(0,n))},negative(n){return this.check(Ne(0,n))},nonpositive(n){return this.check(re(0,n))},multipleOf(n,o){return this.check(Pe(n,o))},step(n,o){return this.check(Pe(n,o))},finite(){return this}});const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null}),ri=u("ZodNumberFormat",(e,t)=>{Wr.init(e,t),ft.init(e,t)});function Ce(e){return Rn(ri,e)}const ni=u("ZodArray",(e,t)=>{qr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ao(e,r,n,o),e.element=t.element,te(e,"ZodArray",{min(r,n){return this.check(B(r,n))},nonempty(r){return this.check(B(1,r))},max(r,n){return this.check(ot(r,n))},length(r,n){return this.check(it(r,n))},unwrap(){return this.element}})});function oi(e,t){return Gn(ni,e,t)}const ii=u("ZodUnion",(e,t)=>{Gr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>so(e,r,n,o),e.options=t.options});function mt(e,t){return new ii({type:"union",options:e,...d(t)})}const ai=u("ZodIntersection",(e,t)=>{Br.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>uo(e,r,n,o)});function si(e,t){return new ai({type:"intersection",left:e,right:t})}const ui=u("ZodLiteral",(e,t)=>{Xr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>no(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ci(e,t){return new ui({type:"literal",values:Array.isArray(e)?e:[e],...d(t)})}const li=u("ZodTransform",(e,t)=>{Hr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>io(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Fe(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(J(a,r.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(J(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function di(e){return new li({type:"transform",transform:e})}const fi=u("ZodOptional",(e,t)=>{rt.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ct(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function De(e){return new fi({type:"optional",innerType:e})}const mi=u("ZodExactOptional",(e,t)=>{Qr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ct(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function pi(e){return new mi({type:"optional",innerType:e})}const hi=u("ZodNullable",(e,t)=>{en.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>co(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ue(e){return new hi({type:"nullable",innerType:e})}const _i=u("ZodDefault",(e,t)=>{tn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gi(e,t){return new _i({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ve(t)}})}const bi=u("ZodPrefault",(e,t)=>{rn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function vi(e,t){return new bi({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ve(t)}})}const yi=u("ZodNonOptional",(e,t)=>{nn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function wi(e,t){return new yi({type:"nonoptional",innerType:e,...d(t)})}const zi=u("ZodCatch",(e,t)=>{on.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>po(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $i(e,t){return new zi({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ki=u("ZodPipe",(e,t)=>{an.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ho(e,r,n,o),e.in=t.in,e.out=t.out});function Re(e,t){return new ki({type:"pipe",in:e,out:t})}const Zi=u("ZodReadonly",(e,t)=>{sn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_o(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Si(e){return new Zi({type:"readonly",innerType:e})}const Oi=u("ZodCustom",(e,t)=>{un.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oo(e,r)});function Ii(e,t={}){return Bn(Oi,e,t)}function Ni(e,t){return Xn(e,t)}function v(e){return Un(ft,e)}var pt=new Date().getUTCFullYear(),W=T().trim().min(1,"Required").regex(/^[A-Za-z\s]+$/,"Only alphabetic characters are allowed."),xe=mt([ci(""),T().trim().regex(/^[A-Za-z\s]*$/,"Only alphabetic characters are allowed.")]).optional(),Ti=(e,t,r)=>v({error:`${e} must be a number.`}).min(t,`${e} must be between ${t.toLocaleString("en-US")} and ${r.toLocaleString("en-US")}.`).max(r,`${e} must be between ${t.toLocaleString("en-US")} and ${r.toLocaleString("en-US")}.`).int(`${e} must be a whole number.`),A=(e,t)=>v({error:`${e} must be a number.`}).min(0,`${e} must be between 0 and ${t.toLocaleString("en-US")}.`).max(t,`${e} must be between 0 and ${t.toLocaleString("en-US")}.`).int(`${e} must be a whole number.`),q=(e,t=1600)=>v({error:`${e} must be a valid 4-digit year.`}).int(`${e} must be a whole number.`).min(t,`${e} should be between ${t} and the current year.`).max(pt,`${e} cannot be in the future.`),G=e=>v({error:`${e} must be a number.`}).int(`${e} must be a whole number.`).min(0,`${e} must be between 0 and 99.`).max(99,`${e} must be between 0 and 99.`),M=(e,t,r=0)=>{let n=10**t-1;return v({error:`${e} must be a number.`}).min(r,`${e}: Value must be between ${r.toLocaleString("en-US")} and ${n.toLocaleString("en-US")}.`).max(n,`${e}: Value must be between ${r.toLocaleString("en-US")} and ${n.toLocaleString("en-US")}.`).int(`${e} must be a whole number.`)},Pi={email:T().trim().min(1,"Required").pipe(jo("Please enter a valid email address.")),phone:T().trim().min(1,"Required").refine(e=>{let t=e.replace(/\D/g,"");return t.length===11&&t.startsWith("1")&&(t=t.slice(1)),t.length===10},"Please enter a valid 10-digit US phone number."),social_security_number:T().trim().refine(e=>e===""||/^\d{3}-\d{2}-\d{4}$/.test(e),"Social Security Number must be in the format XXX-XX-XXXX.").optional(),sms_code:T().trim().min(1,"Required").regex(/^\d{6}$/,"Please enter the 6-digit code."),first_name:W,last_name:W,middle_name:xe,co_applicant_first_name:W,co_applicant_last_name:W,co_applicant_middle_name:xe,year_built:q("Year built",1800),year_roof_updated:v({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:q("Heating update year"),plumbing_update_year:q("Plumbing update year"),electrical_update_year:q("Electrical update year"),total_area_sq_ft:Ti("Square footage",1,999999),sale_price_cents:v({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:G("Number of years with your prior carrier"),home_continuous_coverage_years:G("How long you have had continuous home coverage"),household_size:v({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:v({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:M("Replacement cost",9,1),other_structures_coverage:M("Other structures",9),personal_property_coverage:M("Personal property",9),loss_of_use_coverage:M("Loss of use coverage",9),years_at_address:v({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:v({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:v({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:v({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:v({error:"Number of families must be a number."}).int("Number of families must be a whole number.").refine(e=>e>=1&&e<=5,{message:"Number of families must be between 1 and 5."}),number_of_dogs:v({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."),number_of_parking_spaces:v({error:"Number of parking spaces must be a number."}).int().min(1,"Number of covered parking spaces must be between 1 and 3.").max(3,"Number of covered parking spaces must be between 1 and 3."),distance_to_coast_miles:v({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:M("Amount paid",7),license_number:T().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."),property_damage_amount_paid_cents:A("Property damage amount paid",9999999),personal_injury_amount_paid_cents:A("Personal injury amount paid",9999999),vin:T().superRefine((e,t)=>{if(typeof e=="string"&&e.trim()!==""){if(/\s/.test(e)){t.addIssue({code:"custom",message:"VIN cannot contain spaces."});return}/^[A-HJ-NPR-Z0-9]{17}$/i.test(e.trim())||t.addIssue({code:"custom",message:"VIN must be exactly 17 letters and numbers (excluding I, O, and Q)."})}}),annual_mileage:v({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:v({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:A("Modifications value",9999999),cost_new_value_cents:A("Cost new value",9999999),stated_value_amount_cents:A("Stated Value Amount",9999999),auto_current_annual_premium_cents:A("Current annual premium",9999999),auto_prior_years:G("Years with prior auto carrier"),auto_prior_months:v({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:G("Years with continuous auto coverage")},Ei=(e,t)=>{let r=Pi[e];if(!r)return;let n=r.safeParse(t);return n.success?void 0:n.error.issues[0]?.message},ji=e=>{if(/\s/.test(e))return!1;let t=e.trim();return t.length===17&&/^[A-HJ-NPR-Z0-9]{17}$/i.test(t)},Ai=e=>new Date(`${e}T00:00:00Z`),x=()=>{let e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},se=(e,t)=>{let r=t.getUTCFullYear()-e.getUTCFullYear(),n=t.getUTCMonth()-e.getUTCMonth();return(n<0||n===0&&t.getUTCDate()<e.getUTCDate())&&--r,r},ue=(e,t)=>new Date(Date.UTC(e.getUTCFullYear()+t,e.getUTCMonth(),e.getUTCDate())),N=e=>{if(!e||typeof e!="string")return null;let t=Ai(e);return Number.isNaN(t.getTime())?null:t},I=e=>{if(e==null||e==="")return null;let t=Number(e);return Number.isNaN(t)?null:t},C=(e,t)=>({targetKey:e,dependsOn:[e],validate:r=>{if(!r[e]||typeof r[e]!="string")return;let n=N(r[e]);return n?n>x()?t:void 0:"Invalid date."}}),D=(e,t)=>({targetKey:e,dependsOn:[e,"date_of_birth"],validate:r=>{let n=I(r[e]),o=N(r.date_of_birth);if(!(n==null||!o))return n>se(o,x())?t:void 0}}),je=(e,t)=>({targetKey:e,dependsOn:[e],validate:r=>{if(!r[e]||typeof r[e]!="string")return;let n=N(r[e]);if(!n)return"Invalid date.";let o=x();return n<ue(o,-1)||n>ue(o,1)?t:void 0}}),Me=e=>{let t=/^cov(\d+)to(\d+)$/.exec(e);if(t)return{perPerson:Number(t[1]),perOccurrence:Number(t[2])};let r=/^cov(\d+)CSL$/.exec(e);return r?{perPerson:Number(r[1]),perOccurrence:Number(r[1])}:null},Ci=e=>typeof e.ssn_display=="string"&&e.ssn_display.trim()!=="",ht=e=>_t(e.state)&&!Ci(e),Mi=(e,t)=>e.required||e.key==="social_security_number"&&ht(t),Di=[{targetKey:"social_security_number",dependsOn:["social_security_number","state"],validate:e=>{if(!("social_security_number"in e)||!ht(e))return;let t=e.social_security_number;return(typeof t=="string"?t.trim():"")===""?"Social Security Number is required.":void 0}},{targetKey:"date_of_birth",dependsOn:["date_of_birth"],validate:e=>{if(!e.date_of_birth||typeof e.date_of_birth!="string")return;let t=N(e.date_of_birth);return t?t.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":se(t,x())<18?"Applicant can't be under the age of 18.":void 0:"Invalid date."}},{targetKey:"co_applicant_date_of_birth",dependsOn:["co_applicant_date_of_birth"],validate:e=>{if(!e.co_applicant_date_of_birth||typeof e.co_applicant_date_of_birth!="string")return;let t=N(e.co_applicant_date_of_birth);return t?t.getUTCFullYear()<1900?"Date of birth year can't be earlier than 1900.":se(t,x())<16?"Co-applicant can't be under the age of 16.":void 0:"Invalid date."}},{targetKey:"year_roof_updated",dependsOn:["year_roof_updated","year_built"],validate:e=>{let t=I(e.year_roof_updated);if(t!=null)return t<(I(e.year_built)??1e3)||t>pt?"Roof renovation/replacement year must be between the home's build year and the current year.":void 0}},{targetKey:"move_in_date",dependsOn:["move_in_date","year_built"],validate:e=>{let t=N(e.move_in_date),r=I(e.year_built);if(!(!t||r==null))return t.getUTCFullYear()<r?"Purchase date cannot be prior to the year the building was originally constructed.":void 0}},C("move_in_date","Purchase date cannot be in the future."),C("date_first_licensed","Date first licensed cannot be in the future."),{targetKey:"date_first_licensed",dependsOn:["date_first_licensed","date_of_birth"],validate:e=>{let t=N(e.date_first_licensed),r=N(e.date_of_birth);if(!(!t||!r))return t<r?"Date licensed cannot be before driver date of birth.":t<ue(r,16)?"Driver must be at least 16 years old at the date first licensed.":void 0}},C("occurred_at","Incident date cannot be in the future."),C("accident_prevention_course_date","Course date cannot be in the future."),C("date_of_incident","Loss date cannot be in the future."),C("purchase_date","Vehicle purchase date cannot be in the future."),{targetKey:"effective_date",dependsOn:["effective_date"],validate:e=>{if(!e.effective_date||typeof e.effective_date!="string")return;let t=N(e.effective_date);if(!t)return"Invalid date.";let r=x(),n=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+3,r.getUTCDate()));if(t<r)return"Insurance start date cannot be in the past.";if(t>n)return"Insurance must begin within 3 months from today."}},D("years_at_address","Time at address cannot be greater than the applicant age."),D("years_at_prior_address","Years at prior address cannot be greater than the applicant age."),{targetKey:"home_prior_years",dependsOn:["home_prior_years","home_continuous_coverage_years"],validate:e=>{let t=I(e.home_prior_years),r=I(e.home_continuous_coverage_years);if(t!=null&&r!=null)return t>r?"Years with prior carrier cannot be higher than years with continuous coverage.":void 0}},D("home_prior_years","Years with prior carrier cannot be greater than the Applicant's age."),D("home_continuous_coverage_years","Years with continuous home coverage cannot be greater than the Applicant's age."),je("home_prior_expiration_date","Policy expiration date must be between 1 year ago and 1 year from now."),{targetKey:"purchase_date",dependsOn:["purchase_date","year"],validate:e=>{let t=N(e.purchase_date),r=I(e.year);if(!(!t||r==null))return t.getUTCFullYear()<r?"The year the vehicle was purchased is not valid with the model year.":void 0}},je("auto_prior_expiration_date","Auto policy expiration date must be between 1 year ago and 1 year from now."),{targetKey:"auto_prior_years",dependsOn:["auto_prior_years","auto_continuous_coverage_years"],validate:e=>{let t=I(e.auto_prior_years),r=I(e.auto_continuous_coverage_years);if(t!=null&&r!=null)return t>r?"Years with prior auto carrier cannot be higher than years with continuous coverage.":void 0}},D("auto_prior_years","Years with prior auto carrier cannot be greater than the Applicant's age."),D("auto_continuous_coverage_years","Years with continuous auto coverage cannot be greater than the Applicant's age."),{targetKey:"vehicle_coll_deductible",dependsOn:["vehicle_coll_deductible","vehicle_comp_deductible"],validate:e=>{let t=e.vehicle_coll_deductible,r=e.vehicle_comp_deductible;if(!(typeof t!="string"||!t||typeof r!="string"||!r))return r==="NoCoverage"&&t!=="NoCoverage"?"Collision Coverage cannot be chosen if Comprehensive is No Coverage.":void 0}},{targetKey:"policy_um",dependsOn:["policy_um","policy_bi"],validate:e=>{let t=e.policy_um,r=e.policy_bi;if(typeof t!="string"||!t||typeof r!="string"||!r||t==="Reject"||r==="Dontknow")return;let n=i=>i.endsWith("CSL");if(n(t)&&!n(r))return"A Combined Single Limit cannot be selected for Uninsured/Underinsured Motorist unless a Combined Single Limit has also been selected for Liability.";let o=Me(t),a=Me(r);if(!(!o||!a))return o.perPerson>a.perPerson||o.perOccurrence>a.perOccurrence?"Uninsured/Underinsured Motorist Limit value cannot be greater than Bodily Injury Limit value.":void 0}},{targetKey:"policy_umpd",dependsOn:["policy_umpd","policy_pd"],validate:e=>{let t=e.policy_umpd,r=e.policy_pd;if(typeof t!="string"||!t||typeof r!="string"||!r||t==="NoCoverage"||r==="Dontknow")return;let n=i=>{if(!i.startsWith("cov"))return null;let s=Number.parseInt(i.replace("cov",""),10);return Number.isNaN(s)?null:s},o=n(t),a=n(r);return o!=null&&a!=null&&o>a?"Uninsured Motorist Property Damage Limit value cannot be greater than Liability Property Damage Limit value.":void 0}},{targetKey:"custom_equipment_value_cents",dependsOn:["custom_equipment_value_cents","stated_value_amount_cents"],validate:e=>{let t=I(e.custom_equipment_value_cents),r=I(e.stated_value_amount_cents);if(t!=null&&r!=null)return r>0&&t>0?"Modifications should be included in the stated value of the vehicle. If a stated value quote is not required, remove the stated value.":void 0}}],Ui=(e,t)=>{let r={};for(let n of Di){if(t?.has(n.targetKey))continue;let o=n.validate(e);o&&!r[n.targetKey]&&(r[n.targetKey]=o)}return r},Le=(e,t)=>t==="number"?e==null||typeof e=="string"&&e.trim()==="":t==="checkbox"?e!==!0:e==null||typeof e=="string"&&e.trim()==="",Li=(e,t)=>{let r={};e.forEach(i=>{let s=i.key,c=t[s];if(i.required&&Le(c,i.inputType)){r[s]="Required";return}if(!Le(c,i.inputType)){let l=Ei(s,c);l&&(r[s]=l)}});let n={...t};e.forEach(i=>{i.key in n||(n[i.key]="")});let o=Ui(n,new Set(Object.keys(r))),a=new Set(e.map(i=>i.key));for(let[i,s]of Object.entries(o))a.has(i)&&(r[i]=s);return r};export{Ci as C,Le as O,Mi as T,ji as f,Li as k};
@@ -0,0 +1 @@
1
+ import{t as h}from"./iframe-BImWklE9.js";import{_ as p}from"./visibility-hEdBjgi7-_AUGO8E2.js";import{O as y}from"./validation-DRqHT-u7-pY2KjHw4.js";import"./types-LUGvo5ic-CB-wcgK3.js";var I=h({DRIVER_ASSIGNMENTS_KEY:()=>_,VEHICLE_COVERAGE_KEYS:()=>u,VEHICLE_COVERAGE_LABELS:()=>b,VEHICLE_POLICY_SELECTIONS_KEY:()=>s,assignmentsFor:()=>H,driverAssignmentError:()=>N,driverPercent:()=>F,ensureAutoCoverageSelections:()=>f,vehicleCoverageErrors:()=>$,vehicleCoverageOptions:()=>w,vehicleDisplayName:()=>C,withDriverPercent:()=>S}),s="vehicle_policy_selections",f=(o,e)=>o!=="AutoCurrentCarrier"||e.some(r=>r.key==="vehicle_policy_selections")?[...e]:[...e,{question:"Vehicle coverage selections",inputType:"custom",key:s,required:!1}],u=["vehicle_comp_deductible","vehicle_coll_deductible","vehicle_towing_and_labor","vehicle_transportation_expense"],c=["NoCoverage","Zero","Fifty","Hundred","TwoHunderd","TwoHundredfifty","FiveHundred","Thousand","TwoThousand"],v=["NoCoverage","Zero","Fifty","Hundred","TwoHunderd","TwoHundredfifty","FiveHundred","SeventyFiveHundred","Thousand","TwoThousand"],m=["NoCoverage","TwentyFive","Forty","Fifty","SeventyFive","Eighty","Hundred","TwelveHundred","TwoHundred","Unlimited"],g=["NoCoverage","TwentyFive","Fifty","SeventyFive","Hundred","TwoHundred","Unlimited"],E=["NoCoverage","cov20to600","cov30to900","cov40to1200","cov50to1500"],T=["NoCoverage","cov20to600","cov25to750","cov30to900","cov40to1200","cov50to1500","cov100to3000"],C=(o,e)=>[o.year,o.make,o.model].filter(Boolean).join(" ")||`Vehicle ${e+1}`,b={vehicle_comp_deductible:"Comprehensive deductible",vehicle_coll_deductible:"Collision deductible",vehicle_towing_and_labor:"Towing and Labor",vehicle_transportation_expense:"Transportation expense"},w=o=>{let e=p(o);return{vehicle_comp_deductible:e?v:c,vehicle_coll_deductible:e?v:c,vehicle_towing_and_labor:e?g:m,vehicle_transportation_expense:e?T:E}},_="driver_vehicle_assignments",H=o=>{let e=o[_];return e&&typeof e=="object"?e:{}},F=(o,e,r)=>o[`v${e}`]?.[`d${r}`],S=(o,e,r,t)=>({...o,[`v${e}`]:{...o[`v${e}`]??{},[`d${r}`]:t}}),N=(o,e,r)=>{if(r<2)return null;let t=o[`v${e}`];if(!t)return null;let i=Array.from({length:r},(n,a)=>t[`d${a}`]??0),l=i.filter(n=>n>0);if(l.length>=2&&l.every(n=>n===50))return"Two drivers cannot both be at 50%. Give one of them the larger share.";let d=i.reduce((n,a)=>n+a,0);return d>0&&d!==100?`Driver percentages must add up to 100% (currently ${d}%).`:null},$=o=>{let e=[];return o.forEach((r,t)=>{let i={};for(let l of u)y(r?.[l],"select")&&(i[l]="Required");Object.keys(i).length&&e.push({index:t,errorsByKey:i})}),e};export{H as a,f as c,I as d,C as f,s as i,$ as l,u as n,N as o,S as p,b as r,F as s,_ as t,w as u};
@@ -0,0 +1 @@
1
+ import{n as C}from"./types-LUGvo5ic-CB-wcgK3.js";import{l as w}from"./iframe-BImWklE9.js";var N=e=>{let r=(n,i)=>n.map((o,l)=>{let u=i.length?i.join("__"):"root",c=o.key??`${u}__q${l}_${String(o.question).slice(0,24).replace(/\W+/g,"-")||"field"}`,s=(o.conditionals??[]).map((t,a)=>({...t,conditionalQuestions:t.conditionalQuestions?r(t.conditionalQuestions,[...i,`${c}__c${a}`]):void 0}));return{...o,key:c,conditionals:s}});return r(e,[])},h=e=>typeof e=="number"&&Number.isFinite(e)?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null,y=e=>{if(e instanceof Date&&!Number.isNaN(e.getTime()))return e.getTime();if(typeof e=="string"){let r=Date.parse(e);return Number.isNaN(r)?null:r}return null},f=(e,r)=>{let n=h(e),i=h(r);if(n!=null&&i!=null)return n-i;let o=y(e),l=y(r);return o!=null&&l!=null?o-l:e==null||r==null?null:String(e).localeCompare(String(r))},b=(e,r)=>Array.isArray(e)?e.some(n=>n===r):typeof e=="string"&&r!=null&&e.includes(String(r)),D=(e,r,n)=>{switch(r){case"equals":return e===n;case"notEquals":return e!==n&&e!==""&&e!=null;case"lessThan":{let i=f(e,n);return i!=null&&i<0}case"greaterThan":{let i=f(e,n);return i!=null&&i>0}case"contains":return b(e,n);case"startsWith":return e!=null&&n!=null&&String(e).startsWith(String(n));case"endsWith":return e!=null&&n!=null&&String(e).endsWith(String(n));default:return!1}},d=e=>e.inputType!=="radio"||!e.options||e.options.length!==1||e.options[0]!=="Yes"?!1:(e.conditionals??[]).some(r=>r.conditionalQuestionsAllowMultiple&&r.conditionalType==="equals"&&r.conditionalValue==="Yes"),x=(e,r)=>d(e)?"Yes":r,Y=e=>(e.conditionals??[]).find(r=>r.conditionalQuestionsAllowMultiple),K=(e,r)=>{let n=x(e,r[e.key]),i=(e.conditionals??[]).filter(o=>D(n,o.conditionalType,o.conditionalValue));return i.length>1&&!i.some(o=>o.conditionalQuestionsAllowMultiple)?i.slice(0,1):i},P=new Set(["additional_pip","tort_threshold","pip_coverage_type","extended_medical","policy_pip_deductible","is_corporation"]),k=new Set(["anti_theft_type","passive_restraint_type","anti_lock_brakes","daytime_running_lights","vehicle_full_glass","vehicle_loan_lease","percent_to_work","stated_value_amount_cents","vehicle_comp_deductible","vehicle_coll_deductible","vehicle_towing_and_labor","vehicle_transportation_expense","accident_prevention_course","driver_accidents","driver_violations","losses","middle_name","ssn_display","auto_current_annual_premium_cents","has_co_applicant","co_applicant_middle_name","co_applicant_relationship"]),I=new Set(["Home","HomeConstruction","HomeFeatures","Demographics"]),T=new Set(["HomePolicy","BundlePolicy"]),Q=new Set(["HomeCustomer","BundleCustomer","Demographics"]),A=e=>{if(typeof e!="string"||!e.trim())return!1;let r=e.trim().toLowerCase();return r==="nj"||r==="n.j."||r==="n.j"||r==="new jersey"},g=e=>!!e&&A(e.state??e.State),S=(e,r,n)=>e==="has_health_insurance_auto_accident"?r==="BundleCustomer"||r==="Demographics"?!1:!g(n):P.has(e)?!g(n):e==="household_size"?!(r&&I.has(r)):e==="number_of_mortgagees"?!(r&&T.has(r)):(e==="has_co_applicant"||e==="co_applicant_middle_name"||e==="co_applicant_relationship")&&r&&Q.has(r)?!1:e==="multi_policy_discount"&&r==="HomePolicy"||k.has(e),E=new Set(["auto_prior_years","auto_prior_months","auto_continuous_coverage_years"]),v=e=>{if(typeof e!="string")return null;let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return null;let[n,i,o]=[Number(r[1]),Number(r[2]),Number(r[3])];if(i<1||i>12||o<1||o>31)return null;let l=new Date(Date.UTC(n,i-1,o));return l.getUTCFullYear()!==n||l.getUTCMonth()!==i-1||l.getUTCDate()!==o?null:l.getTime()},p=(e,r)=>{if(!r.effectiveDateKey||!r.expirationDateKey)return!1;let n=v(e[r.expirationDateKey]),i=v(e[r.effectiveDateKey]);return n==null||i==null?!1:n<i},$=e=>{let r=null,n=null,i=null,o=new Set,l=new Set,u=s=>{let t=s.key??"",a=String(s.question??"").trim().toLowerCase();!r&&(t==="auto_prior_carrier_name"||t==="home_prior_carrier_name"||a.includes("current auto insurance company"))&&(r=t),!n&&(t==="effective_date"||a.includes("when do you need your insurance to begin"))&&(n=t),!i&&(t==="auto_prior_expiration_date"||t==="home_prior_expiration_date"||a.includes("when does the current policy expire"))&&(i=t),(t==="auto_reason_for_no_insurance"||a.includes("reason you are not currently insured")||a.includes("reason for lapse in coverage"))&&o.add(t),(t==="auto_prior_years"||t==="auto_prior_months"||t==="auto_continuous_coverage_years"||t==="auto_prior_expiration_date"||t==="auto_current_annual_premium_cents"||t==="auto_prior_liability_limit")&&l.add(t)};e.forEach(u);let c=s=>{s.forEach(t=>{(t.conditionals??[]).forEach(a=>{let _=a.conditionalQuestions??[];_.forEach(u),c(_)})})};return c(e),{currentCarrierKey:r,effectiveDateKey:n,expirationDateKey:i,noInsuranceReasonKeys:o,hideWhenNoPriorInsuranceKeys:l}},H=(e,r)=>r.currentCarrierKey==="home_prior_carrier_name"&&e.home_prior_carrier_name==="NoPriorInsurance"&&e.auto_prior_carrier_name!=="NoPriorInsurance"?!1:(r.currentCarrierKey?e[r.currentCarrierKey]:void 0)==="NoPriorInsurance"?!0:!r.effectiveDateKey||!r.expirationDateKey||r.expirationDateKey==="home_prior_expiration_date"&&p(e,r)?!1:p(e,r),W=(e,r,n)=>{let i=e.key??"";if(n.noInsuranceReasonKeys.has(i)&&n.currentCarrierKey==="home_prior_carrier_name"&&r.home_prior_carrier_name==="NoPriorInsurance"&&r.auto_prior_carrier_name!=="NoPriorInsurance")return!1;let o=(n.currentCarrierKey?r[n.currentCarrierKey]:void 0)==="NoPriorInsurance";return o&&n.hideWhenNoPriorInsuranceKeys.has(i)?!1:!n.noInsuranceReasonKeys.has(i)||o?!0:H(r,n)},j=new Set(["HomePolicy","BundlePolicy"]),q=(e,r,n)=>(e.key??"")!=="lapse_in_coverage"||!n||!j.has(n)||r.home_prior_carrier_name!=="NoPriorInsurance",M=(e,r)=>{let n=e.key??"";if(n==="co_applicant_occupation"||n!=="occupation")return!0;let i=String(r.industry??r.employment_industry??"").trim();return!w.has(i)},F=(e,r,n)=>{let i=N(e),o=$(i),l=[],u=c=>{c.forEach(s=>{if(!W(s,r,o)||!M(s,r)||!q(s,r,n))return;let t=s.key??"";if(S(t,n,r)){let a=o.currentCarrierKey?r[o.currentCarrierKey]:void 0;if(!(a&&a!=="NoPriorInsurance"&&p(r,o)&&E.has(t)))return}d(s)||l.push(s),K(s,r).forEach(a=>{let _=a.conditionalQuestions??[];_.length&&(a.conditionalQuestionsAllowMultiple||u(_))})})};return u(i),l},R=(e,r,n,i,o)=>{let l=N(e),u=[],c=s=>{s.forEach(t=>{let a=t.key??"";if(!S(a,i,n)&&(o!==0||a!=="relationship_to_insured"&&a!=="is_registered_owner")){if(a==="occupation"){let _=String(r.industry??r.employment_industry??"").trim();if(w.has(_))return}d(t)||u.push(t),K(t,r).forEach(_=>{let m=_.conditionalQuestions??[];!m.length||_.conditionalQuestionsAllowMultiple||c(m)})}})};return c(l),u},L=(e,r)=>{let n=e[C(r)];return Array.isArray(n)?n:[]};export{R as A,A as _,d as c,K as d,L as j,F as k,N as n,Y as u};
@@ -14,8 +14,8 @@
14
14
  overflow: hidden;
15
15
  }
16
16
  </style>
17
- <script type="module" crossorigin src="/iframe/assets/iframe-CfQAC0Hv.js"></script>
18
- <link rel="stylesheet" crossorigin href="/iframe/assets/iframe-DFqQdMHv.css">
17
+ <script type="module" crossorigin src="/iframe/assets/iframe-BImWklE9.js"></script>
18
+ <link rel="stylesheet" crossorigin href="/iframe/assets/iframe-Bl0qTZgO.css">
19
19
  </head>
20
20
  <body>
21
21
  <div id="root"></div>