import{_ as O,u as W,y as q,c as r,o as c,a as s,s as d,x as u,e as m,t,d as i}from"./app-C3pBWUn1.js";const z={class:"course-card h-100"},A={class:"card border-light theme-shadow overflow-hidden h-100"},G=["src"],H={class:"card-body pb-0"},J={class:"header-metadata"},K={class:"course-title fw-bold text-hover"},P={class:"card-text text-muted d-flex flex-column flex-xl-row gap-2 justify-content-between mb-3 mt-3 mt-md-0"},Q={key:0,class:"order-lg-2 order-xl-1 d-flex align-items-center"},R={key:0},U={key:0,class:"text-primary me-2"},X={key:1,class:"text-primary me-2"},Y={key:2,class:"text-muted text-decoration-line-through"},Z={key:3,class:"text-muted text-decoration-line-through"},ee={key:1},te={key:0,class:"text-primary me-2"},se={key:1,class:"text-muted text-decoration-line-through"},oe={key:1,class:"d-inline-flex w-auto align-self-center me-auto"},re={class:"badge bg-primary order-lg-2 order-xl-1 w-auto"},ce={class:"order-md-1 order-xl-2"},ae={class:"card-footer bg-white border-light py-0"},ne={class:"row"},ie={class:"col-12 col-sm-6 text-muted course-metadata py-2"},le={class:"d-block"},de={class:"d-block"},ue={class:"col-12 col-sm-6 my-auto"},me={__name:"CourseCard",props:{course:Object},setup(e){const n=W();function F(o){const a=window.innerWidth<=576?20:60;return o.length>a?o.slice(0,a)+"...":o}const I=o=>{if(o>=60){const l=Math.floor(o/60),a=o%60;return`${l} hour${l>1?"s":""}${a>0?` ${a} min`:""}`}return`${o} min`};return(o,l)=>{var h,_,y,g,x,b,f,v,k,w,D,$,C,j,L,B,E,N,S,V,M,T,p;const a=q("router-link");return c(),r("div",z,[s("div",A,[d(a,{to:"/details/"+e.course.id,class:"course-thumbnail-wrapper"},{default:u(()=>[s("img",{src:e.course.thumbnail,class:"course-thumbnail card-img-top object-fit-cover",alt:"..."},null,8,G)]),_:1},8,["to"]),s("div",H,[s("div",J,[d(a,{to:"/instructor/"+e.course.instructor.id,class:"text-decoration-none small d-block mb-1"},{default:u(()=>[m(t(e.course.instructor.name),1)]),_:1},8,["to"]),d(a,{to:`/details/${e.course.id}`,class:"text-decoration-none d-block mb-2"},{default:u(()=>[s("p",K,t(F(e.course.title)),1)]),_:1},8,["to"])]),s("div",P,[!((h=e.course)!=null&&h.is_free)&&!((_=e.course)!=null&&_.is_enrolled)?(c(),r("div",Q,[(y=e.course)!=null&&y.price?(c(),r("div",R,[((x=(g=i(n))==null?void 0:g.masterData)==null?void 0:x.currency_position)=="Left"?(c(),r("strong",U,t((f=(b=i(n))==null?void 0:b.masterData)==null?void 0:f.currency_symbol)+t(e.course.price),1)):(c(),r("strong",X,t(e.course.price)+t((k=(v=i(n))==null?void 0:v.masterData)==null?void 0:k.currency_symbol),1)),((D=(w=i(n))==null?void 0:w.masterData)==null?void 0:D.currency_position)=="Left"?(c(),r("span",Y,t((C=($=i(n))==null?void 0:$.masterData)==null?void 0:C.currency_symbol)+t(e.course.regular_price),1)):(c(),r("span",Z,t(e.course.regular_price)+t((L=(j=i(n))==null?void 0:j.masterData)==null?void 0:L.currency_symbol),1))])):(c(),r("div",ee,[((E=(B=i(n))==null?void 0:B.masterData)==null?void 0:E.currency_position)=="Left"?(c(),r("strong",te,t((S=(N=i(n))==null?void 0:N.masterData)==null?void 0:S.currency_symbol)+t(e.course.regular_price),1)):(c(),r("strong",se,t(e.course.regular_price)+t((M=(V=i(n))==null?void 0:V.masterData)==null?void 0:M.currency_symbol),1))]))])):(c(),r("div",oe,[s("span",re,[s("strong",null,t((T=e.course)!=null&&T.is_enrolled?o.$t("Enrolled"):o.$t("Free")),1)])])),s("span",ce,[l[0]||(l[0]=s("i",{class:"bi bi-star-fill me-2 text-warning"},null,-1)),s("strong",null,t(e.course.average_rating),1),m(" ("+t(e.course.review_count)+") ",1)])])]),s("div",ae,[s("div",ne,[s("div",ie,[s("small",le,t(I((p=e.course)==null?void 0:p.total_duration)),1),s("small",de,t(e.course.student_count)+" "+t(o.$t("Enrolled")),1)]),s("div",ue,[d(a,{to:`/details/${e.course.id}`,class:"small text-decoration-none text-dark d-flex justify-content-start justify-content-md-end align-items-center gap-2 py-3 py-md-0"},{default:u(()=>[m(t(o.$t("Details"))+" ",1),l[1]||(l[1]=s("i",{class:"bi bi-chevron-right goto-details-icon rounded-circle px-1 text-muted"},null,-1))]),_:1,__:[1]},8,["to"])])])])])])}}},_e=O(me,[["__scopeId","data-v-09103985"]]);export{_e as C};
