PageSourceSearch

https://voooai.com/assets/TaskListPanel.ByUpCvmn.js

js voooai.com collected 2026-10-04 11:11:03 UTC 20,250 bytes, 1 lines download raw bytes

1var be=Object.defineProperty,pe=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var te=(r,i,a)=>i in r?be(r,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[i]=a,D=(r,i)=>{for(var a in i||(i={}))Ee.call(i,a)&&te(r,a,i[a]);if(ee)for(var a of ee(i))_e.call(i,a)&&te(r,a,i[a]);return r},K=(r,i)=>pe(r,ye(i));var S=(r,i,a)=>new Promise((h,n)=>{var N=p=>{try{T(a.next(p))}catch(_){n(_)}},x=p=>{try{T(a.throw(p))}catch(_){n(_)}},T=p=>p.done?h(p.value):Promise.resolve(p.value).then(N,x);T((a=a.apply(r,i)).next())});import{j as e}from"./mui-vendor.D0QeGq5V.js";import{a as d}from"./react-vendor.B5Dkw6il.js";import{e as ve,p as Ne,h as je,u as Te,c as we,J as Ie,n as re,g as L,R as ke,S as Oe}from"./index.DaOrSFlw.js";import{i as W,p as Ce}from"./imageCache.Cdpukf9s.js";import{b,T as g,i as B,a as A}from"./task.DiHQfhYb.js";import{C as $,ab as G,X as R,q as H,G as De,a as Ae}from"./lucide.FYt__DOd.js";const y={TEXT_TO_IMAGE:0,IMAGE_TO_IMAGE:1,TEXT_TO_VIDEO:2,IMAGE_TO_VIDEO:3,VIDEO_TO_VIDEO:4,TEXT_TO_AUDIO:5},E={IMAGE:"image",VIDEO:"video",AUDIO:"audio"},Re={[y.TEXT_TO_IMAGE]:"文生图",[y.IMAGE_TO_IMAGE]:"图生图",[y.TEXT_TO_VIDEO]:"文生视频",[y.IMAGE_TO_VIDEO]:"图生视频",[y.VIDEO_TO_VIDEO]:"视频生视频",[y.TEXT_TO_AUDIO]:"文生音频"},se={[E.IMAGE]:"图片",[E.VIDEO]:"视频",[E.AUDIO]:"音频"},Me={[E.IMAGE]:"Image",[E.VIDEO]:"Video",[E.AUDIO]:"Music"},Se={[E.IMAGE]:{light:"bg-blue-500",dark:"dark:bg-blue-600"},[E.VIDEO]:{light:"bg-red-500",dark:"dark:bg-red-600"},[E.AUDIO]:{light:"bg-green-500",dark:"dark:bg-green-600"}},ie=r=>{if(r.task_type==="audio"||r.audio_url)return y.TEXT_TO_AUDIO;const a=r.reference_image_ids&&r.reference_image_ids.length>0,h=r.task_type==="video"||r.video_url,n=r.reference_image_ids&&r.reference_image_ids.some(x=>x&&typeof x=="string"&&x.toLowerCase().includes("video")),N=h&&n;return h?a?N?y.VIDEO_TO_VIDEO:y.IMAGE_TO_VIDEO:y.TEXT_TO_VIDEO:a?y.IMAGE_TO_IMAGE:y.TEXT_TO_IMAGE},Le=r=>r.task_type==="audio"||r.audio_url?E.AUDIO:ie(r)<=y.IMAGE_TO_IMAGE?E.IMAGE:E.VIDEO,Ge=r=>{const i=ie(r),a=Le(r);return{type:i,typeLabel:Re[i],group:a,groupLabel:se[a],badge:se[a],icon:Me[a],colors:Se[a]}},Pe=r=>typeof r=="string"&&(r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")||r.startsWith("blob:")),ze=({imageId:r,alt:i="",className:a="",title:h})=>{const n=Pe(r),[N,x]=d.useState(()=>n?"":W.get(r)||""),[T,p]=d.useState(!1),_=d.useRef(!1),I=d.useRef(!1),j=()=>{r&&(x(""),Ce(r,Ne).then(v=>{I.current||(v?(x(v),p(!1)):p(!0))}))};d.useEffect(()=>{if(I.current=!1,_.current=!1,p(!1),n||!r){x("");return}const v=W.get(r);if(v){x(v);return}return j(),()=>{I.current=!0}},[r,n]);const k=()=>{if(!_.current&&r){_.current=!0;try{W.delete(r)}catch(v){}j();return}p(!0)};if(n){const v=ve(r,120);return e.jsx("img",{src:v,alt:i,title:h||r,className:a})}return T||!N?e.jsx("svg",{className:`m-auto text-gray-400 ${a||""}`,style:{width:"60%",height:"60%"},fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:e.jsx("path",{d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z"})}):e.jsx("img",{src:N,alt:i,title:h,className:a,onError:k})},ae=Object.freeze({[b.CONTENT_MODERATION_FAILED]:"task.error.content_moderation_failed",[b.MODERATION_FAIL_CLOSED]:"task.error.moderation_fail_closed",[b.ENGINE_ERROR]:"task.error.engine_error",[b.ENGINE_CONFIG_ERROR]:"task.error.engine_config_error",[b.ENGINE_CREATE_FAILED]:"task.error.engine_create_failed",[b.ENGINE_EXCEPTION]:"task.error.engine_exception",[b.TASK_EXCEPTION]:"task.error.task_exception"}),ne=Object.freeze({[b.CONTENT_MODERATION_FAILED]:"Content moderation failed: your prompt or image may violate platform rules.",[b.MODERATION_FAIL_CLOSED]:"Content moderation service is temporarily unavailable. Please try again later.",[b.ENGINE_ERROR]:"Generation engine returned an error. Please try again or switch engine.",[b.ENGINE_CONFIG_ERROR]:"Engine configuration error. Please contact support.",[b.ENGINE_CREATE_FAILED]:"Failed to initialize generation engine. Please try again later.",[b.ENGINE_EXCEPTION]:"Generation engine encountered an unexpected error.",[b.TASK_EXCEPTION]:"Task failed due to an unexpected error."});function Ve(r,i,a){if(r&&ae[r]){const h=ae[r];if(typeof i=="function"){const n=i(h);if(n&&n!==h)return n}if(ne[r])return ne[r]}
1return a&&typeof a=="string"&&a.trim()?a:"Unknown error"}Object.freeze(new Set([b.CONTENT_MODERATION_FAILED]));const He=({isOpen:r,onClose:i})=>{const{user:a,refreshUserInfo:h}=je(),{t:n}=Te(),{openDownload:N}=we(),[x,T]=d.useState([]),[p,_]=d.useState(!1),[I,j]=d.useState(null),[k,v]=d.useState(!1),[u,O]=d.useState(null),[le,oe]=d.useState({}),Y=d.useRef({}),P=d.useRef({}),w=d.useRef(null),ce=d.useRef(null),[q,de]=d.useState({}),z=d.useRef({}),C=d.useCallback(()=>S(null,null,function*(){if(!localStorage.getItem("token")||!a){T([]),_(!1);return}try{const s=yield Ie();if(!s.success){if(s.status===401){j(s.error||"会话已过期,请重新登录"),h&&typeof h=="function"&&h().catch(()=>{});return}j(s.error||"获取任务列表失败");return}const f=[...s.tasks.slice(0,40).map(c=>K(D({},c),{status:c.status||g.PENDING}))].sort((c,m)=>{const M={[g.PENDING]:0,processing:1,executing:1,[g.COMPLETED]:2,[g.FAILED]:3,[g.CANCELLED]:4},Z=M[c.status]-M[m.status];return Z!==0?Z:new Date(m.created_at)-new Date(c.created_at)});f.forEach(c=>{const m=Y.current[c.id];B(c.status)&&m!==c.status&&(P.current[c.id]=new Date),Y.current[c.id]=c.status}),T(f),j(null)}catch(s){console.error("[TaskListPanel] fetchTasks error:",s)}finally{_(!1)}}),[a,h]);d.useEffect(()=>{if(r){_(!0),C(),w.current=setInterval(()=>{C()},5e3),window.dispatchEvent(new CustomEvent("taskPanelVisibilityChange",{detail:{isOpen:!0}}));const t=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",t>0&&(document.body.style.paddingRight=`${t}px`)}else w.current&&(clearInterval(w.current),w.current=null),window.dispatchEvent(new CustomEvent("taskPanelVisibilityChange",{detail:{isOpen:!1}})),document.body.style.overflow="",document.body.style.paddingRight="",O(null);return()=>{w.current&&(clearInterval(w.current),w.current=null),window.dispatchEvent(new CustomEvent("taskPanelVisibilityChange",{detail:{isOpen:!1}})),document.body.style.overflow="",document.body.style.paddingRight=""}},[r,C]),d.useEffect(()=>{const t=s=>{s.key==="Escape"&&r&&(u?O(null):i())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[r,i,u]);const V=d.useCallback((t,s,o)=>{try{const l=new Date;if(B(o)&&P.current[t]){const f=P.current[t],c=(l-f)/1e3,m=Math.min(c/20,1);return Math.max(m*70,0)}if(B(o)){const f=new Date(s),c=(l-f)/1e3,m=Math.min(c/20,1);return Math.max(m*70,0)}if(o===g.PENDING){const f=new Date(s),c=(l-f)/1e3,m=Math.min(c/480,1);return Math.max(15*(1-Math.exp(-.8*m)),0)}return 0}catch(l){return 0}},[]);d.useEffect(()=>{if(!r)return;const t=setInterval(()=>{const s=x.filter(o=>o&&o.status&&A(o.status));if(s.length>0){const o={};s.forEach(l=>{l!=null&&l.id&&(l!=null&&l.created_at)&&(l!=null&&l.status)&&(o[l.id]=V(l.id,l.created_at,l.status))}),oe(l=>{let f=!1;return Object.keys(o).forEach(c=>{l[c]!==o[c]&&(f=!0)}),f?D(D({},l),o):l})}},500);return()=>clearInterval(t)},[r,x,V]);const ue=t=>S(null,null,function*(){j(null);try{const s=yield Oe(t);if(!s.success){j(s.error||"取消任务失败");return}yield C()}catch(s){console.error("取消任务失败:",s),j("取消任务失败,请重试")}}),J=t=>{t.status===g.COMPLETED&&(t.image_url||t.video_url||t.audio_url)&&O(t)},xe=()=>S(null,null,function*(){v(!0),yield C(),v(!1)}),ge=t=>{try{return new Date(t).toLocaleString()}catch(s){return t}},me=t=>{const s={[g.PENDING]:{bg:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",icon:e.jsx($,{size:14}),text:n("task.status.pending")},[g.RUNNING]:{bg:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",icon:e.jsx(G,{size:14,className:"animate-spin"}),text:n("task.status.processing")},processing:{bg:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",icon:e.jsx(G,{size:14,className:"animate-spin"}),text:n("task.status.processing")},executing:{bg:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",icon:e.jsx(G,{size:14,className:"animate-spin"}),text:n("task.status.processing")},[g.COMPLETED]:{bg:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",icon:e.jsx(Ae,{size:14}),text:n("task.status.completed")},[g.FAILED]:{bg:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",icon:e.jsx(H,{size:14}),text:n("task.status.failed")},[g.CANCELLED]:{bg:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",icon:e.jsx(R,{size:14}),text:n("task.status.cancelled")}};return s[t]||s[g.PENDING]};d.useEffect(()=>{r&&x.forEach(t=>{if(t.status===g.COMPLETED&&t.video_url&&!z.current[t.video_url]){z.current[t.video_url]="__loading__";const s=document.createElement("video");s.crossOrigin="anonymous",s.preload="metadata",s.muted=!0,s.src=re(t.video_url),s.onloadeddata=()=>{s.currentTime=.1},s.onseeked=()=>{try{const o=document.createElement("canvas");o.width=s.videoWidth||160,o.height=s.videoHeight||90,o.getContext("2d").drawImage(s,0,0,o.width,o.height);const f=o.toDataURL("image/jpeg",.6);z.current[t.video_url]=f,de(c=>K(D({},c),{[t.video_url]:f}))}catch(o){}s.src="",s.load()},s.onerror=()=>{s.src=""}}})},[r,x]);const[U,Q]=d.useState(!1),[fe,F]=d.useState(!1);d.useEffect(()=>{if(r)Q(!0),F(!1);else if(U){F(!0);const t=setTimeout(()=>{Q(!1),F(!1)},300);return()=>clearTimeout(t)}},[r,U]);const he=U,X=r&&!fe;return he?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[10001] transition-opacity duration-300",style:{backgroundColor:"rgba(0,0,0,0.5)",opacity:X?1:0,pointerEvents:X?"auto":"none"},onClick:i}),e.jsxs("div",{ref:ce,className:"fixed top-0 right-0 h-full w-full max-w-[480px] bg-white dark:bg-gray-800 shadow-2xl z-[10002] flex flex-col",style:{transform:X?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out"},children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[e.jsxs("h2",{className:"text-lg font-bold text-gray-800 dark:text-white flex items-center gap-2",children:[e.jsx($,{size:20}),n("taskManagement.title")||"任务管理"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-all duration-300 ${k?"opacity-50 cursor-not-allowed text-gray-400":"bg-blue-500 hover:bg-blue-600 text-white"}`,onClick:xe,disabled:k,children:[e.jsx(G,{size:14,className:k?"animate-spin":""}),n("refresh")||"刷新"]}),e.jsx("button",{className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 dark:text-gray-400 transition-colors",onClick:i,title:n("task.action.close")||"关闭",children:e.jsx(R,{size:22})})]})]}),I&&e.jsx("div",{className:"mx-5 mt-3 p-3 bg-red-50 dark:bg-red-900/30 text-red-600 dark:text-red-400 rounded-lg text-sm",children:I}),!a&&e.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(H,{size:40,className:"text-gray-300 dark:text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm font-medium mb-2",children:n("task.management.login.required")||"请登录您的账户以查看和管理任务。"})]})}),a&&e.jsx("div",{className:"flex-1 overflow-y-auto p-4",style:{overscrollBehavior:"contain",scrollbarWidth:"thin",scrollbarColor:"#cbd5e1 transparent"},children:p?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12",children:[e.jsxs("svg",{className:"animate-spin h-8 w-8 text-blue-500 mb-3",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"})]}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:n("task.list.loading")||"加载任务中..."})]}):x.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12",children:[e.jsx($,{size:40,className:"text-gray-300 dark:text-gray-600 mb-3 opacity-50"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:n("task.no.tasks")||"暂无任务"}),e.jsx("p",{className:"text-gray-400 dark:text-gray-500 text-xs mt-1",children:n("task.no.tasks.hint")||"提交生成任务后将在这里显示"})]}):e.jsx("div",{className:"space-y-3",children:x.map(t=>{const s=me(t.status),o=Ge(t),l=t.reference_image_ids||[],f=l.length>0,c=Math.round(le[t.id]||V(t.id,t.created_at,t.status));return e.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg border border-gray-200 dark:border-gray-600 hover:border-blue-400 hover:shadow-md transition-all cursor-pointer",onClick:()=>J(t),children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0 relative",children:t.status===g.COMPLETED&&(t.image_url||t.video_url||t.audio_url)?t.audio_url?e.jsxs("div",{className:"w-16 h-16 rounded-md overflow-hidden bg-gradient-to-br from-green-500 to-emerald-600 flex flex-col items-center justify-center shadow-md",children:[e.jsx("div",{className:"text-2xl text-white mb-0.5",children:"🎵"}),e.jsx("div",{className:"text-xs text-white/80 font-medium",children:n("audio")||"音频"})]}):e.jsx("div",{className:"w-16 h-16 rounded-md overflow-hidden bg-gray-200 dark:bg-gray-600",children:t.video_url?e.jsxs("div",{className:"w-full h-full bg-black flex items-center justify-center relative",children:[q[t.video_url]?e.jsx("img",{src:L(q[t.video_url]),alt:"Video",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full bg-gray-900"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:e.jsx("span",{className:"text-lg",children:"▶️"})})]}):e.jsx("img",{src:L(t.image_url),alt:"",className:"w-full h-full object-cover"})}):A(t.status)?e.jsxs("div",{className:"w-16 h-16 rounded-md bg-gray-100 dark:bg-gray-600 flex items-center justify-center relative",children:[e.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-500",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"})]}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/60 text-white text-xs font-semibold text-center py-0.5 rounded-b-md",children:[c,"%"]})]}):e.jsx("div",{className:"w-16 h-16 rounded-md bg-gray-100 dark:bg-gray-600 flex items-center justify-center",children:t.status===g.FAILED?e.jsx(H,{size:20,className:"text-red-400"}):e.jsx(R,{size:20,className:"text-gray-400"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${s.bg}`,children:[s.icon,e.jsx("span",{className:"ml-1",children:s.text})]}),o.groupLabel&&e.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:o.groupLabel})]}),e.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300 line-clamp-2 leading-relaxed mb-1",children:t.prompt||"-"}),A(t.status)&&e.jsx("div",{className:"w-full mt-1",children:e.jsx("div",{className:"w-full h-1.5 bg-gray-300 dark:bg-gray-500 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-blue-400 to-blue-500 dark:from-blue-500 dark:to-blue-600 transition-all duration-300 rounded-full",style:{width:`${Math.max(2,c)}%`}})})}),t.status===g.FAILED&&t.error_message&&e.jsx("p",{className:"text-xs text-red-500 dark:text-red-400 line-clamp-1 mt-1",children:Ve(t.error_code,n,t.error_message)}),f&&e.jsx("div",{className:"flex gap-1 mt-1",children:l.slice(0,4).map((m,M)=>e.jsx("div",{className:"w-7 h-7 rounded-sm bg-gray-200 dark:bg-gray-600 overflow-hidden border border-gray-300 dark:border-gray-500 flex items-center justify-center",children:e.jsx(ze,{imageId:m,alt:`ref ${M+1}`,className:"w-full h-full object-cover"})},m))}),e.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-xs text-gray-400 dark:text-gray-500",children:[e.jsx("span",{children:ge(t.created_at)}),t.points_consumed>0&&e.jsx(ke,{points:t.points_consumed,size:"xs"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 flex-shrink-0 items-center justify-center",children:[t.status===g.COMPLETED&&(t.image_url||t.video_url||t.audio_url)&&e.jsx("button",{onClick:m=>{m.stopPropagation(),J(t)},className:"inline-flex items-center justify-center w-7 h-7 p-0 border-0 rounded hover:bg-blue-100 dar
1k:hover:bg-blue-900/30 text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",title:n("task.action.view")||"查看结果",children:e.jsx(De,{size:16})}),A(t.status)&&e.jsx("button",{onClick:m=>{m.stopPropagation(),ue(t.id)},className:"inline-flex items-center justify-center w-7 h-7 p-0 border-0 rounded hover:bg-red-100 dark:hover:bg-red-900/30 text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",title:n("task.action.cancel")||"取消",children:e.jsx(R,{size:16})})]})]})},t.id)})})}),a&&x.length>0&&e.jsxs("div",{className:"px-5 py-3 border-t border-gray-200 dark:border-gray-700 flex-shrink-0 text-xs text-gray-500 dark:text-gray-400 flex items-center justify-between",children:[e.jsxs("span",{children:[n("task.total")||"共"," ",x.length," ",n("task.items")||"个任务"]}),e.jsxs("span",{children:[x.filter(t=>A(t.status)).length," ",n("task.active")||"进行中"]})]})]}),u&&e.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[10003] p-4",onClick:()=>O(null),children:e.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh] flex flex-col",onClick:t=>t.stopPropagation(),children:[e.jsx("button",{className:"absolute -top-2 -right-2 z-10 p-1.5 bg-white/90 dark:bg-gray-700/90 rounded-full shadow-lg text-gray-600 dark:text-gray-300 hover:bg-white dark:hover:bg-gray-600 transition-colors",onClick:()=>O(null),children:e.jsx(R,{size:18})}),u.audio_url?e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-8 flex flex-col items-center gap-4",children:[e.jsx("div",{className:"text-5xl",children:"🎵"}),e.jsx("audio",{src:L(u.audio_url,"audio"),controls:!0,className:"w-full max-w-md"}),u.prompt&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 text-center line-clamp-3 max-w-md",children:u.prompt})]}):u.video_url?e.jsx("video",{src:re(u.video_url),controls:!0,preload:"metadata",controlsList:"nodownload",onContextMenu:t=>{t.preventDefault(),u.video_url&&N(u.video_url,{type:"video"})},autoPlay:!0,className:"max-w-full max-h-[85vh] object-contain rounded-lg"}):e.jsx("img",{src:L(u.image_url),alt:u.prompt||"Generated result",onContextMenu:t=>{t.preventDefault(),u.image_url&&N(u.image_url,{type:"image"})},className:"max-w-full max-h-[85vh] object-contain rounded-lg"}),e.jsxs("div",{className:"flex items-center justify-between mt-2 px-1",children:[e.jsx("p",{className:"text-xs text-white/70 line-clamp-1 max-w-[60%]",children:u.prompt}),(()=>{const t=u.audio_url||u.video_url||u.image_url,s=u.task_type==="audio"?"audio":u.task_type==="video"||u.video_url?"video":"image",o=l=>{l.preventDefault(),t&&N(t,{type:s})};return e.jsx("button",{type:"button",onClick:o,onContextMenu:o,disabled:!t,className:"inline-flex items-center gap-1 px-3 py-1.5 bg-white/20 hover:bg-white/30 disabled:opacity-50 text-white rounded-lg text-xs transition-colors",children:n("download")||"下载"})})()]})]})})]}):null};export{He 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.