import{u,j as e,L as c,H as f}from"./vendor-BKmmeuxg.js";import{C as p,a as x,b as h}from"./card-D9_SJYq6.js";import{c as j}from"./utils-DxSsnXxD.js";import{B as b}from"./button-gradient-primary-CuKxTw1k.js";import{A as g,a as v,b as w}from"./avatar-j28afJTV.js";import{P as C}from"./progress-DinXkPLd.js";import{T as N}from"./tabs-D0Mbb5M5.js";import{S as y}from"./separator-_3LZ_wAA.js";import{T as z,a as _,b as T}from"./tabs-Ifouhv9A.js";import A from"./layout-DmOvRWqJ.js";import L from"./course-assignments-D1lp7tOn.js";import k from"./course-certificate-fjkWh12T.js";import H from"./course-live-classes-C1RYAHf1.js";import P from"./course-modules-DMAoU5XC.js";import F from"./course-quizzes-BQHOF3GI.js";import M from"./course-resources-SZ67v3YU.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./scroll-area-C8HGru-R.js";import"./sheet-DSvHVmaW.js";import"./use-screen-DU5n3V8C.js";import"./landing-layout-DQFYAk24.js";import"./index-CupQom6K.js";import"./app-logo-CmnEIwal.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";import"./dropdown-menu-DO-po5c1.js";import"./use-auth-NG-DQJrC.js";import"./appearance-D2z3xcjR.js";import"./app-BytVvUs_.js";/* empty css */import"./language-BFZ7KItL.js";import"./notification-CYMPYbAP.js";import"./popover-B4kBsMuI.js";import"./profile-toggle-CvHrFE0q.js";import"./index.browser-OxPLOBIU.js";import"./tab-lists-rr3mSx6y.js";import"./table-header-DVkEnG6Y.js";import"./table-DWOXv4Pu.js";import"./assignment-columns-BpMhsyAp.js";import"./badge-AQfLLMpR.js";import"./assignment-dialog-BX2OXkdJ.js";import"./dialog-B2gN9MvT.js";import"./assignment-details-DjTsLMXu.js";import"./richtor-CRcM6Du2.js";import"./assignment-submission-CLSFlMAW.js";import"./assignment-submission-form-Cp0WFuyh.js";import"./chunked-uploader-input-D0XPVOTS.js";import"./input-DM0goJrn.js";import"./input-error-LaPr_4wd.js";import"./loading-button-BnTVAMJ7.js";import"./label-HmIcv5Yx.js";import"./select-CD9o3HN1.js";import"./textarea-CyndvowL.js";import"./dynamic-marksheet-1vU1WSTz.js";import"./radio-group-C0C2vfl-.js";import"./jspdf.es.min-BFMcGtlR.js";import"./alert-D9uBQ7fu.js";import"./live-class-status-DRscMQ3s.js";import"./accordion-CNBvFN43.js";import"./lesson-CdmzyD25.js";import"./lesson-icons-B8irG92C.js";import"./quiz-BZYfHdul.js";import"./quiz-status-BtLnvahp.js";import"./quiz-result-dialog-DbuEXydd.js";const R=({course:r,watch_history:t,completion:s,className:o})=>{const{props:i}=u(),{translate:m}=i,{frontend:l,button:n}=m;return e.jsxs(p,{className:j("flex flex-col justify-between overflow-hidden !border md:flex-row",o),children:[e.jsx(x,{className:"h-[200px] w-full max-w-[360px] p-0",children:e.jsx("img",{src:r.thumbnail||"/assets/images/blank-image.jpg",alt:r.title,className:"h-full w-full object-cover",onError:a=>{const d=a.target;d.src="/assets/images/blank-image.jpg"}})}),e.jsxs(h,{className:"flex w-full flex-col justify-between p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-3 flex items-center gap-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(g,{className:"h-8 w-8",children:[e.jsx(v,{src:r.instructor.user.photo||"",alt:r.instructor.user.name,className:"object-cover"}),e.jsx(w,{children:"IM"})]}),e.jsx("p",{className:"text-sm font-medium",children:r.instructor.user.name})]})}),e.jsx("p",{className:"hover:text-secondary-foreground text-sm font-semibold",children:r.title})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"w-full space-y-2 pt-4 pb-2",children:[e.jsxs("p",{className:"text-muted-foreground flex items-center justify-between text-sm font-medium",children:[e.jsx("span",{children:l.progress}),e.jsxs("span",{children:[(s==null?void 0:s.completion)??0,"%"]})]}),e.jsx(C,{value:Number((s==null?void 0:s.completion)??0),className:"h-1.5"})]}),t&&e.jsx(b,{asChild:!0,shadow:!1,containerClass:"w-full",className:"to-primary-light hover:to-primary-light h-9 w-full",children:e.jsx(c,{href:route("course.player",{type:t.current_watching_type,watch_history:t.id,lesson_id:t.current_watching_id}),children:n.continue})})]})]})]})},q=r=>{const{tab:t,course:s,watchHistory:o,completion:i}=r,m=[{value:"modules",label:"Modules"},{value:"live_classes",label:"Live Classes"},{value:"assignments",label:"Assignments"},{value:"quizzes",label:"Quizzes"},{value:"resources",label:"Resources"},{value:"certificate",label:"Certificate"}],l=()=>{switch(t){case"modules":return e.jsx(P,{});case"live_classes":return e.jsx(H,{});case"assignments":return e.jsx(L,{});case"quizzes":return e.jsx(F,{});case"resources":return e.jsx(M,{});case"certificate":return e.jsx(k,{});default:return e.jsx(e.Fragment,{})}};return e.jsxs(e.Fragment,{children:[e.jsx(f,{title:s.title}),e.jsx(R,{course:s,watch_history:o,completion:i}),e.jsx(p,{className:"mt-6",children:e.jsxs(N,{value:t,className:"bg-card w-full overflow-hidden rounded-md",children:[e.jsx("div",{className:"overflow-x-auto overflow-y-hidden",children:e.jsx(z,{className:"bg-transparent px-0 py-6",children:m.map(({label:n,value:a})=>e.jsx(_,{value:a,className:"border-primary data-[state=active]:!bg-muted data-[state=active]:before:bg-primary relative flex cursor-pointer items-center justify-start gap-3 rounded-none bg-transparent px-8 py-4 text-start !shadow-none before:absolute before:right-0 before:bottom-0 before:left-0 before:h-1 before:rounded-t-xl data-[state=active]:before:content-['.']",asChild:!0,children:e.jsx(c,{href:route("student.course.show",{id:s.id,tab:a}),children:e.jsx("span",{children:n})})},a))})}),e.jsx(y,{className:"mt-[1px]"}),e.jsx(T,{value:t,className:"m-0 p-5",children:l()})]})})]})};q.layout=r=>e.jsx(A,{children:r,tab:"courses"});export{q as default};