From 5f06fd06cf17fa46d188a2e2d54fffa3fcef90e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E4=BD=B3=E8=89=BA?= Date: Thu, 25 Jun 2026 17:19:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BE=B9=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dist/assets/{index-DUhIsGse.js => index-DH3LzPJl.js} | 4 ++-- video-gen-app/dist/index.html | 2 +- video-gen-app/src/components/Layout/AppLayout.tsx | 4 ++-- video-gen-app/src/pages/RemoveInfo.tsx | 8 +++++--- 4 files changed, 10 insertions(+), 8 deletions(-) rename video-gen-app/dist/assets/{index-DUhIsGse.js => index-DH3LzPJl.js} (99%) diff --git a/video-gen-app/dist/assets/index-DUhIsGse.js b/video-gen-app/dist/assets/index-DH3LzPJl.js similarity index 99% rename from video-gen-app/dist/assets/index-DUhIsGse.js rename to video-gen-app/dist/assets/index-DH3LzPJl.js index 249f379e..6383ed5a 100644 --- a/video-gen-app/dist/assets/index-DUhIsGse.js +++ b/video-gen-app/dist/assets/index-DH3LzPJl.js @@ -402,7 +402,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } } - `})]})},B7={HomeOutlined:(0,$.jsx)(u3,{}),DashboardOutlined:(0,$.jsx)(T4,{}),CodeOutlined:(0,$.jsx)(u4,{}),PlayCircleOutlined:(0,$.jsx)(s6,{}),WalletOutlined:(0,$.jsx)(L8,{}),SettingOutlined:(0,$.jsx)(P6,{}),BellOutlined:(0,$.jsx)(T2,{}),UserOutlined:(0,$.jsx)(j8,{}),AppstoreOutlined:(0,$.jsx)(t2,{}),FileTextOutlined:(0,$.jsx)(NU,{}),StarOutlined:(0,$.jsx)(i8,{}),HeartOutlined:(0,$.jsx)(t3,{}),CameraOutlined:(0,$.jsx)(B2,{}),RobotOutlined:(0,$.jsx)(s6,{}),CalculatorOutlined:(0,$.jsx)(L2,{}),DollarOutlined:(0,$.jsx)(j4,{}),GiftOutlined:(0,$.jsx)(Y4,{}),ThunderboltOutlined:(0,$.jsx)(g8,{}),FireOutlined:(0,$.jsx)(U4,{}),CloudOutlined:(0,$.jsx)(t4,{}),SmileOutlined:(0,$.jsx)(Y6,{}),TrophyOutlined:(0,$.jsx)(S8,{}),RocketOutlined:(0,$.jsx)(S6,{}),BulbOutlined:(0,$.jsx)(P2,{}),PictureOutlined:(0,$.jsx)(Q3,{}),VideoCameraOutlined:(0,$.jsx)(P8,{}),AudioOutlined:(0,$.jsx)(p2,{}),MailOutlined:(0,$.jsx)(j3,{}),PhoneOutlined:(0,$.jsx)(Y3,{}),GlobalOutlined:(0,$.jsx)(Q4,{}),ShoppingCartOutlined:(0,$.jsx)(L6,{}),TeamOutlined:(0,$.jsx)(p8,{}),BarChartOutlined:(0,$.jsx)(S2,{}),PieChartOutlined:(0,$.jsx)(t6,{}),LineChartOutlined:(0,$.jsx)(S3,{}),SecurityScanOutlined:(0,$.jsx)(O6,{}),ApiOutlined:(0,$.jsx)(Q0,{}),DatabaseOutlined:(0,$.jsx)(O4,{}),CloudServerOutlined:(0,$.jsx)(i4,{})},V7=240,H7=[{gradient:`linear-gradient(135deg, #c9a96e, #a67c52)`,shadow:`rgba(201,169,110,0.25)`,icon:(0,$.jsx)(pJ,{})},{gradient:`linear-gradient(135deg, #4a5568, #2d3748)`,shadow:`rgba(74,85,104,0.25)`,icon:(0,$.jsx)(B4,{})},{gradient:`linear-gradient(135deg, #718096, #4a5568)`,shadow:`rgba(113,128,150,0.25)`,icon:(0,$.jsx)(y4,{})},{gradient:`linear-gradient(135deg, #5a67d8, #434190)`,shadow:`rgba(90,103,216,0.25)`,icon:(0,$.jsx)(g2,{})}],U7=()=>{let e=qe(),t=We(),{user:n,logout:r}=I7(),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c]=SW.useForm(),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)({}),[_,v]=(0,S.useState)(0),[y,b]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteName||``;return t&&(document.title=t),t}),[x,C]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteLogo||``;if(t){let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=t,e.type=`image/png`}return t}),[w,T]=(0,S.useState)(!localStorage.getItem(`siteInfo`)),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(`alipay`),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)(180),I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null),[z,B]=(0,S.useState)({alipay:!1,wechat:!1}),V=`pending_payment_order`;(0,S.useEffect)(()=>{M5().then(e=>{let t=e.siteName||`民众智创`,n=e.siteLogo||``;if(t!==y&&(b(t),document.title=t),n&&n!==x){C(n);let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=n,e.type=`image/png`}localStorage.setItem(`siteInfo`,JSON.stringify({siteName:t,siteLogo:n}))}).catch(()=>{})},[]);let H=()=>{L5().then(e=>{v(e)}).catch(()=>{})};(0,S.useEffect)(()=>{(async()=>{let e=localStorage.getItem(V);if(e)try{let t=JSON.parse(e),n=await G5(t.orderNo);if(n.status===`pending`){k({price:t.price,credits:t.credits,qrCode:t.qrCode,method:t.method}),R.current=t.orderNo;let e=Date.now(),n=new Date(t.createdAt).getTime(),r=t.timeoutSeconds||180,i=Math.floor((e-n)/1e3),a=Math.max(0,r-i);a>0?(D(!0),J(t.orderNo,a)):localStorage.removeItem(V)}else n.status===`paid`?(Q.success(`支付成功!积分已到账`),I7.getState().refreshUser(),localStorage.removeItem(V)):localStorage.removeItem(V)}catch{localStorage.removeItem(V)}})()},[]),(0,S.useEffect)(()=>{B5().then(e=>{let t=e.filter(e=>e.is_active!==!1&&e.isActive!==!1);if(n?.allowedMenus&&n.allowedMenus.length>0){let e=new Set(n.allowedMenus),r=new Set;t.forEach(t=>{let n=t.parent_id??t.parentId;n&&e.has(t.path)&&r.add(n)}),t=t.filter(t=>(t.menu_type??t.menuType)===`group`&&r.has(t.id)?!0:e.has(t.path))}f(t)}).catch(()=>{}),V5().then(e=>{m(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),H5().then(e=>{B(e),e.alipay?j(`alipay`):e.wechat&&j(`wechat`)}).catch(()=>{}),H()},[n]);let U=t.pathname.startsWith(`/records`)?`/records`:t.pathname,W=V7,ee=[{key:`profile`,icon:(0,$.jsx)(j8,{}),label:`账号: ${n?.username}`,disabled:!0},{key:`credits`,icon:(0,$.jsx)(L8,{style:{color:`#c9a96e`}}),label:`积分: ${n?.credits??0}`,disabled:!0},{type:`divider`},{key:`myCredits`,icon:(0,$.jsx)(L8,{}),label:`积分明细`},{key:`orderRecords`,icon:(0,$.jsx)(NU,{}),label:`订单记录`},{key:`messages`,icon:(0,$.jsx)(T2,{}),label:`消息中心${_>0?`(${_})`:``}`},{type:`divider`},{key:`changePwd`,icon:(0,$.jsx)(T3,{}),label:`修改密码`},{type:`divider`},{key:`logout`,icon:(0,$.jsx)(O3,{}),label:`退出登录`,danger:!0}],te=({key:t})=>{t===`logout`?(r(),e(`/login`)):t===`changePwd`?a(!0):t===`messages`?e(`/messages`):t===`recharge`?s(!0):t===`myCredits`?e(`/user-center?tab=credits`):t===`orderRecords`&&e(`/user-center?tab=orders`)},G=async()=>{try{await c.validateFields(),Q.success(`密码修改成功(演示)`),a(!1),c.resetFields()}catch{}},ne=()=>{r(),e(`/login`)},K=()=>{s(!0)},q=(0,S.useCallback)(()=>{I.current&&=(clearInterval(I.current),null),L.current&&=(clearInterval(L.current),null)},[]),J=(0,S.useCallback)((e,t=180)=>{q(),F(t),I.current=setInterval(async()=>{try{let t=await G5(e);t.status===`paid`?(q(),R.current=null,localStorage.removeItem(V),Q.success(`支付成功!积分已到账`),I7.getState().refreshUser(),D(!1),k(null),u(null)):t.status===`cancelled`&&(q(),R.current=null,localStorage.removeItem(V))}catch{}},2e3),L.current=setInterval(()=>{F(e=>e<=1?(q(),R.current&&=(K5(R.current).catch(()=>{}),null),localStorage.removeItem(V),Q.warning(`订单已超时,请重新充值`),D(!1),k(null),u(null),0):e-1)},1e3)},[q]);return(0,$.jsxs)(fK,{style:{minHeight:`100vh`},children:[(0,$.jsxs)(`div`,{className:`desktop-sidebar`,style:{width:W,position:`fixed`,left:16,top:16,bottom:16,zIndex:100,background:`linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,display:`flex`,flexDirection:`column`,transition:`width 0.25s ease, left 0.25s ease`,overflow:`hidden`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:[(0,$.jsx)(`div`,{style:{height:80,display:`flex`,alignItems:`center`,justifyContent:`flex-start`,padding:`0 20px`,flexShrink:0,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14},children:[(0,$.jsx)(`div`,{style:{width:42,height:42,borderRadius:14,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,overflow:`hidden`},children:x?(0,$.jsx)(`img`,{src:x,alt:`logo`,style:{width:28,height:28,objectFit:`contain`}}):(0,$.jsx)(g8,{style:{fontSize:20,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:17,fontWeight:700,letterSpacing:-.02,whiteSpace:`nowrap`,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:y})]})}),(0,$.jsx)(`div`,{style:{flex:1,padding:`8px 8px`,overflow:`auto`},children:(()=>{let t=d.filter(e=>(e.menu_type??e.menuType)===`group`),n=d.filter(e=>(e.menu_type??e.menuType)!==`group`),r={};n.filter(e=>e.parent_id??e.parentId).forEach(e=>{let t=e.parent_id??e.parentId;r[t]||(r[t]=[]),r[t].push(e)});let i=n.filter(e=>!(e.parent_id??e.parentId)),a=[],o=(t,n=0)=>{let r=t.path===U,i=B7[t.icon]||(0,$.jsx)(u3,{});return(0,$.jsxs)(`div`,{onClick:()=>t.path&&e(t.path),style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,padding:n>0?`8px 14px 8px 36px`:`10px 16px`,borderRadius:12,margin:`2px 6px`,cursor:`pointer`,fontSize:n>0?13:14,fontWeight:r?600:400,color:r?`#4f46e5`:`#475569`,background:r?`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%)`:`transparent`,transition:`all 0.2s ease`},children:[(0,$.jsx)(`span`,{style:{fontSize:n>0?14:16,flexShrink:0,color:r?`#6366f1`:`#64748b`},children:i}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:t.label})]},t.id)};return t.sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0)).forEach(e=>{let t=(r[e.id]||[]).sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0));a.push((0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{color:`#94a3b8`,fontSize:12,fontWeight:600,padding:`12px 16px 6px`,letterSpacing:.5,textTransform:`uppercase`},children:e.label}),t.map(e=>o(e,1))]},e.id))}),i.sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0)).forEach(e=>{a.push(o(e))}),a})()}),(0,$.jsxs)(`div`,{onClick:()=>s(!0),style:{margin:`8px 12px`,padding:`12px 20px`,borderRadius:14,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8,color:`#ffffff`,fontSize:14,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.4)`,transition:`all 0.3s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%)`,e.currentTarget.style.transform=`translateY(-1px)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.5)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(99, 102, 241, 0.4)`},children:[(0,$.jsx)(jR,{style:{fontSize:16}}),(0,$.jsx)(`span`,{children:`充值积分`})]}),(0,$.jsx)(`div`,{style:{padding:`16px 16px`,flexShrink:0},children:(0,$.jsx)(AU,{menu:{items:ee,onClick:te},placement:`topRight`,arrow:!0,children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,padding:`10px 14px`,borderRadius:14,cursor:`pointer`,transition:`all 0.25s ease`,background:`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,boxShadow:`0 2px 12px rgba(0, 0, 0, 0.04)`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(0, 0, 0, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,e.currentTarget.style.boxShadow=`0 2px 12px rgba(0, 0, 0, 0.04)`},children:[(0,$.jsx)(yT,{size:36,icon:(0,$.jsx)(j8,{}),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{color:`#1e293b`,fontSize:14,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,letterSpacing:-.01},children:n?.username}),(0,$.jsxs)(`div`,{style:{color:`#6366f1`,fontSize:12,fontWeight:500,letterSpacing:0,background:`rgba(99, 102, 241, 0.08)`,padding:`2px 8px`,borderRadius:6,display:`inline-block`},children:[`积分: `,n?.credits||0]})]})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:W+48,marginRight:32,marginTop:16,marginBottom:16,flex:1,minHeight:`calc(100vh - 32px)`,background:`transparent`,padding:0,transition:`margin-left 0.25s ease`},children:(0,$.jsx)(`div`,{style:{boxSizing:`border-box`,height:`100%`,background:`#ffffffff`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,minHeight:`100%`,padding:`24px 32px 32px`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:(0,$.jsx)(St,{})})}),(0,$.jsxs)(`div`,{className:`mobile-bottom-nav`,children:[d.filter(e=>(e.menu_type??e.menuType)!==`group`).map(t=>t.path?(0,$.jsxs)(`div`,{className:`nav-item ${t.path===U?`active`:``}`,onClick:()=>e(t.path),children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:B7[t.icon]||(0,$.jsx)(u3,{})}),(0,$.jsx)(`span`,{children:t.label})]},t.id):null),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:K,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(u6,{})}),(0,$.jsx)(`span`,{children:`充值`})]}),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:ne,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(O3,{})}),(0,$.jsx)(`span`,{children:`退出`})]})]}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(OU,{children:[(0,$.jsx)(T3,{}),`修改密码`]}),open:i,onOk:G,onCancel:()=>{a(!1),c.resetFields()},okText:`确认修改`,cancelText:`取消`,width:440,children:(0,$.jsxs)(SW,{form:c,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(SW.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(rK.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(SW.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(rK.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(SW.Item,{name:`confirmPwd`,label:`确认新密码`,rules:[{required:!0,message:`请再次输入新密码`},({getFieldValue:e})=>({validator(t,n){return!n||e(`newPwd`)===n?Promise.resolve():Promise.reject(Error(`两次密码不一致`))}})],children:(0,$.jsx)(rK.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}})})})]})}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(OU,{children:[(0,$.jsx)(Y4,{}),`积分充值`]}),open:o,onCancel:()=>{s(!1),u(null)},footer:null,width:680,children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(OU,{style:{marginBottom:16},children:[(0,$.jsx)(L8,{style:{color:`#6366f1`}}),(0,$.jsx)(g1.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(g1.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:p.map((e,t)=>{let n=H7[t%H7.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>u(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:l===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:l===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(h$,{color:`purple`,style:{position:`absolute`,top:-10,left:`50%`,transform:`translateX(-50%)`,borderRadius:8,fontSize:11},children:e.description}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:n.gradient,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,color:`#fff`,boxShadow:`0 6px 16px ${n.shadow}`},children:n.icon}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:6},children:[(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[r.toLocaleString(),` 积分`]})]}),(0,$.jsxs)(`div`,{style:{fontSize:22,fontWeight:800,marginTop:4,background:n.gradient,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:[`¥`,e.price]})]})]})]},e.id)})}),!z.alipay&&!z.wechat?(0,$.jsx)(`div`,{style:{marginTop:20,marginBottom:8,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(g1.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginTop:20,marginBottom:8},children:[(0,$.jsx)(g1.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(VL.Group,{value:A,onChange:e=>j(e.target.value),style:{display:`flex`,gap:12},children:[z.alipay&&(0,$.jsxs)(VL.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`alipay`?`#1677ff`:void 0,color:A===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(Y0,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),z.wechat&&(0,$.jsxs)(VL.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`wechat`?`#07c160`:void 0,color:A===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(U8,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:[(0,$.jsx)(jD,{size:`large`,onClick:()=>{s(!1),u(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(jD,{type:`primary`,size:`large`,disabled:!l||!z.alipay&&!z.wechat,loading:M,onClick:async()=>{let e=p.find(e=>e.id===l);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{N(!0);let n=await U5(e.id,A),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(k({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),s(!1),D(!0),R.current=n.orderNo,localStorage.setItem(V,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),J(n.orderNo)):(Q.success(`充值成功!积分已到账`),I7.getState().refreshUser(),s(!1),u(null))}catch(e){Q.error(e?.message||`创建订单失败,请重试`)}finally{N(!1)}},style:{borderRadius:10,fontWeight:600,background:l?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:l?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]})]})}),(0,$.jsx)(Dq,{open:E,onCancel:async()=>{if(q(),R.current){try{await K5(R.current)}catch{}R.current=null}localStorage.removeItem(V),D(!1),k(null)},footer:null,width:400,closable:!1,styles:{body:{padding:0,borderRadius:16,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{padding:`24px`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:24},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,background:O?.method===`alipay`?`linear-gradient(135deg, #1677ff, #0958d9)`:`linear-gradient(135deg, #07c160, #06ae56)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`,margin:`0 auto 12px`},children:O?.method===`alipay`?(0,$.jsx)(Y0,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(U8,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(g1.Title,{level:4,style:{margin:0},children:O?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(g1.Text,{style:{color:`#94a3b8`,fontSize:13},children:O?.method===`alipay`?`请使用支付宝扫描二维码完成支付`:`请使用微信扫描二维码完成支付`})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,padding:20,display:`flex`,flexDirection:`column`,alignItems:`center`,boxShadow:`0 4px 20px rgba(0,0,0,0.08)`},children:[(0,$.jsx)(`div`,{style:{width:180,height:180,borderRadius:12,overflow:`hidden`,background:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:O&&(0,$.jsx)(K0,{value:O.qrCode,size:160,level:`M`,includeMargin:!1})}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`},children:[(0,$.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,color:`#1a1a2e`},children:[`¥`,O?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,O?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:P<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:P<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:P<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:P}),` 秒后关闭`]})})]})]}),(0,$.jsx)(`div`,{style:{marginTop:20,padding:16,background:`#fef3c7`,borderRadius:12},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8},children:[(0,$.jsx)(`div`,{style:{fontSize:16,marginTop:-2},children:`💡`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#92400e`},children:[(0,$.jsx)(`div`,{style:{fontWeight:500,marginBottom:4},children:`支付提示`}),(0,$.jsxs)(`ul`,{style:{margin:0,paddingLeft:16},children:[(0,$.jsx)(`li`,{style:{marginBottom:2},children:`请在支付后等待页面自动跳转`}),(0,$.jsx)(`li`,{children:`如支付成功但未到账,请联系客服`})]})]})]})}),(0,$.jsx)(`div`,{style:{marginTop:20},children:(0,$.jsx)(jD,{size:`large`,block:!0,onClick:async()=>{if(q(),R.current){try{await K5(R.current)}catch{}R.current=null}localStorage.removeItem(V),D(!1),k(null),u(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)(z7,{})]})},W7=`http://localhost:8000/api`,G7=()=>{let{checkAuth:e}=I7(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(0),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(0),[x,C]=(0,S.useState)(!1),[w,T]=(0,S.useState)(!1),E=(()=>{try{let e=localStorage.getItem(`siteInfo`);if(e){let t=JSON.parse(e);return{siteName:t.siteName||`VideoGen.AI`,siteLogo:t.siteLogo||``}}}catch{}return{siteName:`VideoGen.AI`,siteLogo:``}})(),[D,O]=(0,S.useState)(E.siteName),[k,A]=(0,S.useState)(E.siteLogo),[j,M]=(0,S.useState)(``),[N,P]=(0,S.useState)(``),F=qe(),{login:I}=I7(),[L]=SW.useForm(),[R]=SW.useForm(),[z]=SW.useForm();(0,S.useEffect)(()=>{M5().then(e=>{O(e.siteName),A(e.siteLogo),M(e.userAgreementUrl),P(e.privacyPolicyUrl)}).catch(()=>{})},[]);let B=()=>d?!0:(Q.warning(`请先阅读并同意用户协议和隐私政策`),!1),V=async()=>{if(B())try{let t=await L.validateFields();await I(t.phone,t.password,void 0,t.rememberMe),Q.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}},H=async()=>{if(B())try{let t=R.getFieldsValue();if(!t.phone||!t.code){Q.error(`请填写手机号和验证码`);return}n(!0),await g5(t.phone,t.code),Q.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}finally{n(!1)}},U=async()=>{if(B())try{let t=await z.validateFields();n(!0),await _5(t.phone,t.regCode,t.password),Q.success(`注册成功`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Q.error(t)}finally{n(!1)}},W=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),m(!1),t?C(!0):T(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{s===0&&r===`phone`&&v(!1)},[s,r]);let ee=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Q.error(`请输入正确的手机号`);return}if(t){m(!0),g(!1);return}if(!_){m(!0),v(!1);return}let n=``;n=r===`register`?`register`:`login`,await F5(e,n),W(t?u:c),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(g(!1),u(0)):(v(!1),c(0)),b(e=>e+1)}},te=async(e=!1)=>{let t=r===`register`?z.getFieldValue(`phone`):R.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await F5(t,e),r===`register`?(g(!0),W(u,!0)):(v(!0),W(c,!1)),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(g(!1),u(0),C(!0)):(v(!1),c(0),T(!0)),b(e=>e+1)}},G=e=>{o(e),i(e),c(0),u(0),v(!1),g(!1),m(!1),C(!1),T(!1),b(e=>e+1),e===`password`?L.resetFields():R.resetFields()},ne=[{icon:(0,$.jsx)(P2,{}),title:`AI 智能优化`,desc:`输入原始提示词,AI 自动为您生成专业级视频、图片描述`},{icon:(0,$.jsx)(s6,{}),title:`一键生成视频、图片`,desc:`支持多种规格生成视频、图片`},{icon:(0,$.jsx)(s3,{}),title:`项目维度管理`,desc:`按项目行业分类视频、图片,支持多种行业`}],K={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,height:48,borderRadius:10,fontSize:14},q=e=>{e&&window.open(`${W7.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,backgroundImage:`url(/backimage.png)`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`,backgroundAttachment:`fixed`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(240,244,255,0.9) 0%, rgba(232,236,248,0.85) 40%, rgba(240,240,255,0.9) 70%, rgba(248,249,255,0.95) 100%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:500,height:500,borderRadius:`50%`,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,top:-150,right:-100,filter:`blur(40px)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:400,height:400,borderRadius:`50%`,background:`radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%)`,bottom:-100,left:-80,filter:`blur(50px)`}}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:`0 80px`,zIndex:1},children:(0,$.jsxs)(OU,{direction:`vertical`,size:36,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:20},children:[k?(0,$.jsx)(`img`,{src:k,alt:`logo`,style:{width:52,height:52,borderRadius:14,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:(0,$.jsx)(g8,{style:{fontSize:26,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:28,fontWeight:800,letterSpacing:-.5},children:D})]}),(0,$.jsx)(`div`,{className:`shiny-text-container`,children:(0,$.jsx)(`span`,{className:`shiny-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsxs)(g1.Paragraph,{style:{color:`#64748b`,fontSize:17,maxWidth:480,lineHeight:1.8},children:[`专业的 AI 素材生成平台,通过智能提示词优化,`,(0,$.jsx)(`br`,{}),`让您的创意快速转化为精美视频、图片`]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:ne.map((e,t)=>(0,$.jsxs)(`div`,{className:`electric-border-card`,style:{position:`relative`,display:`flex`,gap:16,alignItems:`flex-start`,padding:`18px 22px`,borderRadius:14,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(12px)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{className:`electric-border`}),(0,$.jsx)(`div`,{className:`electric-border-inner`}),(0,$.jsx)(`div`,{style:{position:`relative`,zIndex:1},children:(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:`linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15))`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6366f1`,fontSize:20},children:e.icon})}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(g1.Text,{style:{color:`#1e293b`,fontSize:15,fontWeight:600,display:`block`,marginBottom:4},children:e.title}),(0,$.jsx)(g1.Text,{style:{color:`#64748b`,fontSize:13,lineHeight:1.6},children:e.desc})]})]},t))})]})}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1,padding:`40px 24px`},children:(0,$.jsxs)(Uz,{style:{width:440,maxWidth:`100%`,borderRadius:20,boxShadow:`0 20px 60px rgba(0,0,0,0.08)`,border:`1px solid #e2e8f0`,background:`#fff`},styles:{body:{padding:`36px 28px`}},children:[(0,$.jsx)(g1.Title,{level:3,style:{textAlign:`center`,marginBottom:6,color:`#1e293b`,fontWeight:700},children:r===`register`?`创建账号`:`欢迎回来`}),(0,$.jsx)(g1.Text,{style:{display:`block`,textAlign:`center`,marginBottom:28,color:`#94a3b8`,fontSize:14},children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作视频`}),r!==`register`&&(0,$.jsx)(`div`,{style:{display:`flex`,gap:0,marginBottom:24,background:`#f1f5f9`,borderRadius:10,padding:4,border:`1px solid #e2e8f0`},children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>G(e),style:{flex:1,textAlign:`center`,padding:`10px 0`,borderRadius:8,cursor:`pointer`,fontSize:14,fontWeight:a===e?600:400,color:a===e?`#6366f1`:`#64748b`,background:a===e?`#fff`:`transparent`,border:a===e?`1px solid rgba(99,102,241,0.2)`:`1px solid transparent`,boxShadow:a===e?`0 2px 8px rgba(99,102,241,0.1)`:`none`,transition:`all 0.3s ease`},children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(SW,{form:L,size:`large`,layout:`vertical`,onFinish:V,children:[(0,$.jsx)(SW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(rK,{prefix:(0,$.jsx)(L3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:K})}),(0,$.jsx)(SW.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(rK.Password,{prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:K})}),(0,$.jsx)(SW.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(bV,{children:`记住我的登录状态`})}),(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(jD,{type:`primary`,htmlType:`submit`,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(SW,{form:R,size:`large`,layout:`vertical`,children:[(0,$.jsx)(SW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(rK,{prefix:(0,$.jsx)(L3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:K})}),(0,$.jsx)(SW.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(OU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(rK,{prefix:(0,$.jsx)(T6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!_,style:{...K,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(jD,{disabled:s>0,onClick:()=>{w?(v(!1),m(!0),b(e=>e+1)):ee(R.getFieldValue(`phone`))},style:{height:48,borderRadius:`0 10px 10px 0`,background:s>0||_?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:s>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:s>0?`${s}s`:w?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(K7,{onSuccess:te,isVerified:_})},y),(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(jD,{type:`primary`,onClick:H,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(SW,{form:z,size:`large`,layout:`vertical`,children:[(0,$.jsx)(SW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(rK,{prefix:(0,$.jsx)(L3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:K})}),(0,$.jsx)(SW.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(OU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(rK,{prefix:(0,$.jsx)(T6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!h,style:{...K,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(jD,{disabled:l>0,onClick:()=>{x?(g(!1),m(!0),b(e=>e+1)):ee(z.getFieldValue(`phone`),!0)},style:{height:48,borderRadius:`0 10px 10px 0`,background:l>0||h?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:l>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:l>0?`${l}s`:x?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(K7,{onSuccess:te,isVerified:h})},y),(0,$.jsx)(SW.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(rK.Password,{prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:K})}),(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(jD,{type:`primary`,onClick:U,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`注 册`})})]}),(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(bV,{checked:d,onChange:e=>f(e.target.checked),children:(0,$.jsxs)(`span`,{style:{fontSize:13,color:`#64748b`},children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),q(j)},style:{color:`#6366f1`,cursor:`pointer`},children:`《用户协议》`}),`和`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),q(N)},style:{color:`#6366f1`,cursor:`pointer`},children:`《隐私政策》`})]})})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:r===`register`?(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`password`),o(`password`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1),z.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`register`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1)},children:`没有账号?立即注册`})})]})})]})},K7=({onSuccess:e,isVerified:t})=>{let n=S.useRef(null),r=S.useRef(null),i=S.useRef(null),a=S.useRef(0),o=S.useRef(!1),[s,c]=S.useState(360),l=s-50;S.useEffect(()=>{let e=()=>{if(n.current){let e=n.current.offsetWidth;e>0&&c(e)}};e();let t=new ResizeObserver(e);return n.current&&t.observe(n.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let u=n=>{if(o.current||t)return;let c=Math.max(0,Math.min(n,l));a.current=c,r.current&&(r.current.style.left=`${c}px`),i.current&&(i.current.style.width=`${c+50}px`),c>=l-5&&(o.current=!0,r.current&&(r.current.style.background=`#22c55e`,r.current.innerHTML=``),i.current&&(i.current.style.width=`${s}px`,i.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:n,onMouseDown:e=>{if(e.preventDefault(),o.current||t)return;let s=n.current;if(!s)return;let c=s.getBoundingClientRect(),d=e=>{u(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f),!o.current&&a.current({page:1,pageSize:10,total:0,items:[]}),J7=Q8((e,t)=>({projects:[],records:q7(),loading:!1,mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await x5(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await S5(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await C5(n),e({projects:t().projects.filter(e=>e.id!==n)})},fetchRecords:async(t={})=>{e({loading:!0});try{e({records:await w5(t),loading:!1})}catch{e({loading:!1})}},optimizePrompt:async(n,r)=>{let i=await T5(n,r);try{await I7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,total:a.total+1,items:[i.record,...a.items]}}),i},generateVideo:async(n,r)=>{let i=await A5(n,r);try{await I7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,items:a.items.map(e=>e.id===n?i:e)}}),i},updateRecordReferences:(n,r)=>{let i=t().records;e({records:{...i,items:i.items.map(e=>e.id===n?{...e,references:r}:e)}})},setMediaType:t=>e({mediaType:t}),setCountType:t=>e({countType:t}),setImageSettings:(t,n,r,i)=>e({selectedRatio:t,selectedResolution:n,width:r,height:i}),setVideoSettings:(t,n,r)=>e({videoDuration:t,videoAspectRatio:n,videoResolution:r}),setEngineOptions:t=>e({engineOptions:t}),setSelectedRatio:t=>e({selectedRatio:t}),setSelectedResolution:t=>e({selectedResolution:t}),setWidth:t=>e({width:t}),setHeight:t=>e({height:t}),setVideoDuration:t=>e({videoDuration:t}),setVideoAspectRatio:t=>e({videoAspectRatio:t}),setVideoResolution:t=>e({videoResolution:t}),setEnginesele:t=>e({enginesele:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[]})}));function Y7(e){if(!e)return`-`;let t=e.trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);return n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``),t.replace(`T`,` `).slice(0,16)}var X7=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],Z7={ShoppingCartOutlined:(0,$.jsx)(L6,{}),BookOutlined:(0,$.jsx)(O2,{}),HomeOutlined:(0,$.jsx)(u3,{}),FireOutlined:(0,$.jsx)(U4,{}),RocketOutlined:(0,$.jsx)(S6,{}),SkinOutlined:(0,$.jsx)(K6,{}),CompassOutlined:(0,$.jsx)(g4,{}),HeartOutlined:(0,$.jsx)(t3,{}),CarOutlined:(0,$.jsx)(U2,{}),CameraOutlined:(0,$.jsx)(B2,{}),CloudOutlined:(0,$.jsx)(t4,{}),StarOutlined:(0,$.jsx)(i8,{}),TrophyOutlined:(0,$.jsx)(S8,{}),ThunderboltOutlined:(0,$.jsx)(g8,{}),BulbOutlined:(0,$.jsx)(P2,{}),CoffeeOutlined:(0,$.jsx)(p4,{}),CrownOutlined:(0,$.jsx)(S4,{}),DashboardOutlined:(0,$.jsx)(T4,{}),FlagOutlined:(0,$.jsx)(K4,{}),GlobalOutlined:(0,$.jsx)(Q4,{}),GiftOutlined:(0,$.jsx)(Y4,{}),LaptopOutlined:(0,$.jsx)(g3,{}),MobileOutlined:(0,$.jsx)(L3,{}),MonitorOutlined:(0,$.jsx)(B3,{}),PayCircleOutlined:(0,$.jsx)(K3,{}),PictureOutlined:(0,$.jsx)(Q3,{}),PlayCircleOutlined:(0,$.jsx)(s6,{}),SafetyOutlined:(0,$.jsx)(T6,{}),ShoppingOutlined:(0,$.jsx)(B6,{}),SmileOutlined:(0,$.jsx)(Y6,{}),SoundOutlined:(0,$.jsx)(t8,{}),TagOutlined:(0,$.jsx)(u8,{}),TeamOutlined:(0,$.jsx)(p8,{}),ToolOutlined:(0,$.jsx)(y8,{}),TruckOutlined:(0,$.jsx)(T8,{}),VideoCameraOutlined:(0,$.jsx)(P8,{}),WalletOutlined:(0,$.jsx)(L8,{}),BankOutlined:(0,$.jsx)(y2,{}),BuildOutlined:(0,$.jsx)(j2,{}),ExperimentOutlined:(0,$.jsx)(P4,{}),HighlightOutlined:(0,$.jsx)(i3,{}),IdcardOutlined:(0,$.jsx)(p3,{}),MedicineBoxOutlined:(0,$.jsx)(P3,{}),ReadOutlined:(0,$.jsx)(p6,{}),RestOutlined:(0,$.jsx)(g6,{}),SketchOutlined:(0,$.jsx)(U6,{}),SolutionOutlined:(0,$.jsx)(Q6,{})},Q7=()=>{let[e,t]=(0,S.useState)(!1),[n]=SW.useForm(),r=qe(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=J7(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),z5().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:X7[t%X7.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`22px 24px`,borderRadius:16,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:200,height:200,borderRadius:`50%`,background:`rgba(255,255,255,0.08)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(g1.Title,{level:3,style:{margin:`0 0 4px`,color:`#fff`,fontWeight:700},children:`我的项目`}),(0,$.jsxs)(g1.Text,{style:{color:`rgba(255,255,255,0.7)`,fontSize:14},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]}),(0,$.jsx)(jD,{icon:(0,$.jsx)(jR,{}),onClick:()=>t(!0),size:`large`,style:{background:`rgba(255,255,255,0.15)`,border:`1px solid rgba(255,255,255,0.3)`,color:`#fff`,fontWeight:600,backdropFilter:`blur(10px)`,borderRadius:10,height:42},children:`新建项目`})]}),i.length===0?(0,$.jsx)(UC,{image:UC.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(jD,{type:`primary`,icon:(0,$.jsx)(jR,{}),onClick:()=>t(!0),size:`large`,children:`创建第一个项目`})}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},className:`stagger-children`,children:i.map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card project-item animate-slideInCard`,onClick:()=>r(`/projects/${e.id}/generate`),style:{display:`flex`,alignItems:`center`,padding:`18px 22px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,animationDelay:`${t*.06}s`},children:[(0,$.jsx)(`div`,{style:{width:50,height:50,borderRadius:14,flexShrink:0,background:`${u[e.industry]?.color||`#64748b`}12`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,marginRight:16,color:u[e.industry]?.color||`#64748b`},children:Z7[u[e.industry]?.icon]||(0,$.jsx)(t2,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4,flexWrap:`wrap`},children:[(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(h$,{color:u[e.industry]?.color||`#64748b`,style:{borderRadius:6,margin:0},children:u[e.industry]?.label||e.industry})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(BH,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,Y7(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(jD,{type:`primary`,icon:(0,$.jsx)(s6,{}),onClick:t=>{t.stopPropagation(),r(`/projects/${e.id}/generate`)},style:{background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,borderRadius:10,fontWeight:600,height:36,boxShadow:`0 4px 12px rgba(99,102,241,0.25)`},children:`生成`}),(0,$.jsx)(jq,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Q.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(jD,{danger:!0,icon:(0,$.jsx)(v$,{}),onClick:e=>e.stopPropagation(),style:{borderRadius:10,height:36,background:`rgba(239,68,68,0.06)`,border:`1px solid rgba(239,68,68,0.15)`,color:`#ef4444`}})}),(0,$.jsx)(Bg,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(OU,{children:[(0,$.jsx)(t2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Q.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(SW,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(SW.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(rK,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(dZ,{}),size:`large`})}),(0,$.jsx)(SW.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(yw,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(yw.Option,{value:e.key,children:(0,$.jsxs)(OU,{children:[Z7[e.icon]||(0,$.jsx)(t2,{}),` `,e.label]})},e.key))})})]})})]})};function $7(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}return`${Date.now().toString(16).padStart(12,`0`)}-${Math.random().toString(16).slice(2,10).padStart(8,`0`)}-4xxx-yxxx-${Math.random().toString(16).slice(2,12)}`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var e9=({src:e,width:t=48,height:n=48})=>{let[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null);return(0,S.useEffect)(()=>{let r=document.createElement(`video`);r.muted=!0,r.preload=`metadata`,r.crossOrigin=`anonymous`;let a=()=>{o(r.duration),r.currentTime=Math.min(1,r.duration*.1)},s=()=>{try{let e=document.createElement(`canvas`);e.width=t*2,e.height=n*2;let a=e.getContext(`2d`);a&&(a.drawImage(r,0,0,e.width,e.height),i(e.toDataURL(`image/jpeg`,.7)))}catch{}};return r.addEventListener(`loadedmetadata`,a),r.addEventListener(`seeked`,s),r.src=e,()=>{r.removeEventListener(`loadedmetadata`,a),r.removeEventListener(`seeked`,s)}},[e,t,n]),(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`,background:`#1a1a2e`},children:[r?(0,$.jsx)(`img`,{src:r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(s6,{style:{color:`#fff`,fontSize:18}})}),a!=null&&(0,$.jsx)(`span`,{style:{position:`absolute`,bottom:2,right:2,fontSize:9,color:`#fff`,background:`rgba(0,0,0,0.6)`,borderRadius:4,padding:`1px 4px`,lineHeight:1.3},children:(e=>`${Math.round(e)}s`)(a)})]})},t9=()=>{let{projectId:e}=Ze(),t=qe(),[n]=SW.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c}=J7(),l=i.items,{user:u}=I7(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(null),[M,N]=(0,S.useState)([]),[P,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(``),H=(0,S.useRef)(null),[U,W]=(0,S.useState)({}),[ee,te]=(0,S.useState)({}),[G,ne]=(0,S.useState)({}),[K,q]=(0,S.useState)(null),[J,re]=(0,S.useState)({}),[Y,ie]=(0,S.useState)(null),[ae,oe]=(0,S.useState)(5),[se,ce]=(0,S.useState)(`16:9`),[le,ue]=(0,S.useState)(`720p`),[de,fe]=(0,S.useState)(null),[pe,me]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`720p`,`1080p`],durations:[5,8,10,12,15]}),[he,ge]=(0,S.useState)(0),[_e,ve]=(0,S.useState)(0),[ye,be]=(0,S.useState)(`image`),[xe,Se]=(0,S.useState)(`1:1`),[Ce,we]=(0,S.useState)(`2K`),[Te,Ee]=(0,S.useState)(2048),[De,Oe]=(0,S.useState)(2048),[ke,Ae]=(0,S.useState)(!1),[je,Me]=(0,S.useState)([]),[Ne,Pe]=(0,S.useState)([]);(0,S.useEffect)(()=>{if(q5().then(e=>{Me(e.video),Pe(e.image)}),!ke)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&Ae(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ke]);let Fe=(e,t)=>{for(let n=0;n{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e{Ke(e)},Re=e=>{Ye(parseInt(e))},[ze,Be]=(0,S.useState)([]),[Ve,He]=(0,S.useState)([]),[Ue,We]=(0,S.useState)([]),[Ge,Ke]=(0,S.useState)(0),[Je,Ye]=(0,S.useState)(0);(0,S.useEffect)(()=>{Ue[Je]&&Ue[Je][Ge]!==void 0&&(Ee(Ue[Je][Ge].substring(0,4)),Oe(Ue[Je][Ge].substring(5)))},[Ge]),(0,S.useEffect)(()=>{Ue[Je]&&Ue[Je][Ge]!==void 0&&(Ee(Ue[Je][Ge].substring(0,4)),Oe(Ue[Je][Ge].substring(5)))},[Je]);let Xe=()=>{Ee(De),Oe(Te)},Qe=e=>{be(e.target.value===`image`?`image`:`video`)};(0,S.useEffect)(()=>{z5().then(e=>{W(Object.fromEntries(e.map(e=>[e.key,e.label]))),te(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),P5().then(e=>{let t=e.items?.[0]?.supportedSizes||{},n=[],r=[],i=[];for(let e in t[`2K`])n.push(e),r.push(t[`2K`][e]);n.forEach((e,t)=>{Be(n=>[...n,{value:e,label:String(t)}])});for(let e in t[`4K`])i.push(t[`4K`][e]);We([r,i]);let a=[];for(let e in t)a.push(e);a.forEach((e,t)=>{He(n=>[...n,{value:e,label:String(t)}])})}).catch(()=>{}),N5().then(e=>{if(e.items?.length){let t=e.items[0];me({ratios:t.supportedRatios?.length?t.supportedRatios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions?.length?t.supportedResolutions:[`720p`,`1080p`],durations:t.supportedDurations?.length?t.supportedDurations:[5,8,10,12,15]})}}).catch(()=>{})},[]),(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let $e=(0,S.useRef)(!1);(0,S.useEffect)(()=>{$e.current||l.length===0||($e.current=!0,console.log(`aaaa`,l),l.forEach(t=>{t.projectId===e&&t.status===`generating`&&(T(e=>({...e,[t.id]:`generating`})),Et(t.id)),t.projectId===e&&t.status===`optimizing`&&st(t.id)}))},[l,e]);let et=(0,S.useRef)(new Set),tt=(0,S.useRef)(null),nt=(0,S.useRef)(null),rt=e=>{et.current.add(e),ot()},it=e=>{et.current.delete(e),et.current.size===0&&at()},at=()=>{tt.current&&=(clearInterval(tt.current),null),nt.current&&=(nt.current.abort(),null)},ot=()=>{tt.current||=setInterval(async()=>{try{nt.current&&nt.current.abort();let t=new AbortController;nt.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});nt.current=null;let r=Array.from(et.current),i=[];if(r.length>0){let e=J7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`optimizing`&&i.push(e.id),t}return e});J7.setState({records:{...e,items:t}}),i.forEach(e=>{it(e)})}}catch(e){e.name!==`AbortError`&&console.error(`Optimizing polling error:`,e)}},3e3)},st=e=>{rt(e)},ct=(0,S.useRef)(!1),lt=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(ct.current||l.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,ts:o}=JSON.parse(t);if(Date.now()-o>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(lt.current===n)return;let s=l.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>o-1e4);s?(ct.current=!0,localStorage.removeItem(`pending_optimize`),g(s),v(s.optimizedPrompt||``),ge(s.textCreditsCost),ve(s.textTokensUsed),m(!0),Q.success({content:`优化请求已恢复,消耗 ${s.textCreditsCost} 积分`,key:`recovery`})):Date.now()-o>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[l,e]);let ut=r.find(t=>t.id===e),dt=l.filter(t=>t.projectId===e),ft=ut?.name??`项目`,pt=ut&&ee[ut.industry]||[],mt=u?.credits??0,ht=e=>{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e=gt,vt=async()=>{try{if(!e){Q.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Q.error(`请输入视频/图片描述`);return}f(!0);let r=Object.entries(G).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=$7();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:ae,ts:Date.now()})),lt.current=a;let o=await s(e,{prompt:i,duration:ae,genType:ye,resolution:Ce,references:M.length>0?M:void 0,idempotencyKey:a,image_size:Ce,image_proportion:xe,image_px:Te+`x`+De});localStorage.removeItem(`pending_optimize`),lt.current=null,g(o.record),v(o.record.optimizedPrompt||``),ge(o.textCreditsCost),ve(o.textTokensUsed),m(!0),Q.success({content:`「${ft}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){console.error(`优化提示词失败:`,e);let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Q.error(t)}finally{f(!1),localStorage.removeItem(`pending_optimize`),lt.current=null}},yt=(0,S.useRef)(new Set),bt=(0,S.useRef)(null),xt=(0,S.useRef)(null),St=e=>{yt.current.add(e),Tt()},Ct=e=>{yt.current.delete(e),yt.current.size===0&&wt()},wt=()=>{bt.current&&=(clearInterval(bt.current),null),xt.current&&=(xt.current.abort(),null)},Tt=()=>{bt.current||=setInterval(async()=>{try{xt.current&&xt.current.abort();let t=new AbortController;xt.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});xt.current=null;let r=Array.from(yt.current),i=[];if(r.length>0){let e=J7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`generating`&&i.push(e.id),t}return e});J7.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);Ct(e),t?.status===`completed`?(T(t=>({...t,[e]:`done`})),g(n=>n?.id===e?t:n),Q.success({content:`「${ft}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(T(t=>({...t,[e]:`failed`})),g(n=>n?.id===e?t:n),Q.error({content:`「${ft}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name!==`AbortError`&&console.error(`Global polling error:`,e)}},5e3)},Et=e=>{St(e)};(0,S.useEffect)(()=>()=>{wt(),at()},[]);let Dt=async e=>{if(!_t){Q.error(`积分不足,请先充值`);return}C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Q.loading({content:`「${ft}」正在提交视频生成...`,duration:0,key:e});try{(await c(e,{aspectRatio:se,resolution:le})).status===`failed`?(T(t=>({...t,[e]:`failed`})),Q.error({content:`「${ft}」提交失败`,key:e,duration:3})):(Q.success({content:`「${ft}」已提交,正在生成中...`,key:e,duration:3}),Et(e))}catch(t){T(t=>({...t,[e]:`failed`}));let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Q.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}},Ot=async e=>{let t=dt.find(t=>t.id===e);if(t){C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Q.loading({content:`「${ft}」正在重新提交...`,duration:0,key:e});try{let n=E[e];n&&n!==t.optimizedPrompt&&await k5(e,n);let r=await c(e,{aspectRatio:t.aspectRatio||`16:9`,resolution:t.resolution||`720p`});console.log(`重新提交视频生成结果:`,r),r.status===`failed`?(T(t=>({...t,[e]:`failed`})),console.log(`12312`),Q.error({content:`「${ft}」提交失败`,key:e,duration:3})):(Q.success({content:`「${ft}」已提交,正在生成中...`,key:e,duration:3}),Et(e))}catch(t){T(t=>({...t,[e]:`failed`})),console.log(`1231`,t);let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Q.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}}},kt=e=>{let t=w[e.id];return t===`generating`?`generating`:t===`done`?`completed`:t===`failed`?`failed`:e.status},At={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(qm,{style:{animation:`spinSlow 1s linear infinite`}})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(UH,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(qm,{style:{animation:`spinSlow 1s linear infinite`}})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(Y2,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(Q2,{})}},jt=({label:e,value:t,options:n,suffix:r,expanded:i,onToggle:a,onSelect:o,onClose:s})=>{let c=(0,S.useRef)(null),l=(0,S.useRef)(null),u=(0,S.useRef)(i),[d,f]=(0,S.useState)(null);return u.current=i,(0,S.useEffect)(()=>{if(i&&c.current){let e=c.current.getBoundingClientRect();f({bottom:window.innerHeight-e.top+4,left:e.left,width:Math.max(e.width,100)})}else f(null)},[i]),(0,S.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||l.current?.contains(e.target)||u.current&&s()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i,s]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:c,onClick:a,translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`background 0.2s, border-color 0.2s`,background:i?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:i?`1px solid #6366f1`:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(mQ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,Ri.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,background:`#fff`,borderRadius:12,padding:6,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:n.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{o(e),s()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})},Mt=({group:e,selected:t,expanded:n,onToggle:r,onSelect:i,onClose:a})=>{let o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(n),[l,u]=(0,S.useState)(null);return c.current=n,(0,S.useEffect)(()=>{if(n&&o.current){let e=o.current.getBoundingClientRect();u({bottom:window.innerHeight-e.top+4,left:e.left})}else u(null)},[n]),(0,S.useEffect)(()=>{if(!n)return;let e=e=>{o.current?.contains(e.target)||s.current?.contains(e.target)||c.current&&a()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,a]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:o,onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`all 0.2s`,background:t?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:n?`1px solid #6366f1`:`1px solid #e2e8f0`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:t?`#6366f1`:`#64748b`,fontWeight:t?600:400},children:t||e.name}),(0,$.jsx)(mQ,{style:{fontSize:9,color:t?`#6366f1`:`#94a3b8`,transition:`transform 0.2s`,transform:n?`rotate(180deg)`:`rotate(0deg)`}})]}),l&&(0,Ri.createPortal)((0,$.jsxs)(`div`,{ref:s,style:{position:`fixed`,bottom:l.bottom,left:l.left,background:`#fff`,borderRadius:12,padding:8,minWidth:160,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e.name}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:e.options.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{i(e),a()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`20px 28px`,borderRadius:16,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-30,bottom:-30,width:160,height:160,borderRadius:`50%`,background:`rgba(255,255,255,0.05)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,position:`relative`},children:[(0,$.jsx)(jD,{icon:(0,$.jsx)(s2,{}),onClick:()=>t(`/projects`),style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:10}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(g1.Title,{level:4,style:{margin:0,color:`#fff`,fontWeight:700},children:ft}),ut&&(0,$.jsx)(h$,{style:{background:`rgba(255,255,255,0.12)`,border:`1px solid rgba(255,255,255,0.2)`,color:`rgba(255,255,255,0.8)`,borderRadius:6},children:U[ut.industry]||ut.industry})]}),(0,$.jsx)(g1.Text,{style:{color:`rgba(255,255,255,0.5)`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]})]}),(0,$.jsxs)(h$,{style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,mt,` 积分`]})]}),!p&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{marginBottom:24,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 2px 12px rgba(0,0,0,0.03)`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{marginRight:70,position:`relative`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(VL.Group,{defaultValue:`image`,buttonStyle:`solid`,onChange:Qe,children:[(0,$.jsxs)(VL.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(Q3,{style:{marginRight:6,fontSize:14}}),` `,`图片`]}),(0,$.jsxs)(VL.Button,{value:`video`,children:[(0,$.jsx)(P8,{style:{marginRight:6,fontSize:14}}),` `,`视频`]})]})]}),ye===`video`&&[{icon:(0,$.jsx)(x$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(g8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(S6,{}),label:`选择参数生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(g1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),ye===`image`&&[{icon:(0,$.jsx)(x$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(g8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(S6,{}),label:`图片生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(g1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(SW,{form:n,initialValues:{},children:[(0,$.jsx)(SW.Item,{name:`prompt`,noStyle:!0,rules:[{required:!0,message:`请输入视频描述`}],style:{display:`none`}}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:20,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 4px 24px rgba(0,0,0,0.04)`,overflow:`visible`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`12px 16px 0`,minHeight:60},children:[M.map((e,t)=>(0,$.jsxs)(`div`,{className:`ref-thumb`,style:{position:`relative`,width:48,height:48,borderRadius:12,overflow:`visible`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,overflow:`hidden`,border:`1px solid #e2e8f0`,cursor:`pointer`},onClick:()=>{e.type===`video`&&ie(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:e.type===`image`?(0,$.jsx)(SG,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(e9,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),O5(e.url).catch(()=>{}),N(e=>e.filter((e,n)=>n!==t))},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(0,0,0,0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`,backdropFilter:`blur(4px)`},children:(0,$.jsx)(Q2,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(u0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Q.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Q.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=M.filter(e=>e.type===`image`).length,a=M.filter(e=>e.type===`video`).length;return t&&i>=10?(Q.error(`最多上传10张图片`),!1):n&&a>=3?(Q.error(`最多上传3个视频`),!1):(F(!0),(t?E5:D5)(e).then(e=>{let n=t?`图片`:`视频`,r=t?i+1:a+1;N(i=>[...i,{url:e.url,type:t?`image`:`video`,name:`${n}${r}`}]),Q.success(`${n}上传成功`)}).catch(()=>Q.error(`上传失败`)).finally(()=>F(!1)),!1)},children:(0,$.jsx)(cT,{title:`参考内容(${M.length}/10)`,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`,flexShrink:0},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99,102,241,0.04)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`,e.currentTarget.style.background=`transparent`},children:P?(0,$.jsx)(qm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(jR,{style:{fontSize:18,color:`#94a3b8`}})})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(rK.TextArea,{ref:H,value:I,onChange:e=>{let t=e.target.value;L(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` + `})]})},B7={HomeOutlined:(0,$.jsx)(u3,{}),DashboardOutlined:(0,$.jsx)(T4,{}),CodeOutlined:(0,$.jsx)(u4,{}),PlayCircleOutlined:(0,$.jsx)(s6,{}),WalletOutlined:(0,$.jsx)(L8,{}),SettingOutlined:(0,$.jsx)(P6,{}),BellOutlined:(0,$.jsx)(T2,{}),UserOutlined:(0,$.jsx)(j8,{}),AppstoreOutlined:(0,$.jsx)(t2,{}),FileTextOutlined:(0,$.jsx)(NU,{}),StarOutlined:(0,$.jsx)(i8,{}),HeartOutlined:(0,$.jsx)(t3,{}),CameraOutlined:(0,$.jsx)(B2,{}),RobotOutlined:(0,$.jsx)(s6,{}),CalculatorOutlined:(0,$.jsx)(L2,{}),DollarOutlined:(0,$.jsx)(j4,{}),GiftOutlined:(0,$.jsx)(Y4,{}),ThunderboltOutlined:(0,$.jsx)(g8,{}),FireOutlined:(0,$.jsx)(U4,{}),CloudOutlined:(0,$.jsx)(t4,{}),SmileOutlined:(0,$.jsx)(Y6,{}),TrophyOutlined:(0,$.jsx)(S8,{}),RocketOutlined:(0,$.jsx)(S6,{}),BulbOutlined:(0,$.jsx)(P2,{}),PictureOutlined:(0,$.jsx)(Q3,{}),VideoCameraOutlined:(0,$.jsx)(P8,{}),AudioOutlined:(0,$.jsx)(p2,{}),MailOutlined:(0,$.jsx)(j3,{}),PhoneOutlined:(0,$.jsx)(Y3,{}),GlobalOutlined:(0,$.jsx)(Q4,{}),ShoppingCartOutlined:(0,$.jsx)(L6,{}),TeamOutlined:(0,$.jsx)(p8,{}),BarChartOutlined:(0,$.jsx)(S2,{}),PieChartOutlined:(0,$.jsx)(t6,{}),LineChartOutlined:(0,$.jsx)(S3,{}),SecurityScanOutlined:(0,$.jsx)(O6,{}),ApiOutlined:(0,$.jsx)(Q0,{}),DatabaseOutlined:(0,$.jsx)(O4,{}),CloudServerOutlined:(0,$.jsx)(i4,{})},V7=240,H7=[{gradient:`linear-gradient(135deg, #c9a96e, #a67c52)`,shadow:`rgba(201,169,110,0.25)`,icon:(0,$.jsx)(pJ,{})},{gradient:`linear-gradient(135deg, #4a5568, #2d3748)`,shadow:`rgba(74,85,104,0.25)`,icon:(0,$.jsx)(B4,{})},{gradient:`linear-gradient(135deg, #718096, #4a5568)`,shadow:`rgba(113,128,150,0.25)`,icon:(0,$.jsx)(y4,{})},{gradient:`linear-gradient(135deg, #5a67d8, #434190)`,shadow:`rgba(90,103,216,0.25)`,icon:(0,$.jsx)(g2,{})}],U7=()=>{let e=qe(),t=We(),{user:n,logout:r}=I7(),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c]=SW.useForm(),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)({}),[_,v]=(0,S.useState)(0),[y,b]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteName||``;return t&&(document.title=t),t}),[x,C]=(0,S.useState)(()=>{let e=localStorage.getItem(`siteInfo`),t=e&&JSON.parse(e).siteLogo||``;if(t){let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=t,e.type=`image/png`}return t}),[w,T]=(0,S.useState)(!localStorage.getItem(`siteInfo`)),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(`alipay`),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)(180),I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null),[z,B]=(0,S.useState)({alipay:!1,wechat:!1}),V=`pending_payment_order`;(0,S.useEffect)(()=>{M5().then(e=>{let t=e.siteName||`民众智创`,n=e.siteLogo||``;if(t!==y&&(b(t),document.title=t),n&&n!==x){C(n);let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=n,e.type=`image/png`}localStorage.setItem(`siteInfo`,JSON.stringify({siteName:t,siteLogo:n}))}).catch(()=>{})},[]);let H=()=>{L5().then(e=>{v(e)}).catch(()=>{})};(0,S.useEffect)(()=>{(async()=>{let e=localStorage.getItem(V);if(e)try{let t=JSON.parse(e),n=await G5(t.orderNo);if(n.status===`pending`){k({price:t.price,credits:t.credits,qrCode:t.qrCode,method:t.method}),R.current=t.orderNo;let e=Date.now(),n=new Date(t.createdAt).getTime(),r=t.timeoutSeconds||180,i=Math.floor((e-n)/1e3),a=Math.max(0,r-i);a>0?(D(!0),J(t.orderNo,a)):localStorage.removeItem(V)}else n.status===`paid`?(Q.success(`支付成功!积分已到账`),I7.getState().refreshUser(),localStorage.removeItem(V)):localStorage.removeItem(V)}catch{localStorage.removeItem(V)}})()},[]),(0,S.useEffect)(()=>{B5().then(e=>{let t=e.filter(e=>e.is_active!==!1&&e.isActive!==!1);if(n?.allowedMenus&&n.allowedMenus.length>0){let e=new Set(n.allowedMenus),r=new Set;t.forEach(t=>{let n=t.parent_id??t.parentId;n&&e.has(t.path)&&r.add(n)}),t=t.filter(t=>(t.menu_type??t.menuType)===`group`&&r.has(t.id)?!0:e.has(t.path))}f(t)}).catch(()=>{}),V5().then(e=>{m(e.filter(e=>e.is_active!==!1&&e.isActive!==!1))}).catch(()=>{}),H5().then(e=>{B(e),e.alipay?j(`alipay`):e.wechat&&j(`wechat`)}).catch(()=>{}),H()},[n]);let U=t.pathname.startsWith(`/records`)?`/records`:t.pathname,W=V7,ee=[{key:`profile`,icon:(0,$.jsx)(j8,{}),label:`账号: ${n?.username}`,disabled:!0},{key:`credits`,icon:(0,$.jsx)(L8,{style:{color:`#c9a96e`}}),label:`积分: ${n?.credits??0}`,disabled:!0},{type:`divider`},{key:`myCredits`,icon:(0,$.jsx)(L8,{}),label:`积分明细`},{key:`orderRecords`,icon:(0,$.jsx)(NU,{}),label:`订单记录`},{key:`messages`,icon:(0,$.jsx)(T2,{}),label:`消息中心${_>0?`(${_})`:``}`},{type:`divider`},{key:`changePwd`,icon:(0,$.jsx)(T3,{}),label:`修改密码`},{type:`divider`},{key:`logout`,icon:(0,$.jsx)(O3,{}),label:`退出登录`,danger:!0}],te=({key:t})=>{t===`logout`?(r(),e(`/login`)):t===`changePwd`?a(!0):t===`messages`?e(`/messages`):t===`recharge`?s(!0):t===`myCredits`?e(`/user-center?tab=credits`):t===`orderRecords`&&e(`/user-center?tab=orders`)},G=async()=>{try{await c.validateFields(),Q.success(`密码修改成功(演示)`),a(!1),c.resetFields()}catch{}},ne=()=>{r(),e(`/login`)},K=()=>{s(!0)},q=(0,S.useCallback)(()=>{I.current&&=(clearInterval(I.current),null),L.current&&=(clearInterval(L.current),null)},[]),J=(0,S.useCallback)((e,t=180)=>{q(),F(t),I.current=setInterval(async()=>{try{let t=await G5(e);t.status===`paid`?(q(),R.current=null,localStorage.removeItem(V),Q.success(`支付成功!积分已到账`),I7.getState().refreshUser(),D(!1),k(null),u(null)):t.status===`cancelled`&&(q(),R.current=null,localStorage.removeItem(V))}catch{}},2e3),L.current=setInterval(()=>{F(e=>e<=1?(q(),R.current&&=(K5(R.current).catch(()=>{}),null),localStorage.removeItem(V),Q.warning(`订单已超时,请重新充值`),D(!1),k(null),u(null),0):e-1)},1e3)},[q]);return(0,$.jsxs)(fK,{style:{minHeight:`100vh`},children:[(0,$.jsxs)(`div`,{className:`desktop-sidebar`,style:{width:W,position:`fixed`,left:16,top:16,bottom:16,zIndex:100,background:`linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,display:`flex`,flexDirection:`column`,transition:`width 0.25s ease, left 0.25s ease`,overflow:`hidden`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:[(0,$.jsx)(`div`,{style:{height:80,display:`flex`,alignItems:`center`,justifyContent:`flex-start`,padding:`0 20px`,flexShrink:0,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14},children:[(0,$.jsx)(`div`,{style:{width:42,height:42,borderRadius:14,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,overflow:`hidden`},children:x?(0,$.jsx)(`img`,{src:x,alt:`logo`,style:{width:28,height:28,objectFit:`contain`}}):(0,$.jsx)(g8,{style:{fontSize:20,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:17,fontWeight:700,letterSpacing:-.02,whiteSpace:`nowrap`,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:y})]})}),(0,$.jsx)(`div`,{style:{flex:1,padding:`8px 8px`,overflow:`auto`},children:(()=>{let t=d.filter(e=>(e.menu_type??e.menuType)===`group`),n=d.filter(e=>(e.menu_type??e.menuType)!==`group`),r={};n.filter(e=>e.parent_id??e.parentId).forEach(e=>{let t=e.parent_id??e.parentId;r[t]||(r[t]=[]),r[t].push(e)});let i=n.filter(e=>!(e.parent_id??e.parentId)),a=[],o=(t,n=0)=>{let r=t.path===U,i=B7[t.icon]||(0,$.jsx)(u3,{});return(0,$.jsxs)(`div`,{onClick:()=>t.path&&e(t.path),style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,padding:n>0?`8px 14px 8px 36px`:`10px 16px`,borderRadius:12,margin:`2px 6px`,cursor:`pointer`,fontSize:n>0?13:14,fontWeight:r?600:400,color:r?`#4f46e5`:`#475569`,background:r?`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%)`:`transparent`,transition:`all 0.2s ease`},children:[(0,$.jsx)(`span`,{style:{fontSize:n>0?14:16,flexShrink:0,color:r?`#6366f1`:`#64748b`},children:i}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:t.label})]},t.id)};return t.sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0)).forEach(e=>{let t=(r[e.id]||[]).sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0));a.push((0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{color:`#94a3b8`,fontSize:12,fontWeight:600,padding:`12px 16px 6px`,letterSpacing:.5,textTransform:`uppercase`},children:e.label}),t.map(e=>o(e,1))]},e.id))}),i.sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0)).forEach(e=>{a.push(o(e))}),a})()}),(0,$.jsxs)(`div`,{onClick:()=>s(!0),style:{margin:`8px 12px`,padding:`12px 20px`,borderRadius:14,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8,color:`#ffffff`,fontSize:14,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.4)`,transition:`all 0.3s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%)`,e.currentTarget.style.transform=`translateY(-1px)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.5)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(99, 102, 241, 0.4)`},children:[(0,$.jsx)(jR,{style:{fontSize:16}}),(0,$.jsx)(`span`,{children:`充值积分`})]}),(0,$.jsx)(`div`,{style:{padding:`16px 16px`,flexShrink:0},children:(0,$.jsx)(AU,{menu:{items:ee,onClick:te},placement:`topRight`,arrow:!0,children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-start`,gap:12,padding:`10px 14px`,borderRadius:14,cursor:`pointer`,transition:`all 0.25s ease`,background:`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,boxShadow:`0 2px 12px rgba(0, 0, 0, 0.04)`},onMouseEnter:e=>{e.currentTarget.style.background=`linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(0, 0, 0, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.background=`linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)`,e.currentTarget.style.boxShadow=`0 2px 12px rgba(0, 0, 0, 0.04)`},children:[(0,$.jsx)(yT,{size:36,icon:(0,$.jsx)(j8,{}),style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{color:`#1e293b`,fontSize:14,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,letterSpacing:-.01},children:n?.username}),(0,$.jsxs)(`div`,{style:{color:`#6366f1`,fontSize:12,fontWeight:500,letterSpacing:0,background:`rgba(99, 102, 241, 0.08)`,padding:`2px 8px`,borderRadius:6,display:`inline-block`},children:[`积分: `,n?.credits||0]})]})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:W+28,marginRight:12,marginTop:16,marginBottom:16,flex:1,minHeight:`calc(100vh - 32px)`,background:`transparent`,padding:0,transition:`margin-left 0.25s ease`},children:(0,$.jsx)(`div`,{style:{boxSizing:`border-box`,height:`100%`,background:`#ffffffff`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,minHeight:`100%`,padding:`24px 32px 32px`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:(0,$.jsx)(St,{})})}),(0,$.jsxs)(`div`,{className:`mobile-bottom-nav`,children:[d.filter(e=>(e.menu_type??e.menuType)!==`group`).map(t=>t.path?(0,$.jsxs)(`div`,{className:`nav-item ${t.path===U?`active`:``}`,onClick:()=>e(t.path),children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:B7[t.icon]||(0,$.jsx)(u3,{})}),(0,$.jsx)(`span`,{children:t.label})]},t.id):null),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:K,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(u6,{})}),(0,$.jsx)(`span`,{children:`充值`})]}),(0,$.jsxs)(`div`,{className:`nav-item`,onClick:ne,children:[(0,$.jsx)(`span`,{className:`nav-icon`,children:(0,$.jsx)(O3,{})}),(0,$.jsx)(`span`,{children:`退出`})]})]}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(OU,{children:[(0,$.jsx)(T3,{}),`修改密码`]}),open:i,onOk:G,onCancel:()=>{a(!1),c.resetFields()},okText:`确认修改`,cancelText:`取消`,width:440,children:(0,$.jsxs)(SW,{form:c,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(SW.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(rK.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(SW.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(rK.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(SW.Item,{name:`confirmPwd`,label:`确认新密码`,rules:[{required:!0,message:`请再次输入新密码`},({getFieldValue:e})=>({validator(t,n){return!n||e(`newPwd`)===n?Promise.resolve():Promise.reject(Error(`两次密码不一致`))}})],children:(0,$.jsx)(rK.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}})})})]})}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(OU,{children:[(0,$.jsx)(Y4,{}),`积分充值`]}),open:o,onCancel:()=>{s(!1),u(null)},footer:null,width:680,children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(OU,{style:{marginBottom:16},children:[(0,$.jsx)(L8,{style:{color:`#6366f1`}}),(0,$.jsx)(g1.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(g1.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:p.map((e,t)=>{let n=H7[t%H7.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>u(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:l===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:l===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(h$,{color:`purple`,style:{position:`absolute`,top:-10,left:`50%`,transform:`translateX(-50%)`,borderRadius:8,fontSize:11},children:e.description}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:n.gradient,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,color:`#fff`,boxShadow:`0 6px 16px ${n.shadow}`},children:n.icon}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:6},children:[(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[r.toLocaleString(),` 积分`]})]}),(0,$.jsxs)(`div`,{style:{fontSize:22,fontWeight:800,marginTop:4,background:n.gradient,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:[`¥`,e.price]})]})]})]},e.id)})}),!z.alipay&&!z.wechat?(0,$.jsx)(`div`,{style:{marginTop:20,marginBottom:8,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(g1.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginTop:20,marginBottom:8},children:[(0,$.jsx)(g1.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(VL.Group,{value:A,onChange:e=>j(e.target.value),style:{display:`flex`,gap:12},children:[z.alipay&&(0,$.jsxs)(VL.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`alipay`?`#1677ff`:void 0,color:A===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(Y0,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),z.wechat&&(0,$.jsxs)(VL.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:A===`wechat`?`#07c160`:void 0,color:A===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(U8,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:[(0,$.jsx)(jD,{size:`large`,onClick:()=>{s(!1),u(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(jD,{type:`primary`,size:`large`,disabled:!l||!z.alipay&&!z.wechat,loading:M,onClick:async()=>{let e=p.find(e=>e.id===l);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{N(!0);let n=await U5(e.id,A),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(k({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),s(!1),D(!0),R.current=n.orderNo,localStorage.setItem(V,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),J(n.orderNo)):(Q.success(`充值成功!积分已到账`),I7.getState().refreshUser(),s(!1),u(null))}catch(e){Q.error(e?.message||`创建订单失败,请重试`)}finally{N(!1)}},style:{borderRadius:10,fontWeight:600,background:l?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:l?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]})]})}),(0,$.jsx)(Dq,{open:E,onCancel:async()=>{if(q(),R.current){try{await K5(R.current)}catch{}R.current=null}localStorage.removeItem(V),D(!1),k(null)},footer:null,width:400,closable:!1,styles:{body:{padding:0,borderRadius:16,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{padding:`24px`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:24},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,background:O?.method===`alipay`?`linear-gradient(135deg, #1677ff, #0958d9)`:`linear-gradient(135deg, #07c160, #06ae56)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`,margin:`0 auto 12px`},children:O?.method===`alipay`?(0,$.jsx)(Y0,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(U8,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(g1.Title,{level:4,style:{margin:0},children:O?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(g1.Text,{style:{color:`#94a3b8`,fontSize:13},children:O?.method===`alipay`?`请使用支付宝扫描二维码完成支付`:`请使用微信扫描二维码完成支付`})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,padding:20,display:`flex`,flexDirection:`column`,alignItems:`center`,boxShadow:`0 4px 20px rgba(0,0,0,0.08)`},children:[(0,$.jsx)(`div`,{style:{width:180,height:180,borderRadius:12,overflow:`hidden`,background:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:O&&(0,$.jsx)(K0,{value:O.qrCode,size:160,level:`M`,includeMargin:!1})}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`},children:[(0,$.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,color:`#1a1a2e`},children:[`¥`,O?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,O?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:P<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:P<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:P<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:P}),` 秒后关闭`]})})]})]}),(0,$.jsx)(`div`,{style:{marginTop:20,padding:16,background:`#fef3c7`,borderRadius:12},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8},children:[(0,$.jsx)(`div`,{style:{fontSize:16,marginTop:-2},children:`💡`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#92400e`},children:[(0,$.jsx)(`div`,{style:{fontWeight:500,marginBottom:4},children:`支付提示`}),(0,$.jsxs)(`ul`,{style:{margin:0,paddingLeft:16},children:[(0,$.jsx)(`li`,{style:{marginBottom:2},children:`请在支付后等待页面自动跳转`}),(0,$.jsx)(`li`,{children:`如支付成功但未到账,请联系客服`})]})]})]})}),(0,$.jsx)(`div`,{style:{marginTop:20},children:(0,$.jsx)(jD,{size:`large`,block:!0,onClick:async()=>{if(q(),R.current){try{await K5(R.current)}catch{}R.current=null}localStorage.removeItem(V),D(!1),k(null),u(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)(z7,{})]})},W7=`http://localhost:8000/api`,G7=()=>{let{checkAuth:e}=I7(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(0),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(0),[x,C]=(0,S.useState)(!1),[w,T]=(0,S.useState)(!1),E=(()=>{try{let e=localStorage.getItem(`siteInfo`);if(e){let t=JSON.parse(e);return{siteName:t.siteName||`VideoGen.AI`,siteLogo:t.siteLogo||``}}}catch{}return{siteName:`VideoGen.AI`,siteLogo:``}})(),[D,O]=(0,S.useState)(E.siteName),[k,A]=(0,S.useState)(E.siteLogo),[j,M]=(0,S.useState)(``),[N,P]=(0,S.useState)(``),F=qe(),{login:I}=I7(),[L]=SW.useForm(),[R]=SW.useForm(),[z]=SW.useForm();(0,S.useEffect)(()=>{M5().then(e=>{O(e.siteName),A(e.siteLogo),M(e.userAgreementUrl),P(e.privacyPolicyUrl)}).catch(()=>{})},[]);let B=()=>d?!0:(Q.warning(`请先阅读并同意用户协议和隐私政策`),!1),V=async()=>{if(B())try{let t=await L.validateFields();await I(t.phone,t.password,void 0,t.rememberMe),Q.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}},H=async()=>{if(B())try{let t=R.getFieldsValue();if(!t.phone||!t.code){Q.error(`请填写手机号和验证码`);return}n(!0),await g5(t.phone,t.code),Q.success(`登录成功,欢迎回来`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t)}finally{n(!1)}},U=async()=>{if(B())try{let t=await z.validateFields();n(!0),await _5(t.phone,t.regCode,t.password),Q.success(`注册成功`),await e(),F(`/projects`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Q.error(t)}finally{n(!1)}},W=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),m(!1),t?C(!0):T(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{s===0&&r===`phone`&&v(!1)},[s,r]);let ee=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Q.error(`请输入正确的手机号`);return}if(t){m(!0),g(!1);return}if(!_){m(!0),v(!1);return}let n=``;n=r===`register`?`register`:`login`,await F5(e,n),W(t?u:c),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(g(!1),u(0)):(v(!1),c(0)),b(e=>e+1)}},te=async(e=!1)=>{let t=r===`register`?z.getFieldValue(`phone`):R.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await F5(t,e),r===`register`?(g(!0),W(u,!0)):(v(!0),W(c,!1)),Q.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Q.error(t),r===`register`?(g(!1),u(0),C(!0)):(v(!1),c(0),T(!0)),b(e=>e+1)}},G=e=>{o(e),i(e),c(0),u(0),v(!1),g(!1),m(!1),C(!1),T(!1),b(e=>e+1),e===`password`?L.resetFields():R.resetFields()},ne=[{icon:(0,$.jsx)(P2,{}),title:`AI 智能优化`,desc:`输入原始提示词,AI 自动为您生成专业级视频、图片描述`},{icon:(0,$.jsx)(s6,{}),title:`一键生成视频、图片`,desc:`支持多种规格生成视频、图片`},{icon:(0,$.jsx)(s3,{}),title:`项目维度管理`,desc:`按项目行业分类视频、图片,支持多种行业`}],K={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,height:48,borderRadius:10,fontSize:14},q=e=>{e&&window.open(`${W7.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,backgroundImage:`url(/backimage.png)`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`,backgroundAttachment:`fixed`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(240,244,255,0.9) 0%, rgba(232,236,248,0.85) 40%, rgba(240,240,255,0.9) 70%, rgba(248,249,255,0.95) 100%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:500,height:500,borderRadius:`50%`,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,top:-150,right:-100,filter:`blur(40px)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,width:400,height:400,borderRadius:`50%`,background:`radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%)`,bottom:-100,left:-80,filter:`blur(50px)`}}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:`0 80px`,zIndex:1},children:(0,$.jsxs)(OU,{direction:`vertical`,size:36,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:20},children:[k?(0,$.jsx)(`img`,{src:k,alt:`logo`,style:{width:52,height:52,borderRadius:14,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:(0,$.jsx)(g8,{style:{fontSize:26,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontSize:28,fontWeight:800,letterSpacing:-.5},children:D})]}),(0,$.jsx)(`div`,{className:`shiny-text-container`,children:(0,$.jsx)(`span`,{className:`shiny-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsxs)(g1.Paragraph,{style:{color:`#64748b`,fontSize:17,maxWidth:480,lineHeight:1.8},children:[`专业的 AI 素材生成平台,通过智能提示词优化,`,(0,$.jsx)(`br`,{}),`让您的创意快速转化为精美视频、图片`]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:ne.map((e,t)=>(0,$.jsxs)(`div`,{className:`electric-border-card`,style:{position:`relative`,display:`flex`,gap:16,alignItems:`flex-start`,padding:`18px 22px`,borderRadius:14,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(12px)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{className:`electric-border`}),(0,$.jsx)(`div`,{className:`electric-border-inner`}),(0,$.jsx)(`div`,{style:{position:`relative`,zIndex:1},children:(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:`linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15))`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6366f1`,fontSize:20},children:e.icon})}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(g1.Text,{style:{color:`#1e293b`,fontSize:15,fontWeight:600,display:`block`,marginBottom:4},children:e.title}),(0,$.jsx)(g1.Text,{style:{color:`#64748b`,fontSize:13,lineHeight:1.6},children:e.desc})]})]},t))})]})}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1,padding:`40px 24px`},children:(0,$.jsxs)(Uz,{style:{width:440,maxWidth:`100%`,borderRadius:20,boxShadow:`0 20px 60px rgba(0,0,0,0.08)`,border:`1px solid #e2e8f0`,background:`#fff`},styles:{body:{padding:`36px 28px`}},children:[(0,$.jsx)(g1.Title,{level:3,style:{textAlign:`center`,marginBottom:6,color:`#1e293b`,fontWeight:700},children:r===`register`?`创建账号`:`欢迎回来`}),(0,$.jsx)(g1.Text,{style:{display:`block`,textAlign:`center`,marginBottom:28,color:`#94a3b8`,fontSize:14},children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作视频`}),r!==`register`&&(0,$.jsx)(`div`,{style:{display:`flex`,gap:0,marginBottom:24,background:`#f1f5f9`,borderRadius:10,padding:4,border:`1px solid #e2e8f0`},children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>G(e),style:{flex:1,textAlign:`center`,padding:`10px 0`,borderRadius:8,cursor:`pointer`,fontSize:14,fontWeight:a===e?600:400,color:a===e?`#6366f1`:`#64748b`,background:a===e?`#fff`:`transparent`,border:a===e?`1px solid rgba(99,102,241,0.2)`:`1px solid transparent`,boxShadow:a===e?`0 2px 8px rgba(99,102,241,0.1)`:`none`,transition:`all 0.3s ease`},children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(SW,{form:L,size:`large`,layout:`vertical`,onFinish:V,children:[(0,$.jsx)(SW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(rK,{prefix:(0,$.jsx)(L3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:K})}),(0,$.jsx)(SW.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(rK.Password,{prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:K})}),(0,$.jsx)(SW.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(bV,{children:`记住我的登录状态`})}),(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(jD,{type:`primary`,htmlType:`submit`,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(SW,{form:R,size:`large`,layout:`vertical`,children:[(0,$.jsx)(SW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(rK,{prefix:(0,$.jsx)(L3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:K})}),(0,$.jsx)(SW.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(OU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(rK,{prefix:(0,$.jsx)(T6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!_,style:{...K,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(jD,{disabled:s>0,onClick:()=>{w?(v(!1),m(!0),b(e=>e+1)):ee(R.getFieldValue(`phone`))},style:{height:48,borderRadius:`0 10px 10px 0`,background:s>0||_?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:s>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:s>0?`${s}s`:w?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(K7,{onSuccess:te,isVerified:_})},y),(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(jD,{type:`primary`,onClick:H,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(SW,{form:z,size:`large`,layout:`vertical`,children:[(0,$.jsx)(SW.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(rK,{prefix:(0,$.jsx)(L3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:K})}),(0,$.jsx)(SW.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(OU.Compact,{style:{width:`100%`},children:[(0,$.jsx)(rK,{prefix:(0,$.jsx)(T6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!h,style:{...K,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(jD,{disabled:l>0,onClick:()=>{x?(g(!1),m(!0),b(e=>e+1)):ee(z.getFieldValue(`phone`),!0)},style:{height:48,borderRadius:`0 10px 10px 0`,background:l>0||h?`#f1f5f9`:`rgba(99,102,241,0.1)`,border:`1.5px solid #e2e8f0`,borderLeft:`none`,color:l>0?`#94a3b8`:`#6366f1`,fontWeight:600,minWidth:100},children:l>0?`${l}s`:x?`重新发送`:`获取验证码`})]})}),p&&(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(K7,{onSuccess:te,isVerified:h})},y),(0,$.jsx)(SW.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(rK.Password,{prefix:(0,$.jsx)(T3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:K})}),(0,$.jsx)(SW.Item,{style:{marginBottom:12},children:(0,$.jsx)(jD,{type:`primary`,onClick:U,loading:t,block:!0,style:{height:48,borderRadius:10,fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.25)`},children:`注 册`})})]}),(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(bV,{checked:d,onChange:e=>f(e.target.checked),children:(0,$.jsxs)(`span`,{style:{fontSize:13,color:`#64748b`},children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),q(j)},style:{color:`#6366f1`,cursor:`pointer`},children:`《用户协议》`}),`和`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),q(N)},style:{color:`#6366f1`,cursor:`pointer`},children:`《隐私政策》`})]})})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:r===`register`?(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`password`),o(`password`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1),z.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#6366f1`,cursor:`pointer`},onClick:()=>{i(`register`),C(!1),T(!1),g(!1),m(!1),b(e=>e+1)},children:`没有账号?立即注册`})})]})})]})},K7=({onSuccess:e,isVerified:t})=>{let n=S.useRef(null),r=S.useRef(null),i=S.useRef(null),a=S.useRef(0),o=S.useRef(!1),[s,c]=S.useState(360),l=s-50;S.useEffect(()=>{let e=()=>{if(n.current){let e=n.current.offsetWidth;e>0&&c(e)}};e();let t=new ResizeObserver(e);return n.current&&t.observe(n.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let u=n=>{if(o.current||t)return;let c=Math.max(0,Math.min(n,l));a.current=c,r.current&&(r.current.style.left=`${c}px`),i.current&&(i.current.style.width=`${c+50}px`),c>=l-5&&(o.current=!0,r.current&&(r.current.style.background=`#22c55e`,r.current.innerHTML=``),i.current&&(i.current.style.width=`${s}px`,i.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:n,onMouseDown:e=>{if(e.preventDefault(),o.current||t)return;let s=n.current;if(!s)return;let c=s.getBoundingClientRect(),d=e=>{u(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f),!o.current&&a.current({page:1,pageSize:10,total:0,items:[]}),J7=Q8((e,t)=>({projects:[],records:q7(),loading:!1,mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await x5(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await S5(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await C5(n),e({projects:t().projects.filter(e=>e.id!==n)})},fetchRecords:async(t={})=>{e({loading:!0});try{e({records:await w5(t),loading:!1})}catch{e({loading:!1})}},optimizePrompt:async(n,r)=>{let i=await T5(n,r);try{await I7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,total:a.total+1,items:[i.record,...a.items]}}),i},generateVideo:async(n,r)=>{let i=await A5(n,r);try{await I7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,items:a.items.map(e=>e.id===n?i:e)}}),i},updateRecordReferences:(n,r)=>{let i=t().records;e({records:{...i,items:i.items.map(e=>e.id===n?{...e,references:r}:e)}})},setMediaType:t=>e({mediaType:t}),setCountType:t=>e({countType:t}),setImageSettings:(t,n,r,i)=>e({selectedRatio:t,selectedResolution:n,width:r,height:i}),setVideoSettings:(t,n,r)=>e({videoDuration:t,videoAspectRatio:n,videoResolution:r}),setEngineOptions:t=>e({engineOptions:t}),setSelectedRatio:t=>e({selectedRatio:t}),setSelectedResolution:t=>e({selectedResolution:t}),setWidth:t=>e({width:t}),setHeight:t=>e({height:t}),setVideoDuration:t=>e({videoDuration:t}),setVideoAspectRatio:t=>e({videoAspectRatio:t}),setVideoResolution:t=>e({videoResolution:t}),setEnginesele:t=>e({enginesele:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`16:9`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[]})}));function Y7(e){if(!e)return`-`;let t=e.trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);return n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``),t.replace(`T`,` `).slice(0,16)}var X7=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],Z7={ShoppingCartOutlined:(0,$.jsx)(L6,{}),BookOutlined:(0,$.jsx)(O2,{}),HomeOutlined:(0,$.jsx)(u3,{}),FireOutlined:(0,$.jsx)(U4,{}),RocketOutlined:(0,$.jsx)(S6,{}),SkinOutlined:(0,$.jsx)(K6,{}),CompassOutlined:(0,$.jsx)(g4,{}),HeartOutlined:(0,$.jsx)(t3,{}),CarOutlined:(0,$.jsx)(U2,{}),CameraOutlined:(0,$.jsx)(B2,{}),CloudOutlined:(0,$.jsx)(t4,{}),StarOutlined:(0,$.jsx)(i8,{}),TrophyOutlined:(0,$.jsx)(S8,{}),ThunderboltOutlined:(0,$.jsx)(g8,{}),BulbOutlined:(0,$.jsx)(P2,{}),CoffeeOutlined:(0,$.jsx)(p4,{}),CrownOutlined:(0,$.jsx)(S4,{}),DashboardOutlined:(0,$.jsx)(T4,{}),FlagOutlined:(0,$.jsx)(K4,{}),GlobalOutlined:(0,$.jsx)(Q4,{}),GiftOutlined:(0,$.jsx)(Y4,{}),LaptopOutlined:(0,$.jsx)(g3,{}),MobileOutlined:(0,$.jsx)(L3,{}),MonitorOutlined:(0,$.jsx)(B3,{}),PayCircleOutlined:(0,$.jsx)(K3,{}),PictureOutlined:(0,$.jsx)(Q3,{}),PlayCircleOutlined:(0,$.jsx)(s6,{}),SafetyOutlined:(0,$.jsx)(T6,{}),ShoppingOutlined:(0,$.jsx)(B6,{}),SmileOutlined:(0,$.jsx)(Y6,{}),SoundOutlined:(0,$.jsx)(t8,{}),TagOutlined:(0,$.jsx)(u8,{}),TeamOutlined:(0,$.jsx)(p8,{}),ToolOutlined:(0,$.jsx)(y8,{}),TruckOutlined:(0,$.jsx)(T8,{}),VideoCameraOutlined:(0,$.jsx)(P8,{}),WalletOutlined:(0,$.jsx)(L8,{}),BankOutlined:(0,$.jsx)(y2,{}),BuildOutlined:(0,$.jsx)(j2,{}),ExperimentOutlined:(0,$.jsx)(P4,{}),HighlightOutlined:(0,$.jsx)(i3,{}),IdcardOutlined:(0,$.jsx)(p3,{}),MedicineBoxOutlined:(0,$.jsx)(P3,{}),ReadOutlined:(0,$.jsx)(p6,{}),RestOutlined:(0,$.jsx)(g6,{}),SketchOutlined:(0,$.jsx)(U6,{}),SolutionOutlined:(0,$.jsx)(Q6,{})},Q7=()=>{let[e,t]=(0,S.useState)(!1),[n]=SW.useForm(),r=qe(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=J7(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),z5().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:X7[t%X7.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`22px 24px`,borderRadius:16,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:200,height:200,borderRadius:`50%`,background:`rgba(255,255,255,0.08)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`,zIndex:1},children:[(0,$.jsx)(g1.Title,{level:3,style:{margin:`0 0 4px`,color:`#fff`,fontWeight:700},children:`我的项目`}),(0,$.jsxs)(g1.Text,{style:{color:`rgba(255,255,255,0.7)`,fontSize:14},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]}),(0,$.jsx)(jD,{icon:(0,$.jsx)(jR,{}),onClick:()=>t(!0),size:`large`,style:{background:`rgba(255,255,255,0.15)`,border:`1px solid rgba(255,255,255,0.3)`,color:`#fff`,fontWeight:600,backdropFilter:`blur(10px)`,borderRadius:10,height:42},children:`新建项目`})]}),i.length===0?(0,$.jsx)(UC,{image:UC.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(jD,{type:`primary`,icon:(0,$.jsx)(jR,{}),onClick:()=>t(!0),size:`large`,children:`创建第一个项目`})}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},className:`stagger-children`,children:i.map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card project-item animate-slideInCard`,onClick:()=>r(`/projects/${e.id}/generate`),style:{display:`flex`,alignItems:`center`,padding:`18px 22px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,animationDelay:`${t*.06}s`},children:[(0,$.jsx)(`div`,{style:{width:50,height:50,borderRadius:14,flexShrink:0,background:`${u[e.industry]?.color||`#64748b`}12`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,marginRight:16,color:u[e.industry]?.color||`#64748b`},children:Z7[u[e.industry]?.icon]||(0,$.jsx)(t2,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4,flexWrap:`wrap`},children:[(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(h$,{color:u[e.industry]?.color||`#64748b`,style:{borderRadius:6,margin:0},children:u[e.industry]?.label||e.industry})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(BH,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,Y7(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(jD,{type:`primary`,icon:(0,$.jsx)(s6,{}),onClick:t=>{t.stopPropagation(),r(`/projects/${e.id}/generate`)},style:{background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,borderRadius:10,fontWeight:600,height:36,boxShadow:`0 4px 12px rgba(99,102,241,0.25)`},children:`生成`}),(0,$.jsx)(jq,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Q.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(jD,{danger:!0,icon:(0,$.jsx)(v$,{}),onClick:e=>e.stopPropagation(),style:{borderRadius:10,height:36,background:`rgba(239,68,68,0.06)`,border:`1px solid rgba(239,68,68,0.15)`,color:`#ef4444`}})}),(0,$.jsx)(Bg,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(OU,{children:[(0,$.jsx)(t2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Q.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(SW,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(SW.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(rK,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(dZ,{}),size:`large`})}),(0,$.jsx)(SW.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(yw,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(yw.Option,{value:e.key,children:(0,$.jsxs)(OU,{children:[Z7[e.icon]||(0,$.jsx)(t2,{}),` `,e.label]})},e.key))})})]})})]})};function $7(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}return`${Date.now().toString(16).padStart(12,`0`)}-${Math.random().toString(16).slice(2,10).padStart(8,`0`)}-4xxx-yxxx-${Math.random().toString(16).slice(2,12)}`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var e9=({src:e,width:t=48,height:n=48})=>{let[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null);return(0,S.useEffect)(()=>{let r=document.createElement(`video`);r.muted=!0,r.preload=`metadata`,r.crossOrigin=`anonymous`;let a=()=>{o(r.duration),r.currentTime=Math.min(1,r.duration*.1)},s=()=>{try{let e=document.createElement(`canvas`);e.width=t*2,e.height=n*2;let a=e.getContext(`2d`);a&&(a.drawImage(r,0,0,e.width,e.height),i(e.toDataURL(`image/jpeg`,.7)))}catch{}};return r.addEventListener(`loadedmetadata`,a),r.addEventListener(`seeked`,s),r.src=e,()=>{r.removeEventListener(`loadedmetadata`,a),r.removeEventListener(`seeked`,s)}},[e,t,n]),(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`,background:`#1a1a2e`},children:[r?(0,$.jsx)(`img`,{src:r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(s6,{style:{color:`#fff`,fontSize:18}})}),a!=null&&(0,$.jsx)(`span`,{style:{position:`absolute`,bottom:2,right:2,fontSize:9,color:`#fff`,background:`rgba(0,0,0,0.6)`,borderRadius:4,padding:`1px 4px`,lineHeight:1.3},children:(e=>`${Math.round(e)}s`)(a)})]})},t9=()=>{let{projectId:e}=Ze(),t=qe(),[n]=SW.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c}=J7(),l=i.items,{user:u}=I7(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(null),[M,N]=(0,S.useState)([]),[P,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(``),H=(0,S.useRef)(null),[U,W]=(0,S.useState)({}),[ee,te]=(0,S.useState)({}),[G,ne]=(0,S.useState)({}),[K,q]=(0,S.useState)(null),[J,re]=(0,S.useState)({}),[Y,ie]=(0,S.useState)(null),[ae,oe]=(0,S.useState)(5),[se,ce]=(0,S.useState)(`16:9`),[le,ue]=(0,S.useState)(`720p`),[de,fe]=(0,S.useState)(null),[pe,me]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`720p`,`1080p`],durations:[5,8,10,12,15]}),[he,ge]=(0,S.useState)(0),[_e,ve]=(0,S.useState)(0),[ye,be]=(0,S.useState)(`image`),[xe,Se]=(0,S.useState)(`1:1`),[Ce,we]=(0,S.useState)(`2K`),[Te,Ee]=(0,S.useState)(2048),[De,Oe]=(0,S.useState)(2048),[ke,Ae]=(0,S.useState)(!1),[je,Me]=(0,S.useState)([]),[Ne,Pe]=(0,S.useState)([]);(0,S.useEffect)(()=>{if(q5().then(e=>{Me(e.video),Pe(e.image)}),!ke)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&Ae(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ke]);let Fe=(e,t)=>{for(let n=0;n{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e{Ke(e)},Re=e=>{Ye(parseInt(e))},[ze,Be]=(0,S.useState)([]),[Ve,He]=(0,S.useState)([]),[Ue,We]=(0,S.useState)([]),[Ge,Ke]=(0,S.useState)(0),[Je,Ye]=(0,S.useState)(0);(0,S.useEffect)(()=>{Ue[Je]&&Ue[Je][Ge]!==void 0&&(Ee(Ue[Je][Ge].substring(0,4)),Oe(Ue[Je][Ge].substring(5)))},[Ge]),(0,S.useEffect)(()=>{Ue[Je]&&Ue[Je][Ge]!==void 0&&(Ee(Ue[Je][Ge].substring(0,4)),Oe(Ue[Je][Ge].substring(5)))},[Je]);let Xe=()=>{Ee(De),Oe(Te)},Qe=e=>{be(e.target.value===`image`?`image`:`video`)};(0,S.useEffect)(()=>{z5().then(e=>{W(Object.fromEntries(e.map(e=>[e.key,e.label]))),te(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),P5().then(e=>{let t=e.items?.[0]?.supportedSizes||{},n=[],r=[],i=[];for(let e in t[`2K`])n.push(e),r.push(t[`2K`][e]);n.forEach((e,t)=>{Be(n=>[...n,{value:e,label:String(t)}])});for(let e in t[`4K`])i.push(t[`4K`][e]);We([r,i]);let a=[];for(let e in t)a.push(e);a.forEach((e,t)=>{He(n=>[...n,{value:e,label:String(t)}])})}).catch(()=>{}),N5().then(e=>{if(e.items?.length){let t=e.items[0];me({ratios:t.supportedRatios?.length?t.supportedRatios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions?.length?t.supportedResolutions:[`720p`,`1080p`],durations:t.supportedDurations?.length?t.supportedDurations:[5,8,10,12,15]})}}).catch(()=>{})},[]),(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let $e=(0,S.useRef)(!1);(0,S.useEffect)(()=>{$e.current||l.length===0||($e.current=!0,console.log(`aaaa`,l),l.forEach(t=>{t.projectId===e&&t.status===`generating`&&(T(e=>({...e,[t.id]:`generating`})),Et(t.id)),t.projectId===e&&t.status===`optimizing`&&st(t.id)}))},[l,e]);let et=(0,S.useRef)(new Set),tt=(0,S.useRef)(null),nt=(0,S.useRef)(null),rt=e=>{et.current.add(e),ot()},it=e=>{et.current.delete(e),et.current.size===0&&at()},at=()=>{tt.current&&=(clearInterval(tt.current),null),nt.current&&=(nt.current.abort(),null)},ot=()=>{tt.current||=setInterval(async()=>{try{nt.current&&nt.current.abort();let t=new AbortController;nt.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});nt.current=null;let r=Array.from(et.current),i=[];if(r.length>0){let e=J7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`optimizing`&&i.push(e.id),t}return e});J7.setState({records:{...e,items:t}}),i.forEach(e=>{it(e)})}}catch(e){e.name!==`AbortError`&&console.error(`Optimizing polling error:`,e)}},3e3)},st=e=>{rt(e)},ct=(0,S.useRef)(!1),lt=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(ct.current||l.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,ts:o}=JSON.parse(t);if(Date.now()-o>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(lt.current===n)return;let s=l.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>o-1e4);s?(ct.current=!0,localStorage.removeItem(`pending_optimize`),g(s),v(s.optimizedPrompt||``),ge(s.textCreditsCost),ve(s.textTokensUsed),m(!0),Q.success({content:`优化请求已恢复,消耗 ${s.textCreditsCost} 积分`,key:`recovery`})):Date.now()-o>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[l,e]);let ut=r.find(t=>t.id===e),dt=l.filter(t=>t.projectId===e),ft=ut?.name??`项目`,pt=ut&&ee[ut.industry]||[],mt=u?.credits??0,ht=e=>{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e=gt,vt=async()=>{try{if(!e){Q.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Q.error(`请输入视频/图片描述`);return}f(!0);let r=Object.entries(G).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=$7();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:ae,ts:Date.now()})),lt.current=a;let o=await s(e,{prompt:i,duration:ae,genType:ye,resolution:Ce,references:M.length>0?M:void 0,idempotencyKey:a,image_size:Ce,image_proportion:xe,image_px:Te+`x`+De});localStorage.removeItem(`pending_optimize`),lt.current=null,g(o.record),v(o.record.optimizedPrompt||``),ge(o.textCreditsCost),ve(o.textTokensUsed),m(!0),Q.success({content:`「${ft}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){console.error(`优化提示词失败:`,e);let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Q.error(t)}finally{f(!1),localStorage.removeItem(`pending_optimize`),lt.current=null}},yt=(0,S.useRef)(new Set),bt=(0,S.useRef)(null),xt=(0,S.useRef)(null),St=e=>{yt.current.add(e),Tt()},Ct=e=>{yt.current.delete(e),yt.current.size===0&&wt()},wt=()=>{bt.current&&=(clearInterval(bt.current),null),xt.current&&=(xt.current.abort(),null)},Tt=()=>{bt.current||=setInterval(async()=>{try{xt.current&&xt.current.abort();let t=new AbortController;xt.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});xt.current=null;let r=Array.from(yt.current),i=[];if(r.length>0){let e=J7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`generating`&&i.push(e.id),t}return e});J7.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);Ct(e),t?.status===`completed`?(T(t=>({...t,[e]:`done`})),g(n=>n?.id===e?t:n),Q.success({content:`「${ft}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(T(t=>({...t,[e]:`failed`})),g(n=>n?.id===e?t:n),Q.error({content:`「${ft}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name!==`AbortError`&&console.error(`Global polling error:`,e)}},5e3)},Et=e=>{St(e)};(0,S.useEffect)(()=>()=>{wt(),at()},[]);let Dt=async e=>{if(!_t){Q.error(`积分不足,请先充值`);return}C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Q.loading({content:`「${ft}」正在提交视频生成...`,duration:0,key:e});try{(await c(e,{aspectRatio:se,resolution:le})).status===`failed`?(T(t=>({...t,[e]:`failed`})),Q.error({content:`「${ft}」提交失败`,key:e,duration:3})):(Q.success({content:`「${ft}」已提交,正在生成中...`,key:e,duration:3}),Et(e))}catch(t){T(t=>({...t,[e]:`failed`}));let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Q.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}},Ot=async e=>{let t=dt.find(t=>t.id===e);if(t){C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Q.loading({content:`「${ft}」正在重新提交...`,duration:0,key:e});try{let n=E[e];n&&n!==t.optimizedPrompt&&await k5(e,n);let r=await c(e,{aspectRatio:t.aspectRatio||`16:9`,resolution:t.resolution||`720p`});console.log(`重新提交视频生成结果:`,r),r.status===`failed`?(T(t=>({...t,[e]:`failed`})),console.log(`12312`),Q.error({content:`「${ft}」提交失败`,key:e,duration:3})):(Q.success({content:`「${ft}」已提交,正在生成中...`,key:e,duration:3}),Et(e))}catch(t){T(t=>({...t,[e]:`failed`})),console.log(`1231`,t);let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Q.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}}},kt=e=>{let t=w[e.id];return t===`generating`?`generating`:t===`done`?`completed`:t===`failed`?`failed`:e.status},At={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(qm,{style:{animation:`spinSlow 1s linear infinite`}})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(UH,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(qm,{style:{animation:`spinSlow 1s linear infinite`}})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(Y2,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(Q2,{})}},jt=({label:e,value:t,options:n,suffix:r,expanded:i,onToggle:a,onSelect:o,onClose:s})=>{let c=(0,S.useRef)(null),l=(0,S.useRef)(null),u=(0,S.useRef)(i),[d,f]=(0,S.useState)(null);return u.current=i,(0,S.useEffect)(()=>{if(i&&c.current){let e=c.current.getBoundingClientRect();f({bottom:window.innerHeight-e.top+4,left:e.left,width:Math.max(e.width,100)})}else f(null)},[i]),(0,S.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||l.current?.contains(e.target)||u.current&&s()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i,s]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:c,onClick:a,translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`background 0.2s, border-color 0.2s`,background:i?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:i?`1px solid #6366f1`:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(mQ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,Ri.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,background:`#fff`,borderRadius:12,padding:6,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:n.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{o(e),s()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})},Mt=({group:e,selected:t,expanded:n,onToggle:r,onSelect:i,onClose:a})=>{let o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(n),[l,u]=(0,S.useState)(null);return c.current=n,(0,S.useEffect)(()=>{if(n&&o.current){let e=o.current.getBoundingClientRect();u({bottom:window.innerHeight-e.top+4,left:e.left})}else u(null)},[n]),(0,S.useEffect)(()=>{if(!n)return;let e=e=>{o.current?.contains(e.target)||s.current?.contains(e.target)||c.current&&a()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,a]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:o,onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`all 0.2s`,background:t?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:n?`1px solid #6366f1`:`1px solid #e2e8f0`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:t?`#6366f1`:`#64748b`,fontWeight:t?600:400},children:t||e.name}),(0,$.jsx)(mQ,{style:{fontSize:9,color:t?`#6366f1`:`#94a3b8`,transition:`transform 0.2s`,transform:n?`rotate(180deg)`:`rotate(0deg)`}})]}),l&&(0,Ri.createPortal)((0,$.jsxs)(`div`,{ref:s,style:{position:`fixed`,bottom:l.bottom,left:l.left,background:`#fff`,borderRadius:12,padding:8,minWidth:160,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e.name}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:e.options.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{i(e),a()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`20px 28px`,borderRadius:16,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-30,bottom:-30,width:160,height:160,borderRadius:`50%`,background:`rgba(255,255,255,0.05)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,position:`relative`},children:[(0,$.jsx)(jD,{icon:(0,$.jsx)(s2,{}),onClick:()=>t(`/projects`),style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:10}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(g1.Title,{level:4,style:{margin:0,color:`#fff`,fontWeight:700},children:ft}),ut&&(0,$.jsx)(h$,{style:{background:`rgba(255,255,255,0.12)`,border:`1px solid rgba(255,255,255,0.2)`,color:`rgba(255,255,255,0.8)`,borderRadius:6},children:U[ut.industry]||ut.industry})]}),(0,$.jsx)(g1.Text,{style:{color:`rgba(255,255,255,0.5)`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]})]}),(0,$.jsxs)(h$,{style:{background:`rgba(255,255,255,0.1)`,border:`1px solid rgba(255,255,255,0.2)`,color:`#fff`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,mt,` 积分`]})]}),!p&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{marginBottom:24,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 2px 12px rgba(0,0,0,0.03)`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{marginRight:70,position:`relative`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(VL.Group,{defaultValue:`image`,buttonStyle:`solid`,onChange:Qe,children:[(0,$.jsxs)(VL.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(Q3,{style:{marginRight:6,fontSize:14}}),` `,`图片`]}),(0,$.jsxs)(VL.Button,{value:`video`,children:[(0,$.jsx)(P8,{style:{marginRight:6,fontSize:14}}),` `,`视频`]})]})]}),ye===`video`&&[{icon:(0,$.jsx)(x$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(g8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(S6,{}),label:`选择参数生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(g1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),ye===`image`&&[{icon:(0,$.jsx)(x$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(g8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(S6,{}),label:`图片生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(g1.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(SW,{form:n,initialValues:{},children:[(0,$.jsx)(SW.Item,{name:`prompt`,noStyle:!0,rules:[{required:!0,message:`请输入视频描述`}],style:{display:`none`}}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:20,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 4px 24px rgba(0,0,0,0.04)`,overflow:`visible`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`12px 16px 0`,minHeight:60},children:[M.map((e,t)=>(0,$.jsxs)(`div`,{className:`ref-thumb`,style:{position:`relative`,width:48,height:48,borderRadius:12,overflow:`visible`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,overflow:`hidden`,border:`1px solid #e2e8f0`,cursor:`pointer`},onClick:()=>{e.type===`video`&&ie(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:e.type===`image`?(0,$.jsx)(SG,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(e9,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),O5(e.url).catch(()=>{}),N(e=>e.filter((e,n)=>n!==t))},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(0,0,0,0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`,backdropFilter:`blur(4px)`},children:(0,$.jsx)(Q2,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(u0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Q.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Q.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=M.filter(e=>e.type===`image`).length,a=M.filter(e=>e.type===`video`).length;return t&&i>=10?(Q.error(`最多上传10张图片`),!1):n&&a>=3?(Q.error(`最多上传3个视频`),!1):(F(!0),(t?E5:D5)(e).then(e=>{let n=t?`图片`:`视频`,r=t?i+1:a+1;N(i=>[...i,{url:e.url,type:t?`image`:`video`,name:`${n}${r}`}]),Q.success(`${n}上传成功`)}).catch(()=>Q.error(`上传失败`)).finally(()=>F(!1)),!1)},children:(0,$.jsx)(cT,{title:`参考内容(${M.length}/10)`,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`,flexShrink:0},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99,102,241,0.04)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`,e.currentTarget.style.background=`transparent`},children:P?(0,$.jsx)(qm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(jR,{style:{fontSize:18,color:`#94a3b8`}})})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(rK.TextArea,{ref:H,value:I,onChange:e=>{let t=e.target.value;L(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` `)){z(!0),V(e);return}}z(!1)},rows:3,placeholder:`上传参考素材、输入文字,自由组合图、文多元素。输入 @ 可引用参考内容...`,maxLength:500,bordered:!1,autoSize:{minRows:2,maxRows:6},style:{padding:`6px 2px`,fontSize:15,lineHeight:1.7,resize:`none`,caretColor:`#6366f1`}})}),R&&M.length>0&&(0,$.jsx)(`div`,{style:{margin:`0 16px 8px`,background:`#fff`,borderRadius:10,boxShadow:`0 6px 24px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`,padding:6,maxHeight:180,overflowY:`auto`},children:M.filter(e=>!B||e.name.includes(B)).map((e,t)=>(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 10px`,borderRadius:8,cursor:`pointer`,transition:`background 0.15s`},onMouseEnter:e=>e.currentTarget.style.background=`#f1f5f9`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onMouseDown:t=>{t.preventDefault();let r=H.current?.resizableTextArea?.textArea||H.current?.nativeElement?.querySelector(`textarea`)||H.current;if(!r||!r.value)return;let i=r.value,a=i.lastIndexOf(`@`),o=i.slice(0,a)+`@${e.name} `;L(o),n.setFieldValue(`prompt`,o),z(!1),setTimeout(()=>{r.focus(),r.selectionStart=o.length,r.selectionEnd=o.length},50)},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,overflow:`hidden`,background:e.type===`image`?`#f1f5f9`:`#1a1a2e`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:e.type===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(s6,{style:{color:`#fff`,fontSize:14}})}),(0,$.jsx)(g1.Text,{style:{fontSize:13},children:e.name}),(0,$.jsx)(h$,{style:{marginLeft:`auto`,fontSize:11},children:e.type===`image`?`图片`:`视频`})]},t))}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`8px 12px 12px`,gap:8,flexWrap:`wrap`,position:`relative`,zIndex:50,minHeight:48},children:[ye!==`image`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flex:1,flexWrap:`wrap`},children:[(0,$.jsx)(jt,{label:`时长`,value:`${ae}`,options:pe.durations.map(e=>`${e}`),suffix:`秒`,expanded:de===`duration`,onToggle:()=>fe(de===`duration`?null:`duration`),onSelect:e=>oe(parseInt(e)),onClose:()=>fe(null)}),pt.map((e,t)=>{let n=K===e.name,r=G[e.name];return(0,$.jsx)(Mt,{group:e,selected:r,expanded:n,onToggle:()=>q(n?null:e.name),onSelect:t=>{ne(n=>{let r={...n};return r[e.name]===t?delete r[e.name]:r[e.name]=t,r})},onClose:()=>q(null)},`og-${t}`)})]}),ye==`image`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>Ae(!ke),className:`image-settings-trigger`,style:{minWidth:220,padding:`0px 16px`,height:30,borderRadius:10,border:`1px solid #e2e8f0`,backgroundColor:`#f8f9fc`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:(0,$.jsxs)(`div`,{style:{textAlign:`left`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:13,fontWeight:600,color:`#374151`,marginRight:10},children:xe===`auto`?`智能`:xe}),(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#9ca3af`},children:[Ce==`2K`?`高清 2K`:`超清 4K`,`| `,Te,`×`,De]})]})}),(0,$.jsx)(mQ,{style:{fontSize:14,color:`#9ca3af`}})]}),ke&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:520,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:20,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(g1.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:ze.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{Se(e.value),Le(e.label)},style:{flex:`0 0 calc(11.11% - 5px)`,minWidth:48,height:56,borderRadius:8,border:xe===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:xe===e.value?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:e.value===`auto`?16:20,height:e.value===`auto`?16:20,border:`2px solid ${xe===e.value?`#6366f1`:`#9ca3af`}`,borderRadius:(e.value,3),marginBottom:3,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.value===`auto`&&(0,$.jsx)(`span`,{style:{fontSize:8,color:xe===e.value?`#6366f1`:`#9ca3af`},children:`智`})}),(0,$.jsx)(`span`,{style:{fontSize:10,color:xe===e.value?`#6366f1`:`#6b7280`,fontWeight:xe===e.value?600:400},children:e.value})]},e.value))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(g1.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:Ve.map(e=>(0,$.jsx)(`button`,{onClick:()=>{we(e.value),Re(e.label)},style:{flex:1,height:48,borderRadius:8,border:Ce===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:Ce===e.value?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsxs)(`span`,{style:{fontSize:13,fontWeight:600,color:Ce===e.value?`#fff`:`#4b5563`},children:[e.value,e.value===`4k`&&(0,$.jsx)(`span`,{style:{marginLeft:3},children:`✨`})]})},e.value))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`尺寸`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`W`}),(0,$.jsx)(rK,{value:Te,onChange:e=>Ee(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`button`,{onClick:Xe,style:{width:28,height:28,borderRadius:6,border:`1px solid #e5e7eb`,backgroundColor:`#fff`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:`#6366f1`},children:(0,$.jsx)(sG,{style:{fontSize:12}})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`H`}),(0,$.jsx)(rK,{value:De,onChange:e=>Oe(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12},children:`PX`})]})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:[ye===`image`&&(0,$.jsx)(`span`,{style:{color:`#7c7c7c`,fontSize:14},children:`(请在左侧选择图片比例和尺寸)`}),(0,$.jsx)(jD,{type:`primary`,size:`large`,onClick:vt,loading:d,style:{borderRadius:10,fontWeight:600,minWidth:140,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 16px rgba(99,102,241,0.35)`},children:`AI优化提示词`})]})]})]})]})]}),p&&h&&(0,$.jsxs)(Uz,{className:`animate-fadeInUp`,style:{borderRadius:16},styles:{body:{padding:`24px 28px`}},children:[!w[h.id]||w[h.id]===`idle`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:24,padding:`14px 18px`,borderRadius:12,background:`linear-gradient(135deg, rgba(16,185,129,0.06), rgba(5,150,105,0.06))`,border:`1px solid rgba(16,185,129,0.15)`},children:[(0,$.jsx)(Y2,{style:{color:`#10b981`,fontSize:22}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:15,display:`block`},children:`提示词优化完成`}),(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`文本优化消耗 `,he,` 积分· 您可以编辑提示词后选择参数生成视频`]})]})]}):(0,$.jsxs)(`div`,{style:{marginBottom:24,padding:`16px 18px`,borderRadius:12,display:`flex`,alignItems:`center`,gap:12,background:w[h.id]===`failed`?`rgba(239,68,68,0.04)`:w[h.id]===`done`?`rgba(16,185,129,0.04)`:`rgba(99,102,241,0.04)`,border:`1px solid ${w[h.id]===`failed`?`rgba(239,68,68,0.12)`:w[h.id]===`done`?`rgba(16,185,129,0.12)`:`rgba(99,102,241,0.12)`}`},children:[w[h.id]===`generating`&&(0,$.jsx)(qm,{style:{color:`#6366f1`,fontSize:18},spin:!0}),w[h.id]===`done`&&(0,$.jsx)(Y2,{style:{color:`#10b981`,fontSize:18}}),w[h.id]===`failed`&&(0,$.jsx)(Q2,{style:{color:`#ef4444`,fontSize:18}}),(0,$.jsxs)(g1.Text,{strong:!0,style:{fontSize:14,color:w[h.id]===`failed`?`#ef4444`:w[h.id]===`done`?`#10b981`:`#6366f1`},children:[w[h.id]===`generating`&&`${ye===`image`?`图片`:`视频`}生成中,请稍候...`,w[h.id]===`done`&&`${ye===`image`?`图片`:`视频`}生成成功`,w[h.id]===`failed`&&`${ye===`image`?`图片`:`视频`}生成失败,请重试`]})]}),!w[h.id]||w[h.id]===`idle`||w[h.id]===`failed`?(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:100},children:(0,$.jsx)(g1.Text,{style:{fontSize:14,color:`#64748b`,lineHeight:1.7},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(OU,{size:4,children:[(0,$.jsx)(cT,{title:`复制`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(W$,{}),onClick:()=>{navigator.clipboard.writeText(_),Q.success(`已复制`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(cT,{title:`编辑`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(x$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(rK.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:14,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(jD,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(jD,{size:`small`,type:`primary`,onClick:()=>{b(!1),Q.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:100},children:(0,$.jsx)(g1.Text,{style:{fontSize:14,color:`#1a1a2e`,lineHeight:1.7},children:_})})]})]}):(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 55%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:80},children:(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.6},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(OU,{size:4,children:[(0,$.jsx)(cT,{title:`复制`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(W$,{}),onClick:()=>{navigator.clipboard.writeText(_),Q.success(`已复制`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(cT,{title:`编辑`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(x$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(rK.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:13,lineHeight:1.6,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(jD,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(jD,{size:`small`,type:`primary`,onClick:()=>{b(!1),Q.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:120},children:(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.6},children:_})})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:280},children:[h.videoUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成视频`}),(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,background:`#000`},children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${h.videoUrl}`,controls:!0,style:{width:`100%`,maxHeight:350,display:`block`}})})]}),h.imageUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成图片`}),(0,$.jsx)(SG,{src:`http://ceshi.apiforeign.minzhong.cn${h.imageUrl}`,style:{width:`100%`,maxHeight:350,objectFit:`contain`,borderRadius:12,border:`1px solid #f0f0f5`},preview:!0})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:20,padding:`14px 18px`,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:[ye!==`image`&&(0,$.jsxs)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#1a1a2e`,fontWeight:600,display:`block`,marginBottom:12},children:`选择视频参数`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(g1.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[ae,`s`]})]}),(0,$.jsx)(jt,{label:`比例`,value:se,options:pe.ratios,expanded:de===`ratio`,onToggle:()=>fe(de===`ratio`?null:`ratio`),onSelect:e=>ce(e),onClose:()=>fe(null)}),(0,$.jsx)(jt,{label:`分辨率`,value:le,options:pe.resolutions,expanded:de===`resolution`,onToggle:()=>fe(de===`resolution`?null:`resolution`),onSelect:e=>ue(e),onClose:()=>fe(null)})]})]}),ye==`image`&&h&&(0,$.jsx)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-around`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`分辨率`}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageSize||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面比例`}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageProportion||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面尺寸`}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imagePx||`-`})]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`文字积分`}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:`#6366f1`},children:he})]}),(0,$.jsx)(g1.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`+`}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:[`预估`,ye===`image`?`图片`:`视频`,`积分`]}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:`#10b981`},children:ye===`image`&&h.imageSize?ht(h.imageSize)||gt:Fe(ae,le)})]}),(0,$.jsx)(g1.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`=`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`总计`}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:16,color:`#1a1a2e`},children:(he+(ye===`image`?ht(h.imageSize):Fe(ae,le))).toFixed(2)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsxs)(jD,{size:`large`,onClick:()=>{m(!1),g(null),v(``),L(``),N([]),ne({}),q(null),fe(null),n.resetFields()},style:{borderRadius:12,minWidth:120,height:44,fontWeight:500},children:[`配置新`,ye===`image`?`图片`:`视频`]}),(0,$.jsx)(cT,{title:_t?``:`积分不足`,children:(0,$.jsx)(jD,{type:`primary`,size:`large`,icon:(0,$.jsx)(S6,{}),onClick:()=>Dt(h.id),loading:w[h.id]===`generating`,disabled:!_t||w[h.id]===`generating`||w[h.id]===`done`,style:{borderRadius:12,minWidth:180,height:44,fontWeight:600,background:w[h.id]===`done`?`#10b981`:_t?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#d1d5db`,border:`none`,boxShadow:_t?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:w[h.id]===`done`?`生成完成`:w[h.id]===`generating`?`生成中...`:`生成${ye===`image`?`图片`:`视频`} (${ye===`image`?ht(h.imageSize):Fe(ae,le)}积分)`})})]})]}),h.references&&h.references.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`参考内容`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:h.references.map((e,t)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{e.type===`video`&&ie(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:[e.type===`image`?(0,$.jsx)(SG,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(e9,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,width:64,height:64}),(0,$.jsx)(h$,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:e.name})]},t))})]})]}),dt.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:24},children:[(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:15,display:`block`,marginBottom:12},children:`本项目生成记录`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},className:`stagger-children`,children:dt.map((e,t)=>{let n=kt(e),r=E[e.id]??(e.optimizedPrompt||e.originalPrompt),i=A===e.id,a=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.05}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>j(i?null:e.id),style:{padding:`12px 16px`,borderRadius:i?`12px 12px 0 0`:12,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:a===`image`?`#fef3c7`:`#dbeafe`},children:a===`image`?(0,$.jsx)(Q3,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(P8,{style:{color:`#2563eb`,fontSize:12}})}),i?(0,$.jsx)(mQ,{style:{color:`#6366f1`,fontSize:11,flexShrink:0}}):(0,$.jsx)(K2,{style:{color:`#cbd5e1`,fontSize:11,flexShrink:0}}),(0,$.jsx)(h$,{color:At[n]?.color,icon:At[n]?.icon,style:{margin:0},children:At[n]?.text}),(0,$.jsx)(g1.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),n===`prompt_optimized`&&(0,$.jsx)(h$,{color:`processing`,style:{padding:`3px 10px`,fontSize:12,margin:0,flexShrink:0},children:`待配置`}),a===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` ·`,` `,e.imageProportion||`-`,` ·`,` `,e.imagePx||`-`,` ·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:Y7(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` ·`,` `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` `,`·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:Y7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation(),children:(0,$.jsx)(OU,{children:n===`failed`&&(0,$.jsx)(jD,{type:`primary`,danger:!0,size:`small`,icon:(0,$.jsx)(s6,{}),loading:x[e.id],onClick:()=>Ot(e.id),style:{borderRadius:8},children:`重试`})})})]}),i&&(0,$.jsx)(`div`,{style:{background:`#fff`,border:`1px solid #f0f0f5`,borderTop:`none`,borderRadius:`0 0 12px 12px`,padding:`18px 20px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:260},children:[(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,(n===`prompt_optimized`||n===`failed`)&&O!==e.id&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),O!==e.id&&(0,$.jsxs)(OU,{size:4,children:[(0,$.jsx)(cT,{title:`复制`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(W$,{}),onClick:()=>{navigator.clipboard.writeText(r),Q.success(`已复制`)},style:{color:`#94a3b8`}})}),(n===`prompt_optimized`||n===`failed`)&&(0,$.jsx)(cT,{title:`编辑`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(x$,{}),onClick:()=>{k(e.id),D(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt??``}))},style:{color:`#6366f1`}})})]})]}),O===e.id?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(rK.TextArea,{value:r,onChange:t=>D(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(jD,{size:`small`,onClick:()=>k(null),children:`取消`}),(0,$.jsx)(jD,{size:`small`,type:`primary`,onClick:()=>{D(t=>({...t,[e.id]:r})),k(null),Q.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:n===`prompt_optimized`?`rgba(99,102,241,0.02)`:`#f8f9fc`,border:n===`prompt_optimized`?`1px solid rgba(99,102,241,0.1)`:`1px solid #f0f0f5`},children:(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),a===`image`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`图片积分`,value:`${e.creditsCost||0}`},{label:`分辨率`,value:e.imageSize?`${e.imageSize}`:`-`},{label:`比例`,value:e.imageProportion||`-`},{label:`尺寸`,value:e.imagePx||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}):(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`视频积分`,value:`${e.creditsCost||0}`},{label:`时长`,value:e.duration?`${e.duration}秒`:`-`},{label:`比例`,value:e.aspectRatio||`-`},{label:`分辨率`,value:e.resolution||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}),(e.references&&e.references.length>0||n===`failed`)&&(0,$.jsxs)(`div`,{style:{marginTop:14},children:[(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:[`参考素材`,` `,n===`failed`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可删除/添加后重试)`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[e.references?.map((t,r)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`visible`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{t.type===`video`&&ie(`http://ceshi.apiforeign.minzhong.cn${t.url}`)},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`},children:t.type===`image`?(0,$.jsx)(SG,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(e9,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,width:64,height:64})}),(0,$.jsx)(h$,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:t.name}),n===`failed`&&(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),O5(t.url).catch(()=>{});let i=e.references.filter((e,t)=>t!==r);J7.getState().updateRecordReferences(e.id,i)},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(239,68,68,0.8)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`},children:(0,$.jsx)(Q2,{style:{color:`#fff`,fontSize:10}})})]},r)),n===`failed`&&(0,$.jsx)(u0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`);return!n&&!r?(Q.error(`仅支持图片或视频文件`),!1):((n?E5:D5)(t).then(r=>{let i={url:r.url,type:n?`image`:`video`,name:t.name||(n?`图片`:`视频`)},a=e.references||[];J7.getState().updateRecordReferences(e.id,[...a,i]),Q.success(`上传成功`)}).catch(()=>Q.error(`上传失败`)),!1)},children:(0,$.jsx)(cT,{title:`添加参考素材`,children:(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`},children:(0,$.jsx)(jR,{style:{fontSize:18,color:`#94a3b8`}})})})})]})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:220,position:`relative`},children:[n===`prompt_optimized`&&(0,$.jsxs)(`div`,{style:{marginTop:16,position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,backgroundColor:`transparent`},children:[a===`video`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`,marginBottom:12},children:[(0,$.jsxs)(`div`,{translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,marginLeft:12},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(g1.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[e.duration,`秒`]})]}),(0,$.jsx)(jt,{label:`比例`,value:J[e.id]?.aspectRatio||`选择比例`,options:pe.ratios,expanded:de===`ratio-${e.id}`,onToggle:()=>fe(de===`ratio-${e.id}`?null:`ratio-${e.id}`),onSelect:t=>re(n=>({...n,[e.id]:{...n[e.id],aspectRatio:t,resolution:n[e.id]?.resolution||``}})),onClose:()=>fe(null)}),(0,$.jsx)(jt,{label:`分辨率`,value:J[e.id]?.resolution||`选择分辨率`,options:pe.resolutions,expanded:de===`res-${e.id}`,onToggle:()=>fe(de===`res-${e.id}`?null:`res-${e.id}`),onSelect:t=>re(n=>({...n,[e.id]:{...n[e.id],aspectRatio:n[e.id]?.aspectRatio||``,resolution:t}})),onClose:()=>fe(null)})]}),(0,$.jsxs)(jD,{type:`primary`,size:`large`,icon:(0,$.jsx)(S6,{}),block:!0,loading:x[e.id],disabled:a===`video`&&(!J[e.id]?.aspectRatio||!J[e.id]?.resolution),onClick:async()=>{let t=J[e.id];if(a===`video`){if(!t?.aspectRatio||!t?.resolution){Q.error(`请选择比例和分辨率`);return}if(mt({...t,[e.id]:!0})),T(t=>({...t,[e.id]:`generating`}));let n=a===`video`?`视频`:`图片`;Q.loading({content:`「${ft}」正在生成${n}...`,duration:0,key:e.id});try{await c(e.id,{aspectRatio:t?.aspectRatio,resolution:t?.resolution}),T(t=>({...t,[e.id]:`done`})),Q.success({content:`「${ft}」${n}生成成功!`,key:e.id,duration:3})}catch{T(t=>({...t,[e.id]:`failed`})),Q.error({content:`「${ft}」${n}生成失败`,key:e.id,duration:3})}finally{C(t=>({...t,[e.id]:!1}))}},style:{borderRadius:12,fontWeight:600,color:`#fff`,height:48,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,position:`absolute`,bottom:18,left:0},children:[`生成`,a===`video`?`视频`:`图片`,a===`video`?(0,$.jsx)(`span`,{style:{color:`#d2d2d2`,fontSize:`14px`,marginLeft:`6px`},children:`(请选择上方的比例分辨率)`}):``,` `,a===`video`&&J[e.id]?.resolution?`(${Fe(e.duration||5,J[e.id].resolution)}积分)`:``,a===`image`&&e.imageSize?`(${Ie(e.imageSize)}积分)`:a===`image`?`(积分)`:``]})]}),n===`failed`&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:18,right:20},children:(0,$.jsxs)(jD,{type:`primary`,danger:!0,size:`large`,icon:(0,$.jsx)(s6,{}),block:!0,loading:x[e.id],onClick:()=>Ot(e.id),style:{borderRadius:12,fontWeight:600,height:48},children:[`重新生成`,a===`video`?`视频`:`图片`]})}),n===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(qm,{style:{color:`#6366f1`,fontSize:28},spin:!0}),(0,$.jsxs)(g1.Text,{style:{color:`#94a3b8`,fontSize:13},children:[a===`video`?`视频`:`图片`,`生成中...`]})]}):n===`completed`&&e.videoUrl||e.imageUrl?(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(cT,{title:`下载${a===`video`?`视频`:`图片`}`,children:(0,$.jsx)(jD,{size:`small`,icon:(0,$.jsx)(i0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${a===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${a===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:180,overflow:`hidden`},children:a===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,borderRadius:0}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,borderRadius:0}})}),(0,$.jsxs)(`div`,{style:{padding:`8px 12px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(OU,{children:[a===`video`?(0,$.jsx)(P8,{style:{color:`#6366f1`,fontSize:13}}):(0,$.jsx)(Q3,{style:{color:`#6366f1`,fontSize:13}}),(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:11,color:`#94a3b8`},children:Y7(e.generatedAt)})]})]}):n===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10,padding:16},children:[(0,$.jsx)(Q2,{style:{color:`#ef4444`,fontSize:28}}),(0,$.jsxs)(g1.Text,{style:{color:`#ef4444`,fontSize:14,fontWeight:600},children:[a===`video`?`视频`:`图片`,`生成失败`]}),e.errorMessage&&(0,$.jsx)(g1.Text,{style:{color:`#ef4444`,fontSize:12,textAlign:`center`,lineHeight:1.6},children:e.errorMessage})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(UH,{style:{color:`#94a3b8`,fontSize:28}}),(0,$.jsx)(g1.Text,{style:{color:`#94a3b8`,fontSize:13},children:a===`image`?`待生成图片`:n===`prompt_optimized`?`待配置视频参数`:`待生成视频`})]})]})]})})]},e.id)})})]}),(0,$.jsx)(Dq,{open:!!Y,onCancel:()=>ie(null),footer:null,width:480,centered:!0,destroyOnClose:!0,closable:!1,title:null,styles:{body:{padding:0,background:`#000`,position:`relative`}},children:Y&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:Y,controls:!0,autoPlay:!0,style:{width:`100%`,display:`block`,maxHeight:`70vh`}}),(0,$.jsx)(`div`,{onClick:()=>ie(null),style:{position:`absolute`,top:8,right:8,width:28,height:28,borderRadius:`50%`,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,transition:`background 0.15s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.85)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.6)`},children:(0,$.jsx)(Q2,{style:{color:`#fff`,fontSize:16}})})]})})]})},n9={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(qm,{spin:!0})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(UH,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(qm,{spin:!0})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(Y2,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(Q2,{})}},r9=()=>{let{records:e,projects:t,fetchRecords:n,fetchProjects:r,generateVideo:i}=J7(),a=e.items,[o,s]=(0,S.useState)(1),[c,l]=(0,S.useState)(10),[u,d]=(0,S.useState)({}),[f,p]=(0,S.useState)(void 0),[m,h]=(0,S.useState)(void 0),[g,_]=(0,S.useState)({}),[v,y]=(0,S.useState)(null),[b,x]=(0,S.useState)(null),[C,w]=(0,S.useState)(null);(0,S.useEffect)(()=>{r()},[r]),(0,S.useEffect)(()=>{n({projectId:f,status:m,page:o,pageSize:c})},[n,f,m,o,c]);let T=async()=>{if(!C)return;let{recordId:e,projectName:t,ratio:n,resolution:r}=C;d(t=>({...t,[e]:!0})),w(null),Q.loading({content:`「${t}」正在生成视频...`,duration:0,key:e});try{await i(e,{aspectRatio:n,resolution:r}),Q.success({content:`「${t}」视频生成成功!`,key:e,duration:3})}catch{Q.error({content:`「${t}」视频生成失败`,key:e,duration:3})}finally{d(t=>({...t,[e]:!1}))}},E=e=>{if((e.genType||`image`)===`image`){d(t=>({...t,[e.id]:!0})),Q.loading({content:`「${e.projectName}」正在生成图片...`,duration:0,key:e.id}),i(e.id,{}).then(()=>{Q.success({content:`「${e.projectName}」图片生成成功!`,key:e.id,duration:3})}).catch(()=>{Q.error({content:`「${e.projectName}」图片生成失败`,key:e.id,duration:3})}).finally(()=>{d(t=>({...t,[e.id]:!1}))});return}w({recordId:e.id,projectName:e.projectName,ratio:e.aspectRatio||`16:9`,resolution:e.resolution||`720p`})},D=a;return(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(g1.Text,{style:{fontSize:14,color:`#94a3b8`},children:`查看所有视频生成记录,点击记录查看完整内容和视频`})}),(0,$.jsxs)(`div`,{className:`record-filter-bar animate-fadeInUp`,style:{display:`flex`,gap:12,marginBottom:20,padding:`14px 20px`,borderRadius:14,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(OU,{children:[(0,$.jsx)(L4,{style:{color:`#94a3b8`}}),(0,$.jsx)(yw,{placeholder:`全部项目`,allowClear:!0,style:{width:200},onChange:e=>{p(e),s(1)},children:t.map(e=>(0,$.jsx)(yw.Option,{value:e.id,children:e.name},e.id))}),(0,$.jsxs)(yw,{placeholder:`全部状态`,allowClear:!0,style:{width:140},onChange:e=>{h(e),s(1)},children:[(0,$.jsx)(yw.Option,{value:`prompt_optimized`,children:`待生成`}),(0,$.jsx)(yw.Option,{value:`generating`,children:`生成中`}),(0,$.jsx)(yw.Option,{value:`completed`,children:`已完成`}),(0,$.jsx)(yw.Option,{value:`failed`,children:`失败`})]})]}),(0,$.jsxs)(g1.Text,{style:{marginLeft:`auto`,lineHeight:`32px`,color:`#94a3b8`,fontSize:13},children:[`共 `,e.total,` 条记录`]})]}),D.length===0?(0,$.jsx)(UC,{image:UC.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:60}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},className:`stagger-children`,children:D.map((e,t)=>{let n=v===e.id,r=g[e.id]??e.optimizedPrompt,i=u[e.id],a=b===e.id,o=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.04}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>x(a?null:e.id),style:{padding:`14px 20px`,borderRadius:a?`14px 14px 0 0`:14,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:o===`image`?`#fef3c7`:`#dbeafe`},children:o===`image`?(0,$.jsx)(Q3,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(P8,{style:{color:`#2563eb`,fontSize:12}})}),a?(0,$.jsx)(mQ,{style:{color:`#6366f1`,fontSize:12,flexShrink:0}}):(0,$.jsx)(K2,{style:{color:`#cbd5e1`,fontSize:12,flexShrink:0}}),(0,$.jsx)(h$,{color:n9[e.status].color,icon:n9[e.status].icon,style:{margin:0},children:n9[e.status].text}),(0,$.jsx)(h$,{style:{background:`#f0f0ff`,border:`none`,color:`#6366f1`,margin:0},children:e.projectName}),(0,$.jsx)(g1.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),o===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` · `,e.imageProportion||`-`,` · `,e.imagePx||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:Y7(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` · `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:Y7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(OU,{children:[e.status===`prompt_optimized`&&(0,$.jsx)(jD,{type:`primary`,size:`small`,icon:(0,$.jsx)(s6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`生成`}),e.status===`generating`&&(0,$.jsx)(h$,{color:`processing`,icon:(0,$.jsx)(qm,{spin:!0}),style:{padding:`4px 12px`,fontSize:12},children:`生成中...`}),e.status===`failed`&&(0,$.jsx)(jD,{type:`primary`,danger:!0,size:`small`,icon:(0,$.jsx)(s6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:8},children:`重试`})]})})]}),a&&(0,$.jsx)(`div`,{style:{background:`#fff`,border:`1px solid #f0f0f5`,borderTop:`none`,borderRadius:`0 0 14px 14px`,padding:`20px 24px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(g1.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词 `,e.status===`prompt_optimized`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!n&&(0,$.jsxs)(OU,{size:4,children:[(0,$.jsx)(cT,{title:`复制`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(W$,{}),onClick:()=>{navigator.clipboard.writeText(r),Q.success(`已复制`)},style:{color:`#94a3b8`}})}),e.status===`prompt_optimized`&&(0,$.jsx)(cT,{title:`编辑`,children:(0,$.jsx)(jD,{type:`text`,size:`small`,icon:(0,$.jsx)(x$,{}),onClick:()=>{y(e.id),_(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt}))},style:{color:`#6366f1`}})})]})]}),n?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(rK.TextArea,{value:r,onChange:t=>_(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(jD,{size:`small`,onClick:()=>y(null),children:`取消`}),(0,$.jsx)(jD,{size:`small`,type:`primary`,onClick:()=>{_(t=>({...t,[e.id]:r})),y(null),Q.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`},children:(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:16,padding:`12px 16px`,borderRadius:10,background:`#f8f9fc`},children:o===`image`?[{label:`分辨率`,value:e.imageSize?`${e.imageSize} `:`-`},{label:`画面比例`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`画面尺寸`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost} `:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t)):[{label:`时长`,value:e.duration?`${e.duration} 秒`:`-`},{label:`画面比例`,value:e.aspectRatio||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`分辨率`,value:e.resolution||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost}`:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t))}),e.status===`prompt_optimized`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsx)(jD,{type:`primary`,size:`large`,icon:(0,$.jsx)(S6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:12,fontWeight:600,height:44,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.3)`},children:o===`video`?`选择参数生成视频`:`生成图片`})}),e.status===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsxs)(jD,{type:`primary`,danger:!0,size:`large`,icon:(0,$.jsx)(s6,{}),loading:i,onClick:()=>E(e),style:{borderRadius:12,fontWeight:600,height:44},children:[`重新生成`,o===`video`?`视频`:`图片`]})})]}),(0,$.jsx)(`div`,{style:{flex:`1 1 40%`,minWidth:240},children:e.status===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(qm,{style:{color:`#6366f1`,fontSize:32},spin:!0}),(0,$.jsxs)(g1.Text,{style:{color:`#94a3b8`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成中...`]}),(0,$.jsx)(g1.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`请耐心等待,生成完成后将自动展示`})]}):e.status===`completed`&&(e.videoUrl||e.imageUrl)?(0,$.jsxs)(`div`,{style:{borderRadius:14,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(cT,{title:`下载${o===`video`?`视频`:`图片`}`,children:(0,$.jsx)(jD,{size:`small`,icon:(0,$.jsx)(i0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${o===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${o===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:280,overflow:`hidden`},children:o===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,display:`block`}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,display:`block`}})}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(OU,{children:[o===`video`?(0,$.jsx)(P8,{style:{color:`#6366f1`}}):(0,$.jsx)(Q3,{style:{color:`#6366f1`}}),(0,$.jsx)(g1.Text,{style:{fontSize:13,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`生成于 `,Y7(e.generatedAt)]})]})]}):e.status===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(Q2,{style:{color:`#ef4444`,fontSize:32}}),(0,$.jsxs)(g1.Text,{style:{color:`#ef4444`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成失败`]}),(0,$.jsx)(g1.Text,{style:{color:`#94a3b8`,fontSize:12},children:`请在左侧点击重新生成`})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(UH,{style:{color:`#94a3b8`,fontSize:32}}),(0,$.jsxs)(g1.Text,{style:{color:`#94a3b8`,fontSize:14},children:[`待生成`,o===`video`?`视频`:`图片`]}),(0,$.jsx)(g1.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`点击左侧生成按钮开始生成`})]})})]})})]},e.id)})}),e.total>0&&(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:18},children:(0,$.jsx)(UK,{current:e.page||o,pageSize:e.pageSize||c,total:e.total,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{s(e),l(t)}})}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(OU,{children:[(0,$.jsx)(S6,{}),`生成视频`]}),open:!!C,onCancel:()=>w(null),onOk:T,okText:`提交生成`,cancelText:`取消`,width:420,children:C&&(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16,marginTop:16},children:(()=>{let e=a.find(e=>e.id===C.recordId);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,$.jsx)(g1.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`时长`}),(0,$.jsxs)(g1.Text,{strong:!0,children:[e?.duration||5,`秒`]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`画面比例`}),(0,$.jsx)(yw,{value:C.ratio,onChange:e=>w(t=>t?{...t,ratio:e}:null),style:{width:`100%`},options:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`].map(e=>({value:e,label:e}))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`分辨率`}),(0,$.jsx)(yw,{value:C.resolution,onChange:e=>w(t=>t?{...t,resolution:e}:null),style:{width:`100%`},options:[`480p`,`720p`,`1080p`].map(e=>({value:e,label:e}))})]})]})})()})})]})},i9=({value:e,duration:t=1200})=>{let[n,r]=(0,S.useState)(0),i=(0,S.useRef)(0);return(0,S.useEffect)(()=>{let a=n,o=e-a;if(o===0)return;let s=performance.now(),c=e=>{let n=e-s,l=Math.min(n/t,1);r(a+o*(1-(1-l)**3)),l<1&&(i.current=requestAnimationFrame(c))};return i.current=requestAnimationFrame(c),()=>cancelAnimationFrame(i.current)},[e]),(0,$.jsx)($.Fragment,{children:n.toLocaleString()})},a9=()=>{let{user:e}=I7(),[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(1),[s,c]=(0,S.useState)(10),[l,u]=(0,S.useState)(0);(0,S.useEffect)(()=>{(async()=>{i(!0);let e=await j5(a,s);n(e.records),u(e.total),i(!1)})()},[a,s]);let d=(e,t)=>{o(e),c(t)},f=t.filter(e=>e.type===`recharge`).reduce((e,t)=>e+t.amount,0),p=t.filter(e=>e.type===`consume`).reduce((e,t)=>e+Math.abs(t.amount),0);return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(mJ,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(DV,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(OU,{style:{marginBottom:10},children:[(0,$.jsx)(L8,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`当前可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:(0,$.jsx)(i9,{value:e?.credits??0})})]})]})}),(0,$.jsx)(DV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.06s`},children:[(0,$.jsxs)(OU,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(u2,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:(0,$.jsx)(i9,{value:f})})]})}),(0,$.jsx)(DV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.12s`},children:[(0,$.jsxs)(OU,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(i2,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:(0,$.jsx)(i9,{value:p})})]})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{animationDelay:`0.15s`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(g8,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(n$,{columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>(0,$.jsx)(h$,{color:e===`recharge`?`green`:`orange`,icon:e===`recharge`?(0,$.jsx)(u2,{}):(0,$.jsx)(i2,{}),children:e===`recharge`?`充值`:`消费`})},{title:`积分变动`,dataIndex:`amount`,key:`amount`,width:120,render:e=>(0,$.jsxs)(g1.Text,{strong:!0,style:{color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`说明`,dataIndex:`description`,key:`description`},{title:`时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{color:`#94a3b8`},children:Y7(e)})}],dataSource:t,rowKey:`id`,loading:r,pagination:{current:a,pageSize:s,total:l,onChange:d,showSizeChanger:!0,showTotal:e=>`共 ${e} 条`},scroll:{x:500}})})]})]})},o9=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d()},[c]);let d=async()=>{t(!0);try{let e=await j5(c,u);r(e.records||[]),a(e.credits||0),s(e.total||0)}catch{r([])}t(!1)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(mJ,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(DV,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #f59e0b 0%, #ea580c 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(L8,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:i.toLocaleString()})]})]})}),(0,$.jsx)(DV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(u6,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount>0).reduce((e,t)=>e+t.amount,0).toLocaleString()})]})}),(0,$.jsx)(DV,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(g8,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount<0).reduce((e,t)=>e+Math.abs(t.amount),0).toLocaleString()})]})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(g8,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(uq,{spinning:e,children:n.length===0?(0,$.jsx)(UC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无积分变动记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(n$,{dataSource:n,columns:[{title:`变动类型`,dataIndex:`type`,key:`type`,width:120,render:e=>{let t={recharge:{color:`#10b981`,label:`充值`,bg:`rgba(16,185,129,0.1)`},consume:{color:`#ef4444`,label:`消费`,bg:`rgba(239,68,68,0.1)`},admin:{color:`#f59e0b`,label:`管理员调整`,bg:`rgba(245,158,11,0.1)`},refund:{color:`#8b5cf6`,label:`退款`,bg:`rgba(139,92,246,0.1)`}}[e]||{color:`#64748b`,label:e,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(h$,{color:t.color,style:{background:t.bg,fontWeight:500,padding:`4px 12px`},children:t.label})}},{title:`描述`,dataIndex:`description`,key:`description`,ellipsis:!0},{title:`变动积分`,dataIndex:`amount`,key:`amount`,width:120,align:`right`,render:e=>(0,$.jsxs)(g1.Text,{strong:!0,style:{fontWeight:700,color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt||t.create_time||t.createTime;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(UK,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})]})},s9=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(1),[c]=(0,S.useState)(10);(0,S.useEffect)(()=>{l()},[o]);let l=async()=>{t(!0);try{let e=await W5(o,c);r(e.items||[]),a(e.total||0)}catch{r([])}t(!1)};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(NU,{style:{color:`#0ea5e9`,fontSize:16}}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:16},children:`订单记录`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`共 `,n.length,` 条记录`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(uq,{spinning:e,children:n.length===0?(0,$.jsx)(UC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无订单记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(n$,{dataSource:n,columns:[{title:`订单号`,key:`orderNo`,width:200,render:(e,t)=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:13,color:`#64748b`},children:t.order_no||t.orderNo||t.id})},{title:`支付方式`,key:`paymentMethod`,width:100,render:(e,t)=>{let n=t.payment_method||t.paymentMethod||`wechat`,r={alipay:{icon:(0,$.jsx)(Y0,{style:{fontSize:16}}),label:`支付宝`,color:`#1677ff`},wechat:{icon:(0,$.jsx)(U8,{style:{fontSize:16}}),label:`微信支付`,color:`#07c160`}},i=r[n]||r.wechat;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:i.color},children:i.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#374151`},children:i.label})]})}},{title:`金额`,key:`amount`,width:100,align:`right`,render:(e,t)=>{let n=t.amount||t.total_amount||0;return(0,$.jsxs)(g1.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,n]})}},{title:`获得积分`,key:`credits`,width:100,align:`center`,render:(e,t)=>{let n=t.credits||t.credit_amount||0;return(0,$.jsx)(g1.Text,{strong:!0,style:{fontWeight:600,fontSize:14,color:`#f59e0b`},children:n})}},{title:`状态`,key:`status`,width:100,render:(e,t)=>{let n=t.status||`pending`,r={pending:{color:`#f59e0b`,label:`待支付`,bg:`rgba(245,158,11,0.1)`},paid:{color:`#10b981`,label:`已支付`,bg:`rgba(16,185,129,0.1)`},refunded:{color:`#94a3b8`,label:`已退款`,bg:`rgba(148,163,184,0.1)`},failed:{color:`#ef4444`,label:`支付失败`,bg:`rgba(239,68,68,0.1)`},cancelled:{color:`#64748b`,label:`已取消`,bg:`rgba(100,116,139,0.1)`},processing:{color:`#0ea5e9`,label:`处理中`,bg:`rgba(14,165,233,0.1)`}}[n]||{color:`#64748b`,label:n,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(h$,{color:r.color,style:{background:r.bg,fontWeight:500,padding:`4px 12px`},children:r.label})}},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}},{title:`支付时间`,key:`paidAt`,width:180,render:(e,t)=>{let n=t.paid_at||t.paidAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`order_no`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(UK,{current:o,pageSize:c,total:i,onChange:e=>{s(e)},size:`small`})})]})})})]})})},c9=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d(),f()},[c]);let d=async()=>{t(!0);try{let e=await I5(c,u);r(e.items||[]),s(e.total||0)}catch{r([])}t(!1)},f=async()=>{try{a(await L5())}catch{a(0)}},p=async e=>{try{await R5(e),d(),f()}catch{}};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(T2,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:16},children:`消息中心`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`未读 `,i,` 条`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(uq,{spinning:e,children:n.length===0?(0,$.jsx)(UC,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无消息`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(n$,{dataSource:n,columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>{let t={system:{color:`#6366f1`,label:`系统`,bg:`rgba(99,102,241,0.1)`,icon:(0,$.jsx)(P6,{style:{fontSize:14}})},credit:{color:`#f59e0b`,label:`积分`,bg:`rgba(245,158,11,0.1)`,icon:(0,$.jsx)(L8,{style:{fontSize:14}})},promo:{color:`#8b5cf6`,label:`活动`,bg:`rgba(139,92,246,0.1)`,icon:(0,$.jsx)(Y4,{style:{fontSize:14}})}},n=t[e]||t.system;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:n.color},children:n.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:n.color,fontWeight:500},children:n.label})]})}},{title:`标题`,dataIndex:`title`,key:`title`,ellipsis:!0},{title:`内容`,dataIndex:`content`,key:`content`,ellipsis:!0},{title:`状态`,dataIndex:`isRead`,key:`isRead`,width:80,render:(e,t)=>e??t.is_read?(0,$.jsx)(h$,{color:`gray`,style:{background:`rgba(148,163,184,0.1)`},children:`已读`}):(0,$.jsx)(h$,{color:`purple`,style:{background:`rgba(139,92,246,0.1)`},children:`未读`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>{if(!e)return`-`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/(1e3*60*60));if(r<1)return`刚刚`;if(r<24)return`${r}小时前`;let i=Math.floor(r/24);return i<7?`${i}天前`:t.toLocaleDateString(`zh-CN`)}},{title:`操作`,key:`action`,width:100,render:(e,t)=>t.isRead??t.is_read?null:(0,$.jsx)(jD,{type:`text`,size:`small`,onClick:()=>p(t.id),style:{color:`#6366f1`},children:`标记已读`})}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(UK,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})})},l9=()=>{let[e]=En(),[t,n]=(0,S.useState)(`credits`);return(0,S.useEffect)(()=>{(e.get(`tab`)||`credits`)===`orders`?n(`orders`):n(`credits`)},[e]),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(kz,{activeKey:t,onChange:n,items:[{key:`credits`,label:`积分明细`},{key:`orders`,label:`订单记录`}],style:{marginBottom:24},size:`large`}),t===`credits`&&(0,$.jsx)(o9,{}),t===`orders`&&(0,$.jsx)(s9,{})]})},u9=`/assets/bg1-CQh9PRPW.png`,d9=`/assets/bg2-CNoKndHs.png`,{Header:f9,Sider:Wee,Content:p9}=fK,{TextArea:Gee}=rK,{Option:m9}=yw,{Text:h9}=g1,Kee=()=>{let[e,t]=(0,S.useState)(!1),[n,r]=(0,S.useState)(`1`),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(``),{mediaType:c,countType:l,selectedRatio:u,selectedResolution:d,width:f,height:p,videoDuration:m,videoAspectRatio:h,videoResolution:g,engineOptions:_,enginesele:v,setMediaType:y,setCountType:b,setSelectedRatio:x,setSelectedResolution:C,setWidth:w,setHeight:T,setVideoDuration:E,setVideoAspectRatio:D,setVideoResolution:O,setEngineOptions:k,setEnginesele:A}=J7(),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(``),[V,H]=(0,S.useState)(`image`),U=(0,S.useRef)(null),[W,ee]=(0,S.useState)(new Set),te=e=>{if(!e)return null;try{let t=new URL(e).searchParams.get(`exp`);return t?parseInt(t,10):null}catch{try{let t=e.indexOf(`?`);if(t!==-1){let n=e.substring(t+1),r=new URLSearchParams(n).get(`exp`);if(r)return parseInt(r,10)}return null}catch{return null}}},G=e=>{let t=te(e);return t?Math.floor(Date.now()/1e3)>t:!1},[ne,K]=(0,S.useState)(!1),[q,J]=(0,S.useState)(``),[re,Y]=(0,S.useState)(`image`),[ie,ae]=(0,S.useState)(``),[oe,se]=(0,S.useState)(!1),[ce,le]=(0,S.useState)(null),[ue,de]=(0,S.useState)({x:0,y:0}),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(!1),[ge,_e]=(0,S.useState)([]),[ve,ye]=(0,S.useState)([]),[be,xe]=(0,S.useState)([]),[Se,Ce]=(0,S.useState)(0),[we,Te]=(0,S.useState)(0),[Ee,De]=(0,S.useState)(!1),[Oe,ke]=(0,S.useState)([]),[Ae,je]=(0,S.useState)([]),[Me,Ne]=(0,S.useState)([]),Pe=()=>{let e={};return e=Me.find(e=>e.modelConfigId===l&&e.genType===c&&e.resolution===(c===`video`?g:d)),e||(c===`video`?(e={perSecondCredits:2,baseCredits:60,ratio:1},g===`1080p`?e.ratio=2:g===`720p`?e.ratio=1.5:g===`480p`&&(e.ratio=1)):(e={perSecondCredits:.1,baseCredits:4,ratio:1},d===`2K`?e.ratio=1:d===`4K`&&(e.ratio=2))),c===`video`?Math.round((m*e.perSecondCredits+e.baseCredits)*e.ratio):e.baseCredits*e.ratio},Fe=(0,S.useRef)(null),Ie=(0,S.useRef)(null),Le=(0,S.useRef)(null);(0,S.useRef)(!0),i.find(e=>e.id===n);let[Re,ze]=(0,S.useState)([]),[Be,Ve]=(0,S.useState)({page:1,pageSize:20}),[He,Ue]=(0,S.useState)(0),[We,Ge]=(0,S.useState)(!1),Ke=(0,S.useRef)(!1),qe=(0,S.useCallback)((e=`instant`)=>{let t=Ie.current;t&&requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})})},[]);(0,S.useEffect)(()=>{if(Re.length>0&&!Ke.current){let e=setTimeout(()=>{qe(`smooth`),Ke.current=!0},300);return()=>clearTimeout(e)}},[Re.length,qe]),(0,S.useEffect)(()=>{let e=c===`image`?v.image:v.video;e&&e.length>0&&(e.some(e=>e.id===l)||b(e[0].id))},[c,v]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;Ee&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&De(!1),fe&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&pe(!1),me&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&he(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[Ee,fe,me]),(0,S.useEffect)(()=>{J5().then(e=>{if(A(e.engine),e.engine.video&&e.engine.video.length>0){let t=e.engine.video[0],n=e.engine.video.find(e=>e.id===l)||t;k({ratios:n.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:n.supportedResolutions||[`480p`,`720p`,`1080p`],durations:n.supportedDurations||[5,8,10,12,15]}),n.supportedRatios?.includes(h)||D(n.supportedRatios?.[0]||`16:9`),n.supportedResolutions?.includes(g)||O(n.supportedResolutions?.[0]||`720p`),n.supportedDurations?.includes(m)||E(n.supportedDurations?.[0]||5),l===`请选择`&&b(n.id)}}).catch(()=>{}),q5().then(e=>{ke(e.video||[]),je(e.image||[])}).catch(e=>{}),e7().then(e=>{Ne(e)}),X5(Be).then(e=>{let t=e.items,n=e.total;ze(t),Ue(n)}),P5().then(e=>{let t=e.items?.[0]?.supportedSizes||{},n=[],r=[],i=[];for(let e in t[`2K`])n.push(e),r.push(t[`2K`][e]);_e(n.map((e,t)=>({value:e,label:String(t)})));for(let e in t[`4K`])i.push(t[`4K`][e]);xe([r,i]),ye([{value:`2K`,label:`高清 2K`},{value:`4K`,label:`超清 4K`}])}).catch(()=>{})},[]),(0,S.useEffect)(()=>{if(Le.current&&=(clearInterval(Le.current),null),Re.some(e=>e.status===`generating`))return Le.current=window.setInterval(()=>{X5(Be).then(e=>{ze(t=>t.map(t=>t.status===`generating`&&e.items.find(e=>e.id===t.id)||t)),Ue(e.total)}).catch(e=>{})},1e4),()=>{Le.current&&=(clearInterval(Le.current),null)}},[Re,Be]),(0,S.useEffect)(()=>{if(!fe)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&pe(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[fe]),(0,S.useEffect)(()=>{if(!me)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&he(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[me]),(0,S.useEffect)(()=>{be[we]&&be[we][Se]!==void 0&&(w(Number(be[we][Se].substring(0,4))),T(Number(be[we][Se].substring(5))))},[Se]),(0,S.useEffect)(()=>{be[we]&&be[we][Se]!==void 0&&(w(Number(be[we][Se].substring(0,4))),T(Number(be[we][Se].substring(5))))},[we]);let Je=e=>{Ce(e)},Ye=e=>{Te(parseInt(e===`2K`?`0`:`1`))},Xe=()=>{w(p),T(f)},Ze=async()=>{if(!o.trim()&&F.length===0){Q.warning(`请输入内容或上传图片/视频`);return}let e={id:``,gen_type:c,original_prompt:o.trim(),engine_id:l,idempotency_key:new Date().toLocaleString(`zh-CN`),media_references:F.length>0?[...F]:void 0,...c===`image`&&{image_size:d,image_proportion:u,image_px:f+`x`+p},...c===`video`&&{duration:m,aspect_ratio:h,resolution:g}};P(!0),Y5(e).then(()=>{s(``),I([]);let e={...Be,page:1};Ve(e),X5(e).then(e=>{ze(t=>[...t,e.items[e.items.length-1]]),Ue(e.total),setTimeout(()=>{Fe.current?.scrollIntoView({behavior:`smooth`})},100)}).catch(e=>{})}).catch(e=>{let t=`创建任务失败`;e?.response?.data?.detail?t=e.response.data.detail:e?.data?.detail?t=e.data.detail:e?.detail?t=e.detail:e?.message&&(t=e.message),Q.error({content:t,duration:3})}).finally(()=>{P(!1)}),setTimeout(()=>{P(!1)},3e3)},Qe=async()=>{if(Re.length>=He)return;let e=Ie.current;if(!e)return;let t=e.scrollTop,n=e.scrollHeight;Ge(!0);try{let r=Be.page+1,i=await X5({...Be,page:r}),a=Array.isArray(i)?{items:i,total:i.length}:i;a.total&&Ue(a.total),Ve(e=>({...e,page:r})),ze(e=>{let t=new Set(e.map(e=>e.id));return[...a.items.filter(e=>!e.id||t.has(e.id)?!1:(t.add(e.id),!0)),...e]}),setTimeout(()=>{e.scrollTop=t+(e.scrollHeight-n)},200)}catch{}finally{Ge(!1)}},$e=async e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Q.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Q.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=F.filter(e=>e.type===`image`).length;if(t&&i>=4)return Q.error(`最多上传4张图片`),!1;let a=F.filter(e=>e.type===`video`).length;if(n&&a>=1)return Q.error(`最多上传1个视频`),!1;M(!0);try{let n=await(t?E5:D5)(e);I(r=>[...r,{name:e.name,type:t?`image`:`video`,url:n.url}]),Q.success(`${t?`图片`:`视频`}上传成功`)}catch{Q.error(`上传失败`)}finally{M(!1)}return!1},et=e=>{I(t=>t.filter((t,n)=>n!==e))},tt=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ze())},nt=()=>{R(!1),B(``),U.current&&U.current.pause()},rt=e=>{if(e.preventDefault(),e.stopPropagation(),!z)return;let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${z}&download=1`,t.download=V===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)};return(0,$.jsxs)(fK,{style:{margin:`-24px -32px -32px`,borderRadius:20,height:`calc(100vh - 34px)`,background:`linear-gradient(135deg, #f8fafc 0%, #f0f4ff 50%, #faf5ff 100%)`,backgroundImage:`url(${d9})`,backgroundRepeat:`no-repeat`,backgroundSize:`100% 100%`,backgroundPosition:`center`},children:[!1,(0,$.jsxs)(fK,{style:{display:`flex`,flex:1,background:`transparent`},children:[(0,$.jsx)(f9,{style:{borderRadius:`20px 20px 0 0`,background:`rgba(255,255,255,0.1)`,backdropFilter:`blur(20px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 24px`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(y6,{style:{fontSize:18,color:`#fff`}})}),(0,$.jsx)(`div`,{children:(0,$.jsx)(h9,{strong:!0,style:{fontSize:16,background:`linear-gradient(90deg, #6366f1, #8b5cf6)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`开启创作`})})]})}),(0,$.jsxs)(p9,{style:{flex:1,margin:0,padding:24,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0},children:[Re.length===0&&(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:50,background:`linear-gradient(135deg, #6366f1 0%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:(0,$.jsx)(y6,{style:{fontSize:40,color:`#fff`}})}),(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:500,color:`#333`},children:`你好,想创作什么?`}),(0,$.jsx)(`p`,{style:{margin:8,fontSize:13,color:`#999`},children:`输入想法、剧本或上传参考,开始你的创作之旅`})]}),Re.length>0&&(0,$.jsxs)(`div`,{ref:Ie,style:{flex:1,overflowY:`auto`,paddingRight:8},children:[(0,$.jsx)(`div`,{style:{padding:`8px 0`,textAlign:`center`,marginBottom:16},children:Re.length>=He?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#999`},children:`消息全部加载`}):(0,$.jsx)(`button`,{onClick:Qe,disabled:We,style:{fontSize:12,color:`#6366f1`,background:`none`,border:`none`,cursor:We?`not-allowed`:`pointer`},children:We?`加载中...`:`加载更多`})}),(()=>{let e=Q;return Re.map(t=>(0,$.jsx)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`flex-start`,marginBottom:16},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},children:(0,$.jsx)(y6,{style:{color:`#fff`,fontSize:16}})}),(0,$.jsx)(`div`,{style:{flex:1},children:(0,$.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:`16px 16px 16px 4px`,padding:`12px 16px`,width:`70%`,minWidth:500,boxSizing:`border-box`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(0,0,0,0.04)`,position:`relative`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[(0,$.jsxs)(`div`,{style:{margin:4,fontSize:11,color:`#999`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:t.createdAt?.replace(`T`,` `).split(`.`)[0]}),(0,$.jsx)(`span`,{style:{background:t.genType===`image`?`rgba(34, 197, 94, 0.12)`:`rgba(249, 115, 22, 0.12)`,color:t.genType===`image`?`#22c55e`:`#f97316`,padding:`2px 8px`,borderRadius:12,fontWeight:500,fontSize:11,marginLeft:8},children:t.genType===`image`?`图片生成`:`视频生成`})]}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,zIndex:100},children:(0,$.jsx)(jq,{title:`确定要删除吗?`,onConfirm:async()=>{try{await $5(t.id),e.success(`删除成功`),ze(e=>e.filter(e=>e.id!==t.id)),Ue(e=>e-1)}catch(t){let n=t?.response?.data?.message||t?.message||`删除失败`;e.error(n)}},okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(`button`,{onClick:e=>e.stopPropagation(),style:{width:28,height:28,borderRadius:8,border:`none`,background:`rgba(99, 102, 241, 0.08)`,color:`#6366f1`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,padding:0},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`,e.currentTarget.style.color=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.08)`,e.currentTarget.style.color=`#6366f1`},children:(0,$.jsx)(v$,{style:{fontSize:12}})})})}),(t.status===`generating`||t.status===`failed`||t.status===`completed`)&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:16,marginTop:16,width:`100%`,alignItems:`flex-start`},children:[(0,$.jsx)(`div`,{style:{width:`50%`,overflow:`hidden`,borderRadius:12,position:`relative`,height:220,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%)`},children:t.status===`generating`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:12,left:12,display:`flex`,alignItems:`center`,gap:8,zIndex:2}}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%)`,animation:`shimmer 2s infinite`}}),(0,$.jsxs)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:`50%`,background:`rgba(99, 102, 241, 0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 0 30px rgba(99, 102, 241, 0.2)`},children:(0,$.jsx)(`div`,{style:{width:48,height:48,border:`3px solid #c7d2fe`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}})}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500},children:`生成中...`})]})]}):t.status===`failed`?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:`50%`,background:`rgba(254, 226, 226, 0.8)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(B8,{style:{color:`#ef4444`,fontSize:22}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#94a3b8`},children:`生成失败`})]}):(0,$.jsx)($.Fragment,{children:t.genType===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn/static${t.imageUrl}&w=300&p=50`,alt:t.name,style:{width:`100%`,height:`100%`,borderRadius:12,objectFit:`contain`,cursor:`pointer`,transition:`transform 0.3s ease`},onClick:()=>{B(t.imageUrl),H(`image`),R(!0)},onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.05)`},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn/static${t.videoCoverUrl}&w=300&p=50`,alt:t.name,style:{width:`100%`,height:`100%`,borderRadius:12,objectFit:`contain`,cursor:`pointer`,transition:`transform 0.3s ease`},onClick:()=>{B(t.videoUrl),H(`video`),R(!0)},onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.05)`},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:56,height:56,background:`rgba(99, 102, 241, 0.85)`,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.4)`},children:(0,$.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`#fff`,children:(0,$.jsx)(`path`,{d:`M8 5v14l11-7z`})})})]})})}),(0,$.jsxs)(`div`,{style:{width:`50%`,display:`flex`,flexDirection:`column`,gap:12},children:[(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:12,padding:12,border:`1px solid rgba(99, 102, 241, 0.08)`,flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`p`,{style:{width:`100%`,height:150,overflow:`auto`,padding:0,marginTop:0,marginBottom:0,lineHeight:2,color:`#475569`,fontSize:13},children:t.originalPrompt})}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#64748b`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:12,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#6366f1`,fontWeight:500},children:t.engineSnapshot.name}),(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#64748b`},children:t.genType===`image`?`${t.imageProportion||``} · ${t.imagePx||``} · ${t.imageSize||``}`:`${t.duration||``}s · ${t.aspectRatio||``} · ${t.resolution||``}`}),(0,$.jsxs)(`span`,{style:{borderRadius:16,color:`#ef4444`,fontWeight:500},children:[`消耗积分:`,t.creditsCost]})]})]})]}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:t.mediaReferences&&t.mediaReferences.length>0&&(0,$.jsx)(`span`,{style:{padding:`4px 12px`,borderRadius:16,color:`#6366f1`,cursor:`pointer`,fontWeight:500,border:`1px solid rgba(99, 102, 241, 0.2)`,background:`rgba(99, 102, 241, 0.04)`},onClick:e=>{e.stopPropagation();let n=e.currentTarget.getBoundingClientRect();de({x:n.left,y:n.top-10}),le(t.id),se(!0)},children:`附件详情`})})]})})]})},t.id))})(),(0,$.jsx)(`div`,{ref:Fe})]}),oe&&ce&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`transparent`,zIndex:9998},onClick:()=>{se(!1),le(null)}}),(0,$.jsxs)(`div`,{style:{position:`fixed`,top:ue.y-100,left:ue.x,background:`#fff`,borderRadius:12,boxShadow:`0 4px 20px rgba(0,0,0,0.15)`,padding:16,minWidth:200,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500},children:`附件列表`}),(0,$.jsx)(`button`,{onClick:()=>{se(!1),le(null)},style:{width:24,height:24,borderRadius:`50%`,border:`none`,background:`#ff4d4f`,cursor:`pointer`,fontSize:14,color:`#fff`,fontWeight:`bold`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.background=`#ff7875`,e.currentTarget.style.transform=`scale(1.1)`},onMouseLeave:e=>{e.currentTarget.style.background=`#ff4d4f`,e.currentTarget.style.transform=`scale(1)`},children:`×`})]}),Re.find(e=>e.id===ce)?.mediaReferences?.map((e,t)=>(0,$.jsxs)(`div`,{onClick:()=>{J(e.url),Y(e.url.includes(`.mp4`)||e.url.includes(`.mov`)||e.url.includes(`.avi`)||e.url.includes(`.video`)?`video`:`image`),ae(e.name),K(!0),se(!1),le(null)},style:{display:`flex`,alignItems:`center`,gap:8,padding:`8px 12px`,borderRadius:6,cursor:`pointer`,fontSize:13,color:`#333`,transition:`background 0.2s`},onMouseEnter:e=>e.currentTarget.style.background=`#f5f5f5`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[e.type===`image`?(0,$.jsx)(Q3,{style:{color:`#3b82f6`,fontSize:14}}):(0,$.jsx)(P8,{style:{color:`#f59e0b`,fontSize:14}}),e.name]},t))]})]}),(0,$.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.1)`,backdropFilter:`blur(20px)`,borderRadius:24,padding:16,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(0,0,0,0.04)`,transition:`all 0.3s ease`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:[F.length>0&&(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,marginBottom:12,overflowX:`auto`},children:F.map((e,t)=>(0,$.jsxs)(`div`,{style:{position:`relative`,width:e.type===`video`?120:80,flexShrink:0},children:[e.type===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,alt:e.name,style:{width:`100%`,height:80,objectFit:`cover`,borderRadius:8}}):(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:80,objectFit:`cover`,borderRadius:8}}),(0,$.jsx)(`button`,{onClick:()=>et(t),style:{position:`absolute`,top:0,right:0,width:20,height:20,border:`none`,background:`#ff4d4f`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:12,display:`flex`,alignItems:`center`,justifyContent:`center`},children:`×`})]},`media-${t}`))}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`12px 16px`,backgroundColor:`rgba(248,250,252,0.6)`,borderRadius:16,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,transition:`all 0.2s ease`},children:[(0,$.jsx)(u0,{accept:`image/*,video/*`,showUploadList:!1,beforeUpload:$e,children:(0,$.jsx)(cT,{title:`图片${F.filter(e=>e.type===`image`).length}/4,视频${F.filter(e=>e.type===`video`).length}/1`,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:14,border:`2px dashed rgba(99, 102, 241, 0.2)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,flexShrink:0,backgroundColor:`rgba(255,255,255,0.7)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.backgroundColor=`rgba(99, 102, 241, 0.06)`,e.currentTarget.style.transform=`scale(1.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`,e.currentTarget.style.backgroundColor=`rgba(255,255,255,0.7)`,e.currentTarget.style.transform=`scale(1)`},children:j?(0,$.jsx)(qm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(jR,{style:{fontSize:18,color:`#64748b`}})})})}),(0,$.jsx)(Gee,{value:o,onChange:e=>s(e.target.value),onKeyPress:tt,placeholder:`上传最多4张参考图,输入提示词描述您想生成的画面...`,autoSize:{minRows:1,maxRows:4},style:{flex:1,height:`100%`,borderRadius:12,border:`none`,outline:`none`,boxShadow:`none`,fontSize:14,lineHeight:1.5,color:`#1e293b`},disabled:N}),(0,$.jsx)(jD,{type:`primary`,shape:`circle`,icon:(0,$.jsx)(j6,{}),onClick:Ze,disabled:!o.trim()&&F.length===0,loading:N,style:{flexShrink:0,width:48,height:48,borderRadius:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.4)`,transition:`all 0.2s ease`,border:`none`}})]}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginTop:12,paddingTop:12,borderTop:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsxs)(OU,{size:`middle`,children:[(0,$.jsxs)(yw,{value:c,onChange:e=>y(e),style:{width:100,height:34,outline:`none`,border:`none`,backgroundColor:`#f1f5f9`,borderRadius:10},size:`middle`,children:[(0,$.jsxs)(m9,{value:`image`,children:[(0,$.jsx)(Q3,{style:{marginRight:6,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:`图片`})]}),(0,$.jsxs)(m9,{value:`video`,children:[(0,$.jsx)(P8,{style:{marginRight:6,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:`视频`})]})]}),(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>De(!0),className:`image-settings-trigger`,style:{minWidth:200,padding:`6px 14px`,height:34,borderRadius:10,border:`none`,backgroundColor:`#f1f5f9`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`0 4px 12px rgba(99, 102, 241, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.15)`,e.currentTarget.style.boxShadow=`0 2px 8px rgba(99, 102, 241, 0.04)`},children:[(0,$.jsx)(P6,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(h9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:c===`image`?v.image?.find(e=>e.id===l)?.name:v.video?.find(e=>e.id===l)?.name||`选择引擎`})]}),Ee&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:360,backgroundColor:`rgba(255,255,255,0.95)`,backdropFilter:`blur(20px)`,borderRadius:14,boxShadow:`0 12px 48px rgba(99, 102, 241, 0.15)`,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(h9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:600,color:`#475569`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:(c===`image`?v.image:v.video)?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{b(e.id),c===`video`&&(k({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(h)||D(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(g)||O(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(m)||E(e.supportedDurations?.[0]||5)),De(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:l===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:l===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:l===e.id?600:500,color:l===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),c===`image`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>pe(!fe),className:`image-settings-trigger`,style:{minWidth:220,padding:`4px 12px`,height:34,borderRadius:8,border:`none`,backgroundColor:`#f1f5f9`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(y3,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsxs)(h9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[u===`auto`?`智能`:u,` · `,d==`2K`?`2K高清`:`4K超清`,` · `,f,`×`,p]})]}),fe&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:480,backgroundColor:`rgba(255,255,255,0.95)`,backdropFilter:`blur(20px)`,borderRadius:14,boxShadow:`0 12px 48px rgba(99, 102, 241, 0.15)`,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(h9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:ge.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{x(e.value),Je(e.label)},style:{flex:`0 0 calc(11.11% - 4px)`,minWidth:44,height:52,borderRadius:6,border:u===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:u===e.value?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:e.value===`auto`?14:18,height:e.value===`auto`?14:18,border:`2px solid ${u===e.value?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.value===`auto`&&(0,$.jsx)(`span`,{style:{fontSize:7,color:u===e.value?`#6366f1`:`#9ca3af`},children:`智`})}),(0,$.jsx)(`span`,{style:{fontSize:9,color:u===e.value?`#6366f1`:`#6b7280`,fontWeight:u===e.value?600:400},children:e.value})]},e.value))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(h9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:ve.map(e=>(0,$.jsx)(`button`,{onClick:()=>{C(e.value),Ye(e.value)},style:{flex:1,height:42,borderRadius:6,border:d===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:d===e.value?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsxs)(`span`,{style:{fontSize:12,fontWeight:600,color:d===e.value?`#fff`:`#4b5563`},children:[e.value,e.value===`4K`&&(0,$.jsx)(`span`,{style:{marginLeft:2},children:`✨`})]})},e.value))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(h9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`尺寸`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:120},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:11,marginRight:4},children:`W`}),(0,$.jsx)(rK,{value:f,onChange:e=>w(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:4,height:34,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:12,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`button`,{onClick:Xe,style:{width:24,height:24,borderRadius:4,border:`1px solid #e5e7eb`,backgroundColor:`#fff`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:`#6366f1`},children:(0,$.jsx)(sG,{style:{fontSize:10}})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:120},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:11,marginRight:4},children:`H`}),(0,$.jsx)(rK,{value:p,onChange:e=>T(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:4,height:34,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:12,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:11},children:`PX`})]})]})]})]}),c===`video`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>he(!me),className:`image-settings-trigger`,style:{minWidth:220,padding:`4px 12px`,height:34,borderRadius:8,border:`none`,backgroundColor:`#f1f5f9`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(y3,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsxs)(h9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[h,` · `,m,`s · `,g]})]}),me&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:400,backgroundColor:`rgba(255,255,255,0.95)`,backdropFilter:`blur(20px)`,borderRadius:14,boxShadow:`0 12px 48px rgba(99, 102, 241, 0.15)`,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(h9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:_.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>D(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:h===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:h===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${h===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:h===e?`#6366f1`:`#6b7280`,fontWeight:h===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(h9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(m-Math.min(..._.durations))/(Math.max(..._.durations)-Math.min(..._.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(..._.durations),max:Math.max(..._.durations),value:m,onChange:e=>E(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:m}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(h9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:_.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>O(e),style:{flex:1,height:42,borderRadius:6,border:g===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:g===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:g===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`6px 14px`,backgroundColor:`rgba(99, 102, 241, 0.06)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsx)(h9,{style:{fontSize:13,color:`#6366f1`,fontWeight:500},children:`预估积分`}),(0,$.jsx)(h9,{style:{fontSize:14,color:`#6366f1`,fontWeight:600},children:Pe()})]})]})})]})]})]}),(0,$.jsx)(`style`,{children:` @keyframes blink { 0%, 50% { opacity: 1; } @@ -439,4 +439,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho div::-webkit-scrollbar { display: none; } - `}),(0,$.jsx)(`div`,{style:{margin:`auto`,display:`flex`,flexDirection:`column`,width:y.length>0?`${y.length*80+Math.max(0,y.length-1)*1}px`:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,height:86,borderRadius:12,background:`#fff`,gap:1,position:`relative`},children:[x&&y.length===0?(0,$.jsxs)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(uq,{size:`small`}),(0,$.jsx)(_te,{style:{marginLeft:8,color:`#64748b`},children:`正在抽取每秒帧...`})]}):y.length>0?y.map(e=>{let t=e.second>=_[0]&&e.second<_[1];return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>I(e.second),title:`${e.second}s${e.fallback?`,实际取帧 ${e.captureSecond?.toFixed(1)}s`:``}`,style:{minWidth:80,flex:`0 0 80px`,height:86,borderTop:t?`5px solid #6366f1`:`none`,borderBottom:t?`5px solid #6366f1`:`none`,padding:0,background:`transparent`,overflow:`hidden`,cursor:A?`not-allowed`:`pointer`,position:`relative`},children:[e.status===`success`&&e.image?(0,$.jsx)(`img`,{src:e.image,alt:`${e.second}s`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):e.status===`loading`?(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(uq,{size:`small`})}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:12,background:`#fff`},children:[(0,$.jsxs)(`span`,{children:[e.second,`s`]}),(0,$.jsx)(`span`,{style:{fontSize:11},children:`无有效帧`})]}),(0,$.jsxs)(`span`,{style:{position:`absolute`,left:0,bottom:3,color:`#ffffffff`,fontSize:16,textShadow:`0 1px 3px rgba(0,0,0,.7)`},children:[e.second,`s`]})]},e.second)}):(0,$.jsx)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:`暂无帧预览,请确认视频是否加载完成`}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:-10,left:0,right:0,bottom:0},children:(0,$.jsx)(bH,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${W9(Number(e||0))}s`},disabled:!O||A,styles:{track:{background:`#6969dd63`,height:86,borderRadius:12,margin:`0 `},rail:{height:86,borderRadius:12},handle:{width:20,height:86,marginTop:0,borderRadius:`50%`}}})})]})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`,color:`#64748b`,fontSize:14},children:[`已选取 `,k,`s`]}),E&&(0,$.jsx)(`div`,{style:{marginTop:12,padding:`10px 14px`,borderRadius:8,background:`rgba(239, 68, 68, 0.08)`,border:`1px solid rgba(239, 68, 68, 0.15)`,color:`#ef4444`,fontSize:13,textAlign:`center`},children:E})]})]})})},{TextArea:Ete}=rK,Dte=`http://ceshi.apiforeign.minzhong.cn`,Y9=2,X9=15;function Z9(e){return e?/^https?:\/\//i.test(e)?e:`${Dte}${e}`:``}function Ote(){let{creatID:e}=Ze(),t=qe(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(!1),m=(0,S.useRef)(null),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)([]),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),M=(0,S.useRef)(null),N=(0,S.useRef)(null),P=(0,S.useMemo)(()=>Z9(x?.videoUrl),[x?.videoUrl]),F=(0,S.useMemo)(()=>w.length===0?`AI自动拆分`:w.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[w]),I=(0,S.useCallback)(async()=>{if(e)try{C(await g7(e))}catch{Q.error(`获取任务详情失败`)}},[e]),L=(0,S.useCallback)(async()=>{if(e)try{let t=(await y7(e)).items||[];T(t),t.some(e=>e.moduleProjectCurrentStepCode!==`video_generate`&&e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?M.current||=window.setInterval(async()=>{try{let t=(await y7(e)).items||[];T(e=>e.map(e=>{let n=t.find(t=>t.id===e.id);return n&&(e.moduleProjectCurrentStepCode!==`video_generate`||e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?n:e})),t.every(e=>e.moduleProjectCurrentStepCode===`video_generate`||e.moduleProjectStatus===`completed`||e.moduleProjectStatus===`failed`)&&(M.current&&=(clearInterval(M.current),null))}catch(e){console.error(`轮询获取拆镜列表失败:`,e)}},3e4):M.current&&=(clearInterval(M.current),null)}catch{Q.error(`获取拆镜列表失败`)}},[e]),R=(0,S.useCallback)(async()=>{await Promise.all([I(),L()])},[I,L]);(0,S.useEffect)(()=>(R(),()=>{M.current&&=(clearInterval(M.current),null),N.current&&=(clearInterval(N.current),null)}),[R]),(0,S.useEffect)(()=>{if(x)return x.analysisStatus===`processing`?(console.log(`开始轮询`),N.current=window.setInterval(async()=>{try{C(await g7(e))}catch{}},3e3)):N.current&&=(clearInterval(N.current),null),()=>{N.current&&=(clearInterval(N.current),null)}},[x?.analysisStatus,e]);let z=(e,t)=>{s(e),l(t),r(!0)},B=()=>{r(!1),s(null),g(``),l(``),v(``),b(``)},V=e=>{e.fileList.length===0&&b(``)},H=async e=>{try{b((await E5(e)).url),Q.success(`图片上传成功`)}catch{Q.error(`图片上传失败,请重试`)}return!1},U=async()=>{if(!o){Q.warning(`请先选择拆镜片段`);return}if(!y){Q.warning(`请上传产品图`);return}if(!h.trim()){Q.warning(`请输入产品名称`);return}if(!_.trim()){Q.warning(`请输入产品卖点`);return}let n={target_project_name:h.trim(),core_content_point:_.trim(),material_image_url:Z9(y),idempotency_key:`replication_${Date.now()}`};console.log(o,n),D(!0);try{await b7(o,n),Q.success(`视频生成任务创建成功`),B(),y7(e).then(e=>{console.log(`123123123123`,e);let n=e.items.find(e=>e.id===o);console.log(n),Q.loading(`创建中...`,3),setTimeout(()=>{t(`/removelens/${n.moduleProjectId}/removefenbu`)},3e3)})}catch(e){Q.error(e?.message||`创建失败,请重试`)}finally{D(!1)}},W=async()=>{if(e){j(!0);try{let t=w.some(e=>e.sourceMode===`ai_suggestion`);await _7(e,{selected_indices:[],replace_existing:t}),Q.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await R()}catch(e){Q.error(e?.message||`拆镜失败`)}finally{j(!1)}}},ee=()=>{if(!P){Q.warning(`原视频地址不存在`);return}a(!0)},te=async t=>{if(e){if(t.durationSecondX9){Q.warning(`拆镜片段不能超过 ${X9} 秒`);return}k(!0);try{await v7(e,{start_second:t.startSecond,end_second:t.endSecond}),Q.success(`手动拆镜任务已提交`),a(!1),await R()}catch(e){Q.error(e?.message||`手动拆镜失败`)}finally{k(!1)}}},G=e=>e?.splitStatus===`completed`&&!!e?.segmentVideoUrl;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsxs)(`div`,{style:{padding:`20px 32px`,display:`flex`,alignItems:`center`,gap:16,position:`relative`,zIndex:10},children:[(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(s2,{}),onClick:()=>t(-1),style:{fontSize:16,color:`#6366f1`,background:`rgba(99, 102, 241, 0.1)`,borderRadius:12,padding:`8px 16px`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`}}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:40,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h1`,{style:{fontSize:22,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,margin:0},children:`AI视频拆镜工作台`}),(0,$.jsx)(`div`,{style:{width:40,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})})]}),x?(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,overflow:`hidden`,padding:`0 32px 32px`},children:[(0,$.jsxs)(`div`,{style:{flex:1,background:`linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.6) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,display:`flex`,alignItems:`center`,gap:30,padding:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`relative`,width:280,height:160,borderRadius:12,overflow:`hidden`,flexShrink:0,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`},children:(0,$.jsx)(`video`,{controls:!0,src:P,style:{width:`100%`,height:`100%`,objectFit:`cover`}})}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,position:`relative`,zIndex:1},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,marginBottom:16,background:`linear-gradient(135deg, #1e293b 0%, #334155 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频总结`}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`上传时间: `,x.createdAt?new Date(x.createdAt).toLocaleString(`zh-CN`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`产品名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:x.title})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`受众群体:`}),x.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(uq,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):x.analysisStatus===`completed`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:(x.originalVideoAudience?.split(`、`)||[]).map((e,t)=>(0,$.jsx)(h$,{style:{fontSize:12,background:`rgba(99, 102, 241, 0.1)`,color:`#6366f1`,border:`none`,borderRadius:20},children:e},t))}):null]}),(0,$.jsxs)(`div`,{style:{display:`flex`},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`视频内容:`}),x.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(uq,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):x.analysisStatus===`completed`?(0,$.jsx)(`span`,{style:{color:`#475569`,lineHeight:1.6},children:x.originalVideoContent}):null]})]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:20,marginTop:20},children:[(0,$.jsx)(jD,{type:`default`,onClick:ee,disabled:!P||O,style:{flex:1,height:52,borderRadius:12,border:`2px solid rgba(99, 102, 241, 0.3)`,color:`#6366f1`,fontWeight:600,fontSize:15,background:`rgba(255, 255, 255, 0.9)`,backdropFilter:`blur(10px)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.2)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`none`},children:`手动`}),(0,$.jsx)(jq,{title:F===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:W,children:(0,$.jsxs)(jD,{type:`primary`,loading:A,disabled:A,style:{flex:1,height:52,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.3)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`,position:`relative`,overflow:`hidden`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 6px 25px rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.3)`},children:[(0,$.jsx)(`span`,{style:{position:`relative`,zIndex:1},children:F}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:`-100%`,width:`100%`,height:`100%`,background:`linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent)`,transition:`left 0.5s ease`},onMouseEnter:e=>{e.currentTarget.style.left=`100%`}}),x?.aiSuggestions&&x.aiSuggestions.length>0&&(0,$.jsx)(cT,{title:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontWeight:600,marginBottom:8,color:`#6366f1`},children:`AI拆分方案`}),(x?.ai_suggestions||x?.aiSuggestions||[]).map(e=>(0,$.jsxs)(`div`,{style:{marginBottom:8,fontSize:13,lineHeight:1.5},children:[(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#6366f1`},children:[e.index,`.`]}),(0,$.jsx)(`span`,{style:{marginLeft:4,color:`#000000ff`},children:e.timeNode}),(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`#666`},children:e.content})]},e.index))]}),placement:`top`,trigger:`hover`,overlayInnerStyle:{backgroundColor:`#fff`,border:`1px solid rgba(99, 102, 241, 0.1)`,borderRadius:12,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.12)`},children:(0,$.jsx)(`span`,{style:{marginLeft:8,fontSize:13,opacity:.9},children:`(AI 镜头拆分方案)`})})]})})]}),(0,$.jsxs)(`div`,{style:{flex:2,background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,display:`flex`,flexDirection:`column`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,background:`linear-gradient(135deg, rgba(99,102,241,0.02) 0%, transparent 100%)`},children:[(0,$.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`,margin:0},children:`拆镜片段列表`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`,marginLeft:12},children:[`共 `,w.length,` 个片段`]})]}),(0,$.jsx)(n$,{columns:[{title:`片段`,width:100,fixed:`left`,align:`center`,render:(e,t)=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#333`},children:t.segmentName||`片段${t.segmentIndex||``}`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#999`},children:t.timeNode}),t.sourceMode===`custom`&&(0,$.jsx)(h$,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(h$,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},onClick:()=>{console.log(`video clicked:`,t.segmentVideoUrl),t.segmentVideoUrl&&(d(Z9(t.segmentVideoUrl)),p(!0))},children:t.segmentVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:Z9(t.segmentVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`cover`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:0,height:0,borderTop:`8px solid transparent`,borderBottom:`8px solid transparent`,borderLeft:`14px solid #6366f1`,marginLeft:2}})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:12},children:t.splitStatus===`failed`?`切割失败`:`切割中`})})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{if(t.source_mode===`ai_suggestion`||t.sourceMode===`ai_suggestion`)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:t.segmentContent||t.lastError||`-`});let n=t.analysis_status||t.analysisStatus,r={not_required:`无需单独分析`,pending:`等待分析`,processing:`分析中`,failed:`分析失败`};return n===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(uq,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):n===`failed`?(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:`分析失败`}):(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:n&&r[n]?r[n]:t.segmentContent||t.lastError||`-`})}},{title:`视频类型`,width:120,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,fontWeight:500},children:t.segmentCategory||`-`})},{title:`状态`,width:120,align:`center`,dataIndex:`moduleProjectStatus`,render:(e,t)=>{let n=e,r=t.moduleProjectCurrentStepCode||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return n||`-`}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return t.moduleProjectId?{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}:{text:`待生成任务`,color:`#94a3b8`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`操作`,width:140,fixed:`right`,align:`center`,render:(e,n)=>(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:8},children:n.moduleProjectId?(0,$.jsx)(jD,{type:`text`,onClick:()=>t(`/removelens/${n.moduleProjectId}/removefenbu`),style:{color:`#10b981`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`详情任务`}):(0,$.jsx)(jD,{type:`text`,onClick:()=>z(String(n.id),n.segmentName),disabled:!G(n),style:{color:G(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:G(n)?`视频生成`:`待切割完成`})})}],dataSource:w,pagination:!1,bordered:!1,rowKey:`id`,scroll:{y:300},style:{flex:1},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})]})]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Tte,{open:i,videoUrl:P,title:`手动视频切片`,loading:O,minDuration:Y9,maxDuration:X9,onCancel:()=>a(!1),onConfirm:te}),(0,$.jsx)(yU,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:18,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`智能视频复刻`}),c&&(0,$.jsxs)(`span`,{style:{fontSize:14,color:`#64748b`},children:[`- `,c]})]}),(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(K8,{}),onClick:B,style:{padding:0,color:`#64748b`,fontSize:14}})]}),placement:`right`,closable:!1,onClose:B,open:n,size:480,styles:{body:{padding:`24px`,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`},section:{borderRadius:`20px 0 0 20px`,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品白底图 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(u0,{listType:`picture-card`,onChange:V,beforeUpload:H,maxCount:1,accept:`image/*`,style:{width:120,height:120,borderRadius:8,border:`2px dashed rgba(99, 102, 241, 0.3)`,background:`rgba(99, 102, 241, 0.02)`},children:!y&&(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jR,{style:{fontSize:20,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`上传产品图`})]})})})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(rK,{value:h,onChange:e=>g(e.target.value),placeholder:`请输入产品名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:10,showCount:!0})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品卖点 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(Ete,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:100,showCount:!0,rows:3})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(jD,{type:`primary`,onClick:U,loading:E,disabled:E,style:{flex:1,height:48,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 15px rgba(99, 102, 241, 0.3)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.4)`,e.currentTarget.style.transform=`translateY(-1px)`},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 4px 15px rgba(99, 102, 241, 0.3)`,e.currentTarget.style.transform=`translateY(0)`},children:E?`生成中...`:`手动生成`})})]})}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频预览`})]}),open:f,onCancel:()=>p(!1),afterClose:()=>{m.current&&(m.current.pause(),m.current.currentTime=0)},footer:null,width:640,centered:!0,styles:{body:{padding:24},header:{borderBottom:`1px solid #e0e0e0`,padding:`20px 24px`}},children:(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`},children:(0,$.jsx)(`video`,{ref:m,controls:!0,src:u||``,style:{width:`100%`,maxHeight:420,objectFit:`contain`,backgroundColor:`#000`},playsInline:!0,"webkit-playsinline":!0,autoPlay:!0})})})]})}var{Title:kte,Text:Q9}=g1,{TextArea:Ate}=rK;function jte(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function Mte(){let e=qe(),{creatID:t}=Ze(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(`image`),[u,d]=(0,S.useState)({}),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(null),[g,_]=(0,S.useState)(``),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)({}),[C,w]=(0,S.useState)(``),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(5),[j,M]=(0,S.useState)(`16:9`),[N,P]=(0,S.useState)(`480p`),[F,I]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[L,R]=(0,S.useState)([]),[z,B]=(0,S.useState)(1),[V,H]=(0,S.useState)(20),[U,W]=(0,S.useState)(0),[ee,te]=(0,S.useState)(``),[G,ne]=(0,S.useState)({}),[K,q]=(0,S.useState)([]),[J,re]=(0,S.useState)([]),Y=[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}].map((e,t)=>({...e,status:K[t]?.status||``,id:K[t]?.id||t,output:K[t]?.output||``,engineId:K[t]?.input?.payload?.videoConfig?.engineId||``}));(0,S.useEffect)(()=>{let e=new Set;J.forEach(t=>{let n=Y.find(e=>String(e.childId)===t);n&&(n.status===`completed`||n.status===`failed`)&&e.add(t)});for(let t=Y.length-1;t>=0;t--)if(Y[t].status===`completed`||Y[t].status===`failed`){e.add(String(Y[t].childId));break}e.size>0?re(Array.from(e)):re([])},[K]);let ie=(e,t,n)=>{h7(e,t,n).then(e=>{e.items&&R(e.items),e.total!==void 0&&W(e.total)}).catch(e=>{})},ae=(e,t)=>{B(e),H(t),ie(e,t,ee)},oe=()=>{ie(1,20,ee)};(0,S.useEffect)(()=>{ie(z,V,ee)},[]),(0,S.useEffect)(()=>{J5().then(e=>{if(x(e.engine||{}),e.engine?.video&&e.engine.video.length>0){w(e.engine.video[0].id);let t=e.engine.video[0];I({ratios:t.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions||[`480p`,`720p`,`1080p`],durations:t.supportedDurations||[5,8,10,12,15]})}}).catch(e=>{})},[]),(0,S.useEffect)(()=>()=>{m&&(clearInterval(m),h(null))},[m]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(E(!1),O(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{console.log(`creatID`,t),t&&x7(t).then(e=>{ne(e),e.steps&&q(e.steps)}).catch(e=>{})},[t]),(0,S.useEffect)(()=>{let e=Y[4];e&&e.status!==`completed`&&e.status!==`failed`?m||h(setInterval(le,3e4)):e&&m&&(clearInterval(m),h(null))},[Y]);let se=(e,t,n,i)=>{l(t||`image`),_(n?String(n):``),t===`video`?(p(i||null),d(e&&typeof e==`object`?jte(e):{}),a(``)):(p(null),a(e||``),d({})),r(!0)},ce=async()=>{if(c===`image`){if(!G?.id||!g){Q.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!i||!i.trim()){Q.warning(`图片提示词不能为空`);return}y(!0);try{await C7(G.id,g,{prompt:i.trim()}),Q.success(`图片提示词已保存`),ue(),r(!1),_(``)}catch(e){Q.error(e?.message||`保存图片提示词失败`)}finally{y(!1)}return}if(!G?.id||!g){Q.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!u||typeof u!=`object`||Object.keys(u).length===0){Q.warning(`视频提示词不能为空`);return}if(!f){Q.warning(`视频提词配置缺失,暂不能保存`);return}let e=D9(u,f);if(e){Q.warning(e);return}y(!0);try{await w7(G.id,g,{prompt_schema:u}),Q.success(`视频提示词已保存`),ue(),r(!1),_(``)}catch(e){Q.error(e?.message||`保存视频提示词失败`)}finally{y(!1)}},le=()=>{t&&x7(t).then(e=>{ne(e),e.steps&&q(e.steps)}).catch(e=>{})},ue=()=>{t&&x7(t).then(e=>{ne(e),e.steps&&q(e.steps)}).catch(e=>{})},de=e=>{S7(G.id,e.toString()).then(e=>{ue()}).catch(e=>{})},fe=e=>{T7(G.id,e.toString(),{engine_id:`0019e3dac0b795b925b`,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`}).then(e=>{ue()}).catch(e=>{})},pe=()=>{T7(G.id,Y[1].id.toString(),{engine_id:`0019e3dac0b795b925b`,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`}).then(e=>{ue()}).catch(e=>{})},me=e=>{let t={engine_id:C,duration:k,aspect_ratio:j,resolution:N,target_platform:`抖音`};E7(G.id,e.toString(),t).then(e=>{ue()}).catch(e=>{})},he=(e,t)=>{let n={engine_id:t};D7(G.id,e.toString(),n).then(e=>{ue()}).catch(e=>{})},ge=()=>{let e={engine_id:Y[3].engineId};D7(G.id,Y[2].id.toString(),e).then(e=>{ue()}).catch(e=>{})};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(s2,{}),onClick:()=>window.history.back(),style:{color:`#64748b`,borderRadius:10,fontSize:13,height:32,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`拆镜复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(jD,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>s(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:G?.material?.materialVideoUrl?(0,$.jsx)(`video`,{controls:!0,src:`http://ceshi.apiforeign.minzhong.cn${G.material.materialVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:G?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:G.material.materialImageUrl,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),G?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${G.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),G?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(`video`,{controls:!0,src:`http://ceshi.apiforeign.minzhong.cn${G.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)(Qg,{activeKey:J,onChange:re,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Y.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(Y2,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Q9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:G?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${G.material.materialVideoUrl}`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Q9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:G?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:G.material.materialImageUrl,alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]}),(0,$.jsx)(jD,{onClick:()=>{Q.info(`正在生成图片提示词,请稍候...`),de(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片提示词`})]})}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(Q9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(OU,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(jD,{type:`default`,icon:(0,$.jsx)(x$,{}),onClick:()=>se(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(jD,{onClick:()=>{Q.info(`正在生成图片,请稍候...`),fe(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[G.finalImageUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${G.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(jD,{type:`default`,icon:(0,$.jsx)(x$,{}),onClick:()=>pe(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{E(!T),O(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(P6,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(Q9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:b.video?.find(e=>e.id===C)?.name||`选择引擎`})]}),T&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:b.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{w(e.id),I({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(j)||M(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(N)||P(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(k)||A(e.supportedDurations?.[0]||5),E(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:C===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:C===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:C===e.id?600:500,color:C===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{O(!D),E(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(y3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(Q9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[j,` · `,k,`s · `,N]})]}),D&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:F.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>M(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:j===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:j===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${j===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:j===e?`#6366f1`:`#6b7280`,fontWeight:j===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(k-Math.min(...F.durations))/(Math.max(...F.durations)-Math.min(...F.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...F.durations),max:Math.max(...F.durations),value:k,onChange:e=>A(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:k}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:F.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>P(e),style:{flex:1,height:42,borderRadius:6,border:N===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:N===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:N===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(jD,{type:`primary`,style:{width:`100%`,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},onClick:()=>{Q.info(`正在生成视频提示词,请稍候...`),me(e.id)},disabled:e.status!==`completed`,children:`下一步:生成视频提示词`})]}),e.childId===4&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(Q9,{style:{color:`#64748b`,fontSize:13,lineHeight:1.8},children:`视频提词已生成,可点击按钮查看/修改`})}),(0,$.jsxs)(OU,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(jD,{type:`default`,icon:(0,$.jsx)(x$,{}),onClick:()=>se(G?.videoGeneration?.promptSchema,`video`,e.id,G?.videoGeneration?.schemaConfigSnapshot),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!G?.videoGeneration?.promptSchema||!G?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),(0,$.jsx)(jD,{onClick:()=>{Q.info(`正在生成视频,请稍候...`),he(e.id,e.engineId)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成视频`})]})]}),e.childId===5&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,position:`relative`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:e.status===`completed`&&G?.finalVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${G.finalVideoUrl}`,style:{width:`100%`,height:180,objectFit:`cover`},controls:!0}):e.status===`processing`?(0,$.jsxs)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}),(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontSize:14},children:`视频生成中...`})]}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#ef4444`,fontSize:14},children:`视频生成失败`}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无视频`})}),(0,$.jsxs)(OU,{style:{width:`100%`,gap:12},children:[(0,$.jsx)(jD,{onClick:()=>ge(),type:`default`,icon:(0,$.jsx)(x$,{}),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`重新生成`}),(0,$.jsx)(jD,{type:`primary`,icon:(0,$.jsx)(i0,{}),style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,onClick:()=>{let e=`http://ceshi.apiforeign.minzhong.cn${G?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:c===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:n,onCancel:()=>{v||r(!1)},footer:[(0,$.jsx)(jD,{onClick:()=>r(!1),disabled:v,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(jD,{type:`primary`,onClick:ce,loading:v,disabled:v,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:c===`image`?(0,$.jsx)(Ate,{value:i,onChange:e=>a(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(P9,{value:u,schemaConfigSnapshot:f,onChange:d})})}),(0,$.jsxs)(Dq,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`创作记录`})]}),open:o,onCancel:()=>s(!1),width:800,footer:null,styles:{body:{background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:16,gap:8},children:[(0,$.jsx)(rK,{placeholder:`搜索产品名称`,value:ee,onChange:e=>te(e.target.value),onPressEnter:oe,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(jD,{type:`primary`,onClick:oe,style:{borderRadius:10,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(n$,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsx)(jD,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`})}],dataSource:L,rowKey:`id`,pagination:{current:z,pageSize:V,total:U,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:ae,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:350},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})]})]})}var{RangePicker:Nte}=XH,$9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),Pte=()=>{let e=qe(),[t]=En(),{message:n}=Fx.useApp(),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(1),[x,C]=(0,S.useState)(10),[w,T]=(0,S.useState)(t.get(`accountId`)||``),[E,D]=(0,S.useState)(),[O,k]=(0,S.useState)((0,zD.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),[A,j]=(0,S.useState)(``);(0,S.useEffect)(()=>{N(),M()},[]);let M=async(e=1,t=10)=>{c(!0);try{let n=await M7({advertiser_id:w||void 0,consume_date:E,page:e,page_size:t});i(n.data||[]),o(n.pagination?.total||0),b(n.pagination?.page||1),C(n.pagination?.pageSize||10)}catch{n.error(`加载数据失败`)}finally{c(!1)}},N=async()=>{try{let e=((await P7()).data||[]).map(e=>({name:$9(e.field),description:e.description}));m(e);let t=localStorage.getItem(`consumeColumns`);g(t?JSON.parse(t):e.map(e=>e.name))}catch{n.error(`加载表头字段失败`)}},P=r.map((e,t)=>({...e,index:t+1,key:e.id})),F=()=>{e(`/authorization`)},I=()=>{b(1),M(1,x)},L=()=>{T(``),D(void 0),b(1),M(1,x)},R=()=>{Dq.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(g1.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(XH,{value:(0,zD.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,zD.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)(rK,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await N7({date:O,advertiser_id:A||void 0}),n.success(`拉取消耗数据成功`),M(y,x)}catch{n.error(`拉取消耗数据失败`)}finally{u(!1)}},okText:`开始拉取`,cancelText:`取消`})},z=h.map(e=>p.find(t=>t.name===e)).filter(e=>!!e).map(e=>({title:e.description,dataIndex:e.name,key:e.name,ellipsis:!0}));return(0,$.jsxs)(`div`,{style:{minHeight:`94vh`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(s2,{}),onClick:F}),(0,$.jsx)(j4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:16},children:`消耗记录`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(rK,{placeholder:`广告主ID`,value:w,onChange:e=>T(e.target.value),style:{width:180},onPressEnter:()=>{b(1),M(1,x)}}),(0,$.jsx)(Nte,{value:E?[(0,zD.default)(E[0]),(0,zD.default)(E[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?D([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):D(void 0)}}),(0,$.jsx)(jD,{type:`primary`,size:`medium`,onClick:I,children:`搜索`}),(0,$.jsx)(jD,{size:`medium`,onClick:L,children:`重置`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(jD,{icon:(0,$.jsx)(s8,{}),onClick:R,loading:l,style:{borderRadius:8},children:`拉取消耗`}),(0,$.jsx)(jD,{icon:(0,$.jsx)(P6,{}),onClick:()=>f(!0),style:{borderRadius:8},children:`自定义表头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,$.jsx)(n$,{dataSource:P,columns:z,loading:s,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(UK,{current:y,pageSize:x,total:a,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{b(e),C(t),M(e,t)},size:`small`})})]}),(0,$.jsx)(Dq,{title:`自定义表头`,open:d,onOk:()=>{localStorage.setItem(`consumeColumns`,JSON.stringify(h)),n.success(`表头设置已保存`),f(!1)},onCancel:()=>{f(!1),v(``)},okText:`确定`,cancelText:`取消`,width:800,children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,height:400},children:[(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(rK,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(g1.Text,{type:`secondary`,style:{fontSize:12,marginBottom:12,display:`block`},children:`输入指标名称进行搜索`}),(0,$.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:[(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(bV,{checked:h.length===p.length&&p.length>0,indeterminate:h.length>0&&h.length{e.target.checked?g(p.map(e=>e.name)):g([])},style:{marginBottom:12},children:`全选`}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8},children:p.filter(e=>e.description.toLowerCase().includes(_.toLowerCase())||e.name.toLowerCase().includes(_.toLowerCase())).map(e=>(0,$.jsx)(bV,{checked:h.includes(e.name),onChange:t=>{t.target.checked?g(t=>[...t,e.name]):g(t=>t.filter(t=>t!==e.name))},children:e.description},e.name))})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsxs)(g1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(jD,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(jD,{size:`small`,onClick:async()=>{try{let e=((await P7()).data||[]).map(e=>({name:$9(e.field),description:e.description}));m(e),g(e.map(e=>e.name)),localStorage.removeItem(`consumeColumns`),n.success(`表头字段已更新`)}catch{n.error(`更新表头字段失败`)}},children:`更新表头字段`})]})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:h.length===0?(0,$.jsx)(g1.Text,{type:`secondary`,style:{fontSize:14,textAlign:`center`,display:`block`,padding:`40px 0`},children:`暂无已选指标`}):(0,$.jsx)(`div`,{children:h.map((e,t)=>{let n=p.find(t=>t.name===e);return(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 12px`,borderBottom:`1px solid #f0f0f5`,cursor:`move`,userSelect:`none`},draggable:!0,onDragStart:e=>{e.dataTransfer.setData(`index`,String(t))},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=parseInt(e.dataTransfer.getData(`index`)),r=t;if(n!==r){let e=[...h],[t]=e.splice(n,1);e.splice(r,0,t),g(e)}},children:[(0,$.jsx)(g1.Text,{children:n?.description||e}),(0,$.jsx)(g1.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},Fte=({children:e})=>{let{user:t,loading:n,checkAuth:r}=I7();return(0,S.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,$.jsx)(uq,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=I7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(jm,{locale:y0.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8,fontFamily:`'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif`},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,$.jsx)(Fx,{children:(0,$.jsx)(hn,{children:(0,$.jsxs)(Tt,{children:[(0,$.jsx)(Ct,{path:`/login`,element:(0,$.jsx)(G7,{})}),(0,$.jsxs)(Ct,{path:`/`,element:(0,$.jsx)(Fte,{children:(0,$.jsx)(U7,{})}),children:[(0,$.jsx)(Ct,{index:!0,element:(0,$.jsx)(xt,{to:`/projects`,replace:!0})}),(0,$.jsx)(Ct,{path:`projects`,element:(0,$.jsx)(Q7,{})}),(0,$.jsx)(Ct,{path:`projects/:projectId/generate`,element:(0,$.jsx)(t9,{})}),(0,$.jsx)(Ct,{path:`records`,element:(0,$.jsx)(r9,{})}),(0,$.jsx)(Ct,{path:`credits`,element:(0,$.jsx)(a9,{})}),(0,$.jsx)(Ct,{path:`credit-records`,element:(0,$.jsx)(l9,{})}),(0,$.jsx)(Ct,{path:`order-records`,element:(0,$.jsx)(l9,{})}),(0,$.jsx)(Ct,{path:`user-center`,element:(0,$.jsx)(l9,{})}),(0,$.jsx)(Ct,{path:`messages`,element:(0,$.jsx)(c9,{})}),(0,$.jsx)(Ct,{path:`conversation`,element:(0,$.jsx)(Kee,{})}),(0,$.jsx)(Ct,{path:`initial`,element:(0,$.jsx)(Xee,{})}),(0,$.jsx)(Ct,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(nte,{})}),(0,$.jsx)(Ct,{path:`removelens`,element:(0,$.jsx)(rte,{})}),(0,$.jsx)(Ct,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Ote,{})}),(0,$.jsx)(Ct,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(Mte,{})}),(0,$.jsx)(Ct,{path:`generated`,element:(0,$.jsx)(ste,{})}),(0,$.jsx)(Ct,{path:`pretest`,element:(0,$.jsx)(ute,{})}),(0,$.jsx)(Ct,{path:`authorization`,element:(0,$.jsx)(fte,{})}),(0,$.jsx)(Ct,{path:`materials`,element:(0,$.jsx)(gte,{})}),(0,$.jsx)(Ct,{path:`consume`,element:(0,$.jsx)(Pte,{})})]}),(0,$.jsx)(Ct,{path:`*`,element:(0,$.jsx)(xt,{to:`/projects`,replace:!0})})]})})})})},{})); \ No newline at end of file + `}),(0,$.jsx)(`div`,{style:{margin:`auto`,display:`flex`,flexDirection:`column`,width:y.length>0?`${y.length*80+Math.max(0,y.length-1)*1}px`:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,height:86,borderRadius:12,background:`#fff`,gap:1,position:`relative`},children:[x&&y.length===0?(0,$.jsxs)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(uq,{size:`small`}),(0,$.jsx)(_te,{style:{marginLeft:8,color:`#64748b`},children:`正在抽取每秒帧...`})]}):y.length>0?y.map(e=>{let t=e.second>=_[0]&&e.second<_[1];return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>I(e.second),title:`${e.second}s${e.fallback?`,实际取帧 ${e.captureSecond?.toFixed(1)}s`:``}`,style:{minWidth:80,flex:`0 0 80px`,height:86,borderTop:t?`5px solid #6366f1`:`none`,borderBottom:t?`5px solid #6366f1`:`none`,padding:0,background:`transparent`,overflow:`hidden`,cursor:A?`not-allowed`:`pointer`,position:`relative`},children:[e.status===`success`&&e.image?(0,$.jsx)(`img`,{src:e.image,alt:`${e.second}s`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):e.status===`loading`?(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(uq,{size:`small`})}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:12,background:`#fff`},children:[(0,$.jsxs)(`span`,{children:[e.second,`s`]}),(0,$.jsx)(`span`,{style:{fontSize:11},children:`无有效帧`})]}),(0,$.jsxs)(`span`,{style:{position:`absolute`,left:0,bottom:3,color:`#ffffffff`,fontSize:16,textShadow:`0 1px 3px rgba(0,0,0,.7)`},children:[e.second,`s`]})]},e.second)}):(0,$.jsx)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:`暂无帧预览,请确认视频是否加载完成`}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:-10,left:0,right:0,bottom:0},children:(0,$.jsx)(bH,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${W9(Number(e||0))}s`},disabled:!O||A,styles:{track:{background:`#6969dd63`,height:86,borderRadius:12,margin:`0 `},rail:{height:86,borderRadius:12},handle:{width:20,height:86,marginTop:0,borderRadius:`50%`}}})})]})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`,color:`#64748b`,fontSize:14},children:[`已选取 `,k,`s`]}),E&&(0,$.jsx)(`div`,{style:{marginTop:12,padding:`10px 14px`,borderRadius:8,background:`rgba(239, 68, 68, 0.08)`,border:`1px solid rgba(239, 68, 68, 0.15)`,color:`#ef4444`,fontSize:13,textAlign:`center`},children:E})]})]})})},{TextArea:Ete}=rK,Dte=`http://ceshi.apiforeign.minzhong.cn`,Y9=2,X9=15;function Z9(e){return e?/^https?:\/\//i.test(e)?e:`${Dte}${e}`:``}function Ote(){let{creatID:e}=Ze(),t=qe(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(!1),m=(0,S.useRef)(null),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)([]),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),M=(0,S.useRef)(null),N=(0,S.useRef)(null),P=(0,S.useMemo)(()=>Z9(x?.videoUrl),[x?.videoUrl]),F=(0,S.useMemo)(()=>w.length===0?`AI自动拆分`:w.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[w]),I=(0,S.useCallback)(async()=>{if(e)try{C(await g7(e))}catch{Q.error(`获取任务详情失败`)}},[e]),L=(0,S.useCallback)(async()=>{if(e)try{let t=(await y7(e)).items||[];T(t),t.some(e=>e.moduleProjectCurrentStepCode!==`video_generate`&&e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?M.current||=window.setInterval(async()=>{try{let t=(await y7(e)).items||[];T(e=>e.map(e=>{let n=t.find(t=>t.id===e.id);return n&&(e.moduleProjectCurrentStepCode!==`video_generate`||e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?n:e})),t.every(e=>e.moduleProjectCurrentStepCode===`video_generate`||e.moduleProjectStatus===`completed`||e.moduleProjectStatus===`failed`)&&(M.current&&=(clearInterval(M.current),null))}catch(e){console.error(`轮询获取拆镜列表失败:`,e)}},3e4):M.current&&=(clearInterval(M.current),null)}catch{Q.error(`获取拆镜列表失败`)}},[e]),R=(0,S.useCallback)(async()=>{await Promise.all([I(),L()])},[I,L]);(0,S.useEffect)(()=>(R(),()=>{M.current&&=(clearInterval(M.current),null),N.current&&=(clearInterval(N.current),null)}),[R]),(0,S.useEffect)(()=>{if(x)return x.analysisStatus===`processing`?(console.log(`开始轮询`),N.current=window.setInterval(async()=>{try{C(await g7(e))}catch{}},3e3)):N.current&&=(clearInterval(N.current),null),()=>{N.current&&=(clearInterval(N.current),null)}},[x?.analysisStatus,e]);let z=(e,t)=>{s(e),l(t),r(!0)},B=()=>{r(!1),s(null),g(``),l(``),v(``),b(``)},V=e=>{e.fileList.length===0&&b(``)},H=async e=>{try{b((await E5(e)).url),Q.success(`图片上传成功`)}catch{Q.error(`图片上传失败,请重试`)}return!1},U=async()=>{if(!o){Q.warning(`请先选择拆镜片段`);return}if(!y){Q.warning(`请上传产品图`);return}if(!h.trim()){Q.warning(`请输入产品名称`);return}if(!_.trim()){Q.warning(`请输入产品卖点`);return}let n={target_project_name:h.trim(),core_content_point:_.trim(),material_image_url:Z9(y),idempotency_key:`replication_${Date.now()}`};console.log(o,n),D(!0);try{await b7(o,n),Q.success(`视频生成任务创建成功`),B(),y7(e).then(e=>{console.log(`123123123123`,e);let n=e.items.find(e=>e.id===o);console.log(n),Q.loading(`创建中...`,3),setTimeout(()=>{t(`/removelens/${n.moduleProjectId}/removefenbu`)},3e3)})}catch(e){Q.error(e?.message||`创建失败,请重试`)}finally{D(!1)}},W=async()=>{if(e){j(!0);try{let t=w.some(e=>e.sourceMode===`ai_suggestion`);await _7(e,{selected_indices:[],replace_existing:t}),Q.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await R()}catch(e){Q.error(e?.message||`拆镜失败`)}finally{j(!1)}}},ee=()=>{if(!P){Q.warning(`原视频地址不存在`);return}a(!0)},te=async t=>{if(e){if(t.durationSecondX9){Q.warning(`拆镜片段不能超过 ${X9} 秒`);return}k(!0);try{await v7(e,{start_second:t.startSecond,end_second:t.endSecond}),Q.success(`手动拆镜任务已提交`),a(!1),await R()}catch(e){Q.error(e?.message||`手动拆镜失败`)}finally{k(!1)}}},G=e=>e?.splitStatus===`completed`&&!!e?.segmentVideoUrl;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsxs)(`div`,{style:{padding:`20px 32px`,display:`flex`,alignItems:`center`,gap:16,position:`relative`,zIndex:10},children:[(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(s2,{}),onClick:()=>t(-1),style:{fontSize:16,color:`#6366f1`,background:`rgba(99, 102, 241, 0.1)`,borderRadius:12,padding:`8px 16px`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`}}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:40,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h1`,{style:{fontSize:22,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,margin:0},children:`AI视频拆镜工作台`}),(0,$.jsx)(`div`,{style:{width:40,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})})]}),x?(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,overflow:`hidden`,padding:`0 32px 32px`},children:[(0,$.jsxs)(`div`,{style:{flex:1,background:`linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.6) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,display:`flex`,alignItems:`center`,gap:30,padding:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`relative`,width:280,height:160,borderRadius:12,overflow:`hidden`,flexShrink:0,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`},children:(0,$.jsx)(`video`,{controls:!0,src:P,style:{width:`100%`,height:`100%`,objectFit:`cover`}})}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,position:`relative`,zIndex:1},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,marginBottom:16,background:`linear-gradient(135deg, #1e293b 0%, #334155 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频总结`}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`上传时间: `,x.createdAt?new Date(x.createdAt).toLocaleString(`zh-CN`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`产品名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:x.title})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`受众群体:`}),x.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(uq,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):x.analysisStatus===`completed`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:(x.originalVideoAudience?.split(`、`)||[]).map((e,t)=>(0,$.jsx)(h$,{style:{fontSize:12,background:`rgba(99, 102, 241, 0.1)`,color:`#6366f1`,border:`none`,borderRadius:20},children:e},t))}):null]}),(0,$.jsxs)(`div`,{style:{display:`flex`},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`视频内容:`}),x.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(uq,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):x.analysisStatus===`completed`?(0,$.jsx)(`span`,{style:{color:`#475569`,lineHeight:1.6,height:100,overflowY:`auto`},children:x.originalVideoContent}):null]})]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:20,marginTop:20},children:[(0,$.jsx)(jD,{type:`default`,onClick:ee,disabled:!P||O,style:{flex:1,height:52,borderRadius:12,border:`2px solid rgba(99, 102, 241, 0.3)`,color:`#6366f1`,fontWeight:600,fontSize:15,background:`rgba(255, 255, 255, 0.9)`,backdropFilter:`blur(10px)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.2)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`none`},children:`手动`}),(0,$.jsx)(jq,{title:F===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:W,children:(0,$.jsxs)(jD,{type:`primary`,loading:A,disabled:A,style:{flex:1,height:52,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.3)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`,position:`relative`,overflow:`hidden`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 6px 25px rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.3)`},children:[(0,$.jsx)(`span`,{style:{position:`relative`,zIndex:1},children:F}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:`-100%`,width:`100%`,height:`100%`,background:`linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent)`,transition:`left 0.5s ease`},onMouseEnter:e=>{e.currentTarget.style.left=`100%`}}),x?.aiSuggestions&&x.aiSuggestions.length>0&&(0,$.jsx)(cT,{title:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontWeight:600,marginBottom:8,color:`#6366f1`},children:`AI拆分方案`}),(x?.ai_suggestions||x?.aiSuggestions||[]).map(e=>(0,$.jsxs)(`div`,{style:{marginBottom:8,fontSize:13,lineHeight:1.5},children:[(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#6366f1`},children:[e.index,`.`]}),(0,$.jsx)(`span`,{style:{marginLeft:4,color:`#000000ff`},children:e.timeNode}),(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`#666`},children:e.content})]},e.index))]}),placement:`top`,trigger:`hover`,overlayInnerStyle:{backgroundColor:`#fff`,height:300,overflowY:`auto`,border:`1px solid rgba(99, 102, 241, 0.1)`,borderRadius:12,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.12)`},children:(0,$.jsx)(`span`,{style:{marginLeft:8,fontSize:13,opacity:.9},children:`(AI 镜头拆分方案)`})})]})})]}),(0,$.jsxs)(`div`,{style:{flex:2,background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,display:`flex`,flexDirection:`column`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,background:`linear-gradient(135deg, rgba(99,102,241,0.02) 0%, transparent 100%)`},children:[(0,$.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`,margin:0},children:`拆镜片段列表`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`,marginLeft:12},children:[`共 `,w.length,` 个片段`]})]}),(0,$.jsx)(n$,{columns:[{title:`片段`,width:100,fixed:`left`,align:`center`,render:(e,t)=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#333`},children:t.segmentName||`片段${t.segmentIndex||``}`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#999`},children:t.timeNode}),t.sourceMode===`custom`&&(0,$.jsx)(h$,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(h$,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},onClick:()=>{console.log(`video clicked:`,t.segmentVideoUrl),t.segmentVideoUrl&&(d(Z9(t.segmentVideoUrl)),p(!0))},children:t.segmentVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:Z9(t.segmentVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`cover`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:0,height:0,borderTop:`8px solid transparent`,borderBottom:`8px solid transparent`,borderLeft:`14px solid #6366f1`,marginLeft:2}})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:12},children:t.splitStatus===`failed`?`切割失败`:`切割中`})})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{if(t.source_mode===`ai_suggestion`||t.sourceMode===`ai_suggestion`)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:t.segmentContent||t.lastError||`-`});let n=t.analysis_status||t.analysisStatus,r={not_required:`无需单独分析`,pending:`等待分析`,processing:`分析中`,failed:`分析失败`};return n===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(uq,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):n===`failed`?(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:`分析失败`}):(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:n&&r[n]?r[n]:t.segmentContent||t.lastError||`-`})}},{title:`视频类型`,width:120,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,fontWeight:500},children:t.segmentCategory||`-`})},{title:`状态`,width:120,align:`center`,dataIndex:`moduleProjectStatus`,render:(e,t)=>{let n=e,r=t.moduleProjectCurrentStepCode||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return n||`-`}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return t.moduleProjectId?{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}:{text:`待生成任务`,color:`#94a3b8`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`操作`,width:140,fixed:`right`,align:`center`,render:(e,n)=>(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:8},children:n.moduleProjectId?(0,$.jsx)(jD,{type:`text`,onClick:()=>t(`/removelens/${n.moduleProjectId}/removefenbu`),style:{color:`#10b981`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`详情任务`}):(0,$.jsx)(jD,{type:`text`,onClick:()=>z(String(n.id),n.segmentName),disabled:!G(n),style:{color:G(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:G(n)?`视频生成`:`待切割完成`})})}],dataSource:w,pagination:!1,bordered:!1,rowKey:`id`,scroll:{y:300},style:{flex:1},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`,height:80}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(255, 255, 255, 1)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})]})]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Tte,{open:i,videoUrl:P,title:`手动视频切片`,loading:O,minDuration:Y9,maxDuration:X9,onCancel:()=>a(!1),onConfirm:te}),(0,$.jsx)(yU,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:18,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`智能视频复刻`}),c&&(0,$.jsxs)(`span`,{style:{fontSize:14,color:`#64748b`},children:[`- `,c]})]}),(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(K8,{}),onClick:B,style:{padding:0,color:`#64748b`,fontSize:14}})]}),placement:`right`,closable:!1,onClose:B,open:n,size:480,styles:{body:{padding:`24px`,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`},section:{borderRadius:`20px 0 0 20px`,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品白底图 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(u0,{listType:`picture-card`,onChange:V,beforeUpload:H,maxCount:1,accept:`image/*`,style:{width:120,height:120,borderRadius:8,border:`2px dashed rgba(99, 102, 241, 0.3)`,background:`rgba(99, 102, 241, 0.02)`},children:!y&&(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:6},children:[(0,$.jsx)(jR,{style:{fontSize:20,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`上传产品图`})]})})})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(rK,{value:h,onChange:e=>g(e.target.value),placeholder:`请输入产品名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:10,showCount:!0})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品卖点 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(Ete,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:100,showCount:!0,rows:3})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(jD,{type:`primary`,onClick:U,loading:E,disabled:E,style:{flex:1,height:48,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 15px rgba(99, 102, 241, 0.3)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.4)`,e.currentTarget.style.transform=`translateY(-1px)`},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 4px 15px rgba(99, 102, 241, 0.3)`,e.currentTarget.style.transform=`translateY(0)`},children:E?`生成中...`:`手动生成`})})]})}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频预览`})]}),open:f,onCancel:()=>p(!1),afterClose:()=>{m.current&&(m.current.pause(),m.current.currentTime=0)},footer:null,width:640,centered:!0,styles:{body:{padding:24},header:{borderBottom:`1px solid #e0e0e0`,padding:`20px 24px`}},children:(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`},children:(0,$.jsx)(`video`,{ref:m,controls:!0,src:u||``,style:{width:`100%`,maxHeight:420,objectFit:`contain`,backgroundColor:`#000`},playsInline:!0,"webkit-playsinline":!0,autoPlay:!0})})})]})}var{Title:kte,Text:Q9}=g1,{TextArea:Ate}=rK;function jte(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function Mte(){let e=qe(),{creatID:t}=Ze(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(`image`),[u,d]=(0,S.useState)({}),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(null),[g,_]=(0,S.useState)(``),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)({}),[C,w]=(0,S.useState)(``),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(5),[j,M]=(0,S.useState)(`16:9`),[N,P]=(0,S.useState)(`480p`),[F,I]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[L,R]=(0,S.useState)([]),[z,B]=(0,S.useState)(1),[V,H]=(0,S.useState)(20),[U,W]=(0,S.useState)(0),[ee,te]=(0,S.useState)(``),[G,ne]=(0,S.useState)({}),[K,q]=(0,S.useState)([]),[J,re]=(0,S.useState)([]),Y=[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}].map((e,t)=>({...e,status:K[t]?.status||``,id:K[t]?.id||t,output:K[t]?.output||``,engineId:K[t]?.input?.payload?.videoConfig?.engineId||``}));(0,S.useEffect)(()=>{let e=new Set;J.forEach(t=>{let n=Y.find(e=>String(e.childId)===t);n&&(n.status===`completed`||n.status===`failed`)&&e.add(t)});for(let t=Y.length-1;t>=0;t--)if(Y[t].status===`completed`||Y[t].status===`failed`){e.add(String(Y[t].childId));break}e.size>0?re(Array.from(e)):re([])},[K]);let ie=(e,t,n)=>{h7(e,t,n).then(e=>{e.items&&R(e.items),e.total!==void 0&&W(e.total)}).catch(e=>{})},ae=(e,t)=>{B(e),H(t),ie(e,t,ee)},oe=()=>{ie(1,20,ee)};(0,S.useEffect)(()=>{ie(z,V,ee)},[]),(0,S.useEffect)(()=>{J5().then(e=>{if(x(e.engine||{}),e.engine?.video&&e.engine.video.length>0){w(e.engine.video[0].id);let t=e.engine.video[0];I({ratios:t.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions||[`480p`,`720p`,`1080p`],durations:t.supportedDurations||[5,8,10,12,15]})}}).catch(e=>{})},[]),(0,S.useEffect)(()=>()=>{m&&(clearInterval(m),h(null))},[m]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(E(!1),O(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{console.log(`creatID`,t),t&&x7(t).then(e=>{ne(e),e.steps&&q(e.steps)}).catch(e=>{})},[t]),(0,S.useEffect)(()=>{let e=Y[4];e&&e.status!==`completed`&&e.status!==`failed`?m||h(setInterval(le,3e4)):e&&m&&(clearInterval(m),h(null))},[Y]);let se=(e,t,n,i)=>{l(t||`image`),_(n?String(n):``),t===`video`?(p(i||null),d(e&&typeof e==`object`?jte(e):{}),a(``)):(p(null),a(e||``),d({})),r(!0)},ce=async()=>{if(c===`image`){if(!G?.id||!g){Q.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!i||!i.trim()){Q.warning(`图片提示词不能为空`);return}y(!0);try{await C7(G.id,g,{prompt:i.trim()}),Q.success(`图片提示词已保存`),ue(),r(!1),_(``)}catch(e){Q.error(e?.message||`保存图片提示词失败`)}finally{y(!1)}return}if(!G?.id||!g){Q.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!u||typeof u!=`object`||Object.keys(u).length===0){Q.warning(`视频提示词不能为空`);return}if(!f){Q.warning(`视频提词配置缺失,暂不能保存`);return}let e=D9(u,f);if(e){Q.warning(e);return}y(!0);try{await w7(G.id,g,{prompt_schema:u}),Q.success(`视频提示词已保存`),ue(),r(!1),_(``)}catch(e){Q.error(e?.message||`保存视频提示词失败`)}finally{y(!1)}},le=()=>{t&&x7(t).then(e=>{ne(e),e.steps&&q(e.steps)}).catch(e=>{})},ue=()=>{t&&x7(t).then(e=>{ne(e),e.steps&&q(e.steps)}).catch(e=>{})},de=e=>{S7(G.id,e.toString()).then(e=>{ue()}).catch(e=>{})},fe=e=>{T7(G.id,e.toString(),{engine_id:`0019e3dac0b795b925b`,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`}).then(e=>{ue()}).catch(e=>{})},pe=()=>{T7(G.id,Y[1].id.toString(),{engine_id:`0019e3dac0b795b925b`,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`}).then(e=>{ue()}).catch(e=>{})},me=e=>{let t={engine_id:C,duration:k,aspect_ratio:j,resolution:N,target_platform:`抖音`};E7(G.id,e.toString(),t).then(e=>{ue()}).catch(e=>{})},he=(e,t)=>{let n={engine_id:t};D7(G.id,e.toString(),n).then(e=>{ue()}).catch(e=>{})},ge=()=>{let e={engine_id:Y[3].engineId};D7(G.id,Y[2].id.toString(),e).then(e=>{ue()}).catch(e=>{})};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(s2,{}),onClick:()=>window.history.back(),style:{color:`#64748b`,borderRadius:10,fontSize:13,height:32,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`拆镜复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(jD,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>s(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:G?.material?.materialVideoUrl?(0,$.jsx)(`video`,{controls:!0,src:`http://ceshi.apiforeign.minzhong.cn${G.material.materialVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:G?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:G.material.materialImageUrl,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),G?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${G.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),G?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(`video`,{controls:!0,src:`http://ceshi.apiforeign.minzhong.cn${G.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)(Qg,{activeKey:J,onChange:re,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Y.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(Y2,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Q9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:G?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${G.material.materialVideoUrl}`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(Q9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:G?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:G.material.materialImageUrl,alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]}),(0,$.jsx)(jD,{onClick:()=>{Q.info(`正在生成图片提示词,请稍候...`),de(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片提示词`})]})}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(Q9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(OU,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(jD,{type:`default`,icon:(0,$.jsx)(x$,{}),onClick:()=>se(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(jD,{onClick:()=>{Q.info(`正在生成图片,请稍候...`),fe(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[G.finalImageUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${G.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(jD,{type:`default`,icon:(0,$.jsx)(x$,{}),onClick:()=>pe(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{E(!T),O(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(P6,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(Q9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:b.video?.find(e=>e.id===C)?.name||`选择引擎`})]}),T&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:b.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{w(e.id),I({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(j)||M(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(N)||P(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(k)||A(e.supportedDurations?.[0]||5),E(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:C===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:C===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:C===e.id?600:500,color:C===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{O(!D),E(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(y3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(Q9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[j,` · `,k,`s · `,N]})]}),D&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:F.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>M(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:j===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:j===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${j===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:j===e?`#6366f1`:`#6b7280`,fontWeight:j===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(k-Math.min(...F.durations))/(Math.max(...F.durations)-Math.min(...F.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...F.durations),max:Math.max(...F.durations),value:k,onChange:e=>A(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:k}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:F.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>P(e),style:{flex:1,height:42,borderRadius:6,border:N===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:N===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:N===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(jD,{type:`primary`,style:{width:`100%`,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},onClick:()=>{Q.info(`正在生成视频提示词,请稍候...`),me(e.id)},disabled:e.status!==`completed`,children:`下一步:生成视频提示词`})]}),e.childId===4&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(Q9,{style:{color:`#64748b`,fontSize:13,lineHeight:1.8},children:`视频提词已生成,可点击按钮查看/修改`})}),(0,$.jsxs)(OU,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(jD,{type:`default`,icon:(0,$.jsx)(x$,{}),onClick:()=>se(G?.videoGeneration?.promptSchema,`video`,e.id,G?.videoGeneration?.schemaConfigSnapshot),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!G?.videoGeneration?.promptSchema||!G?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),(0,$.jsx)(jD,{onClick:()=>{Q.info(`正在生成视频,请稍候...`),he(e.id,e.engineId)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成视频`})]})]}),e.childId===5&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,position:`relative`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:e.status===`completed`&&G?.finalVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${G.finalVideoUrl}`,style:{width:`100%`,height:180,objectFit:`cover`},controls:!0}):e.status===`processing`?(0,$.jsxs)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}),(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontSize:14},children:`视频生成中...`})]}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#ef4444`,fontSize:14},children:`视频生成失败`}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无视频`})}),(0,$.jsxs)(OU,{style:{width:`100%`,gap:12},children:[(0,$.jsx)(jD,{onClick:()=>ge(),type:`default`,icon:(0,$.jsx)(x$,{}),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`重新生成`}),(0,$.jsx)(jD,{type:`primary`,icon:(0,$.jsx)(i0,{}),style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,onClick:()=>{let e=`http://ceshi.apiforeign.minzhong.cn${G?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(Dq,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:c===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:n,onCancel:()=>{v||r(!1)},footer:[(0,$.jsx)(jD,{onClick:()=>r(!1),disabled:v,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(jD,{type:`primary`,onClick:ce,loading:v,disabled:v,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:c===`image`?(0,$.jsx)(Ate,{value:i,onChange:e=>a(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(P9,{value:u,schemaConfigSnapshot:f,onChange:d})})}),(0,$.jsxs)(Dq,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`创作记录`})]}),open:o,onCancel:()=>s(!1),width:800,footer:null,styles:{body:{background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:16,gap:8},children:[(0,$.jsx)(rK,{placeholder:`搜索产品名称`,value:ee,onChange:e=>te(e.target.value),onPressEnter:oe,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(jD,{type:`primary`,onClick:oe,style:{borderRadius:10,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(n$,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsx)(jD,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`})}],dataSource:L,rowKey:`id`,pagination:{current:z,pageSize:V,total:U,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:ae,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:350},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})]})]})}var{RangePicker:Nte}=XH,$9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),Pte=()=>{let e=qe(),[t]=En(),{message:n}=Fx.useApp(),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(1),[x,C]=(0,S.useState)(10),[w,T]=(0,S.useState)(t.get(`accountId`)||``),[E,D]=(0,S.useState)(),[O,k]=(0,S.useState)((0,zD.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),[A,j]=(0,S.useState)(``);(0,S.useEffect)(()=>{N(),M()},[]);let M=async(e=1,t=10)=>{c(!0);try{let n=await M7({advertiser_id:w||void 0,consume_date:E,page:e,page_size:t});i(n.data||[]),o(n.pagination?.total||0),b(n.pagination?.page||1),C(n.pagination?.pageSize||10)}catch{n.error(`加载数据失败`)}finally{c(!1)}},N=async()=>{try{let e=((await P7()).data||[]).map(e=>({name:$9(e.field),description:e.description}));m(e);let t=localStorage.getItem(`consumeColumns`);g(t?JSON.parse(t):e.map(e=>e.name))}catch{n.error(`加载表头字段失败`)}},P=r.map((e,t)=>({...e,index:t+1,key:e.id})),F=()=>{e(`/authorization`)},I=()=>{b(1),M(1,x)},L=()=>{T(``),D(void 0),b(1),M(1,x)},R=()=>{Dq.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(g1.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(XH,{value:(0,zD.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,zD.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(g1.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)(rK,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await N7({date:O,advertiser_id:A||void 0}),n.success(`拉取消耗数据成功`),M(y,x)}catch{n.error(`拉取消耗数据失败`)}finally{u(!1)}},okText:`开始拉取`,cancelText:`取消`})},z=h.map(e=>p.find(t=>t.name===e)).filter(e=>!!e).map(e=>({title:e.description,dataIndex:e.name,key:e.name,ellipsis:!0}));return(0,$.jsxs)(`div`,{style:{minHeight:`94vh`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(jD,{type:`text`,icon:(0,$.jsx)(s2,{}),onClick:F}),(0,$.jsx)(j4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:16},children:`消耗记录`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(rK,{placeholder:`广告主ID`,value:w,onChange:e=>T(e.target.value),style:{width:180},onPressEnter:()=>{b(1),M(1,x)}}),(0,$.jsx)(Nte,{value:E?[(0,zD.default)(E[0]),(0,zD.default)(E[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?D([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):D(void 0)}}),(0,$.jsx)(jD,{type:`primary`,size:`medium`,onClick:I,children:`搜索`}),(0,$.jsx)(jD,{size:`medium`,onClick:L,children:`重置`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(jD,{icon:(0,$.jsx)(s8,{}),onClick:R,loading:l,style:{borderRadius:8},children:`拉取消耗`}),(0,$.jsx)(jD,{icon:(0,$.jsx)(P6,{}),onClick:()=>f(!0),style:{borderRadius:8},children:`自定义表头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,$.jsx)(n$,{dataSource:P,columns:z,loading:s,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(UK,{current:y,pageSize:x,total:a,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{b(e),C(t),M(e,t)},size:`small`})})]}),(0,$.jsx)(Dq,{title:`自定义表头`,open:d,onOk:()=>{localStorage.setItem(`consumeColumns`,JSON.stringify(h)),n.success(`表头设置已保存`),f(!1)},onCancel:()=>{f(!1),v(``)},okText:`确定`,cancelText:`取消`,width:800,children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,height:400},children:[(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(rK,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(g1.Text,{type:`secondary`,style:{fontSize:12,marginBottom:12,display:`block`},children:`输入指标名称进行搜索`}),(0,$.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:[(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(g1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(bV,{checked:h.length===p.length&&p.length>0,indeterminate:h.length>0&&h.length{e.target.checked?g(p.map(e=>e.name)):g([])},style:{marginBottom:12},children:`全选`}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8},children:p.filter(e=>e.description.toLowerCase().includes(_.toLowerCase())||e.name.toLowerCase().includes(_.toLowerCase())).map(e=>(0,$.jsx)(bV,{checked:h.includes(e.name),onChange:t=>{t.target.checked?g(t=>[...t,e.name]):g(t=>t.filter(t=>t!==e.name))},children:e.description},e.name))})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsxs)(g1.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(jD,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(jD,{size:`small`,onClick:async()=>{try{let e=((await P7()).data||[]).map(e=>({name:$9(e.field),description:e.description}));m(e),g(e.map(e=>e.name)),localStorage.removeItem(`consumeColumns`),n.success(`表头字段已更新`)}catch{n.error(`更新表头字段失败`)}},children:`更新表头字段`})]})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:h.length===0?(0,$.jsx)(g1.Text,{type:`secondary`,style:{fontSize:14,textAlign:`center`,display:`block`,padding:`40px 0`},children:`暂无已选指标`}):(0,$.jsx)(`div`,{children:h.map((e,t)=>{let n=p.find(t=>t.name===e);return(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 12px`,borderBottom:`1px solid #f0f0f5`,cursor:`move`,userSelect:`none`},draggable:!0,onDragStart:e=>{e.dataTransfer.setData(`index`,String(t))},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=parseInt(e.dataTransfer.getData(`index`)),r=t;if(n!==r){let e=[...h],[t]=e.splice(n,1);e.splice(r,0,t),g(e)}},children:[(0,$.jsx)(g1.Text,{children:n?.description||e}),(0,$.jsx)(g1.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},Fte=({children:e})=>{let{user:t,loading:n,checkAuth:r}=I7();return(0,S.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,$.jsx)(uq,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=I7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(jm,{locale:y0.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8,fontFamily:`'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif`},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,$.jsx)(Fx,{children:(0,$.jsx)(hn,{children:(0,$.jsxs)(Tt,{children:[(0,$.jsx)(Ct,{path:`/login`,element:(0,$.jsx)(G7,{})}),(0,$.jsxs)(Ct,{path:`/`,element:(0,$.jsx)(Fte,{children:(0,$.jsx)(U7,{})}),children:[(0,$.jsx)(Ct,{index:!0,element:(0,$.jsx)(xt,{to:`/projects`,replace:!0})}),(0,$.jsx)(Ct,{path:`projects`,element:(0,$.jsx)(Q7,{})}),(0,$.jsx)(Ct,{path:`projects/:projectId/generate`,element:(0,$.jsx)(t9,{})}),(0,$.jsx)(Ct,{path:`records`,element:(0,$.jsx)(r9,{})}),(0,$.jsx)(Ct,{path:`credits`,element:(0,$.jsx)(a9,{})}),(0,$.jsx)(Ct,{path:`credit-records`,element:(0,$.jsx)(l9,{})}),(0,$.jsx)(Ct,{path:`order-records`,element:(0,$.jsx)(l9,{})}),(0,$.jsx)(Ct,{path:`user-center`,element:(0,$.jsx)(l9,{})}),(0,$.jsx)(Ct,{path:`messages`,element:(0,$.jsx)(c9,{})}),(0,$.jsx)(Ct,{path:`conversation`,element:(0,$.jsx)(Kee,{})}),(0,$.jsx)(Ct,{path:`initial`,element:(0,$.jsx)(Xee,{})}),(0,$.jsx)(Ct,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(nte,{})}),(0,$.jsx)(Ct,{path:`removelens`,element:(0,$.jsx)(rte,{})}),(0,$.jsx)(Ct,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Ote,{})}),(0,$.jsx)(Ct,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(Mte,{})}),(0,$.jsx)(Ct,{path:`generated`,element:(0,$.jsx)(ste,{})}),(0,$.jsx)(Ct,{path:`pretest`,element:(0,$.jsx)(ute,{})}),(0,$.jsx)(Ct,{path:`authorization`,element:(0,$.jsx)(fte,{})}),(0,$.jsx)(Ct,{path:`materials`,element:(0,$.jsx)(gte,{})}),(0,$.jsx)(Ct,{path:`consume`,element:(0,$.jsx)(Pte,{})})]}),(0,$.jsx)(Ct,{path:`*`,element:(0,$.jsx)(xt,{to:`/projects`,replace:!0})})]})})})})},{})); \ No newline at end of file diff --git a/video-gen-app/dist/index.html b/video-gen-app/dist/index.html index a9f5d161..d706ca2c 100644 --- a/video-gen-app/dist/index.html +++ b/video-gen-app/dist/index.html @@ -28,7 +28,7 @@ } })(); - + diff --git a/video-gen-app/src/components/Layout/AppLayout.tsx b/video-gen-app/src/components/Layout/AppLayout.tsx index 75016123..d74c861d 100644 --- a/video-gen-app/src/components/Layout/AppLayout.tsx +++ b/video-gen-app/src/components/Layout/AppLayout.tsx @@ -586,8 +586,8 @@ const AppLayout: React.FC = () => { {/* Main Content */}
分析中
) : taskDetail.analysisStatus === 'completed' ? ( - {taskDetail.originalVideoContent} + {taskDetail.originalVideoContent} ) : null} @@ -788,7 +788,7 @@ function RemoveInfo() { } placement="top" trigger="hover" - overlayInnerStyle={{ backgroundColor: '#fff', border: '1px solid rgba(99, 102, 241, 0.1)', borderRadius: 12, boxShadow: '0 8px 24px rgba(99, 102, 241, 0.12)' }} + overlayInnerStyle={{ backgroundColor: '#fff', height: 300, overflowY: 'auto', border: '1px solid rgba(99, 102, 241, 0.1)', borderRadius: 12, boxShadow: '0 8px 24px rgba(99, 102, 241, 0.12)' }} > (AI 镜头拆分方案) @@ -832,6 +832,8 @@ function RemoveInfo() { ...style, transition: 'all 0.2s ease', borderBottom: '1px solid rgba(99, 102, 241, 0.05)', + height: 80, + overflow: 'auto', }} /> ), @@ -853,7 +855,7 @@ function RemoveInfo() { className={className} style={{ ...style, - background: 'rgba(99, 102, 241, 0.03)', + background: 'rgba(255, 255, 255, 1)', color: '#64748b', fontWeight: 500, fontSize: 13,