PageSourceSearch

https://www.covertiger.com/_next/static/chunks/pages/term-insurance-87fe20b918bc993c.js

js covertiger.com collected 2026-10-08 20:51:06 UTC 80,237 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3563,5944,7149],{35332:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/term-insurance",function(){return a(53118)}])},35944:(e,t,a)=>{"use strict";a.d(t,{AF:()=>n,dQ:()=>o,m9:()=>s,sW:()=>i});var l=a(65364);let r="https://api.covertiger.com";function n(){let e=void 0!==l&&l.env.NEXT_PUBLIC_INSURANCE_API_URL?String(l.env.NEXT_PUBLIC_INSURANCE_API_URL).replace(/\/+$/,""):"";if(e)return e;var t=window.location.hostname;return t&&"string"==typeof t&&"www.covertiger.com"===t.toLowerCase()?"https://ct-apis.covertiger.com":r}let s=n(),i="bi_payment_first",o=(void 0!==l&&l.env.NEXT_PUBLIC_BAJAJ_PAYMENT_FLOW?String(l.env.NEXT_PUBLIC_BAJAJ_PAYMENT_FLOW).trim().toLowerCase():"")===i?i:"automation"},39644:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var l=a(37876);a(14232);let r=()=>(0,l.jsxs)("main",{className:"relative max-h-screen",style:{background:"linear-gradient(180deg, #C4C7FF 0%, #E8E9FF 50%, #FFFFFF 100%)"},children:[(0,l.jsx)("div",{className:"bg-[#2D3436] px-6 lg:px-12 py-8",children:(0,l.jsxs)("div",{className:"flex items-center gap-4 justify-center flex-wrap",children:[(0,l.jsx)("span",{className:"text-white text-base font-semibold mb-3 block",children:"Filters:"}),[1,2,3,4,5,6].map(e=>(0,l.jsx)("div",{className:"h-12 w-40 bg-gray-600/50 rounded-lg animate-pulse"},e))]})}),(0,l.jsxs)("div",{className:"flex mt-10",children:[(0,l.jsxs)("div",{className:"max-w-5xl px-6 w-full lg:px-12",children:[(0,l.jsx)("div",{className:"mx-auto",children:(0,l.jsx)("div",{className:"inline-block bg-white rounded-xl p-4 border-2 border-purple-100",children:(0,l.jsx)("div",{className:"h-5 w-48 bg-gray-200 rounded animate-pulse"})})}),(0,l.jsxs)("div",{className:"space-y-6 mt-4",children:[(0,l.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-6",children:[(0,l.jsx)("div",{className:"flex items-start justify-between mb-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"w-12 h-12 bg-gray-200 rounded-lg animate-pulse"}),(0,l.jsx)("div",{className:"h-6 w-32 bg-gray-200 rounded animate-pulse"})]})}),(0,l.jsx)("div",{className:"h-8 w-48 bg-gray-200 rounded mb-4 animate-pulse"}),(0,l.jsx)("div",{className:"space-y-3 mb-6",children:[1,2,3].map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-5 h-5 bg-gray-200 rounded-full animate-pulse"}),(0,l.jsx)("div",{className:"h-4 flex-1 bg-gray-200 rounded animate-pulse"})]},e))}),(0,l.jsx)("div",{className:"h-4 w-32 bg-gray-200 rounded mb-6 animate-pulse"}),(0,l.jsxs)("div",{className:"flex items-end justify-between",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-5 h-5 bg-gray-200 rounded-full animate-pulse"}),(0,l.jsx)("div",{className:"h-4 w-24 bg-gray-200 rounded animate-pulse"})]}),(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("div",{className:"h-4 w-16 bg-gray-200 rounded animate-pulse"}),(0,l.jsx)("div",{className:"h-6 w-32 bg-gray-200 rounded animate-pulse"}),(0,l.jsx)("div",{className:"h-4 w-20 bg-gray-200 rounded animate-pulse"}),(0,l.jsx)("div",{className:"h-6 w-40 bg-gray-200 rounded animate-pulse"})]})]}),(0,l.jsx)("div",{className:"h-12 w-40 bg-gray-200 rounded-lg animate-pulse"})]})]}),(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)("div",{className:"h-10 w-64 bg-gray-200 rounded-lg animate-pulse"})})]})]}),(0,l.jsx)("div",{className:"hidden md:block w-[380px] min-h-[100vh]",children:(0,l.jsx)("div",{className:"flex w-full rounded-[24px] p-[1px]",style:{background:"linear-gradient(180deg, #5EE75C 0%, #6C5CE7 100%)",boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.08)",height:"80%"},children:(0,l.jsxs)("div",{className:"flex bg-[#F8F7FC] h-full w-full rounded-[24px] p-4 flex-col items-center justify-center gap-3",children:[(0,l.jsx)("div",{className:"w-20 h-20 bg-gray-200 rounded-full animate-pulse"}),(0,l.jsx)("div",{className:"h-4 w-48 bg-gray-200 rounded animate-pulse"}),(0,l.jsx)("div",{className:"w-full rounded-xl",children:(0,l.jsx)("div",{className:"h-10 w-full bg-gray-200 rounded-[10px] animate-pulse"})})]})})})]})]}),n=e=>{let{contentOnly:t=!1}=e;return t?(0,l.jsx)(r,{}):(0,l.jsxs)("div",{className:"min-h-screen bg-[#F5F5F5] relative",children:[(0,l.jsx)("header",{className:"bg-white border-b border-gray-100 sticky top-0 z-50",children:(0,l.jsx)("div",{className:"max-w-7xl mx-auto px-6 lg:px-12 py-4",children:(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("div",{className:"h-8 w-32 bg-gray-200 rounded animate-pulse"}),(0,l.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,l.jsxs)("div",{className:"flex gap-0.5",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-gray-200 rounded animate-pulse"}),(0,l.jsx)("div",{className:"w-2 h-2 bg-gray-200 rounded animate-pulse"})]}),(0,l.jsxs)("div",{className:"flex gap-0.5",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-gray-200 rounded animate-pulse"}),(0,l.jsx)("div",{className:"w-2 h-2 bg-gray-200 rounded animate-pulse"})]})]})]})})})}),(0,l.jsx)(r,{})]})}},53118:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>P,default:()=>M});var l=a(37876),r=a(78761),n=a(90939),s=a(94839),i=a(173),o=a(55907),c=a(81981),u=a(79796),m=a(38773),d=a(11599),p=a(91040),h=a(35944),f=a(76330),g=a(18847),x=a.n(g),_=a(77328),v=a.n(_),y=a(54587),b=a.n(y),w=a(89099),j=a(14232),k=a(98477),N=a(17531),C=a(39644),S=a(45064),F=a(24669),I=a(62839);let E=x()(()=>a.e(5604).then(a.bind(a,75604)),{loadableGenerated:{webpack:()=>[75604]}}),A=x()(()=>Promise.all([a.e(4299),a.e(6283),a.e(6042),a.e(3845),a.e(4733),a.e(1598),a.e(7461),a.e(5469),a.e(9051),a.e(5161),a.e(6210),a.e(6240),a.e(7478),a.e(9520),a.e(7452),a.e(2213),a.e(1760)]).then(a.bind(a,80719)).catch(()=>(window.location.reload(),Promise.all([a.e(4299),a.e(6283),a.e(6042),a.e(3845),a.e(4733),a.e(1598),a.e(7461),a.e(5469),a.e(9051),a.e(5161),a.e(6210),a.e(6240),a.e(7478),a.e(9520),a.e(7452),a.e(2213),a.e(1760)]).then(a.bind(a,80719)))),{loadableGenerated:{webpack:()=>[80719]},ssr:!1,loading:()=>(0,l.jsx)("div",{className:"flex flex-col items-center justify-center w-full h-full bg-[#F7F7F7]",children:(0,l.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,l.jsx)("span",{className:"text-sm font-medium text-[#555]",children:"Connecting you with Agent"}),(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)("div",{className:"w-1.5 h-1.5 bg-[#555] rounded-full animate-bounce",style:{animationDelay:"0ms"}}),(0,l.jsx)("div",{className:"w-1.5 h-1.5 bg-[#555] rounded-full animate-bounce",style:{animationDelay:"150ms"}}),(0,l.jsx)("div",{className:"w-1.5 h-1.5 bg-[#555] rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]})})}),D=x()(()=>Promise.all([a.e(4299),a.e(6283),a.e(4733)]).then(a.bind(a,34733)),{loadableGenerated:{webpack:()=>[34733]},ssr:!1}),L=x()(()=>Promise.resolve().then(a.bind(a,45998)),{loadableGenerated:{webpack:()=>[45998]}});var P=!0;let M=function(){var e,t;let{serverLeadId:a=null,initialFilters:g=[],initialPlans:x=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_=(0,w.useRouter)(),y=(0,f.A)(),P=(null==x?void 0:x.ok)&&(null==x?void 0:x.companies),[M,B]=(0,j.use
1State)(P?x.companies:[]),[T,q]=(0,j.useState)(P?x.companies:[]),[z,R]=(0,j.useState)(P&&null!=(t=null==(e=x.meta)?void 0:e.product_count)?t:0),[O,W]=(0,j.useState)({}),[U,V]=(0,j.useState)({}),[J,H]=(0,j.useState)(P?x.companies:[]),[G,Y]=(0,j.useState)(!P),[Q,X]=(0,j.useState)(!1),[$,K]=(0,j.useState)([]),[Z,ee]=(0,j.useState)([]),[et,ea]=(0,j.useState)(""),[el,er]=(0,j.useState)(P&&x.members?x.members:[]),[en,es]=(0,j.useState)(a),[ei,eo]=(0,j.useState)(Array.isArray(g)&&g.length>0?g:[]),[ec,eu]=(0,j.useState)({}),[em,ed]=(0,j.useState)(!0),[ep,eh]=(0,j.useState)(null),[ef,eg]=(0,j.useState)(null),[ex,e_]=(0,j.useState)(!1),[ev,ey]=(0,j.useState)(null),[eb,ew]=(0,j.useState)(null),[ej,ek]=(0,j.useState)(!1),[eN,eC]=(0,j.useState)(0),[eS,eF]=(0,j.useState)(null),eI=(0,j.useRef)(null),eE=(0,j.useRef)(null),eA=(0,j.useRef)(null),[eD,eL]=(0,j.useState)(!1),[eP,eM]=(0,j.useState)(null),[eB,eT]=(0,j.useState)(null),[eq,ez]=(0,j.useState)(!!(null==x?void 0:x.has_parent_recommendations)),[eR,eO]=(0,j.useState)({self:[],parents:[],kids:[]}),[eW,eU]=(0,j.useState)({self:[],parents:[],kids:[]}
1),[eV,eJ]=(0,j.useState)("self"),[eH,eG]=(0,j.useState)("monthly"),[eY,eQ]=(0,j.useState)(!1),[eX,e$]=(0,j.useState)(!1),[eK,eZ]=(0,j.useState)(!1),e0=(0,j.useRef)(null),e1=(0,j.useRef)(Date.now()),[e2,e4]=(0,j.useState)(""),[e3,e5]=(0,j.useState)(null),e6=(0,j.useRef)(0),[e8,e9]=(0,j.useState)(!1),[e7,te]=(0,j.useState)(!1),[tt,ta]=(0,j.useState)(null),[tl,tr]=(0,j.useState)(!1),[tn,ts]=(0,j.useState)(!1);(0,j.useRef)(!1);let ti=(0,j.useRef)(!1),[to,tc]=(0,j.useState)(null),tu=(0,j.useRef)(to);(0,j.useEffect)(()=>{tu.current=to},[to]),(0,j.useEffect)(()=>{null!=to&&console.log("[term-insurance] requirement:",to)},[to]);let[tm,td]=(0,j.useState)(!1);(0,j.useEffect)(()=>{let e=(0,m.cG)();if(!e)return void td(!0);let t=!1;return(async()=>{try{let a=await (0,m.wz)(e,"Term");if(t)return;if(null==a?void 0:a.requirement){let e="string"==typeof a.requirement?JSON.parse(a.requirement):a.requirement;tc(e)}}catch(e){console.error("Error fetching requirement from v2 (term):",e)}finally{t||td(!0)}})(),()=>{t=!0}},[]),(0,j.useEffect)(()=>{if(!h.m9||!en||(0,s.zc)(en))return;let e=!1;return(async()=>{try{let{data:t}=await p.A.post("".concat(h.m9,"/v1/applications/term-post-payment-resume"),{lead_id:en},{timeout:15e3,headers:{"Content-Type":"application/json"}});if(e||!(null==t?void 0:t.success)||!t.application_id)return;let a="term_skip_post_payment_resume_".concat(t.application_id);if("1"===sessionStorage.getItem(a))return;ta(t),te(!0)}catch(e){console.warn("[term-insurance] post-payment resume check failed:",(null==e?void 0:e.message)||e)}})(),()=>{e=!0}},[en]);let tp=(0,j.useCallback)(()=>{if(!(null==tt?void 0:tt.application_id)||!en)return;te(!1),ta(null);let e=new URLSearchParams;e.set("insurance_type","term"),e.set("lead_id",en),tt.product_id&&e.set("plan_id",tt.product_id),e.set("application_id",tt.application_id),e.set("phase","post_payment"),_.push("/buy?".concat(e.toString()))},[tt,en,_]),th=(0,j.useCallback)(()=>{(null==tt?void 0:tt.application_id)&&sessionStorage.setItem("term_skip_post_payment_resume_".concat(tt.application_id),"1"),te(!1),ta(null)},[tt]),{displayedProductCount:tf,displayedInsurerCount:tg}=(0,j.useMemo)(()=>{let e=0,t=new Set;return M.forEach(a=>{let l=!1;a.plans.forEach(t=>{let a=(t.variants||[]).filter(e=>{let t=e.premium_payment_term||0,a=parseInt(String(e.tenure).replace(/[^0-9]/g,""),10)||0;return a<=0||(eY?t>0&&t<a:0===t||t>=a)});e+=a.length,a.length>0&&(l=!0)}),l&&t.add(a.company_name||a.company_id)}),{displayedProductCount:e,displayedInsurerCount:t.size}},[M,eY]);(0,j.useEffect)(()=>{if(0!==M.length)try{var e;let t=tu.current||{},a=null==(e=t.personas)?void 0:e[0],l=ei.filter(e=>e.selectedOption&&"All"!==e.selectedOption.label).map(e=>"".concat(e.label,":").concat(e.selectedOption.label)).join(", "),r={plans:tf,insurers:tg,persona:a?"".concat(a.age||"").concat((a.gender||"")[0]||""," ").concat(a.smoker?"Smoker":"NS").trim():void 0,income:t.annual_income||void 0,city:t.city||void 0,filters:l||void 0,limitedPay:eY||void 0};Object.keys(r).forEach(e=>void 0===r[e]&&delete r[e]),(0,u.sx)({event_type:"page_view",metadata:r})}catch(e){}},[M]);let tx=(0,j.useRef)(!1),t_=(0,j.useRef)(!1),tv=(0,j.useRef)(!1);(0,j.useEffect)(()=>{if(!tv.current){tv.current=!0;return}em&&!tn||t_.current||(t_.current=!0,(0,c.trackPageViewed)("Term Listing Page","Call Interface"))},[em,tn]),(0,j.useEffect)(()=>{tn?sessionStorage.setItem("term_fullScreenChat","true"):sessionStorage.removeItem("term_fullScreenChat")},[tn]),(0,j.useEffect)(()=>{if(tn&&"undefined"!=typeof document){let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[tn]),(0,j.useEffect)(()=>{try{let e=localStorage.getItem("compare_plans_term");if(e){let t=JSON.parse(e);Array.isArray(t)&&t.length>0&&ee(t)}let t=new URLSearchParams(window.location.search),a=t.get("lead_id")||t.get("leadId"),l=(0,s.Ch)(),r=localStorage.getItem("leadId")||localStorage.getItem("onboarding_lead_id"),n=a||(l&&r&&!(0,s.zc)(r)?r:null);n&&es(n),"true"===localStorage.getItem("hasShownCallInterface")&&ed(!1),"true"===sessionStorage.getItem("term_fullScreenChat")&&ts(!0),tr((0,s.wS)("term"))}catch(e){console.error("Error restoring state from localStorage:",e)}},[]),(0,j.useEffect)(()=>
1{if(!_.isReady)return;(0,s.Ji)();let e=_.query.lead_id,t=localStorage.getItem("onboarding_lead_id"),l=localStorage.getItem("leadId")||localStorage.getItem("tempLeadId"),r=e||t||l||a;if(r||(console.log("\uD83D\uDCF1 No leadId found - generating temporary session data for term-insurance page"),t=r=(0,s.AP)().leadId),r&&(es(r),e&&!(0,s.zc)(e)&&(0,d.HN)(e),console.log("✅ leadId set: ".concat(r)),!tx.current)){tx.current=!0;let e=()=>{(0,i.trackPageView)("Term Insurance Plans","/term-insurance",{lead_id:r}),(0,c.trackPageViewed)("Term Listing Page",""),(0,i.initGATracking)()};"undefined"!=typeof requestIdleCallback?requestIdleCallback(e,{timeout:2e3}):setTimeout(e,100)}let n="true"===_.query.open_edit_modal,o=_.query.product_name?String(_.query.product_name):void 0,u=_.query.insurer?String(_.query.insurer):void 0;if(n){eL(!0);let e={..._.query};delete e.open_edit_modal,_.replace({pathname:_.pathname,query:e},void 0,{shallow:!0})}o&&eM(o),u&&eT(u),(0===g.length||to)&&tS(to),to?ea(tC(to)):!n&&tm&&(console.log("⚠️ No requirement from v2 - opening Edit Members Modal"),eL(!0),Y(!1))},[_.isReady,_.query.lead_id,_.query.open_edit_modal,_.query.product_name,_.query.insurer,g.length,a,to,tm]),(0,j.useEffect)(()=>{if(!eS)return;let e=!1,t=null,a=()=>{!e&&eS&&(t=requestAnimationFrame(()=>{eC(Math.max(0,Math.min(eS.scrollTop-100,100))),e=!1}),e=!0)};return eS.addEventListener("scroll",a,{passive:!0}),a(),()=>{eS.removeEventListener("scroll",a),t&&cancelAnimationFrame(t)}},[eS]),(0,j.useEffect)(()=>{if(!en||eK||e6.current>=3)return void(e6.current>=3?console.log("Max popup count reached (3), not tracking anymore"):console.log("Not tracking activity for inactivity popup"));let e=()=>{switch(e6.current){case 0:return 6e4;case 1:return 3e5;case 2:return 9e5;default:return null}},t=()=>{e1.current=Date.now(),e0.current&&clearTimeout(e0.current);let t=e();t&&(e0.current=setTimeout(()=>{Date.now()-e1.current>=t&&!eK&&e6.current<3&&(console.log("Showing inactivity popup (".concat(e6.current+1,"/3)")),e6.current+=1,(0,c.trackPopupViewedQuestions)("Do you have any questions?"),eZ(!0))},t))},a=["mousedown","mousemove","keypress","touchstart","click"];return a.forEach(e=>{window.addEventListener(e,t,{passive:!0})}),console.log("Initializing inactivity timer (popup count: ".concat(e6.current,")")),t(),()=>{a.forEach(e=>{window.removeEventListener(e,t)}),e0.current&&clearTimeout(e0.current)}},[en,eK]);let ty=async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||(0,s.zc)(e)){console.log("[syncFilterPreferencesToAPI] Skipping — leadId is missing or temporary:",e),t.length>0&&!a?await tD(t,l):X(!1);return}try{let c=(0,m.cG)(),u={};t.forEach(e=>{if("coverage"===e.key&&e.customCoverage)u[e.code]={custom:!0,min:e.customCoverage.min,max:e.customCoverage.max,label:e.selected};else if(e.optionsData){let t=e.optionsData.find(t=>t.label===e.selected);t&&(u[e.code]={value:t.value,label:e.selected,meta:t.meta||e.incomeMeta||void 0})}});let d=Object.keys(u),p=["coverage","premium","income","coverage_till_age","insurer","sort_by"].filter(e=>!d.includes(e));p.length>0?console.warn("⚠️ Missing filters in filterPreferences:",p):console.log("✅ All filter preferences saved:",d);let h=tu.current,f=null,g=null,x=null,_=null;if(h){if(h.personas&&Array.isArray(h.personas)&&h.personas.length>0){_=h.personas;let e=h.personas.find(e=>"primary_applicant"===e.relationship||"self"===e.relationship);e&&(f=e.age||null,g=e.gender||null)}x=h.education||null}let{ok:v,result:y}=await (0,m.P1)({step:"FILTERS",filter_preferences:u,insurance_type:"Term",age:f,gender:g,education:x,personas:_},{token:c,leadId:e,deviceId:(0,s.Ji)(),insuranceType:"Term"});if(v){if(console.log("✅ Filter preferences synced to API (v2):",u),null==y?void 0:y.requirement){var r,n,i,o;let e=tu.current,t=(null==e||null==(r=e.personas)?void 0:r.length)>0?e.personas:y.requirement.personas,a={...e||{},...y.requirement,personas:(null==t?void 0:t.length)?t:y.requirement.personas,city:null!=(n=y.requirement.city)?n:null==e?void 0:e.city,city_id:null!=(i=y.requirement.city_id)?i:null==e?void 0:e.city_id,filter_preferences:null!=(o=y.requirement.filter_preferences)?o:u};tc(a)}}else console.warn("Failed to sync filter preferences to API (v2), but continuing with fetchPlans");e&&t.length>
10&&!a?(console.log("\uD83D\uDD04 Scenario 2: Filter changed - calling swift-action after leads table update"),await tD(t,l),sessionStorage.setItem("collected_info_synced_".concat(e),Date.now().toString())):(a&&console.log("\uD83D\uDD04 Skipping fetchPlans - insurer/sortBy filter will be handled client-side"),X(!1))}catch(e){console.error("Error syncing filter preferences to API:",e),X(!1)}},tb=async(e,t)=>{let a=(0,m.cG)();if(a)try{let l={};t.personas&&Array.isArray(t.personas)&&t.personas.length>0&&(l.personas=t.personas),null!=t.education&&""!==t.education&&(l.education=t.education),null!=t.gender&&""!==t.gender&&(l.gender=t.gender),null!=t.smoking_status&&(l.smoking_status=t.smoking_status),null!=t.occupation_type&&""!==t.occupation_type&&(l.occupation_type=t.occupation_type),null!=t.city&&""!==t.city&&(l.city=t.city),null!=t.city_id&&(l.city_id=t.city_id);let{ok:r,result:n}=await (0,m.Tv)(l,{token:a,leadId:e,deviceId:(0,s.Ji)()});if(!r)return void console.warn("Failed to sync requirement to API (v2)",null==n?void 0:n.error);if(null==n?void 0:n.requirement){let e="string"==typeof n.requirement?JSON.parse(n.requirement):n.requirement;tc(e);let t=tC(e);ea(t)}console.log("✅ Requirement synced to API (v2) in one call")}catch(e){console.error("Error syncing requirement to API:",e)}},tw=async(e,t)=>{X(!0),tc(t),ea(tC(t)),eL(!1),en&&(await tb(en,t),ei.length>0&&await tD(ei)),X(!1)},tj=(0,j.useRef)(!0),tk=(0,j.useRef)(!!P||null!==x),tN=(0,j.useRef)(!1);(0,j.useEffect)(()=>{if(G||Q||0!==z)z>0&&(tN.current=!1);else if(!tN.current){let e=_.pathname||"/term-insurance";(0,o.trackNoPlanShown)("Life",e,""),(0,c.trackNoPlanShown)("Life",e,""),tN.current=!0}},[G,Q,z,_.pathname]),(0,j.useEffect)(()=>{(async()=>{if(tk.current&&tj.current&&en&&ei.length>0){let e=tu.current;if((null==e?void 0:e.age)||(null==e?void 0:e.annual_income)||(null==e?void 0:e.gender)){console.log("\uD83D\uDD04 SSR ran but v2 requirement has data - re-fetching with correct data"),await tD(ei),tj.current=!1;return}Y(!1),tj.current=!1;return}if(en&&ei.length>0&&tj.current&&!tk.current)console.log("\uD83D\uDD04 Scenario 1: Initial page load - calling swift-action directly (no leads table update)"),await tD(ei),tk.current=!0,setTimeout(()=>{tj.current=!1},1e3);else if(ei.length>0&&!en){let e=_.query.lead_id,t=localStorage.getItem("onboarding_lead_id");e||t?console.log("Filters loaded, waiting for leadId to be set"):(console.log("Filters loaded but no leadId available"),Y(!1))}else if(!en&&0===ei.length){let e=_.query.lead_id,t=localStorage.getItem("onboarding_lead_id"),a=e||t;a&&tj.current?console.log("Waiting for filters to load... (leadId found, filters loading)"):!a&&tj.current?(console.log("No leadId available, setting loading to false"),Y(!1)):console.log("Still waiting for leadId and filters")}})()},[en,ei.length]);let tC=e=>{if(!e)return"Term Insurance";let t="";if(e.personas&&e.personas.length>0){let a=e.personas.find(e=>"primary_applicant"===e.relationship||"self"===e.relationship);a&&a.age&&(t="Self (".concat(a.age,")"))}t||(t="Self");let a=[t];return(null==e?void 0:e.city)&&a.push(e.city),a.join(" • ")},tS=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t;let a=null!=(t=null!=e?e:tu.current)?t:null,l=localStorage.getItem("filter_metadata_term");if(l)try{let e=JSON.parse(l);if(e.ok&&e.filters){let t=tF(e.filters,a);if(t.length>0){eo(t),eu(e.filters),console.log("✅ Using cached filter metadata: ".concat(t.length," filters"));return}console.warn("Cached filter metadata is invalid, fetching from API")}}catch(e){console.error("Error parsing cached filter metadata:",e)}let r=(0,m.cG)(),n={"Content-Type":"application/json"};r&&(n.Authorization="Bearer ".concat(r));let s=await fetch("https://wxofebyviealmeyltqtm.supabase.co/functions/v1/filter-metadata-v1?product=term",{headers:n});if(s.ok){let e=await s.json();if(e.ok&&e.filters){localStorage.setItem("filter_metadata_term",JSON.stringify(e));let t=tF(e.filters,a);t.length>0?(eo(t),eu(e.filters),console.log("✅ Filter metadata loaded from API: ".concat(t.length," filters"))):console.warn("No filters found in API response, filters might not be set")}else console.warn("Invalid filter metadata response:",e)}else console.warn("Filter metadata API failed with status:",s.status)}catch(e){console.error("Error fetching filter metadata:",e)}},tF=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a={less_than_2_lac:"0","2_lac_to_2.9_lac":"1","3_lac_to_4.9_lac":"2","5_lac_to_9.9_lac":"3","10_lac_to_14.9_lac":"4","15_lac_to_24.9_lac":"5","25_lac_plus":"6"},l=[];return["coverage","premium","income","coverage_till_age","insurer","sort_by"].forEach(r=>{var n,s,i;let o=e[r];if(!o)return;let c=null,u=null;if(t){if(t.filter_preferences&&t.filter_preferences[r]){let e=t.filter_preferences[r];if(e.label?(u=o.options.find(t=>t.label===e.label))&&(c=u.label):e.value&&(u=o.options.find(t=>t.value===e.value))&&(c=u.label),"coverage"===r&&e.custom&&e.min&&e.max){let t=(e.min/1e5).toFixed(0),a=(e.max/1e5).toFixed(0);c=t===a?"₹".concat(t," Lac"):"₹".concat(t,"-").concat(a," Lac")}}if(!c){if("income"===r&&t.annual_income){let e=a[t.annual_income];e&&(u=o.options.find(t=>t.value===e))&&(c=u.label)}else if("coverage_till_age"===r&&t.coverage_till_age){let e=String(t.coverage_till_age);c=(u=o.options.find(t=>t.value===e||String(t.value)===e))?u.label:"".concat(t.coverage_till_age," years")}}}if(!c){let e=o.options.find(e=>e.is_default);c=e?e.label:null==(i=o.options[0])?void 0:i.label,u=e||o.options[0]}let m={key:r.replace(/_([a-z])/g,e=>e[1].toUpperCase()),code:o.code,label:o.label,selected:c,options:o.options.map(e=>e.label),optionsData:o.options};if("coverage"===r&&(null==t||null==(s=t.filter_preferences)||null==(n=s.coverage)?void 0:n.custom)){let e=t.filter_preferences.coverage;m.customCoverage={min:e.min,max:e.max}}l.push(m)}),l}
1,tI=e=>{if(!e)return 1;if("number"==typeof e)return e;if("string"==typeof e){let t=String(e).match(/(\d+)/);return t?parseInt(t[1]):1}return 1},tE=e=>{if(!e||!Array.isArray(e)||0===e.length)return[];let t=new Map;return e.forEach(e=>{let a=e.company||"Unknown";t.has(a)||t.set(a,{company_id:t.size+1,company_name:a,logo:e.logo_url||"",plans:[]});let l=t.get(a),r=l.plans.find(t=>t.product_name===e.product_name);if(!r){let t=e.clean_usp?e.clean_usp.split("|").map(e=>e.trim()).filter(e=>e):e.usp||[],a=tI(e.tenure);r={product_name:e.product_name||"",term:a,plan_type:null,policy_period:a,sum_assured:0,premium:0,featured:e.featured||!1,early_exit_eligible:e.early_exit_eligible||!1,discount_pct:e.discount_pct||0,usps:t,variants:[]},l.plans.push(r)}let n=tI(e.tenure),s=e.premium_payment_term||0;if(!r.variants.find(t=>t.sum_assured===e.sum_assured&&t.tenure===n&&t.premium_payment_term===s&&t.premium===e.premium)){var i,o;let t={product_id:e.product_id||"",pid:e.pid||"",sum_assured:e.sum_assured||0,tenure:n,premium:e.premium||0,base_premium:e.base_premium||0,annual_online_discount:e.annual_online_discount||0,discount_pct:e.discount_pct||0,online_discount:e.online_discount||0,salaried_discount:e.salaried_discount||0,first_time_buyer_discount:e.first_time_buyer_discount||0,existing_customer_discount:e.existing_customer_discount||0,monthly_premium:e.monthly_premium||0,early_exit_eligible:e.early_exit_eligible||!1,second_year_premium:e.second_year_premium||0,second_year_monthly_premium:e.second_year_monthly_premium||0,premium_payment_term:e.premium_payment_term||0,maturity_amount:null!=(o=null!=(i=e.maturity_amount)?i:e.maturity_benefit)?o:0};r.variants.push(t),1===r.variants.length&&(r.sum_assured=t.sum_assured,r.premium=t.premium)}}),Array.from(t.values())},tA=e=>{var t,a;if(!e||!e.success)return{ok:!1,companies:[]};let l=[...e.inline_recommendations||[],...e.backup_recommendations||[]];if(console.log("allRecommendations",l),0===l.length)return{ok:!0,companies:[],members:[]};let r=new Map;l.forEach(e=>{let t=e.company||"Unknown";if(!r.has(t)){let a=e.logo_url||"";r.set(t,{company_id:r.size+1,company_name:t,logo:a,plans:[]})}let a=r.get(t),l=a.plans.find(t=>t.product_name===e.product_name);if(!l){let t=e.clean_usp?e.clean_usp.split("|").map(e=>e.trim()).filter(e=>e):e.usp||[];l={product_name:e.product_name||"",term:tI(e.tenure),plan_type:null,policy_period:tI(e.tenure),sum_assured:0,premium:0,featured:e.featured||!1,early_exit_eligible:e.early_exit_eligible||!1,discount_pct:e.discount_pct||0,usps:t,variants:[]},a.plans.push(l)}let n=tI(e.tenure);if(!l.variants.find(t=>t.sum_assured===e.sum_assured&&t.tenure===n&&t.premium_payment_term===e.premium_payment_term&&t.premium===e.premium)){var s,i;let t={product_id:e.product_id||"",pid:e.pid||"",sum_assured:e.sum_assured||0,tenure:n,premium:e.premium||0,base_premium:e.base_premium||0,annual_online_discount:e.annual_online_discount||0,discount_pct:e.discount_pct||0,online_discount:e.online_discount||0,salaried_discount:e.salaried_discount||0,first_time_buyer_discount:e.first_time_buyer_discount||0,existing_customer_discount:e.existing_customer_discount||0,monthly_premium:e.monthly_premium||0,early_exit_eligible:e.early_exit_eligible||!1,second_year_premium:e.second_year_premium||0,second_year_monthly_premium:e.second_year_monthly_premium||0,premium_payment_term:e.premium_payment_term||0,maturity_amount:null!=(i=null!=(s=e.maturity_amount)?s:e.maturity_benefit)?i:0};l.variants.push(t),1===l.variants.length&&(l.sum_assured=t.sum_assured,l.premium=t.premium)}});let n=Array.from(r.values()),s=[];if(e.family_scenario){let t=e.family_scenario;if(t.eldest_age&&s.push({relationship:"primary_applicant",age:t.eldest_age}),t.has_spouse&&t.eldest_age){let e=t.eldest_age-5;s.push({relationship:"spouse",age:e>0?e:t.eldest_age})}if(t.num_children>0)for(let e=0;e<t.num_children;e++)s.push({relationship:"child",age:5+e})}let i={product_count:l.length,plan_count:n.reduce((e,t)=>e+t.plans.length,0),company_count:n.length,applied_filters:{coverage:"0",premium:"0",policy_period:(null==(a=e.family_scenario)||null==(t=a.preferred_tenure)?void 0:t.toString())||"1",insurer:"all",sort_by:"relevance"},generated_at:new Date().toISOString()};return{ok:!0,lead_id:e.lead_id,scenario_id:null,family_scenario:e.family_scenario,members:s,companies:n,meta:i}},tD=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ei,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!en){console.log("No lead_id available"),Y(!1),X(!1);return}if((0,s.zc)(en)){console.log("[fetchPlans] Skipping — leadId is temporary:",en),Y(!1),X(!1);return}t&&X(!0);try{var a,l,n,i,c,u,d;tM(e);let s=(0,m.cG)(),p=(0,m.Ay)(),h=_.query.lead_id,f={"Content-Type":"application/json"};s&&(f.Authorization="Bearer ".concat(s));let g=tu.current,x=null,v=null,y=null,b=null,w=null,j=null,k=null;if(g)try{if(g.personas&&Array.isArray(g.personas)&&g.personas.length>0&&(x=g.personas),g.filter_preferences){let e=g.filter_preferences.coverage||g.filter_preferences.sum_assured;e&&(e.custom&&void 0!==e.min&&void 0!==e.max?(v=e.min,y=e.max):e.meta&&e.meta.max?(v=e.meta.min||e.meta.max,y=e.meta.max):"number"==typeof e&&(v=e,y=e));let t=g.filter_preferences.premium||g.filter_preferences.budget;t&&(t.custom&&void 0!==t.min&&void 0!==t.max?(b=t.min,w=t.max):t.meta&&t.meta.max?(b=null!=(a=t.meta.min)?a:t.meta.max,w=t.meta.max):"number"==typeof t&&(b=t,
1w=t));let l=g.filter_preferences.insurer;l&&(k=l.label);let r=g.filter_preferences.coverage_till_age;r&&(j=r.value)}if(null===v||null===y){let t=e.find(e=>"coverage"===e.key);if(t){if(t.customCoverage)v=t.customCoverage.min,y=t.customCoverage.max;else if(t.optionsData){let e=t.optionsData.find(e=>e.label===t.selected);e&&e.meta&&e.meta.max?(v=e.meta.min||e.meta.max,y=e.meta.max):e&&"number"==typeof e.value&&(v=e.value,y=e.value)}}}if(null===b||null===w){let t=e.find(e=>"premium"===e.key);if(t){if(t.customPremium)b=t.customPremium.min,w=t.customPremium.max;else if(t.optionsData){let e=t.optionsData.find(e=>e.label===t.selected);e&&e.meta&&e.meta.max?(b=null!=(l=e.meta.min)?l:e.meta.max,w=e.meta.max):e&&"number"==typeof e.value&&(b=e.value,w=e.value)}}}}catch(e){console.error("Error parsing requirement data for swift-action payload:",e)}let N={lead_id:h||p||en,website:!0,send_flag:!1,send_whatsapp_flag:!1,insurance_type:"term"};if(x&&(N.personas=x),null!==k&&"All Insurers"!==k&&(N.preferred_insurer=k),null===v||null===y){let t=e.find(e=>"coverage"===e.key);if(t&&t.optionsData){let e=t.optionsData.find(e=>e.is_default)||t.optionsData[0];e&&e.meta?(v=e.meta.min||e.meta.max||1e6,y=e.meta.max||5e6):(v=1e6,y=5e6)}else v=1e6,y=5e6}null!==v&&(N.preferred_sum_assured_min=v),null!==y&&(N.preferred_sum_assured_max=y),null!==b&&(N.budget_min=b),null!==w&&(N.budget_max=w);let C=e.find(e=>"coverageTillAge"===e.key||"coverage_till_age"===e.code);if(null==C?void 0:C.optionsData){let e=C.optionsData.find(e=>e.label===C.selected),t=e?e.value:null;j=null!=t&&""!==t?t:null}null!==j&&(N.coverage_till_age=j),console.log("[term-insurance] swift-action payload:",N);let S=await fetch(r.vT,{method:"POST",headers:f,body:JSON.stringify(N)});if(S.ok){let a=await S.json();console.log("[term-insurance] swift-action response:",a);let l=tA(a);if(l.ok&&l.companies){let r=!!a.has_parent_recommendations;ez(r);let s=l.companies,m=l.companies,p=null;if(r){let l=[...a.inline_recommendations||[],...a.backup_recommendations||[]],r=[...a.parent_inline_recommendations||[],...a.parent_backup_recommendations||[]],n=[...a.kids_inline_recommendations||[],...a.kids_backup_recommendations||[]],i=tE(l),o=tE(r),c=tE(n);if(p={self:i,parents:o,kids:c},eU(p),t){let t=tL(e,i),a=tL(e,o),l=tL(e,c);eO({self:t,parents:a,kids:l}),s=t}else eO({self:i,parents:o,kids:c}),s=i;m=i}else eO({self:[],parents:[],kids:[]}),eU({self:[],parents:[],kids:[]});q(m);let h=new Set;(r&&p?[...p.self||[],...p.parents||[],...p.kids||[]]:l.companies).forEach(e=>{e&&e.company_name&&e.company_name.trim()&&h.add(e.company_name.trim())}),console.log("\uD83D\uDCCA Updating insurer filter with ".concat(h.size," unique insurers from resultset:"),Array.from(h)),eo(e=>e.map(e=>{if("insurer"===e.key){let t=["All Insurers",...Array.from(h).sort()],a=[{value:"all",label:"All Insurers",is_default:!0},...Array.from(h).sort().map(e=>({value:e.toLowerCase().replace(/\s+/g,"_"),label:e}))],l=e.selected,r=t.includes(l)?l:"All Insurers";return console.log("✅ Updated insurer filter: ".concat(t.length," options, selected: ").concat(r)),{...e,options:t,optionsData:a,selected:r}}return e}));let f=r?s:l.companies;if(!r){if(t){let t=e.find(e=>"coverage"===e.key);if(t&&t.selected){let e=null==(n=t.optionsData)?void 0:n.find(e=>e.label===t.selected);if(e){let a=null,l=null;if(t.customCoverage)a=t.customCoverage.min,l=t.customCoverage.max;else if(e.meta)a=e.meta.min,l=e.meta.max;else if(e.value&&"0"!==e.value){let t={0:{min:5e4,max:1e6},1:{min:5e4,max:5e5},2:{min:5e5,max:9e5},3:{min:1e6,max:24e5},4:{min:25e5,max:99e5}}[e.value];t&&(a=t.min,l=t.max)}null!==a&&null!==l&&(console.log("\uD83D\uDD0D Filtering plans by coverage: ₹".concat(a," - ₹").concat(l)),f=f.map(e=>({...e,plans:e.plans.map(e=>{let t=e.variants.filter(t=>{let r=t.sum_assured||e.sum_assured||0;return r>=a&&r<=l});return t.length>0?{...e,variants:t,sum_assured:t[0].sum_assured||e.sum_assured}:null}).filter(Boolean)})).filter(e=>e.plans.length>0),console.log("✅ Filtered ".concat(f.length," companies by coverage range")))}}let a=e.find(e=>"premium"===e.key);if(a&&a.selected&&"Any"!==a.selected){let e=null,t=null;if(a.customPremium)e=a.customPremium.min,t=a.customPremium.max;else{let l=null==(i=a.optionsData)?void 0:i.find(e=>e.label===a.selected);l&&l.meta&&(e=null!=(c=l.meta.min)?c:0,t=l.meta.max)}null!==e&&null!==t&&(console.log("\uD83D\uDD0D Filtering plans by premium (annual): ₹".concat(e," - ₹").concat(t)),f=f.map(a=>({...a,plans:a.plans.map(a=>{let l=a.variants.filter(l=>{let r=l.premium||(l.monthly_premium?12*l.monthly_premium:0)||a.premium||0;return r>=e&&r<=t});return l.length>0?{...a,variants:l,premium:l[0].premium||a.premium}:null}
1).filter(Boolean)})).filter(e=>e.plans.length>0),console.log("✅ Filtered ".concat(f.length," companies by premium range")))}}eP?(console.log("\uD83D\uDD0D Filtering plans by product name from query: ".concat(eP)),f=f.map(e=>{let t=e.plans.filter(e=>{let t=(e.product_name||"").trim().toLowerCase(),a=eP.trim().toLowerCase();return t===a||t.includes(a)||a.includes(t)});return t.length>0?{...e,plans:t}:null}).filter(Boolean),console.log("✅ Filtered to ".concat(f.length," companies by product name: ").concat(eP))):eB&&(console.log("\uD83D\uDD0D Filtering plans by insurer from query: ".concat(eB)),f=f.filter(e=>{let t=(e.company_name||"").trim().toLowerCase(),a=eB.trim().toLowerCase(),l=t===a||t.includes(a)||a.includes(t);return l&&console.log("✅ Company matched: ".concat(e.company_name," with ").concat(eB)),l}),console.log("✅ Filtered to ".concat(f.length," companies by insurer: ").concat(eB)));let a=e.find(e=>"insurer"===e.key);if(!eP&&!eB&&a&&a.selected&&"All Insurers"!==a.selected&&(null==(u=a.optionsData)?void 0:u.find(e=>e.label===a.selected))){let e=a.selected;console.log("\uD83D\uDD0D Filtering plans by insurer: ".concat(e)),f=f.filter(t=>{let a=(t.company_name||"").trim().toLowerCase(),l=e.trim().toLowerCase(),r=a===l||a.includes(l)||l.includes(a);return r&&console.log("✅ Company matched: ".concat(t.company_name," with ").concat(e)),r}),console.log("✅ Filtered to ".concat(f.length," companies by insurer"))}let l=e.find(e=>"sortBy"===e.key);if(l&&l.selected){let e=null==(d=l.optionsData)?void 0:d.find(e=>e.label===l.selected);if(e){let t=e.value;console.log("\uD83D\uDD0D Sorting plans by: ".concat(t)),f=(f=f.map(e=>{let a=[...e.plans].sort((e,a)=>{switch(t){case"premium_low_high":{let t=Math.min(...(e.variants||[]).map(e=>e.premium||1/0))||e.premium||0,l=Math.min(...(a.variants||[]).map(e=>e.premium||1/0))||a.premium||0;return t-l}case"premium_high_low":{let t=Math.max(...(e.variants||[]).map(e=>e.premium||0),e.premium||0);return Math.max(...(a.variants||[]).map(e=>e.premium||0),a.premium||0)-t}case"coverage_high_low":{let t=Math.max(...(e.variants||[]).map(e=>e.sum_assured||0),e.sum_assured||0);return Math.max(...(a.variants||[]).map(e=>e.sum_assured||0),a.sum_assured||0)-t}default:if(e.featured&&!a.featured)return -1;if(!e.featured&&a.featured)return 1;return 0}});return{...e,plans:a}})).sort((e,a)=>{let l=e.plans[0],r=a.plans[0];if(!l&&!r)return 0;if(!l)return 1;if(!r)return -1;switch(t){case"premium_low_high":{let e=Math.min(...(l.variants||[]).map(e=>e.premium||1/0))||l.premium||0,t=Math.min(...(r.variants||[]).map(e=>e.premium||1/0))||r.premium||0;return e-t}case"premium_high_low":{let e=Math.max(...(l.variants||[]).map(e=>e.premium||0),l.premium||0);return Math.max(...(r.variants||[]).map(e=>e.premium||0),r.premium||0)-e}case"coverage_high_low":{let e=Math.max(...(l.variants||[]).map(e=>e.sum_assured||0),l.sum_assured||0);return Math.max(...(r.variants||[]).map(e=>e.sum_assured||0),r.sum_assured||0)-e}default:if(l.featured&&!r.featured)return -1;if(!l.featured&&r.featured)return 1;return 0}}),console.log("✅ Sorted plans within companies and sorted companies by ".concat(t))}}}let g=f.reduce((e,t)=>e+t.plans.reduce((e,t)=>e+t.variants.length,0),0);R(g),B(f),!t&&g>0?(0,o.trackViewItemList)("life",g):t||0!==g||(0,o.trackErrorEmptyResults)("life",{lead_id:en,reason:"no_plans_found"});let x=tu.current;if(x){let e=tC(x);ea(e)}}else console.error("Invalid API response:",l),B([]),R(0),(0,o.trackErrorEmptyResults)("life",{lead_id:en})}else console.error("API request failed:",S.status),B([]),R(0),(0,o.trackErrorEmptyResults)("life",{lead_id:en,error:"api_failed"})}catch(e){console.error("Error fetching plans:",e),B([]),R(0)}finally{t?X(!1):Y(!1)}},tL=(e,t)=>{var a,l,r,n;let s=JSON.parse(JSON.stringify(t));eP&&(s=s.map(e=>({...e,plans:e.plans.filter(e=>{let t=(e.product_name||"").trim().toLowerCase(),a=eP.trim().toLowerCase();return t===a||t.includes(a)||a.includes(t)})})).filter(e=>e.plans.length>0));let i=e.find(e=>"coverage"===e.key);if(i&&i.selected){let e=null==(a=i.optionsData)?void 0:a.find(e=>e.label===i.selected);if(e){let t=null,a=null;i.customCoverage?(t=i.customCoverage.min,a=i.customCoverage.max):e.meta&&(t=e.meta.min,a=e.meta.max),null!==t&&null!==a&&(s=s.map(e=>({...e,plans:e.plans.map(e=>{let l=e.variants.filter(l=>{let r=l.sum_assured||e.sum_assured||0;return r>=t&&r<=a});return l.length>0?{...e,variants:l,sum_assured:l[0].sum_assured||e.sum_assured}:null}
1).filter(Boolean)})).filter(e=>e.plans.length>0))}}let o=e.find(e=>"premium"===e.key);if(o&&o.selected&&"Any"!==o.selected){let e=null,t=null;if(o.customPremium)e=o.customPremium.min,t=o.customPremium.max;else{let a=null==(l=o.optionsData)?void 0:l.find(e=>e.label===o.selected);a&&a.meta&&(e=null!=(r=a.meta.min)?r:0,t=a.meta.max)}if(null!==e&&null!==t){console.log("\uD83D\uDD0D [Client-side] Filtering by premium: ₹".concat(e," - ₹").concat(t," (annual)"));let a=s.reduce((e,t)=>e+t.plans.reduce((e,t)=>{var a;return e+((null==(a=t.variants)?void 0:a.length)||0)},0),0),l=(s=s.map(a=>({...a,plans:a.plans.map(a=>{let l=a.variants.filter(l=>{let r=l.premium||(l.monthly_premium?12*l.monthly_premium:0)||a.premium||0;return r>=e&&r<=t});return l.length>0?{...a,variants:l,premium:l[0].premium||a.premium}:null}).filter(Boolean)})).filter(e=>e.plans.length>0)).reduce((e,t)=>e+t.plans.reduce((e,t)=>{var a;return e+((null==(a=t.variants)?void 0:a.length)||0)},0),0);console.log("✅ [Client-side] Premium filter: ".concat(a," → ").concat(l," variants"))}}let c=e.find(e=>"insurer"===e.key);if(!eP&&!eB&&c&&c.selected)if("All Insurers"!==c.selected){let e=c.selected;console.log("\uD83D\uDD0D [Client-side] Filtering plans by insurer: ".concat(e)),s=s.filter(t=>{let a=(t.company_name||"").trim().toLowerCase(),l=e.trim().toLowerCase(),r=a===l||a.includes(l)||l.includes(a)||l.split(" ").length>0&&a.startsWith(l.split(" ")[0])||a.split(" ").length>0&&l.includes(a.split(" ")[0]);return r?console.log("✅ [Client-side] Company matched: ".concat(t.company_name," with ").concat(e)):console.log("❌ [Client-side] Company NOT matched: ".concat(t.company_name," with ").concat(e)),r}),console.log("✅ [Client-side] Filtered to ".concat(s.length," companies by insurer"))}else console.log('\uD83D\uDD0D [Client-side] "All Insurers" selected - showing all companies');let u=e.find(e=>"sortBy"===e.key);if(u&&u.selected){let e=null==(n=u.optionsData)?void 0:n.find(e=>e.label===u.selected);if(e){let t=e.value;console.log("\uD83D\uDD0D [Client-side] Sorting plans by: ".concat(t)),s=(s=s.map(e=>{if("relevance"===t){let t=[...e.plans].sort((e,t)=>e.featured&&!t.featured?-1:!e.featured&&t.featured?1:0);return{...e,plans:t}}let a=[...e.plans].sort((e,a)=>{switch(t){case"premium_low_high":return(Math.min(...(e.variants||[]).map(e=>e.premium||1/0))||e.premium||0)-(Math.min(...(a.variants||[]).map(e=>e.premium||1/0))||a.premium||0);case"premium_high_low":{let t=Math.max(...(e.variants||[]).map(e=>e.premium||0),e.premium||0);return Math.max(...(a.variants||[]).map(e=>e.premium||0),a.premium||0)-t}case"coverage_high_low":{let t=Math.max(...(e.variants||[]).map(e=>e.sum_assured||0),e.sum_assured||0);return Math.max(...(a.variants||[]).map(e=>e.sum_assured||0),a.sum_assured||0)-t}default:return 0}});return{...e,plans:a}})).sort((e,a)=>{let l=e.plans[0],r=a.plans[0];if(!l&&!r)return 0;if(!l)return 1;if(!r)return -1;switch(t){case"premium_low_high":return(Math.min(...(l.variants||[]).map(e=>e.premium||1/0))||l.premium||0)-(Math.min(...(r.variants||[]).map(e=>e.premium||1/0))||r.premium||0);case"premium_high_low":{let e=Math.max(...(l.variants||[]).map(e=>e.premium||0),l.premium||0);return Math.max(...(r.variants||[]).map(e=>e.premium||0),r.premium||0)-e}case"coverage_high_low":{let e=Math.max(...(l.variants||[]).map(e=>e.sum_assured||0),l.sum_assured||0);return Math.max(...(r.variants||[]).map(e=>e.sum_assured||0),r.sum_assured||0)-e}default:if(l.featured&&!r.featured)return -1;if(!l.featured&&r.featured)return 1;return 0}}),console.log("✅ [Client-side] Sorted plans within companies and sorted companies by ".concat(t))}}return s},tP=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;console.log("handleFilterChange called:",e,t,a),"sortBy"===e?(0,i.trackSortApplied)(e,t,"term-insurance"):(0,i.trackFilterApplied)(e,JSON.stringify(t),"term-insurance"),(0,c.trackDropdownClickedTopFilter)(e,t,"life","/term-insurance","plan_listing"),eo(l=>{var r,n,s;let i=[...l.map(l=>{if(l.key===e){let r={...l,selected:t};return"coverage"===e&&a?r.customCoverage=a:"coverage"!==e||a||delete r.customCoverage,"income"===e&&a?r.incomeMeta=a:"income"!==e||a||delete r.incomeMeta,"premium"===e&&a?r.customPremium=a:"premium"!==e||a||delete r.customPremium,r}return l})];console.log("New filters:",i.map(e=>({key:e.key,selected:e.selected,customCoverage:e.customCoverage})));let o="insurer"===e||"sortBy"===e,c=eq?(null==(r=eW.self)?void 0:r.length)>0||(null==(n=eW.parents)?void 0:n.length)>0||(null==(s=eW.kids)?void 0:s.length)>0:T.length>0;if(o&&c){if(console.log("\uD83D\uDD04 [Client-side] Applying insurer/sortBy filter without API call"),X(!1),en&&(eI.current&&clearTimeout(eI.current),eI.current=setTimeout(()=>{ty(en,i,!0)},500)),eq){let e=tL(i,eW.self||[]),t=tL(i,eW.parents||[]),a=tL(i,eW.kids||[]);eO({self:e,parents:t,kids:a});let l="self"===eV?e:"parents"===eV?t:a;R(l.reduce((e,t)=>
1e+t.plans.reduce((e,t)=>e+t.variants.length,0),0)),B(l)}else{let e=tL(i,T);R(e.reduce((e,t)=>e+t.plans.reduce((e,t)=>e+t.variants.length,0),0)),B(e)}Y(!1)}else en?(X(!0),eI.current&&clearTimeout(eI.current),eI.current=setTimeout(()=>{ty(en,i,!1,!0)},500)):X(!1);return i})},tM=e=>{let t={};return e.forEach(e=>{if("coverage"===e.key&&e.customCoverage)t[e.code]={custom:!0,min:e.customCoverage.min,max:e.customCoverage.max};else if(e.optionsData){let a=e.optionsData.find(t=>t.label===e.selected);a&&a.value&&(t[e.code]=a.value)}}),console.log("Built filter params:",t),t.sort_by?console.log("✅ sort_by is being passed:",t.sort_by):console.warn("⚠️ sort_by is NOT in params. Current filters:",e.map(e=>{var t;return{key:e.key,code:e.code,selected:e.selected,hasOptionsData:!!e.optionsData,optionsDataLength:(null==(t=e.optionsData)?void 0:t.length)||0}})),t},tB=e=>{W(t=>({...t,[e]:!t[e]}))},tT=e=>{let t=new URLSearchParams({product_id:e.product_id});e.sum_assured&&t.append("sum_assured",e.sum_assured.toString()),e.tenure&&t.append("tenure",e.tenure.toString()),e.premium&&t.append("premium",e.premium.toString()),_.push("/plan-feature?".concat(t.toString()))},tq=(e,t,a)=>{if("addToCart"===e.action)$.includes(a)?K($.filter(e=>e!==a)):K([...$,a]);else if("compare"===e.action){let e;if((0,o.trackCompareButtonClicked)("add_to_compare","/term-insurance"),Z.includes(a))e=Z.filter(e=>e!==a);else{if(!(Z.length<3))return void alert("You can compare up to 3 plans only");e=[...Z,a]}ee(e);try{localStorage.setItem("compare_plans_term",JSON.stringify(e))}catch(e){console.error("Error saving compare plans to localStorage:",e)}}},tz=()=>{if((0,o.trackCompareButtonClicked)("compare_button","/term-insurance"),(0,c.trackButtonClickedCompare)("/term-insurance",""),Z.length>=2){let e=M.flatMap(e=>e.variants||[]).filter(e=>Z.includes(e.product_id)).map(e=>({name:e.product_name||e.plan_name,id:e.product_id,insurer:e.insurer_name,premium:e.total_premium||e.premium||0}));(0,i.trackPlanComparison)(e),_.push("/compare?ids=".concat(Z.join(","),"&lead_id=").concat(en))}else showToast.warning("Please select at least 2 plans to compare")},tR=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;localStorage.setItem("communication_preference","call"),localStorage.setItem("hasShownCallInterface","true"),ed(!1),ek(!0),e&&(console.log("Starting conversation for plan:",e,t),eh(e),eg(t))},tO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];localStorage.setItem("communication_preference","chat"),localStorage.setItem("hasShownCallInterface","true"),ed(!1),y&&ts(!0),ek(!1),e5(null);let l=t||"plan_listing";a||((0,o.trackContactAdvisorClick)("chat","plan_listing"),(0,o.trackButtonClicked)("Talk to Advisor","talk_li_btn","/term-insurance",l),(0,c.trackButtonClickedTalkToAdvisorListing)("term","/term-insurance",l)),e&&e4(e)},tW=e=>{(0,c.trackPopupClosedQuestions)(),"chat"===e?(0,c.trackButtonClickedPopupChat)("/term-insurance",""):"talk"===e?(0,c.trackButtonClickedPopupTalk)("/term-insurance",""):"no_thanks"===e&&(0,c.trackButtonClickedPopupNoThanks)("/term-insurance",""),eZ(!1),e1.current=Date.now(),"chat"===e?tO("I have some questions, can you please help me?"):"talk"===e&&(tR(),y&&ts(!0))},tU=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(y&&(localStorage.setItem("hasShownCallInterface","true"),ts(!0)),a){localStorage.setItem("hasShownCallInterface","true"),e4(""),ed(!1),ek(!1),eh(e),eg(t);return}let l=localStorage.getItem("communication_preference");l?"call"===l?tR(e,t):(localStorage.setItem("hasShownCallInterface","true"),e4(""),ed(!1),ek(!1),eh(e),eg(t)):(ey(e),ew(t),e_(!0))},tV=e=>{localStorage.setItem("communication_preference",e),localStorage.setItem("hasShownCallInterface","true"),e_(!1),y&&ts(!0),"call"===e?tR(ev,eb):(e4(""),ed(!1),ek(!1),eh(ev),eg(eb)),ey(null),ew(null)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(v(),{children:[(0,l.jsx)("link",{rel:"canonical",href:"https://www.covertiger.com/term-insurance"},"canonical"),(0,l.jsx)("title",{children:"Term Life Insurance Plans - Compare & Buy Online | CoverTiger"}),(0,l.jsx)("link",{rel:"preload",href:"/home/logo.svg",as:"image"}),(0,l.jsx)("meta",{name:"description",content:"Compare and buy the best term life insurance plans from top insurers. Get instant quotes, compare coverage, premiums, and benefits. Find the perfect term insurance plan to protect your family's future."}),(0,l.jsx)("meta",{name:"keywords",content:"term insurance, term life insurance, life insurance, term insurance plans, compare term insurance, buy term insurance online, term insurance quotes, life cover"}),(0,l.jsx)("meta",{property:"og:title",content:"Term Life Insurance Plans - Compare & Buy Online | CoverTiger"}),(0,l.jsx)("meta",{property:"og:description",content:"Compare and buy the best term life insurance plans from top insurers. Get instant quotes, compare coverage, premiums, and benefits."}),(0,l.jsx)("meta",{property:"og:type",content:"website"})]}),(0,l.jsxs)("div",{ref:e=>{eA.current=e,eF(e)},className:"min-h-screen max-h-screen  bg-[#F5F5F5] fixed overflow-y-auto overflow-x-hidden w-full",children:[(0,l.jsx)("header",{className:"z-50 bg-white border-b border-gray-100",children:(0,l.jsx)("div",{className:"px-6 py-3 mx-auto lg:px-12",children:(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),_.prefetch("/"),requestAnimationFrame(()=>{_.push("/")})},children:[(0,l.jsx)(b(),{src:"/home/logo.svg",alt:"CoverTiger Logo",width:147.6,height:39,className:"hidden sm:block",priority:!0}),(0,l.jsx)(b(),{src:"/home/logo.svg",alt:"CoverTiger Logo",width:128,height:31,className:"block sm:hidden"})]}),(0,l.jsxs)("button",{className:"flex items-center space-x-2 font-medium text-white rounded-full",style:{background:"linear-gradient(180deg, #FFFFFF 0%, #F4F4F4 100%)",border:"1.5px solid #A296FF",boxShadow:"0px 0px 21px 0px #00000033",boxShadow:"0px 0px 21px 0px #BCBCBC40 inset",onHover:"text-blue-500",cursor:"pointer"},onClick:()=>
1{if((0,o.trackHomePageAdvisorClick)("homepage_talk now","chat","Header"),y){let e=localStorage.getItem("leadFormSubmitted"),t=localStorage.getItem("tempLeadId"),a=localStorage.getItem("leadId");if(!e||t&&t===a){ti.current=!0,(0,I.$z)(),e9(!0);return}eh(null),eg(null),localStorage.setItem("hasShownCallInterface","true"),ed(!1),ek(!1),(0,o.trackContactAdvisorClick)("chat","plan_listing"),(0,o.trackButtonClicked)("Talk to Advisor","talk_li_btn","/term-insurance","plan_listing"),(0,c.trackButtonClickedTalkToAdvisorListing)("term","/term-insurance","plan_listing"),_.push("/new-term-insurance");return}let e=localStorage.getItem("leadFormSubmitted"),t=localStorage.getItem("tempLeadId"),a=localStorage.getItem("leadId");if(!e||t&&t===a){ti.current=!0,(0,I.$z)(),e9(!0);return}eh(null),eg(null),localStorage.setItem("hasShownCallInterface","true"),ed(!1),ek(!1),(0,o.trackContactAdvisorClick)("chat","plan_listing"),(0,o.trackButtonClicked)("Talk to Advisor","talk_li_btn","/term-insurance","plan_listing"),(0,c.trackButtonClickedTalkToAdvisorListing)("term","/term-insurance","plan_listing"),ts(!0)},children:[(0,l.jsx)("img",{src:"/new-home/nina.png",alt:"AI Advisor",width:32,height:32,loading:"lazy",decoding:"async",className:y?"ml-1 w-6 h-6":"ml-1 w-8 h-8"}),(0,l.jsx)("span",{className:"text-base py-2 md:text-base font-semibold text-[#2D3436] ml-2 mr-3",children:y?"Talk to Advisor":"Talk to Insurance Advisor"})]})]})})}),(0,l.jsx)("main",{className:"relative",style:{background:"linear-gradient(180deg, #C4C7FF 0%, #E8E9FF 50%, #FFFFFF 100%)"},children:G?(0,l.jsx)(C.A,{contentOnly:!0}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(F.default,{filters:ei,onFilterChange:tP,userInfo:et,onEditMembers:tw,openEditModal:eD,currentRequirement:to,insuranceType:"Term",premiumFrequency:eH,onPremiumFrequencyChange:eG,limitedPay:eY,onLimitedPayChange:eQ,viewSecondYearPremium:eX,onViewSecondYearPremiumChange:e$}),eq&&(0,l.jsx)("div",{className:"px-4 pt-3 pb-2 md:px-6 lg:px-12",children:(0,l.jsx)("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide ".concat(y?"px-4 pb-2 -mx-4":""),style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[{key:"self",label:"Self",count:(eR.self||[]).reduce((e,t)=>e+(t.plans||[]).reduce((e,t)=>{var a;return e+((null==(a=t.variants)?void 0:a.length)||0)},0),0)||0},{key:"parents",label:"Parents",count:(eR.parents||[]).reduce((e,t)=>e+(t.plans||[]).reduce((e,t)=>{var a;return e+((null==(a=t.variants)?void 0:a.length)||0)},0),0)||0},{key:"kids",label:"Kids",count:(eR.kids||[]).reduce((e,t)=>e+(t.plans||[]).reduce((e,t)=>{var a;return e+((null==(a=t.variants)?void 0:a.length)||0)},0),0)||0}].filter(e=>e.count>0).map(e=>(0,l.jsxs)("button",{onClick:()=>{eJ(e.key);let t=eR[e.key]||[];B(t),R(t.reduce((e,t)=>e+t.plans.reduce((e,t)=>{var a;return e+((null==(a=t.variants)?void 0:a.length)||0)},0),0))},className:"shrink-0 px-4 py-2.5 rounded-lg text-sm font-medium transition-colors ".concat(eV===e.key?"bg-[#6B61FF] text-white shadow-sm":"bg-white text-[#2D3436] border border-gray-200 hover:border-[#6B61FF]/50"),children:[e.label," (",e.count,")"]},e.key))})}),(0,l.jsxs)("div",{className:"flex gap-4 mt-3",children:[(0,l.jsxs)("div",{className:"relative px-4 mb-5 w-full max-w-5xl md:px-6 lg:px-12",children:[Q&&(0,l.jsx)("div",{className:"flex absolute inset-0 z-40 justify-center items-start pt-40 bg-white bg-opacity-75 rounded-lg",children:(0,l.jsx)("div",{className:"px-8 py-6 rounded-2xl border shadow-xl backdrop-blur-sm bg-white/90 border-gray-200/50",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4 items-center",children:[(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)("div",{className:"w-12 h-12 rounded-full border-4 animate-spin border-t-transparent",style:{borderColor:"#6B61FF transparent #6B61FF #6B61FF"}})}),(0,l.jsx)("div",{className:"text-lg font-medium text-gray-700",children:"Loading..."})]})})}),M.length>0&&(0,l.jsx)("div",{className:"mb-1",children:(0,l.jsxs)("h2",{className:"text-lg font-semibold text-[#2D3436]",children:["Showing ",tf," term (life) insurance plans from ",tg," ",1===tg?"insurer":"insurers"]})}),(0,l.jsx)("div",{className:"mt-1 space-y-6",children:M.map((e,t)=>{var a,r;let s=O[e.company_id],i=s||eY?e.plans:e.plans.slice(0,2),o=eY?0:Math.max(0,(null==e||null==(a=e.plans)?void 0:a.length)-2),u=new Map;for(let[e,t]of(i.forEach((e,t)=>{let a=e.product_name;u.has(a)||u.set(a,{product_name:a,usp:e.usps||[],variants:[],ctaLabel:"Select this plan",term:tI(e.term),early_exit_eligible:e.early_exit_eligible||!1,discount_pct:e.discount_pct||0});let l=u.get(a);
1e.variants.forEach(t=>{let a=t.tenure||tI(e.term);if(!l.variants.find(e=>e.sum_assured===t.sum_assured&&e.tenure===a&&e.premium_payment_term===t.premium_payment_term&&e.premium===t.premium)){var r,n,s;let e=t.second_year_premium||0,i=t.second_year_monthly_premium||0,o=eX&&(e>0||i>0),c=o?e:t.premium||0,u=o?i:t.monthly_premium||Math.round((t.premium||0)/12);l.variants.push({product_id:t.product_id,pid:t.pid||"",sum_assured:t.sum_assured,tenure:a,premium:t.premium,base_premium:t.base_premium||0,annual_online_discount:t.annual_online_discount||0,discount_pct:t.discount_pct||0,online_discount:t.online_discount||0,salaried_discount:t.salaried_discount||0,first_time_buyer_discount:t.first_time_buyer_discount||0,existing_customer_discount:t.existing_customer_discount||0,monthly_premium:t.monthly_premium||0,early_exit_eligible:null!=(r=t.early_exit_eligible)&&r,second_year_premium:e,second_year_monthly_premium:i,premium_payment_term:t.premium_payment_term||0,maturity_amount:null!=(s=null!=(n=t.maturity_amount)?n:t.maturity_benefit)?s:0,premiumLabel:"yearly"===eH?"₹".concat(c.toLocaleString("en-IN"),"/year"):"₹".concat(u.toLocaleString("en-IN"),"/month")})}})}),u))t.variants=t.variants.filter(e=>{let t=e.premium_payment_term||0,a=parseInt(String(e.tenure).replace(/[^0-9]/g,""),10)||0;return a<=0||(eY?t>0&&t<a:0===t||t>=a)}),0===t.variants.length&&u.delete(e);let m=Array.from(u.values()).map(e=>{var t,a,l,r,n;eY?e.variants.sort((e,t)=>e.sum_assured!==t.sum_assured?e.sum_assured-t.sum_assured:(e.tenure||0)-(t.tenure||0)):e.variants.sort((e,t)=>{let a=e.tenure||0,l=t.tenure||0;return a!==l?a-l:(e.sum_assured||0)-(t.sum_assured||0)});let s=null;if(et&&et.includes("Self ("))try{let t=et.match(/Self \((\d+)\)/);if(t){let a=parseInt(t[1]);e.variants=e.variants.map(t=>{let l=t.tenure||tI(e.term);return{...t,coverageTillAge:a+l}}),s=(null==(n=e.variants[0])?void 0:n.coverageTillAge)||null}}catch(e){console.error("Error parsing userInfo for coverageTillAge:",e)}return{...e,product_id:null==(t=e.variants[0])?void 0:t.product_id,premium:null==(a=e.variants[0])?void 0:a.premium,premiumLabel:null==(l=e.variants[0])?void 0:l.premiumLabel,sum_assured:null==(r=e.variants[0])?void 0:r.sum_assured,sumInsuredLabel:"Cover",coverageTillAge:s}}),d={};return(m.forEach(e=>{let t=e.variants&&e.variants.length>0?e.variants.some(e=>Z.includes(e.product_id)):Z.includes(e.product_id);d[e.variants&&e.variants.length>0?e.variants[0].product_id:e.product_id]=t}),0===m.length)?null:(0,l.jsxs)("div",{className:"space-y-4 px-2 py-4 ".concat(0===o?"mb-6":"mb-10"),children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(S.A,{plans:m,companyLogo:e.logo,companyName:e.company_name,insurance_type:"term",index:t,variant:"company",showCompareToggle:!0,compareStates:d,premiumFrequency:eH,viewSecondYearPremium:eX,onStartTalking:(e,t)=>tU(e,t,!0),onCompareToggle:e=>tq({action:"compare"},0,e.product_id),onViewAllFeatures:e=>tT(e),onCtaClick:e=>{let t=new URLSearchParams({insurance_type:"term"});e.product_id&&t.set("product_id",e.product_id),en&&t.set("lead_id",en);let a="?".concat(t.toString());_.prefetch("/buy".concat(a)),_.push("/buy".concat(a))}}),!eY&&(null==e||null==(r=e.plans)?void 0:r.length)>2&&(0,l.jsx)("div",{className:"text-center absolute bottom-[-26px] left-0 right-0",children:(0,l.jsx)("button",{onClick:()=>tB(e.company_id),className:"px-6 py-1 bg-[#E8E9FF] text-[#6B61FF] rounded-b-lg text-sm font-medium hover:bg-[#d8d9ff] transition-colors cursor-pointer",children:s?"Show less plans from ".concat(e.company_name.split(" ")[0]," ").concat(e.company_name.split(" ")[1]):"View ".concat(o," more plan").concat(o>1?"s":""," from ").concat(e.company_name.split(" ")[0]," ").concat(e.company_name.split(" ")[1])})})]}),0===t&&M.length>1&&(0,l.jsx)("div",{className:"px-2 pb-2 mt-4",children:(0,l.jsxs)("div",{className:"w-full rounded-3xl border border-[#E7E7F8] bg-white/95 p-4 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,l.jsx)("img",{src:n.j1,alt:n.u1,className:"h-14 w-14 shrink-0 rounded-full border border-[#E7E7F8] object-cover shadow-md"}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("div",{className:"text-base font-semibold text-[#2D3436]",children:"Have any questions?"}),(0,l.jsxs)("div",{className:"text-sm text-[#636E72]",children:["Chat with ",n.u1," now to solve any queries from premium, benefits, pricing, etc."]})]})]}),(0,l.jsx)("button",{onClick:()=>{(0,c.trackButtonClickedAskQuestionsAIAdvisor)(n.gD,"/term-insurance","plan_listing"),_.push("/new-term-insurance")},className:"mt-4 w-full rounded-2xl bg-gradient-to-r from-[#6B61FF] to-[#FE9BF3] px-4 py-3 text-sm font-semibold text-white shadow-sm transition-colors cursor-pointer",children:n.gD})]})}),2===t&&M.length>3&&(0,l.jsx)("div",{className:"px-2 pb-2 mt-4",children:(0,l.jsxs)("div",{className:"w-full rounded-3xl border border-[#
1E7E7F8] bg-white/95 p-4 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,l.jsx)("img",{src:n.j1,alt:n.u1,className:"h-14 w-14 shrink-0 rounded-full border border-[#E7E7F8] object-cover shadow-md"}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("div",{className:"text-base font-semibold text-[#2D3436]",children:"Confused what to buy"}),(0,l.jsxs)("div",{className:"text-sm text-[#636E72]",children:["Talk to ",n.u1," to get the best advice"]})]})]}),(0,l.jsxs)("button",{onClick:()=>{(0,c.trackButtonClickedAskQuestionsAIAdvisor)("Talk to ".concat(n.u1),"/term-insurance","plan_listing"),_.push("/new-term-insurance")},className:"mt-4 w-full rounded-2xl bg-gradient-to-r from-[#6B61FF] to-[#FE9BF3] px-4 py-3 text-sm font-semibold text-white shadow-sm transition-colors cursor-pointer",children:["Talk to ",n.u1]})]})})]},e.company_id)})}),0===M.length&&!G&&(0,l.jsx)("div",{className:"mt-12 mb-20 w-full flex flex-col items-center justify-center min-h-[60vh] px-4",children:(0,l.jsxs)("div",{className:"flex flex-col gap-8 justify-center items-stretch mx-auto w-full max-w-3xl md:flex-row md:gap-4 md:items-center",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center w-full text-center md:w-1/2",children:[(0,l.jsx)("div",{className:"flex justify-center mb-6 md:mb-8",children:(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"w-25 h-25 sm:w-20 sm:h-20 mx-auto bg-gradient-to-br from-[#E8E9FF] to-[#F8F7FC] rounded-full flex items-center justify-center shadow-lg",children:(0,l.jsx)("svg",{className:"w-20 h-20 sm:w-20 sm:h-20 text-[#6B61FF]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,l.jsx)("div",{className:"absolute -top-2 -right-2 w-16 h-16 bg-[#6B61FF] rounded-full opacity-20 blur-xl"}),(0,l.jsx)("div",{className:"absolute -bottom-2 -left-2 w-16 h-16 bg-[#FE9BF3] rounded-full opacity-20 blur-xl"})]})}),(0,l.jsx)("h2",{className:"text-xl font-bold text-[#2D3436] mb-4",children:"No Plans Found"}),(0,l.jsx)("p",{className:"text-base sm:text-lg text-[#636E72] mb-2 md:mb-6 leading-relaxed px-1",children:"We couldn't find any plans matching your current filters.\n                    Don't worry, we're here to help you find the perfect\n                    insurance plan!"})]}),(0,l.jsx)("div",{className:"w-full md:w-1/2",children:(0,l.jsx)(N.h0,{onStartChat:()=>{_.push("/new-term-insurance")}})})]})})]}),(0,l.jsxs)("div",{className:"hidden md:flex flex-col w-[390px] flex-shrink-0 gap-2",children:[(0,l.jsx)("div",{className:"sticky top-5",style:{height:"calc(80vh - 40px)",maxHeight:"calc(80vh - 40px)"},children:(0,l.jsx)("div",{className:"flex w-full h-full rounded-[24px] p-[1px]",style:{background:"linear-gradient(180deg, #5EE75C 0%, #6C5CE7 100%)",boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.08)"},children:(0,l.jsx)("div",{className:"flex bg-[#F8F7FC] w-full rounded-[24px] overflow-hidden relative flex-col",style:{height:"100%"},children:em?(0,l.jsx)("div",{className:"hidden md:block w-[380px]",children:(0,l.jsx)("div",{className:"flex w-full rounded-[24px] p-[1px]",children:(0,l.jsxs)("div",{className:"flex bg-[#F8F7FC] w-full rounded-[24px] p-4 flex-col items-center justify-center gap-3 pt-8",children:[(0,l.jsx)("img",{src:"/new-home/nina.svg",alt:"Care",className:"w-15 h-15"}),(0,l.jsx)("p",{className:"text-lg text-[#505F79] font-bold max-w-[300px] text-center",children:"Talk to Insurance Advisor"}),(0,l.jsxs)("p",{className:"text-sm text-black max-w-[300px] text-justify mb-1",children:["Ask anything about insurance — plans, prices, coverage, existing diseases, or comparisons."," ",(0,l.jsx)("strong",{children:"Your personal advisor is here to guide you, 24x7."})]}),(0,l.jsxs)("ul",{className:"text-sm text-black max-w-[300px] text-left space-y-2 mb-1 list-none",children:[(0,l.jsxs)("li",{className:"flex gap-2 items-start text-sm leading-relaxed",children:[(0,l.jsx)("span",{className:"mt-0.5 font-bold",children:"•"}),(0,l.jsx)("span",{children:"Which term (life) plan is best for my family?"})]}),(0,l.jsxs)("li",{className:"flex gap-2 items-start leading-relaxed",children:[(0,l.jsx)("span",{className:"mt-0.5 font-bold",children:"•"}),(0,l.jsx)("span",{children:"How much coverage do I really need?"})]}),(0,l.jsxs)("li",{className:"flex gap-2 items-start leading-relaxed",children:[(0,l.jsx)("span",{className:"mt-0.5 font-bold",children:"•"}),(0,l.jsx)("span",{children:"What is the age upto which to insure?"})]}),(0,l.jsxs)("li",{className:"flex gap-2 items-start leading-relaxed",children:[(0,l.jsx)("span",{className:"mt-0.5 font-bold",children:"•"}),(0,l.jsx)("span",{children:"Compare plans from top insurers"})]})]}),(0,l.jsx)("p",{className:"text-sm text-black max-w-[300px] text-justify",children:"Chat or talk — get clear, unbiased answers instantly."}),(0,l.jsx)("div",{className:"w-[50%] mx-auto mt-2 border-1 border-[#2D3436] rounded-xl cursor-pointer",children:(0,l.jsxs)("button",{onClick:()=>{(0,c.trackButtonClickedAskQuestionsAIAdvisor)("Chat Now","/term-insurance","plan_listing"),tO("I am looking to buy a term life insurance plan. Can you help me find the right term insurance?","",!0)},className:"px-4 w-full py-2 rounded-[10px] border-1 border-green-500 bg-green-500 text-white font-medium text-[#2D3436] transition-colors cursor-pointer flex items-center justify-center gap-2",children:[(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.25
15-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Chat Now"]})}),(0,l.jsx)("div",{className:"w-[50%] mx-auto border-1 border-[#2D3436] rounded-xl ",children:(0,l.jsxs)("button",{onClick:tR,className:"px-4 w-full py-2 rounded-[10px] font-medium text-[#2D3436] transition-colors cursor-pointer bg-white flex items-center justify-center gap-2",children:[(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),"Talk Now"]})})]})})}):(0,l.jsx)("div",{className:"flex overflow-hidden relative flex-col w-full h-full",style:{margin:"0 auto",position:"relative"},children:(0,l.jsx)("div",{ref:eE,className:"flex flex-col w-full h-full",style:{WebkitOverflowScrolling:"touch",scrollbarWidth:"thin",position:"relative"},children:(0,l.jsx)("div",{className:"flex flex-col h-full",style:{position:"relative",overflow:"hidden",transform:"scale(1)",transformOrigin:"top center"},children:(0,l.jsx)(A,{insurance_type:"term",showHeader:!0,hideSummary:!0,forceMobileView:!0,initialLeadId:en,scrollOffset:eN,initialPlanId:ep,initialPlanName:ef,initialMessage:e2,initialAgentMessage:e3,shouldStartCall:ej,onPlanIdProcessed:()=>{eh(null),eg(null),ek(!1)},onFilterUpdate:tP,onEditMembers:tw,onCompareChange:(e,t)=>
1{"add"===t?!Z.includes(e)&&Z.length<3&&ee([...Z,e]):"remove"===t&&ee(Z.filter(t=>t!==e))}},"call-interface-".concat(en||"default"))})})})})})}),!em&&(0,l.jsx)("div",{className:"hidden sticky justify-center items-center w-full md:flex",style:{top:"calc(80vh - 40px + 5px + 20px)",zIndex:10},onClick:()=>{(0,o.trackContinueWhatsAppClicked)("/term-insurance","plan_listing"),(0,c.trackButtonClickedContinueWhatsApp)("/term-insurance","plan_listing")},children:(0,l.jsxs)("a",{href:"https://api.whatsapp.com/send?phone=%20+919236097624&text=".concat(encodeURIComponent("I would like to continue the conversation on whatsapp. You have all my details. Please suggest.")),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 bg-[#25D366] text-white rounded-lg hover:bg-[#20BA5A] transition-colors cursor-pointer shadow-sm w-[250px] justify-center",children:[(0,l.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})}),(0,l.jsx)("span",{className:"text-sm font-medium",children:"Continue on WhatsApp"})]})})]})]})]})}),(0,l.jsx)(E,{selectedPlanIds:Z,companies:M,onRemove:e=>{let t=Z.filter(t=>t!==e);ee(t);try{localStorage.setItem("compare_plans_term",JSON.stringify(t))}catch(e){console.error("Error saving compare plans to localStorage:",e)}},onCompare:tz,onCancel:()=>{ee([]);try{localStorage.setItem("compare_plans_term",JSON.stringify([]))}catch(e){console.error("Error clearing compare plans from localStorage:",e)}},leadId:en}),ex&&(0,l.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"overflow-hidden relative w-full max-w-lg bg-white rounded-2xl shadow-2xl",children:[(0,l.jsx)("button",{onClick:()=>{e_(!1),ey(null),ew(null)},className:"flex absolute top-4 right-4 z-10 justify-center items-center w-8 h-8 rounded-full shadow-md transition-colors cursor-pointer bg-white/80 hover:bg-white",children:(0,l.jsx)("svg",{className:"w-5 h-5 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,l.jsxs)("div",{className:"relative h-64 bg-gradient-to-br from-[#6B61FF] via-[#8B7FFF] to-[#FE9BF3] overflow-hidden",children:[(0,l.jsx)("div",{className:"flex absolute inset-0 justify-center items-center",children:(0,l.jsx)("div",{className:"px-6 text-center",children:(0,l.jsx)("div",{className:"flex justify-center items-center mx-auto mb-4 w-24 h-24 rounded-full backdrop-blur-sm bg-white/20",children:(0,l.jsx)("svg",{className:"w-12 h-12 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})})})}),(0,l.jsx)("div",{className:"absolute top-0 right-0 -mt-16 -mr-16 w-32 h-32 rounded-full bg-white/10"}),(0,l.jsx)("div",{className:"absolute bottom-0 left-0 -mb-12 -ml-12 w-24 h-24 rounded-full bg-white/10"})]}),(0,l.jsxs)("div",{className:"p-6",children:[(0,l.jsx)("h2",{className:"text-2xl font-bold text-[#1E1E1E] mb-2 text-center",children:"How would you like to connect?"}),(0,l.jsx)("p",{className:"text-sm text-[#636E72] mb-6 text-center",children:"Choose your preferred way to talk with your personal insurance advisor"}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 mb-4",children:[(0,l.jsxs)("button",{onClick:()=>tV("chat"),className:"w-full px-6 py-4 rounded-xl bg-gradient-to-r from-green-500 to-green-600 text-white font-semibold text-base transition-all hover:shadow-lg hover:scale-[1.02] flex items-center justify-center gap-3  cursor-pointer",children:[(0,l.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.25
15-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Chat Now"]}),(0,l.jsxs)("button",{onClick:()=>tV("call"),className:"w-full px-6 py-4 rounded-xl bg-gradient-to-r from-[#6B61FF] to-[#FE9BF3] text-white font-semibold text-base transition-all hover:shadow-lg hover:scale-[1.02] flex items-center justify-center gap-3 cursor-pointer",children:[(0,l.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),"Talk Now"]})]})]})]})}),(0,l.jsxs)("div",{className:"flex fixed right-6 bottom-6 z-40 flex-col gap-3 lg:hidden",children:[Z.length>0&&(0,l.jsxs)("button",{onClick:tz,className:"flex relative justify-center items-center w-14 h-14 text-white bg-black rounded-full shadow-lg",children:[(0,l.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),(0,l.jsx)("span",{className:"flex absolute -top-1 -right-1 justify-center items-center w-5 h-5 text-xs text-white bg-red-500 rounded-full",children:Z.length})]}),$.length>0&&(0,l.jsxs)("button",{onClick:()=>{_.push("/cart")},className:"w-14 h-14 bg-[#6B61FF] text-white rounded-full shadow-lg flex items-center justify-center relative",children:[(0,l.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"})}),(0,l.jsx)("span",{className:"flex absolute -top-1 -right-1 justify-center items-center w-5 h-5 text-xs text-white bg-red-500 rounded-full",children:$.length})]})]}),eK&&(0,l.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"overflow-hidden relative w-full max-w-lg bg-white rounded-2xl shadow-2xl",children:[(0,l.jsx)("button",{onClick:()=>tW("no_thanks"),className:"flex absolute top-4 right-4 z-10 justify-center items-center w-8 h-8 rounded-full shadow-md transition-colors cursor-pointer bg-white/80 hover:bg-white",children:(0,l.jsx)("svg",{className:"w-5 h-5 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,l.jsxs)("div",{className:"relative h-64 bg-gradient-to-br from-[#E8E9FF] via-[#F8F7FC] to-[#FE9BF3]/30 overflow-hidden",children:[(0,l.jsx)("div",{className:"flex absolute inset-0 justify-center items-center",children:(0,l.jsx)("div",{className:"px-6 text-center",children:(0,l.jsxs)("div",{className:"relative mx-auto mb-4 w-32 h-32",children:[(0,l.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-[#6B61FF] to-[#FE9BF3] rounded-full flex items-center justify-center shadow-xl",children:(0,l.jsx)("svg",{className:"w-16 h-16 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,l.jsx)("div",{className:"absolute -top-2 -right-2 w-8 h-8 bg-[#6B61FF]/30 rounded-full"}),(0,l.jsx)("div",{className:"absolute -bottom-2 -left-2 w-6 h-6 bg-[#FE9BF3]/30 rounded-full"})]})})}),(0,l.jsx)("div",{className:"absolute top-0 right-0 w-40 h-40 bg-[#6B61FF]/10 rounded-full -mr-20 -mt-20"}),(0,l.jsx)("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-[#FE9BF3]/10 rounded-full -ml-16 -mb-16"})]}),(0,l.jsxs)("div",{className:"p-6",children:[(0,l.jsx)("h2",{className:"text-2xl font-bold text-[#1E1E1E] mb-2 text-center",children:"Do you have any questions?"}),(0,l.jsx)("p",{className:"text-sm text-[#636E72] mb-6 text-center",children:"Chat or talk to our personal insurance advisor for a quick answer to any question"}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 mb-4",children:[(0,l.jsxs)("button",{onClick:()=>tW("chat"),className:"w-full px-6 py-4 rounded-xl bg-gradient-to-r from-green-500 to-green-600 text-white font-semibold text-base transition-all hover:shadow-lg hover:scale-[1.02] flex items-center justify-center gap-3 cursor-pointer",children:[(0,l.jsx)("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z",clipRule:"evenodd"})}),"Chat Now"]}),(0,l.jsxs)("button",{onClick:()=>tW("talk"),className:"w-full px-6 py-4 rounded-xl bg-gradient-to-r from-[#6B61FF] to-[#FE9BF3] text-white font-semibold text-base transition-all hover:shadow-lg hover:scale-[1.02] flex items-center justify-center gap-3 cursor-pointer",children:[(0,l.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 
111.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),"Talk Now"]}),(0,l.jsx)("button",{onClick:()=>tW("no_thanks"),className:"px-6 py-3 w-full font-medium text-gray-700 rounded-xl border-2 border-gray-300 transition-all cursor-pointer hover:bg-gray-50 hover:border-gray-400",children:"No Thanks"})]})]})]})}),(0,l.jsx)(L,{}),tn&&"undefined"!=typeof document&&(0,k.createPortal)((0,l.jsx)("div",{className:"fixed inset-0 z-[99999] flex flex-col w-full h-full bg-[#F7F7F7] overflow-hidden",style:{isolation:"isolate",width:"100vw",height:"100dvh"},children:(0,l.jsx)("div",{className:"flex overflow-hidden flex-col flex-1 w-full min-h-0",children:(0,l.jsx)(A,{insurance_type:"term",showHeader:!0,hideSummary:!1,forceMobileView:!1,initialLeadId:en,initialPlanId:ep,initialPlanName:ef,initialMessage:e2,initialAgentMessage:e3,shouldStartCall:ej,onPlanIdProcessed:()=>{eh(null),eg(null),ek(!1)},onFilterUpdate:tP,onEditMembers:tw,onCompareChange:(e,t)=>{"add"===t?!Z.includes(e)&&Z.length<3&&ee([...Z,e]):"remove"===t&&ee(Z.filter(t=>t!==e))},onBackFromFullView:()=>ts(!1)})})}),document.body),e7&&tt&&(0,l.jsx)("div",{className:"fixed inset-0 z-[100000] flex items-center justify-center bg-black/50 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"term-post-payment-resume-title",children:(0,l.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl max-w-md w-full p-6 sm:p-8",children:[(0,l.jsx)("h2",{id:"term-post-payment-resume-title",className:"text-xl font-semibold text-[#1E1E1E] mb-2",children:"Continue your application?"}),(0,l.jsxs)("p",{className:"text-[#4A5568] text-sm mb-2",children:["You have a term application where payment was completed",tt.plan_name?" (".concat(tt.plan_name,")"):"",". You can continue with the remaining steps or stay on this page to compare plans."]}),(0,l.jsx)("p",{className:"text-[#636E72] text-xs mb-6",children:"If you start browsing other plans, you can return here anytime to resume the same application."}),(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)("button",{type:"button",onClick:tp,className:"w-full py-3 px-4 rounded-xl font-medium text-white bg-[#2563EB] hover:bg-[#1d4ed8] transition-colors cursor-pointer",children:"Continue application"}),(0,l.jsx)("button",{type:"button",onClick:th,className:"w-full py-3 px-4 rounded-xl font-medium text-[#1E1E1E] bg-[#F0F0F0] hover:bg-[#E5E5E5] transition-colors border border-[#DFE1E6] cursor-pointer",children:"Not now — stay on listing"})]})]})}),(0,l.jsx)(D,{isOpen:e8,onClose:()=>{e9(!1)},allowClose:!0,skipNavigation:!0,updateExistingLead:en&&!(0,s.zc)(en)&&(0,m.cG)()?{leadId:en,token:(0,m.cG)(),apiUrl:r.xR}:null,onSubmitSuccess:e=>{if(console.log("[TERM-INSURANCE] Lead form submitted successfully:",e),e.lead_id&&((0,s.x$)(e.lead_id),es(e.lead_id),localStorage.setItem("onboarding_lead_id",e.lead_id),localStorage.setItem("leadId",e.lead_id),(0,c.updateMixpanelUserIdentity)(e.lead_id)),(0,s.BC)("term"),tr(!0),sessionStorage.setItem("freshLeadCreated",Date.now().toString()),e9(!1),ti.current){ti.current=!1,eh(null),eg(null),tO("I am looking to buy a term life insurance plan. Can you help me find the right term insurance?"),y&&ts(!0);return}e.lead_id&&_.replace({pathname:_.pathname,query:{..._.query,lead_id:e.lead_id}})}})]})]})}}},e=>{var t=t=>e(e.s=t);e.O(0,[7043,4928,8659,421,4669,5064,8224,636,8792],()=>t(35332)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.