1import{j as e,r as i}from"./react-vendor.B75MsAI9.js";import{u as a,s as t,a6 as n,S as l,L as s,Q as r,g as o,w as d,a as c,d4 as u,a4 as m,M as p,o as g,aQ as _,t as h,r as v,p as f,eL as y,hP as b,d_ as x,eN as j,i as $,cW as N,U as w,hQ as k,H as R,hR as S,eM as T,hS as F}from"./AuthModalContainer.D3JsQqnf.js";import{L as C,P}from"./main.DrmgIV4z.js";import{T as L}from"./TestimonialCard.Bv4OaCv7.js";import{R as I}from"./Rating.Bh-Nzh-g.js";import{T as q}from"./ThemeCard.BI3lWJnW.js";import O from"./BottomTabbedNavBar.juCVGsuy.js";import{O as A}from"./OfflineRedirect.B3MDyilY.js";import"./RTLProvider.Bmr48mpV.js";import"./LazyFontLoader.5DGfhuFK.js";import"./SiteNavLink.CgvBTSZT.js";const E=({variant:i="default",grades:m,completed:p,index:g,totalFluency:_,enrollmentId:h,enrollmentType:v,levelText:f,landingPageContent:y,language:b,isRtl:x,isCbse:j,isValidAffiliationNo:$,levelNumber:N,profile:w,goToFluencyTheme:k,getNextThemeSuggestion:R,getRPCertificate:S,addSlimNotification:T})=>{a();const F=t(),C="pb-fluency-component",P=[`${C}__grades`],L=[`${C}__link`],I=[`${C}__level`],q={[C]:!0,[`${C}--${i}`]:i,[`${C}__wrapper`]:0===g,[`${C}__wrapper--end`]:g===_-1,[`${C}__wrapper--middle`]:0!==g&&g!==_-1};"fr"===b?(I.push(`${C}__level--french`),P.push(`${C}__grades--french`)):"fa"===b?(I.push(`${C}__level--farsi`),P.push(`${C}__grades--farsi`)):"ar"===b?(I.push(`${C}__level--arabic`),P.push(`${C}__grades--arabic`)):"mr"===b&&(I.push(`${C}__level--marathi`),P.push(`${C}__grades--marathi`)),x&&L.push(`${C}__link--rtl`);const O=(e,i)=>{e.stopPropagation(),e.preventDefault(),i&&(null==S||S(i).then(e=>{(null==e?void 0:e.ok)?(window.open(e.url),null==T||T({type:"success",content:e.msg}),window.dataLayer&&window.dataLayer.push({event:c.certificateDownload,category:d.readingProgram,label:o.certificate,item_type:o.theme,item_value:n.fluenceArr[N-1],item_id:null,user_id:null==w?void 0:w.id,user_profile:null==w?void 0:w.profile_type})):null==T||T({type:"danger",content:(null==e?void 0:e.msg)||"Failed to download certificate"})}))},A=e.jsxs("div",{className:h?`${C}__progress-wrapper`:`${C}__progress-wrapper ${C}__progress-wrapper--hidden`,children:[e.jsx("progress",{className:`${C}__progress-bar`,value:String(p),max:"100"}),e.jsx("div",{className:`${C}__progress-percentage`,children:parseInt(p,10)+"%"})]}),E=j&&["teacher","librarian"].includes(null==v?void 0:v.toLowerCase())&&!$,H=p<n.downloadPercentage||E;let W,B,V;return W=p>=n.downloadPercentage?null==y?void 0:y.downloadCertificateText:null==y?void 0:y.completeCertificationText,B=e.jsxs("div",{role:"button",tabIndex:H?-1:0,onClick:e=>{H||O(e,h)},onKeyDown:e=>{H||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),O(e,h))},className:(H?`${C}__certificate--disable`:`${C}__certificate`)+" pb-link",style:{cursor:H?"not-allowed":"pointer"},"aria-disabled":H,children:[h?W:null==y?void 0:y.enrollCertText,h&&p>=n.downloadPercentage?e.jsx(l,{name:"download"}):null]}),V=e.jsx("div",{children:B}),E&&p>=n.downloadPercentage&&(V=e.jsx("div",{title:"School Affiliation Number is incorrect",children:B})),e.jsx(s,{parentClassName:L.join(" "),onClick:()=>{h?(null==k||k(N),null==R||R(h),window.dataLayer&&window.dataLayer.push({event:c.programContinueButton,category:`reading_programme_${b}`,label:o.topSection,item_type:o.theme,item_value:u[N-1],item_id:null,user_id:null==w?void 0:w.id,user_profile:null==w?void 0:w.profile_type})):(F(`/reading-programme/${N}?language=${b}`),window.dataLayer&&window.dataLayer.push({event:c.moduleSelected,category:`reading_programme_${b}`,label:o.topSection,item_type:o.theme,item_value:u[N-1],item_id:null,user_id:null==w?void 0:w.id,user_profile:null==w?void 0:w.profile_type}))},children:e.jsx("div",{className:r(q),children:e.jsxs("div",{className:`${C}__inner-wrapper`,children:[e.jsx("div",{className:I.join(" "),children:f}),e.jsx("div",{className:P.join(" "),children:m}),A,e.jsxs("div",{className:`${C}__explore-button`,children:[(()=>{let e;return e=h?100===p?null==y?void 0:y.readAgainText:0===p?null==y?void 0:y.startReading:null==y?void 0:y.continueWithTheme:null==y?void 0:y.exploreThemes,e})(),p!==n.downloadPercentage&&e.jsx(l,{name:x?"chevron-left":"chevron-right",size:"m",parentClassName:`${C}__circular-icon`,centerAlign:!0,circular:!0})]}),V]})})})};E.propTypes={levelText:m.string,grades:m.oneOfType([m.string,m.array]),completed:m.oneOfType([m.string,m.number]),variant:m.oneOf(["default","early","middle","advanced"]),index:m.number,totalFluency:m.number,enrollmentId:m.string,enrollmentType:m.string,landingPageContent:m.object,language:m.string,isRtl:m.bool,isCbse:m.bool,isValidAffiliationNo:m.bool,levelNumber:m.number,profile:m.object,goToFluencyTheme:m.func,getNextThemeSuggestion:m.func,getRPCertificate:m.func,addSlimNotification:m.func};const H=({title:i,image:a,description:t,variant:n="default",locale:l="en",isRtl:s=!1})=>{const r="pb-features-component",o=[r],d=[`${r}__description`],c=[`${r}__title`];return"hi"===l&&c.push(`${r}__title--hi`),"hi"===l&&d.push(`${r}__description--hi`),n&&o.push(`${r}--${n}`),s&&o.push(`${r}--rtl`),e.jsxs("div",{className:o.join(" "),children:[e.jsx(C,{offset:100,once:!0,children:e.jsx("div",{className:`${r}__image-container`,children:e.jsx("img",{src:a,alt:i,className:`${r}__image`})})}),e.jsxs("div",{className:`${r}__text-wrapper`,children:[e.jsx("div",{className:c.join(" "),children:i}),e.jsx("div",{className:d.join(" "),children:t})]})]})};H.propTypes={title:m.string,image:m.string,onClick:m.func,description:m.string,variant:m.oneOf(["default","reverse"]),locale:m.string,isRtl:m.bool};const W=({variant:i="default",featuresImages:a=[],features:t=[],locale:n="en",isRtl:l=!1})=>{const s="pb-features-bar";return e.jsx("div",{className:s,children:e.jsx("div",{className:`${s}__wrapper`,children:t.map((i,t)=>e.jsx(H,{title:i.title,image:a[t],description:i.description,variant:t%2==0?"reverse":"default",locale:n,isRtl:l},t))})})};W.propTypes={};const B=({isSubmittingRpSurveyFormFeedback:a,enrollmentType:t,language:n,profile:s,isRtl:r,onClose:u,postRpSurveyFormFeedbackWorkflow:m,addSlimNotification:h})=>{const[v,f]=i.useState(-1),[y,b]=i.useState(0),[x,j]=i.useState({}),[$,N]=i.useState(1),w="pb-rp-survey-form";let k="";return k="Parent"===t?[{question:"The Reading Programme helped my childâ¦",reasons:["Read more books","Improve reading skills","Expand vocabulary","Boost creativity"],multichoice:!0},{question:"How likely are you to recommend the Reading Programme to someone?",reasons:["Very Likely","Likely","Unsure","Unlikely","Very
1Unlikely"],multichoice:!1}]:"Student"===t?[{question:"What did you like about the Reading Programme?",reasons:["Interesting stories","Good themes","Images in the story","Interesting activities"],multichoice:!0}]:[{question:"What did you like about the Reading Programme?",reasons:["Engaging stories","Good themes","Grade appropriate content","Interesting activities"],multichoice:!0},{question:"The Reading Programme helped studentsâ¦",reasons:["Read more books","Learn new concepts","Increase vocabulary","Boost creativity ","Develop empathy"],multichoice:!0},{question:"How likely are you to recommend the Reading Programme to someone?",reasons:["Very Likely","Likely","Unsure","Unlikely","Very Unlikely"],multichoice:!1}],e.jsxs(p,{parentClassName:`${w}__modal-wrapper`,starRating:!0,noContentScroll:!0,isRtl:r,children:[1===$&&e.jsxs("div",{children:[e.jsx("h2",{className:`${w}__title`,children:"How was your experience with the Reading Programme?"}),e.jsx(I,{parentClassName:`${w}__rating`,onSelect:e=>{f(e),j({})},type:"normal",surveyForm:!0}),e.jsx("p",{className:`${w}__status`,children:["Not Great!","Okay!","Satisfied!","Very Good!","Excellent!"][v]}),e.jsx("div",{className:`${w}__submit-btn-wrapper`,children:e.jsx(g,{variant:"primary",fullWidth:!0,label:"Next",isRtl:r,parentClassName:`${w}__submit-btn`,disabled:-1===v,onClick:()=>{N(2),b(0),window.dataLayer.push({event:c.rated,category:d.rpSurvey,label:o.surveyForm,item_type:o.language,item_value:n,item_id:null,user_id:s.id,user_profile:s.profile_type})}})})]}),2===$?e.jsxs("div",{children:[e.jsxs("div",{className:`${w}__back-wrapper`,children:[e.jsx("span",{className:`${w}__icon`,onClick:()=>{return 0===(e=y)&&(N(1),f(-1)),void b(e-1);var e},children:e.jsx(l,{size:"m",name:"back",title:"Back"})}),e.jsxs("span",{children:[y+1," ","of"," ",k.length," ","questions"," "]}),e.jsx("span",{children:!0})]}),e.jsxs("div",{className:`${w}__reasons-wrapper`,children:[e.jsx("p",{className:`${w}__title`,children:k[y].question}),k[y].multichoice&&e.jsx("p",{children:"(More than one option can be selected)"}),e.jsx(_,{inline:!0,parentClassName:`${w}__reasons`,children:k[y].reasons.map(i=>{const a=[].concat.apply([],Object.values(x));return e.jsx(P,{label:i,onClick:()=>((e,i,a)=>{[].concat.apply([],Object.values(x)).includes(e)?j(a=>{const t={...a};return t[i]&&(t[i]=t[i].filter(i=>i!==e),0===t[i].length&&delete t[i]),t}):j(t=>{const n={...t};return Object.keys(n).includes(i)&&a?n[i]=[...n[i]||[],e]:n[i]=[e],n})})(i,k[y].question,k[y].multichoice),isSelected:a.includes(i),surveyForm:!0},i)})})]}),e.jsx("div",{className:`${w}__submit-btn-wrapper`,children:e.jsx(g,{variant:"primary",fullWidth:!0,label:y===k.length-1?"Submit":"Next",isRtl:r,disabled:!Object.keys(x).includes(k[y].question)||0===x[k[y].question].length,parentClassName:`${w}__submit-btn`,onClick:y===k.length-1?()=>{const e=Object.entries(x).map(e=>({reason:e[1],query_reason:e[0]}));m({rating:v+1,reasons:e}).then(e=>{u(),"ok"===e.status?(h({type:"success",content:"Form submitted successfully."}),window.dataLayer.push({event:c.formSubmit,category:d.rpSurvey,label:o.surveyForm,item_type:o.language,item_value:n,item_id:null,user_id:s.id,user_profile:s.profile_type})):h({type:"danger",content:e&&e.error})})}:()=>{return b((e=y)+1),void window.dataLayer.push({event:`answer_${e+1}_given`,category:d.rpSurvey,label:o.surveyForm,item_type:o.language,item_value:n,item_id:null,user_id:s.id,user_profile:s.profile_type});var e},loading:a})})]}):null]})};B.propTypes={isSubmittingRpSurveyFormFeedback:m.bool,enrollmentType:m.string,language:m.string.isRequired,profile:m.object.isRequired,isRtl:m.bool,onClose:m.func.isRequired,postRpSurveyFormFeedbackWorkflow:m.func.isRequired,addSlimNotification:m.func.isRequired};const V=()=>{const n=a(),l=h(),s=t(),[r]=v(),[o,d]=i.useState(!1),c=r.get("language")||"en",u=f(e=>e.allFluences),m=f(e=>e.user),p=f(e=>e.viewport),{isFetchingFluences:g,fluences:_,isFetchingLandginPageImages:C,landingPagesImages:P,isFetchingLandingPageContent:I,landingPageContent:H,userEnrolledFluency:V,showSurvey:U,nextThemeSuggestion:D,targetFluencyLevel:G,isSubmittingRpSurveyFormFeedback:M}=u,{isLoggedIn:Q,profile:z}=m;i.useEffect(()=>{l(y()),l(b()),l(x()),Q&&(null==z?void 0:z.id)&&l(j({id:z.id})),d(!0)},[l,Q,null==z?void 0:z.id]),i.useEffect(()=>{D&&Object.keys(D).length>0&&D.themeNumber&&0!==G&&s(`/reading-programme/${G}/theme/${D.themeNumber}?language=${c}`,{replace:!0})},[D,G,c,s]),i.useEffect(()=>{Q&&(null==z?void 0:z.id)&&l(j({id:z.id}))},[l,Q,null==z?void 0:z.id]);const K="pb-reading-program-landing-container",J=$(c),X=[K];return J&&X.push(`${K}--rtl`),e.jsxs("div",{className:X.join(" "),children:[e.jsxs("div",{className:`${K}__container-top`,children:[!I&&H&&H.bannerTitle&&e.jsxs("div",{className:`${K}__banner-wrapper`,children:[e.jsxs("div",{className:`${K}__text-wrapper`,children:[e.jsx("div",{className:`${K}__title`,children:H.bannerTitle}),e.jsxs("div",{className:`${K}__desc-wrapper`,children:[e.jsx("p",{children:H.bannerDescription}),p.medium&&e.jsx("ul",{children:H.bannerBulletPoints&&H.bannerBulletPoints.map((i,a)=>e.jsx("li",{children:i},a))})]})]}),e.jsx("img",{className:`${K}__rp-logo`,src:H.rpLogo,alt:"for header"}),e.jsx("img",{className:`${K}__banner-image-el`,src:p.medium?H.bannerDesktopImage:H.bannerMobileImage,alt:"for header"}),e.jsx(A,{offlinePageLink:`${N[1]}?language=${c}`,isRtl:J})]}),g?e.jsx(w,{}):e.jsx("div",{className:`${K}__fluency-wrapper`,children:_.map((i,a)=>{const t=(e=>{switch(e){case 1:default:return"default";case 2:return"early";case 3:return"middle";case 4:return"advanced"}})(i.level),s=V.find(e=>e.level===i.level);return e.jsx(E,{t:n,levelText:i.fluencyLevelText,grades:i.name,completed:s?s.fluenceProgress:0,isCbse:!!s&&s.is_CBSE,isGoaRp:!!s&&s.isGoaRp,variant:t,index:a,id:i.id,levelNumber:i.level,isLoggedIn:Q,totalFluency:_.length,enrolledFluency:V.length,enrollmentId:s?s.enrollment_id:null,enrollmentType:s?s.enrollment_type:null,getNextThemeSuggestion:e=>l(T({id:e})),nextThemeSuggestion:D,targetFluencyLevel:G,goToFluencyTheme:e=>l(S({targetFluencyLevel:e})),profile:z,language:c,landingPageContent:H,isRtl:J,addSlimNotification:e=>l(R(e)),isValidAffiliationNo:!!s&&s.isValidAffiliationNo,getEnrolledFluenciesFn:e=>l(j({id:e})),getRPCertificate:e=>l(k({id:e}))},i.id)})})]}),!I&&H&&H.keyHighlightsHeading&&e.jsxs("div",{className:`${K}__container-bottom`,children:[e.jsx("div",{className:`${K}__features-text`,children:H.keyHighlightsHeading}),e.jsx(W,{featuresImages:null==P?void 0:P.featureLinks,features:H.features,locale:c,isRtl:J}),e.jsx("div",{className:`${K}__features-text`,children:H.testimonialHeading}),e.jsx("div",{className:`${K}__testimonial-wrapper`,children:e.jsx(L,{images:p.medium?null==P?void 0:P.testimonialLinks:null==P?void 0:P.testimonialMobileLinks,sideImage:null==P?void 0:P.landingPageImage,viewport:p,testimonial:H.testimonial,isRtl:J})}),e.jsx("div",{className:`${K}__features-text`,children:H.browseSectionHeading}),e.jsx("div",{className:`${K}__fluency-card-wrapper`,children:_.map((i,a)=>{const t=V.find(e=>e.level===i.level),s=((e,i)=>i?e?100===e.fluenceProgress?i.readAgainText||"":0===e.fluenceProgress?i.startReading||"":i.continueWithTheme||"":i.exploreThemes||"":"")(t,H);return e.jsx(q,{t:n,variant:a%2!=0?"default":"reverse",image:p.medium?i.fluenceImage:i.fluenceMobileImage,details:i.body,title:i.levelName,description:i.name,button:s,href:`/reading-programme/${i.level}?language=${c}`,enrollmentId:t?t.enrollment_id:null,getNextThemeSuggestion:e=>l(T({id:e})),nextThemeSuggestion:D,levelNumber:i.level,goToFluencyTheme:e=>l(S({targetFluencyLevel:e})),profile:z,locale:c,isRtl:J},a)})})]}),p.medium?null:e.jsx(O,{user:z,viewport:p,t:n}),U&&o&&V&&V.length>0&&e.jsx(B,{postRpSurveyFormFeedbackWorkflow:e=>l(F({postRpSurveyFormFeedbackPayload:e})),addSlimNotification:e=>l(R(e)),isSubmittingRpSurveyFormFeedback:M,isRtl:J,viewport:p,enrollmentType:V[0].enrollment_type,onClose:()=>d(!1),language:c,profile:z})]})};export{V as default};
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.