1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8075],{89691:function(t,e,n){"use strict";var a=n(9268);n(86006);var r=n(22397),s=n.n(r),c=n(45918),i=n(35391);let l=t=>{let{text:e,classes:n,red:r}=t;return(0,a.jsx)("div",{className:(0,i.m)(s().ribbon,"flex rounded-sm ".concat(r?"bg-[#F03556] after:bg-[#560014]":"bg-primary-main after:bg-primary-900"," h-6 px-spacing8 items-center after:block after:absolute after:w-1.25 after:h-1.25 after:-top-1.25 after:right-px"),null==n?void 0:n.ribbon),children:(0,a.jsx)(c.Z,{textVariant:"labelSmall",component:"p",text:e,className:(0,i.m)("capitalize font-semibold text-white",null==n?void 0:n.text)})})};e.Z=l},28075:function(t,e,n){"use strict";n.d(e,{Z:function(){return x}});var a=n(9268),r=n(86006),s=n(89691),c=n(56008),i=n(67149),l=n(97771),o=n(95506),u=n(52818);let d=t=>{let{sectionCode:e,testId:n=o.fX,slug:s="/",totalQuestions:d,totalTests:m=4,timeLimitMinutes:p=o.cg,redirectPath:x=o.HY,label:f="Start Test",className:g="bg-primary-600 text-white px-spacing16 py-spacing12 rounded-[4px]",categoryId:h}=t,y=(0,c.useRouter)(),{openForm:v,setSfo:b}=(0,i.vR)(),[S,w]=(0,r.useState)(!1),T=(0,r.useCallback)(()=>{let t="".concat(s,"?testId=").concat(n,"&showInstructions=true").concat(h?"&categoryId=".concat(h):"").concat(m?"&totalTests=".concat(m):"").concat(p!==o.cg?"&timeLimit=".concat(p):"");localStorage.setItem("pendingPracticeTestRedirect",t),b(!0),v(l.D.sfoForm)},[v,b,s,n,h,m,p]),I=(0,r.useCallback)(()=>{try{let t=localStorage.getItem("formData");if(!t)return"";let e=JSON.parse(t);return"string"==typeof(null==e?void 0:e.email)?e.email.trim():""}catch(t){return""}},[]),P=(0,r.useCallback)(()=>{{let t=new URLSearchParams;t.set("testId",n),t.set("showInstructions","true"),h&&t.set("categoryId",h),m&&t.set("totalTests",m.toString()),p!==o.cg&&t.set("timeLimit",p.toString()),y.push("".concat(s,"?").concat(t.toString()))}},[x,y,n,s,h,m,p]),j=(0,r.useCallback)(async()=>{if(setTimeout(()=>{(0,u.a)({event:"cta_click",data:{section:e,component_name:"ext_redirection",label:"Start Test",landing_url:"".concat(window.location.host).concat(s,"?testId=").concat(n,"&showInstructions=true").concat(h?"&categoryId=".concat(h):"").concat(m?"&totalTests=".concat(m):""),parent_entity:"practice_test_card"}})},0),S)return;let t=I();if(!t){T();return}try{w(!0),P()}catch(t){T()}finally{w(!1)}},[I,S,P,T]);return(0,a.jsx)("button",{className:g,onClick:j,disabled:S,"aria-busy":S,children:S?"Preparing...":f})};var m=n(34084);let p=t=>{let{isMobile:e,category:n,title:r,duration:c,questionCount:i,isPopular:l=!1,href:u="/",sectionCode:p,index:x=0,slug:f="/",testId:g=o.fX,timeLimitMinutes:h=o.cg,cardClassName:y="",categoryId:v,totalTests:b=4,categorySlug:S}=t,{getCTALabel:w,isLoading:T,getTestStatus:I}=(0,m.t4)(),P=w(g);I(g);let j=()=>{let t=S||u;if(t&&"/"!==t){let e=v?"".concat(t,"?categoryId=").concat(v):t;window.location.href=e}},N=t=>{t.stopPropagation()};return e?(0,a.jsxs)("div",{className:"relative bg-white border border-neutral-200 rounded-12 px-spacing16 py-spacing20 w-full flex flex-col gap-spacing16 cursor-pointer hover:shadow-md transition-shadow",onClick:j,children:[l&&(0,a.jsx)("span",{className:"absolute top-5 right-[-5px] z-10",children:(0,a.jsx)(s.Z,{text:"Popular",red:!0})}),(0,a.jsxs)("div",{className:"flex flex-col gap-spacing8",children:[(0,a.jsx)("p",{className:"text-greyscale2 text-sm font-bold leading-[22px] h-5 overflow-hidden",children:n}),(0,a.jsxs)("div",{className:"flex flex-col gap-spacing12",children:[(0,a.jsx)("h3",{className:"text-black md:text-sm xs:text-title3 font-bold leading-5 line-clamp-2 min-h-10",children:r}),(0,a.jsxs)("div",{className:"flex items-center gap-spacing20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-spacing6",children:[(0,a.jsx)("i",{className:"icon-clock text-home-green-main text-sm w-4 h-4 flex items-center justify-center"}),(0,a.jsxs)("span",{className:"text-greyscale2 text-xs font-normal leading-4",children:[c," mins"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-spacing4",children:[(0,a.jsx)("i",{className:"icon-book-open text-home-green-main text-sm w-4 h-4 flex items-center justify-center"}),(0,a.jsxs)("span",{className:"text-greyscale2 text-xs font-normal leading-4",children:[i," Questions"]})]})]})]})]}),(0,a.jsx)("div",{className:"border border-greyContentBody rounded h-12 w-full",onClick:N,children:(0,a.jsx)(d,{testId:g,totalQuestions:parseInt(i)||30,timeLimitMinutes:h,categoryId:v,totalTests:b,slug:f,label:T?(0,a.jsx)("span",{className:"animate-pulse",children:"Loading..."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:P}),(0,a.jsx)("i",{className:"icon-chevron-right text-greyContentBody text-lg"})]}),className:"w-full h-full flex items-center justify-center gap-1 bg-transparent transition-colors text-greyscale-1 text-sm font-semibold leading-5 border rounded"})})]}):(0,a.jsxs)("div",{className:"relative bg-white border border-neutral-200 rounded-12 px-spacing16 py-spacing20 w-[305px] flex flex-col gap-spacing16 cursor-pointer hover:shadow-md transition-shadow ".concat(y),onClick:j,children:[l&&(0,a.jsx)("span",{className:"absolute top-5 right-[-5px] z-10",children:(0,a.jsx)(s.Z,{text:"Popular",red:!0})}),(0,a.jsxs)("div",{className:"flex flex-col gap-spacing8",children:[(0,a.jsx)("p",{className:"text-greyscale2 text-sm font-bold leading-[22px] h-5 overflow-hidden",children:n}),(0,a.jsxs)("div",{className:"flex flex-col gap-spacing12",children:[(0,a.jsx)("div",{className:"flex items-center gap-spacing16",children:(0,a.jsx)("h3",{className:"text-black text-base font-bold leading-6 flex-1 line-clamp-2",children:r})}),(0,a.jsxs)("div",{className:"flex items-center gap-spacing20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-spacing6",children:[(0,a.jsx)("i",{className:"icon-clock text-home-green-main text-base w-4 h-4 flex items-center justify-center"}),(0,a.jsxs)("span",{className:"text-greyscale2 text-sm font-normal leading-[22px]",children:[c," mins"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-spacing6",children:[(0,a.jsx)("i",{className:"icon-book-open text-home-green-main text-lg w-[18px] h-[18px] flex items-center justify-center"}),(0,a.jsxs)("span",{className:"text-greyscale2 text-sm font-normal leading-[22px]",children:[i," Questions"]})]})]})]})]}),(0,a.jsx)("div",{className:"border border-greyContentBody rounded h-12 w-full",onClick:N,children:(0,a.jsx)(d,{testId:g,totalQuestions:parseInt(i)||30,timeLimitMinutes:h,categoryId:v,totalTests:b,label:T?(0,a.jsx)("span",{className:"animate-pulse",children:"Loading..."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:P}),(0,a.jsx)("i",{className:"icon-chevron-right text-greyContentBody text-xl"})]}),slug:f,className:"w-full h-full flex items-center justify-center gap-1 bg-transparent transition-colors text-greyscale-1 text-sm font-semibold leading-5 border rounded",sectionCode:p})})]})};var x=p},95506:function(t,e,n){"use strict";n.d(e,{HY:function(){return r},cg:function(){return s},fX:function(){return a}});let a="",r="/practice_tests",s=30},34084:function(t,e,n){"use strict";n.d(e,{mJ:function(){return l},t4:function(){return o}});var a=n(9268),r=n(86006),s=n(61561);let c=(0,r.createContext)(null),i=()=>{try{let t=localStorage.getItem("formData");if(!t)return"";let e=JSON.parse(t);return"string"==typeof(null==e?void 0:e.email)?e.email.trim().toLowerCase():""}catch(t){return""}},l=t=>{let{testIds:e,children:n}=t,[l,o]=(0,r.useState)(new Map),[u,d]=(0,r.useState)(!0),[m,p]=(0,r.useState)(!1),x=(0,r.useMemo)(()=>[...e].sort(),[e]);(0,r.useEffect)(()=>{let t=!1,e=async()=>{let e=i();if(!e||0===x.length){d(!1),p(!0);return}d(!0);try{let n=await (0,s.TX)(x,e);t||(o(n),p(!0))}catch(t){p(!0)}finally{t||d(!1)}};return e(),()=>{t=!0}},[JSON.stringify(x)]);let f=(0,r.useCallback)(t=>{var e;return null!==(e=l.get(t))&&void 0!==e?e:null},[l]),g=(0,r.useCallback)(t=>{let e=l.get(t);if(!e)return"Start Test";switch(e){case"IN_PROGRESS":case"PAUSED":return"Resume Test";case"COMPLETED":return"Restart Test";default:return"Start Test"}},[l]),h=(0,r.useMemo)(()=>({statusMap:l,isLoading:u,getTestStatus:f,getCTALabel:g}),[l,u,f,g]);return(0,a.jsx)(c.Provider,{value:h,children:n})},o=()=>{let t=(0,r.useContext)(c);return t||{statusMap:new Map,isLoading:!1,getTestStatus:()=>null,getCTALabel:()=>"Start Test"}}},61561:function(t,e,n){"use strict";n.d(e,{SB:function(){return L},TX:function(){return E},Uv:function(){return $},d_:function(){return C},lR:function(){return k},lT:function(){return A},rQ:function(){return N},t4:function(){return _}});var a=n(62805),r=n(38822),s=n(79580),c=n(23009),i=n(41299);function l(){let t=(0,a._)(["\n query LatestPracticeTestAttempt($testId: String!, $userEmail: String!) {\n latestPracticeTestAttempt(testId: $testId, userEmail: $userEmail) {\n id\n testId\n userEmail\n status\n elapsedSeconds\n totalTimeLimitSeconds\n currentQuestionIndex\n startedAt\n lastInteractedAt\n completedAt\n answers {\n questionId\n selectedOptionIndexes\n state\n fractionalScore\n timeSpentSeconds\n answeredAt\n }\n correctCount\n partiallyCorrectCount\n incorrectCount\n totalQuestions\n totalScore\n percentage\n }\n }\n"]);return l=function(){return t},t}function o(){let t=(0,a._)(["\n mutation StartPracticeTestAttempt($input: StartPracticeTestAttemptInput!) {\n startPracticeTestAttempt(input: $input) {\n id\n testId\n userEmail\n status\n elapsedSeconds\n totalTimeLimitSeconds\n totalQuestions\n currentQuestionIndex\n startedAt\n lastInteractedAt\n answers {\n questionId\n selectedOptionIndexes\n state\n fractionalScore\n timeSpentSeconds\n answeredAt\n }\n correctCount\n partiallyCorrectCount\n incorrectCount\n totalScore\n percentage\n }\n }\n"]);return o=function(){return t},t}function u(){let t=(0,a._)(["\n mutation UpdatePracticeTestAttemptProgress($input: UpdatePracticeTestProgressInput!) {\n updatePracticeTestAttemptProgress(input: $input) {\n id\n status\n elapsedSeconds\n totalTimeLimitSeconds\n currentQuestionIndex\n lastInteractedAt\n correctOptionIndexes\n selectedOptionIndexes\n explanation\n }\n }\n"]);return u=function(){return t},t}function d(){let t=(0,a._)(["\n mutation RecordPracticeTestAnswer($input: RecordPracticeTestAnswerInput!) {\n recordPracticeTestAnswer(input: $input) {\n id\n status\n elapsedSeconds\n totalTimeLimitSeconds\n currentQuestionIndex\n answers {\n questionId\n selectedOptionIndexes\n state\n fractionalScore\n timeSpentSeconds\n answeredAt\n }\n correctCount\n partiallyCorrectCount\n incorrectCount\n totalQuestions\n totalScore\n percentage\n lastInteractedAt\n }\n }\n"]);return d=function(){return t},t}function m(){let t=(0,a._)(["\n mutation PausePracticeTestAttempt($input: PausePracticeTestInput!) {\n pausePracticeTestAttempt(input: $input) {\n id\n status\n elapsedSeconds\n totalTimeLimitSeconds\n currentQuestionIndex\n lastInteractedAt\n }\n }\n"]);return m=function(){return t},t}function p(){let t=(0,a._)(["\n mutation ResumePracticeTestAttempt($input: ResumePracticeTestInput!) {\n resumePracticeTestAttempt(input: $input) {\n id\n status\n elapsedSeconds\n totalTimeLimitSeconds\n currentQuestionIndex\n lastInteractedAt\n }\n }\n"]);return p=function(){return t},t}function x(){let t=(0,a._)(["\n mutation CompletePracticeTestAttempt($input: CompletePracticeTestInput!) {\n completePracticeTestAttempt(input: $input) {\n id\n status\n elapsedSeconds\n totalTimeLimitSeconds\n completedAt\n currentQuestionIndex\n correctCount\n partiallyCorrectCount\n incorrectCount\n totalQuestions\n totalScore\n percentage\n }\n }\n"]);return x=function(){return t},t}function f(){let t=(0,a._)(["\n query BatchPracticeTestAttemptStatuses($testIds: [String!]!, $userEmail: String!) {\n batchPracticeTestAttemptStatuses(testIds: $testIds, userEmail: $userEmail) {\n testId\n status\n }\n }\n"]);return f=function(){return t},t}
1let g={headers:{"x-tenant":i.Vr||""}},h=(0,r.Ps)(l()),y=(0,r.Ps)(o()),v=(0,r.Ps)(u()),b=(0,r.Ps)(d()),S=(0,r.Ps)(m()),w=(0,r.Ps)(p()),T=(0,r.Ps)(x()),I=(0,r.Ps)(f()),P=()=>({context:g}),j=t=>{throw s.cA,t},N=async(t,e)=>{try{var n;let{data:a}=await c.Z.query({query:h,variables:{testId:t,userEmail:e},fetchPolicy:"no-cache",context:P().context});return null!==(n=null==a?void 0:a.latestPracticeTestAttempt)&&void 0!==n?n:null}catch(t){return j(t)}},A=async t=>{try{let{data:e}=await c.Z.mutate({mutation:y,variables:{input:t},context:P().context}),n=null==e?void 0:e.startPracticeTestAttempt;if(!n)throw Error("Failed to start practice test attempt");return n}catch(t){return j(t)}},C=async t=>{try{var e;let{data:n}=await c.Z.mutate({mutation:v,variables:{input:t},context:P().context});return null!==(e=null==n?void 0:n.updatePracticeTestAttemptProgress)&&void 0!==e?e:null}catch(t){return j(t)}},_=async t=>{try{var e;let{data:n}=await c.Z.mutate({mutation:b,variables:{input:t},context:P().context});return null!==(e=null==n?void 0:n.recordPracticeTestAnswer)&&void 0!==e?e:null}catch(t){return j(t)}},k=async t=>{try{var e;let{data:n}=await c.Z.mutate({mutation:S,variables:{input:t},context:P().context});return null!==(e=null==n?void 0:n.pausePracticeTestAttempt)&&void 0!==e?e:null}catch(t){return j(t)}},$=async t=>{try{var e;let{data:n}=await c.Z.mutate({mutation:w,variables:{input:t},context:P().context});return null!==(e=null==n?void 0:n.resumePracticeTestAttempt)&&void 0!==e?e:null}catch(t){return j(t)}},L=async t=>{try{var e;let{data:n}=await c.Z.mutate({mutation:T,variables:{input:t},context:P().context});return null!==(e=null==n?void 0:n.completePracticeTestAttempt)&&void 0!==e?e:null}catch(t){return j(t)}},E=async(t,e)=>{try{var n,a;let r=await c.Z.query({query:I,variables:{testIds:t,userEmail:e},fetchPolicy:"no-cache",context:P().context,errorPolicy:"all"});r.errors;let s=new Map,i=null===(n=r.data)||void 0===n?void 0:n.batchPracticeTestAttemptStatuses;if(i)for(let t of i)s.set(t.testId,null!==(a=t.status)&&void 0!==a?a:null);return s}catch(t){return new Map}}},22397:function(t){t.exports={ribbon:"TopRightFoldedRibbon_ribbon__dtJ7z"}}}]);
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.