PageSourceSearch

https://01agent.ai/_next/static/chunks/1549-4b9c30a2af93df04.js

js 01agent.ai collected 2026-10-05 11:47:44 UTC 47,890 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1549],{3930:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>et});var s=a(95155),l=a(41520),r=a(12115),n=a(47650),i=a(73800),o=a(17482),c=a(59828),d=a(16291),m=a(5225),x=a(69795),p=a(36654),u=a(13630),h=a(26615),g=a(63263),f=a(8595),b=a(97776),j=a(35831),v=a(81598),y=a(90109),N=a(92033),M=a(15239),w=a(81400),_=a(92728),k=a(83861),C=a(75967),A=a(99113),S=a(15223),z=a.n(S),E=a(45026);let T={pdf:{iconPath:"/images/files/Pdf.png",label:"PDF"},doc:{iconPath:"/images/files/doc.png",label:"Word"},docx:{iconPath:"/images/files/doc.png",label:"Word"},xls:{iconPath:"/images/files/CSV.png",label:"Excel"},xlsx:{iconPath:"/images/files/CSV.png",label:"Excel"},csv:{iconPath:"/images/files/CSV.png",label:"CSV"},ppt:{iconPath:"/images/files/ppt.svg",label:"PPT"},pptx:{iconPath:"/images/files/ppt.svg",label:"PPT"},txt:{iconPath:"/images/files/txt.png",label:"TXT"},md:{iconPath:"/images/files/md.png",label:"Markdown"},json:{iconPath:"/images/files/JSON.png",label:"JSON"},xml:{iconPath:"/images/files/XML.png",label:"XML"},html:{iconPath:"/images/files/HTML.png",label:"HTML"},css:{iconPath:"/images/files/css.png",label:"CSS"},js:{iconPath:"/images/files/js.png",label:"JS"},ts:{iconPath:"/images/files/js.png",label:"TS"},jsx:{iconPath:"/images/files/jsx.png",label:"JSX"},tsx:{iconPath:"/images/files/tsx.png",label:"TSX"},py:{iconPath:"/images/files/py.png",label:"Python"},pyc:{iconPath:"/images/files/pyc.png",label:"Python"},java:{iconPath:"/images/files/JAVA.png",label:"Java"},default:{iconPath:"/images/files/doc.png",label:"文档"}},I=e=>{var t;if(!e)return T.default;let a=null==(t=e.split(".").pop())?void 0:t.toLowerCase().split("?")[0];return a&&T[a]||T.default},P=[{value:"all",label:"全部",icon:(0,s.jsx)(i.A,{className:"w-3.5 h-3.5"})},{value:w.Mt.IMAGE,label:"图片",icon:(0,s.jsx)(o.A,{className:"w-3.5 h-3.5"})},{value:w.Mt.VIDEO,label:"视频",icon:(0,s.jsx)(c.A,{className:"w-3.5 h-3.5"})},{value:w.Mt.AUDIO,label:"音频",icon:(0,s.jsx)(d.A,{className:"w-3.5 h-3.5"})},{value:w.Mt.TEXT,label:"文本",icon:(0,s.jsx)(m.A,{className:"w-3.5 h-3.5"})},{value:w.Mt.DOCUMENT,label:"文档",icon:(0,s.jsx)(m.A,{className:"w-3.5 h-3.5"})}],D=["image/jpeg","image/jpg","image/png","image/gif","image/webp","image/bmp","image/svg+xml"],O=[".jpg",".jpeg",".png",".gif",".webp",".bmp",".svg"],L=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv","text/plain","text/markdown","application/json"],V=[".pdf",".doc",".docx",".ppt",".pptx",".xls",".xlsx",".csv",".txt",".md",".json"],W=[".mp3",".wav",".m4a",".aac",".ogg",".flac",".mp4",".mov",".webm",".mkv",".avi",".m4v"],G=[...D,...O].join(","),F=[...D,"video/*",...O,".mp4",".mov",".webm",".mkv",".avi",".m4v"].join(","),U=[...D,...L,"audio/*","video/*",...O,...V,...W].join(","),X=e=>{let t=e.name||"",a=t.lastIndexOf(".");return a>=0?t.slice(a).toLowerCase():""},B=e=>e.type.startsWith("image/")||O.includes(X(e)),J="group relative overflow-visible rounded-2xl bg-transparent p-1 transition-all duration-300 ease-out hover:z-20 hover:-translate-y-1",H="aspect-square relative !bg-transparent flex items-center justify-center overflow-visible rounded-xl shadow-none transition-transform duration-300 ease-out group-hover:scale-[1.06]",Y="pointer-events-none absolute inset-3 rounded-2xl bg-[radial-gradient(circle_at_50%_50%,rgba(15,23,42,0.08),transparent_68%)] opacity-0 blur-xl transition-opacity duration-500 group-hover:opacity-100",q="max-h-[82%] max-w-[82%] rounded-lg object-contain drop-shadow-[0_10px_18px_rgba(15,23,42,0.11)] transition-transform duration-500 ease-out group-hover:scale-[1.14] group-hover:-rotate-1",R=e=>{if(!e)return"-";let t=new Date(e);if(Number.isNaN(t.getTime()))return"-";let a=e=>String(e).padStart(2,"0");return"".concat(t.getFullYear(),"-").concat(a(t.getMonth()+1),"-").concat(a(t.getDate())," ").concat(a(t.getHours()),":").concat(a(t.getMinutes()))},Q=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];
1return"reference"===e?a?{title:"添加参考图或参考视频",helper:"图片用于视觉风格与构图参考,视频还可提供动作和运镜参考",uploadTitle:"上传参考图或参考视频",uploadHint:"支持常用图片,以及 MP4、MOV、WEBM、MKV、AVI、M4V 视频",accept:F}:{title:"添加参考图片",helper:"上传你想参考的设计图片",uploadTitle:"上传用于参考的图片",uploadHint:"仅支持图片格式:PNG、JPG、JPEG、WEBP、GIF、BMP、SVG",accept:G}:t?{title:"添加素材图",helper:"上传生成内容中需要使用的图片",uploadTitle:"上传素材图",uploadHint:"仅支持图片格式:PNG、JPG、JPEG、WEBP、GIF、BMP、SVG",accept:G}:{title:"添加素材",helper:"上传生成内容里需要用到的参考素材",uploadTitle:"上传素材",uploadHint:"支持图片、音视频、PDF、Word、PPT、表格和文本等常用文件",accept:U}};function Z(e){let{folder:t,onClick:a}=e,{t:l}=(0,A.pd)();return(0,s.jsx)("div",{className:"relative overflow-visible",children:(0,s.jsx)(C.y,{title:t.name,subtitle:l("文件夹"),tags:t.tags||[],className:"min-h-[10rem] sm:min-h-[11.75rem]",onClick:a})})}function K(e){let{material:t,onDelete:a,onPreview:l,isSelected:r,onToggleSelect:n}=e,{t:i}=(0,A.pd)(),o=t.data&&"url"in t.data?t.data.url:"",c=t.material_type===w.Mt.DOCUMENT&&o?I(o):null;return(0,s.jsxs)("div",{className:"".concat(J," cursor-pointer ").concat(r?"z-20":""),onClick:n,children:[r&&(0,s.jsx)("div",{className:"absolute right-3 top-3 z-30 flex size-5 items-center justify-center rounded-full bg-gray-900 shadow-md",children:(0,s.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})})}),(0,s.jsxs)("div",{className:H,children:[(0,s.jsx)("div",{className:Y}),(()=>{if(t.material_type===w.Mt.IMAGE&&o)return(0,s.jsx)("img",{src:o,alt:t.name,className:q,loading:"lazy",decoding:"async"});if(t.material_type===w.Mt.TEXT){let e=t.data,a=null==e?void 0:e.nodes,l=a?Object.values(a).find(t=>t.id===(null==e?void 0:e.rootId)):null,r=(null==l?void 0:l.fill)==="#ffffff"||(null==l?void 0:l.fill)==="white"?"#000":(null==l?void 0:l.fill)||"#000";return(0,s.jsx)("div",{className:"flex size-full items-center justify-center p-4 text-center",children:(0,s.jsx)("span",{className:"line-clamp-3 leading-tight",style:{color:r,fontWeight:(null==l?void 0:l.fontWeight)||"normal",fontFamily:(null==l?void 0:l.fontFamily)||"system-ui",fontSize:(null==l?void 0:l.fontSize)?"".concat(Math.min(l.fontSize/2.5,32),"px"):"20px"},children:(null==l?void 0:l.text)||t.name})})}
1return t.material_type===w.Mt.VIDEO&&o?(0,s.jsx)("video",{src:o,className:"max-h-[82%] max-w-[82%] rounded-lg object-contain shadow-sm",muted:!0,playsInline:!0,preload:"metadata"}):t.material_type===w.Mt.AUDIO?(0,s.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-2 text-gray-500",children:[(0,s.jsx)(d.A,{className:"size-10",strokeWidth:1.5}),(0,s.jsx)("span",{className:"max-w-[80%] truncate text-xs",children:t.name})]}):t.material_type===w.Mt.DOCUMENT&&c?(0,s.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-2 bg-transparent",children:[(0,s.jsx)(M.default,{src:c.iconPath,alt:c.label,width:52,height:52,className:"size-12 object-contain drop-shadow-[0_8px_14px_rgba(15,23,42,0.12)] transition-transform duration-500 ease-out group-hover:-translate-y-1 group-hover:scale-[1.2]",loading:"eager",unoptimized:!0}),(0,s.jsx)("span",{className:"px-2 py-0.5 text-[11px] font-medium text-gray-600 transition-colors duration-300 group-hover:text-gray-900",children:c.label})]}):t.material_type===w.Mt.GROUP?(0,s.jsx)("div",{className:"flex size-[82%] items-center justify-center overflow-hidden rounded-lg bg-white shadow-sm",children:(0,s.jsx)(x.A,{className:"size-9 text-gray-400",strokeWidth:1.5})}):(0,s.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-2 text-gray-400",children:[(0,s.jsx)(m.A,{className:"w-8 h-8"}),(0,s.jsx)("span",{className:"text-xs",children:t.name})]})})(),t.tags&&t.tags.length>0&&(0,s.jsxs)("div",{className:"absolute left-1.5 top-1.5 z-10 flex max-w-[calc(100%-48px)] flex-wrap gap-0.5",children:[t.tags.slice(0,2).map(e=>(0,s.jsx)("span",{className:"max-w-[60px] truncate rounded bg-black/70 px-1.5 py-0.5 text-[9px] text-white backdrop-blur-sm",children:e},e)),t.tags.length>2&&(0,s.jsxs)("span",{className:"rounded bg-black/70 px-1.5 py-0.5 text-[9px] text-white backdrop-blur-sm",children:["+",t.tags.length-2]})]}),(0,s.jsxs)("div",{className:"absolute top-1.5 z-20 flex gap-1 opacity-0 transition-opacity duration-200 group-hover:opacity-100 ".concat(r?"right-8":"right-1.5"),children:[(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),l()},className:"flex size-6 items-center justify-center rounded bg-black/70 text-white backdrop-blur-sm transition-colors hover:bg-black/90",title:i("预览"),children:(0,s.jsx)(p.A,{className:"w-3.5 h-3.5"})}),a&&(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),a()},className:"flex size-6 items-center justify-center rounded bg-black/70 text-white backdrop-blur-sm transition-colors hover:bg-red-500/90",title:i("删除"),children:(0,s.jsx)(u.A,{className:"w-3.5 h-3.5"})})]})]}),(0,s.jsxs)("div",{className:"px-1 pb-1 pt-2 text-center",children:[(0,s.jsx)("h3",{className:"line-clamp-2 text-[11px] font-medium leading-snug text-gray-900 sm:text-xs",title:t.name,children:t.name}),(0,s.jsxs)("div",{className:"mt-1 flex items-center justify-center gap-1 text-[9px] text-gray-400 sm:text-[10px]",children:[(0,s.jsx)("span",{className:"truncate",children:R(t.created_at)}),(0,s.jsx)("span",{className:"text-gray-300",children:"\xb7"}),(0,s.jsx)("span",{className:"shrink-0",children:i((e=>{switch(e){case w.Mt.IMAGE:return"图片";case w.Mt.DOCUMENT:return"文档";case w.Mt.TEXT:return"文本";case w.Mt.GROUP:return"组合";case w.Mt.AUDIO:return"音频";case w.Mt.VIDEO:return"视频";default:return"素材"}})(t.material_type))})]})]})]})}function $(e){let{material:t,onClose:a}=e;return t?(0,s.jsxs)("div",{className:"fixed inset-0 z-[110] flex items-center justify-center bg-black/60 backdrop-blur-sm animate-in fade-in duration-200",onClick:a,children:[(0,s.jsx)("button",{onClick:a,className:"absolute top-4 right-4 w-10 h-10 rounded-full bg-gray-900/50 hover:bg-gray-900/70 flex items-center justify-center text-white transition-colors",children:(0,s.jsx)(h.A,{className:"w-5 h-5"})}),(0,s.jsx)("div",{onClick:e=>e.stopPropagation(),children:(()=>{var e,a;if(t.material_type===w.Mt.IMAGE&&(null==(e=t.data)?void 0:e.url))return(0,s.jsx)("img",{src:t.data.url,alt:t.name,className:"max-w-full max-h-[80vh] object-contain rounded-xl"});if(t.material_type===w.Mt.TEXT){let e=t.data,a=null==e?void 0:e.nodes,l=a?Object.values(a).find(t=>
1t.id===(null==e?void 0:e.rootId)):null,r=(null==l?void 0:l.fill)==="#ffffff"||(null==l?void 0:l.fill)==="white"?"#000":(null==l?void 0:l.fill)||"#000";return(0,s.jsx)("div",{className:"p-8 bg-white rounded-2xl text-center max-w-md shadow-2xl",style:{fontFamily:(null==l?void 0:l.fontFamily)||"system-ui",fontSize:(null==l?void 0:l.fontSize)||32,fontWeight:(null==l?void 0:l.fontWeight)||"normal",color:r},children:(null==l?void 0:l.text)||t.name})}if(t.material_type===w.Mt.DOCUMENT&&(null==(a=t.data)?void 0:a.url)){let e=I(t.data.url);return(0,s.jsxs)("div",{className:"p-12 bg-white rounded-2xl flex flex-col items-center gap-4 shadow-2xl",children:[(0,s.jsx)(M.default,{src:e.iconPath,alt:e.label,width:64,height:64,className:"w-16 h-16 object-contain",unoptimized:!0}),(0,s.jsx)("span",{className:"text-base text-gray-900 font-medium",children:t.name})]})}return(0,s.jsxs)("div",{className:"p-12 bg-white rounded-2xl flex flex-col items-center gap-4 shadow-2xl",children:[(0,s.jsx)(m.A,{className:"w-16 h-16 text-gray-300"}),(0,s.jsx)("span",{className:"text-base text-gray-900",children:t.name})]})})()})]}):null}function ee(e){let{breadcrumbs:t,onNavigate:a}=e,{t:l}=(0,A.pd)();return t.length<=1?null:(0,s.jsx)("div",{className:"flex items-center gap-1 px-1 py-2 mb-2 text-xs text-gray-500 flex-wrap",children:t.map((e,r)=>(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[r>0&&(0,s.jsx)(g.A,{className:"w-3 h-3 text-gray-300 flex-shrink-0"}),0===r?(0,s.jsxs)("button",{onClick:()=>a(null),className:"flex items-center gap-1 text-gray-400 hover:text-gray-700 transition-colors",children:[(0,s.jsx)(f.A,{className:"w-3 h-3"}),(0,s.jsx)("span",{children:l("全部")})]}):r<t.length-1?(0,s.jsx)("button",{onClick:()=>a(e.id),className:"text-gray-400 hover:text-gray-700 transition-colors max-w-[80px] truncate",children:e.name}):(0,s.jsx)("span",{className:"text-gray-700 font-medium max-w-[100px] truncate",children:e.name})]},String(e.id)))})}function et(e){let{openingOrigin:t,isOpen:a,onClose:d,onSelect:m,onSelectMany:x,onSelectImage:p,mode:f="browse",usage:M="library",imageOnly:C=!1,allowReferenceVideo:S=!1,onLocalUpload:T,canvasElements:I,singleSelect:D=!1,selectionTitle:O,selectionHelper:G,selectionActionLabel:F}=e,{t:U}=(0,A.pd)(),et="select"===f&&"reference"===M&&Array.isArray(I),[ea,es]=(0,r.useState)(et?"canvas":"materials"),el=(0,r.useRef)(null),[er,en]=(0,r.useState)([]),[ei,eo]=(0,r.useState)([]),[ec,ed]=(0,r.useState)([]),[em,ex]=(0,r.useState)([]),[ep,eu]=(0,r.useState)(!1),[eh,eg]=(0,r.useState)(""),[ef,eb]=(0,r.useState)("all"),[ej,ev]=(0,r.useState)(1),[ey,eN]=(0,r.useState)(1),[eM,ew]=(0,r.useState)(1),[e_,ek]=(0,r.useState)(1),[eC,eA]=(0,r.useState)(0),[eS,ez]=(0,r.useState)(0),[eE,eT]=(0,r.useState)(0),[eI,eP]=(0,r.useState)(0),[eD,eO]=(0,r.useState)([]),[eL,eV]=(0,r.useState)(null),[eW,eG]=(0,r.useState)([{id:null,name:"全部"}]),[eF,eU]=(0,r.useState)(!1),[eX,eB]=(0,r.useState)(null),eJ=(0,E.j)(a,t),eH=eJ.closing,[eY,eq]=(0,r.useState)(null),[eR,eQ]=(0,r.useState)(!1),[eZ,eK]=(0,r.useState)(!1),[e$,e0]=(0,r.useState)(!1),[e1,e5]=(0,r.useState)([]),[e2,e3]=(0,r.useState)(!1),[e4,e8]=(0,r.useState)(1),[e9,e6]=(0,r.useState)(0),[e7,te]=(0,r.useState)(null),[tt,ta]=(0,r.useState)(!1),[ts,tl]=(0,r.useState)(new Map),[tr,tn]=(0,r.useState)(new Set),[ti,to]=(0,r.useState)(new Map),tc="reference"===M?"reference":"material",td="select"===f&&"reference"===M&&S,tm="select"===f&&("reference"===M&&!S||C),tx=tm||td?w.Mt.IMAGE:"all",tp="select"===f&&!!T,tu=(0,r.useMemo)(()=>Q(tc,C,S),[S,C,tc]),th=(0,r.useMemo)(()=>tm||td?P.filter(e=>e.value===w.Mt.IMAGE):S?P.filter(e=>e.value!==w.Mt.VIDEO):P,[S,tm,td]),tg=tx===w.Mt.IMAGE?eS:eC,tf=ts.size+tr.size+ti.size,tb=F?U(F):U("reference"===tc?S?"添加 {count} 个参考素材":"添加 {count} 张参考图":C?"添加 {count} 张素材图":"添加 {count} 个素材").replace("{count}",String(tf)),tj=(0,r.useCallback)(async e=>{eU(!0);try{let t=await (0,w.f6)({parent_id:e});0===t.code&&t.data&&eO(t.data.items||[])}catch(e){}finally{eU(!1)}},[]),tv=(0,r.useCallback)(async(e,t,a)=>{eu(!0);try{let s={page:t,page_size:12,folder_id:null!==a?a:"root"};"all"!==e&&(s.material_type=e),eh&&(s.name=eh);let l=await (0,w.kU)(s);if(0===l.code&&l.data){let t=l.data.items||[],a=l.data.total||0;
1"all"===e?(en(t),eA(a)):e===w.Mt.IMAGE?(eo(t),ez(a)):e===w.Mt.DOCUMENT?(ed(t),eT(a)):e===w.Mt.VIDEO?(ex(t),eP(a)):(en(t),eA(a))}}catch(e){}finally{eu(!1)}},[12,eh]),ty=(0,r.useCallback)(async()=>{e3(!0);try{let e=await (0,_.pU)({page:e4,page_size:12,export_format:"image"});0===e.code&&e.data&&(e5(e.data.items||[]),e6(e.data.total||0))}catch(e){}finally{e3(!1)}},[e4]);(0,r.useEffect)(()=>{a?(es(et?"canvas":"materials"),tl(new Map),tn(new Set),to(new Map),eV(null),eG([{id:null,name:"全部"}]),ev(1),eN(1),ew(1),ek(1),eb(tx),e8(1),eg(""),eK(!1),e0(!0)):e0(!1)},[a,tx,et]),(0,r.useEffect)(()=>{a&&e$&&"canvas"===ea&&ty()},[ea,ty,a,e$]),(0,r.useEffect)(()=>{a&&e$&&"materials"===ea&&ef!==w.Mt.VIDEO&&tj(eL)},[a,e$,ea,eL,ef,eh]),(0,r.useEffect)(()=>{a&&e$&&"materials"===ea&&("all"===ef?tv("all",ej,eL):ef===w.Mt.IMAGE?tv(w.Mt.IMAGE,ey,eL):ef===w.Mt.DOCUMENT?tv(w.Mt.DOCUMENT,eM,eL):ef===w.Mt.VIDEO?tv(w.Mt.VIDEO,e_,eL):tv(ef,ej,eL))},[a,e$,ea,ef,eh,ej,ey,eM,e_,eL]);let tN=(0,r.useCallback)(async e=>{eV(e.id),ev(1),eN(1),ew(1),ek(1);try{let t=await (0,w.iE)(e.id);0===t.code&&t.data?eG([{id:null,name:"全部"},...t.data]):eG(t=>[...t,{id:e.id,name:e.name}])}catch(t){eG(t=>[...t,{id:e.id,name:e.name}])}},[]),tM=(0,r.useCallback)(e=>{eV(e),ev(1),eN(1),ew(1),ek(1),eG(t=>{let a=t.findIndex(t=>t.id===e);return a>=0?t.slice(0,a+1):[{id:null,name:"全部"}]})},[]),tw=(0,r.useCallback)(()=>{eH||d()},[d,eH]),t_=(0,r.useCallback)(e=>{if(!e.length||!T)return;let t=e.filter(e=>tm?B(e):td?B(e)||e.type.startsWith("video/")||[".mp4",".mov",".webm",".mkv",".avi",".m4v"].includes(X(e)):B(e)||e.type.startsWith("audio/")||e.type.startsWith("video/")||L.includes(e.type)||V.includes(X(e))||W.includes(X(e))),a=D?t.slice(0,1):t;0!==a.length&&(T(a,tc),tw())},[tw,tm,td,tc,T,D]),tk=(0,r.useCallback)(e=>{let t=Array.from(e.target.files||[]);e.target.value="",t_(t)},[t_]),tC=(0,r.useCallback)(e=>{e.preventDefault(),eK(!1),t_(Array.from(e.dataTransfer.files||[]))},[t_]),tA=(0,r.useCallback)(e=>{let t=String(e.id);if(D){tl(ts.has(t)?new Map:new Map([[t,e]])),tn(new Set),to(new Map);return}tl(a=>{let s=new Map(a);return s.has(t)?s.delete(t):s.set(t,e),s})},[ts,D]),tS=(0,r.useCallback)(e=>{let t=String(e);if(D){tl(new Map),tn(tr.has(t)?new Set:new Set([t])),to(new Map);return}tn(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},[tr,D]),tz=(0,r.useCallback)(e=>{let t=String(e.id);if(D){tl(new Map),tn(new Set),to(ti.has(t)?new Map:new Map([[t,e]]));return}to(a=>{let s=new Map(a);return s.has(t)?s.delete(t):s.set(t,e),s})},[ti,D]),tE=(0,r.useCallback)(()=>{if("select"===f&&(m||x)){let e=Array.from(ts.values()),t=[...e,...e1.filter(e=>tr.has(String(e.id))).map(e=>{var t,a;let s=null==(a=e.file_urls)||null==(t=a[0])?void 0:t.url;return s?{id:e.id,user_id:"",name:e.export_name,material_type:w.Mt.IMAGE,data:{url:s},is_public:0,created_at:e.created_at||new Date().toISOString()}:null}).filter(e=>!!e),...Array.from(ti.values())];e.forEach(l.uS),x?x(t):m&&t.forEach(e=>m(e))}else p&&tr.size>0&&e1.filter(e=>tr.has(String(e.id))).forEach(e=>{var t,a;let s=null==(a=e.file_urls)||null==(t=a[0])?void 0:t.url;s&&p(s)});tw()},[f,m,x,p,e1,ts,tr,ti,tw]),tT=async()=>{if(eY){eQ(!0);try{let e=await (0,w.iq)(eY.id);if(0===e.code){let e=eY.id;en(t=>t.filter(t=>t.id!==e)),eA(e=>Math.max(0,e-1)),eY.material_type===w.Mt.IMAGE?(eo(t=>t.filter(t=>t.id!==e)),ez(e=>Math.max(0,e-1))):eY.material_type===w.Mt.DOCUMENT?(ed(t=>t.filter(t=>t.id!==e)),eT(e=>
1Math.max(0,e-1))):eY.material_type===w.Mt.VIDEO&&(ex(t=>t.filter(t=>t.id!==e)),eP(e=>Math.max(0,e-1))),eq(null)}}catch(e){}finally{eQ(!1)}}},tI=async()=>{if(e7){ta(!0);try{let e=await (0,_.$d)(e7.id);0===e.code&&(e5(e=>e.filter(e=>e.id!==e7.id)),e6(e=>Math.max(0,e-1)),te(null))}catch(e){}finally{ta(!1)}}},tP=(0,r.useMemo)(()=>ef===w.Mt.IMAGE?ei:ef===w.Mt.DOCUMENT?ec:ef===w.Mt.VIDEO?em:er,[ef,er,ei,ec,em]),tD=(0,r.useMemo)(()=>ef===w.Mt.IMAGE?eS:ef===w.Mt.DOCUMENT?eE:ef===w.Mt.VIDEO?eI:eC,[ef,eC,eS,eE,eI]),tO=(0,r.useMemo)(()=>ef===w.Mt.IMAGE?ey:ef===w.Mt.DOCUMENT?eM:ef===w.Mt.VIDEO?e_:ej,[ef,ej,ey,eM,e_]),tL=Math.ceil(tD/12),tV=Math.ceil(e9/12),tW=(0,r.useCallback)(()=>{ef===w.Mt.IMAGE?eN(e=>Math.max(1,e-1)):ef===w.Mt.DOCUMENT?ew(e=>Math.max(1,e-1)):ef===w.Mt.VIDEO?ek(e=>Math.max(1,e-1)):ev(e=>Math.max(1,e-1))},[ef]),tG=(0,r.useCallback)(()=>{ef===w.Mt.IMAGE?eN(e=>Math.min(Math.ceil(eS/12),e+1)):ef===w.Mt.DOCUMENT?ew(e=>Math.min(Math.ceil(eE/12),e+1)):ef===w.Mt.VIDEO?ek(e=>Math.min(Math.ceil(eI/12),e+1)):ev(e=>Math.min(Math.ceil(eC/12),e+1))},[ef,eC,eS,eE,eI,12]),tF=ep||eF,tU=ef!==w.Mt.VIDEO&&eD.length>0,tX=tP.length>0;if(!eJ.present||"undefined"==typeof document)return null;let tB=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"fixed inset-0 z-[2147483647] flex items-center justify-center p-3 transition-all duration-200 sm:p-6 ".concat(eH?"opacity-0":"opacity-100"),onClick:tw,children:[(0,s.jsx)("div",{className:"absolute inset-0 ".concat(z().backdrop)}),(0,s.jsxs)("div",{className:"".concat(z().dialog," relative flex h-[min(760px,88dvh)] w-full max-w-[960px] flex-col overflow-hidden rounded-2xl transform transition-all duration-200 ").concat(eH?"scale-[0.98] opacity-0":"scale-100 opacity-100"),onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":O||tp?"material-library-title":void 0,"aria-label":O||tp?void 0:U("素材库"),children:[(0,s.jsx)("button",{onClick:tw,className:"".concat(z().closeButton," absolute right-5 top-5 z-20 flex size-9 items-center justify-center rounded-xl transition-all duration-150 active:scale-95"),"aria-label":U("关闭"),children:(0,s.jsx)(h.A,{className:"size-[18px]",strokeWidth:1.8})}),(0,s.jsxs)("div",{className:"".concat(z().header," flex-shrink-0 px-5 pb-4 pt-5 pr-16 sm:px-6 sm:pb-5 sm:pt-6 sm:pr-20"),children:[(O||tp)&&(0,s.jsxs)("div",{className:"mb-4 min-w-0",children:[(0,s.jsx)("h2",{id:"material-library-title",className:"".concat(z().title," text-lg font-semibold leading-7"),children:U(O||tu.title)}),(0,s.jsx)("p",{className:"".concat(z().helper," mt-0.5 text-xs leading-5"),children:U(G||tu.helper)})]}),tp&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("input",{ref:el,type:"file",multiple:!D,accept:tu.accept,className:"hidden",onChange:tk}),(0,s.jsxs)("button",{type:"button",onClick:()=>{var e;return null==(e=el.current)?void 0:e.click()},onDragEnter:e=>{e.preventDefault(),eK(!0)},onDragOver:e=>{e.preventDefault(),eK(!0)},onDragLeave:e=>{e.preventDefault(),e.currentTarget.contains(e.relatedTarget)||eK(!1)},onDrop:tC,"aria-label":U(tu.uploadTitle),className:"".concat(z().uploadArea," group flex w-full cursor-pointer items-center justify-between gap-5 rounded-xl px-4 py-4 text-left transition-all duration-200 sm:px-5 ").concat(eZ?z().uploadAreaDragging:""),children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-4",children:[(0,s.jsx)("div",{className:"".concat(z().uploadIcon," flex size-11 flex-shrink-0 items-center justify-center rounded-xl transition-colors sm:size-12"),children:(0,s.jsx)(b.A,{className:"size-5 sm:size-6",strokeWidth:1.65})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"".concat(z().uploadTitle," text-sm font-semibold leading-5 sm:text-[15px]"),children:U(tu.uploadTitle)}),(0,s.jsx)("div",{className:"".concat(z().uploadHint," mt-1 text-xs leading-5 sm:text-[13px]"),children:U(tu.uploadHint)})]})]}),(0,s.jsxs)("div",{className:"".concat(z().uploadAction," hidden flex-shrink-0 items-center gap-1.5 text-sm font-medium transition-colors sm:flex"),children:[(0,s.jsx)("span",{children:U("点击上传")}),(0,s.jsx)(g.A,{className:"size-4",strokeWidth:1.8})]})]})]}),(0,s.jsxs)("div",{className:"".concat(z().controls," flex flex-wrap items-center gap-2.5"),children:[(0,s.jsxs)("div",{className:"".concat(z().sourceTabs," flex flex-shrink-0 items-center gap-1 rounded-xl p-1"),children:[et&&(0,s.jsxs)("button",{onClick:()=>es("canvas"),className:"".concat(z().sourceTab," ").concat("canvas"===ea?z().sourceTabActive:""," flex h-8 items-center gap-1.5 rounded-lg px-3 text-xs font-medium transition-all"),children:[(0,s.jsx)(j.A,{className:"w-3.5 h-3.5"}),U("画布元素"),(0,s.jsxs)("span",{className:"text-gray-400",children:["(",(null==I?void 0:I.length)||0,")"]})]}),(0,s.jsxs)("button",{onClick:()=>
1{es("materials"),ef===w.Mt.VIDEO&&(eb(tx),eV(null),eG([{id:null,name:"全部"}]))},className:"".concat(z().sourceTab," ").concat("materials"===ea&&ef!==w.Mt.VIDEO?z().sourceTabActive:""," flex h-8 items-center gap-1.5 rounded-lg px-3 text-xs font-medium transition-all"),children:[(0,s.jsx)(o.A,{className:"w-3.5 h-3.5"}),U("素材"),(0,s.jsxs)("span",{className:"text-gray-400",children:["(",tg,")"]})]}),S&&(0,s.jsxs)("button",{onClick:()=>{es("materials"),eb(w.Mt.VIDEO),ek(1),eV(null),eG([{id:null,name:"全部"}])},className:"".concat(z().sourceTab," ").concat("materials"===ea&&ef===w.Mt.VIDEO?z().sourceTabActive:""," flex h-8 items-center gap-1.5 rounded-lg px-3 text-xs font-medium transition-all"),children:[(0,s.jsx)(c.A,{className:"w-3.5 h-3.5"}),U("视频"),(0,s.jsxs)("span",{className:"text-gray-400",children:["(",eI,")"]})]}),(0,s.jsxs)("button",{onClick:()=>es("works"),className:"".concat(z().sourceTab," ").concat("works"===ea?z().sourceTabActive:""," flex h-8 items-center gap-1.5 rounded-lg px-3 text-xs font-medium transition-all"),children:[(0,s.jsx)(v.A,{className:"w-3.5 h-3.5"}),U("海报"),(0,s.jsxs)("span",{className:"text-gray-400",children:["(",e9,")"]})]})]}),"materials"===ea&&(0,s.jsxs)("div",{className:"relative min-w-[180px] flex-1",children:[(0,s.jsx)(y.A,{className:"".concat(z().searchIcon," absolute left-3 top-1/2 size-4 -translate-y-1/2"),strokeWidth:1.8}),(0,s.jsx)("input",{type:"text",value:eh,onChange:e=>eg(e.target.value),placeholder:U(ef===w.Mt.VIDEO?"根据文件名搜索视频...":"根据文件名搜索素材..."),className:"".concat(z().searchInput," h-10 w-full rounded-xl pl-9 pr-3 text-sm outline-none transition-all")})]}),"materials"===ea&&ef!==w.Mt.VIDEO&&(0,s.jsx)("div",{className:"".concat(z().typeFilters," flex flex-shrink-0 items-center gap-1 rounded-xl p-1"),children:th.map(e=>(0,s.jsxs)("button",{onClick:()=>{eb(e.value),e.value===w.Mt.IMAGE?eN(1):e.value===w.Mt.DOCUMENT?ew(1):ev(1)},className:"".concat(z().typeFilter," ").concat(ef===e.value?z().typeFilterActive:""," flex h-8 items-center gap-1.5 rounded-lg px-3 text-xs transition-all duration-150"),children:[e.icon,(0,s.jsx)("span",{className:"hidden sm:inline",children:U(e.label)})]},e.value))}),"select"===f&&tf>0&&(0,s.jsxs)("button",{onClick:tE,className:"".concat(z().confirmButton," ml-auto flex h-10 flex-shrink-0 items-center gap-2 whitespace-nowrap rounded-xl px-4 text-sm font-semibold transition-all duration-150 active:scale-[0.98]"),children:[(0,s.jsx)("svg",{className:"size-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),tb]})]})]}),(0,s.jsx)("div",{className:"".concat(z().content," flex-1 overflow-y-auto px-5 pb-5 pt-4 sm:px-6"),children:"materials"===ea?(0,s.jsxs)(s.Fragment,{children:[ef!==w.Mt.VIDEO&&(0,s.jsx)(ee,{breadcrumbs:eW,onNavigate:tM}),tF?(0,s.jsx)("div",{className:"h-40 flex items-center justify-center",children:(0,s.jsx)(N.A,{className:"w-7 h-7 text-gray-300 animate-spin"})}):tF||tU||tX?(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-1.5 sm:grid-cols-5 sm:gap-2.5 md:grid-cols-6",children:[ef!==w.Mt.VIDEO&&1===tO&&eD.map(e=>(0,s.jsx)(Z,{folder:e,onClick:()=>tN(e)},"folder-".concat(e.id))),tP.map(e=>(0,s.jsx)(K,{material:e,onDelete:()=>eq(e),onPreview:()=>eB(e),isSelected:ts.has(String(e.id)),onToggleSelect:()=>tA(e)},e.id))]}):(0,s.jsxs)("div",{className:"".concat(z().emptyState," flex h-full flex-col items-center justify-center gap-3 pb-12 text-center"),children:[(0,s.jsx)("div",{className:"".concat(z().emptyIcon," flex size-14 items-center justify-center rounded-2xl"),children:(0,s.jsx)(i.A,{className:"size-6",strokeWidth:1.5})}),(0,s.jsx)("span",{className:"".concat(z().emptyTitle," text-sm font-medium"),children:ef===w.Mt.VIDEO?eh?U("没有找到匹配的视频"):U("暂无视频素材"):eh?U("没有找到匹配的素材"):U("此文件夹为空")})]})]}):"works"===ea?(0,s.jsx)(s.Fragment,{children:e2?(0,s.jsx)("div",{className:"h-40 flex items-center justify-center",children:(0,s.jsx)(N.A,{className:"w-7 h-7 text-gray-300 animate-spin"})}):0===e1.length?(0,s.jsxs)("div",{className:"h-full flex flex-col items-center justify-center gap-3 text-gray-400 pt-16",children:[(0,s.jsx)(v.A,{className:"w-12 h-12 text-gray-200"}),(0,s.jsx)("span",{className:"text-sm",children:U("暂无海报作品")})]}):(0,s.jsx)("div",{className:"grid grid-cols-3 gap-1.5 sm:grid-cols-5 sm:gap-2.5 md:grid-cols-6",children:e1.map(e=>{var t,a;let l=null==(a=e.file_urls)||null==(t=a[0])?void 0:t.url,r=tr.has(String(e.id));return(0,s.jsxs)("div",{className:"".concat(J," cursor-pointer ").concat(r?"z-20":""),onClick:()=>tS(e.id),children:[r&&(0,s.jsx)("div",{className:"absolute right-3 top-3 z-30 flex size-5 items-center justify-center rounded-full bg-gray-900 shadow-md",children:(0,s.jsx)("svg",{className:"w-3 h-3 text-white",f
1ill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})})}),(0,s.jsxs)("div",{className:H,children:[(0,s.jsx)("div",{className:Y}),l?(0,s.jsx)("img",{src:l,alt:e.export_name,className:q,loading:"lazy",decoding:"async"}):(0,s.jsx)(v.A,{className:"w-8 h-8 text-gray-300"}),(0,s.jsx)("div",{className:"absolute right-1.5 top-1.5 z-20 opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),te(e)},disabled:tt,className:"flex size-6 items-center justify-center rounded bg-black/70 text-white backdrop-blur-sm transition-colors hover:bg-red-500/90 disabled:opacity-50",title:U("删除"),children:(0,s.jsx)(u.A,{className:"w-3.5 h-3.5"})})})]}),(0,s.jsxs)("div",{className:"px-1 pb-1 pt-2 text-center",children:[(0,s.jsx)("h3",{className:"line-clamp-2 text-[11px] font-medium leading-snug text-gray-900 sm:text-xs",title:e.export_name,children:e.export_name}),(0,s.jsxs)("div",{className:"mt-1 flex items-center justify-center gap-1 text-[9px] text-gray-400 sm:text-[10px]",children:[(0,s.jsx)("span",{className:"truncate",children:R(e.created_at)}),(0,s.jsx)("span",{className:"text-gray-300",children:"\xb7"}),(0,s.jsx)("span",{className:"shrink-0",children:U("海报")})]})]})]},e.id)})})}):(0,s.jsx)(s.Fragment,{children:(null==I?void 0:I.length)?(0,s.jsx)("div",{className:"grid grid-cols-3 gap-1.5 sm:grid-cols-5 sm:gap-2.5 md:grid-cols-6",children:I.map(e=>(0,s.jsx)(K,{material:e,onPreview:()=>eB(e),isSelected:ti.has(String(e.id)),onToggleSelect:()=>tz(e)},e.id))}):(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 pb-12 text-gray-400",children:[(0,s.jsx)("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-white text-gray-300 shadow-sm ring-1 ring-gray-200/80",children:(0,s.jsx)(j.A,{className:"size-6",strokeWidth:1.5})}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("strong",{className:"block text-sm font-medium text-gray-600",children:S?U("暂无可用的画布素材"):U("暂无可用的画布图片")}),(0,s.jsx)("span",{className:"mt-1 block text-xs text-gray-400",children:S?U("画布中生成或上传素材后,可在这里直接引用"):U("画布中生成或上传图片后,可在这里直接引用")})]})]})})}),"materials"===ea&&tL>1&&(0,s.jsxs)("div",{className:"px-5 py-3 border-t border-gray-100 flex items-center justify-between bg-white flex-shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:[U("共")," ",tD," ",U(ef===w.Mt.VIDEO?"个视频":"个素材")]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:tW,disabled:1===tO,className:"px-3 py-1.5 text-xs text-gray-600 hover:text-gray-900 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:U("上一页")}),(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:[tO," / ",tL]}),(0,s.jsx)("button",{onClick:tG,disabled:tO===tL,className:"px-3 py-1.5 text-xs text-gray-600 hover:text-gray-900 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:U("下一页")})]})]}),"works"===ea&&tV>1&&(0,s.jsxs)("div",{className:"px-5 py-3 border-t border-gray-100 flex items-center justify-between bg-white flex-shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:[U("共")," ",e9," ",U("个海报作品")]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>e8(e=>Math.max(1,e-1)),disabled:1===e4,className:"px-3 py-1.5 text-xs text-gray-600 hover:text-gray-900 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:U("上一页")}),(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:[e4," / ",tV]}),(0,s.jsx)("button",{onClick:()=>e8(e=>Math.min(tV,e+1)),disabled:e4===tV,className:"px-3 py-1.5 text-xs text-gray-600 hover:text-gray-900 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:U("下一页")})]})]})]})]}),eX&&(0,s.jsx)($,{material:eX,onClose:()=>eB(null)}),(0,s.jsx)(k.A,{isOpen:!!eY,onClose:()=>eq(null),onConfirm:tT,title:U("删除素材"),content:"".concat(U("确定要删除素材"),' "').concat((null==eY?void 0:eY.name)||"",'" ').concat(U("吗?")),confirmText:U("删除"),cancelText:U("取消"),type:"danger",isLoading:eR,loadingText:U("删除中...")}),(0,s.jsx)(k.A,{isOpen:!!e7,onClose:()=>
1te(null),onConfirm:tI,title:U("删除海报作品"),content:"".concat(U("确定要删除"),' "').concat((null==e7?void 0:e7.export_name)||"",'" ').concat(U("吗?")),confirmText:U("删除"),cancelText:U("取消"),type:"danger",isLoading:tt,loadingText:U("删除中...")})]});return(0,n.createPortal)(tB,document.body)}},15223:e=>{e.exports={backdrop:"MaterialLibraryModal_backdrop__Mn5Qy",dialog:"MaterialLibraryModal_dialog__12fZW",header:"MaterialLibraryModal_header__1R_va",title:"MaterialLibraryModal_title__TtUFk",uploadTitle:"MaterialLibraryModal_uploadTitle__7_RwQ",emptyTitle:"MaterialLibraryModal_emptyTitle__AoNu2",helper:"MaterialLibraryModal_helper__Mmn_q",uploadHint:"MaterialLibraryModal_uploadHint__Bmxd5",closeButton:"MaterialLibraryModal_closeButton__ueJ_U",uploadArea:"MaterialLibraryModal_uploadArea__QWAdM",uploadAreaDragging:"MaterialLibraryModal_uploadAreaDragging__gL_hD",uploadIcon:"MaterialLibraryModal_uploadIcon__VtUt3",emptyIcon:"MaterialLibraryModal_emptyIcon__o2O_8",uploadAction:"MaterialLibraryModal_uploadAction__RSWfp",sourceTabs:"MaterialLibraryModal_sourceTabs__7A72I",typeFilters:"MaterialLibraryModal_typeFilters__lm9YC",sourceTab:"MaterialLibraryModal_sourceTab__qPLO4",typeFilter:"MaterialLibraryModal_typeFilter__1Wd_F",sourceTabActive:"MaterialLibraryModal_sourceTabActive__mjj_G",typeFilterActive:"MaterialLibraryModal_typeFilterActive__6Uyy8",searchIcon:"MaterialLibraryModal_searchIcon__RF0na",searchInput:"MaterialLibraryModal_searchInput__Cx8D9",confirmButton:"MaterialLibraryModal_confirmButton__jxTeN",content:"MaterialLibraryModal_content__5JZeN",emptyState:"MaterialLibraryModal_emptyState___A2wC",controls:"MaterialLibraryModal_controls__XY1sY"}},64795:e=>{e.exports={scene:"project-folder_scene__cWS5T",compactScene:"project-folder_compactScene___Rgdv",front:"project-folder_front__bmg8n",shadow:"project-folder_shadow__8sXFM",contents:"project-folder_contents__3kxFv",preview:"project-folder_preview__ml2n6",paper:"project-folder_paper__1YKo8",cover:"project-folder_cover__mMYJ9",glass:"project-folder_glass__bfQEw",emptyPapers:"project-folder_emptyPapers__qVoVq",projectCard:"project-folder_projectCard__bpc0f",projectVisual:"project-folder_projectVisual__Z9i72",projectCaption:"project-folder_projectCaption__bETOL",projectSubtitle:"project-folder_projectSubtitle__Uixo_"}},75967:(e,t,a)=>{"use strict";a.d(t,{y:()=>v});var s=a(95155),l=a(24746),r=a(99113),n=a(12115),i=a(17482),o=a(59828),c=a(16916),d=a(97013),m=a(69795),x=a(5225),p=a(1644),u=a(64269),h=a(64795),g=a.n(h);let f="https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&q=80&w=800",b={back:"linear-gradient(135deg, #fee9a3 0%, #f7c848 100%)",tab:"linear-gradient(135deg, #ffe8a2 0%, #f5bb2f 100%)",front:"linear-gradient(145deg, #ffd966 0%, #f0ae1b 100%)"};function j(e){let{file:t,delay:a,index:n,totalCount:p,isVisible:h,projectCard:b=!1}=e,{t:j}=(0,r.pd)(),v=(p-1)/2,y=p>1?(n-v)/v:0,N=52*y,M=8*Math.abs(y),w=4===p?[{x:-38,y:-56,angle:-13},{x:-14,y:-70,angle:-5},{x:13,y:-65,angle:3},{x:38,y:-57,angle:12}][n]:{x:36*y,y:-60-(1-Math.abs(y))*9,angle:11*y},_={x:w.x+16*y,y:w.y-13-(1-Math.abs(y))*7,angle:w.angle+8*y},k=h?_:w,C=function(e){switch(e){case"image":return i.A;case"video":return o.A;case"audio":return c.A;case"text":return d.A;case"group":return m.A;default:return x.A}}(t.kind),A=!!t.image;return(0,s.jsx)("div",{className:(0,u.cn)("pointer-events-none absolute left-1/2 top-1/2 motion-reduce:!transition-none",b?g().preview:"size-14 -translate-x-1/2 -translate-y-1/2 sm:size-[4.5rem]"),style:{transform:b?"translate(calc(-50% + ".concat(k.x,"%), ").concat(k.y,"%) rotate(").concat(k.angle,"deg)"):h?"translate(calc(-50% + ".concat(N,"px), calc(-50% - 50px + ").concat(M,"px)) rotate(").concat(24*y,"deg) scale(1)"):"translate(-50%, -50%) rotate(0deg) scale(0.42)",opacity:b||h?1:0,transition:"transform 650ms cubic-bezier(0.16, 1, 0.3, 1) ".concat(a,"ms, opacity 420ms ease ").concat(a,"ms"),zIndex:20+n},children:(0,s.jsxs)("div",{className:"relative size-full overflow-hidden rounded-lg bg-background/95 shadow-[0_14px_30px_rgba(15,23,42,0.16)] transition-transform duration-300 group-hover/folder:shadow-[0_18px_38px_rgba(15,23,42,0.18)]",children:[A?(0,s.jsx)(l.OssThumbnail,{sizes:"128px",src:t.image||f,alt:t.title,className:"size-full object-cover",draggable:!1,onError:e=>{e.currentTarget.src=f}}):t.text?(0,s.jsxs)("div",{className:"size-full overflow-hidden bg-background p-2 text-left text-[7px] leading-relaxed text-muted-foreground",children:[(0,s.jsx)("strong",{className:"mb-1 block text-[8px] text-foreground",children:t.title}),t.text]}):(0,s.jsxs)("div",{className:(0,u.cn)("flex size-full flex-col items-center justify-center gap-1 bg-gradient-to-br from-background px-2",b?"to-muted text-muted-foreground":"to-amber-50 text-amber-700"),children:[(0,s.jsx)(C,{className:"size-6",strokeWidth:1.8}),(0,s.jsx)("span",{className:"max-w-full truncate text-[9px] font-bold uppercase tracking-normal",children:t.label||j("audio"===t.kind?"音频":"video"===t.kind?"视频":"image"===t.kind?"图片":"文件")})]}),!b&&(0,s.jsx)("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/85 to-transparent px-1.5 pb-1.5 pt-5",children:(0,s.jsx)("p",{className:"truncate text-[9px] font-semibold leading-none text-white",children:t.title})})]})})}function v(e){let{title:t,subtitle:a,metadata:l,files:i=[],tags:o=[],className:c,isDropTarget:d,isDragging:x,previewLoading:h,cover:f,projectCard:v=!1,compactGrid:y=!1,previewsExpanded:N=!1,action:M,onClick:w,onDoubleClick:_}=e,{t:k}
1=(0,r.pd)(),[C,A]=(0,n.useState)(!1),[S,z]=(0,n.useState)(null),E=(0,n.useMemo)(()=>i.slice(0,v||y?4:5),[i,v,y]),T=(C||N)&&E.length>0;return y?(0,s.jsxs)("div",{onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),onFocus:()=>A(!0),onBlur:()=>A(!1),onClick:w,onDoubleClick:_,className:(0,u.cn)("group/folder relative flex min-w-0 cursor-pointer flex-col rounded-2xl bg-transparent transition-transform duration-300 hover:-translate-y-1 motion-reduce:transform-none motion-reduce:transition-none",d&&"ring-2 ring-ring",x&&"opacity-40",c),children:[(0,s.jsxs)("div",{className:"relative isolate aspect-square w-full bg-transparent",children:[o.length>0&&(0,s.jsxs)("div",{className:"absolute left-1.5 top-1.5 z-50 flex max-w-[calc(100%-5rem)] flex-wrap gap-1",children:[o.slice(0,2).map(e=>(0,s.jsx)("span",{className:"max-w-20 truncate rounded-md bg-amber-100/90 px-1.5 py-0.5 text-[9px] font-semibold text-amber-800 shadow-sm backdrop-blur dark:bg-amber-950/90 dark:text-amber-200",children:e},e)),o.length>2&&(0,s.jsxs)("span",{className:"rounded-md bg-amber-100/90 px-1.5 py-0.5 text-[9px] font-semibold text-amber-800 shadow-sm backdrop-blur dark:bg-amber-950/90 dark:text-amber-200",children:["+",o.length-2]})]}),(0,s.jsxs)("div",{className:(0,u.cn)(g().scene,g().compactScene),children:[(0,s.jsx)("div",{className:g().shadow}),(0,s.jsx)("div",{className:g().contents,children:E.length>0?E.map((e,t)=>(0,s.jsx)(j,{file:e,delay:42*t,index:t,totalCount:E.length,isVisible:T,projectCard:!0},e.id)):(0,s.jsxs)("div",{className:g().emptyPapers,"aria-hidden":"true",children:[(0,s.jsx)("div",{}),(0,s.jsx)("div",{}),(0,s.jsx)("div",{children:(0,s.jsx)(m.A,{size:24,strokeWidth:1.2})})]})}),(0,s.jsx)("div",{className:g().front,"aria-hidden":"true",children:(0,s.jsx)("div",{className:g().glass})})]}),h&&0===E.length&&(0,s.jsx)("span",{role:"status",className:"sr-only",children:k("正在加载文件夹内容...")}),d&&(0,s.jsx)("div",{className:"absolute inset-x-0 bottom-2 z-50 flex justify-center",children:(0,s.jsx)("span",{className:"rounded-full bg-amber-100 px-2.5 py-1 text-[10px] font-semibold text-amber-800 shadow-sm dark:bg-amber-950 dark:text-amber-200",children:k("放入此文件夹")})}),M&&(0,s.jsx)("div",{className:"absolute right-1.5 top-1.5 z-50",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:M})]}),(0,s.jsxs)("div",{className:"relative min-w-0 px-1 pb-1 pt-2 text-center",children:[(0,s.jsx)("h3",{className:"line-clamp-2 text-[11px] font-medium leading-snug text-foreground sm:text-xs",title:t,children:t}),(0,s.jsx)("div",{className:"sr-only",children:a}),l&&(0,s.jsx)("div",{className:"mt-1 flex min-w-0 justify-center",children:l})]})]}):v?(0,s.jsxs)("div",{onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),onFocus:()=>A(!0),onBlur:()=>A(!1),onClick:w,onDoubleClick:_,className:(0,u.cn)("group/folder relative flex min-w-0 cursor-pointer flex-col",g().projectCard,d&&"ring-2 ring-ring",x&&"opacity-40",c),children:[(0,s.jsxs)("div",{className:g().projectVisual,children:[(0,s.jsxs)("div",{className:g().scene,children:[(0,s.jsx)("div",{className:g().shadow}),(0,s.jsx)("div",{className:g().contents,children:f&&S!==f?(0,s.jsx)("div",{className:g().cover,children:(0,s.jsx)("img",{src:f,alt:k("{name}封面").replace("{name}",t),loading:"lazy",onError:()=>z(f),className:"size-full rounded-lg object-cover"})}):E.length>0?E.map((e,t)=>(0,s.jsx)(j,{file:e,delay:42*t,index:t,totalCount:E.length,isVisible:T,projectCard:!0},e.id)):(0,s.jsxs)("div",{className:g().emptyPapers,"aria-hidden":"true",children:[(0,s.jsx)("div",{}),(0,s.jsx)("div",{}),(0,s.jsx)("div",{children:(0,s.jsx)(m.A,{size:24,strokeWidth:1.2})})]})}),(0,s.jsx)("div",{className:g().front,"aria-hidden":"true",children:(0,s.jsx)("div",{className:g().glass})})]}),h&&0===E.length&&(0,s.jsx)("div",{role:"status","aria-label":k("正在加载项目预览"),className:"absolute inset-x-0 bottom-0 h-0.5 animate-pulse bg-muted motion-reduce:animate-none"}),M&&(0,s.jsx)("div",{className:"absolute right-3 top-3 z-50",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:M})]}),(0,s.jsxs)("div",{className:g().projectCaption,children:[(0,s.jsx)("h3",{className:"truncate text-sm font-semibold leading-snug text-foreground sm:text-base",title:t,children:t}),(0,s.jsx)("p",{className:g().projectSubtitle,title:a,children:a}),l&&(0,s.jsx)("div",{className:"mt-1 flex min-w-0 justify-center",children:l})]})]}):(0,s.jsxs)("div",{onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),onFocus:()=>A(!0),onBlur:()=>A(!1),onClick:w,onDoubleClick:_,className:(0,u.cn)("group/folder relative flex min-h-[9.5rem] cursor-pointer select-none flex-col overflow-visible rounded-2xl bg-transparent shadow-none transition-all duration-300 sm:min-h-[12rem]","hover:z-30 hover:-translate-y-1",d&&"z-30 scale-[1.03]",x&&"opacity-40",c),style:{perspective:"1200px"},children:[(0,s.jsxs)("div",{className:(0,u.cn)("relative z-10 flex items-center justify-center overflow-visible bg-transparent",v?"aspect-[4/3] min-h-40 w-full":"h-[6.75rem] sm:h-auto sm:aspect-square"),children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-500 group-hover/folder:opacity-100",style:{background:"radial-gradient(circle at 50% 76%, rgba(245, 158, 11, 0.18) 0%, transparent 58%)"}}),o.length>0&&(0,s.jsxs)("div",{className:"absolute left-2 top-2 z-40 flex max-w-[calc(100%-2.75rem)] flex-wrap gap-1",children:[o.slice(0,2).map(e=>(0,s.jsx)("span",{className:"max-w-16 truncate rounded-md bg-amber-100/85 px-1.5 py-0.5 text-[9px] font-semibold text-amber-800 shadow-sm backdrop-blur",children:e},e)),o.length>2&&(0,s.jsxs)("span",{className:"rounded-md bg-amber-100/85 px-1.5 py-0.5 text-[9px] font-semibold text-amber-800 shadow-sm backdrop-blur",children:["+",o.length-2]})]}),M&&(0,s.jsx)("div",{className:"absolute right-2 top-2 z-50",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:M}),(0,s.jsxs)("div",{className:"relative z-20 size-24 overflow-visible sm:size-36",children:[h&&C&&0===E.length&&(0,s.jsx)("div",{className:"absolute left-1/2 top-3 z-40 h-1.5 w-16 -translate-x-1/2 overflow-hidden rounded-full bg-amber-100",children:(0,s.jsx)("div",{className:"h-full w-1/2 animate-shimmer rounded-full bg-amber-300"})}),E.map((e,t)=>(0,s.jsx)(j,{file:e,delay:42*t,index:t,totalCount:E.length,isVisible:T},e.id)),(0,s.jsx)("div",{className:"absolute left-1/2 top-1/2 h-[3.45rem] w-[4.875rem] -translate-x-1/2 -translate-y-1/2 roun
1ded-lg shadow-md transition-transform duration-700 sm:h-20 sm:w-28",style:{background:b.back,transformOrigin:"bottom center",transform:C?"translate(-50%, -50%) rotateX(-18deg) scaleY(1.04)":"translate(-50%, -50%) rotateX(0deg) scaleY(1)",zIndex:10}}),(0,s.jsx)("div",{className:"absolute left-[1.3rem] top-[1.45rem] h-3 w-9 rounded-t transition-transform duration-700 sm:left-9 sm:top-8 sm:h-5 sm:w-12 sm:rounded-t-md",style:{background:b.tab,transformOrigin:"bottom center",transform:C?"rotateX(-28deg) translateY(-3px)":"rotateX(0deg)",zIndex:11}}),(0,s.jsx)("div",{className:"absolute left-1/2 top-[3.2rem] h-[3.45rem] w-[4.875rem] -translate-x-1/2 rounded-lg shadow-[0_12px_24px_rgba(245,158,11,0.20)] transition-transform duration-700 sm:top-[4.7rem] sm:h-20 sm:w-28 sm:shadow-[0_16px_32px_rgba(245,158,11,0.22)]",style:{background:b.front,transformOrigin:"bottom center",transform:C?"translateX(-50%) rotateX(34deg) translateY(12px)":"translateX(-50%) rotateX(0deg)",zIndex:30}}),(0,s.jsx)("div",{className:"pointer-events-none absolute left-1/2 top-[3.2rem] h-[3.45rem] w-[4.875rem] -translate-x-1/2 rounded-lg opacity-80 transition-transform duration-700 sm:top-[4.7rem] sm:h-20 sm:w-28",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.48) 0%, transparent 58%)",transformOrigin:"bottom center",transform:C?"translateX(-50%) rotateX(34deg) translateY(12px)":"translateX(-50%) rotateX(0deg)",zIndex:31}}),!T&&(f&&S!==f?(0,s.jsx)("img",{src:f,alt:k("{name}封面").replace("{name}",t),loading:"lazy",onError:()=>z(f),className:"absolute left-1/2 top-[3.65rem] z-40 size-8 -translate-x-1/2 rounded-md object-cover transition-opacity duration-300 group-hover/folder:opacity-0 sm:top-[5.35rem] sm:size-12"}):(0,s.jsx)(p.A,{className:"absolute left-1/2 top-[3.85rem] z-40 size-5 -translate-x-1/2 text-amber-800/45 transition-opacity duration-300 group-hover/folder:opacity-0 sm:top-[5.8rem] sm:size-7",strokeWidth:1.7}))]}),d&&(0,s.jsx)("div",{className:"absolute inset-x-0 bottom-3 z-50 flex justify-center",children:(0,s.jsx)("span",{className:"rounded-full bg-amber-100 px-2.5 py-1 text-[10px] font-semibold text-amber-800 shadow-sm",children:k("放入此文件夹")})})]}),(0,s.jsxs)("div",{className:"relative z-20 px-2 pb-3 pt-2 text-center sm:px-3 sm:pb-4 sm:pt-1",children:[(0,s.jsx)("h3",{className:"truncate text-[13px] font-semibold leading-snug text-foreground",title:t,children:t}),(0,s.jsx)("p",{className:"mt-1 truncate text-[11px] font-medium text-muted-foreground",children:E.length>0?k("{name} \xb7 {count} 个预览").replace("{name}",a||k("文件夹")).replace("{count}",String(E.length)):a||k("文件夹")})]})]})}}}]);

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.