1import{j as e}from"./vendor-data-Z5doMMu-.js";import{b as fe,r as b}from"./vendor-react-zNM0AU50.js";import{b as E}from"./bulletinService-CRS1aT1n.js";import{v as je,a as be,d as Ne}from"./imageService-5xt-7IGi.js";import{a7 as i,F as U,ak as ae,aa as k,c as se,g as we,af as Se,D as Oe,aA as Ce,T as _,aR as J,aS as V}from"./vendor-ui-CW5bJ11U.js";import"./vendor-firebase-Da9KY1q_.js";import"./index-D1K3lVhu.js";import"./vendor-charts-08G1rM8P.js";const ke=[{order:1,title:"ìë°°ìë¶ë¦",detail:"ì¸ëì"},{order:2,title:"ì¡ì",detail:"ì°¬ìë"},{order:3,title:"경배ìì°¬ì¡",detail:"42ì¥"},{order:4,title:"ì°¸íì기ë",detail:"ë¤ê°ì´"},{order:5,title:"ì¬í¨ìíì ",detail:"ì¸ëì"},{order:6,title:"ìê´ì¡",detail:"ì°¬ìë"},{order:7,title:"ì±ìêµë
",detail:"11ë²"},{order:8,title:"ì ìê³ ë°±",detail:"ì¬ëì ê²½"},{order:9,title:"ì°¬ì¡",detail:"219ì¥"},{order:10,title:"기ëì¸ë",detail:"ì´ìë³µ ìì§"},{order:11,title:"ì±ëìêµì ",detail:"ì¸ëì"},{order:12,title:"êµíìì",detail:"ì¸ëì"},{order:13,title:"ì±ê²½ë´ë
",detail:"íë¸ë¦¬ì 10ì¥ 19~25ì (ì ì½ 364쪽)"},{order:14,title:"ì°¬ì",detail:"ë²§ìì°¬ìë"},{order:15,title:"ë§ìì í¬",detail:"모ì´ê¸°ì ëì± íììë¤ / ê¹ìí 목ì¬"},{order:16,title:"ë´í",detail:"íë¼ìì ë°±ëê¹ì§"},{order:17,title:"ë´í기ë",detail:"ì¤êµì"},{order:18,title:"ìíê³¼ì¶ë",detail:"ì¤êµì"}],_e=[{order:1,title:"ìë°°ì ë¶ë¦",detail:"ì¸ëì"},{order:2,title:"경배ì ì°¬ì",detail:"경배ì ì°¬ì¡ ~ 기ëì¸ë ì ê¹ì§"},{order:3,title:"기ë",detail:""},{order:4,title:"ì±ê²½ë´ë
",detail:"ì¸ëì"},{order:5,title:"ì°¬ì",detail:""},{order:6,title:"ì¤êµ",detail:""},{order:7,title:"ì°¬ì",detail:""},{order:8,title:"êµíìì",detail:"ìì목ì¬"},{order:9,title:"ì¶ë",detail:"ìì목ì¬"}],Ae=[{order:1,title:"ìë°°ì ë¶ë¦",detail:"ì¸ëì"},{order:2,title:"ì°¬ì¡",detail:""},{order:3,title:"기ë",detail:""},{order:4,title:"ì±ê²½ë´ë
",detail:"ì¸ëì"},{order:5,title:"ì°¬ì",detail:""},{order:6,title:"ì¤êµ",detail:""},{order:7,title:"ì°¬ì",detail:""},{order:8,title:"êµíìì",detail:"ìì목ì¬"},{order:9,title:"ì¶ë",detail:"ìì목ì¬"}],Ee=[{order:1,title:"ìë°°ìë¶ë¦",detail:"ì¸ëì"},{order:2,title:"ì°¬ì¡",detail:"154ì¥"},{order:3,title:"기ë",detail:"ê¹ëì¥ ì§ì¬"},{order:4,title:"ì±ê²½ë´ë
",detail:"ì¸ëì"},{order:5,title:"ì°¬ì",detail:"ìì´ë ë¤ ì¤ì°½ë¨"},{order:6,title:"ì¤êµ",detail:"ê¹ëª
ì 목ì¬"},{order:7,title:"ì°¬ì",detail:"429ì¥"},{order:8,title:"êµíìì",detail:"ìì목ì¬"},{order:9,title:"ì¶ë",detail:"ìì목ì¬"}],Me=[{order:1,title:"경배ìì°¬ì",detail:"ììì°¬ìí"},{order:2,title:"기ë",detail:"ì¡ì¼ì ì§ì¬"},{order:3,title:"ì±ê²½ë´ë
",detail:"ì¸ëì"},{order:4,title:"ì°¬ì",detail:"ë¸ëì ì°¬ìë"},{order:5,title:"ì¤êµ",detail:"ê¹ìí 목ì¬"},{order:6,title:"ì°¬ì",detail:"ë´ ë 주ì ìê´ì ë³´ë¤"},{order:7,title:"기ë",detail:"ë¤ê°ì´"},{order:8,title:"ì¶ë",detail:"ìì목ì¬"}],te={ì¼ë°ì£¼ì¼ìë°°:ke,ì´ë¦°ìë°°:_e,ì²ë
ìë°°:Ae,ì¤íìë°°:Ee,ìììë°°:Me},Pe=["ëë¼ì민족","íì°ë¥¼ìí´","ë¤ìì¸ë","ì ëë°ì êµ","구ìê³¼ë¶ì","ì배·êµì§ì"];function Je(){const l=fe(),[T,M]=b.useState(!0),[m,v]=b.useState([]),[f,S]=b.useState(""),[p,P]=b.useState("all"),[D,O]=b.useState("all"),[A,a]=b.useState(!1),[d,B]=b.useState(null);b.useEffect(()=>{j()},[]);async function j(){try{M(!0);const c=await E.getAllBulletins();v(c)}catch(c){console.error("주보 ë¡ë© ì¤í¨:",c),i.error("주보를 ë¶ë¬ì¬ ì ììµëë¤")}finally{M(!1)}}const F=[...new Set(m.map(c=>c.date.split("-")[0]))].sort((c,x)=>x.localeCompare(c)),Y=m.filter(c=>{var x,h,C;if(D!=="all"&&!c.date.startsWith(D)||p!=="all"&&(c.status||"draft")!==p)return!1;if(f){const g=f.toLowerCase();return!!(c.date.includes(g)||c.week.toLowerCase().includes(g)||((x=c.sunday_services)==null?void 0:x.some(y=>{var N,w;return((N=y.sermon_title)==null?void 0:N.toLowerCase().includes(g))||((w=y.sermon_text)==null?void 0:w.toLowerCase().includes(g))}))||((h=c.announcements)==null?void 0:h.some(y=>{var N,w;return((N=y.content)==null?void 0:N.toLowerCase().includes(g))||((w=y.title)==null?void 0:w.toLowerCase().includes(g))}))||((C=c.servingMembers)==null?void 0:C.some(y=>{var N,w;return((N=y.members)==null?void 0:N.toLowerCase().includes(g))||((w=y.role)==null?void 0:w.toLowerCase().includes(g))})))}return!0}),W={all:m.length,draft:m.filter(c=>(c.status||"draft")==="draft").length,published:m.filter(c=>
1c.status==="published").length,archived:m.filter(c=>c.status==="archived").length};async function $(c){if(confirm("ì´ ì£¼ë³´ë¥¼ ìì íìê² ìµëê¹?"))try{await E.deleteBulletin(c),i.success("ìì ëììµëë¤"),j()}catch{i.error("ìì ì ì¤í¨íìµëë¤")}}async function z(c){const x=prompt("ë³µì¬í ë ì§ë¥¼ ì ë ¥íì¸ì (YYYY-MM-DD):",c.date);if(!x)return;const h=prompt("주차를 ì ë ¥íì¸ì:",c.week);if(h)try{const{id:C,created_at:g,updated_at:X,published_at:L,published_by:Z,...y}=c;await E.createBulletin({...y,date:x,week:h,status:"draft",created_by:"admin"}),i.success("ì£¼ë³´ê° ë³µì¬ëììµëë¤"),j()}catch{i.error("ë³µì¬ì ì¤í¨íìµëë¤")}}async function G(c){const x=m.find(h=>h.id===c);if(!x){i.error("주보를 ì°¾ì ì ììµëë¤");return}if(!x.images||x.images.length===0){i.error(`주보 ì´ë¯¸ì§ë¥¼ 먼ì ë±ë¡í´ì£¼ì¸ì. 2ì´ë¯¸ì§ ìì´ë ë°íí ì ììµëë¤.`);return}if(confirm(`ì´ ì£¼ë³´ë¥¼ ë°ííìê² ìµëê¹? 3ë°ííë©´ 모ë ì¬ì©ìê° ë³¼ ì ììµëë¤.`))try{await E.publishBulletin(c,"admin"),i.success("ì£¼ë³´ê° ë°íëììµëë¤"),j()}catch{i.error("ë°íì ì¤í¨íìµëë¤")}}async function q(c){if(confirm(`ë°íì ì·¨ìíìê² ìµëê¹? 4ì´ì ìíë¡ ëëìê°ëë¤.`))try{await E.unpublishBulletin(c),i.success("ë°íì´ ì·¨ìëììµëë¤"),j()}catch{i.error("ë°í ì·¨ìì ì¤í¨íìµëë¤")}}async function K(c){if(confirm(`ì´ ì£¼ë³´ë¥¼ ë³´ê´íìê² ìµëê¹? 5ë³´ê´ë 주보ë 목ë¡ìì ì¨ê²¨ì§ëë¤.`))try{await E.archiveBulletin(c),i.success("ì£¼ë³´ê° ë³´ê´ëììµëë¤"),j()}catch{i.error("ë³´ê´ì ì¤í¨íìµëë¤")}}async function Q(c){try{i.success(`PDF ë¤ì´ë¡ë를 ì¤ë¹ ì¤ì ëë¤... 6미리보기 íì´ì§ìì ë¤ì´ë¡ë ë²í¼ì í´ë¦íì¸ì.`),l(`/bulletin-view?id=${c.id}`)}catch(x){console.error("PDF ë¤ì´ë¡ë ì¤í¨:",x),i.error("PDF ë¤ì´ë¡ëì ì¤í¨íìµëë¤")}}return T?e.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-10rem)]",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"}),e.jsx("span",{className:"text-gray-500 text-sm",children:"주보를 ë¶ë¬ì¤ë ì¤..."})]})}):e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsx("div",{className:"relative overflow-hidden bg-white border border-gray-200 rounded-2xl p-6 shadow-sm",children:e.jsxs("div",{className:"relative flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 bg-blue-50 rounded-xl flex items-center justify-center",children:e.jsx(U,{className:"w-5 h-5 text-blue-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"ì¤ë§í¸ 주보 ê´ë¦¬"})]}),e.jsx("p",{className:"text-gray-500 text-sm",children:"ì£¼ê° ìë°° 주보를 ìì±íê³ ê´ë¦¬í©ëë¤"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>l("/bulletin-view"),className:"flex items-center gap-2 px-4 py-2.5 bg-gray-100 text-gray-700 rounded-xl hover:bg-gray-200 transition-all text-sm font-medium",children:[e.jsx(ae,{className:"w-4 h-4"}),"미리보기"]}),e.jsxs("button",{onClick:()=>{B(null),a(!0)},className:"flex items-center gap-2 px-5 py-2.5 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-all text-sm font-semibold shadow-sm",children:[e.jsx(k,{className:"w-4 h-4"}),"주보 ìì±"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-xl p-4 border border-gray-200 transition-all duration-300 hover:shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(U,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm font-medium text-gray-500",children:"ì ì²´ 주보"})]}),e.jsx("div",{className:"text-2xl font-bold text-gray-900 tabular-nums",children:m.length})]}),e.jsxs("div",{className:"bg-white rounded-xl p-4 border border-gray-200 transition-all duration-300 hover:shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(se,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm font-medium text-gray-500",children:"ì´ë² ë¬"})]}),e.jsx("div",{className:"text-2xl font-bold text-gray-900 tabular-nums",children:m.filter(c=>{const x=new Date(c.date),h=new Date;return x.getMonth()===h.getMonth()}).length})]}),e.jsxs("div",{className:"bg-white rounded-xl p-4 border border-gray-200 transition-all duration-300 hover:shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(se,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm font-medium text-gray-500",children:"ìµê·¼ 주차"})]}),e.jsx("div",{className:"text-2xl font-bold text-gray-900 tabular-nums",children:m[0]?m[0].week:"-"})]})]}),e.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"flex-1 max-w-xs",children:e.jsxs("div",{className:"relative",children:[e.jsx(we,{className:"absolute left-3.5 to
6p-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"ë ì§, 주차, ì¤êµì 목, ê´ê³ ë´ì© ê²ì...",value:f,onChange:c=>S(c.target.value),className:"w-full pl-10 pr-4 py-2.5 border border-gray-200 rounded-xl text-sm bg-gray-50 focus:bg-white focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all"})]})}),e.jsxs("select",{value:D,onChange:c=>O(c.target.value),className:"px-4 py-2.5 border border-gray-200 rounded-xl text-sm bg-gray-50 focus:bg-white focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",children:[e.jsx("option",{value:"all",children:"ì ì²´ ì°ë"}),F.map(c=>e.jsxs("option",{value:c,children:[c,"ë
"]},c))]})]}),e.jsx("div",{className:"flex items-center gap-2 bg-gray-100 p-1 rounded-xl",children:["all","draft","published","archived"].map(c=>e.jsx("button",{onClick:()=>P(c),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${p===c?"bg-white text-blue-600 shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:c==="all"?`ì ì²´ (${W.all})`:c==="draft"?`ì´ì (${W.draft})`:c==="published"?`ë°íë¨ (${W.published})`:`ë³´ê´ë¨ (${W.archived})`},c))})]})}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-gray-100 bg-slate-50",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-blue-50 rounded-lg flex items-center justify-center",children:e.jsx(U,{className:"w-4 h-4 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-gray-900",children:"주보 목ë¡"}),e.jsxs("p",{className:"text-xs text-gray-500",children:[Y.length,"ê°ì 주보"]})]})]})}),Y.length===0?e.jsxs("div",{className:"p-16 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-2xl flex items-center justify-center mx-auto mb-4",children:e.jsx(U,{className:"w-8 h-8 text-gray-400"})}),e.jsx("p",{className:"text-gray-600 font-medium",children:p==="all"?"ìì±ë ì£¼ë³´ê° ììµëë¤":p==="draft"?"ì´ì ìíì ì£¼ë³´ê° ììµëë¤":p==="published"?"ë°íë ì£¼ë³´ê° ììµëë¤":"ë³´ê´ë ì£¼ë³´ê° ììµëë¤"}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"ìë¨ì '주보 ìì±' ë²í¼ì í´ë¦íì¬ ì 주보를 ìì±íì¸ì"})]}):e.jsx("div",{className:"divide-y divide-gray-100",children:Y.map(c=>e.jsx(De,{bulletin:c,onEdit:()=>{B(c),a(!0)},onView:()=>l(`/bulletin-view?id=${c.id}`),onDelete:()=>$(c.id),onDuplicate:()=>z(c),onPublish:()=>G(c.id),onUnpublish:()=>q(c.id),onArchive:()=>K(c.id),onDownloadPDF:()=>Q(c)},c.id))})]}),A&&e.jsx(Te,{bulletin:d,bulletins:m,onClose:()=>{a(!1),B(null)},onSuccess:()=>{a(!1),B(null),j()}})]})}function De({bulletin:l,onEdit:T,onDelete:M,onDuplicate:m,onView:v,onPublish:f,onUnpublish:S,onArchive:p,onDownloadPDF:P}){const D=()=>{const O=l.status||"draft",A={draft:"bg-yellow-50 text-yellow-700 border-yellow-200",published:"bg-emerald-50 text-emerald-700 border-emerald-200",archived:"bg-slate-50 text-gray-600 border-gray-200"},a={draft:"ì´ì",published:"ë°íë¨",archived:"ë³´ê´ë¨"};return e.jsx("span",{className:`px-2.5 py-1 text-xs font-medium border rounded-full ${A[O]}`,children:a[O]})};return e.jsxs("div",{className:"p-5 hover:bg-gray-50 transition-all duration-200",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex flex-col items-center justify-center text-white shadow-sm",children:[e.jsxs("span",{className:"text-[10px] font-medium opacity-80",children:[l.date.split("-")[1],"ì"]}),e.jsx("span",{className:"text-lg font-bold leading-none",children:l.date.split("-")[2]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-base font-bold text-gray-900",children:l.date}),e.jsx("span",{className:"text-sm text-gray-500",children:l.week}),D()]}),l.status==="published"&&l.published_at&&e.jsxs("div",{className:"text-xs text-gray-500",children:["ë°í: ",new Date(l.published_at).toLocaleStr
6ing("ko-KR")]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[l.status==="draft"&&f&&e.jsx("button",{onClick:f,className:"px-3 py-1.5 text-xs font-medium bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 transition-all shadow-sm",title:"ë°íí기",children:"ë°í"}),l.status==="published"&&S&&e.jsx("button",{onClick:S,className:"px-3 py-1.5 text-xs font-medium bg-yellow-500 text-white rounded-lg hover:bg-yellow-600 transition-all shadow-sm",title:"ë°í ì·¨ì",children:"ì·¨ì"}),(l.status==="draft"||l.status==="published")&&p&&e.jsx("button",{onClick:p,className:"px-3 py-1.5 text-xs font-medium bg-gray-500 text-white rounded-lg hover:bg-gray-600 transition-all shadow-sm",title:"ë³´ê´í기",children:"ë³´ê´"}),e.jsxs("div",{className:"flex gap-1 ml-2",children:[e.jsx("button",{onClick:v,className:"p-2 hover:bg-blue-100 rounded-lg transition-colors",title:"보기",children:e.jsx(ae,{className:"w-4 h-4 text-blue-600"})}),e.jsx("button",{onClick:T,className:"p-2 hover:bg-blue-100 rounded-lg transition-colors",title:"ìì ",children:e.jsx(Se,{className:"w-4 h-4 text-blue-600"})}),P&&e.jsx("button",{onClick:P,className:"p-2 hover:bg-blue-100 rounded-lg transition-colors",title:"PDF ë¤ì´ë¡ë",children:e.jsx(Oe,{className:"w-4 h-4 text-blue-600"})}),e.jsx("button",{onClick:m,className:"p-2 hover:bg-green-100 rounded-lg transition-colors",title:"ë³µì¬",children:e.jsx(Ce,{className:"w-4 h-4 text-green-600"})}),e.jsx("button",{onClick:M,className:"p-2 hover:bg-red-100 rounded-lg transition-colors",title:"ìì ",children:e.jsx(_,{className:"w-4 h-4 text-red-600"})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm ml-16",children:[e.jsxs("div",{className:"space-y-1.5 p-3 bg-gray-50 rounded-lg",children:[e.jsx("div",{className:"font-semibold text-gray-800 mb-2",children:"ì£¼ì¼ ìë°°"}),l.sunday_services.map((O,A)=>e.jsxs("div",{className:"text-gray-600 flex items-center gap-2",children:[e.jsxs("span",{className:"w-12 text-xs font-medium text-blue-600",children:[A+1,"ë¶"]}),e.jsx("span",{className:"text-xs text-gray-400",children:O.time}),e.jsx("span",{className:"truncate",children:O.sermon_title||"미ì "})]},A))]}),e.jsxs("div",{className:"space-y-1.5 p-3 bg-gray-50 rounded-lg",children:[e.jsx("div",{className:"font-semibold text-gray-800 mb-2",children:"기í ìë°°"}),e.jsxs("div",{className:"text-gray-600 flex items-center gap-2",children:[e.jsx("span",{className:"w-12 text-xs font-medium text-blue-600",children:"ì¤í"}),e.jsx("span",{children:l.sundayAfternoon.time})]}),e.jsxs("div",{className:"text-gray-600 flex items-center gap-2",children:[e.jsx("span",{className:"w-12 text-xs font-medium text-blue-600",children:"ìì"}),e.jsx("span",{children:l.wednesdayService.time})]})]})]})]})}function Re(l){var v;if(l.length===0)return"74-1주";const m=(((v=l[0])==null?void 0:v.week)||"").match(/(\d+)-(\d+)주/);if(m){const f=parseInt(m[1]),S=parseInt(m[2]);if(f===74)return`74-${S+1}주`}return"74-1주"}function Te({bulletin:l,bulletins:T,onClose:M,onSuccess:m}){const v=!!l,[f,S]=b.useState(!1),[p,P]=b.useState(!1),D=()=>l!=null&&l.sunday_services?l.sunday_services:[{time:"7:30",hymn:"",prayer:"",sermon_title:"",sermon_text:"",announcement:"",orderOfService:[]},{time:"9:30",hymn:"",prayer:"",sermon_title:"",sermon_text:"",announcement:"",orderOfService:[]},{time:"11:30",hymn:"",prayer:"",sermon_title:"",sermon_text:"",announcement:"",orderOfService:[]},{time:"13:30",hymn:"",prayer:"",sermon_title:"",sermon_text:"",announcement:"",orderOfService:[]}],O=()=>{if(l!=null&&l.dawnPrayer.schedule)return l.dawnPrayer.schedule;const t=["ëë¼ì민족","íì°ë¥¼ìí´","ë¤ìì¸ë","ì ëë°ì êµ","구ìê³¼ë¶ì","ì배·êµì§ì"];return[{day:"ì",passage:"",prayerTopic:t[0]},{day:"í",passage:"",prayerTopic:t[1]},{day:"ì",passage:"",prayerTopic:t[2]},{day:"목",passage:"",prayerTopic:t[3]},{day:"ê¸",passage:"",prayerTopic:t[4]},{day:"í ",passage:"",prayerTopic:t[5]}]},A=()=>l!=null&&l.prayerMembers?l.prayerMembers:[{service:"1ë¶",member:""},{service:"2ë¶",member:""},{service:"3ë¶",member:""}
6,{service:"4ë¶(ì§ì¬)",member:""},{service:"주ì¼ì¤í",member:""},{service:"ìì",member:""}],[a,d]=b.useState({date:(l==null?void 0:l.date)||new Date().toISOString().split("T")[0],week:(l==null?void 0:l.week)||Re(T),sunday_services:D(),status:(l==null?void 0:l.status)||"draft",sundayAfternoon:(l==null?void 0:l.sundayAfternoon)||{time:"ì¤í 2ì",leader:"",sermon_title:"",sermon_text:"",orderOfService:[]},wednesdayService:(l==null?void 0:l.wednesdayService)||{time:"ì¤í 7:30",leader:"",content:"",scripture:"",orderOfService:[]},dawnPrayer:{leader:(l==null?void 0:l.dawnPrayer.leader)||"",schedule:O(),note:(l==null?void 0:l.dawnPrayer.note)||""},weeklyEvents:(l==null?void 0:l.weeklyEvents)||[],prayerMembers:A(),orderOfService:(l==null?void 0:l.orderOfService)||[],announcements:(l==null?void 0:l.announcements)||[],servingMembers:(l==null?void 0:l.servingMembers)||[],weeklySchedule:(l==null?void 0:l.weeklySchedule)||[],images:(l==null?void 0:l.images)||[]});async function B(t){if(t.preventDefault(),!a.date||!a.week){i.error("ë ì§ì 주차를 ì
ë ¥íì¸ì");return}try{S(!0);const s={...a,status:a.status||"draft",created_by:"admin"};v?(await E.updateBulletin(l.id,s),i.success("ì£¼ë³´ê° ìì ëììµëë¤")):(await E.createBulletin(s),i.success("ì£¼ë³´ê° ìì±ëììµëë¤")),m()}catch{i.error(v?"ìì ì ì¤í¨íìµëë¤":"ìì±ì ì¤í¨íìµëë¤")}finally{S(!1)}}function j(t,s,r){const n=[...a.sunday_services];n[t]={...n[t],[s]:r},d({...a,sunday_services:n})}function F(t,s,r){const n=[...a.dawnPrayer.schedule];n[t]={...n[t],[s]:r},d({...a,dawnPrayer:{...a.dawnPrayer,schedule:n}})}function Y(t,s){const r=[...a.prayerMembers];r[t]={...r[t],member:s},d({...a,prayerMembers:r})}function W(){const t={order:a.orderOfService.length+1,title:"",detail:""};d({...a,orderOfService:[...a.orderOfService,t]})}function $(t,s,r){const n=[...a.orderOfService];n[t]={...n[t],[s]:r},d({...a,orderOfService:n})}function z(t){const s=a.orderOfService.filter((r,n)=>n!==t);s.forEach((r,n)=>{r.order=n+1}),d({...a,orderOfService:s})}function G(){const t={category:"ì¼ë°",title:"",content:""};d({...a,announcements:[...a.announcements,t]})}function q(t,s,r){const n=[...a.announcements];n[t]={...n[t],[s]:r},d({...a,announcements:n})}function K(t){d({...a,announcements:a.announcements.filter((s,r)=>r!==t)})}function Q(){const t={role:"",members:""};d({...a,servingMembers:[...a.servingMembers,t]})}function c(t,s,r){const n=[...a.servingMembers];n[t]={...n[t],[s]:r},d({...a,servingMembers:n})}function x(t){d({...a,servingMembers:a.servingMembers.filter((s,r)=>r!==t)})}function h(){const t={day:"",time:"",title:"",location:""};d({...a,weeklySchedule:[...a.weeklySchedule,t]})}function C(t,s,r){const n=[...a.weeklySchedule];n[t]={...n[t],[s]:r},d({...a,weeklySchedule:n})}function g(t){d({...a,weeklySchedule:a.weeklySchedule.filter((s,r)=>r!==t)})}function X(t){const s=[...a.sunday_services],r=s[t].orderOfService||[],n={order:r.length+1,title:"",detail:""};s[t]={...s[t],orderOfService:[...r,n]},d({...a,sunday_services:s})}function L(t,s,r,n){const o=[...a.sunday_services],u=[...o[t].orderOfService||[]];u[s]={...u[s],[r]:n},o[t]={...o[t],orderOfService:u},d({...a,sunday_services:o})}function Z(t,s){const r=[...a.sunday_services],n=(r[t].orderOfService||[]).filter((o,u)=>u!==s);n.forEach((o,u)=>{o.order=u+1}),r[t]={...r[t],orderOfService:n},d({...a,sunday_services:r})}function y(t,s){const r=te[s],n=[...a.sunday_services];n[t]={...n[t],orderOfService:JSON.parse(JSON.stringify(r))},d({...a,sunday_services:n}),i.success(`${s} í
íë¦¿ì´ ì ì©ëììµëë¤`)}function N(t,s){const r=a.sunday_services[t].orderOfService||[];if(r.length===0){i.error("ë³µì¬í ìë°°ììê° ììµëë¤");return}const n=[...a.sunday_services];n[s]={...n[s],orderOfService:JSON.parse(JSON.stringify(r))},d({...a,sunday_services:n}),i.success(`${t+1}ë¶ ìë°°ììê° ${s+1}ë¶ë¡ ë³µì¬ëììµëë¤`)}function w(){const t=a.sundayAfternoon.orderOfService||[],s={order:t.length+1,title:"",detail:""};d({...a,sundayAfternoon:{...a.sundayAfternoon,orderOfService:[...t,s]}})}function I(t,s,r){const n=[...a.sundayAfternoon.orderOfService||[]];n[t]={...n[t],[s]:r},d({...a,sundayAfternoon:{...a.sundayAfternoon,orderOfService:n}})}function re(t){const s=(a.sundayAfternoon.orderOfService||[]).filter((r,n)=>n!==t);
6s.forEach((r,n)=>{r.order=n+1}),d({...a,sundayAfternoon:{...a.sundayAfternoon,orderOfService:s}})}function ne(t){const s=te[t];d({...a,sundayAfternoon:{...a.sundayAfternoon,orderOfService:JSON.parse(JSON.stringify(s))}}),i.success(`${t} í
íë¦¿ì´ ì ì©ëììµëë¤`)}function le(){const t=a.wednesdayService.orderOfService||[],s={order:t.length+1,title:"",detail:""};d({...a,wednesdayService:{...a.wednesdayService,orderOfService:[...t,s]}})}function ee(t,s,r){const n=[...a.wednesdayService.orderOfService||[]];n[t]={...n[t],[s]:r},d({...a,wednesdayService:{...a.wednesdayService,orderOfService:n}})}function ce(t){const s=(a.wednesdayService.orderOfService||[]).filter((r,n)=>n!==t);s.forEach((r,n)=>{r.order=n+1}),d({...a,wednesdayService:{...a.wednesdayService,orderOfService:s}})}function de(t){const s=te[t];d({...a,wednesdayService:{...a.wednesdayService,orderOfService:JSON.parse(JSON.stringify(s))}}),i.success(`${t} í
íë¦¿ì´ ì ì©ëììµëë¤`)}function oe(t,s){if(s===0)return;const r=[...a.sunday_services],n=[...r[t].orderOfService||[]];[n[s-1],n[s]]=[n[s],n[s-1]],n.forEach((o,u)=>{o.order=u+1}),r[t]={...r[t],orderOfService:n},d({...a,sunday_services:r})}function ie(t,s){const r=a.sunday_services[t].orderOfService||[];if(s===r.length-1)return;const n=[...a.sunday_services],o=[...r];[o[s],o[s+1]]=[o[s+1],o[s]],o.forEach((u,H)=>{u.order=H+1}),n[t]={...n[t],orderOfService:o},d({...a,sunday_services:n})}function me(t){if(t===0)return;const s=[...a.sundayAfternoon.orderOfService||[]];[s[t-1],s[t]]=[s[t],s[t-1]],s.forEach((r,n)=>{r.order=n+1}),d({...a,sundayAfternoon:{...a.sundayAfternoon,orderOfService:s}})}function xe(t){const s=a.sundayAfternoon.orderOfService||[];if(t===s.length-1)return;const r=[...s];[r[t],r[t+1]]=[r[t+1],r[t]],r.forEach((n,o)=>{n.order=o+1}),d({...a,sundayAfternoon:{...a.sundayAfternoon,orderOfService:r}})}function ue(t){if(t===0)return;const s=[...a.wednesdayService.orderOfService||[]];[s[t-1],s[t]]=[s[t],s[t-1]],s.forEach((r,n)=>{r.order=n+1}),d({...a,wednesdayService:{...a.wednesdayService,orderOfService:s}})}function pe(t){const s=a.wednesdayService.orderOfService||[];if(t===s.length-1)return;const r=[...s];[r[t],r[t+1]]=[r[t+1],r[t]],r.forEach((n,o)=>{n.order=o+1}),d({...a,wednesdayService:{...a.wednesdayService,orderOfService:r}})}function he(t){if(t===0)return;const s=[...a.orderOfService];[s[t-1],s[t]]=[s[t],s[t-1]],s.forEach((r,n)=>{r.order=n+1}),d({...a,orderOfService:s})}function ge(t){if(t===a.orderOfService.length-1)return;const s=[...a.orderOfService];[s[t],s[t+1]]=[s[t+1],s[t]],s.forEach((r,n)=>{r.order=n+1}),d({...a,orderOfService:s})}async function ye(t){const s=t.target.files;if(!s||s.length===0)return;const r=(l==null?void 0:l.id)||`temp_${Date.now()}`;P(!0);try{const n=Array.from(s).map(async u=>{const H=je(u);if(!H.valid)return i.error(H.error||"íì¼ì´ ì í¨íì§ ììµëë¤"),null;const R=await be(r,u);return{id:R.path,url:R.url,path:R.path,name:R.name,size:R.size,contentType:R.contentType,createdAt:R.createdAt}}),o=(await Promise.all(n)).filter(u=>u!==null);d({...a,images:[...a.images,...o]}),i.success(`${o.length}ê° ì´ë¯¸ì§ê° ì
ë¡ëëììµëë¤`)}catch(n){console.error("ì´ë¯¸ì§ ì
ë¡ë ì¤í¨:",n),i.error("ì´ë¯¸ì§ ì
ë¡ëì ì¤í¨íìµëë¤")}finally{P(!1),t.target.value=""}}async function ve(t,s){if(confirm("ì´ ì´ë¯¸ì§ë¥¼ ìì íìê² ìµëê¹?"))try{await Ne(t.path);const r=a.images.filter((n,o)=>o!==s);d({...a,images:r}),i.success("ì´ë¯¸ì§ê° ìì ëììµëë¤")}catch(r){console.error("ì´ë¯¸ì§ ìì ì¤í¨:",r),i.error("ì´ë¯¸ì§ ìì ì ì¤í¨íìµëë¤")}}return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4 overflow-y-auto",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-6xl w-full my-8",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 sticky top-0 bg-white z-10 rounded-t-lg",children:e.jsx("h2",{className:"text-[16px] font-bold text-gray-900",children:v?"주보 ìì ":"주보 ìì±"})}),e.jsxs("form",{onSubmit:B,className:"p-6 space-y-6 max-h-[calc(100vh-200px)] overflow-y-auto",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[13px] font-medium text-gray-700 mb-1.5",children:["ë ì§ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"date",value:a.date,onChange:t=>d({...a,date:t.target.value}),className:"compact-input",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[13px] font-medium text-gray-700 mb-1.5",children:["주차 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:a.week,onChange:t=>d({...a,week:t.target.value}),className:"compact-input",placeholder:"ì: ì 73-42주",required:!0})]})]}),e.jsxs("div",{className:"space-y-4 p-4 bg-blue-50 rounded",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ì£¼ì¼ ìë°° (1ë¶~4ë¶)"}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:a.sunday_services.map((t,s)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:"text-[13px] font-bold text-gray-900",children:[s+1,"ë¶"]}),e.jsx("input",{type:"text",value:t.time,onChange:r=>j(s,"time",r.target.value),className:"compact-input flex-1",placeholder:"ìê° (ì: 9:30)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] text-gray-600 mb-0.5",children:"ì¤êµ ì 목"}),e.jsx("input",{type:"text",value:t.sermon_title,onChange:r=>j(s,"sermon_title",r.target.value),className:"compact-input",placeholder:"ì¤êµ ì 목"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] text-gray-600 mb-0.5",children:"본문"}),e.jsx("input",{type:"text",value:t.sermon_text,onChange:r=>j(s,"sermon_text",r.target.value),className:"compact-input",placeholder:"ì: íë¸ë¦¬ì 11:1-6"})]})]}),e.jsxs("div",{className:"border-t border-gray-200 pt-2 mt-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-700",children:"ìë°°ìì"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs("select",{onChange:r=>{r.target.value&&(y(s,r.target.value),r.target.value="")},className:"text-[10px] px-2 py-0.5 border border-gray-300 rounded",children:[e.jsx("option",{value:"",children:"í
í릿"}),e.jsx("option",{value:"ì¼ë°ì£¼ì¼ìë°°",children:"ì¼ë°ì£¼ì¼"}),e.jsx("option",{value:"ì´ë¦°ìë°°",children:"ì´ë¦°ìë°°"}),e.jsx("option",{value:"ì²ë
ìë°°",children:"ì²ë
ìë°°"}),e.jsx("option",{value:"ì¤íìë°°",children:"ì¤íìë°°"}),e.jsx("option",{value:"ìììë°°",children:"ìììë°°"})]}),s>0&&e.jsxs("select",{onChange:r=>
6{r.target.value&&(N(parseInt(r.target.value),s),r.target.value="")},className:"text-[10px] px-2 py-0.5 border border-gray-300 rounded",children:[e.jsx("option",{value:"",children:"ë³µì¬"}),[...Array(s)].map((r,n)=>e.jsxs("option",{value:n,children:[n+1,"ë¶"]},n))]}),e.jsx("button",{type:"button",onClick:()=>X(s),className:"text-[10px] px-2 py-0.5 bg-blue-600 text-white rounded hover:bg-blue-700",children:e.jsx(k,{className:"w-3 h-3"})})]})]}),e.jsxs("div",{className:"space-y-1",children:[(t.orderOfService||[]).map((r,n)=>e.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[e.jsx("input",{type:"number",value:r.order,onChange:o=>L(s,n,"order",parseInt(o.target.value)||0),className:"compact-input w-14"}),e.jsx("input",{type:"text",value:r.title,onChange:o=>L(s,n,"title",o.target.value),className:"compact-input flex-1",placeholder:"í목"}),e.jsx("input",{type:"text",value:r.detail||"",onChange:o=>L(s,n,"detail",o.target.value),className:"compact-input flex-1",placeholder:"ìì¸"}),e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx("button",{type:"button",onClick:()=>oe(s,n),disabled:n===0,className:"p-0.5 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìë¡",children:e.jsx(J,{className:"w-3 h-3"})}),e.jsx("button",{type:"button",onClick:()=>ie(s,n),disabled:n===(t.orderOfService||[]).length-1,className:"p-0.5 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìëë¡",children:e.jsx(V,{className:"w-3 h-3"})}),e.jsx("button",{type:"button",onClick:()=>Z(s,n),className:"p-0.5 text-red-600 hover:bg-red-100 rounded",title:"ìì ",children:e.jsx(_,{className:"w-3 h-3"})})]})]},n)),(t.orderOfService||[]).length===0&&e.jsx("p",{className:"text-[10px] text-gray-500 text-center py-1",children:"í
í릿 ì í ëë ì¶ê° ë²í¼ì¼ë¡ ìë°°ìì ì
ë ¥"})]})]})]},s))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-green-50 rounded space-y-3",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ì£¼ì¼ ì¤íìë°°"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ìê°"}),e.jsx("input",{type:"text",value:a.sundayAfternoon.time,onChange:t=>d({...a,sundayAfternoon:{...a.sundayAfternoon,time:t.target.value}}),className:"compact-input",placeholder:"ì¤í 2ì"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ì¸ë"}),e.jsx("input",{type:"text",value:a.sundayAfternoon.leader,onChange:t=>d({...a,sundayAfternoon:{...a.sundayAfternoon,leader:t.target.value}}),className:"compact-input",placeholder:"í길ë 목ì¬"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ì¤êµ ì 목"}),e.jsx("input",{type:"text",value:a.sundayAfternoon.sermon_title||"",onChange:t=>d({...a,sundayAfternoon:{...a.sundayAfternoon,sermon_title:t.target.value}}),className:"compact-input",placeholder:"ì¤êµ ì 목"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"본문"}),e.jsx("input",{type:"text",value:a.sundayAfternoon.sermon_text||"",onChange:t=>d({...a,sundayAfternoon:{...a.sundayAfternoon,sermon_text:t.target.value}}),className:"compact-input",placeholder:"ì: ìí¸ 23:1-6"})]})]}),e.jsxs("div",{className:"border-t border-gray-200 pt-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-700",children:"ìë°°ìì"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs("select",{onChange:t=>{t.target.value&&(ne(t.target.value),t.target.value="")},className:"text-[10px] px-2 py-0.5 border border-gray-300 rounded",children:[e.jsx("option",{value:"",children:"í
í릿"}),e.jsx("option",{value:"ì¼ë°ì£¼ì¼ìë°°",children:"ì¼ë°ì£¼ì¼"}),e.jsx("option",{value:"ì´ë¦°ìë°°",children:"ì´ë¦°ìë°°"}),e.jsx("option",{value:"ì²ë
ìë°°",children:"ì²ë
ìë°°"}),e.jsx("option",{value:"ì¤íìë°°",children:"ì¤íìë°°"}),e.jsx("option",{value:"ìììë°°",children:"ìììë°°"})]}),e.jsx("button",{type:"button",onClick:w,className:"text-[10px] px-2 py-0.5 bg-green-600 text-white rounded hover:bg-green-700",children:e.jsx(k,{className:"w-3 h-3"})})]})]}),e.jsxs("div",{className:"space-y-1",children:[(a.sundayAfternoon.orderOfService||[]).map((t,s)=>e.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[e.jsx("input",{type:"number",value:t.order,onChange:r=>I(s,"order",parseInt(r.target.value)||0),className:"compact-input w-10"}),e.jsx("input",{type:"text",value:t.title,onChange:r=>I(s,"title",r.target.value),className:"compact-input flex-1",placeholder:"í목"}),e.jsx("input",{type:"text",value:t.detail||"",onChange:r=>I(s,"detail",r.target.value),className:"compact-input flex-1",placeholder:"ìì¸"}),e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx("button",{type:"button",onClick:()=>me(s),disabled:s===0,className:"p-0.5 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìë¡",children:e.jsx(J,{className:"w-3 h-3"})}),e.jsx("button",{type:"button",onClick:()=>xe(s),disabled:s===(a.sundayAfternoon.orderOfService||[]).length-1,className:"p-0.5 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìëë¡",children:e.jsx(V,{className:"w-3 h-3"})}),e.jsx("button",{type:"button",onClick:()=>re(s),className:"p-0.5 text-red-600 hover:bg-red-100 rounded",title:"ìì ",children:e.jsx(_,{className:"w-3 h-3"})})]})]},s)),(a.sundayAfternoon.orderOfService||[]).length===0&&e.jsx("p",{className:"text-[10px] text-gray-500 text-center py-1",children:"í
í릿 ì í ëë ì¶ê° ë²í¼ì¼ë¡ ìë°°ìì ì
ë ¥"})]})]})]}),e.jsxs("div",{className:"p-4 bg-blue-50 rounded space-y-3",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ìììë°°"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ìê°"}),e.jsx("input",{type:"text",value:a.wednesdayService.time,onChange:t=>d({...a,wednesdayService:{...a.wednesdayService,time:t.target.value}}),className:"compact-input",placeholder:"ì¤í 7:30"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ì¸ë"}),e.jsx("input",{type:"text",value:a.wednesdayService.leader,onCh
6ange:t=>d({...a,wednesdayService:{...a.wednesdayService,leader:t.target.value}}),className:"compact-input",placeholder:"í길ë 목ì¬"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ì¤êµ ì 목"}),e.jsx("input",{type:"text",value:a.wednesdayService.content,onChange:t=>d({...a,wednesdayService:{...a.wednesdayService,content:t.target.value}}),className:"compact-input",placeholder:"ì¤êµ ì 목"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"본문"}),e.jsx("input",{type:"text",value:a.wednesdayService.scripture,onChange:t=>d({...a,wednesdayService:{...a.wednesdayService,scripture:t.target.value}}),className:"compact-input",placeholder:"ì: ë§íë³µì 5:1-12"})]})]}),e.jsxs("div",{className:"border-t border-gray-200 pt-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-700",children:"ìë°°ìì"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs("select",{onChange:t=>{t.target.value&&(de(t.target.value),t.target.value="")},className:"text-[10px] px-2 py-0.5 border border-gray-300 rounded",children:[e.jsx("option",{value:"",children:"í
í릿"}),e.jsx("option",{value:"ì¼ë°ì£¼ì¼ìë°°",children:"ì¼ë°ì£¼ì¼"}),e.jsx("option",{value:"ì´ë¦°ìë°°",children:"ì´ë¦°ìë°°"}),e.jsx("option",{value:"ì²ë
ìë°°",children:"ì²ë
ìë°°"}),e.jsx("option",{value:"ì¤íìë°°",children:"ì¤íìë°°"}),e.jsx("option",{value:"ìììë°°",children:"ìììë°°"})]}),e.jsx("button",{type:"button",onClick:le,className:"text-[10px] px-2 py-0.5 bg-blue-600 text-white rounded hover:bg-blue-700",children:e.jsx(k,{className:"w-3 h-3"})})]})]}),e.jsxs("div",{className:"space-y-1",children:[(a.wednesdayService.orderOfService||[]).map((t,s)=>e.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[e.jsx("input",{type:"number",value:t.order,onChange:r=>ee(s,"order",parseInt(r.target.value)||0),className:"compact-input w-10"}),e.jsx("input",{type:"text",value:t.title,onChange:r=>ee(s,"title",r.target.value),className:"compact-input flex-1",placeholder:"í목"}),e.jsx("input",{type:"text",value:t.detail||"",onChange:r=>ee(s,"detail",r.target.value),className:"compact-input flex-1",placeholder:"ìì¸"}),e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx("button",{type:"button",onClick:()=>ue(s),disabled:s===0,className:"p-0.5 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìë¡",children:e.jsx(J,{className:"w-3 h-3"})}),e.jsx("button",{type:"button",onClick:()=>pe(s),disabled:s===(a.wednesdayService.orderOfService||[]).length-1,className:"p-0.5 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìëë¡",children:e.jsx(V,{className:"w-3 h-3"})}),e.jsx("button",{type:"button",onClick:()=>ce(s),className:"p-0.5 text-red-600 hover:bg-red-100 rounded",title:"ìì ",children:e.jsx(_,{className:"w-3 h-3"})})]})]},s)),(a.wednesdayService.orderOfService||[]).length===0&&e.jsx("p",{className:"text-[10px] text-gray-500 text-center py-1",children:"í
í릿 ì í ëë ì¶ê° ë²í¼ì¼ë¡ ìë°°ìì ì
ë ¥"})]})]})]})]}),e.jsxs("div",{className:"p-4 bg-orange-50 rounded space-y-3",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ì벽기ëí"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ì¸ë"}),e.jsx("input",{type:"text",value:a.dawnPrayer.leader,onChange:t=>d({...a,dawnPrayer:{...a.dawnPrayer,leader:t.target.value}}),className:"compact-input",placeholder:"í길ë 목ì¬"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ì±ê²½ì§ë ë° ê¸°ë주ì "}),e.jsx("div",{className:"grid grid-cols-6 gap-2",children:a.dawnPrayer.schedule.map((t,s)=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-[10px] text-gray-600 mb-0.5",children:t.day}),e.jsx("input",{type:"text",value:t.passage,onChange:r=>F(s,"passage",r.target.value),className:"compact-input text-[11px]",placeholder:"1ì¥"}),e.jsx("select",{value:t.prayerTopic,onChange:r=>F(s,"prayerTopic",r.target.value),className:"compact-input text-[10px] w-full",children:Pe.map(r=>e.jsx("option",{value:r,children:r},r))})]},t.day))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] text-gray-700 mb-1",children:"ë¹ê³ (ì í)"}),e.jsx("input",{type:"text",value:a.dawnPrayer.note||"",onChange:t=>d({...a,dawnPrayer:{...a.dawnPrayer,note:t.target.value}}),className:"compact-input",placeholder:"ì: í¨ê»íë 기ëí: ê¸í¥ë¡ê¸°ëíë¡ ëì í©ëë¤"})]})]}),e.jsxs("div",{className:"p-4 bg-blue-50 rounded space-y-3",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ë¤ìì£¼ì¼ ê¸°ëì
6ì"}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:a.prayerMembers.map((t,s)=>e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] text-gray-600 mb-0.5",children:t.service}),e.jsx("input",{type:"text",value:t.member,onChange:r=>Y(s,r.target.value),className:"compact-input text-[12px]",placeholder:"ì´ë¦"})]},t.service))})]}),e.jsxs("div",{className:"p-4 bg-blue-50 rounded space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ìë°°ìì"}),e.jsxs("button",{type:"button",onClick:W,className:"px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[11px] flex items-center gap-1",children:[e.jsx(k,{className:"w-3 h-3"}),"ì¶ê°"]})]}),e.jsxs("div",{className:"space-y-2",children:[a.orderOfService.map((t,s)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",value:t.order,onChange:r=>$(s,"order",parseInt(r.target.value)||0),className:"compact-input w-16 text-[12px]",placeholder:"ìì"}),e.jsx("input",{type:"text",value:t.title,onChange:r=>$(s,"title",r.target.value),className:"compact-input flex-1 text-[12px]",placeholder:"í목ëª
(ì: ìë°°ë¡ì ë¶ë¦)"}),e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx("button",{type:"button",onClick:()=>he(s),disabled:s===0,className:"p-1 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìë¡",children:e.jsx(J,{className:"w-4 h-4"})}),e.jsx("button",{type:"button",onClick:()=>ge(s),disabled:s===a.orderOfService.length-1,className:"p-1 text-gray-600 hover:bg-gray-100 rounded disabled:opacity-30 disabled:cursor-not-allowed",title:"ìëë¡",children:e.jsx(V,{className:"w-4 h-4"})}),e.jsx("button",{type:"button",onClick:()=>z(s),className:"p-1 text-red-600 hover:bg-red-100 rounded transition-colors",title:"ìì ",children:e.jsx(_,{className:"w-4 h-4"})})]})]}),e.jsx("input",{type:"text",value:t.detail||"",onChange:r=>$(s,"detail",r.target.value),className:"compact-input text-[11px]",placeholder:"ìì¸ ë´ì© (ì í)"})]},s)),a.orderOfService.length===0&&e.jsx("p",{className:"text-[11px] text-gray-500 text-center py-2",children:"ì¶ê° ë²í¼ì ëë¬ ìë°°ìì를 ì
ë ¥íì¸ì"})]})]}),e.jsxs("div",{className:"p-4 bg-yellow-50 rounded space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ê´ê³ "}),e.jsxs("button",{type:"button",onClick:G,className:"px-3 py-1 bg-yellow-600 text-white rounded hover:bg-yellow-700 transition-colors text-[11px] flex items-center gap-1",children:[e.jsx(k,{className:"w-3 h-3"}),"ì¶ê°"]})]}),e.jsxs("div",{className:"space-y-3",children:[a.announcements.map((t,s)=>e.jsx("div",{className:"p-3 bg-white rounded border border-gray-200",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("textarea",{value:t.content,onChange:r=>q(s,"content",r.target.value),className:"compact-input text-[12px] resize-none flex-1",rows:5,placeholder:"ê´ê³ ë´ì©ì ì
ë ¥íì¸ì"}),e.jsx("button",{type:"button",onClick:()=>K(s),className:"p-1.5 text-red-600 hover:bg-red-100 rounded transition-colors self-start",children:e.jsx(_,{className:"w-4 h-4"})})]})},s)),a.announcements.length===0&&e.jsx("p",{className:"text-[11px] text-gray-500 text-center py-2",children:"ì¶ê° ë²í¼ì ëë¬ ê´ê³ 를 ì
ë ¥íì¸ì"})]})]}),e.jsxs("div",{className:"p-4 bg-blue-50 rounded space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ë´ì¬ì"}),e.jsxs("button",{type:"button",onClick:Q,className:"px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[11px] flex items-center gap-1",children:[e.jsx(k,{className:"w-3 h-3"}),"ì¶ê°"]})]}),e.jsxs("div",{className:"space-y-2",children:[a.servingMembers.map((t,s)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-gray-200 flex items-center gap-2",children:[e.jsx("input",{type:"text",value:t.role,onChange:r=>c(s,"role",r.target.value),className:"compact-input w-32 text-[12px]",placeholder:"ìí (ì: ìë´)"}),e.jsx("input",{type:"text",value:t.members,onChange:r=>c(s,"members",r.target.value),className:"compact-input flex-1 text-[12px]",placeholder:"ë´ì¬ì ëª
ë¨ (ì: í길ë, ê¹ì² ì)"}),e.jsx("button",{type:"button",onClick:()=>x(s),className:"p-1 text-red-600 hover:bg-red-100 rounded transition-colors",children:e.jsx(_,{className:"w-4 h-4"})})]},s)),a.servingMembers.length===0&&e.jsx("p",{className:"text-[11px] text-gray-500 text-center py-2",children:"ì¶ê° ë²í¼ì ëë¬ ë´ì¬ì를 ì
ë ¥íì¸ì"})]})]}),e.jsxs("div",{className:"p-4 bg-rose-50 rounded space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"주ê°ì¼ì "}),e.jsxs("button",{type:"button",onClick:h,className:"px-3 py-1 bg-rose-600 text-white rounded hover:bg-rose-700 transition-colors text-[11px] flex items-center gap-1",children:[e.jsx(k,{className:"w-3 h-3"}),"ì¶ê°"]})]}),e.jsxs("div",{className:"space-y-2",children:[a.weeklySchedule.map((t,s)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:t.day,onChange:r=>C(s,"day",r.target.value),className:"compact-input w-16 text-[12px]",placeholder:"ìì¼"}),e.jsx("input",{type:"text",value:t.time,onChange:r=>C(s,"time",r.target.value),className:"compact-input w-24 text-[12px]",placeholder:"ìê°"}),e.jsx("input",{type:"text",value:t.title,onChange:r=>C(s,"title",r.target.value),className:"compact-input flex-1 text-[12px]",placeholder:"ì¼ì ì 목"}),e.jsx("button",{type:"button",onClick:()=>g(s),className:"p-1 text-red-600 hover:bg-red-100 rounded transition-colors",children:e.jsx(_,{className:"w-4 h-4"})})]}),e.jsx("input",{type:"text",value:t.location||"",onChange:r=>C(s,"location",r.target.value),className:"compact-input text-[11px]",placeholder:"ì¥ì (ì í)"})]},s)),a.weeklySchedule.length===0&&e.jsx("p",{className:"text-[11px] text-gray-500 text-center py-2",children:"ì¶ê° ë²í¼ì ëë¬ ì£¼ê°ì¼ì ì ì
ë ¥íì¸ì"})]})]}),e.jsxs("div",{className:"p-4 bg-cyan-50 rounded space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ì²¨ë¶ ì´ë¯¸ì§"}),e.jsxs("label",{className:"px-3 py-1 bg-cyan-600 text-white rounded hover:bg-cyan-700 transition-colors text-[11px] flex items-center gap-1 cursor-pointer",children:[e.jsx(k,{className:"w-3 h-3"}
6),p?"ì
ë¡ë ì¤...":"ì´ë¯¸ì§ ì¶ê°",e.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:ye,className:"hidden",disabled:p})]})]}),e.jsx("div",{className:"text-[11px] text-gray-600 mb-2",children:"* JPG, PNG, GIF, WEBP íì ì§ì (ìµë 5MB)"}),a.images.length>0?e.jsx("div",{className:"grid grid-cols-3 gap-3",children:a.images.map((t,s)=>e.jsxs("div",{className:"relative group bg-white rounded border border-gray-200 p-2",children:[e.jsx("img",{src:t.url,alt:t.name,className:"w-full h-32 object-cover rounded"}),e.jsx("div",{className:"mt-1 text-[10px] text-gray-600 truncate",children:t.name}),e.jsx("button",{type:"button",onClick:()=>ve(t,s),className:"absolute top-1 right-1 p-1 bg-red-600 text-white rounded opacity-0 group-hover:opacity-100 transition-opacity",title:"ìì ",children:e.jsx(_,{className:"w-3 h-3"})})]},s))}):e.jsx("p",{className:"text-[11px] text-gray-500 text-center py-4 border-2 border-dashed border-gray-300 rounded",children:"ì´ë¯¸ì§ë¥¼ ì¶ê°íë ¤ë©´ ìì ë²í¼ì í´ë¦íì¸ì"})]}),e.jsxs("div",{className:"flex gap-3 pt-4 border-t border-gray-200 sticky bottom-0 bg-white",children:[e.jsx("button",{type:"button",onClick:M,className:"flex-1 px-4 py-2.5 border border-gray-300 rounded hover:bg-gray-50 transition-colors text-[13px] font-medium",children:"ì·¨ì"}),e.jsx("button",{type:"submit",disabled:f,className:"flex-1 px-4 py-2.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium disabled:opacity-50",children:f?"ì²ë¦¬ ì¤...":v?"ìì ":"ìì±"})]})]})]})})}export{Je as SmartBulletinPage};
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.