1import{j as e}from"./vendor-data-Z5doMMu-.js";import{r as p,b as L,f as Y}from"./vendor-react-zNM0AU50.js";import{b as _}from"./bulletinService-CRS1aT1n.js";import z from"./html2canvas.esm-CBrSDip1.js";import{E as K}from"./jspdf.es.min-BLt6GQQp.js";import{bq as F,X as E,k as R,D as I,T as O,a7 as y,c as U,aD as B,F as q}from"./vendor-ui-CW5bJ11U.js";import{d as M}from"./imageService-5xt-7IGi.js";import"./vendor-firebase-Da9KY1q_.js";import"./index-D1K3lVhu.js";import"./vendor-charts-08G1rM8P.js";const H="AIzaSyC6Y14YR4xsW1ApyDtLn-miKKAjISU5cMA",V="UCcm2Yg6YOH9k0bib1RpayYQ";async function G(t,n){try{const s=await fetch(`https://www.googleapis.com/youtube/v3/search?key=${H}&channelId=${V}&part=snippet,id&order=date&maxResults=50&type=video`);if(!s.ok)throw new Error("YouTube API ìì² ì¤í¨");const l=await s.json();if(!l.items||l.items.length===0)return null;const i=new Date(t),d=i.getFullYear(),r=i.getMonth()+1,c=i.getDate(),u=[`${d}ë
${r}ì ${c}ì¼`,`${d}.${r}.${c}`,`${d}-${r}-${c}`,`${r}ì ${c}ì¼`,`${r}/${c}`,`${d}ë
${r}ì ${c.toString().padStart(2,"0")}ì¼`],a=(o=>o.includes("1ë¶")?["ì£¼ì¼ 1ë¶","1ë¶","주ì¼1ë¶","1ë¶ìë°°","#1ë¶ìë°°","#주ì¼1ë¶"]:o.includes("2ë¶")?["ì£¼ì¼ 2ë¶","2ë¶","주ì¼2ë¶","2ë¶ìë°°","#2ë¶ìë°°","#주ì¼2ë¶"]:o.includes("3ë¶")?["ì£¼ì¼ 3ë¶","3ë¶","주ì¼3ë¶","3ë¶ìë°°","#3ë¶ìë°°","#주ì¼3ë¶"]:o.includes("4ë¶")||o.includes("ì¤í")?["ì¤íìë°°","ì¤í ìë°°","4ë¶","ì£¼ì¼ 4ë¶"]:o.includes("ìì")?["ìììë°°","ìì ìë°°","ìì"]:o.includes("ê¸í¥ë¡")?["ê¸í¥ë¡ê¸°ëí","ê¸í¥ë¡ 기ëí","ê¸í¥"]:["ìë°°","ì¤êµ"])(n);let x=null,j=0;for(const o of l.items){const f=o.snippet.title.toLowerCase(),v=o.snippet.description.toLowerCase();let h=0,w=!1;for(const m of u)if(f.includes(m.toLowerCase())||v.includes(m.toLowerCase())){h+=20,w=!0;break}let S=!1;for(const m of a)if(f.includes(m.toLowerCase())||v.includes(m.toLowerCase())){h+=15,S=!0;break}w&&S?h+=30:w||(h=0);const P=["ì¤êµ","ë§ì","ìë°°"];for(const m of P)(f.includes(m)||v.includes(m))&&(h+=3);const D=["ê³µì§","ìë´","모ì","íì¬","ìº í","ìë ¨í"];for(const m of D)(f.includes(m)||v.includes(m))&&(h-=10);h>j&&h>20&&(j=h,x={videoId:o.id.videoId,title:o.snippet.title,description:o.snippet.description,publishedAt:o.snippet.publishedAt,thumbnailUrl:o.snippet.thumbnails.medium.url})}return x}catch(s){return console.error("YouTube ìì ê²ì ì¤í¨:",s),null}}function W(t){return`https://www.youtube.com/embed/${t}`}async function J(t,n={}){const{filename:s="document.pdf",scale:l=2,quality:i=.95,orientation:d="portrait"}=n;try{const r=await z(t,{scale:l,useCORS:!0,logging:!1,backgroundColor:"#ffffff"}),c=r.toDataURL("image/jpeg",i),u=d==="portrait"?210:297,b=d==="portrait"?297:210,a=u,x=r.height*a/r.width,j=new K({orientation:d,unit:"mm",format:"a4"});let o=x,f=0;for(j.addImage(c,"JPEG",0,f,a,x),o-=b;o>0;)f=o-x,j.addPage(),j.addImage(c,"JPEG",0,f,a,x),o-=b;j.save(s)}catch(r){throw console.error("PDF ìì± ì¤í¨:",r),new Error("PDF ìì±ì ì¤í¨íìµëë¤.")}}async function Q(t,n){const s=document.querySelector("#bulletin-container");if(!s)throw new Error("주보 ìì를 ì°¾ì ì ììµëë¤.");const l=`주보_${n.replace(/-/g,"")}.pdf`;await J(s,{filename:l,scale:2,quality:.95,orientation:"portrait"})}const X=[{id:"sun1",label:"ì£¼ì¼ 1ë¶"},{id:"sun2",label:"ì£¼ì¼ 2ë¶"},{id:"sun3",label:"ì£¼ì¼ 3ë¶"},{id:"sun4",label:"ì£¼ì¼ 4ë¶"},{id:"afternoon",label:"ì¤íìë°°"},{id:"wednesday",label:"ìììë°°"},{id:"dawn",label:"ì벽기ë"}];function Z({activeService:t,onServiceChange:n}){return e.jsx("div",{className:"flex flex-wrap gap-1 text-[11px]",children:X.map(s=>e.jsx("button",{onClick:()=>n(s.id),className:`px-3 py-1 rounded transition-colors ${t===s.id?"bg-indigo-600 text-white border border-indigo-700":"bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"}`,children:s.label},s.id))})}function ee({service:t,serviceType:n,onPlayVideo:s}){var l,i,d;if(!t)return e.jsx("section",{className:"bg-gradient-to-br from-indigo-50 to-white border border-indigo-100 rounded-xl p-3",children:e.jsx("div",{className:"text-[12px] text-gray-500 text-center py-4",children:"ì´ ìë°°ì ì ë³´ê° ììµëë¤"})});if(n==="sunday"&&"orderOfService"in t){const r=(l=t.orderOfService)==null?void 0:l.find(c=>c.title.includes("ë§ìì í¬"));return e.jsx("section",{className:"bg-gradient-to-br from-indigo-50 to-white border border-indigo-100 rounded-xl p-3 leading-[1.6]",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[11px] text-indigo-700 mb-0.5",children:"ì¤êµ"}),r?e.jsx("div",{className:"text-[12px] text-gray-900",children:r.detail||"ë§ìì í¬ ë´ì© ìì"}):e.jsx("div",{className:"text-[12px] text-gray-500",children:"ë§ìì í¬ ì ë³´ ìì"})]}),s&&e.jsxs("button",{onClick:s,className:"flex items-center gap-1 px-2 py-1 bg-red-600 text-white rounded hover:bg-red-700 transition-colors text-[11px]",title:"ì¤êµ ìì 보기",children:[e.jsx(F,{className:"w-3 h-3"}
1),"ìì"]})]})})}if(n==="afternoon"&&"orderOfService"in t){const r=(i=t.orderOfService)==null?void 0:i.find(c=>c.title.includes("ë§ìì í¬"));return e.jsx("section",{className:"bg-gradient-to-br from-green-50 to-white border border-green-100 rounded-xl p-3 leading-[1.6]",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[11px] text-green-700 mb-0.5",children:"ì¤êµ"}),r?e.jsx("div",{className:"text-[12px] text-gray-900",children:r.detail||"ë§ìì í¬ ë´ì© ìì"}):e.jsx("div",{className:"text-[12px] text-gray-500",children:"ë§ìì í¬ ì ë³´ ìì"})]}),s&&e.jsxs("button",{onClick:s,className:"flex items-center gap-1 px-2 py-1 bg-red-600 text-white rounded hover:bg-red-700 transition-colors text-[11px]",title:"ì¤êµ ìì 보기",children:[e.jsx(F,{className:"w-3 h-3"}),"ìì"]})]})})}if(n==="wednesday"&&"orderOfService"in t){const r=(d=t.orderOfService)==null?void 0:d.find(c=>c.title.includes("ë§ìì í¬"));return e.jsx("section",{className:"bg-gradient-to-br from-purple-50 to-white border border-purple-100 rounded-xl p-3 leading-[1.6]",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[11px] text-purple-700 mb-0.5",children:"ì¤êµ"}),r?e.jsx("div",{className:"text-[12px] text-gray-900",children:r.detail||"ë§ìì í¬ ë´ì© ìì"}):e.jsx("div",{className:"text-[12px] text-gray-500",children:"ë§ìì í¬ ì ë³´ ìì"})]}),s&&e.jsxs("button",{onClick:s,className:"flex items-center gap-1 px-2 py-1 bg-red-600 text-white rounded hover:bg-red-700 transition-colors text-[11px]",title:"ì¤êµ ìì 보기",children:[e.jsx(F,{className:"w-3 h-3"}),"ìì"]})]})})}return n==="dawn"&&"schedule"in t?e.jsxs("section",{className:"bg-gradient-to-br from-orange-50 to-white border border-orange-100 rounded-xl p-3 leading-[1.6]",children:[e.jsx("div",{className:"text-[11px] text-orange-700 mb-2 font-semibold",children:"ì벽기ëí"}),e.jsxs("div",{className:"space-y-2 text-[11px] text-gray-700",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"ì¸ë:"}),e.jsx("span",{className:"font-medium",children:t.leader||"-"})]}),t.schedule&&t.schedule.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-gray-500 mb-1",children:"ì±ê²½ì§ë ë° ê¸°ë주ì :"}),e.jsx("div",{className:"grid grid-cols-5 gap-1 text-[10px]",children:t.schedule.map((r,c)=>e.jsxs("div",{className:"bg-white border border-orange-200 rounded px-2 py-1",children:[e.jsx("div",{className:"font-medium text-orange-700 mb-0.5",children:r.day}),e.jsx("div",{className:"text-gray-900 font-medium mb-0.5",children:r.passage}),e.jsx("div",{className:"text-gray-600 text-[9px]",children:r.prayerTopic})]},c))})]}),t.note&&e.jsxs("div",{className:"text-[10px] text-gray-600 pt-1 border-t border-orange-100",children:["* ",t.note]})]})]}):null}function te({video:t,isLoading:n,onClose:s}){return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("div",{className:"text-[11px] text-gray-600",children:"ì¤êµ ìì"}),e.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx(E,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"aspect-video bg-gray-100 rounded-lg overflow-hidden",children:n?e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 text-[12px]",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600 mb-2"}),e.jsx("div",{children:"í´ë¹ ë ì§ì ì¤êµ ììì ì°¾ë ì¤..."})]})}):t?e.jsxs("div",{className:"h-full",children:[e.jsx("iframe",{src:W(t.videoId),title:t.title,className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),e.jsx("div",{className:"p-2 bg-white",children:e.jsx("div",{className:"text-[11px] font-medium text-gray-900 line-clamp-2",children:t.title})})]}):e.jsxs("div",{className:"flex items-center justify-center h-full text-gray-500 text-[12px] px-4 text-center",children:["í´ë¹ ë ì§ì ìë°°ì ì¤êµ ììì ì°¾ì ì ììµëë¤.",e.jsx("br",{}),"ë¤ë¥¸ ì배를 ì ííê±°ë ëì¤ì ë¤ì ìëí´ì£¼ì¸ì."]})})]})}function se({images:t,onDelete:n,editable:s=!1}){const[l,i]=p.useState(null),[d,r]=p.useState(null);async function c(a){if(confirm("ì´ë¯¸ì§ë¥¼ ìì íìê² ìµëê¹?")){r(a.id);try{await M(a.path),y.success("ì´ë¯¸ì§ê° ìì ëììµëë¤."),n==null||n(a.id)}catch(x){console.error("ì´ë¯¸ì§ ìì ì¤í¨:",x),y.error("ì´ë¯¸ì§ ìì ì ì¤í¨íìµëë¤.")}finally{r(null)}}}function u(a){const x=document.createElement("a");x.href=a.url,x.download=a.name,x.target="_blank",document.body.appendChild(x),x.click(),document.body.removeChild(x)}function b(a){return a<1024?a+" B":a<1024*1024?(a/1024).toFixed(1)+" KB":(a/(1024*1024)).toFixed(1)+" MB"}return t.length===0?e.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"ì
ë¡ëë ì´ë¯¸ì§ê° ììµëë¤"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:t.map(a=>e.jsxs("div",{className:"group relative aspect-square rounded-lg overflow-hidden bg-gray-100 border border-gray-200 hover:border-indigo-400 transition-colors",children:[e.jsx("img",{src:a.url,alt:a.name,className:"w-full h-full object-cover",loading:"lazy"}),e.jsxs("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-40 transition-opacity flex items-center justify-center gap-2 opacity-0 group-hover:opacity-100",children:[e.jsx("button",{onClick:()=>i(a),className:"p-2 bg-white rounded-lg hover:bg-gray-100 transition-colors",title:"í¬ê² 보기",children:e.jsx(R,{className:"w-4 h-4 text-gray-700"})}),e.jsx("button",{onClick:()=>u(a),className:"p-2 bg-white rounded-lg hover:bg-gray-100 transition-colors",title:"ë¤ì´ë¡ë",children:e.jsx(I,{className:"w-4 h-4 text-gray-700"})}),s&&e.jsx("button",{onClick:()=>c(a),disabled:d===a.id,className:"p-2 bg-white rounded-lg hover:bg-red-50 transition-colors disabled:opacity-50",title:"ìì ",children:e.jsx(O,{className:"w-4 h-4 text-red-600"})})]}),d===a.id&&e.jsx("div",{className:"absolute inset-0 bg-white bg-opacity-80 flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-3 border-red-600 border-t-transparent roun
1ded-full animate-spin"})}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black to-transparent opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("p",{className:"text-xs text-white font-medium truncate",children:a.name}),e.jsx("p",{className:"text-xs text-gray-300",children:b(a.size)})]})]},a.id))}),l&&e.jsxs("div",{className:"fixed inset-0 z-50 bg-black bg-opacity-90 flex items-center justify-center p-4",onClick:()=>i(null),children:[e.jsx("button",{onClick:()=>i(null),className:"absolute top-4 right-4 p-2 bg-white bg-opacity-20 hover:bg-opacity-30 rounded-lg transition-colors",children:e.jsx(E,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{className:"max-w-5xl max-h-[90vh] relative",children:[e.jsx("img",{src:l.url,alt:l.name,className:"max-w-full max-h-[90vh] object-contain",onClick:a=>a.stopPropagation()}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4 bg-black bg-opacity-60",children:[e.jsx("p",{className:"text-sm text-white font-medium",children:l.name}),e.jsxs("div",{className:"flex items-center gap-4 mt-1 text-xs text-gray-300",children:[e.jsx("span",{children:b(l.size)}),e.jsx("span",{children:l.contentType}),e.jsx("span",{children:new Date(l.createdAt).toLocaleDateString("ko-KR")})]})]}),e.jsxs("div",{className:"absolute bottom-20 right-4 flex gap-2",children:[e.jsxs("button",{onClick:a=>{a.stopPropagation(),u(l)},className:"px-4 py-2 bg-white bg-opacity-20 hover:bg-opacity-30 rounded-lg transition-colors flex items-center gap-2 text-white text-sm",children:[e.jsx(I,{className:"w-4 h-4"}),"ë¤ì´ë¡ë"]}),s&&e.jsxs("button",{onClick:a=>{a.stopPropagation(),c(l),i(null)},className:"px-4 py-2 bg-red-500 bg-opacity-80 hover:bg-opacity-100 rounded-lg transition-colors flex items-center gap-2 text-white text-sm",children:[e.jsx(O,{className:"w-4 h-4"}),"ìì "]})]})]})]})]})}function re({bulletin:t,currentServiceOrderOfService:n}){const[s,l]=p.useState("order"),i=[{id:"order",label:"ìë°°ìì"},{id:"notices",label:"ê´ê³ "},{id:"serving",label:"ë´ì¬"},{id:"schedule",label:"ì¼ì "},{id:"images",label:"첨ë¶ì´ë¯¸ì§"}];return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex gap-1 text-[11px]",children:i.map(d=>e.jsx("button",{onClick:()=>l(d.id),className:`px-3 py-1 rounded transition-colors ${s===d.id?"bg-indigo-600 text-white border border-indigo-700":"bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"}`,children:d.label},d.id))}),e.jsxs("div",{className:"border border-gray-200 rounded-xl p-3 bg-white text-[12px] leading-[1.9]",children:[s==="order"&&e.jsx(ne,{orderOfService:n||t.orderOfService}),s==="notices"&&e.jsx(ae,{announcements:t.announcements}),s==="serving"&&e.jsx(ie,{servingMembers:t.servingMembers}),s==="schedule"&&e.jsx(le,{weeklySchedule:t.weeklySchedule}),s==="images"&&e.jsx(ce,{images:t.images})]})]})}function ne({orderOfService:t}){return!t||t.length===0?e.jsx("div",{className:"text-gray-500 text-center py-4",children:"ìë°° ììê° ë±ë¡ëì§ ìììµëë¤"}):e.jsx("div",{className:"space-y-1.5",children:t.map((n,s)=>e.jsxs("div",{className:"flex items-center gap-2 py-1.5 px-2 bg-gray-50 rounded border-l-2 border-indigo-500",children:[e.jsxs("span",{className:"text-indigo-600 font-semibold text-[11px] min-w-[28px]",children:[n.order,"."]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("span",{className:"font-medium text-gray-900 text-[12px]",children:n.title}),n.detail&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-400",children:"·"}),e.jsx("span",{className:"text-[11px] text-gray-600",children:n.detail})]})]})]},s))})}function ae({announcements:t}){if(!t||t.length===0)return e.jsx("div",{className:"text-gray-500 text-center py-4",children:"ê´ê³ ì¬íì´ ììµëë¤"});const n=t.reduce((s,l)=>{const i=l.category||"ì¼ë°";return s[i]||(s[i]=[]),s[i].push(l),s},{});return e.jsx("div",{className:"space-y-4",children:Object.entries(n).map(([s,l])=>e.jsxs("div",{children:[e.jsxs("div",{className:"text-[13px] font-bold text-indigo-600 mb-2 pb-1 border-b border-gray-200",children:["â ",s]}),e.jsx("div",{className:"space-y-2",children:l.map((i,d)=>e.jsxs("div",{className:"pl-3",children:[e.jsx("div",{className:"font-medium text-gray-900",children:i.title}),i.content&&e.jsx("div",{className:"text-[11px] text-gray-600 mt-1 leading-relaxed whitespace-pre-line",children:i.content})]},d))})]},s))})}function ie({servingMembers:t}){return!t||t.length===0?e.jsx("div",{className:"text-gray-500 text-center py-4",children:"ë´ì¬ì ëª
ë¨ì´ ììµëë¤"}):e.jsx("div",{className:"space-y-2",children:t.map((n,s)=>e.jsxs("div",{className:"flex justify-between items-center py-1",children:[e.jsxs("span",{className:"font-medium text-gray-700",children:["⢠",n.role]}
1),e.jsx("span",{className:"text-gray-900",children:n.members})]},s))})}function le({weeklySchedule:t}){return!t||t.length===0?e.jsx("div",{className:"text-gray-500 text-center py-4",children:"ì£¼ê° ì¼ì ì´ ììµëë¤"}):e.jsx("div",{className:"space-y-3",children:t.map((n,s)=>e.jsxs("div",{className:"border-l-2 border-indigo-600 pl-3 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[11px] font-semibold text-indigo-600",children:n.day}),e.jsx("span",{className:"text-[10px] text-gray-500",children:n.time})]}),e.jsx("div",{className:"font-medium text-gray-900",children:n.title}),n.location&&e.jsxs("div",{className:"text-[11px] text-gray-600 mt-0.5",children:["ð ",n.location]})]},s))})}function ce({images:t}){return!t||t.length===0?e.jsx("div",{className:"text-gray-500 text-center py-4",children:"첨ë¶ë ì´ë¯¸ì§ê° ììµëë¤"}):e.jsx(se,{images:t,editable:!1})}function de({bulletins:t,currentBulletinId:n,onSelect:s}){if(t.length===0)return null;const l=t.filter(i=>i.id!==n).slice(0,5);return l.length===0?null:e.jsxs("div",{className:"border border-gray-200 rounded-xl p-3 bg-white",children:[e.jsxs("div",{className:"text-[11px] text-gray-500 mb-2 flex items-center gap-1",children:[e.jsx(U,{className:"w-3 h-3"}),"ì´ì 주보 ì í"]}),e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:l.map(i=>e.jsxs("button",{onClick:()=>s(i),className:"flex-shrink-0 px-3 py-1.5 bg-gray-100 hover:bg-indigo-100 border border-gray-300 hover:border-indigo-300 rounded text-[10px] transition-colors",children:[e.jsx("div",{className:"font-medium text-gray-900",children:i.week}),e.jsx("div",{className:"text-gray-600",children:i.date})]},i.id))})]})}function ye(){const t=L(),[n]=Y(),[s,l]=p.useState(!0),[i,d]=p.useState([]),[r,c]=p.useState(null),[u,b]=p.useState("sun1"),[a,x]=p.useState(!1),[j,o]=p.useState(null),[f,v]=p.useState(!1);p.useEffect(()=>{h()},[]);async function h(){try{l(!0);const N=(await _.getAllBulletins()).sort(($,T)=>new Date(T.date).getTime()-new Date($.date).getTime());d(N);const k=n.get("id");if(k){const $=N.find(T=>T.id===k);c($||N[0]||null)}else N.length>0&&c(N[0])}catch(g){console.error("주보 ë¡ë© ì¤í¨:",g),y.error("주보를 ë¶ë¬ì¬ ì ììµëë¤")}finally{l(!1)}}function w(g){b(g),x(!1)}function S(g){c(g),b("sun1"),x(!1)}async function P(){if(r){x(!0),v(!0),o(null);try{const N={sun1:"ì£¼ì¼ 1ë¶",sun2:"ì£¼ì¼ 2ë¶",sun3:"ì£¼ì¼ 3ë¶",sun4:"ì£¼ì¼ 4ë¶",afternoon:"ì¤íìë°°",wednesday:"ìììë°°",dawn:"ì벽기ëí"}[u],k=await G(r.date,N);o(k)}catch(g){console.error("ìì ê²ì ì¤í¨:",g),y.error("ììì ì°¾ì ì ììµëë¤")}finally{v(!1)}}}async function D(){if(r)try{y.loading("PDF를 ìì±íë ì¤ì
ëë¤..."),await Q(r.id,r.date),y.dismiss(),y.success("PDF ë¤ì´ë¡ëê° ìë£ëììµëë¤")}catch(g){y.dismiss(),console.error("PDF ë¤ì´ë¡ë ì¤í¨:",g),y.error("PDF ë¤ì´ë¡ëì ì¤í¨íìµëë¤")}}function m(){if(!r)return null;switch(u){case"sun1":return r.sunday_services[0]||null;case"sun2":return r.sunday_services[1]||null;case"sun3":return r.sunday_services[2]||null;case"sun4":return r.sunday_services[3]||null;case"afternoon":return r.sundayAfternoon||null;case"wednesday":return r.wednesdayService||null;case"dawn":return r.dawnPrayer||null;default:return null}}function A(){return u==="sun1"||u==="sun2"||u==="sun3"||u==="sun4"?"sunday":u==="afternoon"?"afternoon":u==="wednesday"?"wednesday":"dawn"}if(s)return e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsx("div",{className:"text-gray-600 text-[13px]",children:"주보를 ë¶ë¬ì¤ë ì¤..."})});if(!r)return e.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[e.jsx("div",{className:"bg-white p-4 border-b border-gray-200",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>t("/"),className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-gray-100 transition-colors",children:e.jsx(B,{className:"w-5 h-5 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"ì¤ë§í¸ì£¼ë³´"}),e.jsx("div",{className:"text-xs text-gray-500",children:"ì´ë² 주 ìë°°ì ììì íëì"})]})]})}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(q,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ë±ë¡ë ì£¼ë³´ê° ììµëë¤"})]})})]});const C=m();return e.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[e.jsx("div",{className:"bg-white p-4 border-b border-gray-200 print:hidden",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>t("/"),className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-gray-100 transition-colors",children:e.jsx(B,{className:"w-5 h-5 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"ì¤ë§í¸ì£¼ë³´"}),e.jsx("div",{className:"text-xs text-gray-500",children:"ì´ë² 주 ìë°°ì ììì íëì"})]})]}),e.jsxs("button",{onClick:D,className:"flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-[13px] font-medium",title:"PDF ë¤ì´ë¡ë",children:[e.jsx(I,{className:"w-4 h-4"}),e.jsx("span",{children:"PDF"})]})]})}),e.jsxs("main",{id:"bulletin-container",className:"flex-1 overflow-y-auto p-4 pb-20 space-y-3 print:overflow-visible print:p-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:i.length>0&&i[0].id===r.id?"ì´ë² 주 주보":"ì§ë 주보"}),e.jsxs("div",{className:"text-[11px] text-gray-500",children:[r.date," (",r.week,")"]})]}),e.jsx("div",{className:"print:hidden",children:e.jsx(Z,{activeService:u,onServiceChange:w})}),e.jsx(ee,{service:C,serviceType:A(),onPlayVideo:P}),a&&e.jsx("div",{className:"print:hidden",children:e.jsx(te,{video:j,isLoading:f,onClose:()=>x(!1)})}),e.jsx(re,{bulletin:r,currentServiceOrderOfService:C&&"orderOfService"in C?C.orderOfService:void 0}),e.jsx("div",{className:"print:hidden",children:e.jsx(de,{bulletins:i,currentBulletinId:r.id,onSelect:S})})]}),e.jsx("nav",{className:"bg-white border-t border-gray-200 px-4 py-2 print:hidden",children:e.jsxs("div",{className:"grid grid-cols-4 text-center text-[10px]",children:[e.jsxs("button",{onClick:()=>
1t("/dashboard"),className:"flex flex-col items-center text-gray-500 hover:text-blue-600 transition-colors",children:[e.jsx("i",{className:"fas fa-home text-sm mb-1"}),e.jsx("span",{children:"í"})]}),e.jsxs("button",{onClick:()=>t("/content/qt"),className:"flex flex-col items-center text-gray-500 hover:text-blue-600 transition-colors",children:[e.jsx("i",{className:"fas fa-book-open text-sm mb-1"}),e.jsx("span",{children:"ì¤ëì QT"})]}),e.jsxs("button",{onClick:()=>t("/pastoral"),className:"flex flex-col items-center text-gray-500 hover:text-blue-600 transition-colors",children:[e.jsx("i",{className:"fas fa-route text-sm mb-1"}),e.jsx("span",{children:"목ìê´ë¦¬"})]}),e.jsxs("button",{onClick:()=>t("/members"),className:"flex flex-col items-center text-gray-500 hover:text-blue-600 transition-colors",children:[e.jsx("i",{className:"fas fa-church text-sm mb-1"}),e.jsx("span",{children:"êµì ë¶"})]})]})})]})}export{ye as BulletinView};
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.