(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60573],{85812:(e,s,l)=>{Promise.resolve().then(l.bind(l,89750))},89750:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>p});var a=l(95155),t=l(12115),r=l(73321),i=l(98500),n=l.n(i),d=l(8267),c=l(66451),o=l(2581),x=l(64593),m=l(25160),h=l(30672);function g(){return(0,a.jsxs)("div",{className:"h-screen flex flex-col bg-gray-50",children:[(0,a.jsxs)("div",{className:"h-14 flex-shrink-0 bg-gray-900 flex items-center gap-3 px-4 lg:px-6",children:[(0,a.jsx)("div",{className:"h-9 w-9 rounded-md bg-white/10 animate-pulse"}),(0,a.jsx)("div",{className:"h-6 w-px bg-white/20 hidden sm:block"}),(0,a.jsx)("div",{className:"h-5 w-48 bg-white/10 rounded animate-pulse"}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("div",{className:"h-8 w-24 bg-white/10 rounded animate-pulse hidden sm:block"})]}),(0,a.jsxs)("div",{className:"flex-1 flex min-h-0",children:[(0,a.jsx)("main",{className:"flex-1 min-w-0 p-4 lg:p-6",children:(0,a.jsxs)("div",{className:"max-w-4xl mx-auto space-y-4",children:[(0,a.jsx)("div",{className:"aspect-video w-full max-w-3xl mx-auto bg-gray-200 rounded-lg animate-pulse"}),(0,a.jsx)("div",{className:"h-6 w-2/3 bg-gray-200 rounded animate-pulse"}),(0,a.jsx)("div",{className:"h-4 w-full bg-gray-200 rounded animate-pulse"}),(0,a.jsx)("div",{className:"h-4 w-5/6 bg-gray-200 rounded animate-pulse"})]})}),(0,a.jsx)("aside",{className:"hidden lg:flex w-96 flex-shrink-0 border-l border-gray-200 bg-white p-4 flex-col gap-4",children:[1,2,3,4,5].map(e=>(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"h-4 w-3/4 bg-gray-200 rounded animate-pulse"}),(0,a.jsx)("div",{className:"space-y-1 pl-2",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-3 w-full bg-gray-100 rounded animate-pulse"},e))})]},e))})]})]})}function u({children:e,params:s}){let{course:l,chapters:r,lessons:i,completedLessonIds:o,progressPercent:h}=(0,x.w)(),{sidebarOpen:g,toggleSidebar:u,closeSidebar:p,closeSidebarIfMobile:f}=(0,m.m)(),b=s.lessonId,j=(0,t.useMemo)(()=>{let e=i.filter(e=>e&&"string"==typeof e.title&&e.title.trim().length>0);if(!r.length||!e.length)return e.slice().sort((e,s)=>e.order-s.order);let s=[];for(let l of r){let a=e.filter(e=>e.chapterId===l.id).sort((e,s)=>e.order-s.order);s.push(...a)}return[...s,...e.filter(e=>!r.some(s=>s.id===e.chapterId)).sort((e,s)=>e.order-s.order)]},[r,i]);return l?(0,a.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden bg-gray-50",children:[(0,a.jsxs)("header",{className:"h-14 flex-shrink-0 bg-gray-900 text-white flex items-center justify-between px-4 lg:px-6 z-30 shadow-lg",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)(n(),{href:`/courses/${l.id}`,className:"p-2 hover:bg-white/10 rounded transition-colors flex-shrink-0",children:(0,a.jsx)(d.UZh,{className:"w-5 h-5"})}),(0,a.jsx)("div",{className:"h-6 w-px bg-white/20 hidden sm:block"}),(0,a.jsx)("h1",{className:"text-base font-bold truncate max-w-[180px] sm:max-w-sm",children:l.title})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("div",{className:"hidden sm:flex flex-col items-end",children:[(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-gray-400",children:"Progress"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-24 h-1.5 bg-white/20 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-emerald-400 transition-all duration-300",style:{width:`${h}%`}})}),(0,a.jsxs)("span",{className:"text-xs font-bold",children:[h,"%"]})]})]}),(0,a.jsx)("button",{type:"button",onClick:u,className:"p-2 hover:bg-white/10 rounded transition-colors lg:hidden","aria-label":g?"Close playlist":"Open playlist",children:g?(0,a.jsx)(d.U_s,{className:"w-5 h-5"}):(0,a.jsx)(d.TF4,{className:"w-5 h-5"})})]})]}),(0,a.jsxs)("div",{className:"flex-1 flex min-h-0 relative",children:[(0,a.jsx)("main",{className:"flex-1 min-w-0 overflow-y-auto bg-gray-50 p-4 lg:p-6",children:(0,a.jsx)("div",{className:"max-w-4xl mx-auto",children:e})}),g&&(0,a.jsx)("button",{type:"button",className:"fixed inset-0 top-14 z-30 bg-black/40 lg:hidden","aria-label":"Close playlist",onClick:p}),(0,a.jsxs)("aside",{className:`
            flex flex-col bg-white border-l border-gray-200 shadow-xl
            fixed top-14 bottom-0 right-0 z-40 w-full max-w-sm
            transition-transform duration-200 ease-out
            ${g?"translate-x-0":"translate-x-full"}
            lg:relative lg:top-auto lg:bottom-auto lg:right-auto lg:z-20 lg:w-96 lg:max-w-none lg:flex-shrink-0 lg:translate-x-0 lg:shadow-none
          `,children:[(0,a.jsxs)("div",{className:"p-4 border-b border-gray-100 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-sm font-bold text-gray-900 uppercase tracking-wider lg:hidden truncate",children:l.title}),(0,a.jsx)("h2",{className:"text-sm font-bold text-gray-900 uppercase tracking-wider hidden lg:block",children:"Course content"}),(0,a.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[j.length," lessons \xb7"," ",j.filter(e=>o.has(e.id)).length," completed",(0,a.jsxs)("span",{className:"lg:hidden",children:[" \xb7 ",h,"%"]})]})]}),(0,a.jsx)("button",{type:"button",onClick:p,className:"p-2 hover:bg-gray-100 rounded transition-colors lg:hidden shrink-0","aria-label":"Close playlist",children:(0,a.jsx)(d.U_s,{className:"w-5 h-5 text-gray-700"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,a.jsx)("ul",{className:"divide-y divide-gray-100 pb-24",children:j.map((e,s)=>{let t=b===e.id,r=o.has(e.id);return(0,a.jsx)("li",{children:(0,a.jsxs)(n(),{href:`/courses/${l.id}/learn/${e.id}`,onClick:f,className:`
                        flex items-center gap-3 px-4 py-3 text-left transition-colors
                        ${t?"bg-[var(--primary-50)] text-[var(--primary-700)]":"hover:bg-gray-50 text-gray-700"}
                      `,children:[(0,a.jsx)("span",{className:"flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold bg-gray-200 text-gray-600",children:s+1}),(0,a.jsx)("span",{className:"flex-shrink-0 text-gray-400",children:(0,a.jsx)(c.U,{lesson:e,variant:"marketing",size:"sm"})}),(0,a.jsx)("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:e.title}),null!=e.videoDuration&&e.videoDuration>0&&(0,a.jsxs)("span",{className:"flex-shrink-0 text-xs text-gray-400",children:[Math.floor(e.videoDuration/60),"m"]}),r&&(0,a.jsx)(d.OLr,{className:"flex-shrink-0 w-5 h-5 text-emerald-500"})]})},e.id)})})})]})]})]}):null}function p({children:e,params:s}){let l=(0,t.use)(s),i=(0,r.useRouter)(),n=(0,r.usePathname)(),d=l.id,c=l.lessonId,m=(0,t.useCallback)(()=>{i.push(`/login?redirect=${encodeURIComponent(n||"")}`)},[n,i]),{authLoading:p,loading:f,loadError:b,course:j,contextValue:N,setRetryCount:w}=(0,h.K)({courseId:d,lessonId:c,learnBasePath:`/courses/${d}/learn`,onUnauthenticated:m});return((0,t.useEffect)(()=>{b&&(0,o.Qg)(b)},[b]),p||f)?(0,a.jsx)(g,{}):b&&!j?(0,a.jsx)("div",{className:"h-screen flex items-center justify-center bg-gray-50 px-4",children:(0,a.jsxs)("div",{className:"w-full max-w-lg rounded-xl border border-gray-200 bg-white p-6 text-center shadow-sm",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Unable to open this course"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:b}),(0,a.jsxs)("div",{className:"mt-5 flex flex-wrap items-center justify-center gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>w(e=>e+1),className:"inline-flex items-center rounded-md bg-[var(--primary-700)] px-4 py-2 text-sm font-medium text-white hover:bg-[var(--primary-800)] transition-colors",children:"Retry"}),(0,a.jsx)("button",{type:"button",onClick:()=>i.push(`/courses/${d}`),className:"inline-flex items-center rounded-md border border-gray-200 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors",children:"Back to course"})]})]})}):j?(0,a.jsx)(x.A,{value:N,children:(0,a.jsx)(u,{params:l,children:e})}):null}}},e=>{e.O(0,[24777,92619,59185,98500,37931,76541,92106,22283,28441,93794,77358],()=>e(e.s=85812)),_N_E=e.O()}]);