PageSourceSearch

https://kube.academy/LearningPaths-DFoc6NfT.js

js kube.academy collected 2026-10-03 22:41:42 UTC 9,379 bytes, 1 lines download raw bytes

1import{u as R,c as _,d as A,bg as K,b as H,r as a,j as s,F as Q,y as $,am as V,a6 as X,a3 as O,bh as Y,a as Z,p as S,L as E,s as ee,bi as se,q as te,m as oe,h as ne,bj as re,o as B,D as M,bk as k,B as ae,bl as P,bm as ie,_ as ce,$ as le}from"./index-DkRXpVJl.js";import{B as he}from"./Banner-CvpNkb65.js";import{F as ue,a as de,N as me}from"./Filter-BUzT-gSZ.js";import{C as pe}from"./courseIcon-CU7Kb-yz.js";import{C as G}from"./clockIcon-VS_B82-U.js";import{C as Ce}from"./circleCheckIcon-DFgu01EO.js";import{p as W,M as U,r as q,C as z,a as J}from"./markdownCoverterToHTML-Bl-YjFcC.js";import"./icons-Ddl6WW3N.js";const xe="_pathsContainer_1jmok_1733",ge="_pathNodataContainer_1jmok_1739",fe="_pathNodataWrapper_1jmok_1746",I={pathsContainer:xe,pathNodataContainer:ge,pathNodataWrapper:fe},je="_courseCard_1shef_1733",_e="_imageContainer_1shef_1738",ve="_completedIcon_1shef_1745",Ne="_favoritesIcon_1shef_1750",ye="_accessFlag_1shef_1755",be="_courseCardContent_1shef_1767",Fe="_description_1shef_1773",we="_courseDescriptionBorder_1shef_1776",De="_countContainer_1shef_1783",Pe="_borderGray_1shef_1788",d={courseCard:je,imageContainer:_e,completedIcon:ve,favoritesIcon:Ne,accessFlag:ye,courseCardContent:be,description:Fe,courseDescriptionBorder:we,countContainer:De,borderGray:Pe},Le=e=>{const{courseData:i}=e,u=R();_(A);const o=_(K),{isAuthenticated:p}=H(),[y,f]=a.useState(!1),b=window.location.protocol,C=window.location.pathname,[v,N]=a.useState("");a.useEffect(()=>{e.courseData.description&&N(W(e.courseData.description))},[e.courseData.description]);const F=c=>{u(Y(c?"remove":"save",e.courseData.courseId,"course"))};return s.jsx(s.Fragment,{children:s.jsxs("div",{className:`${d.courseCard}`,children:[s.jsxs("div",{className:`${d.imageContainer}`,children:[s.jsx("img",{src:e.courseData.thumbLink,className:"w-100 ratio ratio-16x9 object-fit-cover rounded-2",alt:""})," ",p&&e.courseData.completedLesson===e.courseData.lessonsCount&&s.jsx("div",{className:`d-flex w-1.7 h-1.7 bg-primary text-primary-text rounded-full ${d.completedIcon}`,children:s.jsx("span",{className:"icon icon-solid icon-check m-auto",children:s.jsx(Ce,{color:"white",width:"12",height:"12"})})}),p&&s.jsxs("div",{className:d.favoritesIcon,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[s.jsx("span",{"data-tooltip-id":`fav-tooltip-${e.courseData.courseId}`,"data-tooltip-content":e.courseData.isFavorite?"Remove from favorites":"Add to favorites",className:`btn rounded-full btn-white w-1.7 h-1.7 min-h-0 p-0 ${e.courseData.isFavorite?"bg-primary hover:bg-primary-hover !text-white":""}`,onClick:c=>{c.preventDefault(),c.stopPropagation(),o||F(e.courseData.isFavorite)},children:e.courseData.isFavorite?s.jsx(Q,{color:"white",width:"11",height:"11"}):s.jsx("span",{children:y?s.jsx($,{color:"primary",width:"11",height:"11"}):s.jsx($,{color:"black",width:"11",height:"11"})})}),s.jsx(V,{id:`fav-tooltip-${e.courseData.courseId}`,place:"top"})]}),e.courseData.access==="Pro"&&s.jsx("div",{className:d.accessFlag,children:"Pro"})]}),s.jsxs("div",{className:d.courseCardContent,children:[s.jsx("h3",{className:"h4",children:e.courseData.title}),e.courseData.description&&s.jsx("div",{className:`mt-2 rich-text ${d.description}`,children:s.jsx(U,{rehypePlugins:[q],components:{ul:c=>s.jsx(J,{data:i.description,...c}),h2:c=>s.jsx(z,{baseUrl:b,pathname:C,...c})},children:v})}),s.jsx("div",{className:d.courseDescriptionBorder}),s.jsxs("div",{className:d.countContainer,children:[s.jsxs("div",{className:"icon-text",children:[s.jsx("span",{className:"icon icon-regular icon-book text-primary","aria-hidden":"true",children:s.jsx(X,{color:"primary",width:"12",height:"12"})}),s.jsxs("span",{className:"fix-baseline",children:[e.courseData.lessonsCount," Lessons"]})]}),s.jsx("div",{className:d.borderGray}),s.jsxs("div",{className:"icon-text",children:[s.jsx("span",{className:"icon icon-regular icon-clock text-primary","aria-hidden":"true",children:s.jsx(G,{color:"primary",width:"12",height:"12"})}),s.jsx("span",{className:"fix-baseline",children:O(e.courseData.duration)})]})]})]})]})})},Se="_pathCardContainer_se05y_1733",ke="_pathCardHeader_se05y_1743",Ie
1="_contentTitle_se05y_1746",Te="_learningPathTitle_se05y_1752",$e="_countContainer_se05y_1758",Ee="_startButton_se05y_1761",Be="_coursesContainer_se05y_1764",Me="_courseCardContainer_se05y_1769",g={pathCardContainer:Se,pathCardHeader:ke,contentTitle:Ie,learningPathTitle:Te,countContainer:$e,startButton:Ee,coursesContainer:Be,courseCardContainer:Me},Re=({data:e})=>{const i=Z(),u=window.location.protocol,o=window.location.pathname,[p,y]=a.useState(""),[f,b]=a.useState(0),[C,v]=a.useState(0),N=te(C,f),{isAuthenticated:F}=H(),c=(e==null?void 0:e.progressStatus)===S.NOT_STARTED?"Start Path":(e==null?void 0:e.progressStatus)===S.IN_PROGRESS?"Resume Path":"Restart Path",L=()=>{var j;let t=e==null?void 0:e.courses[0],n=!1;if(e==null||e.courses.map((l,h)=>{!n&&l.progressStatus!==S.COMPLETED&&(t=l,n=!0)}),t.completedLesson===0||t.completedLesson===t.lessonsCount)i(`/courses/${t.slug}/lessons/${t.lessons[0].slug}`);else{let l="";for(let h=0;h<((j=t==null?void 0:t.lessons)==null?void 0:j.length);h++)if((t==null?void 0:t.lessons[h].progressStatus)==="Not Started"){l=t==null?void 0:t.lessons[h].slug;break}l!==""&&i(`/courses/${t.slug}/lessons/${l}`)}};a.useEffect(()=>{if(e.description&&y(W(e.description)),e.courses.length>0){let t=0,n=0;e.courses.forEach(j=>{t+=j.lessonsCount,n+=j.completedLesson}),b(t),v(n)}},[e]);const w=({children:t})=>s.jsx(J,{data:e.description,children:t}),r=({children:t})=>s.jsx(z,{baseUrl:u,pathname:o,children:t});return s.jsxs("div",{className:g.pathCardContainer,children:[s.jsxs("div",{className:g.pathCardHeader,children:[s.jsx("h2",{className:g.contentTitle,children:"Learning Path"}),s.jsx(E,{to:`/paths/${e.slug}`,rel:"noopener noreferrer","data-tooltip-id":e.title,children:s.jsx("h2",{className:g.learningPathTitle,children:e.title})}),e.description&&s.jsx("div",{className:"rich-text",children:s.jsx(U,{rehypePlugins:[q],components:{ul:w,h2:r},children:p})}),s.jsx("div",{className:`d-flex flex-wrap align-items-center gap-6 ${g.countContainer}`,children:((e==null?void 0:e.courseCount)>0||(e==null?void 0:e.duration)>0)&&s.jsxs("div",{className:"d-flex align-items-center gap-6 text-14 text-gray-600 mt-auto",children:[(e==null?void 0:e.courseCount)>0&&s.jsxs("div",{className:"icon-text",children:[s.jsx(pe,{color:"primary",width:"16",height:"14"}),s.jsxs("span",{className:"fix-baseline",children:[e==null?void 0:e.courseCount,(e==null?void 0:e.courseCount)===1?" Course":" Courses"]})]}),(e==null?void 0:e.courseCount)>0&&(e==null?void 0:e.duration)>0&&s.jsx("div",{className:"h-4 border-left border-gray-300"}),(e==null?void 0:e.duration)>0&&s.jsxs("div",{className:"icon-text",children:[s.jsx(G,{color:"primary",width:"12",height:"12"}),s.jsx("span",{className:"fix-baseline",children:O(e==null?void 0:e.duration)})]}),F&&f>0&&N>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-4 border-left border-gray-300"}),s.jsxs("span",{className:"text-gray-500",children:[N,"% Completed"]})]})]})}),s.jsx(ee,{className:g.startButton,onClick:t=>{t.preventDefault(),t.stopPropagation(),L()},children:s.jsx("span",{className:"fix-baseline fw-semibold testing",children:c})})]}),s.jsx("div",{className:g.coursesContainer,children:e==null?void 0:e.courses.map(t=>s.jsx(E,{to:se(t.tenantId,t.slug),rel:"noopener noreferrer","data-tooltip-id":e.title,children:s.jsx("div",{className:g.courseCardContainer,children:s.jsx(Le,{courseData:t})},`course-${t.slug}`)}))})]},`path-container-${e.slug}`)},Je=()=>{const e=_(A),i=R(),u=_(oe),{filtersSelected:o,filters:p,searchParam:y}=_(r=>r.paths.pathsList),f=_(ne),b=_(re),[C,v]=a.useState([]),[N,F]=a.useState(p),c=()=>{i(P([]))},L=(r,t)=>p.map(n=>{const j=n.options.map(l=>{let h=0;const T=t.filter(m=>m.category!==n.categoryName),D=T.length>0?k(r,T):r;return n.categoryName==="level"?h=D.filter(m=>{var x;return(x=m.level)==null?void 0:x.includes(l.name)}).length:n.categoryName==="topic"?h=D.filter(m=>{var x;return(x=m.topic)==null?void 0:x.includes(l.name)}).length:n.categoryName==="status"?h=D.filter(m=>{var x;return((x=m.progressStatus)==null?void 0:x.toLowerCase())===l.name.toLowerCase()}).length:n.categoryName==="favorite"?h=D.filter(m=>m.isFavorite).length:h=l.count,{...l,count:h}});return{...n,options:j}}),w=(r,t,n)=>{i(n?P(ce(o,r,t)):P(le(o,r,t)))};return a.useEffect(()=>{i(B(e)),M("Learning Paths",e)},[i,e]),a.useEffect(()=>
1{v(k(u,o))},[u,o]),a.useEffect(()=>{i(B(e)),M("Learning Paths",e)},[i,e]),a.useEffect(()=>{v(k(u,o))},[u,o]),a.useEffect(()=>{const r=L(u,o);F(r)},[u,o,p]),!f&&b?s.jsxs(s.Fragment,{children:[s.jsx(he,{page:ae.paths}),s.jsx(ue,{filterOptions:N,onToggleChecked:w,filtersSelected:o}),s.jsxs("div",{className:`g-0 ${I.pathsContainer}`,children:[C.length>0&&o.length>0&&s.jsx("div",{children:s.jsx(de,{filteredItemsCount:C.length,filtersSelected:o,onItemClick:w,onReset:c,contentType:"path"})}),s.jsx("div",{children:u.length>0?C.length===0?s.jsx(me,{searchParam:y,setSearchParam:ie,setFilterSelected:P}):C.map((r,t)=>s.jsx(Re,{data:r},r.pathId)):s.jsx("div",{className:I.pathNodataContainer,children:s.jsx("div",{className:I.pathNodataWrapper,children:s.jsx("h2",{className:"text-gray-500",children:"No learning paths currently available"})})})})]})]}):s.jsx(s.Fragment,{})};export{Je as default};

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.