1import{j as e}from"./vendor-data-Z5doMMu-.js";import{r as h}from"./vendor-react-zNM0AU50.js";import{A as De}from"./index.esm-NBNS-BUx.js";/* empty css */import{W as Z,K as Te,c as ee,U as le,y as Pe,a7 as f,ar as xe,d as ce,b8 as Ae,A as ue,aa as ie,af as pe,T as $e,D as ge,ax as Ie,aA as fe,X as te,n as be,a8 as ye,ah as Re,ai as Le,aW as Oe,Y as Me}from"./vendor-ui-CW5bJ11U.js";import{H as je,q,l as O,w as B,m as z,k as T,u as U,z as oe,j as V,x as K,t as Ue,y as Fe,D as Ne,G as ve,E as we}from"./vendor-firebase-Da9KY1q_.js";import{d as S,s as Se}from"./index-D1K3lVhu.js";import"./vendor-charts-08G1rM8P.js";const de="seodoon-church",Y=`churches/${de}/cultureSemesters`,G=`churches/${de}/cultureCourses`,L=`churches/${de}/cultureEnrollments`,H={async getAllSemesters(){try{const t=q(O(S,Y),K("year","desc"),K("semester","desc"));return(await z(t)).docs.map(s=>({id:s.id,...s.data()}))}catch(t){throw console.error("í기 ëª©ë¡ ì¡°í ì¤í¨:",t),t}},async getSemester(t){try{const a=T(S,Y,t),s=await V(a);return s.exists()?{id:s.id,...s.data()}:null}catch(a){throw console.error("í기 ì¡°í ì¤í¨:",a),a}},async getActiveSemester(){try{let t=q(O(S,Y),B("status","==","recruiting")),a=await z(t);if(!a.empty){const s=a.docs[0];return{id:s.id,...s.data()}}if(t=q(O(S,Y),B("status","==","active")),a=await z(t),!a.empty){const s=a.docs[0];return{id:s.id,...s.data()}}return null}catch(t){throw console.error("íì± í기 ì¡°í ì¤í¨:",t),t}},async createSemester(t){try{const a={...t,createdAt:new Date,updatedAt:new Date};return(await oe(O(S,Y),a)).id}catch(a){throw console.error("í기 ìì± ì¤í¨:",a),a}},async updateSemester(t,a){try{const s=T(S,Y,t);await U(s,{...a,updatedAt:new Date})}catch(s){throw console.error("í기 ìì ì¤í¨:",s),s}},async updateSemesterStatus(t,a){try{const s=T(S,Y,t);await U(s,{status:a,updatedAt:new Date})}catch(s){throw console.error("í기 ìí ë³ê²½ ì¤í¨:",s),s}},async deleteSemester(t){try{const a=je(S),s=q(O(S,G),B("semesterId","==",t));(await z(s)).docs.forEach(x=>{a.delete(x.ref)});const d=q(O(S,L),B("semesterId","==",t));(await z(d)).docs.forEach(x=>{a.delete(x.ref)}),a.delete(T(S,Y,t)),await a.commit()}catch(a){throw console.error("í기 ìì ì¤í¨:",a),a}}},$={async getCoursesBySemester(t){try{const a=q(O(S,G),B("semesterId","==",t),K("sortOrder","asc"));return(await z(a)).docs.map(u=>({id:u.id,...u.data()}))}catch(a){throw console.error("ê°ì¢ ëª©ë¡ ì¡°í ì¤í¨:",a),a}},async getCourse(t){try{const a=T(S,G,t),s=await V(a);return s.exists()?{id:s.id,...s.data()}:null}catch(a){throw console.error("ê°ì¢ ì¡°í ì¤í¨:",a),a}},async getOpenCourses(t){try{const a=q(O(S,G),B("semesterId","==",t),B("status","==","open"),K("sortOrder","asc"));return(await z(a)).docs.map(u=>({id:u.id,...u.data()}))}catch(a){throw console.error("ê³µê° ê°ì¢ ì¡°í ì¤í¨:",a),a}},async createCourse(t){try{const a={...t,currentEnrollment:0,isMinEnrollmentMet:!1,createdAt:new Date,updatedAt:new Date};return(await oe(O(S,G),a)).id}catch(a){throw console.error("ê°ì¢ ìì± ì¤í¨:",a),a}},async updateCourse(t,a){try{const s=T(S,G,t);await U(s,{...a,updatedAt:new Date})}catch(s){throw console.error("ê°ì¢ ìì ì¤í¨:",s),s}},async updateCourseStatus(t,a){try{const s=T(S,G,t);await U(s,{status:a,updatedAt:new Date})}catch(s){throw console.error("ê°ì¢ ìí ë³ê²½ ì¤í¨:",s),s}},async deleteCourse(t){try{const a=je(S),s=q(O(S,L),B("courseId","==",t));(await z(s)).docs.forEach(d=>{a.delete(d.ref)}),a.delete(T(S,G,t)),await a.commit()}catch(a){throw console.error("ê°ì¢ ìì ì¤í¨:",a),a}},async copyCoursesBetweenSemesters(t,a,s){try{const u=await this.getCoursesBySemester(t),d=s?u.filter(x=>s.includes(x.id)):u;let v=0;for(const x of d){const c={semesterId:a,category:x.category,name:x.name,description:x.description||"",instructor:x.instructor,instructorTitle:x.instructorTitle||"",instructorPhone:x.instructorPhone||"",instructorProfile:x.instructorProfile||{photoUrl:"",bio:"",careers:[]},schedule:x.schedule,scheduleText:x.scheduleText,durationText:x.durationText,location:x.location,imageUrl:x.imageUrl||"",tagline:x.tagline||"",targetAudience:x.targetAudience||"",suppliesNeeded:x.suppliesNeeded||"",curriculum:[],maxEnrollment:x.maxEnrollment,fee:x.fee,feeType:x.feeType,status:"draft",sortOrder:x.sortOrder,createdBy:"admin"};await this.createCourse(c),v++}return v}catch(u){throw console.error("ê°ì¢ ë³µì¬ ì¤í¨:",u),u}},async updateEnrollmentCount(t,a){try{const s=T(S,G,t);await U(s,{currentEnrollment:Ue(a),updatedAt:new Date});const u=await V(s);if(u.exists()){const d=u.data(),v=await V(T(S,Y,d.semesterId));if(v.exists()){const x=v.data(),c=d.currentEnrollment>=x.minEnrollment;await U(s,{isMinEnrollmentMet:c})}}}catch(s){throw console.error("ìê° ì¸ì ì
ë°ì´í¸ ì¤í¨:",s),s}}},J={async getEnrollmentsBySemester(t){try{const a=q(O(S,L),B("semesterId","==",t),K("createdAt","desc"));return(await z(a)).docs.map(u=>({id:u.id,...u.data()}))}catch(a){throw console.error("ìê°ì ì² ëª©ë¡ ì¡°í ì¤í¨:",a),a}},async getEnrollmentsByCourse(t){try{const a=q(O(S,L),B("courseId","==",t),K("createdAt","desc"));return(await z(a)).docs.map(u=>({id:u.id,...u.data()}))}catch(a){throw console.error("ê°ì¢ë³ ìê°ì ì² ì¡°í ì¤í¨:",a),a}},async getEnrollment(t){try{const a=T(S,L,t),s=await V(a);return s.exists()?{id:s.id,...s.data()}:null}catch(a){throw console.error("ìê°ì ì² ì¡°í ì¤í¨:",a),a}},async createEnrollment(t){try{const a={...t,enrolledAt:new Date,createdAt:new Date,updatedAt:new Date},s=await oe(O(S,L),a);return await $.updateEnrollmentCount(t.courseId,1),s.id}catch(a){throw console.error("ìê°ì ì² ìì± ì¤í¨:",a),a}},async updateEnrollment(t,a){try{const s=T(S,L,t);await U(s,{...a,updatedAt:new Date})}catch(s){throw console.error("ìê°ì ì² ìì ì¤í¨:",s),s}},async confirmEnrollment(t,a){try{const s=T(S,L,t);await U(s,{status:"confirmed",confirmedAt:new Date,confirmedBy:a,updatedAt:new Date})}catch(s){throw console.error("ìê°ì ì² íì ì¤í¨:",s),s}},async confirmPayment(t,a){try{const s=T(S,L,t);await U(s,{paymentStatus:"paid",paymentDate:new Date().toISOString().split("T")[0],...a,updatedAt:new Date})}catch(s){throw console.error("ë©ë¶ íì¸ ì¤í¨:",s),s}},async refundPayment(t){try{const a=T(S,L,t);await U(a,{paymentStatus:"refunded",updatedAt:new Date})}catch(a){throw console.error("íë¶ ì²ë¦¬ ì¤í¨:",a),a}},async cancelEnrollment(t,a){try{const s=await V(T(S,L,t));if(!s.exists())throw new Error("ìê°ì ì²ì ì°¾ì ì ììµëë¤.");const u=s.data(),d=T(S,L,t);await U(d,{status:"cancelled",cancelledAt:new Date,cancelReason:a,updatedAt:new Date}),await $.updateEnrollmentCount(u.courseId,-1)}catch(s){throw console.error("ìê°ì ì² ì·¨ì ì¤í¨:",s),s}},async deleteEnrollment(t){try{const a=await V(T(S,L,t));if(a.exists()){const s=a.data();
1s.status!=="cancelled"&&await $.updateEnrollmentCount(s.courseId,-1)}await Fe(T(S,L,t))}catch(a){throw console.error("ìê°ì ì² ìì ì¤í¨:",a),a}}},qe={async getSemesterStats(t){try{const a=await $.getCoursesBySemester(t),s=await J.getEnrollmentsBySemester(t),u=a.map(d=>{const v=s.filter(x=>x.courseId===d.id);return{courseId:d.id,courseName:d.name,category:d.category,enrollmentCount:v.length,confirmedCount:v.filter(x=>x.status==="confirmed").length,paidCount:v.filter(x=>x.paymentStatus==="paid").length,isMinEnrollmentMet:d.isMinEnrollmentMet}});return{totalCourses:a.length,openCourses:a.filter(d=>d.status==="open").length,totalEnrollments:s.length,confirmedEnrollments:s.filter(d=>d.status==="confirmed").length,paidEnrollments:s.filter(d=>d.paymentStatus==="paid").length,courseStats:u}}catch(a){throw console.error("í기 íµê³ ì¡°í ì¤í¨:",a),a}}},se={music:"ìì
",literature:"문í",craft:"ê³µì",other:"기í"},re={planning:"ì¤ë¹ì¤",recruiting:"모ì§ì¤",active:"ì§íì¤",closed:"ì¢
ë£"},ze={draft:"ì¤ë¹ì¤",open:"모ì§ì¤",closed:"ë§ê°",cancelled:"ì·¨ì"},me={pending:"미ë©",paid:"ë©ë¶ìë£",refunded:"íë¶"},he={pending:"ë기",confirmed:"íì ",cancelled:"ì·¨ì",withdrawn:"ì² í"},Ce={once:"1í(ì¼ìë©)",monthly:"ìë©",semester:"í기ë©"};function ne(t,a="monthly"){const s=`${t.toLocaleString()}ì`;return a==="once"?`${s} (1í)`:a==="semester"?`í기 ${s}`:`ì ${s}`}const Be=["ì¼","ì","í","ì","목","ê¸","í "],_e=[{category:"music",name:"ë°ì±êµì¤"},{category:"music",name:"ì°ì¿¨ë ë "},{category:"music",name:"ì¤ì¹´ë¦¬ë"},{category:"music",name:"í루í¸"},{category:"music",name:"í모ëì¹´"},{category:"literature",name:"ìì´êµì¤"}];function ae(t){const a=t.dayOfWeek.map(u=>Be[u]).join(", "),s=`${t.startTime} ~ ${t.endTime}`;return t.note?`${a} ${s} (${t.note})`:`${a} ${s}`}function We(t,a){return`${t}ë
${a==="first"?"ìë°ê¸°":"íë°ê¸°"}`}function it(){const[t,a]=h.useState("dashboard"),s=[{id:"dashboard",label:"ëìë³´ë",icon:Te},{id:"semesters",label:"í기 ê´ë¦¬",icon:ee},{id:"courses",label:"ê°ì¢ ê´ë¦¬",icon:Z},{id:"enrollments",label:"ìê°ì ì²",icon:le},{id:"instructors",label:"ê°ì¬ ê´ë¦¬",icon:Pe}];return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[18px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(Z,{className:"w-5 h-5 text-blue-600"}),"ìë문íê°ì¢"]}),e.jsx("p",{className:"text-[12px] text-gray-500 mt-1",children:"문íê°ì¢ í기, ê°ì¢, ìê°ì ì²ì ê´ë¦¬í©ëë¤"})]})}),e.jsx("div",{className:"flex gap-1 border-b border-gray-200",children:s.map(u=>e.jsxs("button",{onClick:()=>a(u.id),className:`flex items-center gap-1.5 px-4 py-2 text-[13px] font-medium border-b-2 -mb-[1px] transition-colors ${t===u.id?"border-blue-600 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[e.jsx(u.icon,{className:"w-4 h-4"}),u.label]},u.id))}),t==="dashboard"&&e.jsx(Ye,{}),t==="semesters"&&e.jsx(Ge,{}),t==="courses"&&e.jsx(Ve,{}),t==="enrollments"&&e.jsx(Qe,{}),t==="instructors"&&e.jsx(Ze,{})]})}function Ye(){const[t,a]=h.useState(!0),[s,u]=h.useState(null),[d,v]=h.useState(null);h.useEffect(()=>{x()},[]);async function x(){try{a(!0);const n=await H.getActiveSemester();if(u(n),n){const N=await qe.getSemesterStats(n.id);v(N)}}catch(n){console.error("ëìë³´ë ë¡ë© ì¤í¨:",n),f.error("ë°ì´í°ë¥¼ ë¶ë¬ì¬ ì ììµëë¤")}finally{a(!1)}}if(t)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"ë¡ë© ì¤..."})});if(!s)return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-8 text-center",children:[e.jsx(ee,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[14px] text-gray-600 mb-2",children:"ì§í ì¤ì¸ íê¸°ê° ììµëë¤"}),e.jsx("p",{className:"text-[12px] text-gray-500",children:"í기 ê´ë¦¬ íìì ì í기를 ì¶ê°íì¸ì"})]});const c=(d==null?void 0:d.courseStats.filter(n=>!n.isMinEnrollmentMet))||[];return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-white border border-gray-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[12px] text-gray-500 mb-1",children:"íì¬ í기"}),e.jsx("h2",{className:"text-[20px] font-bold text-gray-900",children:s.name}),e.jsxs("p",{className:"text-[12px] text-gray-500 mt-1",children:[s.startDate," ~ ",s.endDate]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`px-3 py-1 rounded-full text-[11px] font-medium text-white ${s.status==="recruiting"?"bg-green-500":s.status==="active"?"bg-blue-500":"bg-gray-500"}`,children:re[s.status]}),e.jsxs("p",{className:"text-[11px] text-gray-500 mt-2",children:["ë´ë¹: ",s.managerName," (",s.managerPhone,")"]})]})]})}
1),d&&e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsx(X,{label:"ì ì²´ ê°ì¢",value:d.totalCourses,icon:e.jsx(Z,{className:"w-4 h-4"})}),e.jsx(X,{label:"모ì§ì¤ ê°ì¢",value:d.openCourses,icon:e.jsx(xe,{className:"w-4 h-4"}),color:"green"}),e.jsx(X,{label:"ì´ ì ì²",value:d.totalEnrollments,icon:e.jsx(le,{className:"w-4 h-4"})}),e.jsx(X,{label:"íì ",value:d.confirmedEnrollments,icon:e.jsx(ce,{className:"w-4 h-4"}),color:"blue"}),e.jsx(X,{label:"ë©ë¶ìë£",value:d.paidEnrollments,icon:e.jsx(Ae,{className:"w-4 h-4"}),color:"blue"})]}),c.length>0&&e.jsx("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ue,{className:"w-5 h-5 text-orange-500 mt-0.5"}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-[13px] font-bold text-orange-800",children:["ìµì ì¸ì 미충족 ê°ì¢ (",c.length,"ê°)"]}),e.jsxs("p",{className:"text-[12px] text-orange-700 mt-1",children:["ìë ê°ì¢ë ìµì ê°ì¤ ì¸ì(",s.minEnrollment,"ëª )ì 충족íì§ ëª»íìµëë¤"]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:c.map(n=>e.jsxs("span",{className:"px-2 py-1 bg-orange-100 text-orange-800 rounded text-[11px]",children:[n.courseName," (",n.enrollmentCount,"ëª )"]},n.courseId))})]})]})}),d&&d.courseStats.length>0&&e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm",children:[e.jsx("div",{className:"p-3 border-b border-gray-200",children:e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ê°ì¢ë³ ì ì² íí©"})}),e.jsx("div",{className:"divide-y divide-gray-100",children:d.courseStats.map(n=>e.jsxs("div",{className:"p-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium ${n.category==="music"?"bg-slate-100 text-slate-700":n.category==="literature"?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:se[n.category]}),e.jsx("span",{className:"text-[13px] font-medium text-gray-900",children:n.courseName})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[12px]",children:[e.jsxs("span",{className:"text-gray-600",children:["ì ì² ",e.jsx("strong",{children:n.enrollmentCount}),"ëª "]}),e.jsxs("span",{className:"text-blue-600",children:["íì ",e.jsx("strong",{children:n.confirmedCount}),"ëª "]}),e.jsxs("span",{className:"text-blue-600",children:["ë©ë¶ ",e.jsx("strong",{children:n.paidCount}),"ëª "]}),n.isMinEnrollmentMet?e.jsx(xe,{className:"w-4 h-4 text-green-500"}):e.jsx(ue,{className:"w-4 h-4 text-orange-500"})]})]},n.courseId))})]})]})}function Ge(){const[t,a]=h.useState(!0),[s,u]=h.useState([]),[d,v]=h.useState(!1),[x,c]=h.useState(null);h.useEffect(()=>{n()},[]);async function n(){try{a(!0);const p=await H.getAllSemesters();u(p)}catch(p){console.error("í기 ëª©ë¡ ì¡°í ì¤í¨:",p),f.error("í기 목ë¡ì ë¶ë¬ì¬ ì ììµëë¤")}finally{a(!1)}}async function N(p){if(confirm(`ì´ í기를 ìì íìê² ìµëê¹? 2ì°ê´ë 모ë ê°ì¢ì ìê°ì ì²ë í¨ê» ìì ë©ëë¤.`))try{await H.deleteSemester(p),f.success("ìì ëììµëë¤"),n()}catch{f.error("ìì ì ì¤í¨íìµëë¤")}}async function w(p,g){try{await H.updateSemesterStatus(p,g),f.success("ìíê° ë³ê²½ëììµëë¤"),n()}catch{f.error("ìí ë³ê²½ì ì¤í¨íìµëë¤")}}return t?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"ë¡ë© ì¤..."})}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>{c(null),v(!0)},className:"flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium",children:[e.jsx(ie,{className:"w-4 h-4"}),"í기 ì¶ê°"]})}),s.length===0?e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-8 text-center",children:[e.jsx(ee,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ë±ë¡ë íê¸°ê° ììµëë¤"})]}):e.jsx("div",{className:"space-y-3",children:s.map(p=>e.jsx("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-4",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-[15px] font-bold text-gray-900",children:p.name}),e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium ${p.status==="planning"?"bg-gray-100 text-gray-700":p.status==="recruiting"?"bg-green-100 text-green-700":p.status==="active"?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-500"}`,children:re[p.status]})]}),e.jsxs("div",{className:"text-[12px] text-gray-600 space-y-1",children:[e.jsxs("p",{children:["기ê°: ",p.startDate," ~ ",p.endDate]}),e.jsxs("p",{children:["모ì§: ",p.registrationStartDate," ~ ",p.registrationEndDate]}),e.jsxs("p",{children:["ë´ë¹: ",p.managerName," (",p.managerPhone,")"]}),e.jsxs("p",{children:["ìê°ë£: ì ",p.monthlyFee.toLocaleStr
2ing(),"ì / ìµì ì¸ì: ",p.minEnrollment,"ëª
"]}),p.instructorAccessCode&&e.jsxs("p",{className:"flex items-center gap-1",children:["ê°ì¬ ì ê·¼ì½ë: ",e.jsx("code",{className:"bg-gray-100 px-1.5 py-0.5 rounded text-[11px] font-mono font-bold",children:p.instructorAccessCode})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("select",{value:p.status,onChange:g=>w(p.id,g.target.value),className:"text-[11px] px-2 py-1 border border-gray-200 rounded",children:[e.jsx("option",{value:"planning",children:"ì¤ë¹ì¤"}),e.jsx("option",{value:"recruiting",children:"모ì§ì¤"}),e.jsx("option",{value:"active",children:"ì§íì¤"}),e.jsx("option",{value:"closed",children:"ì¢
ë£"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>{c(p),v(!0)},className:"p-1.5 bg-blue-100 hover:bg-blue-200 text-blue-700 rounded",children:e.jsx(pe,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>N(p.id),className:"p-1.5 bg-red-100 hover:bg-red-200 text-red-700 rounded",children:e.jsx($e,{className:"w-3.5 h-3.5"})})]})]})]})},p.id))}),d&&e.jsx(Xe,{semester:x,onClose:()=>{v(!1),c(null)},onSuccess:()=>{v(!1),c(null),n()}})]})}function He(t){const a=t.data;return a?e.jsxs("div",{className:"flex gap-1 items-center h-full",children:[e.jsx("button",{className:"px-2 py-1 text-[11px] bg-blue-500 text-white rounded hover:bg-blue-600",onClick:s=>{var u;s.stopPropagation(),(u=t.onEdit)==null||u.call(t,a)},title:"ìì¸í¸ì§",children:"ìì "}),e.jsx("button",{className:"px-2 py-1 text-[11px] bg-blue-600 text-white rounded hover:bg-blue-700",onClick:s=>{var u;s.stopPropagation(),(u=t.onCopyLink)==null||u.call(t,a.id)},title:"ê°ì¬ ì
ë ¥ ë§í¬ ë³µì¬",children:"ë§í¬"}),e.jsx("button",{className:"px-2 py-1 text-[11px] bg-red-500 text-white rounded hover:bg-red-600",onClick:s=>{var u;s.stopPropagation(),(u=t.onDelete)==null||u.call(t,a.id)},title:"ìì ",children:"ìì "})]}):null}function Ve(){const[t,a]=h.useState(!0),[s,u]=h.useState([]),[d,v]=h.useState(""),[x,c]=h.useState([]),[n,N]=h.useState(!1),[w,p]=h.useState(null),[g,k]=h.useState(!1);h.useEffect(()=>{M()},[]),h.useEffect(()=>{d&&P()},[d]);async function M(){try{const l=await H.getAllSemesters();if(u(l),l.length>0){const m=l.find(b=>b.status==="recruiting"||b.status==="active");
2v((m==null?void 0:m.id)||l[0].id)}}catch(l){console.error("í기 ëª©ë¡ ì¡°í ì¤í¨:",l)}finally{a(!1)}}async function P(){try{const l=await $.getCoursesBySemester(d);c(l)}catch(l){console.error("ê°ì¢ ëª©ë¡ ì¡°í ì¤í¨:",l),f.error("ê°ì¢ 목ë¡ì ë¶ë¬ì¬ ì ììµëë¤")}}function F(l){const m=`https://culture.seodoon.org/instructor-form.html?course=${l}`;navigator.clipboard.writeText(m).then(()=>{f.success("ê°ì¬ ì ë ¥ ë§í¬ê° ë³µì¬ëììµëë¤")}).catch(()=>{f.error("ë³µì¬ì ì¤í¨íìµëë¤")})}async function R(l){if(confirm(`ì´ ê°ì¢ë¥¼ ìì íìê² ìµëê¹? 3ì°ê´ë ìê°ì ì²ë í¨ê» ìì ë©ëë¤.`))try{await $.deleteCourse(l),f.success("ìì ëììµëë¤"),P()}catch{f.error("ìì ì ì¤í¨íìµëë¤")}}async function _(){const l=x.filter(m=>m.status==="open");if(l.length===0){f("모ì§ì¤ì¸ ê°ì¢ê° ììµëë¤");return}if(confirm(`${l.length}ê° ê°ì¢ì ìê°ì ì²ì ì ì²´ ë§ê°íìê² ìµëê¹?`))try{await Promise.all(l.map(m=>$.updateCourseStatus(m.id,"closed"))),f.success(`${l.length}ê° ê°ì¢ ìê°ì ì² ë§ê° ìë£`),P()}catch(m){console.error("ì ì²´ ë§ê° ì¤í¨:",m),f.error("ë§ê° ì²ë¦¬ì ì¤í¨íìµëë¤")}}function W(){const l=s.find(E=>E.id===d);if(!l){f.error("í기를 ì ííì¸ì");return}const m=x.filter(E=>E.status!=="cancelled").sort((E,Q)=>(E.sortOrder||0)-(Q.sortOrder||0));if(m.length===0){f.error("ì¸ìí ê°ì¢ê° ììµëë¤");return}const b=E=>E.fee!=null?ne(E.fee,E.feeType||"monthly"):ne(l.monthlyFee,"monthly"),C=E=>String(E??"").replace(/[&<>"]/g,Q=>({"&":"&","<":"<",">":">",'"':"""})[Q]),A=m.map((E,Q)=>{const Ee=C(E.scheduleText||(E.schedule?ae(E.schedule):""))||"-",ke=E.durationText?` <span style="color:#666;">(${C(E.durationText)})</span>`:"";return` 4 <tr class="course-row"> 5 <td class="c" rowspan="2">â¡</td> 6 <td class="c" rowspan="2">${Q+1}</td> 7 <td class="cname"><b>${C(E.name)}</b></td> 8 <td>${C(E.instructor)}${E.instructorTitle?" "+C(E.instructorTitle):""}</td> 9 <td class="r">${C(b(E))}${ke}</td> 10 </tr> 11 <tr class="course-sub"> 12 <td colspan="3"><b>ìê°</b> ${Ee}ãï½ã<b>ì¥ì</b> ${C(E.location)||"-"}</td> 13 </tr>`}).join(""),D=`<!DOCTYPE html> 14<html lang="ko"> 15<head> 16<meta charset="utf-8" /> 17<title>ìë문íê°ì¢ ìê°ì ì²ì - ${C(l.name)}</title> 18<style> 19 * { box-sizing: border-box; } 20 body { font-family: 'Malgun Gothic', 'ë§ì ê³ ë', sans-serif; color: #111; margin: 24px; font-size: 13px; } 21 h1 { text-align: center; font-size: 22px; margin: 0 0 4px; letter-spacing: 4px; } 22 .sub { text-align: center; color: #555; font-size: 13px; margin-bottom: 18px; } 23 table { width: 100%; border-collapse: collapse; margin-bottom: 16px; } 24 th, td { border: 1px solid #333; padding: 6px 8px; } 25 th { background: #f0f0f0; font-weight: 700; } 26 .c { text-align: center; } 27 .r { text-align: right; } 28 .applicant th { width: 80px; background: #f0f0f0; text-align: center; } 29 .applicant td { height: 38px; } 30 .applicant td.wide { width: 260px; } 31 .course-row td { border-top: 1.6px solid #333; } 32 .course-row .cname { font-size: 13px; } 33 .course-sub td { font-size: 12px; color: #333; } 34 .section-title { font-weight: 700; font-size: 14px; margin: 16px 0 6px; } 35 .notice { border: 1px solid #999; padding: 10px 12px; font-size: 12px; line-height: 1.7; color: #333; } 36 .notice b { color: #111; } 37 .sign { margin-top: 24px; text-align: right; font-size: 13px; line-height: 2.2; } 38 .sign .line { display: inline-block; border-bottom: 1px solid #333; width: 120px; } 39 @media print { body { margin: 12mm; } .no-print { display: none; } } 40</style> 41</head> 42<body> 43 <h1>ì ê° ì ì² ì</h1> 44 <div class="sub">ìë문íê°ì¢ · ${C(l.name)} (모ì§: ${C(l.registrationStartDate)} ~ ${C(l.registrationEndDate)})<br />주ê´: ìëêµí 문íì²´ì¡ì êµë¶</div> 45 46 <div class="section-title">â ì ì²ì ì ë³´</div> 47 <table class="applicant"> 48 <tr><th>ì±ëª </th><td class="wide"></td><th>êµì¸ ì¬ë¶</th><td>â¡ êµì¸ããâ¡ ë¹êµì¸</td></tr> 49 <tr><th>ì°ë½ì²</th><td colspan="3"></td></tr> 50 </table> 51 52 <div class="section-title">â ì ì² ê°ì¢ (ì ì²í ê°ì¢ì â¡ì íìíì¸ì · ìê°ë£ë ê°ì¢ë³ë¡ ë¤ë¦ ëë¤)</div> 53 <table> 54 <thead> 55 <tr> 56 <th class="c" style="width:36px;">ì ì²</th> 57 <th class="c" style="width:34px;">No</th> 58 <th>ê°ì¢ëª </th> 59 <th style="width:130px;">ê°ì¬</th> 60 <th class="r" style="width:130px;">ìê°ë£</th> 61 </tr> 62 </thead> 63 <tbody>${A}</tbody> 64 </table> 65 66 <div class="section-title">â ë©ë¶ ìë´</div> 67 <div class="notice"> 68 · ìê°ë£ë <b>ê°ì¢ë³ë¡ ìì´</b>íë©°, ì íì 기ì¬ë ê¸ì¡ì ë©ë¶í©ëë¤.<br /> 69 · ì ê¸ ê³ì¢: <b>ì¹´ì¹´ì¤ë± í¬ 3333333111536</b> (ìê¸ì£¼: ì í¨í / ìë문íê°ì¢íì¥)<br /> 70 · 주ê´: ìëêµí 문íì²´ì¡ì êµë¶ · ë´ë¹: ${C(l.managerName)} (${C(l.managerPhone)}) 71 </div> 72 73 <div class="sign"> 74 ìì ê°ì´ ìê°ì ì ì²í©ëë¤.<br /> 75 ${new Date().getFullYear()}ë ãããìãããì¼<br /> 76 ì ì²ì¸ : <span class="line"></span> (ìëª ëë ì¸) 77 </div> 78 79 <div class="no-print" style="text-align:center; margin-top:20px;"> 80 <button onclick="window.print()" style="padding:8px 20px; font-size:14px; cursor:pointer;">ì¸ìí기</button> 81 </div> 82</body> 83</html>`,I=window.open("","_blank","width=900,height=700");if(!I){f.error("íì ì´ ì°¨ë¨ëììµëë¤. íì ì íì©í´ì£¼ì¸ì.");return}I.document.write(D),I.document.close()}const y=h.useCallback(async l=>{const m=l.data,b=l.column.colId;let C=l.newValue;(b==="sortOrder"||b==="maxEnrollment"||b==="fee")&&(C=C?Number(C):b==="sortOrder"?0:null);try{await $.updateCourse(m.id,{[b]:C}),f.success("ì ì¥ëììµëë¤")}catch(A){console.error("ì ì¥ ì¤í¨:",A),f.error("ì ì¥ì ì¤í¨íìµëë¤"),l.node.setDataValue(b,l.oldValue)}},[]),i=h.useCallback(l=>{p(l.data),N(!0)},[]),j=h.useMemo(()=>[{headerName:"ìì",field:"sortOrder",width:70,editable:!0,cellDataType:"number"},{headerName:"ì¹´í ê³ ë¦¬",field:"category",width:90,editable:!0,cellEditor:"agSelectCellEditor",cellEditorParams:{values:["music","literature","craft","other"]},valueFormatter:l=>se[l.value]||l.value,cellStyle:l=>{const m={music:{bg:"#f3e8ff",color:"#7c3aed"},literature:{bg:"#dbeafe",color:"#2563eb"},craft:{bg:"#ffedd5",color:"#ea580c"},other:{bg:"#f3f4f6",color:"#4b5563"}},b=m[l.value]||m.other;return{backgroundColor:b.bg,color:b.color,fontWeight:500}}},{headerName:"ê°ì¢ëª ",field:"name",width:150,editable:!0,cellStyle:{fontWeight:"bold"}},{headerName:"ê°ì¬",field:"instructor",width:100,editable:!0},{headerName:"ì§ì± ",field:"instructorTitle",width:80,editable:!0},{headerName:"ê°ììê°",field:"scheduleText",width:160,editable:!0,valueGetter:l=>{const m=l.data;return(m==null?void 0:m.scheduleText)||(m!=null&&m.schedule?ae(m.schedule):"")}},{headerName:"ì¥ì",field:"location",width:120,editable:!0},{headerName:"ì ì",field:"maxEnrollment",width:70,editable:!0,cellDataType:"number",valueFormatter:l=>l.value?`${l.value}ëª `:"-"},{headerName:"ìê°ë£",field:"fee",width:110,editable:!0,cellDataType:"number",valueFormatter:l=>{if(l.value==null)return"í기 기본";const m=l.data;return ne(Number(l.value),(m==null?void 0:m.feeType)||"monthly")}},{headerName:"ë©ë¶ì£¼ê¸°",field:"feeType",width:90,editable:!0,cellEditor:"agSelectCellEditor",cellEditorParams:{values:["once","monthly","semester"]},valueFormatter:l=>Ce[l.value||"monthly"]},{headerName:"기ê°/íì",field:"durationText",width:110,editable:!0,valueFormatter:l=>l.value||"-"},{headerName:"íì¬ì¸ì",field:"currentEnrollment",width:80,editable:!1,valueFormatter:l=>`${l.value||0}ëª `},{headerName:"ìí",field:"status",width:90,editable:!0,cellEditor:"agSelectCellEditor",cellEditorParams:{values:["draft","open","closed","cancelled"]},valueFormatter:l=>ze[l.value]||l.value,cellStyle:l=>{const m={draft:{bg:"#f3f4f6",color:"#4b5563"},open:{bg:"#dcfce7",color:"#16a34a"},closed:{bg:"#dbeafe",color:"#2563eb"},cancelled:{bg:"#fee2e2",color:"#dc2626"}},b=m[l.value]||m.draft;return{backgroundColor:b.bg,color:b.color,fontWeight:500}}},{headerName:"í보문구",field:"tagline",width:150,editable:!0},{headerName:"ëì",field:"targetAudience",width:100,editable:!0},{headerName:"ì¤ë¹ë¬¼",field:"suppliesNeeded",width:100,editable:!0},{headerName:"ì¡ì ",field:"id",width:160,editable:!1,sortable:!1,filter:!1,cellRenderer:He,cellRendererParams:{onEdit:l=>{p(l),N(!0)},onCopyLink:F,onDelete:R}}],[]),o=h.useMemo(()=>
83({sortable:!0,filter:!0,resizable:!0,minWidth:60,editable:!1,cellStyle:{display:"flex",alignItems:"center",fontSize:"12px",lineHeight:"normal"}}),[]);if(t)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"ë¡ë© ì¤..."})});if(s.length===0)return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-8 text-center",children:[e.jsx(ee,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"먼ì í기를 ì¶ê°íì¸ì"})]});const r=s.find(l=>l.id===d);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("select",{value:d,onChange:l=>v(l.target.value),className:"text-[13px] px-3 py-1.5 border border-gray-200 rounded",children:s.map(l=>e.jsxs("option",{value:l.id,children:[l.name," (",re[l.status],")"]},l.id))}),e.jsxs("span",{className:"text-[12px] text-gray-500",children:[x.length,"ê° ê°ì¢"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:W,className:"flex items-center gap-1.5 px-3 py-1.5 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 transition-colors text-[13px] font-medium",children:[e.jsx(ge,{className:"w-4 h-4"}),"ì¢ ì´ ì ì²ì ì¸ì"]}),e.jsxs("button",{onClick:_,className:"flex items-center gap-1.5 px-3 py-1.5 bg-red-500 text-white rounded hover:bg-red-600 transition-colors text-[13px] font-medium",children:[e.jsx(Ie,{className:"w-4 h-4"}),"ì ì²´ ìê°ì ì² ë§ê°"]}),s.length>=2&&e.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 px-3 py-1.5 border border-blue-300 text-blue-700 rounded hover:bg-blue-50 transition-colors text-[13px] font-medium",children:[e.jsx(fe,{className:"w-4 h-4"}),"ì´ì í기ìì ë³µì¬"]}),e.jsxs("button",{onClick:()=>{p(null),N(!0)},className:"flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium",children:[e.jsx(ie,{className:"w-4 h-4"}),"ê°ì¢ ì¶ê°"]})]})]}),e.jsxs("div",{className:"ag-theme-alpine",style:{height:Math.max(300,Math.min(x.length*42+50,600)),width:"100%"},children:[e.jsx("style",{children:` 84 .ag-theme-alpine .ag-cell { 85 font-size: 12px !important; 86 } 87 .ag-theme-alpine .ag-header-cell-label { 88 font-size: 12px !important; 89 } 90 `}),e.jsx(De,{rowData:x,columnDefs:j,defaultColDef:o,onCellValueChanged:y,onRowDoubleClicked:i,undoRedoCellEditing:!0,undoRedoCellEditingLimit:20,animateRows:!0,rowHeight:40,enableCellTextSelection:!0,ensureDomOrder:!0,getRowId:l=>l.data.id,noRowsOverlayComponent:()=>e.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[e.jsx(Z,{className:"w-12 h-12 text-gray-300 mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ë±ë¡ë ê°ì¢ê° ììµëë¤"})]})})]}),n&&r&&e.jsx(Je,{course:w,semesterId:d,onClose:()=>{N(!1),p(null)},onSuccess:()=>{N(!1),p(null),P()}}),g&&e.jsx(Ke,{semesters:s,targetSemesterId:d,onClose:()=>k(!1),onSuccess:()=>{k(!1),P()}})]})}function Ke({semesters:t,targetSemesterId:a,onClose:s,onSuccess:u}){const[d,v]=h.useState(!1),[x,c]=h.useState(""),[n,N]=h.useState([]),[w,p]=h.useState(new Set),[g,k]=h.useState(!1),M=t.filter(y=>y.id!==a),P=t.find(y=>y.id===a);h.useEffect(()=>{x&&F()},[x]);async function F(){try{k(!0);const y=await $.getCoursesBySemester(x);N(y),p(new Set(y.map(i=>i.id)))}catch{f.error("ê°ì¢ 목ë¡ì ë¶ë¬ì¬ ì ììµëë¤")}finally{k(!1)}}function R(y){p(i=>{const j=new Set(i);return j.has(y)?j.delete(y):j.add(y),j})}function _(){w.size===n.length?p(new Set):p(new Set(n.map(y=>y.id)))}async function W(){if(w.size===0){f.error("ë³µì¬í ê°ì¢ë¥¼ ì ííì¸ì");return}if(confirm(`ì íí ${w.size}ê° ê°ì¢ë¥¼ ë³µì¬íìê² ìµëê¹? 91ê°ì¢ 기본 ì ë³´ê° ë³µì¬ëê³ , ìê° ì¸ìì 0ì¼ë¡ ì´ê¸°íë©ëë¤.`))try{v(!0);const y=await $.copyCoursesBetweenSemesters(x,a,Array.from(w));f.success(`${y}ê° ê°ì¢ê° ë³µì¬ëììµëë¤`),u()}catch{f.error("ë³µì¬ì ì¤í¨íìµëë¤")}finally{v(!1)}}return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-lg w-full max-h-[80vh] overflow-y-auto",children:[e.jsxs("div",{className:"p-4 border-b border-gray-200",children:[e.jsxs("h2",{className:"text-[16px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(fe,{className:"w-5 h-5 text-blue-600"}),"ì´ì í기ìì ê°ì¢ ë³µì¬"]}),e.jsxs("p",{className:"text-[12px] text-gray-500 mt-1",children:["ë³µì¬ ëì: ",e.jsx("strong",{children:P==null?void 0:P.name})]})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë³µì¬í í기 ì í"}),e.jsxs("select",{value:x,onChange:y=>c(y.target.value),className:"compact-input",children:[e.jsx("option",{value:"",children:"í기를 ì ííì¸ì"}),M.map(y=>
91e.jsxs("option",{value:y.id,children:[y.name," (",re[y.status],")"]},y.id))]})]}),g&&e.jsx("div",{className:"text-center py-4 text-[13px] text-gray-500",children:"ë¶ë¬ì¤ë ì¤..."}),x&&!g&&n.length===0&&e.jsx("div",{className:"text-center py-4 text-[13px] text-gray-500",children:"í´ë¹ í기ì ê°ì¢ê° ììµëë¤"}),n.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700",children:["ë³µì¬í ê°ì¢ (",w.size,"/",n.length,")"]}),e.jsx("button",{type:"button",onClick:_,className:"text-[11px] text-blue-600 hover:underline",children:w.size===n.length?"ì ì²´ í´ì ":"ì ì²´ ì í"})]}),e.jsx("div",{className:"space-y-1 max-h-60 overflow-y-auto border border-gray-200 rounded p-2",children:n.map(y=>e.jsxs("label",{className:`flex items-center gap-2 p-2 rounded cursor-pointer transition-colors ${w.has(y.id)?"bg-blue-50":"hover:bg-gray-50"}`,children:[e.jsx("input",{type:"checkbox",checked:w.has(y.id),onChange:()=>R(y.id),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[9px] font-medium ${y.category==="music"?"bg-slate-100 text-slate-700":y.category==="literature"?"bg-blue-100 text-blue-700":y.category==="craft"?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:se[y.category]}),e.jsx("span",{className:"text-[13px] font-medium text-gray-900 truncate",children:y.name})]}),e.jsxs("div",{className:"text-[11px] text-gray-500 mt-0.5",children:[y.instructor,y.instructorTitle?` (${y.instructorTitle})`:""," · ",ae(y.schedule)]})]})]},y.id))}),e.jsx("p",{className:"text-[10px] text-gray-500 mt-2",children:'* ê°ì¢ëª
, ê°ì¬, ìê°, ì¥ì ë± ê¸°ë³¸ ì ë³´ê° ë³µì¬ë©ëë¤. ìê° ì¸ìì 0ì¼ë¡, ìíë "ì¤ë¹ì¤"ì¼ë¡ ì¤ì ë©ëë¤.'})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-200 flex gap-2",children:[e.jsx("button",{type:"button",onClick:s,className:"flex-1 px-3 py-2 border border-gray-300 rounded hover:bg-gray-50 transition-colors text-[13px]",children:"ì·¨ì"}),e.jsx("button",{onClick:W,disabled:d||w.size===0,className:"flex-1 px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium disabled:opacity-50",children:d?"ë³µì¬ ì¤...":`${w.size}ê° ê°ì¢ ë³µì¬`})]})]})})}function Qe(){const[t,a]=h.useState(!0),[s,u]=h.useState([]),[d,v]=h.useState(""),[x,c]=h.useState([]),[n,N]=h.useState("all"),[w,p]=h.useState([]),[g,k]=h.useState("all"),[M,P]=h.useState("all");h.useEffect(()=>{F()},[]),h.useEffect(()=>{d&&R()},[d]);async function F(){try{const r=await H.getAllSemesters();if(u(r),r.length>0){const l=r.find(m=>m.status==="recruiting"||m.status==="active");
91v((l==null?void 0:l.id)||r[0].id)}}catch(r){console.error("í기 ëª©ë¡ ì¡°í ì¤í¨:",r)}finally{a(!1)}}async function R(){try{const[r,l]=await Promise.all([$.getCoursesBySemester(d),J.getEnrollmentsBySemester(d)]);c(r),p(l)}catch(r){console.error("ë°ì´í° ë¡ë© ì¤í¨:",r),f.error("ë°ì´í°ë¥¼ ë¶ë¬ì¬ ì ììµëë¤")}}async function _(r){const l=prompt(`ë©ë¶ ë°©ë²ì ì ííì¸ì: 921. íê¸ 932. ê³ì¢ì´ì²´ 943. ì¹´ë`,"2");if(!l)return;const b={1:"cash",2:"transfer",3:"card"}[l]||"transfer",C=s.find(I=>I.id===d),A=x.find(I=>I.id===r.courseId),D=(A==null?void 0:A.fee)??(C==null?void 0:C.monthlyFee)??3e4;try{await J.confirmPayment(r.id,{paymentMethod:b,paymentAmount:D}),f.success("ë©ë¶ê° íì¸ëììµëë¤"),R()}catch{f.error("ë©ë¶ íì¸ì ì¤í¨íìµëë¤")}}async function W(r){try{await J.confirmEnrollment(r,"admin"),f.success("ìê°ì´ íì ëììµëë¤"),R()}catch{f.error("íì ì ì¤í¨íìµëë¤")}}async function y(r){const l=prompt("ì·¨ì ì¬ì 를 ì ë ¥íì¸ì:");if(l!==null)try{await J.cancelEnrollment(r,l),f.success("ìê°ì´ ì·¨ìëììµëë¤"),R()}catch{f.error("ì·¨ìì ì¤í¨íìµëë¤")}}function i(){const r=j();if(r.length===0){f.error("ë´ë³´ë¼ ë°ì´í°ê° ììµëë¤");return}const l=["ê°ì¢","ì´ë¦","ì°ë½ì²","êµì¸ì¬ë¶","ì ì²ì¼","ë©ë¶ìí","ì ì²ìí"],m=r.map(D=>[D.courseName,D.applicantName,D.applicantPhone,D.isChurchMember?"O":"X",D.enrolledAt?new Date(D.enrolledAt).toLocaleDateString("ko-KR"):"",me[D.paymentStatus],he[D.status]]),b=[l,...m].map(D=>D.map(I=>`"${I}"`).join(",")).join(` 95`),C=new Blob(["\uFEFF"+b],{type:"text/csv;charset=utf-8;"}),A=document.createElement("a");A.href=URL.createObjectURL(C),A.download=`ìê°ì ì²_${new Date().toISOString().split("T")[0]}.csv`,A.click(),f.success("ìì íì¼ì´ ë¤ì´ë¡ëëììµëë¤")}function j(){return w.filter(r=>!(n!=="all"&&r.courseId!==n||g!=="all"&&r.paymentStatus!==g||M!=="all"&&r.status!==M))}if(t)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"ë¡ë© ì¤..."})});if(s.length===0)return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-8 text-center",children:[e.jsx(ee,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"먼ì í기를 ì¶ê°íì¸ì"})]});const o=j();return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-medium text-gray-600 mb-1",children:"í기"}),e.jsx("select",{value:d,onChange:r=>v(r.target.value),className:"compact-input",children:s.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-medium text-gray-600 mb-1",children:"ê°ì¢"}),e.jsxs("select",{value:n,onChange:r=>N(r.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´ ê°ì¢"}),x.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-medium text-gray-600 mb-1",children:"ë©ë¶ ìí"}),e.jsxs("select",{value:g,onChange:r=>k(r.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),e.jsx("option",{value:"pending",children:"미ë©"}),e.jsx("option",{value:"paid",children:"ë©ë¶ìë£"}),e.jsx("option",{value:"refunded",children:"íë¶"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-medium text-gray-600 mb-1",children:"ì ì² ìí"}),e.jsxs("select",{value:M,onChange:r=>P(r.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),e.jsx("option",{value:"pending",children:"ë기"}),e.jsx("option",{value:"confirmed",children:"íì "}),e.jsx("option",{value:"cancelled",children:"ì·¨ì"})]})]}),e.jsx("div",{className:"flex items-end",children:e.jsxs("button",{onClick:i,className:"flex items-center gap-1.5 px-3 py-1.5 bg-green-600 text-white rounded hover:bg-green-700 transition-colors text-[12px] font-medium w-full justify-center",children:[e.jsx(ge,{className:"w-3.5 h-3.5"}),"ìì ë´ë³´ë´ê¸°"]})})]})}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsx("div",{className:"text-[20px] font-bold text-gray-900",children:w.length}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"ì ì²´ ì ì²"})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsx("div",{className:"text-[20px] font-bold text-blue-600",children:w.filter(r=>r.status==="confirmed").length}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"íì "})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsx("div",{className:"text-[20px] font-bold text-blue-600",children:w.filter(r=>r.paymentStatus==="paid").length}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"ë©ë¶ìë£"})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsx("div",{className:"text-[20px] font-bold text-orange-600",children:w.filter(r=>r.paymentStatus==="pending").length}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"미ë©"})]})]}),o.length===0?e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-8 text-center",children:[e.jsx(le,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ìê°ì ì² ë´ìì´ ììµëë¤"})]}):e.jsx("div",{className:"bg-white border border-gray-200 rounded shadow-sm overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left text-[11px] font-medium text-gray-600",children:"ê°ì¢"}),e.jsx("th",{className:"px-3 py-2 text-left text-[11px] font-medium text-gray-600",children:"ì´ë¦"}),e.jsx("th",{className:"px-3 py-2 text-left text-[11px] font-medium text-gray-600",children:"ì°ë½ì²"}),e.jsx("th",{className:"px-3 py-2 text-center text-[11px] font-medium text-gray-600",children:"êµì¸"}),e.jsx("th",{className:"px-3 py-2 text-center text-[11px] font-medium text-gray-600",children:"ë©ë¶"}),e.jsx("th",{className:"px-3 py-2 text-center text-[11px] font-medium text-gray-600",children:"ìí"}),e.jsx("th",{className:"px-3 py-2 text-center text-[11px] font-medium text-gray-600",children:"ì¡ì "})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:o.map(r=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-3 py-2 text-[12px] text-gray-900",children:r.courseName}),e.jsx("td",{className:"px-3 py-2 text-[12px] font-medium text-gray-900",children:r.applicantName}),e.jsx("td",{className:"px-3 py-2 text-[12px] text-gray-600",children:r.applicantPhone}),e.jsx("td",{className:"px-3 py-2 text-center",children:r.isChurch
95Member?e.jsx(ce,{className:"w-4 h-4 text-green-500 mx-auto"}):e.jsx(te,{className:"w-4 h-4 text-gray-300 mx-auto"})}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium ${r.paymentStatus==="pending"?"bg-orange-100 text-orange-700":r.paymentStatus==="paid"?"bg-green-100 text-green-700":"bg-gray-100 text-gray-700"}`,children:me[r.paymentStatus]})}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium ${r.status==="pending"?"bg-yellow-100 text-yellow-700":r.status==="confirmed"?"bg-blue-100 text-blue-700":r.status==="cancelled"?"bg-red-100 text-red-700":"bg-gray-100 text-gray-700"}`,children:he[r.status]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[r.paymentStatus==="pending"&&e.jsx("button",{onClick:()=>_(r),className:"px-2 py-1 bg-green-100 hover:bg-green-200 text-green-700 rounded text-[10px]",title:"ë©ë¶ íì¸",children:"ë©ë¶"}),r.status==="pending"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>W(r.id),className:"px-2 py-1 bg-blue-100 hover:bg-blue-200 text-blue-700 rounded text-[10px]",title:"ìê° íì ",children:"íì "}),e.jsx("button",{onClick:()=>y(r.id),className:"px-2 py-1 bg-red-100 hover:bg-red-200 text-red-700 rounded text-[10px]",title:"ìê° ì·¨ì",children:"ì·¨ì"})]})]})})]},r.id))})]})})]})}function X({label:t,value:a,icon:s,color:u}){const d={green:"text-green-600",blue:"text-blue-600",purple:"text-blue-600",orange:"text-orange-600"}[u||"gray"]||"text-gray-900";return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsxs("div",{className:`text-[22px] font-bold flex items-center gap-2 ${d}`,children:[a,s]}),e.jsx("div",{className:"text-[11px] text-gray-500",children:t})]})}function Xe({semester:t,onClose:a,onSuccess:s}){const u=!!t,[d,v]=h.useState(!1),x=new Date().getFullYear(),c=new Date().getMonth()+1,[n,N]=h.useState({year:(t==null?void 0:t.year)||x,semester:(t==null?void 0:t.semester)||(c<=6?"first":"second"),startDate:(t==null?void 0:t.startDate)||"",endDate:(t==null?void 0:t.endDate)||"",registrationStartDate:(t==null?void 0:t.registrationStartDate)||"",registrationEndDate:(t==null?void 0:t.registrationEndDate)||"",status:(t==null?void 0:t.status)||"planning",minEnrollment:(t==null?void 0:t.minEnrollment)||5,monthlyFee:(t==null?void 0:t.monthlyFee)||3e4,managerName:(t==null?void 0:t.managerName)||"",managerPhone:(t==null?void 0:t.managerPhone)||"",managerPosition:(t==null?void 0:t.managerPosition)||"",orientationDate:(t==null?void 0:t.orientationDate)||"",openingDate:(t==null?void 0:t.openingDate)||"",description:(t==null?void 0:t.description)||"",instructorAccessCode:(t==null?void 0:t.instructorAccessCode)||""}),w=We(n.year,n.semester);async function p(g){if(g.preventDefault(),!n.startDate||!n.endDate||!n.managerName||!n.managerPhone){f.error("íì í목ì ì
ë ¥íì¸ì");return}try{v(!0);const k={...n,name:w,createdBy:"admin"};
95u?(await H.updateSemester(t.id,k),f.success("íê¸°ê° ìì ëììµëë¤")):(await H.createSemester(k),f.success("íê¸°ê° ì¶ê°ëììµëë¤")),s()}catch{f.error(u?"ìì ì ì¤í¨íìµëë¤":"ì¶ê°ì ì¤í¨íìµëë¤")}finally{v(!1)}}return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[e.jsx("div",{className:"p-4 border-b border-gray-200",children:e.jsx("h2",{className:"text-[16px] font-bold text-gray-900",children:u?"í기 ìì ":"í기 ì¶ê°"})}),e.jsxs("form",{onSubmit:p,className:"p-4 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì°ë ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("select",{value:n.year,onChange:g=>N({...n,year:parseInt(g.target.value)}),className:"compact-input",children:[x-1,x,x+1].map(g=>e.jsxs("option",{value:g,children:[g,"ë
"]},g))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["í기 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("select",{value:n.semester,onChange:g=>N({...n,semester:g.target.value}),className:"compact-input",children:[e.jsx("option",{value:"first",children:"ìë°ê¸°"}),e.jsx("option",{value:"second",children:"íë°ê¸°"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"í기ëª
"}),e.jsx("input",{type:"text",value:w,disabled:!0,className:"compact-input bg-gray-50"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ììì¼ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"date",value:n.startDate,onChange:g=>N({...n,startDate:g.target.value}),className:"compact-input",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¢
ë£ì¼ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"date",value:n.endDate,onChange:g=>N({...n,endDate:g.target.value}),className:"compact-input",required:!0})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ëª¨ì§ ììì¼"}),e.jsx("input",{type:"date",value:n.registrationStartDate,onChange:g=>N({...n,registrationStartDate:g.target.value}),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ëª¨ì§ ì¢
ë£ì¼"}),e.jsx("input",{type:"date",value:n.registrationEndDate,onChange:g=>N({...n,registrationEndDate:g.target.value}),className:"compact-input"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ë´ë¹ì ì´ë¦ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:n.managerName,onChange:g=>N({...n,managerName:g.target.value}),className:"compact-input",placeholder:"í길ë",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ë´ë¹ì ì°ë½ì² ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"tel",value:n.managerPhone,onChange:g=>N({...n,managerPhone:g.target.value}),className:"compact-input",placeholder:"010-1234-5678",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë´ë¹ì ì§ë¶"}),e.jsx("input",{type:"text",value:n.managerPosition,onChange:g=>N({...n,managerPosition:g.target.value}),className:"compact-input",placeholder:"ê¶ì¬"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"기본 ì ìê°ë£"}),e.jsx("input",{type:"number",value:n.monthlyFee,onChange:g=>N({...n,monthlyFee:parseInt(g.target.value)}),className:"compact-input",min:"0",step:"1000"}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"ê°ì¢ì ìê°ë£ 미ì
ë ¥ ì ì ì©ëë 기본ê°"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ìµì ê°ì¤ ì¸ì"}),e.jsx("input",{type:"number",value:n.minEnrollment,onChange:g=>N({...n,minEnrollment:parseInt(g.target.value)}),className:"compact-input",min:"1"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¤ë¦¬ìí
ì´ì
ë ì§"}),e.jsx("input",{type:"date",value:n.orientationDate,onChange:g=>N({...n,orientationDate:g.target.value}),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê°ê°ì¼"}),e.jsx("input",{type:"date",value:n.openingDate,onChange:g=>N({...n,openingDate:g.target.value}),className:"compact-input"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê°ì¬ ì ë³´ ì
ë ¥ ì ê·¼ì½ë"}),e.jsx("input",{type:"text",value:n.instructorAccessCode,onChange:g=>N({...n,instructorAccessCode:g.target.value}),className:"compact-input",placeholder:"ê°ì¬ë¤ì´ ì ë³´ ì
ë ¥ ì ì¬ì©í ì½ë"}),e.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:"ê°ì¬ ì
ë ¥ íì´ì§(culture.seodoon.org/instructor-form.html)ìì ì¬ì©"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ìë´ ë¬¸êµ¬"}),e.jsx("textarea",{value:n.description,onChange:g=>N({...n,description:g.target.value}),className:"compact-input",rows:2,placeholder:"í기ì ëí ì¶ê° ìë´ ë¬¸êµ¬"})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:a,className:"flex-1 px-3 py-2 border border-gray-300 rounded hover:bg-gray-50 transition-colors text-[13px]",children:"ì·¨ì"}),e.jsx("button",{type:"submit",disabled:d,className:"flex-1 px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium disabled:opacity-50",children:d?"ì²ë¦¬ ì¤...":u?"ìì ":"ì¶ê°"})]})]})]})})}function Je({course:t,semesterId:a,onClose:s,onSuccess:u}){const d=!!t,[v,x]=h.useState(!1),[c,n]=h.useState({category:(t==null?void 0:t.category)||"music",name:(t==null?void 0:t.name)||"",description:(t==null?void 0:t.description)||"",instructor:(t==null?void 0:t.instructor)||"",instructorTitle:(t==null?void 0:t.instructorTitle)||"",instructorPhone:(t==null?void 0:t.instructorPhone)||"",instructorProfile:(t==null?void 0:t.instructorProfile)||{photoUrl:"",bio:"",careers:[]},schedule:(t==null?void 0:t.schedule)||{dayOfWeek:[],startTime:"10:00",endTime:"11:00",note:""},scheduleText:(t==null?void 0:t.scheduleText)||"",durationText:(t==null?void 0:t.durationText)||"",weeklyOverrides:(t==null?void 0:t.weeklyOverrides)||[],location:(t==null?void 0:t.location)||"",maxEnrollment:(t==null?void 0:t.maxEnrollment)||void 0,fee:(t==null?void 0:t.fee)??void 0,feeType:(t==null?void 0:t.feeType)||"monthly",status:(t==null?void 0:t.status)||"draft",sortOrder:(t==null?void 0:t.sortOrder)||1,imageUrl:(t==null?void 0:t.imageUrl)||"",tagline:(t==null?void 0:t.tagline)||"",targetAudience:(t==null?void 0:t.targetAudience)||"",suppliesNeeded:(t==null?void 0:t.suppliesNeeded)||"",curriculum:(t==null?void 0:t.curriculum)||[]}),[N,w]=h.useState(!1),[p,g]=h.useState(!1),k=h.useCallback(async(i,j)=>{var l;const o=(l=i.target.files)==null?void 0:l[0];if(!o)return;if(o.size>5*1024*1024){f.error("5MB ì´íë§ ê°ë¥í©ëë¤");return}const r=j==="course"?w:g;try{r(!0);const m=Date.now(),b=o.name.split(".").pop()||"jpg",C=j==="course"?`culture/courses/${m}.${b}
95`:`culture/instructors/${m}.${b}`,A=Ne(Se,C);await ve(A,o,{contentType:o.type});const D=await we(A);n(j==="course"?I=>({...I,imageUrl:D}):I=>({...I,instructorProfile:{...I.instructorProfile,photoUrl:D}})),f.success("ì´ë¯¸ì§ê° ì
ë¡ëëììµëë¤")}catch{f.error("ì
ë¡ëì ì¤í¨íìµëë¤")}finally{r(!1)}},[]);function M(){const i=c.curriculum.length+1;n({...c,curriculum:[...c.curriculum,{week:i,title:"",description:""}]})}function P(i){const j=c.curriculum.filter((o,r)=>r!==i).map((o,r)=>({...o,week:r+1}));n({...c,curriculum:j})}function F(i,j,o){const r=[...c.curriculum];r[i]={...r[i],[j]:o},n({...c,curriculum:r})}function R(){n({...c,instructorProfile:{...c.instructorProfile,careers:[...c.instructorProfile.careers||[],""]}})}function _(i){const j=(c.instructorProfile.careers||[]).filter((o,r)=>r!==i);n({...c,instructorProfile:{...c.instructorProfile,careers:j}})}function W(i,j){const o=[...c.instructorProfile.careers||[]];o[i]=j,n({...c,instructorProfile:{...c.instructorProfile,careers:o}})}async function y(i){var j;if(i.preventDefault(),!c.name||!c.instructor||!((j=c.scheduleText)!=null&&j.trim())){f.error("íì í목ì ì
ë ¥íì¸ì");return}try{x(!0);const o={...c,semesterId:a,createdBy:"admin"};d?(await $.updateCourse(t.id,o),f.success("ê°ì¢ê° ìì ëììµëë¤")):(await $.createCourse(o),f.success("ê°ì¢ê° ì¶ê°ëììµëë¤")),u()}catch{f.error(d?"ìì ì ì¤í¨íìµëë¤":"ì¶ê°ì ì¤í¨íìµëë¤")}finally{x(!1)}}return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[e.jsx("div",{className:"p-4 border-b border-gray-200",children:e.jsx("h2",{className:"text-[16px] font-bold text-gray-900",children:d?"ê°ì¢ ìì ":"ê°ì¢ ì¶ê°"})}),e.jsxs("form",{onSubmit:y,className:"p-4 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¹´í
ê³ ë¦¬ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("select",{value:c.category,onChange:i=>n({...c,category:i.target.value}),className:"compact-input",children:Object.entries(se).map(([i,j])=>e.jsx("option",{value:i,children:j},i))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì ë ¬ ìì"}),e.jsx("input",{type:"number",value:c.sortOrder,onChange:i=>n({...c,sortOrder:parseInt(i.target.value)}),className:"compact-input",min:"1"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ê°ì¢ëª
",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:c.name,onChange:i=>n({...c,name:i.target.value}),className:"compact-input",placeholder:"ì: ë°ì±êµì¤",required:!0}),!d&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:_e.filter(i=>i.category===c.category).map(i=>e.jsx("button",{type:"button",onClick:()=>n({...c,name:i.name}),className:"px-2 py-0.5 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded text-[10px]",children:i.name},i.name))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¤ëª
"}),e.jsx("textarea",{value:c.description,onChange:i=>n({...c,description:i.target.value}),className:"compact-input",rows:2,placeholder:"ê°ì¢ì ëí ê°ë¨í ì¤ëª
"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ê°ì¬ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:c.instructor,onChange:i=>n({...c,instructor:i.target.value}),className:"compact-input",placeholder:"í길ë",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê°ì¬ ì§ì±
"}),e.jsx("input",{type:"text",value:c.instructorTitle,onChange:i=>n({...c,instructorTitle:i.target.value}),className:"compact-input",placeholder:"ê¶ì¬"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê°ì¬ ì°ë½ì²"}),e.jsx("input",{type:"tel",value:c.instructorPhone,onChange:i=>n({...c,instructorPhone:i.target.value}),className:"compact-input",placeholder:"010-1234-5678"})]})]}),e.jsxs("div",{className:"space-y-3 p-3 bg-blue-50 rounded",children:[e.jsx("h3",{className:"text-[13px] font-bold text-gray-900",children:"ê°ì¬ íë¡í (íë³´ ì¬ì´í¸ì©)"}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:c.instructorProfile.photoUrl?e.jsx("img",{src:c.instructorProfile.photoUrl,alt:"ê°ì¬ ì¬ì§",className:"w-16 h-16 rounded-full object-cover border-2 border-white shadow"}):e.jsx("div",{className:"w-16 h-16 rounded-full bg-gray-200 flex items-center justify-center",children:e.jsx(be,{className:"w-6 h-6 text-gray-400"})})}),e.jsx("div",{className:"flex-1",children:e.jsxs("label",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-gray-200 rounded hover:bg-gray-50 cursor-pointer w-fit text-[12px]",children:[e.jsx(ye,{className:"w-3.5 h-3.5 text-gray-500"}
95),p?"ì ë¡ë ì¤...":"ê°ì¬ ì¬ì§ ì ë¡ë",e.jsx("input",{type:"file",accept:"image/*",onChange:i=>k(i,"instructor"),className:"hidden",disabled:p})]})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê°ì¬ ìê°"}),e.jsx("textarea",{value:c.instructorProfile.bio||"",onChange:i=>n({...c,instructorProfile:{...c.instructorProfile,bio:i.target.value}}),className:"compact-input",rows:2,placeholder:"ê°ì¬ ìê° (ê²½ë ¥, ì 문ë¶ì¼ ë±)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê²½ë ¥/ì격"}),(c.instructorProfile.careers||[]).map((i,j)=>e.jsxs("div",{className:"flex gap-1 mb-1",children:[e.jsx("input",{type:"text",value:i,onChange:o=>W(j,o.target.value),className:"compact-input flex-1",placeholder:`ê²½ë ¥ ${j+1}`}),e.jsx("button",{type:"button",onClick:()=>_(j),className:"p-1 text-red-500 hover:bg-red-50 rounded",children:e.jsx(te,{className:"w-3.5 h-3.5"})})]},j)),e.jsx("button",{type:"button",onClick:R,className:"text-[11px] text-blue-600 hover:underline mt-1",children:"+ ê²½ë ¥ ì¶ê°"})]})]}),e.jsxs("div",{className:"space-y-3 p-3 bg-gray-50 rounded",children:[e.jsx("h3",{className:"text-[13px] font-bold text-gray-900",children:"ìì ìê°"}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ê°ììê° ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:c.scheduleText,onChange:i=>n({...c,scheduleText:i.target.value}),className:"compact-input",rows:3,placeholder:`ì: 96매주 í ìì¼ ì¤í 2:00~3:00 973,4주차 í´ë¹ / 1,2주차ë ë¹ì ì¼í°2층`,required:!0}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"ííì´ì§ ìê°ìë´ì ê·¸ëë¡ íìë©ëë¤. ì¤ë°ê¿ ê°ë¥."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ìì 기ê°/íì"}),e.jsx("input",{type:"text",value:c.durationText,onChange:i=>n({...c,durationText:i.target.value}),className:"compact-input",placeholder:"ì: 16주 / íê¸°ë¹ 8í (ë¹ìëë©´ 미íì)"}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"ê°ì¢ë³ë¡ ìì 기ê°Â·íìê° ë¤ë¥¼ ê²½ì° ì ë ¥íì¸ì. ìê°ë£ ìì íìë©ëë¤."})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¥ì ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:c.location,onChange:i=>n({...c,location:i.target.value}),className:"compact-input",rows:2,placeholder:`ì: 1,2주 ë¹ì ì¼í° 983,4주 êµì¡ê´`,required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ìµë ì ì (0=무ì í)"}),e.jsx("input",{type:"number",value:c.maxEnrollment||"",onChange:i=>n({...c,maxEnrollment:i.target.value?parseInt(i.target.value):void 0}),className:"compact-input",placeholder:"무ì í",min:"0"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ìê°ë£ (ì)"}),e.jsx("input",{type:"number",value:c.fee??"",onChange:i=>n({...c,fee:i.target.value?parseInt(i.target.value):void 0}),className:"compact-input",placeholder:"ë¹ìëë©´ í기 기본 ìê°ë£ ì ì©",min:"0",step:"1000"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë©ë¶ì£¼ê¸°"}),e.jsx("select",{value:c.feeType,onChange:i=>n({...c,feeType:i.target.value}),className:"compact-input",children:Object.entries(Ce).map(([i,j])=>e.jsx("option",{value:i,children:j},i))})]})]}),e.jsx("p",{className:"text-[11px] text-gray-400 -mt-2",children:"ê°ì¢ë³ë¡ ìê°ë£ê° ë¤ë¥¼ ê²½ì° ì ë ¥íì¸ì. ë¹ìëë©´ í기 기본 ìê°ë£(ìë©)ê° ì ì©ë©ëë¤. ì) ì±ì ë° 80,000ì · 1í(ì¼ìë©) / í모ëì¹´ 20,000ì · ìë©"}),e.jsxs("div",{className:"space-y-3 p-3 bg-amber-50 rounded",children:[e.jsx("h3",{className:"text-[13px] font-bold text-gray-900",children:"íë³´ ì ë³´ (íë³´ ì¬ì´í¸ì©)"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê°ì¢ ëí ì´ë¯¸ì§"}),e.jsxs("div",{className:"flex items-center gap-3",children:[c.imageUrl&&e.jsx("img",{src:c.imageUrl,alt:"ê°ì¢ ì´ë¯¸ì§",className:"w-20 h-14 roun
98ded object-cover border"}),e.jsxs("label",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-gray-200 rounded hover:bg-gray-50 cursor-pointer text-[12px]",children:[e.jsx(Me,{className:"w-3.5 h-3.5 text-gray-500"}),N?"ì
ë¡ë ì¤...":"ì´ë¯¸ì§ ì í",e.jsx("input",{type:"file",accept:"image/*",onChange:i=>k(i,"course"),className:"hidden",disabled:N})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"íì¤ íë³´ 문구"}),e.jsx("input",{type:"text",value:c.tagline,onChange:i=>n({...c,tagline:i.target.value}),className:"compact-input",placeholder:"ì: ìì
ì ì¦ê±°ìì í¨ê» ëë ì!",maxLength:50})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ëì"}),e.jsx("input",{type:"text",value:c.targetAudience,onChange:i=>n({...c,targetAudience:i.target.value}),className:"compact-input",placeholder:"ì: ë구ë ì°¸ì¬ ê°ë¥"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¤ë¹ë¬¼"}),e.jsx("input",{type:"text",value:c.suppliesNeeded,onChange:i=>n({...c,suppliesNeeded:i.target.value}),className:"compact-input",placeholder:"ì: ê°ì¸ ì
기 ì§ì°¸"})]})]})]}),e.jsxs("div",{className:"space-y-3 p-3 bg-green-50 rounded",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-[13px] font-bold text-gray-900",children:"ì£¼ì°¨ë³ ì»¤ë¦¬íë¼"}),e.jsxs("button",{type:"button",onClick:M,className:"flex items-center gap-1 text-[11px] text-green-700 hover:underline",children:[e.jsx(ie,{className:"w-3 h-3"})," 주차 ì¶ê°"]})]}),c.curriculum.length===0?e.jsx("p",{className:"text-[11px] text-gray-500 text-center py-2",children:"커리íë¼ì ì¶ê°íë©´ íë³´ ì¬ì´í¸ì íìë©ëë¤"}):e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:c.curriculum.map((i,j)=>e.jsxs("div",{className:"flex items-start gap-2 bg-white p-2 rounded border border-green-100",children:[e.jsx("span",{className:"flex-shrink-0 w-6 h-6 bg-green-600 text-white rounded-full flex items-center justify-center text-[10px] font-bold mt-0.5",children:i.week}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("input",{type:"text",value:i.title,onChange:o=>F(j,"title",o.target.value),className:"compact-input text-[12px]",placeholder:`${i.week}주차 ì 목`}),e.jsx("input",{type:"text",value:i.description||"",onChange:o=>F(j,"description",o.target.value),className:"compact-input text-[11px]",placeholder:"ìì¸ ì¤ëª
(ì í)"})]}),e.jsx("button",{type:"button",onClick:()=>P(j),className:"p-1 text-red-500 hover:bg-red-50 rounded flex-shrink-0",children:e.jsx(te,{className:"w-3.5 h-3.5"})})]},j))})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:s,className:"flex-1 px-3 py-2 border border-gray-300 rounded hover:bg-gray-50 transition-colors text-[13px]",children:"ì·¨ì"}),e.jsx("button",{type:"submit",disabled:v||N||p,className:"flex-1 px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium disabled:opacity-50",children:v?"ì²ë¦¬ ì¤...":d?"ìì ":"ì¶ê°"})]})]})]})})}function Ze(){const[t,a]=h.useState(!0),[s,u]=h.useState([]),[d,v]=h.useState(""),[x,c]=h.useState([]),[n,N]=h.useState(null),[w,p]=h.useState({name:"",bio:"",careers:"",phone:""}),[g,k]=h.useState(!1),[M,P]=h.useState(!1);h.useEffect(()=>{F()},[]),h.useEffect(()=>{d&&R()},[d]);async function F(){try{const o=await H.getAllSemesters();if(u(o),o.length>0){const r=o.find(l=>l.status==="recruiting"||l.status==="active");
98v((r==null?void 0:r.id)||o[0].id)}}catch(o){console.error("í기 ëª©ë¡ ì¡°í ì¤í¨:",o)}finally{a(!1)}}async function R(){try{a(!0);const o=await $.getCoursesBySemester(d);c(o.sort((r,l)=>(r.sortOrder||0)-(l.sortOrder||0)))}catch(o){console.error("ë°ì´í° ë¡ë© ì¤í¨:",o),f.error("ë°ì´í°ë¥¼ ë¶ë¬ì¬ ì ììµëë¤")}finally{a(!1)}}function _(o){const r=`https://culture.seodoon.org/instructor-form.html?course=${o}`;navigator.clipboard.writeText(r),f.success("ê°ì¬ ì ë ¥ ë§í¬ê° ë³µì¬ëììµëë¤")}function W(o){const r=o.instructorProfile||{};N(o.id),p({name:o.instructor||"",bio:r.bio||"",careers:(r.careers||[]).join(` 99`),phone:o.instructorPhone||""})}function y(){N(null),p({name:"",bio:"",careers:"",phone:""})}async function i(o,r){if(r.size>5*1024*1024){f.error("íì¼ í¬ê¸°ê° 5MB를 ì´ê³¼í©ëë¤");return}try{P(!0);const l=r.name.split(".").pop()||"jpg",m=Ne(Se,`culture/instructors/${o}/photo.${l}`);await ve(m,r);const b=await we(m),C=x.find(D=>D.id===o),A=(C==null?void 0:C.instructorProfile)||{};await $.updateCourse(o,{instructorProfile:{...A,photoUrl:b}}),f.success("ê°ì¬ ì¬ì§ì´ ì ë°ì´í¸ëììµëë¤"),R()}catch(l){console.error("ì¬ì§ ì ë¡ë ì¤í¨:",l),f.error("ì¬ì§ ì ë¡ëì ì¤í¨íìµëë¤")}finally{P(!1)}}async function j(o){try{k(!0);const r=x.find(b=>b.id===o),l=(r==null?void 0:r.instructorProfile)||{},m=w.careers.split(/\r?\n/).map(b=>b.trim()).filter(b=>b);await $.updateCourse(o,{instructor:w.name.trim(),instructorPhone:w.phone.trim()||void 0,instructorProfile:{...l,bio:w.bio.trim(),careers:m}}),f.success("ê°ì¬ ì ë³´ê° ì ì¥ëììµëë¤"),N(null),R()}catch(r){console.error("ì ì¥ ì¤í¨:",r),f.error("ì ì¥ì ì¤í¨íìµëë¤")}finally{k(!1)}}return t&&x.length===0?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"ë¡ë© ì¤..."})}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("label",{className:"text-[13px] font-medium text-gray-700",children:"í기"}),e.jsx("select",{value:d,onChange:o=>v(o.target.value),className:"px-3 py-1.5 border border-gray-300 rounded text-[13px]",children:s.map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))})]}),x.length===0?e.jsx("div",{className:"text-center py-16 text-gray-500 text-[13px]",children:"ë±ë¡ë ê°ì¢ê° ììµëë¤"}):e.jsx("div",{className:"space-y-4",children:x.map(o=>{const r=o.instructorProfile||{},l=n===o.id;return e.jsx("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-shrink-0",children:[e.jsxs("label",{className:"cursor-pointer group relative",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gray-100 flex items-center justify-center overflow-hidden ring-2 ring-gray-200 group-hover:ring-blue-300 transition-all",children:r.photoUrl?e.jsx("img",{src:r.photoUrl,alt:o.instructor,className:"w-full h-full object-cover"}):e.jsx(be,{className:"w-8 h-8 text-gray-300"})}),e.jsx("div",{className:"absolute inset-0 rounded-full bg-black/30 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:e.jsx(ye,{className:"w-4 h-4 text-white"})}),e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:m=>{var C;const b=(C=m.target.files)==null?void 0:C[0];b&&i(o.id,b),m.target.value=""},disabled:M})]}),M&&e.jsx("span",{className:"text-[10px] text-blue-600",children:"ì ë¡ë ì¤..."})]}),e.jsx("div",{className:"flex-1 min-w-0",children:l?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-500 mb-1 block",children:"ê°ì¬ëª "}),e.jsx("input",{type:"text",value:w.name,onChange:m=>p(b=>({...b,name:m.target.value})),className:"w-full px-2.5 py-1.5 border border-gray-300 rounded text-[13px] focus:outline-none focus:border-blue-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-500 mb-1 block",children:"ì°ë½ì²"}),e.jsx("input",{type:"tel",value:w.phone,onChange:m=>p(b=>({...b,phone:m.target.value})),placeholder:"010-0000-0000",className:"w-full px-2.5 py-1.5 border border-gray-300 rounded text-[13px] focus:outline-none focus:border-blue-500"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-500 mb-1 block",children:"ì기ìê°"}),e.jsx("textarea",{value:w.bio,onChange:m=>p(b=>({...b,bio:m.target.value})),rows:2,placeholder:"ê°ì¬ ìê°",className:"w-full px-2.5 py-1.5 border border-gray-300 rounded text-[13px] focus:outline-none focus:border-blue-500 resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-500 mb-1 block",children:"ê²½ë ¥/ì격 (ì¤ë°ê¿ 구ë¶)"}),e.jsx("textarea",{value:w.careers,onChange:m=>p(b=>({...b,careers:m.target.value})),rows:3,placeholder:"í ì¤ì íëì© ì ë ¥",className:"w-full px-2.5 py-1.5 border border-gray-300 rounded text-[13px] focus:outline-none focus:border-blue-500 resize-none"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>j(o.id),disabled:g,className:"px-3 py-1.5 bg-blue-600 text-white rounded text-[12px] font-medium hover:bg-blue-700 disabled:opacity-50 flex items-center gap-1",children:[e.jsx(ce,{className:"w-3 h-3"}),g?"ì ì¥ ì¤...":"ì ì¥"]}),e.jsxs("button",{onClick:y,className:"px-3 py-1.5 border border-gray-300 rounded text-[12px] font-medium hover:bg-gray-50 flex items-center gap-1",children:[e.jsx(te,{className:"w-3 h-3"}),"ì·¨ì"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-bold text-[15px] text-gray-900",children:o.instructor||"ê°ì¬ 미ì "}),o.instructorPhone&&e.jsxs("span",{className:"text-[11px] text-gray-400 flex items-center gap-0.5",children:[e.jsx(Re,{className:"w-3 h-3"})," ",o.instructorPhone]}),e.jsxs("button",{onClick:()=>W(o),className:"ml-auto flex items-center gap-1 px-2 py-1 text-[11px] font-medium text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors",children:[e.jsx(pe,{className:"w-3 h-3"}),"ìì "]})]}),e.jsxs("div",{className:"text-[13px] text-gray-600 mt-1 flex items-center gap-1.5",children:[e.jsx(Z,{className:"w-3.5 h-3.5 text-blue-500"}),e.jsx("span",{className:"font-medium",children:o.name}),o.schedule&&e.jsxs("span",{className:"text-gray-400",children:["| ",ae(o.schedule)]}),o.location&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300",children:"|"}),e.jsx(Le,{className:"w-3 h-3 text-gray-400"}),e.jsx("span",{className:"text-gray-400",children:o.location})]})]}),r.bio&&e.jsx("p",{className:"text-[12px] text-gray-500 mt-2 line-clamp-2",children:r.bio}),r.careers&&r.careers.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:r.careers.map((m,b)=>e.jsx("span",{className:"inline-block px-2 py-0.5 bg-gray-50 border border-gray-200 rounded text-[11px] text-gray-600",children:m},b))})]})})]}),!l&&e.jsx("div",{className:"flex items-center mt-3 pt-3 border-t border-gray-100",children:e.jsxs("button",{onClick:()=>_(o.id),className:"flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium text-blue-600 bg-blue-50 rounded hover:bg-blue-100 transition-colors",title:"ê°ì¬ìê² ì´ ë§í¬ë¥¼ ë³´ë´ë©´ ì기 íë¡í/커리íë¼ì ì§ì ì ë ¥í ì ììµëë¤",children:[e.jsx(Oe,{className:"w-3 h-3"}),"ê°ì¬ ì ë ¥ ë§í¬ ë³µì¬"]})})]})},o.id)})})]})}export{it as CultureManagementPage};
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.