1import{u as L,w as A,E,j as e,B as h}from"./index-DNWw9vL6.js";import{r as x,S as v,N as F,as as w,X as U,Z as z,q as D,i as y,W as I,$ as T,P as _,a0 as V}from"./vendor-ui-BEzN-rtg.js";import{B as q}from"./badge-CAn3Rvbr.js";import{S as k}from"./skeleton-D4qHMoUI.js";import"./vendor-react-qkC6yhPU.js";function X(){const{navigate:n}=L(),{removeFromCompare:p}=A(),r=x.useMemo(()=>(new URLSearchParams(window.location.search).get("ids")||"").split(",").map(a=>parseInt(a.trim(),10)).filter(a=>!isNaN(a)&&a>0),[]),[b,C]=x.useState([]),[j,u]=x.useState(!0);x.useEffect(()=>{if(r.length===0){u(!1);return}u(!0),Promise.all(r.map(s=>E(s,null))).then(s=>C(s)).finally(()=>u(!1))},[r.join(",")]);const l=x.useMemo(()=>b.filter(Boolean),[b]),f=s=>{if(!s.stats||s.stats.length===0)return null;const t=s.stats.map(a=>a.pass_rate).filter(a=>a!=null);return t.length===0?null:t.reduce((a,i)=>a+i,0)/t.length},g=(s,t)=>{if(l.length<2)return new Set;const a=l.map(o=>s==="avg_difficulty"?o.avg_difficulty:o.latest_pass_rate),i=a.filter(o=>o!=null);if(i.length<2)return new Set;const m=t==="max"?Math.max(...i):Math.min(...i);return new Set(l.filter((o,P)=>a[P]===m).map(o=>o.qual_id))},S=()=>{if(l.length<2)return new Set;const s=l.map(f),t=s.filter(i=>i!=null);if(t.length<2)return new Set;const a=Math.max(...t);return new Set(l.filter((i,m)=>s[m]!=null&&Math.abs(s[m]-a)<.01).map(i=>i.qual_id))},$=x.useMemo(()=>g("latest_pass_rate","max"),[l]),B=x.useMemo(()=>g("avg_difficulty","min"),[l]),M=x.useMemo(()=>S(),[l]),N=s=>s==null?"text-slate-500":s>70?"pass-high":s>=30?"pass-mid":"pass-low",R=s=>s==null?"text-slate-500":s>=7.5?"text-rose-400":s>=5?"text-amber-400":"text-emerald-400";return!j&&r.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh] space-y-6 text-center",children:[e.jsx("div",{className:"p-8 bg-slate-900 rounded-full",children:e.jsx(v,{className:"w-14 h-14 text-slate-700"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"ë¹êµí ì격ì¦ì ì ííì¸ì"}),e.jsx("p",{className:"text-slate-500 max-w-sm",children:"ìê²©ì¦ ëª©ë¡ì´ë ìì¸ íì´ì§ìì ìµë 3ê°ë¥¼ ì ííë©´ ì´ íì´ì§ìì ëëí ë¹êµí ì ììµëë¤."})]}),e.jsx(h,{onClick:()=>n("/certs"),className:"bg-blue-600 hover:bg-blue-700 text-white rounded-xl",children:"ìê²©ì¦ íìíë¬ ê°ê¸°"})]}):j?e.jsxs("div",{className:"space-y-8 pb-40",children:[e.jsx(k,{className:"h-10 w-64 bg-slate-900 rounded-xl"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx("div",{className:"grid gap-4 min-w-[560px]",style:{gridTemplateColumns:`160px repeat(${r.length}, 1fr)`},children:Array.from({length:(r.length+1)*10}).map((s,t)=>e.jsx(k,{className:"h-10 bg-slate-900 rounded-lg"},t))})})]}):e.jsxs("div",{className:"space-y-8 pb-40 max-w-5xl mx-auto",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs(h,{variant:"ghost",onClick:()=>n("/certs"),className:"text-slate-500 hover:text-white -ml-4 flex items-center gap-2",children:[e.jsx(F,{className:"w-4 h-4"})," ìê²©ì¦ ëª©ë¡"]}),e.jsxs("div",{className:"flex items-end justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(q,{variant:"outline",className:"border-blue-500/30 text-blue-400 px-3 py-1 flex items-center gap-1.5 w-fit",children:[e.jsx(v,{className:"w-3 h-3"})," ìê²©ì¦ ë¹êµ"]}),e.jsxs("h1",{className:"text-3xl font-bold text-white tracking-tight",children:[l.length,"ê° ìê²©ì¦ ë¹êµ ë¶ì"]}),e.jsx("p",{className:"text-slate-500 text-sm",children:"íëì ì
ì í´ë¹ í목ìì ê°ì¥ ì 리í ê°ì
ëë¤."})]}),l.length<3&&e.jsxs(h,{onClick:()=>n("/certs"),variant:"outline",className:"border-slate-700 text-slate-400 hover:text-white rounded-xl flex items-center gap-2",children:[e.jsx(w,{className:"w-4 h-4"})," ìê²©ì¦ ì¶ê°"]})]})]}),e.jsxs("p",{className:"sm:hidden text-[11px] text-slate-600 flex items-center gap-1.5 -mb-4",children:[e.jsx("span",{"aria-hidden":!0,children:"â"})," ì¢ì°ë¡ ì¤í¬ë¡¤íì¬ ë¹êµ ",e.jsx("span",{"aria-hidden":!0,
1children:"â"})]}),e.jsx("div",{className:"overflow-x-auto rounded-2xl border border-slate-800",tabIndex:0,"aria-label":"ìê²©ì¦ ë¹êµ í (ì¢ì° ì¤í¬ë¡¤ ê°ë¥)",children:e.jsxs("table",{className:"w-full border-collapse",style:{minWidth:`${160+l.length*220}px`},children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-800",children:[e.jsx("th",{className:"sticky left-0 z-20 bg-slate-950 w-40 min-w-[160px] px-6 py-5 text-left text-xs font-bold text-slate-600 uppercase tracking-wider",scope:"col"}),l.map(s=>e.jsx("th",{className:"px-6 py-5 text-left min-w-[200px] bg-slate-900/50",scope:"col",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{type:"button",onClick:()=>n(`/certs/${s.qual_id}`),className:"text-base font-bold text-white hover:text-blue-400 transition-colors text-left leading-snug rounded focus-ring",children:s.qual_name}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(q,{className:"bg-slate-800 text-slate-400 border-none text-[10px] px-1.5 py-0",children:s.qual_type||"â"}),s.is_active?e.jsx("span",{className:"text-[10px] text-emerald-500 font-bold",children:"ìíì¤"}):e.jsx("span",{className:"text-[10px] text-slate-500 font-bold",children:"ì¢
ë£"})]}),e.jsxs("button",{type:"button",onClick:()=>p(s.qual_id),className:"flex items-center gap-1 text-[11px] text-slate-600 hover:text-slate-400 transition-colors font-medium rounded focus-ring","aria-label":`${s.qual_name} ë¹êµ ì ê±°`,children:[e.jsx(U,{className:"w-3 h-3"})," ì ê±°"]})]})},s.qual_id))]})}),e.jsxs("tbody",{children:[e.jsx(d,{label:"í©ê²©ë¥ "}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(z,{className:"w-3.5 h-3.5 text-slate-500"}),label:"ìµê·¼ í©ê²©ë¥ "}),l.map(s=>{const t=s.latest_pass_rate,a=$.has(s.qual_id)&&t!=null;return e.jsx("td",{className:"px-6 py-4",children:t!=null?e.jsxs("div",{className:`space-y-1.5 ${a?"bg-blue-500/10 rounded-lg px-3 py-2 -mx-3":""}`,children:[e.jsxs("div",{className:`text-base font-black ${N(t)}`,children:[t,"%"]}),e.jsx("div",{className:"h-1.5 bg-slate-800 rounded-full overflow-hidden max-w-[80px]",children:e.jsx("div",{className:`h-full rounded-full ${t>70?"bg-emerald-500":t>=30?"bg-amber-500":"bg-rose-500"}`,style:{width:`${Math.min(t,100)}%`}})})]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"ì ë³´ ìì"})},s.qual_id)})]}),e.jsxs("tr",{className:"border-b border-slate-800/60 bg-slate-900/20 hover:bg-slate-900/30 transition-colors",children:[e.jsx(c,{icon:e.jsx(D,{className:"w-3.5 h-3.5 text-slate-500"}),label:"íê· í©ê²©ë¥ "}),l.map(s=>{const t=f(s),a=M.has(s.qual_id)&&t!=null;return e.jsxs("td",{className:"px-6 py-4",children:[t!=null?e.jsxs("span",{className:`text-sm font-bold ${N(t)} ${a?"bg-blue-500/10 rounded-lg px-2 py-1 -mx-2":""}`,children:[t.toFixed(1),"%"]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"ì ë³´ ìì"}),t!=null&&e.jsxs("span",{className:"text-[10px] text-slate-600 ml-1.5",children:["(",s.stats?.length||0,"íì°¨ íê· )"]})]},s.qual_id)})]}),e.jsx(d,{label:"ëì´ë"}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(y,{className:"w-3.5 h-3.5 text-slate-500"}),label:"íê· ëì´ë"}),l.map(s=>{const t=s.avg_difficulty,a=B.has(s.qual_id)&&t!=null;return e.jsx("td",{className:"px-6 py-4",children:t!=null?e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${a?"bg-blue-500/10 rounded-lg px-2 py-1 -mx-2":""}`,children:[e.jsx("span",{className:`text-base font-black ${R(t)}`,children:t.toFixed(1)}),e.jsx("span",{className:"text-[11px] text-slate-600",children:"/10"}),a&&e.jsx("span",{className:"text-[10px] text-blue-400 font-bold",children:"ê°ì¥ ì¬ì"})]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"ì ë³´ ìì"})},s.qual_id)})]}),e.jsx(d,{label:"ìì ì ë³´"}),e.jsxs("tr",{className:"border-b border-slate-800/60 bg-slate-900/20 hover:bg-slate-900/30 transition-colors",children:[e.jsx(c,{icon:e.jsx(I,{className:"w-3.5 h-3.5 text-slate-500"}),label:"ëì ììì"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm font-bold text-slate-300 tabular-nums",children:s.total_candidates?s.total_candidates.toLocaleStr
1ing("ko-KR")+"ëª
":"ì ë³´ ìì"})},s.qual_id))]}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(T,{className:"w-3.5 h-3.5 text-slate-500"}),label:"ìí 구ì±"}),l.map(s=>{const t=[];return(s.written_cnt||0)>0&&t.push(`í기 ${s.written_cnt}과목`),(s.practical_cnt||0)>0&&t.push(`ì¤ê¸° ${s.practical_cnt}과목`),(s.interview_cnt||0)>0&&t.push(`ë©´ì ${s.interview_cnt}과목`),e.jsx("td",{className:"px-6 py-4",children:t.length>0?e.jsx("div",{className:"space-y-0.5",children:t.map(a=>e.jsx("div",{className:"text-sm text-slate-300",children:a},a))}):e.jsx("span",{className:"text-slate-600 text-sm",children:"ì ë³´ ìì"})},s.qual_id)})]}),e.jsx(d,{label:"ì격 ë¶ë¥"}),e.jsxs("tr",{className:"border-b border-slate-800/60 bg-slate-900/20 hover:bg-slate-900/30 transition-colors",children:[e.jsx(c,{icon:e.jsx(_,{className:"w-3.5 h-3.5 text-slate-500"}),label:"ì격 ë±ê¸"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-slate-300 font-medium",children:s.grade_code||"ë±ê¸ ìì"})},s.qual_id))]}),e.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(y,{className:"w-3.5 h-3.5 text-slate-500"}),label:"ì§ë¬´ ë¶ë¥ (NCS)",title:"êµê°ì§ë¬´ë¥ë ¥íì¤(NCS) ê¸°ì¤ ì§ë¬´ ë¶ë¥ ì²´ê³"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-slate-300",children:[s.ncs_large,s.main_field].filter(Boolean).join(" ⺠")||"ì ë³´ ìì"})},s.qual_id))]}),e.jsxs("tr",{className:"hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(_,{className:"w-3.5 h-3.5 text-slate-500"}),label:"ê´ë¦¬ 기ê´"}),l.map(s=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-slate-400 leading-snug",children:s.managing_body||"ì ë³´ ìì"})},s.qual_id))]}),e.jsx(d,{label:"커리ì´"}),e.jsxs("tr",{className:"border-t border-slate-800/60 hover:bg-slate-900/20 transition-colors",children:[e.jsx(c,{icon:e.jsx(V,{className:"w-3.5 h-3.5 text-slate-500"}),label:"ê´ë ¨ ì§ë¬´"}),l.map(s=>{const t=s.jobs?.length||0;return e.jsx("td",{className:"px-6 py-4",children:t>0?e.jsxs("button",{type:"button",onClick:()=>n(`/certs/${s.qual_id}#jobs`),className:"text-sm font-bold text-blue-400 hover:text-blue-300 transition-colors rounded focus-ring",children:[t,"ê° ì§ë¬´ 보기"]}):e.jsx("span",{className:"text-slate-600 text-sm",children:"ë°ì´í° ìì"})},s.qual_id)})]})]})]})}),l.length<3&&e.jsxs("div",{className:"flex items-center gap-4 pt-4 border-t border-slate-800/50",children:[e.jsxs("p",{className:"text-sm text-slate-500",children:["ìµë 3ê°ê¹ì§ ë¹êµí ì ììµëë¤. ì§ê¸ ",l.length,"ê°ë¥¼ ë¹êµ ì¤ì
ëë¤."]}),e.jsxs(h,{onClick:()=>n("/certs"),variant:"outline",className:"border-slate-700 text-slate-400 hover:text-white rounded-xl text-sm",children:[e.jsx(w,{className:"w-4 h-4 mr-1.5"})," ì¶ê° ì í"]})]})]})}function d({label:n}){return e.jsx("tr",{children:e.jsx("td",{colSpan:100,className:"sticky left-0 px-6 py-2 text-[10px] font-black text-slate-600 uppercase tracking-[0.08em] bg-slate-950 border-b border-slate-800/60",children:n})})}function c({icon:n,label:p,title:r}){return e.jsx("td",{className:"sticky left-0 z-10 bg-slate-950 px-6 py-4 text-xs font-bold text-slate-500 whitespace-nowrap border-r border-slate-800/40",children:e.jsxs("div",{className:"flex items-center gap-2",children:[n,p,r&&e.jsx("span",{title:r,"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full border border-slate-700 text-slate-700 hover:border-slate-500 hover:text-slate-400 transition-colors cursor-help text-[9px] font-black leading-none select-none",children:"?"})]})})}export{X as CertComparePage};
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.