PageSourceSearch

https://edbot.ai/_next/static/chunks/pages/play/core-concept-7359ce470635b5b5.js

js edbot.ai collected 2026-10-05 13:41:33 UTC 72,038 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8563,9422],{87177:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/play/core-concept",function(){return i(31961)}])},99422:function(e,t,i){"use strict";i.r(t);var r=i(85893);let n=e=>{var t;let{children:i,style:n,dataTestId:a,onClick:l,disabled:o,disableBoxShadow:d,courseRef:s,ariaLabel:c,...u}=e,p={...n,cursor:(null==n?void 0:n.cursor)?n.cursor:o?"not-allowed":l?"pointer":"default",borderRadius:null!==(t=null==n?void 0:n.borderRadius)&&void 0!==t?t:5,boxShadow:d?void 0:"0px 1px 2px rgba(0, 0, 0, 0.15)"},h=e=>{let t="Enter"===e.key||" "===e.key;l&&!o&&t&&(e.preventDefault(),l(e))};return(0,r.jsx)("div",{ref:s,onClick:o?void 0:l,onKeyDown:l?h:void 0,role:l?"button":void 0,tabIndex:l&&!o?0:void 0,"aria-disabled":!!l&&!!o||void 0,"data-testid":a,style:p,"aria-label":c,...u,children:i})};t.default=n},10894:function(e,t,i){"use strict";i.r(t);var r=i(85893),n=i(76354),a=i(97537),l=i(3174),o=i(26470),d=i.n(o),s=i(37268),c=i.n(s);t.default=function(e){let{number:t,padding:i}=e;return(0,r.jsx)(n.Z,{spacing:1,direction:"column",padding:i,sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:Array.from({length:t}).map((e,t)=>(0,r.jsx)(a.Z,{variant:"rounded",width:"100%",animation:"wave",style:{backgroundColor:d().grey},children:(0,r.jsx)(l.Z,{className:c().skeleton_card})},t))})}},96182:function(e,t,i){"use strict";var r=i(85893),n=i(43905),a=i(83744),l=i(42748),o=i(46946),d=i(69626),s=i(34308),c=i(30128),u=i(25675),p=i.n(u),h=i(41664),m=i.n(h);let g=e=>{let{useLargeScreenView:t,paragraph:i}=e,u=(0,o.Z)();return"html"===i.type?(0,r.jsx)(d.Z,{variant:"body2",component:"div",sx:{fontFamily:(0,l.LM)(i.content||"")?a.cn.style.fontFamily:u.typography.fontFamily,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden","& h1, & h2, & h3, & h4, & h5, & h6":{fontSize:t?"1.2rem":"1.1rem",lineHeight:1.6,margin:0},"& ul, & ol":{paddingLeft:4,paddingRight:4,marginTop:2},"& li":{marginBottom:1},"& table":{display:t?"table":"block",position:"relative",left:t?"50%":void 0,transform:t?"translateX(-50%)":void 0,overflowX:t?"visible":"auto"},"& table::-webkit-scrollbar":{height:8},"& table::-webkit-scrollbar-thumb":{backgroundColor:"#ccc",borderRadius:8},"& td":{padding:"6px"},"& th":{padding:"6px"},"& p":{marginBottom:"1em"},fontSize:t?"1.2rem":"1.1rem",lineHeight:1.6},dangerouslySetInnerHTML:{__html:i.content}}):"image"===i.type?(0,r.jsx)(s.Z,{sx:{textAlign:"center",my:2},children:(0,r.jsxs)(s.Z,{sx:{width:"80%",maxWidth:600,mx:"auto",position:"relative"},children:[(0,r.jsx)(p(),{unoptimized:!0,src:i.content,alt:"Image",width:0,height:0,sizes:"(max-width: 600px) 100vw, 600px",style:{width:"100%",height:"auto",borderRadius:8}}),(0,r.jsxs)(n.default,{sx:{wordBreak:"break-word",textAlign:"center"},children:[i.source_text," ",i.source&&(0,r.jsx)(m(),{href:i.source,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:2},children:(e=>{try{let t=new URL(e);return t.hostname}catch(t){return(0,c.Tb)(t),e}})(i.source)})]})]})}):(0,r.jsx)(r.Fragment,{})};t.Z=g},52269:function(e,t,i){"use strict";var r=i(85893),n=i(48644),a=i(63150),l=i(60173),o=i(43905),d=i(78749),s=i(69708),c=i(26725),u=i(66577),p=i(56601),h=i(78698),m=i(76354),g=i(34308),x=i(69626),v=i(11163),f=i(67294),y=i(96182);let b=e=>{let{activityId:t,index:i=0,subtitle:b,paragraph:j,useLargeScreenView:w,completed:C=!1,onSaveAnswer:_,markTaskAsCompleted:k,testOptions:Z}=e,{t:S}=(0,f.useContext)(a.d),{tCourse:L,getCourseLanguage:R}=(0,f.useContext)(n.a),[z,N]=(0,f.useState)((null==Z?void 0:Z.isExpanded)||!1),[I,A]=(0,f.useState)(C),[F,T]=(0,f.useState)((null==Z?void 0:Z.isClamped)||!1),[H,W]=(0,f.useState)(10),[E,P]=(0,f.useState)(!1),B=(0,f.useRef)(null),M=null==j?void 0:j.filter(e=>"html"===e.type).map(e=>e.content.replaceAll("<p>","<span>").replaceAll("</p>","</span>")).join(" "),G=(0,v.useRouter)(),{cid:q,chapter_id:D,task_id:V}=G.query,U=e=>{let i={Page_id:G.pathname.replace("/",""),Course_id:q,Chapter_id:D,Sub_chapter_id:V,Activity_id:t,Activity_name:"Bonus Activity"};(0,s.Hi)(e,i)},J=()=>{U(c.aG.adbBonusRead),A(!0),null==_||_(["true"]),null==k||k()},Q=()=>{U(z?c.aG.adbBonusSeeLess:c.aG.adbBonusSeeMore),N(!z)},K=(0,f.useCallback)(()=>B.current?B.current.scrollHeight:0,[]),O=(0,f.useCallback)(()=>
1{if(!B.current)return 0;let e=Number.parseFloat(getComputedStyle(B.current).lineHeight||"24");return 6*e+28},[]);(0,f.useEffect)(()=>{let e=()=>{if(!B.current||z){T(!1);return}let e=B.current;requestAnimationFrame(()=>{let t=getComputedStyle(e),i=Number.parseFloat(t.lineHeight||"24"),r=e.scrollHeight>6*i+28;T(r)})};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[z]),(0,f.useEffect)(()=>{if(!B.current||z){T(!1);return}let e=()=>{let e=K(),t=O();T(e>t)};e();let t=setTimeout(e,100);return()=>clearTimeout(t)},[M,z,K,O]);let[Y,X]=(0,f.useState)(!1);(0,f.useEffect)(()=>{let e=document.getElementById("bonus-activity-content");if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;X(t.isIntersecting)},{threshold:.1});return t.observe(e),()=>{t.disconnect()}},[]),(0,f.useEffect)(()=>{if(!Y||I||0===H)return;let e=setTimeout(()=>{W(e=>Math.max(e-1,0))},1e3);return()=>clearTimeout(e)},[Y,I,H]),(0,f.useEffect)(()=>{I&&(W(10),P(!1))},[I]);let $=(null==Z?void 0:Z.showToggleButton)||(F||z)&&K()>0,ee=null!=Z&&!!Z.forceEnableSubmitButton||0===H&&(!$||z);return(0,r.jsxs)(m.Z,{spacing:1.25,children:[b&&(0,r.jsx)(o.default,{"data-testid":"activity-bonus-subtitle-".concat(i+1),fontWeight:600,children:b}),(0,r.jsx)(g.Z,{id:"bonus-activity-content",children:F&&!z?(0,r.jsx)(x.Z,{component:"div",ref:B,sx:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:6,overflow:"hidden",textOverflow:"ellipsis",fontSize:w?"1.2rem":"1.1rem",lineHeight:1.6,"& p":{marginBottom:"1em"},"& ul, & ol":{paddingLeft:4,paddingRight:4,marginTop:2},"& li":{marginBottom:1}},dangerouslySetInnerHTML:{__html:M||""}}):(0,r.jsx)("div",{ref:B,children:null==j?void 0:j.map((e,t)=>(0,r.jsx)(y.Z,{paragraph:e,useLargeScreenView:w},t))})}),((null==Z?void 0:Z.showToggleButton)||(F||z)&&K()>0)&&(0,r.jsx)(g.Z,{display:"flex",justifyContent:"flex-end",children:(0,r.jsxs)(l.default,{datatestid:z?"see-less":"see-more",variant:"text",htmlColor:d.w.Primary500,onClick:Q,sx:{fontWeight:700,fontSize:14,padding:"4px 8px",borderRadius:"51px"},children:[z?R(Number(q))?L("readLess"):S("readLess"):R(Number(q))?L("readMore"):S("readMore"),z?(0,r.jsx)(h.Z,{sx:{color:d.w.Primary500}}):(0,r.jsx)(p.Z,{sx:{color:d.w.Primary500}})]})}),(0,r.jsxs)(m.Z,{spacing:.625,alignItems:"center",width:"100%",children:[!I&&(0,r.jsx)(o.default,{lineHeight:"2em",sx:{textAlign:"center"},children:R(Number(q))?L("adbHaveYouReadTheContent"):S("adbHaveYouReadTheContent")}),I?(0,r.jsxs)(m.Z,{"data-testid":"adb-activity-completed",direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(u.Z,{sx:{color:d.w.Green400}}),(0,r.jsx)(o.default,{fontWeight:700,fontSize:16,sx:{color:d.w.Green400},children:R(Number(q))?L("adbCompleted"):S("adbCompleted")})]}):(0,r.jsx)(l.default,{datatestid:ee?"activity-bonus-read-button":"activity-bonus-read-button-disable",variant:"contained",disabled:!ee,htmlColor:d.w.Green400,pill:!0,onClick:J,sx:{width:"100%",padding:"8px 35px"},children:R(Number(q))?L("adbIveReadThis"):S("adbIveReadThis")}),(0,r.jsxs)(m.Z,{direction:"row",spacing:1,alignItems:"center",children:[!I&&H>0&&(0,r.jsx)(o.default,{datatestid:"activity-bonus-warning",fontSize:14,lineHeight:"2em",sx:{color:"#B85E00",textAlign:"center"},children:R(Number(q))?L("adbWaitSomeSeconds"):S("adbWaitSomeSeconds")}),!I&&H>0&&(0,r.jsx)(o.default,{fontSize:14,lineHeight:"2em",sx:{color:E?d.w.Primary500:d.w.Grey4,textAlign:"center",fontStyle:"italic",marginBottom:1},datatestid:"activity-bonus-countdown",children:"(".concat(H,"s)")})]})]})]})};t.Z=b},31961:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return eK}});var r,n,a=i(85893),l=i(48644),o=i(63150),d=i(83744),s=i(78749),c=i(5152),u=i.n(c),p=i(3174),h=i(34308),m=i(76354),g=i(43905),x=i(78276),v=i(95372),f=i(71285),y=i(33268),b=i(32577);(r=n||(n={})).activity_knowledge_check="activity_knowledge_check",r.activity_bonus="activity_bonus",r.activity_input
1="activity_input",r.activity_input_multiple="activity_input_multiple",r.activity_upload="activity_upload";var j=i(72274);let w=e=>{let{size:t=24,variant:i,color:r,htmlColor:n,className:l,style:o,datatestid:d="CoinsAlternativeIcon2",ariahidden:s,arialabel:c}=e,u=(0,j.y)(r),p=n||("inherit"===u?"currentColor":u),h={fontSize:t,...o};return"outlined"===i?(0,a.jsxs)("svg",{"aria-hidden":s,"aria-label":c,width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",className:l,style:h,"data-testid":d,children:[(0,a.jsx)("path",{d:"M12 4C16.4181 4.00021 20 7.58185 20 12C20 14.9825 18.3669 17.5811 15.9512 18.9561C16.6168 17.789 17 16.4397 17 15C17 10.5817 13.4183 7 9 7C7.56093 7 6.21164 7.38179 5.04492 8.04688C6.42005 5.6322 9.01842 4.00014 12 4Z",stroke:p,strokeWidth:"1.5",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M16 0C20.4181 0.000167763 24 3.58183 24 8C24 10.7193 22.6422 13.1215 20.5723 14.5654L19.9121 15.0254C20.6024 13.8427 21 12.4682 21 11C21 6.58172 17.4183 3 13 3C11.5473 3 10.186 3.38864 9.01172 4.06543L9.30469 3.62012C10.7319 1.44231 13.1975 0.000104691 16 0Z",stroke:p,strokeWidth:"1.5",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M8 8C12.4183 8 16 11.5817 16 16C16 20.4183 12.4183 24 8 24C3.58172 24 0 20.4183 0 16C0 11.5817 3.58172 8 8 8ZM6.94238 14.5439L4.19531 14.7637L6.28809 16.5566L5.64844 19.2363L8 17.7998L10.3516 19.2363L9.71191 16.5566L11.8047 14.7637L9.05762 14.5439L8 12L6.94238 14.5439Z",stroke:p,strokeWidth:"1.5",strokeLinejoin:"round"})]}):(0,a.jsxs)("svg",{"aria-hidden":s,"aria-label":c,width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",className:l,style:h,"data-testid":d,children:[(0,a.jsx)("path",{d:"M12 4C16.4181 4.00021 20 7.58185 20 12C20 14.9825 18.3669 17.5811 15.9512 18.9561C16.6168 17.789 17 16.4397 17 15C17 10.5817 13.4183 7 9 7C7.56093 7 6.21164 7.38179 5.04492 8.04688C6.42005 5.6322 9.01842 4.00014 12 4Z",fill:p}),(0,a.jsx)("path",{d:"M16 0C20.4181 0.000167763 24 3.58183 24 8C24 10.7193 22.6422 13.1215 20.5723 14.5654L19.9121 15.0254C20.6024 13.8427 21 12.4682 21 11C21 6.58172 17.4183 3 13 3C11.5473 3 10.186 3.38864 9.01172 4.06543L9.30469 3.62012C10.7319 1.44231 13.1975 0.000104691 16 0Z",fill:p}),(0,a.jsx)("path",{d:"M8 8C12.4183 8 16 11.5817 16 16C16 20.4183 12.4183 24 8 24C3.58172 24 0 20.4183 0 16C0 11.5817 3.58172 8 8 8ZM6.94238 14.5439L4.19531 14.7637L6.28809 16.5566L5.64844 19.2363L8 17.7998L10.3516 19.2363L9.71191 16.5566L11.8047 14.7637L9.05762 14.5439L8 12L6.94238 14.5439Z",fill:p})]})};var C=i(42748);let _=e=>{let{headerStyle:t,useLargeScreenView:i,isCompleted:r,textTitle:l,reward:o,children:d,typeWrapper:c}=e;return(0,a.jsxs)(p.Z,{"data-testId":"adb-activity-card",style:{borderRadius:8,overflow:"hidden",backgroundColor:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[(0,a.jsxs)(h.Z,{"data-testid":"adb-activity-header",sx:t?{...t}:{backgroundColor:s.w.Primary500,color:"white",display:"flex",alignItems:"center",justifyContent:"space-between",p:2.2},children:[(0,a.jsxs)(m.Z,{"data-testid":"adb-activity-title",direction:"row",spacing:1,alignItems:"center",children:[c===n.activity_upload?(0,a.jsx)(y.Z,{htmlColor:"white","data-testid":"assignment-icon"}):c===n.activity_knowledge_check?(0,a.jsx)(x.PepBookIcon,{htmlColor:"white",datatestid:"pep-book-icon"}):c===n.activity_bonus?(0,a.jsx)(x.PepBookIcon,{htmlColor:"white",datatestid:"pep-book-icon"}):c===n.activity_input||c===n.activity_input_multiple?(0,a.jsx)(f.Z,{htmlColor:"white","data-testid":"lamp-icon"}):void 0,(0,a.jsx)(g.default,{variant:"inherit",style:{fontSize:"1.2em"},fontWeight:"bold",children:l})]}),r?(0,a.jsx)(v.Z,{htmlColor:s.w.Secondary400,"data-testid":"checklist-icon"}):o&&(0,a.jsxs)(h.Z,{"data-testid":"adb-activity-points",display:"flex",alignItems:"center",children:[(0,a.jsx)(w,{datatestid:"point-icon",style:{fontSize:i?26:24,color:s.w.Secondary400,marginRight:1}}),(0,a.jsxs)(g.default,{fontWeight:"bold",children:["+",(0,C.au)(o)]})]})]}),(0,a.jsxs)(h.Z,{p:2,children:[(0,a.jsx)(b.Z,{margin:8}),d]})]})};var k=i(46946),Z=i(5806),S=i(69626),L=i(67294),R=i(11163),z=i(6777),N=i(10894),I=i(90737),A=i(23875),F=i(25675),T=i.n(F),H=i(63183);let W=e=>{let{htmlString:t,useLargeScreenView:i,datatestid:r}=e,n=(0,k.Z)();return(0,a.jsx)(S.Z,{"data-testid":r,variant:"body2",component:"div",sx:{dis
1play:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",fontFamily:n.typography.fontFamily,"& h1, & h2, & h3, & h4, & h5, & h6":{fontSize:i?"1.2rem":"1.1rem",lineHeight:1.6,margin:0},"& ul":{paddingLeft:4,paddingRight:4,marginTop:2},"& ol":{paddingLeft:4,paddingRight:4,marginTop:2},"& li":{marginBottom:1},fontSize:i?"1.2rem":"1.1rem",lineHeight:1.6},dangerouslySetInnerHTML:{__html:t}})};var E=i(96182),P=i(60173),B=i(26725),M=i(71663),G=i(48296),q=i(70258),D=i(48524),V=i(69708),U=i(82018),J=i(62111),Q=function(e){var t,i;let{useLargeScreenView:r,testMode:n,testOptions:d,activityId:c,userAnswer:u,setDisabledNavigation:p,markTaskAsCompleted:v,isMandatory:f}=e,{t:y}=(0,L.useContext)(o.d),{tCourse:b,getCourseLanguage:j}=(0,L.useContext)(l.a),w=(0,R.useRouter)(),{cid:C,chapter_id:_,task_id:k}=w.query,{showSnackbar:Z}=(0,z.Ds)(),[S,N]=(0,L.useState)(null),[I,A]=(0,L.useState)((null!==(i=null==u?void 0:u.length)&&void 0!==i?i:0)>0),[F,T]=(0,L.useState)(!1),[W,E]=(0,L.useState)(u||[]),Q=u&&2===u.length,K=e=>"png"===e||"jpg"===e||"jpeg"===e||"gif"===e,[O,Y]=(0,L.useState)(S?K(S.name.split(".").pop()||""):K((null==u?void 0:null===(t=u[0])||void 0===t?void 0:t.split(".").pop())||"")),X=async e=>{if(c)try{ee(B.aG.adbSubmitActivity,{is_correct:!0}),null==p||p(!0);let i=new FormData;i.append("file",e),i.append("task_id",c);let r=await (0,H.aV)(i);if((null==r?void 0:r.bDone)===1){var t;let e=(null==r?void 0:null===(t=r.data)||void 0===t?void 0:t.user_file)||[];E(e),A(!0),null==v||v()}else Z(j(Number(C))?b("adbUploadFileError"):y("adbUploadFileError"),"error")}catch(e){Z(j(Number(C))?b("errorText"):y("errorText"),"error")}finally{T(!1),N(null),null==p||p(!1),J.Z.loadChapters(Number(J.Z.course_pref))}},$=e=>{var t;let i=n?new File([""],(null==d?void 0:d.fileName)||"test.png",{type:"image/png"}):null===(t=e.target.files)||void 0===t?void 0:t[0];if(i){T(!1);let e=i.name.split(".").pop();if(!B.Yu.includes((null==e?void 0:e.toLowerCase())||"")){N(null),Z(j(Number(C))?b("adbFileTypeError"):y("adbFileTypeError"),"error");return}let t=(null==d?void 0:d.fileSize)||Math.round(i.size/1024);if(t>B.c8){N(null),Z(j(Number(C))?b("adbFileSizeError"):y("adbFileSizeError"),"error");return}N(i),Y(K(e||""))}},ee=(e,t)=>{let i={Page_id:w.pathname.replace("/",""),Course_id:C,Chapter_id:_,Sub_chapter_id:k,Activity_id:c,Activity_name:"Upload Activity",is_correct:!0,...t};(0,V.Hi)(e,i)};return(0,L.useEffect)(()=>{E(u||[])},[u]),(0,a.jsxs)(m.Z,{spacing:2,"data-testid":"adb-upload",children:[(0,a.jsxs)(h.Z,{"data-testid":Q?"activity-upload-file":F?"activity-upload-file-loading":"adb-upload-box",sx:{border:Q?"2px solid ".concat(s.w.Primary100):"2px dashed ".concat(s.w.Primary100),borderRadius:4,padding:2,display:"flex",alignItems:"center",justifyContent:"center",height:r?250:200,width:"100%",bgcolor:"white",overflow:"hidden"},children:[(0,a.jsx)("input",{type:"file",id:"file","data-testid":"file",accept:B.Yu.join(","),name:"file",style:{display:"none"},onChange:e=>{var t;let i=null===(t=e.target.files)||void 0===t?void 0:t[0];if(i){let t=Math.round(i.size/1024);if(t>B.c8){Z(j(Number(C))?b("adbFileSizeError"):y("adbFileSizeError"),"error"),e.target.value="";return}}$(e),e.target.value=""}}),(0,a.jsx)(m.Z,{alignItems:"center",justifyContent:"center",spacing:2,sx:{width:"100%",height:"100%"},onClick:()=>{if(!F&&!S&&!(W&&2===W.length)){var e;ee(B.aG.adbUploadActivity),null===(e=document.getElementById("file"))||void 0===e||e.click()}},children:F?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.Z,{thickness:4,size:r?60:52,sx:{color:"#E6BB16",animationDuration:"800ms","& .MuiCircularProgress-circle":{strokeLinecap:"round",stroke:"#FFD946",opacity:.9},"& .MuiCircularProgress-circleDeterminate":{strokeOpacity:1}}}),(0,a.jsx)(g.default,{style:{color:s.w.Black,fontWeight:600,fontSize:18},children:j(Number(C))?b("loadingUpload"):y("loadingUpload")})]}):S?(0,a.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"center",gap:1,sx:{width:"100%",height:"100%",position:"relative"},children:[O?(0,a.jsx)(U.Z,{sx:{color:s.w.Primary600,fontSize:64}}):(0,a.jsx)(G.Z,{sx:{fontSize:64,color:s.w.Primary500}}),(0,a.jsx)(g.default,{style:{color:s.w.Primary500,wordBreak:"break-word",textAlign:"center"},children:S.name}),(0,a.jsx)(P.default,{datatestid:"activity-upload-file-close",onClick:()=>
1{if(N(null),T(!1),ee(B.aG.adbRemoveFileActivity),u&&(null==u?void 0:u.length)>0){var e;Y(K((null==u?void 0:null===(e=u[0])||void 0===e?void 0:e.split(".").pop())||""))}},sx:{position:"absolute",top:8,right:8,minWidth:"auto",padding:0},children:(0,a.jsx)(q.Z,{fontSize:r?"large":"medium",htmlColor:s.w.Red400})})]}):W&&2===W.length?(0,a.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"center",gap:1,sx:{width:"100%",height:"100%",position:"relative"},children:[O?(0,a.jsx)(U.Z,{sx:{color:s.w.Primary600,fontSize:64}}):(0,a.jsx)(G.Z,{sx:{fontSize:64,color:s.w.Primary500}}),(0,a.jsx)(g.default,{onClick:()=>{window.open(W[1],"_blank")},style:{color:s.w.Primary500,wordBreak:"break-word",textAlign:"center"},children:W[0]}),(0,a.jsx)(P.default,{datatestid:"activity-upload-file-edit",onClick:()=>{var e;ee(B.aG.adbEditUploadActivity),null===(e=document.getElementById("file"))||void 0===e||e.click()},sx:{position:"absolute",top:8,right:8,minWidth:"auto",padding:0},children:(0,a.jsx)(D.Z,{fontSize:r?"large":"medium",htmlColor:s.w.Primary500})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.UploadIcon,{size:r?48:32,variant:"outlined",htmlColor:s.w.Primary600}),(0,a.jsxs)(g.default,{children:[(0,a.jsx)("span",{style:{color:s.w.Primary500,cursor:"pointer"},children:j(Number(C))?b("adbClickHereFile"):y("adbClickHereFile")})," ",j(Number(C))?b("adbClickHereFile2"):y("adbClickHereFile2")]}),(0,a.jsx)(g.default,{style:{color:s.w.Accent200},children:j(Number(C))?b("maximumFileSize"):y("maximumFileSize")})]})})]}),!F&&!S&&(null==u?void 0:u.length)===0&&!I&&!!f&&(0,a.jsx)(g.default,{datatestid:"activity-upload-warning",fontSize:14,style:{marginTop:2,color:"#B85E00",display:"flex",justifyContent:"end"},children:j(Number(C))?b("adbUploadThisFieldIsRequired"):y("adbUploadThisFieldIsRequired")}),S&&(0,a.jsx)(P.default,{disabled:F,datatestid:F?"submit-button-disable":"submit-button",variant:"contained",style:{borderRadius:"18px",width:"100%",backgroundColor:F?s.w.Grey2:s.w.Green400},onClick:()=>{T(!0),X(S)},children:(0,a.jsx)(g.default,{children:j(Number(C))?b("submit"):y("submit")})})]})},K=i(52269),O=i(99422),Y=i(98002),X=i(11340),$=i(87454);let ee=e=>{let{activityId:t,options:i,correctAnswer:r,userAnswer:n,completed:d=!1,onSaveAnswer:c,markTaskAsCompleted:u,loadingSubmit:p,isMandatory:v}=e,{t:f}=(0,L.useContext)(o.d),{tCourse:y,getCourseLanguage:b}=(0,L.useContext)(l.a),j=(0,Y.$V)("md"),[w,_]=(0,L.useState)(n&&(null==n?void 0:n.length)>0||d),[k,Z]=(0,L.useState)(n||null),[S,z]=(0,L.useState)(!!d||null),[N,I]=(0,L.use
1State)(null),A=(0,R.useRouter)(),{cid:F,chapter_id:T,task_id:H}=A.query,W=(0,L.useMemo)(()=>(0,C.Sy)(i),[i]),E=e=>{w&&S||(w&&!S&&(_(!1),z(null)),Z(e))},G=()=>{if(!k||w&&S)return;let e=k===(0,C.D$)(r);z(e),_(!0),q(B.aG.adbSubmitActivity,{is_correct:e}),c&&c([k]),u&&e&&u()},q=(e,i)=>{let r={Page_id:A.pathname.replace("/",""),Course_id:F,Chapter_id:T,Sub_chapter_id:H,Activity_id:t,Activity_name:"Knowledge Activity",is_correct:S,...i};(0,V.Hi)(e,r)};return(0,L.useEffect)(()=>{let e=k===(0,C.D$)(r);z(e)},[n]),(0,a.jsxs)(m.Z,{mt:2,children:[(0,a.jsxs)(m.Z,{spacing:1.25,children:[(0,a.jsx)(m.Z,{spacing:1,"data-testid":"activity-knowledge-option",children:W.map(e=>{let t=k===e,i=!!(w&&S),r=w&&!S&&t;return(0,a.jsxs)(O.default,{role:"button",dataTestId:w&&S&&t?"activity-knowledge-option-correct":r?"activity-knowledge-result-incorrect":"activity-knowledge-option-".concat(e),disableBoxShadow:!0,onClick:()=>E(e),disabled:i,style:{border:"0.3px solid ".concat(s.w.Grey2),borderRadius:12,padding:"5px 10px",fontWeight:500,fontSize:14,display:"flex",alignItems:"center",justifyContent:"flex-start",minHeight:50,marginBottom:10,backgroundColor:w&&S&&t?s.w.Green100:r?s.w.Red100:"inherit",cursor:i?"not-allowed":"pointer",color:i&&!t?s.w.Grey2:void 0},onMouseEnter:i?void 0:()=>I(e),onMouseLeave:i?void 0:()=>I(null),children:[(0,a.jsx)(h.Z,{mr:1.5,display:"flex",alignItems:"center",children:w&&S&&t?(0,a.jsx)(x.CheckInCircleIcon,{size:28,htmlColor:s.w.Green400}):r?(0,a.jsx)(x.CrossInCircleIcon,{size:28,htmlColor:s.w.Red400}):w&&S?(0,a.jsx)($.Z,{sx:{fontSize:28},htmlColor:s.w.Grey2}):w&&t?(0,a.jsx)(X.Z,{sx:{fontSize:28},htmlColor:s.w.Red400}):w&&!S?(0,a.jsx)($.Z,{sx:{fontSize:28},htmlColor:s.w.Primary500}):t||N===e&&!i?(0,a.jsx)(X.Z,{sx:{fontSize:28},htmlColor:s.w.Primary500}):(0,a.jsx)($.Z,{sx:{fontSize:28},htmlColor:s.w.Primary500})}),(0,a.jsx)(g.default,{sx:{fontSize:j?"1.2rem":"1.1rem",lineHeight:1.6},children:(0,a.jsx)("span",{style:{color:i&&!t?s.w.Grey2:void 0},children:e})})]},e)})}),(0,a.jsx)(h.Z,{display:"flex",justifyContent:"flex-end",mt:1,children:w&&!S?p?(0,a.jsx)(M.Z,{size:16,sx:{color:"inherit"}}):(0,a.jsxs)(h.Z,{display:"flex",alignItems:"center",width:"100%",justifyContent:"flex-end",mt:1,children:[(0,a.jsx)(x.CrossInCircleIcon,{size:20,htmlColor:s.w.Red400,style:{marginRight:8}}),(0,a.jsx)(g.default,{datatestid:"activity-knowledge-try-again",fontSize:15,fontWeight:700,sx:{color:s.w.Red400},children:b(Number(F))?y("tryAgain"):f("tryAgain")})]}):k&&!(w&&S)&&(0,a.jsx)(P.default,{datatestid:w&&S||p?"submit-button-disable":"submit-button",variant:"contained",htmlColor:s.w.Green400,fullWidth:!0,pill:!0,disabled:!!(w&&S)||p,onClick:G,sx:{minWidth:120,fontWeight:700,fontSize:15,borderRadius:"51px",padding:"8px 35px"},children:b(Number(F))?y("submit"):f("submit")})})]}),!k&&!!v&&(0,a.jsx)(g.default,{datatestid:"activity-knowledge-warning",fontSize:14,lineHeight:"2em",sx:{color:"#B85E00",textAlign:"right"},children:b(Number(F))?y("adbKnowledgeThisFieldIsRequired"):f("adbKnowledgeThisFieldIsRequired")})]})};var et=i(58216),ei=i(11468),er=i(16051),en=i(59583);let ea=e=>{var t;let{activityId:i,isMultiple:r,index:n=0,userAnswer:d,completed:c=!1,onSaveAnswer:u,loadingSubmit:p,isMandatory:x}=e,{t:v}=(0,L.useContext)(o.d),{tCourse:f,getCourseLanguage:y}=(0,L.useContext)(l.a),[b,j]=(0,L.useState)(""),[w,C]=(0,L.useState)(""),[_,k]=(0,L.useState)(c),Z=r?"essay":"reflection",S=(0,L.useRef)(""),z=(0,R.useRouter)(),{cid:N,chapter_id:I,task_id:A}=z.query,F=(e,t)=>{let n={Page_id:z.pathname.replace("/",""),Course_id:N,Chapter_id:I,Sub_chapter_id:A,Activity_id:i,Activity_name:r?"Essay Activity":"Reflection Activity",...t};(0,V.Hi)(e,n)},T=async()=>{if((null==b?void 0:b.trim())===""){C(y(Number(N))?f("adbReflectionFieldRequiredReflection"):v("adbReflectionFieldRequiredReflection"));return}if((0,ei.U)(b)){C(y(Number(N))?f("adbReflectionInputNotValid"):v("adbReflectionInputNotValid"));return}let e=await (0,et.SA)(b);if((null==e?void 0:e.iMessageCode)===1){C(y(Number(N))?f("badWordPost"):v("badWordPost"));return}k(!0),null==u||u([b]),F(B.aG.adbSubmitActivity,{is_correct:!0}
1),J.Z.loadChapters(Number(J.Z.course_pref))},H=e=>{var t;let i=null!==(t=S.current)&&void 0!==t?t:"",r=e.length-i.length>1;if(r){j(i);return}S.current=e,j(e),C("")},W=e=>{if((e.ctrlKey||e.metaKey)&&"v"===e.key||e.shiftKey&&"Insert"===e.key){e.preventDefault();return}},E=e=>{let t=e.target;if(t&&t.value!==b){var i;let e=null!==(i=S.current)&&void 0!==i?i:"";t.value.length>e.length+1&&(j(e),t.value=e)}};return(0,L.useEffect)(()=>{j(d),S.current=d},[d]),(0,L.useEffect)(()=>{k(c)},[c]),(0,a.jsx)(m.Z,{children:(0,a.jsxs)(h.Z,{mt:1.25,children:[(0,a.jsx)(er.Z,{"data-testid":r?_?"activity-".concat(Z,"-answer-step-").concat(n+1):"activity-".concat(Z,"-text-box-step-").concat(n+1):_?"activity-".concat(Z,"-answer"):"activity-".concat(Z,"-text-box"),fullWidth:!0,multiline:!0,rows:6,placeholder:y(Number(N))?f("type_answer"):v("type_answer"),value:b,onPaste:e=>e.preventDefault(),onCopy:e=>e.preventDefault(),onCut:e=>e.preventDefault(),onContextMenu:e=>e.preventDefault(),onKeyDown:W,onKeyUp:E,onChange:e=>H(e.target.value),sx:{["& .".concat(en.Z.root)]:{borderRadius:4,border:_?"none":"1px solid "+s.w.Primary200,fontSize:{xs:15,md:16},bgcolor:_?s.w.Primary100:"white"},["& .".concat(en.Z.input)]:{WebkitTextFillColor:s.w.Black+" !important",border:"none"}},disabled:_}),(void 0===b||(null==b?void 0:b.trim())==="")&&x?(0,a.jsx)(h.Z,{sx:{mt:{xs:.5,md:2},bgcolor:"white",justifyContent:"end",display:"flex"},children:(0,a.jsx)(g.default,{fontSize:14,datatestid:"activity-".concat(Z,"-warning"),variant:"caption",sx:{color:s.w.Red500,textAlign:"end"},children:y(Number(N))?f("adbReflectionFieldRequiredReflection"):v("adbReflectionFieldRequiredReflection")})}):(0,a.jsx)(a.Fragment,{}),(0,a.jsxs)(m.Z,{alignItems:"end",sx:{display:(null==b?void 0:b.trim())===""||void 0===b?"none":"flex"},children:[w?(0,a.jsx)(h.Z,{sx:{mt:{xs:.5,md:2},bgcolor:"white"},children:(0,a.jsx)(g.default,{fontSize:14,datatestid:w===y(Number(N))?f("badWordPost"):v("badWordPost")?"chat-warning":"activity-reflection-warning",variant:"caption",sx:{color:s.w.Red500,textAlign:"end"},children:w})}):(0,a.jsx)(a.Fragment,{}),_?(0,a.jsx)(P.default,{datatestid:"edit-button",variant:"outlined",htmlColor:s.w.Primary500,pill:!0,onClick:()=>{F(B.aG.adbEditActivity),k(!1)},sx:{width:"100%",mt:{xs:2,md:2.5}},children:p?(0,a.jsx)(M.Z,{size:16,sx:{color:"inherit"}}):y(Number(N))?f("edit"):v("edit")}):(0,a.jsxs)(m.Z,{sx:{width:"100%"},children:[!r&&(0,a.jsx)(g.default,{fontSize:14,style:{marginTop:8,alignSelf:"flex-end",color:s.w.Red500},children:y(Number(N))?f("adbReflectionMinimumCharacter"):v("adbReflectionMinimumCharacter")}),(0,a.jsx)(P.default,{datatestid:w||p?"submit-button-disable":"submit-button",disabled:!!w||p||!r&&(null===(t=null==b?void 0:b.trim())||void 0===t?void 0:t.length)<50,variant:"contained",htmlColor:s.w.Green400,pill:!0,onClick:T,sx:{width:"100%",mt:{xs:2,md:2.5}},children:y(Number(N))?f("submit"):v("submit")})]})]})]})})},el=e=>{let{useLargeScreenView:t,completed:i,kind:r,parentContent:d,content:s,activityId:c,setDisabledNavigation:u,markParentAsCompleted:p,isMandatory:x}=e,v=(0,R.useRouter)(),f=v.query.cid,y=Number(f),{t:j}=(0,L.useContext)(o.d),{tCourse:w,getCourseLanguage:C}=(0,L.useContext)(l.a),[_,k]=(0,L.useState)(!1),{showSnackbar:Z}=(0,z.Ds)(),[S,N]=(0,L.useState)(i||!1),I=(()=>{switch(r){case n.activity_input:return"activity-reflection-description";case n.activity_input_multiple:return"activity-essay-description";case n.activity_knowledge_check:return"activity-knowledge-description";case n.activity_upload:return"activity-upload-description";case n.activity_bonus:return"activity-bonus-description";default:return"activity-description"}})(),A=(e,t)=>{let i=e;if(r===n.activity_input_multiple&&void 0!==t){let r=[];null==s||s.forEach((i,n)=>{var a;let l=t===n?e[0]:(null===(a=i.user_answer)||void 0===a?void 0:a[n])||"";r.push(l)}),i=r,s&&s[t]&&s[t].user_answer&&(s[t].user_answer[t]=e[0]);let n=i.every(e=>""!==e&&void 0!==e);return n&&(null==p||p()),i}return e},F=async(e,t)=>{if(c){k(!0),null==u||u(!0);try{let i=e;r===n.activity_input_multiple&&(i=A(e,t)),await (0,H.q8)({task_id:Number(c),user_answer:i}),r===n.activity_input&&(null==p||p())}catch(e){Z(C(y)?w("errorText"):j("errorText"),"error")}
1finally{k(!1),null==u||u(!1),J.Z.loadChapters(Number(J.Z.course_pref))}}},T=(0,L.useCallback)((e,i)=>{var l,o,d,s,v,f,y,j;switch(r){case n.activity_upload:return(0,a.jsxs)(m.Z,{children:[(null==e?void 0:e.subtitle)&&(0,a.jsx)(g.default,{datatestid:"activity-upload-subtitle-".concat(i+1),fontWeight:600,children:e.subtitle}),(0,a.jsx)(h.Z,{"data-testid":"activity-upload-content",children:null==e?void 0:null===(l=e.paragraph)||void 0===l?void 0:l.map((e,i)=>(0,a.jsx)(E.Z,{paragraph:e,useLargeScreenView:t},i+"_paragraph"))}),(0,a.jsx)(Q,{useLargeScreenView:t,userAnswer:e.user_answer,activityId:c,setDisabledNavigation:u,markTaskAsCompleted:p,isMandatory:x})]});case n.activity_knowledge_check:return(0,a.jsxs)(m.Z,{children:[(null==e?void 0:e.subtitle)&&(0,a.jsx)(g.default,{datatestid:"activity-knowledge-subtitle-".concat(i+1),fontWeight:600,children:e.subtitle}),(0,a.jsx)(h.Z,{"data-testid":"activity-knowledge-content",children:null==e?void 0:null===(o=e.paragraph)||void 0===o?void 0:o.map((e,i)=>(0,a.jsx)(E.Z,{paragraph:e,useLargeScreenView:t},i+"_paragraph"))}),(0,a.jsx)(ee,{activityId:c,correctAnswer:e.correct_answer[0],userAnswer:(null===(d=e.user_answer)||void 0===d?void 0:d.length)>0?e.user_answer[0]:"",options:e.options,markTaskAsCompleted:p,completed:S,onSaveAnswer:F,loadingSubmit:_,isMandatory:x})]});case n.activity_input:return(0,a.jsxs)(m.Z,{children:[(null==e?void 0:e.subtitle)&&(0,a.jsx)(g.default,{datatestid:"activity-reflection-subtitle-".concat(i+1),fontWeight:600,variant:"h6",mt:2,children:e.subt
1itle}),(0,a.jsx)(h.Z,{"data-testid":"activity-reflection-content",children:null==e?void 0:null===(s=e.paragraph)||void 0===s?void 0:s.map((e,i)=>(0,a.jsx)(E.Z,{paragraph:e,useLargeScreenView:t},i+"_paragraph"))}),(0,a.jsx)(ea,{activityId:c,userAnswer:e.user_answer[0],completed:S||(null===(v=e.user_answer)||void 0===v?void 0:v.length)>0,onSaveAnswer:F,loadingSubmit:_,isMandatory:x})]});case n.activity_input_multiple:return(0,a.jsxs)(m.Z,{children:[(null==e?void 0:e.subtitle)&&(0,a.jsx)(g.default,{datatestid:"activity-essay-subtitle-".concat(i+1),fontWeight:600,variant:"h6",mt:2,children:e.subtitle}),(0,a.jsx)(h.Z,{"data-testid":"activity-essay-content",children:null==e?void 0:null===(f=e.paragraph)||void 0===f?void 0:f.map((e,i)=>(0,a.jsx)(E.Z,{paragraph:e,useLargeScreenView:t},i+"_paragraph"))}),(0,a.jsx)(ea,{activityId:c,index:i,isMultiple:!0,userAnswer:(null===(y=e.user_answer)||void 0===y?void 0:y.length)>0?e.user_answer[i]:"",completed:S||(null===(j=e.user_answer[i])||void 0===j?void 0:j.length)>0,onSaveAnswer:e=>F(e,i),loadingSubmit:_,isMandatory:x}),(0,a.jsx)(b.Z,{margin:16})]});case n.activity_bonus:return(0,a.jsx)(K.Z,{completed:S,activityId:c,index:i,subtitle:e.subtitle,paragraph:e.paragraph,onSaveAnswer:F,markTaskAsCompleted:p,useLargeScreenView:t});default:return(0,a.jsx)(a.Fragment,{})}},[r,t,S,F]);return(0,L.useEffect)(()=>{N(i||!1)},[i]),(0,a.jsxs)(m.Z,{children:[(null==d?void 0:d.description)&&(0,a.jsx)(W,{datatestid:I,htmlString:d.description,useLargeScreenView:t}),null==s?void 0:s.map((e,t)=>(0,a.jsx)(h.Z,{children:T(e,t)},t+"activity-content"))]})};var eo=i(8604),ed=i(74837),es=i(72730),ec=i(19751);let eu=e=>{var t,i;let{isLoading:r}=e,{t:n}=(0,L.useContext)(o.d),{tCourse:d,getCourseLanguage:c}=(0,L.useContext)(l.a),u=(0,R.useRouter)(),{cid:p,chapter_id:g,task_id:x,task_ids:v}=u.query,f=v?String(v).split(","):[],y=x===f[0],b=x===f[f.length-1],j=null===(t=J.Z.chapters)||void 0===t?void 0:null===(i=t[(null==p?void 0:p.toString())||""])||void 0===i?void 0:i.find(e=>e.id===Number(g)),w=()=>{(0,V.Hi)(B.aG.previousConcept,{Page_id:u.pathname.replace("/",""),Course_id:p,Chapter_id:g,Sub_chapter_id:x});let e=f[f.indexOf(x)-1];u.push("".concat(u.pathname,"?cid=").concat(p,"&chapter_id=").concat(g,"&task_id=").concat(e,"&task_ids=").concat(v))},C=()=>{if(b){(0,V.Hi)(B.aG.adbQuizCard,{Page_id:u.pathname.replace("/",""),Course_id:p,Chapter_id:g,Sub_chapter_id:x,Current_progress:null==j?void 0:j.progress}),u.push((0,ed.H)(B.zb.playQuiz.concat("?cid=".concat(p,"&chapter_id=").concat(g,"&source=learning&close_to=task_list")))),eo.Z.addRoute((0,ed.H)(B.zb.playTaskList.concat("?cid=".concat(p,"&chapter_id=").concat(g))));return}(0,V.Hi)(B.aG.nextConcept,{Page_id:u.pathname.replace("/",""),Course_id:p,Chapter_id:g,Sub_chapter_id:x});let e=f[f.indexOf(x)+1];u.push("".concat(u.pathname,"?cid=").concat(p,"&chapter_id=").concat(g,"&task_id=").concat(e,"&task_ids=").concat(v))};return(0,a.jsxs)(m.Z,{direction:"row",spacing:{xs:1.25,md:1.75},children:[y?(0,a.jsx)(h.Z,{width:"100%"}):(0,a.jsx)(P.default,{variant:"outlined",htmlColor:s.w.Primary500,startIcon:(0,a.jsx)(es.Z,{}),pill:!0,fullWidth:!0,disabled:r,onClick:w,datatestid:"concept-page-previous",children:c(Number(p))?d("previous"):n("previous")}),b?(0,a.jsx)(P.default,{variant:"contained",htmlColor:s.w.Green500,endIcon:(0,a.jsx)(ec.Z,{}),pill:!0,fullWidth:!0,disabled:r,onClick:C,datatestid:"concept-page-quiz",children:c(Number(p))?d("takeQuiz"):n("takeQuiz")}):(0,a.jsx)(P.default,{variant:"outlined",htmlColor:s.w.Primary500,endIcon:(0,a.jsx)(ec.Z,{}),pill:!0,fullWidth:!0,disabled:r,onClick:C,datatestid:"concept-page-next",children:c(Number(p))?d("next"):n("next")})]})};var ep=i(30128),eh=i(41664),em=i.n(eh),eg=i(72739),ex=i(15005);let ev=e=>{var t,i,r,d,s,c,u,p,x;let{useLargeScreenView:v}=e,f=(0,k.Z)(),y=(0,R.useRouter)(),b=y.query.cid,j=Number(b),{t:w}=(0,L.useContext)(o.d),{tCourse:C,getCourseLanguage:F}=(0,L.useContext)(l.a),{showSnackbar:H}=(0,z.Ds)(),[W,E]=(0,L.useState)(!1),[P,B]=(0,L.useState)(!1),[M,G]=(0,L.useState)(null),[q,D]=(0,L.useState)([]),[V,U]=(0,L.useState)(!1),J=e=>{try{let t=new URL(e);return t.hostname}catch(t){return(0,ep.Tb)(t),e}},Q=e=>{D(t=>{let i=[...t];return i[e]={...i[e],is_completed:!0,is_correct:i[e].kind===n.activity_knowledge_check||i[e].is_correct},i})},K=async()=>{E(!0);try{if(y.query.task_id){let t=await (0,I.Lu)(y.query.task_id,A.Z.getUserLanguage());if((null==t?void 0:t.bDone)==1){var e;G(t),D((null===(e=t.data)||void 0===e?void 0:e.reading_content)||[])}else G(null),D([]),H(F(j)?C("errorText"):w("errorText"),"error")}}catch(e){console.error("Failed to fetch reading core concept content:",e)}finally{E(!1)}};return((0,L.useEffect)(()=>{y.isReady&&K()},[y.isReady]),(0,L.useEffect)(()=>{let e=F(Number(j));e||U(!0)},[F,j]),V)?(0,a.jsx)(eg.Z,{useLargeScreenView:v,onLanguageSubmitCallback:()=>{U(!1),K()}}):W||void 0===M?(0,a.jsx)(Z.Z,{maxWidth:"md",disableGutters:!v,children:(0,a.jsx)(N.default,{number:4})}):(0,a.jsxs)(Z.Z,{maxWidth:"md",disableGutters:!v,children:[null===M?(0,a.jsx)(h.Z,{style:{display:"flex",justifyContent:"center",padding:16},children:(0,a.jsx)(g.default,{children:F(j)?C("ecoReadingContentEmpty"):w("ecoReadingContentEmpty")})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{children:(null==M?void 0:null===(t=M.data)||void 0===t?void 0:t.header_image)||(null==M?void 0:null===(i=M.data)||void 0===i?void 0:i.header_image_desktop)&&(null==M?void 0:null===(r=M.data)||void 0===r?void 0:r.header_image_mobile)&&(0,a.jsx)(h.Z,{"data-testid":"concept-page-illustration",style:{marginLeft:v?80:0,marginRight:v?80:0},children:(0,a.jsx)(T(),{src:v?(null==M?void 0:null===(d=M.data)||void 0===d?void 0:d.header_image_desktop)||(null==M?void 0:null===(s=M.data)||void 0===s?void 0:s.header_image)||"":(null==M?void 0:null===(c=M.data)||void 0===c?void 0:c.header_image_mobile)||(null==M?void 0:null===(u=M.data)||void 0===u?void 0:u.header_image)||"",unoptimized:!0,alt:"illustration",width:800,height:400,style:{alignSelf:"center",borderRadius:v?8:0,objectFit:"contain",width:"100%",height:"auto",maxHeight:"300px"}})})}),(0,a.jsxs)(m.Z,{gap:2,style:{marginLeft:v?80:16,marginRight:v?80:16,marginTop:16},children:[null==M?void 0:null===(p=M.data)||void 0===p?void 0:null===(x=p.reading_content)||void 0===x?void 0:x.map((e,t)=>{if("html"===e.type)return(0,a.jsx)(S.Z,{"data-testid":"concept-page-theory",variant:"body2",component:"div",sx:{fontFamily:f.typography.fontFamily,"& table":{display:v?"table":"block",position:"relative",left:v?"50%":void 0,transform:v?"translateX(-50%)":void 0,overflowX:v?"visible":"auto"},"& table::-webkit-scrollbar":{height:8},"& table::-webkit-scrollbar-thumb":{backgroundColor:"#ccc",borderRadius:8},"& td":{padding:"6px"},"& th":{padding:"6px"},"& ul":{paddingLeft:4,paddingRight:4,marginTop:2},"& ol":{paddingLeft:4,paddingRight:4,marginTop:2},"& li":{marginBottom:1},"& p":{marginBottom:"1em"},fontSize:v?"1.2rem":"1.1rem",lineHeight:1.6},dangerouslySetInnerHTML:{__html:e.content}},t);if("image"===e.type)return(0,a.jsxs)(h.Z,{sx:{textAlign:"center",my:2},children:[(0,a.jsx)(h.Z,{sx:{width:"80%",maxWidth:600,mx:"auto",position:"relative"},children:(0,a.jsx)(T(),{"data-testid":"concept-page-theory",unoptimized:!0,src:"string"==typeof e.content?e.content:"",alt:"Reading content ".concat(t),width:0,height:0,sizes:"(max-width: 600px) 100v
1w, 600px",style:{width:"100%",height:"auto",borderRadius:8}})}),(0,a.jsxs)(g.default,{sx:{wordBreak:"break-word",textAlign:"center"},children:[e.source_text," ",e.source&&(0,a.jsx)(em(),{href:e.source,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:2},children:J(e.source)})]})]},t);if("activity"===e.type){var i,r;if(!e.content)return null;e.content=e.content;let l=q[t]||e;return(0,a.jsx)(_,{isCompleted:e.kind===n.activity_knowledge_check?l.is_completed&&l.is_correct:l.is_completed,typeWrapper:e.kind,useLargeScreenView:v,reward:e.star,textTitle:(null==e?void 0:null===(i=e.content)||void 0===i?void 0:i.title)||"",children:e.content&&(0,a.jsx)(el,{useLargeScreenView:v,kind:e.kind,parentContent:null==e?void 0:e.content,content:null==e?void 0:null===(r=e.content)||void 0===r?void 0:r.content,completed:e.kind===n.activity_knowledge_check?e.is_completed&&e.is_correct:e.is_completed,activityId:e.activity_id,setDisabledNavigation:e=>B(e),markParentAsCompleted:()=>Q(t),isMandatory:e.is_mandatory})},"act-".concat(t))}return null}),(0,a.jsx)(eu,{isLoading:P})]})]}),(0,a.jsx)(ex.default,{})]})};var ef=i(69330),ey=i(88945),eb=i(4161),ej=i(33048),ew=i(28060);let eC=e=>{var t,i;let{isLoading:r,isExperiment:n}=e,{t:d}=(0,L.useContext)(o.d),{tCourse:s,getCourseLanguage:c}=(0,L.useContext)(l.a),u=(0,R.useRouter)(),{cid:p,chapter_id:g,task_id:x,quiz_task_id:v}=u.query,f=null===(t=J.Z.chapters)||void 0===t?void 0:null===(i=t[(null==p?void 0:p.toString())||""])||void 0===i?void 0:i.find(e=>e.id===Number(g)),y=()=>{if(n){u.replace((0,ed.H)(B.zb.playTaskList.concat("?cid=".concat(p,"&chapter_id=").concat(g))));return}(0,V.Hi)(B.aG.adbQuizCard,{Page_id:u.pathname.replace("/",""),Course_id:p,Chapter_id:g,Sub_chapter_id:x,Current_progress:null==f?void 0:f.progress}),u.push((0,ed.H)(B.zb.playQuiz.concat("?cid=".concat(p,"&chapter_id=").concat(g,"&task_id=").concat(v,"&source=learning&close_to=task_list")))),eo.Z.addRoute((0,ed.H)(B.zb.playTaskList.concat("?cid=".concat(p,"&chapter_id=").concat(g))))};return(0,a.jsxs)(m.Z,{direction:"row",spacing:{xs:1.25,md:1.75},children:[(0,a.jsx)(h.Z,{width:"100%"}),(0,a.jsx)(P.default,{variant:"contained",htmlColor:ef.J.Yellow500,endIcon:n?void 0:(0,a.jsx)(ec.Z,{}),pill:!0,fullWidth:!0,disabled:r,onClick:y,datatestid:"concept-page-next",sx:{color:ef.J.Neutral800+" !important",boxShadow:"none"},children:c(Number(p))?s(n?"continue":"quizBannerTitle"):d(n?"continue":"quizBannerTitle")})]})},e_=e=>{let{size:t=24,htmlColor:i,className:r,style:n,datatestid:l="CalendarStarIcon",ariahidden:o,arialabel:d}=e,s={fontSize:t,...n};return(0,a.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":o,"aria-label":d,className:r,style:s,"data-testid":l,children:(0,a.jsx)("path",{d:"M19.5 3H17.25V2.25C17.25 2.05109 17.171 1.86032 17.0303 1.71967C16.8897 1.57902 16.6989 1.5 16.5 1.5C16.3011 1.5 16.1103 1.57902 15.9697 1.71967C15.829 1.86032 15.75 2.05109 15.75 2.25V3H8.25V2.25C8.25 2.05109 8.17098 1.86032 8.03033 1.71967C7.88968 1.57902 7.69891 1.5 7.5 1.5C7.30109 1.5 7.11032 1.57902 6.96967 1.71967C6.82902 1.86032 6.75 2.05109 6.75 2.25V3H4.5C4.10218 3 3.72064 3.15804 3.43934 3.43934C3.15804 3.72064 3 4.10218 3 4.5V19.5C3 19.8978 3.15804 20.2794 3.43934 20.5607C3.72064 20.842 4.10218 21 4.5 21H19.5C19.8978 21 20.2794 20.842 20.5607 20.5607C20.842 20.2794 21 19.8978 21 19.5V4.5C21 4.10218 20.842 3.72064 20.5607 3.43934C20.2794 3.15804 19.8978 3 19.5 3ZM19.5 19.5H4.5V4.5H6.75V5.25C6.75 5.44891 6.82902 5.63968 6.96967 5.78033C7.11032 5.92098 7.30109 6 7.5 6C7.69891 6 7.88968 5.92098 8.03033 5.78033C8.17098 5.63968 8.25 5.44891 8.25 5.25V4.5H15.75V5.25C15.75 5.44891 15.829 5.63968 15.9697 5.78033C16.1103 5.92098 16.3011 6 16.5 6C16.6989 6 16.8897 5.92098 17.0303 5.78033C17.171 5.63968 17.25 5.44891 17.25 5.25V4.5H19.5V19.5ZM16.5581 10.6537L13.7606 10.4372L12.6891 7.95281C12.6312 7.81808 12.535 7.70327 12.4126 7.6226C12.2901 7.54194 12.1467 7.49894 12 7.49894C11.8533 7.49894 11.7099 7.54194 11.5874 7.6226C11.465 7.70327 11.3688 7.81808 11.3109 7.95281L10.2394 10.4372L7.44187 10.6537C7.293 10.6655 7.15101 10.7214 7.03411 10.8143C6.9172 10.9073 6.8307 11.033 6.78569 11.1754C6.74068 11.3178 6.7392 11.4703 6.78144 11.6136C6.82369 11.7568 6.90773 11.8842 7.02281 11.9794L9.13406 13.7222L8.49094 16.32C8.45568 16.4632 8.46345 16.6137 8.51326 16.7525C8.56308 16.8914 8.65273 17.0124 8.771 17.1006C8.88927 17.1887 9.0309 17.2401 9.17819 17.2481C9.32548 17.2562 9.47187 17.2206 9.59906 17.1459L12 15.7331L14.4009 
117.1459C14.5281 17.2206 14.6745 17.2562 14.8218 17.2481C14.9691 17.2401 15.1107 17.1887 15.229 17.1006C15.3473 17.0124 15.4369 16.8914 15.4867 16.7525C15.5366 16.6137 15.5443 16.4632 15.5091 16.32L14.8659 13.7222L16.9772 11.9794C17.0923 11.8842 17.1763 11.7568 17.2186 11.6136C17.2608 11.4703 17.2593 11.3178 17.2143 11.1754C17.1693 11.033 17.0828 10.9073 16.9659 10.8143C16.849 10.7214 16.707 10.6655 16.5581 10.6537ZM13.5478 12.8663C13.4387 12.9561 13.3572 13.075 13.3128 13.2092C13.2683 13.3434 13.2627 13.4874 13.2966 13.6247L13.6247 14.9484L12.3806 14.2162C12.2653 14.1483 12.1339 14.1125 12 14.1125C11.8661 14.1125 11.7347 14.1483 11.6194 14.2162L10.3753 14.9484L10.7034 13.6247C10.7373 13.4874 10.7317 13.3434 10.6872 13.2092C10.6428 13.075 10.5613 12.9561 10.4522 12.8663L9.41062 12.0056L10.8066 11.8978C10.9427 11.8874 11.0735 11.8399 11.1847 11.7606C11.2958 11.6813 11.3833 11.5732 11.4375 11.4478L12 10.1428L12.5625 11.4478C12.6167 11.5732 12.7042 11.6813 12.8153 11.7606C12.9265 11.8399 13.0573 11.8874 13.1934 11.8978L14.5894 12.0056L13.5478 12.8663Z",fill:i||"currentColor"})})},ek=e=>{let{feedback:t}=e,{t:i}=(0,L.useContext)(o.d);return(0,a.jsxs)(h.Z,{sx:{p:"16px",bgcolor:ef.J.Neutral100,borderRadius:"8px",mt:"16px"},children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:"8px",alignItems:"center",children:[(0,a.jsx)(e_,{}),(0,a.jsx)(g.default,{fontWeight:700,fontSize:{xs:"1.1rem",md:"1.2rem"},children:i("tfcWritingFeedback")})]}),(0,a.jsx)(h.Z,{sx:{p:"16px",bgcolor:ef.J.Neutral50,borderRadius:"8px",mt:"16px",fontSize:{xs:"1.1rem",md:"1.2rem"}},dangerouslySetInnerHTML:{__html:t}})]})},eZ=e=>{let{size:t=24,htmlColor:i,className:r,style:n,datatestid:l="EditPencilIcon",ariahidden:o,arialabel:d}=e,s={fontSize:t,...n};return(0,a.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":o,"aria-label":d,className:r,style:s,"data-testid":l,children:[(0,a.jsx)("path",{d:"M8 20L4 16M8 20L19.1466 7.99594C20.1811 6.88186 20.1491 5.14905 19.074 4.07402C17.9412 2.9412 16.0943 2.97539 15.0042 4.14937L4 16M8 20L3 21L4 16",stroke:"#424242",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M14 5.00049L18 9.00049",stroke:i||"currentColor",strokeWidth:"1.5"})]})};var eS=function(e){var t;let{useLargeScreenView:i,testMode:r,testOptions:n,activityId:d,userAnswer:s,setDisabledNavigation:c,markTaskAsCompleted:u,isMandatory:p}=e,{t:v}=(0,L.useContext)(o.d),{tCourse:f,getCourseLanguage:y}=(0,L.useContext)(l.a),b=(0,R.useRouter)(),{cid:j,chapter_id:w,task_id:C}=b.query,{showSnackbar:_}=(0,z.Ds)(),[k,Z]=(0,L.useState)(null),[S,N]=(0,L.useState)((null!==(t=null==s?void 0:s.length)&&void 0!==t?t:0)>0),[I,A]=(0,L.useState)(!1),[F,T]=(0,L.useState)(s||""),H=s&&2===s.length,W=e=>
1"png"===e||"jpg"===e||"jpeg"===e||"gif"===e,[E,D]=(0,L.useState)(k?W(k.name.split(".").pop()||""):W((null==s?void 0:s.split(".").pop())||"")),Q=async e=>{if(d)try{O(B.aG.adbSubmitActivity,{is_correct:!0}),null==c||c(!0);let t=new FormData;t.append("file",e),t.append("taskId",d);let i=await (0,ey.O3)(t);(null==i?void 0:i.success)?(T(e.name),N(!0),null==u||u()):_(y(Number(j))?f("adbUploadFileError"):v("adbUploadFileError"),"error")}catch(e){_(y(Number(j))?f("errorText"):v("errorText"),"error")}finally{A(!1),Z(null),null==c||c(!1),J.Z.loadChapters(Number(J.Z.course_pref))}},K=e=>{var t;let i=r?new File([""],(null==n?void 0:n.fileName)||"test.png",{type:"image/png"}):null===(t=e.target.files)||void 0===t?void 0:t[0];if(i){A(!1);let e=i.name.split(".").pop();if(!B.Yu.includes((null==e?void 0:e.toLowerCase())||"")){Z(null),_(y(Number(j))?f("adbFileTypeError"):v("adbFileTypeError"),"error");return}let t=(null==n?void 0:n.fileSize)||Math.round(i.size/1024);if(t>B.lA){Z(null),_(y(Number(j))?f("tfcFileSizeError"):v("tfcFileSizeError"),"error");return}Z(i),D(W(e||""))}},O=(e,t)=>{let i={Page_id:b.pathname.replace("/",""),Course_id:j,Chapter_id:w,Sub_chapter_id:C,Activity_id:d,Activity_name:"Upload Activity",is_correct:!0,...t};(0,V.Hi)(e,i)};return(0,L.useEffect)(()=>{T(s||"")},[s]),(0,a.jsxs)(m.Z,{spacing:2,"data-testid":"adb-upload",mt:"16px",children:[(0,a.jsxs)(h.Z,{"data-testid":H?"activity-upload-file":I?"activity-upload-file-loading":"adb-upload-box",sx:{border:"2px dashed ".concat(ef.J.Neutral400,"75"),borderRadius:4,padding:2,display:"flex",alignItems:"center",justifyContent:"center",height:i?250:200,width:"100%",bgcolor:"white",overflow:"hidden"},children:[(0,a.jsx)("input",{type:"file",id:"file","data-testid":"file",accept:B.Yu.join(","),name:"file",style:{display:"none"},onChange:e=>{var t;let i=null===(t=e.target.files)||void 0===t?void 0:t[0];if(i){let t=Math.round(i.size/1024);if(t>B.lA){_(y(Number(j))?f("tfcFileSizeError"):v("tfcFileSizeError"),"error"),e.target.value="";return}}K(e),e.target.value=""}}),(0,a.jsx)(m.Z,{alignItems:"center",justifyContent:"center",sx:{width:"100%",height:"100%"},onClick:()=>{if(!I&&!k){var e;O(B.aG.adbUploadActivity),null===(e=document.getElementById("file"))||void 0===e||e.click()}},children:I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.Z,{thickness:4,size:i?60:52,sx:{color:"#E6BB16",animationDuration:"800ms","& .MuiCircularProgress-circle":{strokeLinecap:"round",stroke:"#FFD946",opacity:.9},"& .MuiCircularProgress-circleDeterminate":{strokeOpacity:1}}}),(0,a.jsx)(g.default,{style:{color:ef.J.Neutral800,fontWeight:600,fontSize:18},sx:{mt:2},children:y(Number(j))?f("loadingUpload"):v("loadingUpload")})]}):k?(0,a.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"center",gap:1,sx:{width:"100%",height:"100%",position:"relative"},children:[E?(0,a.jsx)(U.Z,{sx:{color:ef.J.Neutral800,fontSize:64}}):(0,a.jsx)(G.Z,{sx:{fontSize:64,color:ef.J.Neutral800}}),(0,a.jsx)(g.default,{style:{wordBreak:"break-word",textAlign:"center"},children:k.name}),(0,a.jsx)(P.default,{datatestid:"activity-upload-file-close",onClick:()=>{Z(null),A(!1),O(B.aG.adbRemoveFileActivity),s&&(null==s?void 0:s.length)>0&&D(W((null==s?void 0:s.split(".").pop())||""))},sx:{position:"absolute",top:8,right:8,minWidth:"auto",padding:0},children:(0,a.jsx)(q.Z,{fontSize:i?"large":"medium",htmlColor:ef.J.Red500})})]}):F?(0,a.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"center",gap:1,sx:{width:"100%",height:"100%",position:"relative"},children:[E?(0,a.jsx)(U.Z,{sx:{color:ef.J.Neutral800,fontSize:64}}):(0,a.jsx)(G.Z,{sx:{fontSize:64,color:ef.J.Neutral800}}),(0,a.jsx)(g.default,{style:{wordBreak:"break-word",textAlign:"center"},children:F}),(0,a.jsx)(P.default,{datatestid:"activity-upload-file-edit",onClick:()=>{O(B.aG.adbEditUploadActivity)},sx:{position:"absolute",top:8,right:8,minWidth:"auto",padding:0},children:(0,a.jsx)(eZ,{size:i?28:24,htmlColor:ef.J.Neutral800})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.UploadIcon,{size:i?48:32,variant:"outlined",htmlColor:ef.J.Yellow900}),(0,a.jsxs)(g.default,{sx:{marginTop:2},children:[(0,a.jsx)("span",{style:{color:ef.J.Yellow900,cursor:"pointer"},children:y(Number(j))?f("adbClickHereFile"):v("adbClickHereFile")})," ",y(Number(j))?f("adbClickHereFile2"):v("adbClickHereFile2")]}),(0,a.jsx)(g.default,{sx:{marginTop:.5,fontSize:15},children:y(Number(j))?f("tfcBioMaximumFileSize"):v("tfcBioMaximumFileSize")})]})})]}
1),!I&&!k&&(null==s?void 0:s.length)===0&&!S&&!!p&&(0,a.jsx)(g.default,{datatestid:"activity-upload-warning",fontSize:14,style:{marginTop:2,color:"#B85E00",display:"flex",justifyContent:"end"},children:y(Number(j))?f("adbUploadThisFieldIsRequired"):v("adbUploadThisFieldIsRequired")}),k&&(0,a.jsx)(P.default,{disabled:I,datatestid:I?"submit-button-disable":"submit-button",variant:I?"contained":"outlined",htmlColor:ef.J.Blue600,style:{borderRadius:"18px",width:"100%",backgroundColor:I?ef.J.Neutral300:void 0,color:I?ef.J.Neutral500:void 0,boxShadow:"none"},onClick:()=>{A(!0),Q(k)},children:(0,a.jsx)(g.default,{children:y(Number(j))?f("submit"):v("submit")})})]})};let eL=e=>{var t;let{activityId:i,isMultiple:r,index:n=0,userAnswer:l,completed:d=!1,onSaveAnswer:c,loadingSubmit:u,isMandatory:p}=e,{t:x}=(0,L.useContext)(o.d),[v,f]=(0,L.useState)(""),[y,b]=(0,L.useState)(""),[j,w]=(0,L.useState)(d),C=r?"essay":"reflection",_=(0,L.useRef)(""),k=(0,R.useRouter)(),{cid:Z,chapter_id:S,task_id:z}=k.query,N=(e,t)=>{let n={Page_id:k.pathname.replace("/",""),Course_id:Z,Chapter_id:S,Sub_chapter_id:z,Activity_id:i,Activity_name:r?"Essay Activity":"Reflection Activity",...t};(0,V.Hi)(e,n)},I=async()=>{if((null==v?void 0:v.trim())===""){b(x("adbReflectionFieldRequiredReflection"));return}let e=await (0,et.SA)(v);if((null==e?void 0:e.iMessageCode)===1){b(x("badWordPost"));return}w(!0),null==c||c([v]),N(B.aG.adbSubmitActivity,{is_correct:!0}),J.Z.loadChapters(Number(J.Z.course_pref))},A=e=>{var t,i;let r=null!==(i=_.current)&&void 0!==i?i:"",n=e.length-r.length>1;if(n){f(r);return}if(_.current=e,f(e),(null===(t=e.trim())||void 0===t?void 0:t.length)<50){b(x("adbReflectionMinimumCharacter"));return}b("")},F=e=>{if((e.ctrlKey||e.metaKey)&&"v"===e.key||e.shiftKey&&"Insert"===e.key){e.preventDefault();return}},T=e=>{let t=e.target;if(t&&t.value!==v){var i;let e=null!==(i=_.current)&&void 0!==i?i:"";t.value.length>e.length+1&&(f(e),t.value=e)}};return(0,L.useEffect)(()=>{f(l),_.current=l},[l]),(0,L.useEffect)(()=>{w(d)},[d]),(0,a.jsx)(m.Z,{children:(0,a.jsxs)(h.Z,{mt:1.25,children:[(0,a.jsx)(er.Z,{"data-testid":r?j?"activity-".concat(C,"-answer-step-").concat(n+1):"activity-".concat(C,"-text-box-step-").concat(n+1):j?"activity-".concat(C,"-answer"):"activity-".concat(C,"-text-box"),fullWidth:!0,multiline:!0,rows:6,placeholder:x("type_answer"),value:v,onPaste:e=>e.preventDefault(),onCopy:e=>e.preventDefault(),onCut:e=>e.preventDefault(),onContextMenu:e=>e.preventDefault(),onKeyDown:F,onKeyUp:T,onChange:e=>A(e.target.value),sx:{["& .".concat(en.Z.root)]:{borderRadius:4,border:j?"none":"1px solid "+s.w.Primary200,fontSize:{xs:15,md:16},bgcolor:j?s.w.Primary100:"white"},["& .".concat(en.Z.input)]:{WebkitTextFillColor:s.w.Black+" !important",border:"none"}},disabled:j}),(void 0===v||(null==v?void 0:v.trim())==="")&&p?(0,a.jsx)(h.Z,{sx:{mt:{xs:.5,md:2},bgcolor:"white",justifyContent:"end",display:"flex"},children:(0,a.jsx)(g.default,{fontSize:14,datatestid:"activity-".concat(C,"-warning"),variant:"caption",sx:{color:s.w.Red500,textAlign:"end"},children:x("adbReflectionFieldRequiredReflection")})}):(0,a.jsx)(a.Fragment,{}),(0,a.jsxs)(m.Z,{alignItems:"end",sx:{display:"flex"},children:[y&&""!==y?(0,a.jsx)(h.Z,{sx:{mt:{xs:.5,md:2},bgcolor:"white"},children:(0,a.jsx)(g.default,{fontSize:14,datatestid:y===x("badWordPost")?"chat-warning":"activity-reflection-warning",variant:"caption",sx:{color:s.w.Red500,textAlign:"end"},children:y})}):(0,a.jsx)(a.Fragment,{}),j?(0,a.jsx)(P.default,{datatestid:"edit-button",variant:"outlined",size:"large",htmlColor:ef.J.Neutral800,pill:!0,onClick:()=>{N(B.aG.adbEditActivity),w(!1)},sx:{width:"100%",mt:{xs:2,md:2.5}},children:u?(0,a.jsx)(M.Z,{size:16,sx:{color:"inherit"}}):x("edit")}):(0,a.jsx)(m.Z,{sx:{width:"100%"},children:(0,a.jsx)(P.default,{datatestid:y||u?"submit-button-disable":"submit-button",size:"large",disabled:!!y||u||!r&&(null===(t=null==v?void 0:v.trim())||void 0===t?void 0:t.length)<50,variant:"outlined",htmlColor:ef.J.Blue500,pill:!0,onClick:I,sx:{width:"100%",mt:{xs:2,md:2.5}},children:x("submit")})})]})]})})},eR=e=>{let{useLargeScreenView:t,data:i,setDisabledNavigation:r,markParentAsCompleted:n}=e,{t:l}
1=(0,L.useContext)(o.d),[d,s]=(0,L.useState)(!1),{showSnackbar:c}=(0,z.Ds)(),[u,p]=(0,L.useState)(i.completed||!1),x=async e=>{if(i.id){s(!0),null==r||r(!0);try{if(i.type===B.iQ.reflection){let t=await (0,ey.LN)(i.id,e.join(" "));(null==t?void 0:t.success)?null==n||n():c((null==t?void 0:t.error)||l("errorText"),"error")}}catch(e){c(l("errorText"),"error")}finally{s(!1),null==r||r(!1),J.Z.loadChapters(Number(J.Z.course_pref))}}},v=(0,L.useCallback)(()=>{switch(i.type){case B.iQ.upload:return(0,a.jsxs)(m.Z,{children:[i.title&&(0,a.jsx)(g.default,{datatestid:"activity-upload-subtitle",fontWeight:600,children:i.title}),(0,a.jsx)(h.Z,{"data-testid":"activity-upload-content",children:i.question&&(0,a.jsx)(E.Z,{paragraph:{type:"html",content:i.question},useLargeScreenView:t})}),(0,a.jsx)(eS,{useLargeScreenView:t,userAnswer:i.user_answer||"",activityId:i.id,setDisabledNavigation:r,markTaskAsCompleted:n}),i.feedback&&(0,a.jsx)(ek,{feedback:i.feedback})]});case B.iQ.reflection:var e;return(0,a.jsxs)(m.Z,{children:[i.title&&(0,a.jsx)(g.default,{datatestid:"activity-reflection-subtitle",fontWeight:600,variant:"h6",mt:2,children:i.title}),(0,a.jsx)(h.Z,{"data-testid":"activity-reflection-content",children:i.question&&(0,a.jsx)(E.Z,{paragraph:{type:"html",content:i.question},useLargeScreenView:t},"paragraph")}),(0,a.jsx)(eL,{activityId:i.id,userAnswer:i.user_answer||"",completed:u||(null===(e=i.user_answer||"")||void 0===e?void 0:e.length)>0,onSaveAnswer:x,loadingSubmit:d}),i.feedback&&(0,a.jsx)(ek,{feedback:i.feedback})]});default:return(0,a.jsx)(a.Fragment,{})}},[i.type,t,u,x]);return(0,L.useEffect)(()=>{p(i.completed||!1)},[i.completed]),(0,a.jsx)(h.Z,{children:v()},"activity-content")};var ez=i(18715);let eN=e=>{let{size:t=24,htmlColor:i,className:r,style:n,datatestid:l="AssignmentIcon",ariahidden:o,arialabel:d}=e,s=i||"currentColor",c={fontSize:t,...n};return(0,a.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":o,"aria-label":d,className:r,style:c,"data-testid":l,children:[(0,a.jsx)("path",{d:"M6.95654 10.7241L9.23915 13.0067L13.0435 9.20239",stroke:s,strokeWidth:"1.5",strokeLinecap:"round"}),(0,a.jsx)("path",{d:"M6.95654 2.34774V4.6376H13.0435V2.34774C13.0435 2.0716 12.8196 1.84774 12.5435 1.84774H11.0851C11.0399 1.84774 10.9965 1.82978 10.9646 1.7978C10.4319 1.2651 9.56818 1.2651 9.03547 1.7978C9.00349 1.82978 8.96012 1.84774 8.9149 1.84774H7.45654C7.1804 1.84774 6.95654 2.0716 6.95654 2.34774Z",stroke:s,strokeWidth:"1.5"}),(0,a.jsx)("path",{d:"M13.0432 3.87695H16.1592V18.3335H3.84033V3.87695H6.95627",stroke:s,strokeWidth:"1.5",strokeLinejoin:"round"})]})},eI=e=>{let{headerStyle:t,useLargeScreenView:i,isCompleted:r,textTitle:n,reward:l,children:o,typeWrapper:d}=e;return(0,a.jsxs)(p.Z,{"data-testid":"biology-activity-card",style:{borderRadius:8,overflow:"hidden",backgroundColor:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[(0,a.jsxs)(h.Z,{"data-testid":"biology-activity-header",sx:t?{...t}:{backgroundColor:ef.J.Yellow500,color:ef.J.Neutral800,display:"flex",alignItems:"center",justifyContent:"space-between",p:2.2},children:[(0,a.jsxs)(m.Z,{"data-testid":"biology-activity-title",direction:"row",spacing:1,alignItems:"center",children:[d===B.FA.experiment?(0,a.jsx)(eN,{htmlColor:ef.J.Neutral800,"data-testid":"assignment-icon"}):d===B.FA.reading?(0,a.jsx)(f.Z,{htmlColor:ef.J.Neutral900,"data-testid":"lamp-icon"}):void 0,(0,a.jsx)(g.default,{variant:"inherit",style:{fontSize:"1.2em"},children:n})]}),r?(0,a.jsx)(ez.Z,{htmlColor:ef.J.Success500,"data-testid":"checklist-icon",size:28}):l&&(0,a.jsxs)(h.Z,{"data-testid":"biology-activity-points",display:"flex",alignItems:"center",children:[(0,a.jsx)(w,{datatestid:"point-icon",style:{fontSize:i?26:24,color:ef.J.Neutral800}}),(0,a.jsxs)(g.default,{fontWeight:700,style:{fontSize:"1.2em",marginLeft:5},children:["+",(0,C.au)(l)]})]})]}),(0,a.jsxs)(h.Z,{p:2,children:[(0,a.jsx)(b.Z,{margin:8}),o]})]})},eA=e=>{var t,i;let{useLargeScreenView:r}=e,n=(0,R.useRouter)(),s=n.query.cid,c=n.query.chapter_id,u=n.query.task_id,p=n.query.unit_id,x=Number(s),v=null===(t=null===J.Z||void 0===J.Z?void 0:J.Z.chapters[x])||void 0===t?void 0:t.find(e=>e.id.toString()===c),{t:f}=(0,L.useContext)(o.d),{tCourse:y,getCourseLanguage:b}=(0,L.useContext)(l.a),{showSnackbar:j}
1=(0,z.Ds)(),[w,_]=(0,L.useState)(!1),[k,A]=(0,L.useState)(!1),[F,H]=(0,L.useState)(null),[W,E]=(0,L.useState)([]),P=(0,L.useRef)(!1),M=(null==F?void 0:F.type)===B.FA.experiment;(0,L.useEffect)(()=>{if(v)return ej.Z.start({courseId:null==v?void 0:v.dcs_subject_id,chapterId:null==v?void 0:v.dcs_chapter_id,activityId:u,unitId:p}),()=>{ej.Z.stop()}},[v]);let G=async(e,t)=>{if(!t.completed){var i;let e=0;t.type===B.iQ.reflection?e=B.Mo.reflection:t.type===B.iQ.upload&&(e=B.Mo.upload);let r={answers:[],app_version:B.Ji,minigame_id:(0,B.HW)("grammar"),difficulty_level:(null==v?void 0:v.order)||1,timestamp_finished:0,points:e,chapter_id:Number(c),timestamp_started:0,identifier:Number((null===ew.Z||void 0===ew.Z?void 0:null===(i=ew.Z.user)||void 0===i?void 0:i.id)||0),subject_id:Number(x),is_complete:!0,is_complete_chapter:!1,is_sent:!0,question_length:1,session:1,subject_version:1};await (0,I.CG)(r)}E(t=>{let i=[...t];return i[e]={...i[e],completed:!0},i})},q=async()=>{_(!0);try{if(n.query.task_id){var e;let t=await (0,ey.NK)({courseId:(null==v?void 0:v.dcs_subject_id)||"",chapterId:(null==v?void 0:v.dcs_chapter_id)||"",activityId:u});if((null==t?void 0:t.success)&&(null===(e=t.data)||void 0===e?void 0:e.activity)){let e=t.data.activity,i=(e.tasks||[]).map(e=>{if(e.type===B.iQ.article||e.type===B.iQ.text){let t=(0,B.y$)((null==e?void 0:e.content)||"",(null==e?void 0:e.images_url)||{});return{...e,content:t}}return e});H(e),E(i)}else H(null),E([]),j(b(x)?y("errorText"):f("errorText"),"error")}}catch(e){console.error("Failed to fetch reading core concept content:",e)}finally{_(!1)}};return((0,L.useEffect)(()=>{n.isReady&&(P.current=!1,q())},[n.isReady,u]),(0,L.useEffect)(()=>{if(null!==F&&!w&&!P.current){var e,t,i,r,a,l;let o=null==F?void 0:null===(e=F.tasks)||void 0===e?void 0:e.some(e=>e.type===B.iQ.reflection),d=null==F?void 0:null===(t=F.tasks)||void 0===t?void 0:t.some(e=>e.type===B.iQ.upload);o?((0,V.Hi)(B.aG.readingMaterial,{currentURL:n.asPath,language:eb.Z.language,previousURL:eo.Z.getRealPreviousUrl(
1),user_id:(null===(i=ew.Z.user)||void 0===i?void 0:null===(r=i.id)||void 0===r?void 0:r.toString())||"",user_pseudo_id:(0,C.Y0)().toString()}),P.current=!0):d&&((0,V.Hi)(B.aG.experimentActivity,{currentURL:n.asPath,language:eb.Z.language,previousURL:eo.Z.getRealPreviousUrl(),user_id:(null===(a=ew.Z.user)||void 0===a?void 0:null===(l=a.id)||void 0===l?void 0:l.toString())||"",user_pseudo_id:(0,C.Y0)().toString()}),P.current=!0)}},[F,w]),w||void 0===F)?(0,a.jsx)(Z.Z,{maxWidth:"md",disableGutters:!r,children:(0,a.jsx)(N.default,{number:4})}):(0,a.jsxs)(Z.Z,{maxWidth:"md",disableGutters:!r,sx:{color:ef.J.Black},children:[null===F?(0,a.jsx)(h.Z,{style:{display:"flex",justifyContent:"center",padding:16},children:(0,a.jsx)(g.default,{children:b(x)?y("tfcReadingContentEmpty"):f("tfcReadingContentEmpty")})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{children:(null==F?void 0:F.image_url)&&(0,a.jsx)(h.Z,{"data-testid":"concept-page-illustration",style:{marginLeft:r?80:0,marginRight:r?80:0},children:(0,a.jsx)(T(),{src:(null==F?void 0:F.image_url)||"",unoptimized:!0,alt:"illustration",width:800,height:400,style:{alignSelf:"center",borderRadius:r?8:0,width:"100%",height:"auto"}})})}),(0,a.jsxs)(m.Z,{gap:2,style:{marginLeft:r?80:16,marginRight:r?80:16,marginTop:(null==F?void 0:F.image_url)?"20px":"16px"},children:[null==F?void 0:null===(i=F.tasks)||void 0===i?void 0:i.map((e,t)=>{if(e.type===B.iQ.article||e.type===B.iQ.text)return(0,a.jsxs)(h.Z,{"data-testid":"concept-page-theory",children:[(0,a.jsx)(g.default,{variant:"h2",fontSize:{xs:e.type===B.iQ.article?24:18,md:e.type===B.iQ.article?28:20},fontWeight:600,textAlign:e.type===B.iQ.article?"center":"left",mb:{xs:"16px",md:"24px"},maxWidth:e.type===B.iQ.article?"645px":"100%",children:e.title}),(0,a.jsx)(S.Z,{variant:"body2",component:"div",sx:{fontFamily:d.cn.style.fontFamily,"& table":{display:r?"table":"block",position:"relative",left:r?"50%":void 0,transform:r?"translateX(-50%)":void 0,overflowX:r?"visible":"auto"},"& table::-webkit-scrollbar":{height:8},"& table::-webkit-scrollbar-thumb":{backgroundColor:"#ccc",borderRadius:8},"& td":{padding:"6px"},"& th":{padding:"6px"},"& ul":{paddingLeft:4,paddingRight:4,marginTop:2},"& ol":{paddingLeft:4,paddingRight:4,marginTop:2},"& li":{marginBottom:1},"& p":{marginBottom:"1em"},fontSize:"1.1rem",lineHeight:1.6},dangerouslySetInnerHTML:{__html:e.content||""}},t)]},t);if(e.type===B.iQ.reflection||e.type===B.iQ.upload){var i;if(!e.question)return null;let n=W[t]||e;return(0,a.jsx)(eI,{isCompleted:n.completed,typeWrapper:F.type,useLargeScreenView:r,reward:null===(i=e.reward)||void 0===i?void 0:i.points,textTitle:e.type===B.iQ.reflection?f("tfcReflection"):f("tfcUpload"),children:e.question&&(0,a.jsx)(eR,{useLargeScreenView:r,data:e,setDisabledNavigation:e=>A(e),markParentAsCompleted:()=>G(t,n)})},"act-".concat(t))}return null}),(0,a.jsx)(eC,{isLoading:k,isExperiment:M})]})]}),(0,a.jsx)(ex.default,{isGain:!0})]})},eF=u()(()=>Promise.resolve().then(i.bind(i,10894)),{loadableGenerated:{webpack:()=>[10894]},ssr:!1}),eT=u()(()=>Promise.resolve().then(i.bind(i,33234)),{loadableGenerated:{webpack:()=>[33234]},ssr:!1}),eH=u()(()=>i.e(4244).then(i.bind(i,14244)),{loadableGenerated:{webpack:()=>[14244]},ssr:!1}),eW=e=>{var t,i,r,n,l,d,s,c,u,p;let{useLargeScreenView:x}=e,v=(0,k.Z)(),{showSnackbar:f}=(0,z.Ds)(),y=(0,R.useRouter)(),j=y.query.cid,w=y.query.chapter_id,{t:C}=(0,L.useContext)(o.d),[_,N]=L.useState(void 0),[F,H]=L.useState(!0),W=e=>{try{let t=new URL(e);return t.hostname}catch(t){return(0,ep.Tb)(t),e}};return((0,L.useEffect)(()=>{if(y.isReady){let e=async()=>{H(!0);try{if(y.query.task_id){let e=await (0,I.Lu)(y.query.task_id,A.Z.getUserLanguage());(null==e?void 0:e.bDone)==1?N(e):(N(null),f(C("errorText"),"error"))}}catch(e){console.error("Failed to fetch reading core concept content:",e)}finally{H(!1)}};e()}},[y]),F||void 0===_)?(0,a.jsx)(Z.Z,{maxWidth:"md",disableGutters:!x,children:(0,a.jsx)(eF,{number:4})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(Z.Z,{maxWidth:"md",disableGutters:!x,children:null===_?(0,a.jsx)(h.Z,{style:{display:"flex",justifyContent:"center",padding:16},children:(0,a.jsx)(g.default,{children:C("ecoReadingContentEmpty")})}):(0,a.jsxs)(m.Z,{children:[(0,a.jsx)(m.Z,{children:(null==_?void 0:null===(t=_.data)||void 0===t?void 0:t.header_image)||(null==_?void 0:null===(i=_.data)||void 0===i?void 0:i.header_image_desktop)&&(null==_?void 0:null===(r=_.data)||void 0===r?void 0:r.header_image_mobile)&&(0,a.jsx)(h.Z,{"data-testid":"concept-page-illustration",style:{marginLeft:x?85:0,marginRight:x?85:0},children:(0,a.jsx)(T(),{src:x?(null==_?void 0:null===(n=_.data)||void 0===n?void 0:n.header_image_desktop)||(null==_?void 0:null===(l=_.data)||void 0===l?void 0:l.header_image)||"":(null==_?void 0:null===(d=_.data)||void 0===d?void 0:d.header_image_mobile)||(null==_?void 0:null===(s=_.data)||void 0===s?void 0:s.header_image)||"",unoptimized:!0,alt:"illustration",width:800,height:400,style:{alignSelf:"center",borderRadius:x?8:0,objectFit:"contain",width:"100%",height:"auto",maxHeight:"300px"}})})}),(0,a.jsxs)(h.Z,{"data-testid":"concept-page-theory",style:{marginLeft:x?85:16,marginRight:x?85:16,marginTop:16},children:[(0,a.jsx)("div",{children:null==_?void 0:null===(c=_.data)||void 0===c?void 0:null===(u=c.reading_content)||void 0===u?void 0:u.map((e,t)=>"html"===e.type?(0,a.jsx)(S.Z,{variant:"body2",component:"div",sx:{fontFamily:v.typography.fontFamily,"& td":{padding:"8px 12px"},"& ul":{paddingLeft:4,paddingRight:4,marginTop:2},"& ol":{paddingLeft:4,paddingRight:4,marginTop:2},"& li":{marginBottom:1},"& p":{marginBottom:"1em"},fontSize:x?"1.2rem":"1.1rem",lineHeight:1.6},dangerouslySetInnerHTML:{__html:e.content}},t):"image"===e.type?(0,a.jsxs)(h.Z,{sx:{textAlign:"center",my:2},children:[(0,a.jsx)(h.Z,{sx:{width:"80%",maxWidth:600,mx:"auto",position:"relative"},children:(0,a.jsx)(T(),{unoptimized:!0,src:"string"==typeof e.content?e.content:"",alt:"Reading content ".concat(t),width:0,height:0,sizes:"(max-width: 600px) 100v
1w, 600px",style:{width:"100%",height:"auto",borderRadius:8}})}),(0,a.jsxs)(g.default,{sx:{wordBreak:"break-word",textAlign:"center"},children:[e.source_text," ",e.source&&(0,a.jsx)(em(),{href:e.source,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:2},children:W(e.source)})]})]},t):null)}),(0,a.jsx)(b.Z,{margin:28}),(0,a.jsx)(eH,{isLoading:F}),(0,a.jsx)(b.Z,{margin:40}),(0,a.jsx)(eT,{style:{maxWidth:"100%"},analyticsData:{page_id:y.pathname,course_id:j,chapter_id:w,concept_id:null==y?void 0:null===(p=y.query)||void 0===p?void 0:p.task_id},datatestid:"ai-generated-disclaimer",isCoreConcept:!0})]})]})})})};var eE=i(85337),eP=i(48230);let eB=e=>{let{useLargeScreenView:t}=e,i=(0,R.useRouter)(),r=i.query.cid,n=Number(r),l=i.query.chapter_id,{t:d}=(0,L.useContext)(o.d),{showSnackbar:s}=(0,z.Ds)(),[c,u]=(0,L.useState)(!1),[p,x]=(0,L.useState)(!1),[v,f]=(0,L.useState)(null),[y,j]=(0,L.useState)(null),w=J.Z.chapters[n].find(e=>e.id===Number.parseInt(l||"0")),C=async()=>{u(!0);try{let l=await (0,ey.QI)({dcsCourseId:(null==w?void 0:w.dcs_subject_id)||"",dcsChapterId:(null==w?void 0:w.dcs_chapter_id)||""});if(null==l?void 0:l.success){var e,t,i,r,n,a;let o=(0,B.y$)((null==l?void 0:null===(e=l.data)||void 0===e?void 0:null===(t=e.reading_material)||void 0===t?void 0:t.content)||"",(null==l?void 0:null===(i=l.data)||void 0===i?void 0:null===(r=i.reading_material)||void 0===r?void 0:r.images_url)||{}),d=null==l?void 0:null===(n=l.data)||void 0===n?void 0:n.reading_material;if(d){let e={...d,content:o};f(e),j(null==l?void 0:null===(a=l.data)||void 0===a?void 0:a.mastery_progress)}else f(null);x((0,B.ND)(o||""))}else f(null),s(d("errorText"),"error")}catch(e){s(d("errorText"),"error")}finally{u(!1)}};return((0,L.useEffect)(()=>{i.isReady&&C()},[i.isReady]),c||void 0===v)?(0,a.jsx)(Z.Z,{maxWidth:"md",disableGutters:!t,children:(0,a.jsx)(N.default,{number:4})}):(0,a.jsxs)(Z.Z,{maxWidth:"md",disableGutters:!t||p,children:[null===v?(0,a.jsx)(h.Z,{style:{display:"flex",justifyContent:"center",padding:16},children:(0,a.jsx)(g.default,{children:d("ecoReadingContentEmpty")})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)(m.Z,{children:(null==v?void 0:v.reading_image)&&(0,a.jsx)(h.Z,{"data-testid":"concept-page-illustration",style:{marginLeft:t?85:0,marginRight:t?85:0},children:(0,a.jsx)(T(),{src:null==v?void 0:v.reading_image,alt:"illustration",width:800,height:400,style:{alignSelf:"center",borderRadius:t?8:0,objectFit:"contain",width:"100%",height:"auto",maxHeight:"300px"}})})})}),(0,a.jsxs)(m.Z,{gap:2,style:{marginTop:8},children:[p?(0,a.jsx)(eE.default,{useLargeScreenView:t,expression:(null==v?void 0:v.content)||"",loadingSkeletonNumber:4,textWidthInPercent:t?void 0:92,textMarginLeftInPercent:t?void 0:4,textMarginRightInPercent:t?void 0:4,showHorizontalScrollBarOnLongFormula:!0}):(0,a.jsx)(g.default,{variant:"body1",fontSize:t?24:18,dangerouslySetInnerHTML:{__html:v.content||""}}),(0,a.jsx)(b.Z,{margin:30}),(0,a.jsx)(h.Z,{style:{marginLeft:t?85:12,marginRight:t?85:12},children:y&&(0,a.jsx)(eP.default,{isCompleted:(null==y?void 0:y.star)>=(null==y?void 0:y.target_star),starsCollected:(null==y?void 0:y.star)||0,targetStars:(null==y?void 0:y.target_star)||0,isLoading:c,isReadingContent:!0},1)})]})]}),(0,a.jsx)(ex.default,{})]})};var eM=i(13816),eG=i(94904),eq=i(49905),eD=i(56465),eV=i(50297);let eU=u()(()=>Promise.resolve().then(i.bind(i,23830)),{loadableGenerated:{webpack:()=>[23830]},ssr:!1}),eJ=u()(()=>i.e(5922).then(i.bind(i,38560)),{loadableGenerated:{webpack:()=>[38560]},ssr:!1}),eQ=u()(()=>Promise.resolve().then(i.bind(i,49824)),{loadableGenerated:{webpack:()=>[49824]},ssr:!1});function eK(){var e;let{t}=(0,L.useContext)(o.d),i=(0,R.useRouter)(),r=i.query.cid,n=i.query.chapter_id,c=i.query.task_id,u=null===(e=null===J.Z||void 0===J.Z?void 0:J.Z.chapters[Number(r)])||void 0===e?void 0:e.find(e=>e.id===Number.parseInt(n||"0")),p=i.query.unit_id,h="true"===i.query.is_experiment,m=(0,eG.U)(),g=(0,Y.$V)("md"),x=(0,C.jf)(Number(r));return(0,V.Qf)({eventName:B.aG.pageVisitCoreConcept,eventCategory:V.Rg.core_concept,additionalProperties:{course_id:r,chapter_id:n,task_id:c}}),(0,L.useEffect)(()=>{eM.Z.checkSurveyGate(Number(r))},[r]),(0,a.jsx)(eD.i1,{children:(0,a.jsxs)(eq.Z,{theme:d.Wb,children:[x?(0,a.jsx)(eU,{styleAppBar:{padding:0},styleToolBar:{padding:0},children:(0,a.jsx)(Z.Z,{maxWidth:"lg",children:(0,a.jsx)(eQ,{backButtonTestId:"ArrowBackIcon",textStyle:{color:ef.J.Neutral900,fontFamily:d.BW.style.fontFamily,fontSize:18,marginLeft:"16
1px"},buttonIconStyle:{fontSize:g?32:26,color:ef.J.Neutral900},buttonColor:"transparent",text:t(h?"tfcExperiment":"unitReflection"),additionalComponent:(0,a.jsx)("div",{}),sx:{justifyContent:{xs:"flex-start",md:"space-between"}},action:()=>{(0,C.N1)(Number(r))&&(0,V.Hi)(B.aG.back,{Page_id:i.pathname.replace("/",""),Course_id:r,Chapter_id:n}),((0,C.Q_)(Number(r))||(0,C.jf)(Number(r)))&&(0,V.Hi)(B.aG.back,{Page_id:i.pathname.replace("/",""),Course_id:r,Chapter_id:n,Course_id_DCS:null==u?void 0:u.dcs_subject_id,Chapter_id_DCS:null==u?void 0:u.dcs_chapter_id,Sub_chapter_id:p})}})})}):(0,a.jsx)(eJ,{customLeftContent:(0,a.jsx)(es.Z,{htmlColor:s.w.White,fontSize:"large"}),customLeftContentStyles:g?{marginLeft:"-50px"}:{},useCloseActionOnly:!0,closeAction:()=>{var e;(0,V.Hi)(B.aG.back,{Page_id:i.pathname.replace("/",""),Course_id:r,Chapter_id:n,Sub_chapter_id:c});let t=(0,ed.H)("".concat(B.zb.playTaskList,"?cid=").concat(r,"&chapter_id=").concat(n));(null===(e=eo.Z.routes)||void 0===e?void 0:e.includes(t))?i.replace(t):m()}}),(0,a.jsx)(eV.X,{padTop:g?80:56,padBot:56,style:x?{minHeight:"100vh",backgroundColor:ef.J.Neutral50}:{},children:x?(0,a.jsx)(eA,{useLargeScreenView:g}):(0,C.N1)(Number(r))?(0,a.jsx)(l.P,{children:(0,a.jsx)(ev,{useLargeScreenView:g})}):(0,C.Jw)(Number(r))?(0,a.jsx)(eB,{useLargeScreenView:g}):(0,a.jsx)(eW,{useLargeScreenView:g})})]})})}},11468:function(e,t,i){"use strict";i.d(t,{U:function(){return n}});var r=i(26725);function n(e){if(!e||e.trim().length<3)return!1;let t=e.trim().split(/\s+/);if(0===t.length)return!1;let i=0;for(let e of t)(function(e){if(!e||e.trim().length<3)return!1;let t=e.trim();if(/^[^a-zA-Z0-9]+$/.test(t))return!0;let i=t.toLowerCase(),r=i.replaceAll(/[^a-z]/g,"");if(r.length<3)return!1;let n=(r.match(/[aeiou]/g)||[]).length,a=(r.match(/[bcdfghjklmnpqrstvwxyz]/g)||[]).length;if(0===n&&r.length>5||a>0&&n/a<.15&&r.length>4)return!0;let l=new Set;for(let e=0;e<=r.length-2;e++)l.add(r.substring(e,e+2));let o=l.size/(r.length-2+1);if(r.length>8&&o<.4||o<.25)return!0;for(let e of["qwertyuiop","asdfghjkl","zxcvbnm"])for(let t=3;t<=5;t++)for(let i=0;i<=e.length-t;i++){let n=e.substring(i,i+t),a=n.split("").reverse().join("");if(r.startsWith(n)||r.startsWith(a))return!0}return!!(/[bcdfghjklmnpqrstvwxyz]{4,}/i.test(t)||!/[aeiou]/i.test(t)&&t.length>3&&/^[a-zA-Z]+$/.test(t))})(e)&&i++;let n=i/t.length;return t.length>2?n>r.ir:n>=r.B2}}},function(e){e.O(0,[1664,6051,669,4045,628,8276,9195,622,7762,9774,2888,179],function(){return e(e.s=87177)}),_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.