1import{c as h,b as g,r as n,j as e,m as p,aW as b,am as d}from"./main-DO3vLohi.js";import{C as f,a as j,b as N,A as v}from"./canonical-skills-DSlASvWM.js";import{L as y}from"./loader-circle-CwLuAjM1.js";const k=h({method:"GET"}).handler(g("597e9ad136f92dc94ed851215e8963b7d8d6e4209af1127c0a4c619ffde4a48b")),u=j.map(t=>({domain:t,atoms:N(t.value)}));function I(){const[t,s]=n.useState("catalog"),[a,r]=n.useState(""),l=o=>{s(o),r("")};return e.jsx(p,{children:e.jsxs("div",{className:"mx-auto flex max-w-5xl flex-col gap-6 p-6",children:[e.jsxs("header",{className:"border-b border-hairline pb-4",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-label text-text-muted",children:"Skill Builder"}),e.jsx("h1",{className:"mt-1 text-2xl font-bold text-text-strong",children:"Catalog"}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:"The free courses Chegg picked for every skill an internship might ask you to build, and the full skills vocabulary those recommendations are grounded in."})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx(w,{value:t,onChange:l}),e.jsx("input",{type:"search",value:a,onChange:o=>r(o.target.value),placeholder:t==="catalog"?"Filter â try 'sql' or 'python'":"Filter â try 'healthcare' or 'writing'","aria-label":t==="catalog"?"Filter catalog":"Filter skills tree","data-amp-track-surface":"catalog_page","data-amp-track-action":"filter","data-amp-track-target":t,className:"w-full rounded-md border border-hairline bg-surface-white px-3 py-1.5 text-sm outline-none focus-visible:border-orange sm:w-64"})]}),e.jsx("div",{role:"tabpanel",id:`tabpanel-${t}`,"aria-labelledby":`tab-${t}`,children:t==="catalog"?e.jsx(S,{filter:a}):e.jsx(F,{filter:a})})]})})}const C=[{key:"catalog",label:"Catalog"},{key:"tree",label:"Skills tree"}];function w({value:t,onChange:s}){return e.jsx("div",{role:"tablist","aria-label":"Catalog view",className:"inline-flex rounded-lg border border-hairline bg-surface-white p-0.5",children:C.map(a=>e.jsx(L,{tabKey:a.key,label:a.label,active:t===a.key,onClick:()=>t!==a.key&&s(a.key)},a.key))})}function L({tabKey:t,active:s,onClick:a,label:r}){return e.jsx("button",{type:"button",role:"tab",id:`tab-${t}`,"aria-selected":s,"aria-controls":`tabpanel-${t}`,onClick:a,"data-amp-track-surface":"catalog_page","data-amp-track-action":`tab_${t}`,className:d("rounded-md px-3 py-1.5 text-sm font-bold transition-colors",s?"bg-orange/10 text-orange":"text-text-muted hover:text-text-strong"),children:r})}function S({filter:t}){const s=b({queryKey:["skill-builder-public-catalog"],queryFn:()=>k(),staleTime:3e5,retry:!1}),a=n.useMemo(()=>E(s.data??[],t),[s.data,t]),r=n.useMemo(()=>(s.data??[]).reduce((l,o)=>l+o.entries.length,0),[s.data]);return s.isLoading?e.jsxs("div",{className:"flex items-center gap-3 text-text-muted",children:[e.jsx(y,{"aria-hidden":!0,className:"size-4 animate-spin"})," Loading catalogâ¦"]}):s.error?e.jsx("p",{className:"text-sm text-text-muted",children:"Couldn't load the catalog. Try again in a moment."}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-muted",children:[r," skill",r===1?"":"s"," with a picked course across ",(s.data??[]).length," domain",(s.data??[]).length===1?"":"s",". Every pick below is truly free and vetted."]}),a.length===0?e.jsxs("p",{className:"rounded-xl border border-dashed border-hairline p-6 text-sm text-text-muted",children:['No matches for "',t,'".']}):e.jsx("div",{className:"flex flex-col gap-8",children:a.map(l=>e.jsx(T,{domain:l},l.domainSlug))})]})}function T({domain:t}){return e.jsxs("section",{"aria-labelledby":`catalog-domain-${t.domainSlug}`,children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsx("h2",{id:`catalog-domain-${t.domainSlug}`,className:"text-lg font-bold text-text-strong",children:t.domainLabel}),e.jsx("span",{className:"text-xs text-text-muted",children:t.category})]}),e.jsx("ul",{className:"grid gap-2 md:grid-cols-2",children:t.entries.map(s=>e.jsx("li",{children:e.jsx(A,{entry:s})},s.atomSlug))})]})}function A({entry:t}){const s=$(t.format);return e.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer","data-amp-track-surface":"catalog_page","data-amp-track-action":"external_open","data-amp-track-target":"catalog_entry",className:d("group flex items-center justify-between gap-4 roun
1ded-xl border border-hairline bg-surface-white p-4","transition-colors hover:border-orange"),children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-[0.08em] text-text-muted",children:t.atomLabel}),e.jsx("div",{className:"mt-0.5 truncate font-bold text-text-strong",children:t.title}),e.jsxs("div",{className:"mt-0.5 text-xs text-text-muted",children:[s," from ",t.provider]})]}),e.jsx(v,{"aria-hidden":!0,className:"size-5 shrink-0 text-text-muted transition-colors group-hover:text-orange"})]})}function F({filter:t}){const s=n.useMemo(()=>q(u,t),[t]),a=f.length,r=u.length;return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-muted",children:[a," atomic skill",a===1?"":"s"," across"," ",r," domain",r===1?"":"s",". This is the vocabulary the gap engine recognizes â a resume or job posting skill that doesn't map here is silently dropped, so it shapes what the Skill Builder can teach."]}),s.length===0?e.jsxs("p",{className:"rounded-xl border border-dashed border-hairline p-6 text-sm text-text-muted",children:['No matches for "',t,'".']}):e.jsx("div",{className:"flex flex-col gap-8",children:s.map(l=>e.jsx(_,{row:l},l.domain.value))})]})}function _({row:t}){const{domain:s,atoms:a}=t;return e.jsxs("section",{"aria-labelledby":`tree-domain-${s.value}`,children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsx("h2",{id:`tree-domain-${s.value}`,className:"text-lg font-bold text-text-strong",children:s.label}),e.jsx("span",{className:"text-xs text-text-muted",children:s.category}),e.jsx("span",{className:d("rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-label",s.priority==="hero"?"bg-orange/10 text-orange":"bg-surface-raised text-text-muted"),children:s.priority}),e.jsxs("span",{className:"text-xs text-text-muted",children:[a.length," atom",a.length===1?"":"s"]})]}),a.length===0?e.jsx("p",{className:"rounded-xl border border-dashed border-hairline p-4 text-sm text-text-muted",children:"No atoms decompose from this domain yet â the gap engine can match the domain itself, but there's no finer-grained skill to teach against."}):e.jsx("ul",{className:"flex flex-wrap gap-2",children:a.map(r=>e.jsx("li",{children:e.jsx("span",{className:"inline-block rounded-full border border-hairline bg-surface-white px-3 py-1 text-xs font-bold text-text-strong",children:r.label})},r.value))})]})}function $(t){switch(t){case"video":return"Video";
1case"reading":return"Reading";case"interactive":return"Interactive";case"project":return"Project";default:return"Course"}}function E(t,s){const a=s.trim().toLowerCase();if(!a)return[...t];const r=[];for(const l of t){const i=l.domainLabel.toLowerCase().includes(a)||l.category.toLowerCase().includes(a)?l.entries:l.entries.filter(c=>c.atomLabel.toLowerCase().includes(a)||c.title.toLowerCase().includes(a)||c.provider.toLowerCase().includes(a));i.length>0&&r.push({...l,entries:i})}return r}function q(t,s){const a=s.trim().toLowerCase();if(!a)return t;const r=[];for(const l of t){const{domain:o,atoms:i}=l;if(o.label.toLowerCase().includes(a)||o.category.toLowerCase().includes(a)||o.value.toLowerCase().includes(a)){r.push(l);continue}const m=i.filter(x=>x.label.toLowerCase().includes(a)||x.value.toLowerCase().includes(a));m.length>0&&r.push({domain:o,atoms:m})}return r}export{I as component};
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.