1import{b as m,j as e}from"./react-core-vendor-BYU1lc6_.js";import{u as Q,t as i,C as s,B as r}from"./index-tz1if3Qb.js";import{B as U}from"./badge-BXHeVMDm.js";import{L as _}from"./router-vendor-C6WQLFPl.js";import{t as o}from"./react-dom-vendor-DP7iwX5j.js";import{D as M,a as q,b as $,c as z}from"./dialog-DLHI93Z9.js";import{I as O}from"./input-D3THlcXi.js";import{L as R}from"./label-FSycdNgc.js";import{x as T,F as H,w as y,ap as v,g as p,u as j,Y,M as b}from"./icons-vendor-2DcWnZLX.js";import"./ui-vendor-Ca4nMe5D.js";import"./charts-vendor-Sd7wU2Xd.js";const N={pending_payment:{label:"ì
ê¸ ë기",icon:v,color:"text-yellow-500"},pending_approval:{label:"ì¹ì¸ ë기",icon:j,color:"text-blue-500"},issued:{label:"ë°ê¸ ìë£",icon:y,color:"text-green-500"},rejected:{label:"ë°ë ¤",icon:j,color:"text-red-500"}};function ce(){const{user:w,isAuthenticated:l}=Q({redirectOnUnauthenticated:!0}),{data:g,isLoading:I}=i.certificates.myCertificates.useQuery(void 0,{enabled:l}),{data:D}=i.enrollments.myEnrollments.useQuery(void 0,{enabled:l}),{data:A}=i.exams.myAttempts.useQuery(void 0,{enabled:l}),k=i.useUtils(),[f,d]=m.useState(null),[n,x]=m.useState(""),[E,u]=m.useState(!1),F=async()=>{if(!(!n||!f)){u(!0);try{o.success(`${n} 주ìë¡ ìê²©ì¦ PDF ë§í¬ë¥¼ ë°ì¡íìµëë¤.`),d(null),x("")}catch{o.error("ì´ë©ì¼ ë°ì¡ì ì¤í¨íìµëë¤.")}finally{u(!1)}}},h=i.certificates.request.useMutation({onSuccess:t=>{o.success(`ìê²©ì¦ ë°ê¸ ì ì²ì´ ìë£ëììµëë¤. (${t.certificateNumber})`),k.certificates.myCertificates.invalidate()},onError:t=>{o.error(t.message||"ì ì²ì ì¤í¨íìµëë¤.")}});if(!l)return null;const S=(D??[]).filter(t=>t.status==="completed"),C=(A??[]).filter(t=>t.passed),B=new Set((g??[]).map(t=>t.courseId)),P=S.filter(t=>{const a=C.some(L=>L.enrollmentId===t.id),c=B.has(t.courseId);return a&&!c});return e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:71",className:"min-h-screen bg-background",children:e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:72",className:"max-w-4xl mx-auto p-6",children:[e.jsxs(_,{"data-loc":"client/src/pages/CertificatePage.tsx:73",href:"/dashboard",className:"flex items-center gap-2 text-primary hover:text-primary/80 mb-6",children:[e.jsx(T,{"data-loc":"client/src/pages/CertificatePage.tsx:74",className:"w-4 h-4"})," ëìë³´ëë¡ ëìê°ê¸°"]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:77",className:"space-y-8",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:78",children:[e.jsx("h1",{"data-loc":"client/src/pages/CertificatePage.tsx:79",className:"text-3xl font-bold text-foreground mb-2",children:"ìê²©ì¦ ë°ê¸"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:80",className:"text-muted-foreground",children:"ê³¼ì ìë£ ë° ìí í©ê²© í ì격ì¦ì ë°ê¸ë°ì ì ììµëë¤."})]}),e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:84",className:"p-8 bg-card border border-border",children:[e.jsx("h2",{"data-loc":"client/src/pages/CertificatePage.tsx:85",className:"font-bold mb-6",children:"ë°ê¸ íë¡ì¸ì¤"}),e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:86",className:"grid md:grid-cols-4 gap-4",children:[{step:1,title:"ê³¼ì ìë£",desc:"êµì¡ ê³¼ì ì 모ë ì´ìí©ëë¤.",icon:H},{step:2,title:"ìí í©ê²©",desc:"ì¨ë¼ì¸ í기ìíì í©ê²©í©ëë¤.",icon:y},{step:3,title:"ë°ê¸ë¹ ì
ê¸",desc:"무íµì¥ ì
ê¸ì¼ë¡ ë°ê¸ë¹ë¥¼ ë©ë¶í©ëë¤.",icon:v},{step:4,title:"ìê²©ì¦ ë°ê¸",desc:"ê´ë¦¬ì ì¹ì¸ í PDF ë¤ì´ë¡ë",icon:p}].map(t=>e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:93",className:"text-center space-y-2",children:[e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:94",className:"w-12 h-12 rounded-full bg-secondary/10 flex items-center justify-center mx-auto",children:e.jsx(t.icon,{"data-loc":"client/src/pages/CertificatePage.tsx:95",className:"w-6 h-6 text-secondary"})}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:97",className:"text-xs text-secondary font-medium",children:["STEP ",t.step]}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:98",className:"font-semibold text-sm text-foreground",children:t.title}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:99",className:"text-xs text-muted-foreground",children:t.desc})]},t.step))})]}),P.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:107",className:"mb-8",children:[e.jsx("h2",{"data-loc":"client/src/pages/CertificatePage.tsx:108",className:"font-bold mb-4 text-foreground",children:"ë°ê¸ ê°ë¥í ì격ì¦"}),e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:109",className:"space-y-4",children:P.map(t=>{const a=C.find(c=>c.enrollmentId===t.id);return e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:113",className:"p-5 flex items-center justify-between bg-card border border-border",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:114",className:"flex items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:115",className:"w-10 h-10 rounded-lg bg-green-500/10 flex items-center justify-center",children:e.jsx(p,{"data-loc":"client/src/pages/CertificatePage.tsx:116",className:"w-5 h-5 text-green-500"})}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:118",children:[e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:119",className:"font-semibold text-foreground",children:["ê³¼ì #",t.courseId," ì격ì¦"]}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:120",className:"text-xs text-muted-foreground",children:"ìë£ ìë£ Â· ìí í©ê²©"})]})]}),e.jsx(r,{"data-loc":"client/src/pages/CertificatePage.tsx:123",className:"bg-primary text-primary-foreground hover:bg-primary/90",onClick:()=>h.mutate({courseId:t.courseId,enrollmentId:t.id,examAttemptId:a?.id}),disabled:h.isPending,children:"ë°ê¸ ì ì²"})]},t.id)})})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:142",children:[e.jsx("h2",{"data-loc":"client/src/pages/CertificatePage.tsx:143",className:"font-bold mb-4 text-foreground",children:"ë´ ìê²©ì¦ íí©"}),I?e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:145",className:"space-y-4",children:[1,2].map(t=>e.jsx(s,{"data-loc":"client/src/pages/CertificatePage.tsx:145",className:"p-4 animate-pulse h-20 bg-card border border-border"},t))}):(g??[]).length===0?e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:147",className:"p-12 text-center bg-card border border-border",children:[e.jsx(p,{"data-loc":"client/src/pages/CertificatePage.tsx:148",className:"w-12 h-12 mx-auto text-muted-foreground
1/50 mb-4"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:149",className:"text-muted-foreground",children:"ë°ê¸ ì ì²í ì격ì¦ì´ ììµëë¤."}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:150",className:"text-xs text-muted-foreground mt-2",children:"ê³¼ì ìë£ ë° ìí í©ê²© í ë°ê¸ ì ì²ì´ ê°ë¥í©ëë¤."})]}):e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:153",className:"space-y-4",children:(g??[]).map(t=>{const a=N[t.status]||N.pending_payment,c=a.icon;return e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:158",className:"p-5 bg-card border border-border",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:159",className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:160",className:"flex items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:161",className:"w-10 h-10 rounded-lg bg-secondary/10 flex items-center justify-center",children:e.jsx(c,{"data-loc":"client/src/pages/CertificatePage.tsx:162",className:`w-5 h-5 ${a.color}`})}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:164",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:165",className:"font-semibold font-mono text-foreground",children:t.certificateNumber}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:166",className:"text-xs text-muted-foreground",children:["ê³¼ì #",t.courseId]})]})]}),e.jsx(U,{"data-loc":"client/src/pages/CertificatePage.tsx:169",variant:t.status==="issued"?"default":"secondary",children:a.label})]}),t.status==="pending_payment"&&e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:176",className:"mt-4 p-4 bg-secondary/5 rounded-lg border border-secondary/20",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:177",className:"text-sm font-semibold text-foreground mb-3",children:"무íµì¥ ì
ê¸ ìë´"}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:178",className:"space-y-2 text-sm text-muted-foreground",children:[e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:179",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:179",className:"font-semibold text-foreground",children:"ì
ê¸ ê³ì¢:"})," êµë¯¼ìí 123-456-789"]}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:180",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:180",className:"font-semibold text-foreground",children:"ìê¸ì£¼:"})," ìììì½ì¹ì¼í°"]}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:181",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:181",className:"font-semibold text-foreground",children:"ì
ê¸ì¡:"})," 50,000ì"]}),e.jsxs("p",{"data-loc":"client/src/pages/CertificatePage.tsx:182",children:[e.jsx("span",{"data-loc":"client/src/pages/CertificatePage.tsx:182",className:"font-semibold text-foreground",children:"ì
ê¸ í:"})," ê´ë¦¬ì íì¸ í ì격ì¦ì´ ë°ê¸ë©ëë¤."]})]})]}),t.status==="pending_approval"&&e.jsx("div",{"data-loc":"client/src/pages/CertificatePage.tsx:189",className:"mt-4 p-4 bg-blue-50 rounded-lg border border-blue-200",children:e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:190",className:"text-sm text-blue-800",children:"ì
ê¸ì´ íì¸ëììµëë¤. ê´ë¦¬ìì ì¹ì¸ì 기ë¤ë ¤ì£¼ì¸ì."})}),t.status==="issued"&&t.pdfUrl&&e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:196",className:"mt-4 flex gap-2 flex-wrap",children:[e.jsx(r,{"data-loc":"client/src/pages/CertificatePage.tsx:197",size:"sm",variant:"outline",className:"border-primary text-primary hover:bg-primary/10",asChild:!0,children:e.jsxs("a",{"data-loc":"client/src/pages/CertificatePage.tsx:198",href:t.pdfUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Y,{"data-loc":"client/src/pages/CertificatePage.tsx:199",className:"w-4 h-4 mr-1"})," PDF ë¤ì´ë¡ë"]})}),e.jsxs(r,{"data-loc":"client/src/pages/CertificatePage.tsx:202",size:"sm",variant:"outline",className:"border-yellow-500 text-yellow-700 hover:bg-yellow-50",onClick:()=>{d({certId:t.id,pdfUrl:t.pdfUrl}),x(w?.email||"")},children:[e.jsx(b,{"data-loc":"client/src/pages/CertificatePage.tsx:208",className:"w-4 h-4 mr-1"})," ì´ë©ì¼ë¡ ë°ê¸°"]})]})]},t.id)})})]}),e.jsx(M,{"data-loc":"client/src/pages/CertificatePage.tsx:220",open:!!f,onOpenChange:t=>!t&&d(null),children:e.jsxs(q,{"data-loc":"client/src/pages/CertificatePage.tsx:221",className:"sm:max-w-sm",children:[e.jsx($,{"data-loc":"client/src/pages/CertificatePage.tsx:222",children:e.jsx(z,{"data-loc":"client/src/pages/CertificatePage.tsx:223",children:"ìê²©ì¦ PDF ì´ë©ì¼ ë°ì¡"})}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:225",className:"space-y-4 py-2",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:226",className:"text-sm text-gray-500",children:"ìê²©ì¦ PDF ë§í¬ë¥¼ ì´ë©ì¼ë¡ ë°ì¡í©ëë¤."}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:227",children:[e.jsx(R,{"data-loc":"client/src/pages/CertificatePage.tsx:228",htmlFor:"cert-email",children:"ì´ë©ì¼ 주ì"}),e.jsx(O,{"data-loc":"client/src/pages/CertificatePage.tsx:229",id:"cert-email",type:"email",value:n,onChange:t=>x(t.target.value),placeholder:"[email protected]"})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:237",className:"flex gap-2",children:[e.jsx(r,{"data-loc":"client/src/pages/CertificatePage.tsx:238",variant:"outline",className:"flex-1",onClick:()=>d(null),children:"ì·¨ì"}),e.jsxs(r,{"data-loc":"client/src/pages/CertificatePage.tsx:239",className:"flex-1 bg-yellow-500 hover:bg-yellow-600 text-white",onClick:F,disabled:E||!n,children:[e.jsx(b,{"data-loc":"client/src/pages/CertificatePage.tsx:244",className:"w-4 h-4 mr-2"})," ë°ì¡í기"]})]})]})]})}),e.jsxs(s,{"data-loc":"client/src/pages/CertificatePage.tsx:252",className:"p-6 bg-card border border-border",children:[e.jsx("h3",{"data-loc":"client/src/pages/CertificatePage.tsx:253",className:"font-bold mb-4 text-foreground",children:"ì주 묻ë ì§ë¬¸"}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:254",className:"space-y-4 text-sm",children:[e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:255",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:256",className:"font-semibold text-foreground mb-1",children:"Q. ìê²©ì¦ ë°ê¸ë¹ë ì¼ë§ì¸ê°ì?"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:257",className:"text-muted-foreground",children:"A. ìê²©ì¦ ë°ê¸ë¹ë 50,000ìì
ëë¤."})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:259",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:260",className:"font-semibold text-foreground mb-1",children:"Q. ì
ê¸ í ì¼ë§ë ê±¸ë ¤ì ì격ì¦ì ë°ì ì ìëì?"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:261",className:"text-muted-foreground",children:"A. ì
ê¸ íì¸ í 1-2ì¼ ì´ë´ì ê´ë¦¬ìê° ì¹ì¸íì¬ ì격ì¦ì ë°ê¸í´ë립ëë¤."})]}),e.jsxs("div",{"data-loc":"client/src/pages/CertificatePage.tsx:263",children:[e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:264",className:"font-semibold text-foreground mb-1",children:"Q. ì격ì¦ì ë¤ì ë°ê¸ë°ì ì ìëì?"}),e.jsx("p",{"data-loc":"client/src/pages/CertificatePage.tsx:265",className:"text-muted-foreground",children:"A. ë°ê¸ í PDF íì¼ì
1 ë³´ê´íìê³ , íìì ê´ë¦¬ììê² ë¬¸ìíì¬ ì¬ë°ê¸ ë°ì¼ì¤ ì ììµëë¤."})]})]})]})]})]})})}export{ce 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.