1import{j as e}from"./vendor-data-Z5doMMu-.js";import{r as x}from"./vendor-react-zNM0AU50.js";import{k as q,m as _,q as k,l as b,w as C,u as T,y as O,z,x as F}from"./vendor-firebase-Da9KY1q_.js";import{d as p}from"./index-D1K3lVhu.js";import{s as $}from"./storageService-HxVmCucr.js";import{a7 as d,Y as P,aa as G,I as W,ad as Y,f as J,S as K,aT as X,ak as R,aU as L,g as H,aV as A,aW as Q,aX as Z,af as ee,T as te,aJ as se,aY as ae,a8 as le}from"./vendor-ui-CW5bJ11U.js";import"./vendor-charts-08G1rM8P.js";const h="banners",S={async getAllBanners(){try{const t=k(b(p,h),F("order","asc"));return(await _(t)).docs.map(c=>({id:c.id,...c.data()}))}catch(t){throw console.error("ë°°ë ëª©ë¡ ì¡°í ì¤í¨:",t),t}},async getBannersByType(t){try{const a=k(b(p,h),C("type","==",t),C("is_active","==",!0),F("order","asc"));return(await _(a)).docs.map(i=>({id:i.id,...i.data()}))}catch(a){throw console.error("ë°°ë ì¡°í ì¤í¨:",a),a}},async getActiveBanners(){try{const t=k(b(p,h),C("is_active","==",!0),F("order","asc"));return(await _(t)).docs.map(c=>({id:c.id,...c.data()}))}catch(t){throw console.error("íì± ë°°ë ì¡°í ì¤í¨:",t),t}},async createBanner(t){try{return(await z(b(p,h),{...t,view_count:0,click_count:0,created_at:new Date().toISOString(),updated_at:new Date().toISOString()})).id}catch(a){throw console.error("ë°°ë ìì± ì¤í¨:",a),a}},async updateBanner(t,a){try{const c=q(p,h,t);await T(c,{...a,updated_at:new Date().toISOString()})}catch(c){throw console.error("ë°°ë ìì ì¤í¨:",c),c}},async deleteBanner(t){try{await O(q(p,h,t))}catch(a){throw console.error("ë°°ë ìì ì¤í¨:",a),a}},async toggleActive(t,a){try{await this.updateBanner(t,{is_active:a})}catch(c){throw console.error("íì±í í ê¸ ì¤í¨:",c),c}},async incrementViewCount(t){try{const a=q(p,h,t),i=(await _(k(b(p,h),C("__name__","==",t)))).docs[0].data().view_count||0;await T(a,{view_count:i+1})}catch(a){throw console.error("ì¡°íì ì¦ê° ì¤í¨:",a),a}},async incrementClickCount(t){try{const a=q(p,h,t),i=(await _(k(b(p,h),C("__name__","==",t)))).docs[0].data().click_count||0;await T(a,{click_count:i+1})}catch(a){throw console.error("í´ë¦ì ì¦ê° ì¤í¨:",a),a}}};function I(t){if(!t)return null;const a=[/(?:youtube\.com\/watch\?(?:.*&)?v=)([\w-]{11})/,/(?:youtu\.be\/)([\w-]{11})/,/(?:youtube\.com\/shorts\/)([\w-]{11})/,/(?:youtube\.com\/embed\/)([\w-]{11})/,/(?:youtube\.com\/live\/)([\w-]{11})/];for(const c of a){const i=t.match(c);if(i)return i[1]}return/^[\w-]{11}$/.test(t.trim())?t.trim():null}function he(){const[t,a]=x.useState(!0),[c,i]=x.useState([]),[j,B]=x.useState(""),[g,f]=x.useState("all"),[s,o]=x.useState("all"),[D,v]=x.useState(!1),[M,r]=x.useState(null),[n,u]=x.useState(!1);x.useEffect(()=>{m()},[]);async function m(){try{a(!0);const l=await S.getAllBanners();i(l)}catch(l){console.error("ë°°ë ë¡ë© ì¤í¨:",l),d.error("ë°°ë를 ë¶ë¬ì¬ ì ììµëë¤")}finally{a(!1)}}const E=c.filter(l=>!(j&&!l.title.toLowerCase().includes(j.toLowerCase())||g!=="all"&&l.type!==g||s==="active"&&!l.is_active||s==="inactive"&&l.is_active)),N={total:c.length,rolling:c.filter(l=>l.type==="rolling").length,normal:c.filter(l=>l.type==="normal").length,active:c.filter(l=>l.is_active).length,totalViews:c.reduce((l,y)=>l+(y.view_count||0),0),totalClicks:c.reduce((l,y)=>l+(y.click_count||0),0)};async function U(l){if(confirm("ì´ ë°°ë를 ìì íìê² ìµëê¹?"))try{await S.deleteBanner(l),d.success("ìì ëììµëë¤"),m()}catch{d.error("ìì ì ì¤í¨íìµëë¤")}}async function V(l,y){try{await S.toggleActive(l,!y),d.success(y?"ë¹íì±íëììµëë¤":"íì±íëììµëë¤"),m()}catch{d.error("ìí ë³ê²½ì ì¤í¨íìµëë¤")}}return t?e.jsx("div",{className:"flex items-center justify-center h-96",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"ë°°ë를 ë¶ë¬ì¤ë ì¤..."})}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[18px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(P,{className:"w-5 h-5 text-blue-600"}),"ë°°ë ê´ë¦¬"]}),e.jsx("p",{className:"text-[12px] text-gray-500 mt-1",children:"ì± ë©ì¸ íë©´ì íìë ë°°ë를 ê´ë¦¬í©ëë¤"})]}),e.jsxs("button",{onClick:()=>{r(null),v(!0)},className:"flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium",children:[e.jsx(G,{className:"w-4 h-4"}),"ë°°ë ì¶ê°"]})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg overflow-hidden",children:[e.jsxs("button",{onClick:()=>u(!n),className:"w-full px-4 py-3 flex items-center justify-between hover:bg-blue-100/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-[13px] font-medium text-blue-800",children:"ë°°ë ì´ë¯¸ì§ ì ì ê°ì´ë"})]}),n?e.jsx(Y,{className:"w-4 h-4 text-blue-600"}):e.jsx(J,{className:"w-4 h-4 text-blue-600"})]}),n&&e.jsxs("div",{className:"px-4 pb-4 border-t border-blue-200 bg-white/50",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-3",children:[e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-gray-200",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(K,{className:"w-5 h-5 text-emerald-600"}),e.jsx("h4",{className:"text-[13px] font-bold text-gray-900",children:"모ë°ì¼ ë°°ë (ê¶ì¥)"})]}),e.jsxs("div",{className:"space-y-2 text-[12px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"ê¶ì¥ í¬ê¸°"}),e.jsx("span",{className:"font-semibold text-gray-900",children:"1200 x 600 px"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"ë¹ì¨"}),e.jsx("span",{className:"font-semibold text-emerald-600",children:"2:1 (íì ìì)"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"ìµì í¬ê¸°"}),e.jsx("span",{className:"text-gray-900",children:"800 x 400 px"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"íì¼ í¬ê¸°"}),e.jsx("span",{className:"text-gray-900",children:"500KB ì´í"})]})]}),e.jsx("div",{className:"mt-3 bg-gray-100 rounded overflow-hidden",style:{aspectRatio:"2/1"},children:e.jsx("div",{className:"w-full h-full flex items-center justify-center border-2 border-dashed border-gray-300",children:e.jsx("span",{className:"text-[11px] text-gray-500",children:"2:1 ë¹ì¨"})})})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-gray-200",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(X,{className:"w-5 h-5 text-blue-600"}),e.jsx("h4",{className:"text-[13px] font-bold text-gray-900",children:"PC ë°°ë"})]}),e.jsxs("div",{className:"space-y-2 text-[12px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"ê¶ì¥ í¬ê¸°"}),e.jsx("span",{className:"font-semibold text-gray-900",children:"1440 x 560 px"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"ë¹ì¨"}),e.jsx("span",{className:"font-semibold text-blue-600",children:"18:7 (ìì´ë, íì ìì)"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"ê³ íì§"}),e.jsx("span",{className:"text-gray-900",children:"2880 x 1120 px (2ë°°)"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"íì¼ í¬ê¸°"}),e.jsx("span",{className:"text-gray-900",children:"1MB ì´í"})]})]}),e.jsx("div",{className:"mt-3 bg-gray-100 rounded overflow-hidden",style:{aspectRatio:"18/7"},children:e.jsx("div",{className:"w-full h-full flex items-center justify-center border-2 border-dashed border-gray-300",children:e.jsx("span",{className:"text-[11px] text-gray-500",children:"18:7 ë¹ì¨"})})})]})]}),e.jsxs("div",{className:"mt-4 p-3 bg-amber-50 rounded-lg border border-amber-200",children:[e.jsx("h4",{className:"text-[12px] font-bold text-amber-800 mb-2",children:"ð¡ ì ì í"}),e.jsxs("ul",{className:"text-[11px] text-amber-700 space-y-1",children:[e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"íì¼ íì"}),": JPG, PNG, WebP ê¶ì¥ (WebPê° ê°ì¥ ì©ë í¨ì¨ì )"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"ì본 ê·¸ëë¡ ì
ë¡ë"}),": ì
ë¡ë ì ìë¥´ì§ ìê³ ì본ì ì ì¥íë©°, ê²ì íë©´ìì PC(1440Ã560, 18:7)·모ë°ì¼(2:1) íì ììì ë§ì¶° ìëì¼ë¡ ë³´ì¬ì¤ëë¤"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"ë¹ì¨ 주ì"}),": PCì 모ë°ì¼ íì ë¹ì¨ì´ ë¤ë¥´ë¯ë¡, 문구·ë¡ê³ ë± ì¤ì ììë ìíì¢ì° ì¤ì ìì ììì ë°°ì¹ (기기ë³ë¡ ê°ì¥ìë¦¬ê° ì릴 ì ìì)"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"í
ì¤í¸"}),": ê°ë
ì±ì ìí´ í° ê¸ì¨ ì¬ì©, ìí ì¬ë°± ì¶©ë¶í"]}),e.jsxs("li",{children:["⢠",e.jsx("strong",{children:"Canva"}),": ì¬ì©ì ì§ì í¬ê¸° ",e.jsx("strong",{children:"1440 x 560"}),"(PC) ëë ",e.jsx("strong",{children:"1200 x 600"}),"(모ë°ì¼)ë¡ ì ì"]})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-6 gap-3",children:[e.jsx(w,{label:"ì ì²´",value:N.total}),e.jsx(w,{label:"롤ë§",value:N.rolling}),e.jsx(w,{label:"ì¼ë°",value:N.normal}
1),e.jsx(w,{label:"íì±",value:N.active,color:"green"}),e.jsx(w,{label:"ì´ ì¡°í",value:N.totalViews,icon:e.jsx(R,{className:"w-3 h-3"})}),e.jsx(w,{label:"ì´ í´ë¦",value:N.totalClicks,icon:e.jsx(L,{className:"w-3 h-3"})})]}),e.jsx("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë°°ë íì
"}),e.jsxs("select",{value:g,onChange:l=>f(l.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),e.jsx("option",{value:"rolling",children:"ë¡¤ë§ ë°°ë"}),e.jsx("option",{value:"normal",children:"ì¼ë° ë°°ë"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ìí"}),e.jsxs("select",{value:s,onChange:l=>o(l.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),e.jsx("option",{value:"active",children:"íì±"}),e.jsx("option",{value:"inactive",children:"ë¹íì±"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê²ì"}),e.jsxs("div",{className:"relative",children:[e.jsx(H,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"ë°°ë ì 목...",value:j,onChange:l=>B(l.target.value),className:"compact-input pl-8"})]})]})]})}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:E.length===0?e.jsxs("div",{className:"col-span-2 bg-white border border-gray-200 rounded shadow-sm p-12 text-center",children:[e.jsx(P,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ë±ë¡ë ë°°ëê° ììµëë¤"})]}):E.map(l=>e.jsx(re,{banner:l,onEdit:()=>{r(l),v(!0)},onDelete:()=>U(l.id),onToggleActive:()=>V(l.id,l.is_active)},l.id))}),D&&e.jsx(ce,{banner:M,onClose:()=>{v(!1),r(null)},onSuccess:()=>{v(!1),r(null),m()}})]})}function w({label:t,value:a,color:c,icon:i}){return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsxs("div",{className:"text-[22px] font-bold text-gray-900 flex items-center gap-2",children:[a,i]}),e.jsx("div",{className:"text-[11px] text-gray-500",children:t})]})}function re({banner:t,onEdit:a,onDelete:c,onToggleActive:i}){return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"relative aspect-[18/7] bg-gray-100",children:[t.media_type==="youtube"&&I(t.youtube_url||"")?e.jsx("div",{className:"w-full h-full bg-black flex items-center justify-center",children:e.jsxs("div",{className:"h-full relative",style:{aspectRatio:"16/9"},children:[e.jsx("img",{src:`https://img.youtube.com/vi/${I(t.youtube_url||"")}/hqdefault.jpg`,alt:t.title,className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(A,{className:"w-10 h-10 text-red-600 drop-shadow",fill:"white"})})]})}):t.media_type==="video"&&t.video_url?e.jsx("video",{src:t.video_url,className:"w-full h-full object-cover",autoPlay:!0,muted:!0,loop:!0,playsInline:!0}):t.image_url?e.jsx("img",{src:t.image_url,alt:t.title,className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(P,{className:"w-12 h-12 text-gray-300"})}),e.jsxs("div",{className:"absolute top-2 left-2 flex gap-2",children:[e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded font-medium ${t.type==="rolling"?"bg-blue-100 text-blue-700":"bg-slate-100 text-slate-700"}`,children:t.type==="rolling"?"롤ë§":"ì¼ë°"}),t.media_type==="video"&&e.jsx("span",{className:"text-[10px] px-2 py-0.5 bg-orange-100 text-orange-700 rounded font-medium",children:"ëìì"}),t.media_type==="youtube"&&e.jsx("span",{className:"text-[10px] px-2 py-0.5 bg-red-100 text-red-700 rounded font-medium",children:"ì íë¸"}),t.is_active?e.jsx("span",{className:"text-[10px] px-2 py-0.5 bg-green-100 text-green-700 rounded font-medium",children:"íì±"}):e.jsx("span",{className:"text-[10px] px-2 py-0.5 bg-gray-100 text-gray-700 rounded font-medium",children:"ë¹íì±"})]}),e.jsx("div",{className:"absolute top-2 right-2 w-8 h-8 bg-black bg-opacity-60 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-[12px] font-bold text-white",children:t.order})})]}),e.jsxs("div",{className:"p-3",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900 mb-1",children:t.title}),t.description&&e.jsx("p",{className:"text-[11px] text-gray-600 mb-2 line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-500 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"w-3 h-3"}),e.jsx("span",{children:t.view_count||0})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(L,{className:"w-3 h-3"}),e.jsx("span",{children:t.click_count||0})]}),t.link_url&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Q,{className:"w-3 h-3"}),e.jsx("span",{className:"truncate max-w-[100px]",children:t.link_url})]})]}),(t.start_date||t.end_date)&&e.jsxs("div",{className:"text-[10px] text-gray-500 mb-3",children:[t.start_date&&`ìì: ${t.start_date}`,t.start_date&&t.end_date&&" ~ ",t.end_date&&`ì¢
ë£: ${t.end_date}`]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:i,className:`flex-1 flex items-center justify-center gap-1 px-2 py-1.5 rounded transition-colors text-[11px] ${t.is_active?"bg-gray-100 hover:bg-gray-200 text-gray-700":"bg-green-100 hover:bg-green-200 text-green-700"}`,children:t.is_active?e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"w-3 h-3"}),"ë¹íì±"]}
1):e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"w-3 h-3"}),"íì±"]})}),e.jsxs("button",{onClick:a,className:"flex-1 flex items-center justify-center gap-1 px-2 py-1.5 bg-blue-100 hover:bg-blue-200 text-blue-700 rounded transition-colors text-[11px]",children:[e.jsx(ee,{className:"w-3 h-3"}),"ìì "]}),e.jsx("button",{onClick:c,className:"flex items-center justify-center px-2 py-1.5 bg-red-100 hover:bg-red-200 text-red-700 rounded transition-colors text-[11px]",children:e.jsx(te,{className:"w-3 h-3"})})]})]})]})}function ce({banner:t,onClose:a,onSuccess:c}){const i=!!t,[j,B]=x.useState(!1),[g,f]=x.useState(!1),[s,o]=x.useState({type:(t==null?void 0:t.type)||"rolling",media_type:(t==null?void 0:t.media_type)||"image",title:(t==null?void 0:t.title)||"",description:(t==null?void 0:t.description)||"",image_url:(t==null?void 0:t.image_url)||"",video_url:(t==null?void 0:t.video_url)||"",youtube_url:(t==null?void 0:t.youtube_url)||"",link_url:(t==null?void 0:t.link_url)||"",link_type:(t==null?void 0:t.link_type)||"none",is_active:(t==null?void 0:t.is_active)??!0,start_date:(t==null?void 0:t.start_date)||"",end_date:(t==null?void 0:t.end_date)||"",order:(t==null?void 0:t.order)||1});async function D(r){var u;const n=(u=r.target.files)==null?void 0:u[0];if(n)try{f(!0);const m=await $.uploadBannerImage(n);o({...s,image_url:m}),d.success("ì´ë¯¸ì§ê° ì
ë¡ëëììµëë¤")}catch{d.error("ì´ë¯¸ì§ ì
ë¡ëì ì¤í¨íìµëë¤")}finally{f(!1)}}async function v(r){var u;const n=(u=r.target.files)==null?void 0:u[0];if(n){if(n.size>50*1024*1024){d.error("ëìì íì¼ì 50MB ì´íì¬ì¼ í©ëë¤");return}try{f(!0);const m=await $.uploadBannerVideo(n);o({...s,video_url:m}),d.success("ëììì´ ì
ë¡ëëììµëë¤")}catch(m){d.error(m.message||"ëìì ì
ë¡ëì ì¤í¨íìµëë¤")}finally{f(!1)}}}async function M(r){r.preventDefault();const n=s.media_type==="video"?!!s.video_url:s.media_type==="youtube"?!!I(s.youtube_url):!!s.image_url;if(!s.title||!n){d.error("íì í목ì ì
ë ¥íì¸ì (ì 목 + ì´ë¯¸ì§/ëìì/ì íë¸ ë§í¬)");return}try{B(!0);const u={...s,created_by:"admin"};i?(await S.updateBanner(t.id,u),d.success("ë°°ëê° ìì ëììµëë¤")):(await S.createBanner(u),d.success("ë°°ëê° ì¶ê°ëììµëë¤")),c()}catch{d.error(i?"ìì ì ì¤í¨íìµëë¤":"ì¶ê°ì ì¤í¨íìµëë¤")}finally{B(!1)}}return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[e.jsx("div",{className:"p-4 border-b border-gray-200",children:e.jsx("h2",{className:"text-[16px] font-bold text-gray-900",children:i?"ë°°ë ìì ":"ë°°ë ì¶ê°"})}),e.jsxs("form",{onSubmit:M,className:"p-4 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ë°°ë íì
",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("select",{value:s.type,onChange:r=>o({...s,type:r.target.value}),className:"compact-input",required:!0,children:[e.jsx("option",{value:"rolling",children:"ë¡¤ë§ ë°°ë"}),e.jsx("option",{value:"normal",children:"ì¼ë° ë°°ë"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì ë ¬ ìì ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"number",value:s.order,onChange:r=>o({...s,order:parseInt(r.target.value)}),className:"compact-input",min:"1",required:!0})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì 목 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:s.title,onChange:r=>o({...s,title:r.target.value}),className:"compact-input",placeholder:"ì: 2025 ì ë
í¹ë³ì§í",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¤ëª
"}),e.jsx("textarea",{value:s.description,onChange:r=>o({...s,description:r.target.value}),className:"compact-input",rows:2,placeholder:"ë°°ëì ëí ê°ë¨í ì¤ëª
"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["미ëì´ íì
",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>o({...s,media_type:"image"}),className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded border text-[13px] font-medium transition-colors ${s.media_type==="image"?"border-blue-500 bg-blue-50 text-blue-600":"border-gray-300 text-gray-600 hover:bg-gray-50"}`,children:[e.jsx(P,{className:"w-4 h-4"}),"ì´ë¯¸ì§"]}),e.jsxs("button",{type:"button",onClick:()=>o({...s,media_type:"video"}),className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded border text-[13px] font-medium transition-colors ${s.media_type==="video"?"border-blue-500 bg-blue-50 text-blue-600":"border-gray-300 text-gray-600 hover:bg-gray-50"}`,children:[e.jsx(se,{className:"w-4 h-4"}),"ëìì"]}
1),e.jsxs("button",{type:"button",onClick:()=>o({...s,media_type:"youtube"}),className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded border text-[13px] font-medium transition-colors ${s.media_type==="youtube"?"border-red-500 bg-red-50 text-red-600":"border-gray-300 text-gray-600 hover:bg-gray-50"}`,children:[e.jsx(A,{className:"w-4 h-4"}),"ì íë¸"]})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:[s.media_type==="video"?"ëìì":s.media_type==="youtube"?"ì íë¸ ë§í¬":"ì´ë¯¸ì§"," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("div",{className:"space-y-2",children:s.media_type==="youtube"?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"text",value:s.youtube_url,onChange:r=>o({...s,youtube_url:r.target.value}),className:"compact-input",placeholder:"https://www.youtube.com/watch?v=... ëë https://youtu.be/..."}),(()=>{const r=I(s.youtube_url);return s.youtube_url&&!r?e.jsx("p",{className:"text-[11px] text-red-500",children:"ì í¨í ì íë¸ ë§í¬ê° ìëëë¤"}):r?e.jsx("div",{className:"relative aspect-[18/7] bg-black rounded overflow-hidden flex items-center justify-center",children:e.jsx("div",{className:"h-full",style:{aspectRatio:"16/9"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${r}?rel=0`,className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}):null})(),e.jsx("p",{className:"text-[11px] text-gray-400",children:"ììì 16:9 ë¹ì¨ ê·¸ëë¡ íìëë©° ëì´ë¥¼ ë°°ëì ë§ì¶¥ëë¤(ì¢ì° ì¬ë°±). ê²ì íë©´ììë ìëì¬ì·ìì거·ë°ë³µë©ëë¤."})]}):s.media_type==="video"?e.jsxs(e.Fragment,{children:[s.video_url&&e.jsx("div",{className:"relative aspect-[18/7] bg-black rounded overflow-hidden",children:e.jsx("video",{src:s.video_url,className:"w-full h-full object-cover",autoPlay:!0,muted:!0,loop:!0,playsInline:!0})}),e.jsxs("label",{className:"flex items-center justify-center gap-2 px-4 py-2 border-2 border-dashed border-gray-300 rounded hover:border-blue-500 cursor-pointer transition-colors",children:[e.jsx(ae,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-[13px] text-gray-600",children:g?"ì
ë¡ë ì¤...":"ëìì ì í (ìµë 50MB)"}),e.jsx("input",{type:"file",accept:"video/*",onChange:v,className:"hidden",disabled:g})]}),e.jsx("p",{className:"text-[11px] text-gray-400",children:"MP4, WebM ë± ì§ì. PC 18:7(1440Ã560) / 모ë°ì¼ 2:1 íì."})]}):e.jsxs(e.Fragment,{children:[s.image_url&&e.jsx("div",{className:"relative aspect-[18/7] bg-gray-100 rounded overflow-hidden",children:e.jsx("img",{src:s.image_url,alt:"미리보기",className:"w-full h-full object-cover"})}),e.jsxs("label",{className:"flex items-center justify-center gap-2 px-4 py-2 border-2 border-dashed border-gray-300 rounded hover:border-blue-500 cursor-pointer transition-colors",children:[e.jsx(le,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-[13px] text-gray-600",children:g?"ì
ë¡ë ì¤...":"ì´ë¯¸ì§ ì í (ì본 ê·¸ëë¡ ì
ë¡ë)"}),e.jsx("input",{type:"file",accept:"image/*",onChange:D,className:"hidden",disabled:g})]})]})})]}),e.jsxs("div",{className:"space-y-3 p-3 bg-gray-50 rounded",children:[e.jsx("h3",{className:"text-[13px] font-bold text-gray-900",children:"ë§í¬ ì¤ì "}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë§í¬ íì
"}
1),e.jsxs("select",{value:s.link_type,onChange:r=>o({...s,link_type:r.target.value}),className:"compact-input",children:[e.jsx("option",{value:"none",children:"ë§í¬ ìì"}),e.jsx("option",{value:"internal",children:"ë´ë¶ ë§í¬ (ì± íë©´)"}),e.jsx("option",{value:"external",children:"ì¸ë¶ ë§í¬ (ì¹ì¬ì´í¸)"})]})]}),s.link_type!=="none"&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë§í¬ URL"}),e.jsx("input",{type:"text",value:s.link_url,onChange:r=>o({...s,link_url:r.target.value}),className:"compact-input",placeholder:s.link_type==="internal"?"/bulletin":"https://example.com"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ììì¼ (ì í)"}),e.jsx("input",{type:"date",value:s.start_date,onChange:r=>o({...s,start_date:r.target.value}),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¢
ë£ì¼ (ì í)"}),e.jsx("input",{type:"date",value:s.end_date,onChange:r=>o({...s,end_date:r.target.value}),className:"compact-input"})]})]}),e.jsx("div",{children:e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:s.is_active,onChange:r=>o({...s,is_active:r.target.checked}),className:"w-4 h-4"}),e.jsx("span",{className:"text-[12px] font-medium text-gray-700",children:"íì±í (ì²´í¬ í´ì ì ì±ì íìëì§ ìì)"})]})}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:a,className:"flex-1 px-3 py-2 border border-gray-300 rounded hover:bg-gray-50 transition-colors text-[13px]",children:"ì·¨ì"}),e.jsx("button",{type:"submit",disabled:j||g,className:"flex-1 px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium disabled:opacity-50",children:j?"ì²ë¦¬ ì¤...":i?"ìì ":"ì¶ê°"})]})]})]})})}export{he as BannerManagementPage};
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.