PageSourceSearch

https://www.filetico.com/_next/static/chunks/pages/user/courses/[slug]-3a64a31de94ff4e6.js

js filetico.com collected 2026-10-02 00:51:51 UTC 5,168 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1295],{9213:function(e,r,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/courses/[slug]",function(){return o(94357)}])},94357:function(e,r,o){"use strict";o.r(r),o.d(r,{default:function(){return UserCoursePage}});var t=o(85893),l=o(67294),s=o(11163),n=o(6154),i=o(10149),a=o(16373),d=o(12386),c=o(65400),u=o.n(c),g=o(11187),h=o(59180),p=o(30744),v=o(20637);o(20171);let{Content:f,Sider:x}=a.default;function UserCoursePage(){var e,r,o,c,m,j;let y=(0,s.useRouter)(),{slug:C}=y.query,[_,b]=(0,l.useState)(null),[D,k]=(0,l.useState)(0),[w,E]=(0,l.useState)(!0),[S,A]=(0,l.useState)(0),[P,T]=(0,l.useState)(!0),B=(null==_?void 0:null===(e=_.lessons)||void 0===e?void 0:e[D])||{},I=(null==_?void 0:null===(r=_.lessons)||void 0===r?void 0:r[S])||null;(0,l.useEffect)(()=>{C&&loadCourse()},[C]),(0,l.useEffect)(()=>{(null==B?void 0:B.content)&&v.Z.highlightAll()},[B]),(0,l.useEffect)(()=>{let e=setTimeout(()=>{let e=document.querySelectorAll("pre code");e.forEach(e=>{e.classList.add("hljs"),v.Z.highlightElement(e)})},100);return()=>clearTimeout(e)},[null==B?void 0:B.content]);let loadProgress=async e=>{var r;let o=null===(r=localStorage.getItem("token"))||void 0===r?void 0:r.replace(/^"(.*)"$/,"$1");try{let r=await n.Z.get("/progress?courseId=".concat(e),{headers:{Authorization:"Bearer ".concat(o)}});r&&r.data&&r.data.currentLesson?(A(r.data.currentLesson||0),k(r.data.currentLesson||0)):(A(0),k(0))}catch(e){console.error("❌ Error cargando progreso")}},loadCourse=async()=>{try{let{data:e}=await n.Z.get("/course/".concat(C));console.log("data => ",e),b(e),await loadProgress(e._id),E(!1)}catch(e){g.ZP.error("Error cargando el curso"),y.push("/user/dashboard")}};if(w||!_)return(0,t.jsx)(i.default,{active:!0});let saveProgress=async e=>{var r;if(e<=S){console.log("⏩ Clase anterior, no se guarda progreso");return}let o=null===(r=localStorage.getItem("token"))||void 0===r?void 0:r.replace(/^"(.*)"$/,"$1");try{await n.Z.post("/progress",{courseId:_._id,lessonIndex:e},{headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer ".concat(o)}}),console.log("✅ Progreso guardado"),A(e)}catch(e){console.error("❌ Error guardando progreso:",e)}};return(0,t.jsxs)(a.default,{style:{minHeight:"100vh"},children:[(0,t.jsxs)(x,{collapsible:!0,collapsed:P,onCollapse:e=>T(e),width:250,style:{background:"#fff",overflow:"auto"},children:[(0,t.jsx)("h3",{style:{padding:P?"10px":"20px"},children:P?"\uD83D\uDCDA":_.title}),(0,t.jsx)(d.default,{mode:"inline",selectedKeys:[String(D)],onClick:e=>{let{key:r}=e;k(Number(r)),saveProgress(Number(r))},children:null===(o=_.lessons)||void 0===o?void 0:o.map((e,r)=>(0,t.jsx)(d.default.Item,{icon:(0,t.jsx)(h.Z,{}),children:P?r+1:"".concat(r+1,". ").concat(e.title)},r))})]}),(0,t.jsx)(a.default,{children:(0,t.jsxs)(f,{style:{padding:24},children:[(0,t.jsx)("div",{style:{marginBottom:20},children:(0,t.jsx)(u(),{type:"dashed",onClick:()=>T(!P),children:P?"\uD83D\uDCC2 Mostrar lecciones":"\uD83D\uDCC1 Ocultar lecciones"})}),S>0&&(0,t.jsxs)("div",{style:{backgroundColor:"#f0f5ff",borderLeft:"5px solid #1890ff",padding:"16px",marginBottom:"24px",borderRadius:"6px"},children:[(0,t.jsxs)("strong",{children:["\uD83D\uDCD8 Retomando desde la lecci\xf3n ",S+1,":"]})," ",null==I?void 0:I.title]}),(0,t.jsx)("h1",{style:{font:"700 4.4rem / 2rem 'VAG Rounded Std', sans-serif",fontSize:"x-large",marginBottom:"25px"},children:B.title}),(null===(c=B.video)||void 0===c?void 0:c.url)?(0,t.jsx)("div",{style:{marginBottom:20},children:(0,t.jsx)("video",{width:"100%",controls:!0,poster:(null===(m=_.image)||void 0===m?void 0:m.url)||"",children:(0,t.jsx)("source",{src:B.video.url,type:"video/mp4"})})}):null,B.videoUrl?(0,t.jsx)("div",{style:{marginBottom:20},children:(0,t.jsx)("div",{style:{textAlign:"center"},dangerouslySetInnerHTML:{__html:B.videoUrl}})}):null,(0,t.jsx)("div",{style:{whiteSpace:"pre-line",font:"1rem / 1.5rem 'Inter', sans-serif",width:"100%"},dangerouslySetInnerHTML:{__html:B.content}}),!B.content&&!B.videoUrl&&(0,t.jsx)("div",{style:{marginTop:20,textAlign:"center",backgroundColor:"#fff1b8",borderLeft:"5px solidrgb(255, 59, 24)",padding:"16px",marginBottom:"24px",borderRadius:"6px"},children:(0,t.jsx)("p",{children:"Estamos actualizando esta lecci\xf3n, vuelve en unas horas."})}),(null===(j=B.resources)||void 0===j?void 0:j.length)>0&&(0,t.jsxs)("div",{style:{marginTop:30},children:[(0,t.jsx)("h4",{children:"\uD83D\uDCCE Archivos adjuntos:"}),B.resources.map((e,r)=>(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsx)(u(),{type:"link",href:e.url,target:"_blank",icon:(0,t.jsx)(p.Z,{}),children:e.name||e.url.split("/").pop()})},r))]}),(0,t.jsxs)("div",{style:{marginTop:40},children:[(0,t.jsx)(u(),{type:"default",disabled:0===D,onClick:()=>k(e=>e-1),style:{marginRight:10},children:"Anterior"}),(0,t.jsx)(u(),{type:"primary",disabled:_.lessons&&D+1>=_.lessons.length,onClick:()=>{let e=D+1;k(e),saveProgress(e)},children:"Siguiente"})]})]})})]})}}},function(e){e.O(0,[5141,7315,6545,9417,3220,5400,2074,1602,996,149,2386,4237,8367,9774,2888,179],function(){return e(e.s=9213)}),_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.