PageSourceSearch

https://seodoon-church-admin.web.app/assets/SmartBulletinPage-DJNDhfoE.js

js seodoon-church-admin.web.app collected 2026-10-03 12:35:54 UTC 49,960 bytes, 6 lines download raw bytes

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.