1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/shareComments-BhcYGG95.js","assets/vendor-firebase-Dak2Hxsr.js","assets/firebase-FBroemQC.js","assets/firestoreService-7NrzI4tJ.js","assets/index-CL-0Jw9t.js","assets/vendor-react-Hmgc0IJo.js","assets/index-BDOMsqD5.css","assets/detailHtml-BUUBOfBA.js","assets/storageService-BSSwqqbq.js","assets/userService-j0Fmw12X.js","assets/userNotifications-BFSmaFGp.js"])))=>i.map(i=>d[i]); 2import{s as B,n as J,a as Pe,_ as ae}from"./index-CL-0Jw9t.js";import{r as d,j as e}from"./vendor-react-Hmgc0IJo.js";import{s as Ae}from"./shareCommentRules-Bqb9G7Ec.js";import{E as Be,Q as Le}from"./AppAuthenticated-DS7p-za4.js";import{a7 as Ue,a8 as $e,a9 as Te}from"./firestoreService-7NrzI4tJ.js";import{g as I,t as Me}from"./storageService-BSSwqqbq.js";import{d as We}from"./downloadFile-DbTs4Tyj.js";import"./detailHtml-BUUBOfBA.js";import"./vendor-genai-Ca_DMGSD.js";import"./firebase-FBroemQC.js";import"./vendor-firebase-Dak2Hxsr.js";import"./userNotifications-BFSmaFGp.js";import"./userService-j0Fmw12X.js";const Ve=s=>s.deletedAt?"trash":s.projectKind==="link-import"?"draft":s.status||"completed",re=s=>{const l=new Date(s).getTime();return Number.isFinite(l)?l:0},_e=(s,{status:l,favoritesOnly:o,sort:c})=>s.filter(i=>{const m=Ve(i);return l==="trash"?m==="trash"&&(!o||i.isFavorite===!0):m==="trash"?!1:(!o||i.isFavorite===!0)&&(l==="all"||m===l)}).sort((i,m)=>(c==="name"?i.name.localeCompare(m.name,"ko",{numeric:!0,sensitivity:"base"}):re(c==="created"?m.createdAt:m.updatedAt)-re(c==="created"?i.createdAt:i.updatedAt))||i.id.localeCompare(m.id)),ze=s=>{var c,i;const l=(s.images||[]).filter(m=>m.status==="completed").length,o=Math.max(((c=s.plan)==null?void 0:c.length)||0,((i=s.images)==null?void 0:i.length)||0);return{completed:l,total:o,percent:o?Math.min(100,l/o*100):0}},Re=({project:s,onClose:l,onPrepare:o,onApply:c})=>{const[i,m]=d.useState("product"),[u,b]=d.useState(!1),[r,N]=d.use
2State(null),[w,f]=d.useState(""),D=d.useRef(null);d.useEffect(()=>()=>{var x;(x=D.current)==null||x.abort()},[]);const E=()=>{var x;(x=D.current)==null||x.abort(),l()},F=async()=>{if(u)return;const x=new AbortController;D.current=x,b(!0),f("");try{const p=r||await o(s,i,x.signal);if(x.signal.aborted)return;if(!r&&p.warnings.length){N(p);return}await c(p,x.signal)}catch(p){if(x.signal.aborted)return;f(p instanceof Error?p.message:"ì¤ë¹íì§ ëª»íìµëë¤. ë¤ì ìëí´ ì£¼ì¸ì.")}finally{x.signal.aborted||b(!1)}};return e.jsxs(Be,{title:"ì´ ìì
ì¼ë¡ ìë¡ ë§ë¤ê¸°",onClose:E,footer:e.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[e.jsx("button",{type:"button",onClick:E,className:"rounded-xl border border-slate-200 px-5 py-3 text-sm font-medium hover:bg-slate-50",children:"ì·¨ì"}),e.jsx("button",{type:"button",disabled:u,onClick:()=>void F(),className:"rounded-xl bg-[#285D5B] px-5 py-3 text-sm font-semibold text-white hover:bg-[#1D4745] disabled:opacity-60",children:u?"ì¤ë¹ ì¤â¦":r?"ì¬ì§ ëë½ íì¸ í ìì":"ì´ ë´ì©ì¼ë¡ ìì"})]}),children:[e.jsxs("p",{className:"text-sm leading-6 text-slate-600",children:[e.jsx("span",{className:"font-semibold text-slate-900",children:s.name}),"ìì 무ìì ê°ì ¸ì¬ê¹ì?"]}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",role:"group","aria-label":"ì¬ì¬ì©í ë´ì©",children:[["product","ê°ì ìíì¼ë¡ ìë¡ ë§ë¤ê¸°","ìí ì 보·ì¬ì§Â·ìµì
Â·ê³ ì를 ë³µì¬í´ ìì í´ì."],["design","ì¤íì¼ë§ ê°ì ¸ì¤ê¸°","ëìì¸ ì¤ì ë§ ê°ì ¸ì¤ê³ , ìí ì ë³´ë ìë¡ ì
ë ¥í´ì."]].map(([x,p,M])=>e.jsxs("button",{type:"button","aria-pressed":i===x,disabled:u,onClick:()=>{m(x),N(null),f("")},className:`rounded-2xl border-2 p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-teal-600 focus-visible:ring-offset-2 ${i===x?"border-[#48A9A6] bg-[#F0F8F7]":"border-slate-200 bg-white hover:border-slate-300"}`,children:[e.jsxs("span",{className:"flex items-start gap-2 font-semibold text-slate-900",children:[e.jsx("span",{"aria-hidden":"true",className:i===x?"text-teal-600":"text-slate-300",children:i===x?"â":"â"}),p]}),e.jsx("span",{className:"mt-2 block text-sm leading-6 text-slate-600",children:M})]},x))}),e.jsx("p",{className:"text-xs leading-6 text-slate-500",children:"ì본ì ê·¸ëë¡ ì ì§ë¼ì. ì¤ì ìì± ì ê¹ì§ í¬ë ë§ì ì¬ì©íì§ ììµëë¤."}),e.jsxs("details",{className:"rounded-xl bg-slate-50 px-4 py-3 text-xs leading-6 text-slate-600",children:[e.jsx("summary",{className:"cursor-pointer font-medium",children:"ê°ì ¸ì¤ì§ ìë ë´ì© · íì¸ ì¬í"}),e.jsxs("p",{className:"mt-2",children:["ìì±ë ê²°ê³¼ ì´ë¯¸ì§Â·ìºë²ì¤ ë°°ì¹Â·ìì ì´ë ¥Â·ê³µì ì¤ì ì ë³µì¬íì§ ììµëë¤.",i==="design"?" ìíëª
·ì¬ì§Â·ë¸ëëëª
·ìµì
Â·ê³ ìë ì ìíì ë§ê² ì
ë ¥í´ ì£¼ì¸ì.":" ìµì
Â·ê³ ìì ì¬ì¤ ì ë³´ë ì§ì íì¸í´ 주ì¸ì."," ","ì¤ì ìì± ì 기존 ì´ì© íëê° ì ì©ë©ëë¤."]})]}),r&&e.jsxs("div",{role:"alert",className:"rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900",children:[e.jsx("p",{className:"font-semibold",children:"ì¼ë¶ ì¬ì§ì ê°ì ¸ì¤ì§ 못íìµëë¤"}),e.jsx("ul",{className:"mt-2 list-disc space-y-1 pl-5",children:r.warnings.map((x,p)=>e.jsx("li",{children:x},p))}),e.jsx("button",{type:"button",disabled:u,onClick:()=>{N(null),f("")},className:"mt-3 underline underline-offset-4",children:"ì¬ì§ ë¤ì ë¶ë¬ì¤ê¸°"})]}),w&&e.jsx("p",{role:"alert",className:"rounded-xl bg-red-50 p-3 text-sm text-red-700",children:w}),u&&e.jsx("p",{role:"status",className:"text-sm text-[#285D5B]",children:"ì본 ì¬ì§ì ì¤ë¹íê³ ììµëë¤. ì¬ì§ ìì ë°ë¼ ì ì 걸릴 ì ììµëë¤."})]})},Ne={all:"ì ì²´ ìí","in-progress":"ì§í ì¤",completed:"ìë£",failed:"ì¤í¨",draft:"ë§í¬ ì´ì",trash:"í´ì§íµ"},ye={updated:"ìµê·¼ ìì ì",created:"ìµê·¼ ìì±ì",name:"ì´ë¦ì"},Ke=({query:s,onQuery:l,type:o,onType:c,typeOptions:i,status:m,onStatus:u,favoritesOnly:b,onFavorites:r,sort:N,onSort:w,view:f,onView:D,count:E,total:F,onReset:x})=>{var R;const[p,M]=d.useState(!1),P=d.useId(),j=o==="video-translation",A=[o!=="all"&&((R=i.find(h=>h.value===o))==null?void 0:R.label),!j&&m!=="all"&&Ne[m],!j&&b&&"ì¦ê²¨ì°¾ê¸°",!j&&N!=="updated"&&ye[N],!j&&f==="list"&&"ëª©ë¡ ë³´ê¸°"].filter(
2Boolean),O=!!s||A.length>0;return e.jsxs("div",{className:"mb-5 rounded-2xl border border-slate-200 bg-white p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx("svg",{"aria-hidden":"true",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-4.35-4.35m1.35-5.15a6.5 6.5 0 11-13 0 6.5 6.5 0 0113 0z"})}),e.jsx("input",{type:"search","aria-label":"ìì
ë´ì ê²ì",placeholder:"ì´ë¦Â·ì¤ëª
ì¼ë¡ ê²ì",value:s,onChange:h=>l(h.target.value),className:"min-h-11 w-full rounded-xl border border-slate-200 bg-slate-50 py-2 pl-9 pr-9 text-base text-slate-900 placeholder:text-slate-400 focus:border-teal-600 focus:outline-none sm:text-sm"}),s&&e.jsx("button",{type:"button","aria-label":"ê²ìì´ ì§ì°ê¸°",onClick:()=>l(""),className:"absolute right-1 top-1/2 h-9 w-9 -translate-y-1/2 rounded-lg text-slate-500 hover:bg-slate-200",children:"Ã"})]}),e.jsxs("button",{type:"button","aria-expanded":p,"aria-controls":P,onClick:()=>M(h=>!h),className:`min-h-11 shrink-0 rounded-xl border px-3 text-sm font-medium ${p?"border-teal-200 bg-teal-50 text-teal-800":"border-slate-200 text-slate-600 hover:bg-slate-50"}`,children:["íí°Â·ë³´ê¸° ",e.jsx("span",{"aria-hidden":"true",children:p?"â":"+"})]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-xs text-slate-500",children:[e.jsxs("p",{role:"status",className:"mr-auto",children:[e.jsxs("span",{className:"font-semibold text-slate-800",children:[E,"ê°"]})," íì · ì ì²´ ",F,"ê°"]}),A.map(h=>e.jsx("span",{className:"rounded-md bg-teal-50 px-2 py-1 text-teal-800",children:h},String(h))),O&&e.jsx("button",{type:"button",onClick:x,className:"min-h-8 rounded-lg px-2 text-slate-500 underline underline-offset-4 hover:bg-slate-50",children:"ì´ê¸°í"})]}),e.jsxs("div",{id:P,hidden:!p,className:p?"mt-3 flex flex-wrap items-center gap-3 border-t border-slate-100 pt-3":"hidden",children:[e.jsxs("label",{className:"flex min-h-11 max-w-full items-center gap-2 text-sm text-slate-500",children:["ì í",e.jsx("select",{"aria-label":"ìì
ì í",value:o,onChange:h=>c(h.target.value),className:"min-w-0 max-w-full rounded-lg border border-slate-200 bg-white p-2 text-base text-slate-900 focus:outline-teal-600 sm:text-sm",children:i.map(h=>e.jsxs("option",{value:h.value,children:[h.label," (",h.count,")"]},h.value))})]}),!j&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"flex min-h-11 items-center gap-2 text-sm text-slate-500",children:["ìí",e.jsx("select",{"aria-label":"ìì
ìí",value:m,onChange:h=>u(h.target.value),className:"rounded-lg border border-slate-200 bg-white p-2 text-base text-slate-900 focus:outline-teal-600 sm:text-sm",children:Object.entries(Ne).map(([h,k])=>e.jsx("option",{value:h,children:k},h))})]}),e.jsx("button",{type:"button","aria-pressed":b,onClick:()=>r(!b),className:`min-h-11 rounded-xl border px-3 text-sm ${b?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-200 text-slate-600 hover:bg-slate-50"}`,children:"â
ì¦ê²¨ì°¾ê¸°ë§"}),e.jsxs("label",{className:"flex min-h-11 items-center gap-2 text-sm text-slate-500",children:["ì ë ¬",e.jsx("select",{"aria-label":"ìì
ì ë ¬",value:N,onChange:h=>w(h.target.value),className:"rounded-lg border border-slate-200 bg-white p-2 text-base text-slate-900 focus:outline-teal-600 sm:text-sm",children:Object.entries(ye).map(([h,k])=>e.jsx("option",{value:h,children:k},h))})]}),e.jsx("div",{role:"group","aria-label":"ìì
보기 ë°©ì",className:"flex rounded-xl bg-slate-100 p-1",children:["grid","list"].map(h=>e.jsx("button",{type:"button","aria-pressed":f===h,onClick:()=>D(h),className:`min-h-10 rounded-lg px-3 text-sm ${f===h?"bg-white font-semibold text-[#285D5B] shadow-sm":"text-slate-500 hover:text-slate-900"}`,children:h==="grid"?"ì¹´ë":"목ë¡"},h))})]})]})]})},He=(s,l,o)=>
2{const[c,i]=d.useState(null),[m,u]=d.useState(!0),b=s.rawStoragePath||s.storagePath;return d.useEffect(()=>{let r=!0;return(async()=>{if(u(!0),b)try{const f=await I(b);r&&(i(f),u(!1));return}catch(f){console.warn("ìµì URL ê°ì ¸ì¤ê¸° ì¤í¨:",b,f)}const w=s.rawImageUrl||s.imageUrl;if(w){r&&(i(w),u(!1));return}if(l&&o)try{s.id;const f=await Me(o,l,s.id);if(f&&r){i(f),u(!1);return}}catch(f){console.warn("â ê²½ë¡ ì¬êµ¬ì± ì¤í¨:",f)}r&&(i(null),u(!1))})(),()=>{r=!1}},[b,s.rawImageUrl,s.imageUrl,s.id,l,o]),c},S=s=>{var o,c,i,m;const l=s;return l.projectKind==="detail-editor"||l.projectKind==="link-import"?l.projectKind:!((o=s.plan)!=null&&o.length)&&((m=(i=(c=s.detailBlockEditorDraft)==null?void 0:c.importedDocument)==null?void 0:i.blocks)!=null&&m.length)?"detail-editor":"generated"},je=s=>{var m,u,b,r,N,w,f,D,E,F;const l=s;if(l.detailEditorSummary)return l.detailEditorSummary;const o=((u=(m=s.detailBlockEditorDraft)==null?void 0:m.importedDocument)==null?void 0:u.blocks)||[];if(o.length===0)return;const c=o.filter(x=>x.type==="image"),i=o.filter(x=>x.type==="text");return{blockCount:o.length,imageBlockCount:c.length,textBlockCount:i.length,referenceImageCount:((r=(b=s.detailBlockEditorDraft)==null?void 0:b.referenceImages)==null?void 0:r.length)||0,pageTitle:(w=(N=s.detailBlockEditorDraft)==null?void 0:N.importedDocument)==null?void 0:w.pageTitle,previewStoragePath:((f=c.find(x=>x.storagePath))==null?void 0:f.storagePath)||((F=(E=(D=s.detailBlockEditorDraft)==null?void 0:D.referenceImages)==null?void 0:E.find(x=>x.storagePath))==null?void 0:F.storagePath)}},Se=(s,l)=>
2{const[o,c]=d.useState(l||null);return d.useEffect(()=>{let i=!0;return(async()=>{if(l){c(l);return}if(!s){c(null);return}try{const u=await I(s);i&&c(u)}catch(u){console.warn("ìì¸ í¸ì§ 미리보기 URL ë¡ë ì¤í¨:",s,u),i&&c(null)}})(),()=>{i=!1}},[l,s]),o},Ce=({img:s,alt:l,projectId:o,userId:c})=>{const i=He(s,o,c),[m,u]=d.useState(!1),[b,r]=d.useState(!1),N=d.useCallback(async()=>{if(m||b)return;console.error("ì¸ë¤ì¼ ë¡ë ì¤í¨:",{imageId:s.id,sectionTitle:s.sectionTitle,storagePath:s.rawStoragePath||s.storagePath});const w=s.rawStoragePath||s.storagePath;if(w){r(!0);try{(await I(w,!0)).substring(0,100)}catch(f){console.error("ìµì URL íë ì¤í¨:",f),u(!0)}finally{r(!1)}}else u(!0)},[s,m,b]);return m||!i?null:e.jsx("img",{src:i,alt:l,className:"w-full h-full object-cover",loading:"lazy",decoding:"async",crossOrigin:i.includes("firebasestorage.googleapis.com")?void 0:"anonymous",onError:N})},le=({storagePath:s,dataUrl:l,alt:o})=>{const c=Se(s,l);return c?e.jsx("img",{src:c,alt:o,className:"w-full h-full object-cover",loading:"lazy",decoding:"async"}):null},Oe=s=>s?{none:"ë¸ëë 미ë
¸ì¶",subtle:"ììíê² ë
¸ì¶","ending-only":"ë§ì§ë§ìë§ ë
¸ì¶",all:"ì ì²´ ë
¸ì¶"}[s]:"ë
¸ì¶ ë°©ì 미ì¤ì ",Qe=s=>!!(s!=null&&s.brandPresetId||s!=null&&s.brandPresetName||s!=null&&s.brandName||s!=null&&s.brandSlogan||s!=null&&s.brandLogoUrl||s!=null&&s.brandTone||s!=null&&s.brandColorPalette||s!=null&&s.brandLayoutDirection),De=({productInfo:s})=>{const l=Se(s==null?void 0:s.brandLogoStoragePath,s==null?void 0:s.brandLogoUrl);if(!Qe(s))return null;const o=(s==null?void 0:s.brandPresetName)||(s==null?void 0:s.brandName)||"ë¸ëë ì¤íì¼",c=((s==null?void 0:s.brandName)||(s==null?void 0:s.brandPresetName)||"B").slice(0,1),i=[s!=null&&s.brandName?`ë¸ëë ${s.brandName}`:"í리ì
ì ì©",Oe(s==null?void 0:s.brandMentionMode)];return e.jsx("div",{className:"mb-4 rounded-lg border border-blue-100 bg-blue-50/70 px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-8 w-8 flex-shrink-0 overflow-hidden rounded-md border border-blue-100 bg-white",children:l?e.jsx("img",{src:l,alt:o,className:"h-full w-full object-contain p-1"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center text-xs font-bold text-blue-700",children:c})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-[11px] font-bold text-blue-900",children:o}),e.jsx("div",{className:"mt-0.5 truncate text-[10px] font-medium text-blue-700",children:i.join(" · ")})]})]})})},Fe=({productInfo:s})=>{const l=Array.isArray(s==null?void 0:s.productOptions)?s.productOptions:[],o=l.filter(r=>r.name||r.description||r.hasImage).length,c=l.filter(r=>r.hasImage||r.imageStoragePath||r.imageUrl).length,i=!!(s!=null&&s.productNotice)&&Object.values(s.productNotice).some(r=>typeof r=="string"&&r.trim().length>0),m=!!(s!=null&&s.productNoticeDisplayImageStoragePath||s!=null&&s.productNoticeDisplayImageUrl),u=(s==null?void 0:s.aiDisclosureEnabled)===!0,b=[o>0?`ìµì
${o}ê°${c?` · ì´ë¯¸ì§ ${c}`:""}`:"",i?`ìíì ë³´ì ê³µê³ ì${m?" · ì¬ì§":""}`:"",u?"AI íì í¬í¨":""].filter(Boolean);return b.length===0?null:e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:b.map(r=>e.jsx("span",{className:"rounded-full border border-slate-200 bg-white px-2 py-1 text-[10px] font-semibold text-slate-600",children:r},r))})},qe=({project:s,onClose:l,onShare:o})=>{const[c,i]=d.useState(""),[m,u]=d.useState(!1),[b,r]=d.useState(!1),{user:N}=Pe(),[w,f]=d.useState({isPublic:s.isPublic===!0,shareToken:s.shareToken}),[D,E]=d.useState(!1),[F,x]=d.useState(null),[p,M]=d.useState(null);d.useEffect(()=>{if(!s.isPublic)return;let k=!1;return ae(async()=>{const{getProjectShareComments:y}=await import("./shareComments-BhcYGG95.js");return{getProjectShareComments:y}},__vite__mapDeps([0,1,2])).then(({getProjectShareComments:y})=>y(s.id)).then(y=>{k||M(Ae(y))}).catch(()=>{}),()=>{k=!0}},[s.id,s.isPublic]);const P=d.useRef(!1),j=()=>{P.current&&o(),l()},A=w.isPublic&&w.shareToken?`${window.location.origin}${window.location.pathname}?share=${encodeURIComponent(w.shareToken)}`:null,O=async()=>
2{if(!D){E(!0),x(null);try{const{setProjectPublicShare:k}=await ae(async()=>{const{setProjectPublicShare:W}=await import("./firestoreService-7NrzI4tJ.js").then(K=>K.ar);return{setProjectPublicShare:W}},__vite__mapDeps([3,4,5,6,1,2,7,8])),y=await k(s.id,!w.isPublic,w.shareToken);f(y),x(y.isPublic?"ê³µê° ë§í¬ë¥¼ ì¼°ì´ì. ìë ë§í¬ë¥¼ ë³µì¬í´ ì ë¬íì¸ì.":"ê³µê° ë§í¬ë¥¼ ê»ì´ì. 기존 ë§í¬ë¡ë ë ì´ì ì´ë¦¬ì§ ììµëë¤."),P.current=!0}catch(k){console.error("ê³µê° ë§í¬ ì¤ì ì¤í¨:",k),x("ê³µê° ë§í¬ ì¤ì ì ì¤í¨íìµëë¤. ì ì í ë¤ì ìëí´ ì£¼ì¸ì.")}finally{E(!1)}}},R=async()=>{if(A)try{await navigator.clipboard.writeText(A),x("ë§í¬ë¥¼ ë³µì¬íì´ì.")}catch{x("ë³µì¬íì§ ëª»íìµëë¤. ë§í¬ë¥¼ ì§ì ì íí´ ë³µì¬í´ 주ì¸ì.")}},h=async()=>{if(!c||!N)return;const k=c.trim().toLowerCase();if(!k||!k.includes("@")){B("ì í¨í ì´ë©ì¼ 주ì를 ì
ë ¥í´ì£¼ì¸ì.");return}try{r(!0);const{validateUserEmailForSharing:y}=await ae(async()=>{const{validateUserEmailForSharing:K}=await import("./userService-j0Fmw12X.js");return{validateUserEmailForSharing:K}},__vite__mapDeps([9,4,5,6,1,2,3,7,8,10])),W=await y(k);if(r(!1),!W.isValid){B(W.message||"ì¬ì©ì ê²ì¦ì ì¤í¨íìµëë¤.");return}if(!W.hasActiveSubscription){B(W.message||"구ë
ì¤ì¸ ì¬ì©ììê²ë§ íë¡ì í¸ë¥¼ ê³µì í ì ììµëë¤.");return}u(!0),s.id,await Te(s.id,N.uid,k),B("íë¡ì í¸ê° ê³µì ëììµëë¤."),o(),l(),i("")}catch(y){r(!1),console.error("â íë¡ì í¸ ê³µì ì¤í¨:",y),B("ê³µì ì ì¤í¨íìµëë¤: "+(y instanceof Error?y.message:"ì ì ìë ì¤ë¥"))}finally{u(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white rounded-xl max-w-md w-full p-6",children:[e.jsx("h3",{className:"text-xl font-bold mb-4",children:"íë¡ì í¸ ê³µì "}),e.jsxs("div",{className:"mb-5 rounded-xl border border-slate-200 bg-slate-50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-slate-800",children:"ð ê³µê° ë§í¬ë¡ ë³´ì¬ì£¼ê¸°"}),e.jsx("div",{className:"text-[11px] text-slate-500 break-keep",children:"ê°ì
ìì´ ë구ë ì½ê¸° ì ì©ì¼ë¡ ë³´ê³ , ì¹ì
ì ëë¬ ì½ë©í¸ë¥¼ ë¨ê¸¸ ì ìì´ì. ê±°ëì²Â·ì¬ì¥ë íì¸ì©."})]}),e.jsx("button",{type:"button",onClick:()=>{O()},disabled:D,"aria-pressed":w.isPublic,className:`flex-shrink-0 rounded-full px-3 py-1.5 text-xs font-semibold transition-colors disabled:opacity-50 ${w.isPublic?"bg-emerald-600 text-white hover:bg-emerald-700":"bg-white border border-slate-300 text-slate-700 hover:bg-slate-100"}`,children:D?"ì²ë¦¬ ì¤â¦":w.isPublic?"ì¼ì§ · ë기":"ì¼ê¸°"})]}),A&&e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("input",{readOnly:!0,value:A,onFocus:k=>k.currentTarget.select(),className:"min-w-0 flex-1 rounded-lg border border-slate-300 bg-white px-2 py-1.5 text-[11px] text-slate-700","aria-label":"ê³µê° ë§í¬"}),e.jsx("button",{type:"button",onClick:()=>{R()},className:"flex-shrink-0 rounded-lg bg-slate-900 px-3 py-1.5 text-xs font-semibold text-white hover:bg-slate-800",children:"ë³µì¬"})]}),F&&e.jsx("p",{className:"mt-2 text-[11px] text-slate-600",role:"status",children:F}),w.isPublic&&p&&e.jsxs("p",{className:"mt-2 text-[11px] text-indigo-700 break-keep","data-share-comment-summary":"1",children:["ð¬ ",p," â ìì
ì ì´ë©´ ê²°ê³¼ íë©´ ìë¨ìì íì¸Â·ë°ì ì²ë¦¬í ì ìì´ì."]})]}),e.jsxs("p",{className:"text-sm text-slate-600 mb-4",children:["ëë í리ìºë²ì¤ ì¬ì©ììê² í¸ì§ ê¶íì¼ë¡ ê³µì í ì ìì´ì. ê³µì í ì¬ì©ìì ì´ë©ì¼ì ì
ë ¥íì¸ì.",e.jsx("br",{}),e.jsx("span",{className:"text-xs text-slate-500",children:"⻠구ë
ì¤ì¸ ì¬ì©ììê²ë§ ê³µì í ì ììµëë¤."}),e.jsx("br",{}),e.jsx("span",{className:"text-xs text-amber-600",children:"â» í ëª
ê³¼ë§ ê³µì ê°ë¥í©ëë¤."})]}),e.jsx("input",{type:"email",value:c,onChange:k=>i(k.target.value),placeholder:"[email protected]",disabled:b||m,className:"w-full px-4 py-2 border border-slate-300 rounded-lg mb-4 focus:outline-none focus:ring-2 focus:ring-[#48A9A6] focus:border-[#48A9A6] disabled:opacity-50 disabled:cursor-not-allowed"}),(b||m)&&e.jsxs("div",{className:"mb-4 text-sm text-[#48A9A6] flex items-center gap-2",children:[e.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),b?"ì¬ì©ì ê²ì¦ ì¤...":"ê³µì ì¤..."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:j,disabled:b||m,className:"flex-1 px-4 py-2 bg-slate-200 text-slate-700 rounded-lg hover:bg-slate-300 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"ì·¨ì"}),e.jsx("button",{onClick:h,disabled:!c||b||m,className:"flex-1 px-4 py-2 bg-[#48A9A6] text-white rounded-lg hover:bg-[#3D908D] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:m?"ê³µì ì¤...":b?"ê²ì¦ ì¤...":"ê³µì "})]})]})})},nt=({projects:s,videoTranslationJobs:l=[],onDeleteVideoJob:o,onLoadProject:c,onDeleteProject:i,onRestoreProject:m,onPurgeProject:u,onEditProject:b,currentUser:r,onPrepareReuse:N,onApplyReuse:w,onToggleFavorite:f,onBack:D,onNewProject:E,onShare:F,isLoading:x,sharedProjects:p=[],initialFilter:M="all",detailEditorImportMode:P=!1})=>
2{const[j,A]=d.useState(M),[O,R]=d.useState(""),[h,k]=d.useState("all"),[y,W]=d.useState(!1),[K,ie]=d.useState("updated"),[H,ne]=d.useState("grid"),[de,oe]=d.useState(null),[ce,me]=d.useState([]),[xe,he]=d.useState(""),[V,X]=d.useState(s.length===0&&p.length>0?"shared":"mine"),[ue,ee]=d.useState(null),ge=()=>{ie("updated"),ne("grid"),R(""),k("all"),W(!1),A("all")},Ee=async t=>{if(!(!f||ce.includes(t.id))){me(a=>[...a,t.id]),he("");try{await f(t)}catch{he("ì¦ê²¨ì°¾ê¸°ë¥¼ ì ì¥íì§ ëª»íìµëë¤. 기존 ìí를 ì ì§íìµëë¤. ë¤ì ìëí´ ì£¼ì¸ì.")}finally{me(a=>a.filter(n=>n!==t.id))}}};d.useEffect(()=>{A(M)},[M]),d.useEffect(()=>{V==="mine"&&s.length===0&&p.length>0?X("shared"):V==="shared"&&p.length===0&&s.length>0&&X("mine")},[V,s.length,p.length]);const Y=d.useCallback(t=>{var v;const a=S(t),n=((v=t.productInfo)==null?void 0:v.pageType)||"general";return a==="detail-editor"||n==="general"||n==="clothing"||n==="fresh-produce"},[]),_=O.trim().toLowerCase(),be=d.useCallback(t=>{var n,v,U,$,T;return _?[t.name,(n=t.productInfo)==null?void 0:n.name,(v=t.productInfo)==null?void 0:v.description,(U=t.linkImportSummary)==null?void 0:U.title,(T=($=t.detailBlockEditorDraft)==null?void 0:$.importedDocument)==null?void 0:T.pageTitle].filter(Boolean).join(" ").toLowerCase().includes(_):!0},[_]),Q=d.useMemo(()=>{let t;return j==="video-translation"?[]:(j==="all"?t=s:j==="detail-editor"?t=s.filter(a=>P?Y(a):S(a)==="detail-editor"):j==="link-import"?t=s.filter(a=>S(a)==="link-import"):t=s.filter(a=>{var n;return(((n=a.productInfo)==null?void 0:n.pageType)||"general")===j&&S(a)!=="detail-editor"}),_e(t.filter(be),{status:h,favoritesOnly:y,sort:K}))},[s,j,P,Y,be,h,y,K]),te=d.useMemo(()=>_?l.filter(t=>[t.fileName,t.selectedVideoUrl,t.sourceUrl].filter(Boolean).join(" ").toLowerCase().includes(_)):l,[l,_]),L=d.useMemo(()=>({all:s.length,general:s.filter(t=>{var a,n;return(((a=t.productInfo)==null?void 0:a.pageType)==="general"||!((n=t.productInfo)!=null&&n.pageType))&&S(t)!=="detail-editor"}).length,clothing:s.filter(t=>{var a;return((a=t.productInfo)==null?void 0:a.pageType)==="clothing"&&S(t)!=="detail-editor"}).length,freshProduce:s.filter(t=>{var a;return((a=t.productInfo)==null?void 0:a.pageType)==="fresh-produce"&&S(t)!=="detail-editor"}).length,cardnews:s.filter(t=>{var a;return((a=t.productInfo)==null?void 0:a.pageType)==="cardnews"&&S(t)!=="detail-editor"}).length,thumbnail:s.filter(t=>{var a;return((a=t.productInfo)==null?void 0:a.pageType)==="thumbnail"&&S(t)!=="detail-editor"}).length,detailEditor:s.filter(t=>P?Y(t):S(t)==="detail-editor").length,linkImport:s.filter(t=>S(t)==="link-import").length,videoTranslation:l.length}),[s,P,Y,l.length]),pe=d.useMemo(()=>({mine:s.length,shared:p.length}),[s.length,p.length]),fe=d.useCallback(t=>{var n,v,U,$,T,z,C,G;if(t.images.length>0)return[t.images.find(g=>g.status==="completed")||t.images[0]].map(g=>({id:g.id,type:"generated",img:g,alt:g.sectionTitle}));if(S(t)==="link-import"){const g=(n=t.originalImageStoragePaths)==null?void 0:n[0],ve=((v=t.originalImagesUrls)==null?void 0:v[0])||((U=t.linkImportSummary)==null?void 0:U.thumbnailUrl);return g||ve?[{id:`${t.id}-link-import-preview`,type:"stored",storagePath:g,dataUrl:g?void 0:ve,alt:(($=t.linkImportSummary)==null?void 0:$.title)||t.name||"ë§í¬ ì´ì ì´ë¯¸ì§"}]:[]}if(S(t)!=="detail-editor")return[];const a=((C=(z=(T=t.detailBlockEditorDraft)==null?void 0:T.importedDocument)==null?void 0:z.blocks)==null?void 0:C.filter(g=>g.type==="image").slice(0,1))||[];return a.length>0?a.map(g=>({id:g.id,type:"stored",storagePath:g.storagePath,dataUrl:g.dataUrl,alt:g.name||"ìì¸ í¸ì§ ì´ë¯¸ì§"})):(((G=t.detailBlockEditorDraft)==null?void 0:G.referenceImages)||[]).slice(0,1).map(g=>({id:g.id,type:"stored",storagePath:g.storagePath,dataUrl:g.dataUrl,alt:g.name}))},[]),[q,we]=d.useState(null),se=d.useCallback(async(t,a)=>{we(t);try{const n=await I(t,!0);await We(n,a)==="opened"&&B('ë°ë¡ ì ì¥ì´ ë§í ì íì¼ë¡ ì´ììµëë¤. ìììì ë§ì°ì¤ ì¤ë¥¸ìª½ ë²í¼ â "ëììì ë¤ë¥¸ ì´ë¦ì¼ë¡ ì ì¥"ì¼ë¡ ë°ì주ì¸ì.')}catch(n){console.error("ìì ë²ì ìì
ë¤ì´ë¡ë ì¤í¨:",n),B("ë¤ì´ë¡ëì ì¤í¨íìµëë¤. ì ì í ë¤ì ìëí´ì£¼ì¸ì.")}finally{we(null)}},[]);if(x)return e.jsxs("div",{className:"max-w-6xl mx-auto px-3 sm:px-4",children:[e.jsxs("div",{role:"status",className:"text-center py-12",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-[#48A9A6]"}),e.jsx("p",{className:"mt-4 text-slate-600 break-keep",children:"ìì
ë´ì ë¶ë¬ì¤ë ì¤..."})]}),e.jsx("div",{"aria-hidden":"true",className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[0,1,2].map(t=>e.jsx("div",{className:"h-80 animate-pulse rounded-2xl border border-slate-100 bg-slate-100 motion-reduce:animate-none"},t))})]});if(s.length===0&&l.length===0&&(!p||p.length===0))return e.jsx("div",{className:"max-w-6xl mx-auto px-3 sm:px-4",children:e.jsxs("div",{className:"text-center py-16 bg-gradient-to-b from-[#F0F8F7] to-white rounded-3xl shadow-sm border border-[#D6E8E6] px-6",children:[e.jsx("svg",{className:"mx-auto h-12 w-12 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),e.jsx("h3",{className:"mt-4 text-base sm:text-lg font-medium text-slate-900 break-keep",children:"ì ì¥ë ìì
ì´ ììµëë¤"}),e.jsxs("p",{className:"mt-2 text-sm text-slate-500 break-keep leading-relaxed",children:["ì í ì¬ì§ì´ë ìí ë§í¬ë¡ 첫 ìì¸íì´ì§ë¥¼ ë§ë¤ì´ë³´ì¸ì.",e.jsx("br",{}
2),"ìì±í ìì
ì ì¬ê¸°ì 모ì ë³´ê³ , ë¤ì ìíì ì¬ì¬ì©í ì ìì´ì."]}),(E||D)&&e.jsxs("button",{onClick:E||D,className:"mt-5 inline-flex items-center gap-2 px-4 py-2 bg-gradient-to-r from-[#48A9A6] to-[#327674] text-white text-sm font-medium rounded-lg hover:from-[#3D908D] hover:to-[#285D5B] transition-colors shadow-sm break-keep",children:[e.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"ìë¡ì´ ì í ë§ë¤ê¸°"]})]})});const Z=t=>re(t)?new Intl.DateTimeFormat("ko-KR",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t):"ë ì§ ì ë³´ ìì",ke=(t,a)=>{const n=S(t);return P?n==="detail-editor"?"í¸ì§ ê³ì":"í¸ì§ì¼ë¡ ì´ê¸°":n==="link-import"?"ì´ì ì´ì´ì":n==="detail-editor"?"í¸ì§ ê³ì":a?"ê³ìí기":"ë¶ë¬ì¤ê¸°"};return e.jsxs("div",{className:"max-w-6xl mx-auto px-3 sm:px-4",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"inline-flex items-center gap-1 p-1 rounded-xl bg-[#F1EAE5]/80 border border-slate-300",children:[e.jsxs("button",{onClick:()=>X("mine"),className:`px-3 sm:px-4 py-2 rounded-lg text-sm font-medium transition-all ${V==="mine"?"bg-white border border-slate-300 shadow-sm text-slate-900":"text-slate-600 hover:text-slate-900"}`,children:["ë´ ìì
",e.jsx("span",{className:`ml-2 px-2 py-0.5 rounded-full text-xs ${V==="mine"?"bg-[#DEF0EF] text-[#285D5B]":"bg-slate-200 text-slate-600"}`,children:pe.mine})]}),e.jsxs("button",{onClick:()=>X("shared"),className:`px-3 sm:px-4 py-2 rounded-lg text-sm font-medium transition-all ${V==="shared"?"bg-white border border-slate-300 shadow-sm text-slate-900":"text-slate-600 hover:text-slate-900"}`,children:["ê³µì ë°ì ìì
",e.jsx("span",{className:`ml-2 px-2 py-0.5 rounded-full text-xs ${V==="shared"?"bg-[#DEF0EF] text-[#285D5B]":"bg-slate-200 text-slate-600"}`,children:pe.shared})]})]})}),V==="mine"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:mb-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-slate-900 break-keep",children:"ë´ ìì
ë´ì"}),P&&e.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"í¸ì§í ìì
ì ì ííì¸ì."})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 sm:gap-3",children:[D&&e.jsxs("button",{onClick:D,className:"flex items-center justify-center gap-2 px-3 sm:px-4 py-2 text-sm font-medium text-slate-700 hover:text-[#3D908D] transition-colors break-keep whitespace-nowrap",children:[e.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),e.jsx("span",{className:"break-keep",children:"ëìê°ê¸°"})]}),E&&e.jsxs("button",{onClick:E,className:"flex items-center justify-center gap-2 px-3 sm:px-4 py-2 bg-gradient-to-r from-[#48A9A6] to-[#327674] text-white text-sm font-medium rounded-lg hover:from-[#3D908D] hover:to-[#285D5B] transition-colors shadow-sm break-keep whitespace-nowrap",children:[e.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),e.jsx("span",{className:"break-keep",children:"ì ìì
ë§ë¤ê¸°"})]})]})]}),e.jsx(Ke,{query:O,onQuery:R,type:j,onType:A,typeOptions:[{value:"all",label:"ì ì²´ ìì
",count:L.all},{value:"general",label:"ì¼ë°",count:L.general},{value:"clothing",label:"ìë¥",count:L.clothing},{value:"fresh-produce",label:"ê³¼ì¼/ì±ì",count:L.freshProduce},{value:"cardnews",label:"ì¹´ëë´ì¤",count:L.cardnews},{value:"thumbnail",label:"ì¸ë¤ì¼",count:L.thumbnail},{value:"detail-editor",label:P?"í¸ì§ ê°ë¥":"ìì¸í¸ì§",count:L.detailEditor},{value:"link-import",label:"ë§í¬ ì´ì",count:L.linkImport},{value:"video-translation",label:"ìì",count:L.videoTranslation}],status:h,onStatus:k,favoritesOnly:y,onFavorites:W,sort:K,onSort:ie,view:H,onView:ne,count:j==="video-translation"?te.length:Q.length,total:j==="video-translation"?L.videoTranslation:s.length,onReset:ge}),xe&&e.jsx("p",{role:"alert",className:"mb-4 rounded-xl bg-red-50 p-3 text-sm text-red-700",children:xe}),h==="trash"&&j!=="video-translation"&&e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900","data-trash-limit-hint":"1",children:[e.jsx("p",{className:"min-w-0 flex-1 break-keep",children:"ì ìì
íëë ì´ë¯¸ì§ íì¼ì´ ì°¨ì§íë ì ì¥ ê³µê° ê¸°ì¤ì´ë¼, í´ì§íµì ìë ìì
ë íì¼ì´ ë¨ì ìë ëìì ì´ë² ë¬ ìì
ìì í¬í¨ë¼ì. ãì구 ìì ãë¡ íì¼ê¹ì§ ì§ì°ë©´ ê·¸ë§í¼ ë¤ì ë§ë¤ ì ìê³ , 30ì¼ì´ ì§ëë©´ ìëì¼ë¡ ì구 ìì ë©ëë¤."}),u&&Q.length>0&&e.jsxs("button",{type:"button",onClick:async()=>{const t=Q.map(a=>a.id);await J({title:`í´ì§íµì ë¹ì¸ê¹ì? (${t.length}ê°)`,message:"목ë¡ì ë³´ì´ë ìì
ì´ ëª¨ë ì구 ìì ëë©° ëë릴 ì ììµëë¤.",confirmLabel:"모ë ì구 ìì ",danger:!0})&&t.forEach(a=>u(a))},className:"flex-shrink-0 rounded-lg bg-red-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-red-700","data-trash-empty":"1",children:["í´ì§íµ ë¹ì°ê¸° (",Q.length,"ê°)"]})]}),j==="video-translation"?te.length===0?e.jsxs("div",{className:"text-center py-12 bg-[#FCFAF8] rounded-2xl shadow-sm border border-slate-300 px-4",children:[e.jsx("h3",{className:"mt-1 text-base sm:text-lg font-medium text-slate-900 break-keep",children:_?"ê²ì ê²°ê
2³¼ê° ììµëë¤":"ì ì¥ë ìì ìì
ì´ ììµëë¤"}),e.jsx("p",{className:"mt-2 text-sm text-slate-500 break-keep leading-relaxed",children:_?"ë¤ë¥¸ ê²ìì´ë¥¼ ì
ë ¥íê±°ë ê²ìì´ë¥¼ ì§ìë³´ì¸ì.":'"1688 ìì ë²ì" íì´ë ê²°ê³¼ íë©´ì "ì¼ì¸ ë§ë¤ê¸°"ë¡ ììì ë§ë¤ë©´ ì¬ê¸°ì 기ë¡ë©ëë¤.'})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:te.map(t=>{const a=t.status==="completed"&&!!t.storagePath,n=t.status==="completed"?"bg-[#DEF0EF] text-[#285D5B]":t.status==="failed"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700";return e.jsxs("div",{className:"bg-[#FCFAF8] rounded-lg shadow-sm border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-base font-semibold text-slate-900 break-keep",children:t.fileName||(t.kind==="shorts"?"ìì¸íì´ì§ ì¼ì¸ ":"1688 ìì ë²ì")}),t.selectedVideoUrl&&e.jsx("div",{className:"text-xs text-slate-500 mt-1 truncate",title:t.selectedVideoUrl,children:t.selectedVideoUrl})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[t.kind==="shorts"?e.jsx("span",{className:"px-2 py-1 bg-violet-600 text-white text-xs font-medium rounded-full whitespace-nowrap",children:"ì¼ì¸ "}):e.jsx("span",{className:"px-2 py-1 bg-slate-900 text-white text-xs font-medium rounded-full whitespace-nowrap",children:"1688 ìì"}),e.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded-full whitespace-nowrap ${n}`,children:t.status==="completed"?"ìë£":t.status==="failed"?"ì¤í¨":"ì§í ì¤"})]})]}),e.jsxs("div",{className:"text-xs text-slate-600 space-y-1",children:[t.kind==="shorts"?e.jsxs("div",{children:["ìì¸íì´ì§ ì´ë¯¸ì§ë¡ ë§ë ì¸ë¡í ì¼ì¸ ìì",typeof t.duration=="number"?` · ì½ ${Math.round(t.duration)}ì´`:""]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["í
í릿: ",t.template==="shortsHeadline"?"ì¼ì¸ í¤ëë¼ì¸":"ì문 ìë§í"]}),e.jsxs("div",{children:["ëë¹: ",t.koreanDubbingEnabled?"íêµì´ ëë¹ ì¬ì©":"ëë¹ ìì"]})]}),e.jsxs("div",{children:["ìì : ",Z(t.updatedAt)]})]}),a?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:()=>se(t.storagePath,`${t.fileName||"1688-video"}.mp4`),disabled:q!==null,className:"px-3 py-2 bg-[#48A9A6] text-white text-sm font-medium rounded-lg hover:bg-[#3D908D] transition-colors disabled:cursor-not-allowed disabled:opacity-60",children:q===t.storagePath?"ì ì¥ ì¤...":"MP4 ë¤ì´ë¡ë"}),t.srtStoragePath&&e.jsx("button",{onClick:()=>se(t.srtStoragePath,`${t.fileName||"1688-video"}.srt`),disabled:q!==null,className:"px-3 py-2 bg-slate-100 text-slate-700 text-sm font-medium rounded-lg hover:bg-slate-200 transition-colors disabled:cursor-not-allowed disabled:opacity-60",children:q===t.srtStoragePath?"ì ì¥ ì¤...":"SRT"}),t.vttStoragePath&&e.jsx("button",{onClick:()=>se(t.vttStoragePath,`${t.fileName||"1688-video"}.vtt`),disabled:q!==null,className:"px-3 py-2 bg-slate-100 text-slate-700 text-sm font-medium rounded-lg hover:bg-slate-200 transition-colors disabled:cursor-not-allowed disabled:opacity-60",children:q===t.vttStoragePath?"ì ì¥ ì¤...":"VTT"}),o&&e.jsx("button",{onClick:async()=>{await J({title:"ì´ ìì ìì
ì ìì í ê¹ì?",message:"ì ì¥ë MP4ì ìë§ íì¼ë í¨ê» ìì ëë©° ëë릴 ì ììµëë¤.",confirmLabel:"ìì ",danger:!0})&&o(t.id)},className:"ml-auto px-3 py-2 bg-slate-100 text-slate-700 text-sm font-medium rounded-lg hover:bg-slate-200 transition-colors",children:"ìì "})]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.status==="failed"?e.jsx("p",{className:"flex-1 min-w-0 text-xs text-red-600 break-keep leading-relaxed",children:'ìì ìì±ì ì¤í¨íìµëë¤. ìì
íë©´ì "1688 ìì ë²ì" íìì ê°ì ë§í¬ë¡ ë¤ì ìëí´ì£¼ì¸ì.'}):e.jsx("p",{className:"flex-1 min-w-0 text-xs text-amber-700 break-keep leading-relaxed",children:"ìì ìì±ì´ ì§í ì¤ì
ëë¤. ìë£ëë©´ ì´ ì¹´ëìì MP4를 ë´ë ¤ë°ì ì ììµëë¤."}),o&&e.jsx("button",{onClick:async()=>{await J({title:"ì´ ìì ìì
기ë¡ì ìì í ê¹ì?",message:"ëë릴 ì ììµëë¤.",confirmLabel:"ìì ",danger:!0})&&o(t.id)},className:"px-3 py-2 bg-slate-100 text-slate-700 text-sm font-medium rounded-lg hover:bg-slate-200 transition-colors flex-shrink-0",children:"ìì "})]})]}),(t.framePreviewStoragePath||t.thumbnailUrl)&&e.jsx("div",{className:"p-2 bg-slate-50",children:e.jsx("div",{className:"aspect-square bg-slate-200 rounded overflow-hidden",children:e.jsx(le,{storagePath:t.framePreviewStoragePath,dataUrl:t.framePreviewStoragePath?void 0:t.thumbnailUrl,alt:t.fileName||"1688 ìì 미리보기"})})})]},t.id)})}):Q.length===0?e.jsxs("div",{className:"text-center py-12 bg-[#FCFAF8] rounded-2xl shadow-sm border border-slate-300 px-4",children:[e.jsx("svg",{className:"mx-auto h-12 w-12 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),e.jsx("h3",{className:"mt-4 text-base sm:text-lg font-medium text-slate-900 break-keep",children:y?"ì¡°ê±´ì ë§ë ì¦ê²¨ì°¾ê¸°ê° ììµëë¤":"ì¡°ê±´ì ë§ë ìì
ì´ ììµëë¤"}),e.jsx("p",{className:"mt-2 text-sm text-slate-500 break-keep leading-relaxed",children:_?"ë¤ë¥¸ ê²ìì´ë¥¼ ì
ë ¥íê±°ë ê²ìì´ë¥¼ ì§ìë³´ì¸ì.":y?"ì주 ì°ë ìì
ì ë³ì ëë¬ ëª¨ì ëì¸ì. ë¤ë¥¸ íí°ê° ì íëì´ ìë¤ë©´ ì´ê¸°íí´ ë³´ì¸ì.":"ìíë ìì
ì íì ë°ê¾¸ì´ ë³´ì¸ì. ì ì¥ë ìì
ì ê·¸ëë¡ ì ì§ë©ëë¤."}),e.jsx("button",{type:"button",onClick:ge,className:"mt-4 rounded-xl bg-[#285D5B] px-5 py-3 text-sm font-medium text-white hover:bg-[#1D4745]",children:"ì ì²´ ìì
보기"})]}):e.jsx("div",{className:H==="grid"?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5":"grid grid-cols-1 gap-4",children:Q.map(t=>{var C,G;const a=S(t),n=je(t),v=t.status==="in-progress",{completed:U,total:$,percent:T}=ze(t),z=fe(t);return e.jsxs("div",{role:"article","aria-label":t.name,className:`flex min-w-0 flex-col bg-white rounded-2xl shadow-sm border hover:shadow-md transition-shadow overflow-hidden ${H==="list"?"sm:flex-row":""} ${v?"border-[#A7D6D4]":"border-slate-200"}`,children:[e.jsxs("div",{className:"order-2 flex min-w-0 flex-1 flex-col p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2 gap-2",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-slate-900 break-words flex-1 min-w-0",children:t.name}),f&&(r==null?void 0:r.uid)===t.userId&&e.jsx("button",{type:"button","aria-label":`${t.name}
2 ì¦ê²¨ì°¾ê¸°`,"aria-pressed":t.isFavorite===!0,disabled:ce.includes(t.id),onClick:()=>void Ee(t),className:`-mt-1 flex h-10 w-10 shrink-0 items-center justify-center rounded-xl transition-colors disabled:opacity-40 ${t.isFavorite?"bg-amber-50 text-amber-600":"text-slate-400 hover:bg-slate-50 hover:text-amber-600"}`,children:e.jsx("svg",{"aria-hidden":"true",className:"h-5 w-5",viewBox:"0 0 24 24",fill:t.isFavorite?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.7",children:e.jsx("path",{strokeLinejoin:"round",d:"m12 3 2.8 5.7 6.3.9-4.55 4.43 1.07 6.27L12 17.34 6.38 20.3l1.07-6.27L2.9 9.6l6.3-.9L12 3Z"})})})]}),e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-1.5",children:[a==="generated"&&e.jsx("span",{className:"rounded-md bg-slate-100 px-2 py-1 text-xs text-slate-600",children:{general:"ì¼ë° ìì¸",clothing:"ìë¥","fresh-produce":"ê³¼ì¼Â·ì±ì",cardnews:"ì¹´ëë´ì¤",thumbnail:"ì¸ë¤ì¼"}[((C=t.productInfo)==null?void 0:C.pageType)||"general"]||"ìì¸íì´ì§"}),t.status==="failed"&&e.jsx("span",{className:"rounded-md bg-red-50 px-2 py-1 text-xs text-red-700",children:"ì¤í¨ · íì¸ íì"}),!v&&t.status!=="failed"&&a!=="link-import"&&e.jsx("span",{className:"rounded-md bg-[#F0F8F7] px-2 py-1 text-xs text-[#285D5B]",children:"ìë£"}),e.jsxs("div",{className:"flex flex-wrap gap-1 justify-end",children:[a==="detail-editor"&&e.jsx("span",{className:"px-2 py-1 bg-slate-900 text-white text-xs font-medium rounded-full whitespace-nowrap flex-shrink-0",children:"ìì¸ í¸ì§"}),a==="link-import"&&e.jsx("span",{className:"px-2 py-1 bg-blue-100 text-blue-700 text-xs font-medium rounded-full whitespace-nowrap flex-shrink-0",children:"ë§í¬ ì´ì"}),v&&e.jsx("span",{className:"px-2 py-1 bg-[#DEF0EF] text-[#285D5B] text-xs font-medium rounded-full whitespace-nowrap flex-shrink-0",children:"ì§í ì¤"}),t.sharedWith&&t.sharedWith.length>0&&e.jsxs("span",{className:"px-2 py-1 bg-[#F1EAE5] text-slate-700 text-xs font-medium rounded-full whitespace-nowrap flex-shrink-0",children:["ê³µì ì¤ (",t.sharedWith.length,")"]})]})]}),e.jsx("p",{className:"text-sm text-slate-600 mb-4 line-clamp-2 break-keep leading-relaxed",children:a==="detail-editor"?(n==null?void 0:n.pageTitle)||"기존 ìì¸íì´ì§ë¥¼ ë¸ë¡ ë¨ìë¡ í¸ì§í ìì
ì
ëë¤.":a==="link-import"?((G=t.linkImportSummary)==null?void 0:G.title)||t.productInfo.name||"ë§í¬ìì ê°ì ¸ì¨ ì´ìì
ëë¤.":t.productInfo.description||"ì¤ëª
ìì"}),a==="generated"&&H==="grid"&&e.jsx(De,{productInfo:t.productInfo}),a==="generated"&&e.jsx(Fe,{productInfo:t.productInfo}),v&&e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-600 mb-1 break-keep",children:[e.jsx("span",{children:"ìì± ì§íë¥ "}),e.jsxs("span",{className:"whitespace-nowrap ml-2",children:[U,"/",$]})]}),e.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:e.jsx("div",{className:"bg-[#48A9A6] h-2 rounded-full transition-all duration-300",style:{width:`${T}%`}})})]}),e.jsxs("div",{className:"flex flex-col gap-1 text-xs text-slate-500 mb-4 break-keep",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1",children:[e.jsxs("span",{className:"break-keep",children:["ìì : ",Z(t.updatedAt)]}),e.jsx("span",{className:"whitespace-nowrap",children:a==="detail-editor"?`ë¸ë¡ ${(n==null?void 0:n.blockCount)||0}ê°`:a==="link-import"?"ë§í¬ ê°ì ¸ì¤ê¸° ì´ì":v?`${U}ê° ìë£`:`${t.images.length}ê° ì´ë¯¸ì§`})]}),a==="detail-editor"&&n&&e.jsxs("div",{className:"text-xs text-slate-500 break-keep",children:["ì´ë¯¸ì§ ",n.imageBlockCount,"ê° Â· í
ì¤í¸ ",n.textBlockCount,"ê°"]}),t.lastEditedBy&&t.lastEditedBy!==(r==null?void 0:r.email)&&e.jsxs("div",{className:"text-xs text-amber-600 break-keep",children:["ë§ì§ë§ í¸ì§: ",t.lastEditedBy,t.lastEditedAt&&` (${Z(t.lastEditedAt)})`]}),t.sharedWith&&t.sharedWith.length>0&&e.jsxs("div",{className:"text-xs text-[#3D908D] break-keep",children:["ê³µì ëì: ",t.sharedWith.join(", ")]})]}),e.jsxs("div",{className:"mt-auto flex flex-col gap-2 border-t border-slate-100 pt-3",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:()=>c(t),className:"flex-1 min-w-[8rem] px-3 sm:px-4 py-2 bg-[#48A9A6] text-white text-sm font-medium rounded-lg hover:bg-[#3D908D] transition-colors break-keep",children:ke(t,v)}),!P&&N&&w&&r&&Le(t,r.uid)&&e.jsx("button",{type:"button",onClick:()=>oe(t),className:"flex-1 min-w-[8rem] rounded-lg border border-[#B5DCDA] bg-[#F0F8F7] px-3 py-2 text-sm font-semibold text-[#285D5B] hover:bg-[#DEF0EF]",children:"ìë¡ ë§ë¤ê¸°"})]}),e.jsxs("details",{className:"group rounded-lg",children:[e.jsx("summary",{"aria-label":`${t.name} ì¶ê° ìì
`,className:"cursor-pointer rounded-lg px-2 py-2 text-xs font-medium text-slate-500 hover:bg-slate-50",children:"ì ë³´ ìì · ê³µì · ìì "}),e.jsxs("div",{className:"flex flex-wrap gap-2 py-2",children:[r&&t.userId===r.uid&&e.jsx(e.Fragment,{children:t.sharedWith&&t.sharedWith.length>0?e.jsxs("button",{onClick:async()=>{try{await Ue(t.id,r.uid),B("ê³µì ê° í´ì ëììµëë¤."),F&&F()}catch(g){console.error("ê³µì í´ì ì¤í¨:",g),B("ê³µì í´ì ì ì¤í¨íìµëë¤: "+(g instanceof Error?g.message:"ì ì ìë ì¤ë¥"))}},className:"px-3 sm:px-4 py-2 bg-red-100 text-red-700 text-sm font-medium rounded-lg hover:bg-red-200 transition-colors whitespace-nowrap break-keep",title:"ê³µì í´ì ",children:[e.jsx("svg",{className:"w-4 h-4 inline-block mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})}),"ê³µì í´ì "]}):e.jsxs("button",{onClick:()=>ee(t),className:"px-3 sm:px-4 py-2 bg-[#DEF0EF] text-[#285D5B] text-sm font-medium rounded-lg hover:bg-[#C3E3E2] transition-colors whitespace-nowrap break-keep",title:"íë¡ì í¸ ê³µì ",children:[e.jsx("svg",{className:"w-4 h-4 inline-block mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.3
216m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),"ê³µì "]})}),t.deletedAt?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>m==null?void 0:m(t.id),className:"px-3 sm:px-4 py-2 bg-emerald-100 text-emerald-800 text-sm font-medium rounded-lg hover:bg-emerald-200 transition-colors",title:"í´ì§íµìì êº¼ë´ ìë 목ë¡ì¼ë¡ ëë립ëë¤",children:"복구"}),e.jsx("button",{onClick:async()=>{await J({title:`"${t.name}"ì(를) ì구 ìì í ê¹ì?`,message:"ì´ë¯¸ì§ì ë´ì©ì´ 모ë ì¬ë¼ì§ë©° ëë릴 ì ììµëë¤.",confirmLabel:"ì구 ìì ",danger:!0})&&(u==null||u(t.id))},className:"px-3 sm:px-4 py-2 bg-red-100 text-red-700 text-sm font-medium rounded-lg hover:bg-red-200 transition-colors",children:"ì구 ìì "})]}):e.jsx("button",{onClick:()=>{i(t.id)},className:"px-3 sm:px-4 py-2 bg-slate-100 text-slate-700 text-sm font-medium rounded-lg hover:bg-slate-200 transition-colors",title:"í´ì§íµì¼ë¡ ì´ë (30ì¼ ìì 복구 ê°ë¥)",children:"ìì "})]}),b&&e.jsx("button",{onClick:()=>b(t),className:"w-full px-3 sm:px-4 py-2 bg-[#F8F4F1] text-slate-700 text-sm font-medium rounded-lg hover:bg-[#F1EAE5] transition-colors border border-slate-300 break-keep",children:"ì ë³´ ìì "})]})]})]}),z.length>0?e.jsx("div",{className:`order-1 bg-slate-50 ${H==="list"?"w-full shrink-0 sm:relative sm:w-52":""}`,children:z.map(g=>e.jsx("div",{className:`overflow-hidden bg-slate-100 [&_img]:object-top ${H==="list"?"aspect-[16/9] sm:absolute sm:inset-0 sm:aspect-auto":"aspect-[16/10]"}`,children:g.type==="generated"?e.jsx(Ce,{img:g.img,alt:g.alt,projectId:t.id,userId:t.userId}):e.jsx(le,{storagePath:g.storagePath,dataUrl:g.dataUrl,alt:g.alt})},g.id))}):e.jsx("div",{className:`order-1 flex items-center justify-center bg-gradient-to-br from-[#F0F8F7] to-slate-50 text-sm text-slate-400 ${H==="list"?"h-32 w-full shrink-0 sm:h-auto sm:w-52":"aspect-[16/10]"}`,children:e.jsx("span",{children:a==="link-import"?"ë§í¬ìì ê°ì ¸ì¨ ìí":v?"ì´ë¯¸ì§ ì¤ë¹ ì¤":"미리보기 ìì"})})]},t.id)})})]}),V==="shared"&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("svg",{className:"w-6 h-6 text-[#48A9A6]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),e.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-slate-900 break-keep",children:"ê³µì ë°ì íë¡ì í¸"}),e.jsxs("span",{className:"px-2 py-1 bg-[#DEF0EF] text-[#285D5B] text-xs font-medium rounded-full",children:[p.length,"ê°"]})]}),e.jsx("p",{className:"text-sm text-slate-600 break-keep",children:"ê³µì ë°ì íë¡ì í¸ë¥¼ ì´ì´ë³´ê³ íìíë©´ ë´ ìì
ì¼ë¡ ì ì¥íì¸ì."})]}),p.length===0?e.jsxs("div",{className:"text-center py-12 bg-[#FCFAF8] rounded-2xl shadow-sm border border-slate-300 px-4",children:[e.jsx("svg",{className:"mx-auto h-12 w-12 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),e.jsx("h3",{className:"mt-4 text-base sm:text-lg font-medium text-slate-900 break-keep",children:"ê³µì ë°ì íë¡ì í¸ê° ììµëë¤"}),e.jsx("p",{className:"mt-2 text-sm text-slate-500 break-keep leading-relaxed",children:"íìì´ íë¡ì í¸ë¥¼ ê³µì íë©´ ì´ íì íìë©ëë¤."})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map(t=>{var T,z;const a=S(t),n=je(t),v=t.status==="in-progress",U=t.images.filter(C=>C.status==="completed").length;(T=t.plan)!=null&&T.length||t.images.length;const $=fe(t);return e.jsxs("div",{className:`bg-[#FCFAF8] rounded-lg shadow-sm border hover:shadow-md transition-shadow overflow-hidden ${v?"border-[#A7D6D4] ring-2 ring-[#DEF0EF]":"border-slate-200"}`,children:[e.jsxs("div",{className:"p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2 gap-2",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-slate-900 break-keep flex-1 min-w-0",children:t.name}),e.jsxs("div",{className:"flex flex-wrap gap-1 justify-end",children:[a==="detail-editor"&&e.jsx("span",{className:"px-2 py-1 bg-slate-900 text-white text-xs font-medium rounded-full whitespace-nowrap flex-shrink-0",children:"ìì¸ í¸ì§"}),a==="link-import"&&e.jsx("span",{className:"px-2 py-1 bg-blue-100 text-blue-700 text-xs font-medium rounded-full whitespace-nowrap flex-shrink-0",children:"ë§í¬ ì´ì"}),e.jsx("span",{className:"ml-2 px-2 py-1 bg-[#DEF0EF] text-[#285D5B] text-xs font-medium rounded-full whitespace-nowrap flex-shrink-0",children:"ê³µì ë¨"})]})]}),e.jsx("p",{className:"text-sm text-slate-600 mb-4 line-clamp-2 break-keep leading-relaxed",children:a==="detail-editor"?(n==null?void 0:n.pageTitle)||"기존 ìì¸íì´ì§ í¸ì§ ìì
ì
ëë¤.":a==="link-import"?((z=t.linkImportSummary)==null?void 0:z.title)||t.productInfo.name||"ë§í¬ìì ê°ì ¸ì¨ ì´ìì
ëë¤.":t.productInfo.description||"ì¤ëª
ìì"}),a==="generated"&&e.jsx(De,{productInfo:t.productInfo}),a==="generated"&&e.jsx(Fe,{productInfo:t.productInfo}),e.jsxs("div",{className:"flex flex-col gap-1 text-xs text-slate-500 mb-4 break-keep",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1",children:[e.jsxs("span",{className:"break-keep",children:["ìì : ",Z(t.updatedAt)]}),e.jsx("span",{className:"whitespace-nowrap",children:a==="detail-editor"?`ë¸ë¡ ${(n==null?void 0:n.blockCount)||0}
2ê°`:a==="link-import"?"ë§í¬ ê°ì ¸ì¤ê¸° ì´ì":v?`${U}ê° ìë£`:`${t.images.length}ê° ì´ë¯¸ì§`})]}),a==="detail-editor"&&n&&e.jsxs("div",{className:"text-xs text-slate-500 break-keep",children:["ì´ë¯¸ì§ ",n.imageBlockCount,"ê° Â· í
ì¤í¸ ",n.textBlockCount,"ê°"]}),t.lastEditedBy&&e.jsxs("div",{className:"text-xs text-amber-600 break-keep",children:["ë§ì§ë§ í¸ì§: ",t.lastEditedBy,t.lastEditedAt&&` (${Z(t.lastEditedAt)})`]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("button",{onClick:()=>c(t),className:"w-full px-3 sm:px-4 py-2 bg-[#48A9A6] text-white text-sm font-medium rounded-lg hover:bg-[#3D908D] transition-colors break-keep",children:ke(t,v)}),r&&e.jsxs("button",{onClick:async()=>{try{await $e(t,r.uid),B("íë¡ì í¸ê° ë´ ìì
ë´ìì ì ì¥ëììµëë¤."),F&&F()}catch(C){console.error("íë¡ì í¸ ì ì¥ ì¤í¨:",C),B("íë¡ì í¸ ì ì¥ì ì¤í¨íìµëë¤: "+(C instanceof Error?C.message:"ì ì ìë ì¤ë¥"))}},className:"w-full px-3 sm:px-4 py-2 bg-[#EFF6F6] text-[#285D5B] text-sm font-medium rounded-lg hover:bg-[#DCEBEA] transition-colors border border-[#BFDAD9] break-keep",children:[e.jsx("svg",{className:"w-4 h-4 inline-block mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),"ë´ íë¡ì í¸ë¡ ì ì¥"]})]})]}),$.length>0&&e.jsx("div",{className:"grid grid-cols-1 gap-1 p-2 bg-slate-50",children:$.map(C=>e.jsx("div",{className:"aspect-square bg-slate-200 rounded overflow-hidden",children:C.type==="generated"?e.jsx(Ce,{img:C.img,alt:C.alt,projectId:t.id,userId:t.userId}):e.jsx(le,{storagePath:C.storagePath,dataUrl:C.dataUrl,alt:C.alt})},C.id))})]},t.id)})})]}),de&&N&&w&&e.jsx(Re,{project:de,onClose:()=>oe(null),onPrepare:N,onApply:w}),ue&&e.jsx(qe,{project:ue,onClose:()=>ee(null),onShare:()=>{ee(null),F&&F()}})]})};export{nt as default};
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.