PageSourceSearch

https://static.cf.vidu.com/2.18.155-sg/_next/static/chunks/06zy3w1km1vvw.js

js vidu.com collected 2026-10-01 10:23:50 UTC 86,595 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="ad36300b-e957-c024-2100-862398c54798")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,856297,e=>{"use strict";var t,s=((t={}).SUBMIT="submit",t.DOWNLOAD="download",t.UPSCALE="upscale",t.FRAME_SHOT="frameShot",t.SHARE="share",t.ELLIPSIS_MENU="ellipsisMenu",t.STAR="star",t.EXTEND="extend",t.QUICK_EDIT="quickEdit",t.TRANSFORM_TO_ELEMENT="transformToElement",t);e.s(["ActionButtonType",()=>s])},717008,497723,129866,e=>{"use strict";var t=e.i(163791),s=e.i(486825);e.i(758908);var i=e.i(607557),a=e.i(48679),n=e.i(856297);let r=e=>"failed"===e.state||"canceled"===e.state;e.s(["getAudioButtonConfig",0,e=>{let{creation:t,task:s}=e;return r(s)||t?.err_info?.err_code?[n.ActionButtonType.ELLIPSIS_MENU]:[n.ActionButtonType.DOWNLOAD,n.ActionButtonType.SHARE,n.ActionButtonType.ELLIPSIS_MENU,n.ActionButtonType.STAR]},"getImageButtonConfig",0,e=>{let{task:t,creation:s,isLgScreen:a,type:o}=e;if("creation"===o){if(r(t)||!s)return[];if(s.err_info?.err_code)return[n.ActionButtonType.ELLIPSIS_MENU]}else if(r(t)||!s||s?.err_info?.err_code)return[n.ActionButtonType.ELLIPSIS_MENU];let l=t.settings?.sample_count??1,c=t.settings?.resolution;return[n.ActionButtonType.QUICK_EDIT,n.ActionButtonType.TRANSFORM_TO_ELEMENT,...1===l&&a&&!(0,i.isAdmissionTemplateTask)(t)?[n.ActionButtonType.SUBMIT]:[],n.ActionButtonType.DOWNLOAD,..."4k"!==c?[n.ActionButtonType.UPSCALE]:[],n.ActionButtonType.SHARE,n.ActionButtonType.ELLIPSIS_MENU,n.ActionButtonType.STAR]},"getVideoButtonConfig",0,e=>{let{task:t,creation:o,isLgScreen:l,type:c}=e;if("creation"===c){if(r(t)||!o)return[];if(o.err_info?.err_code)return[n.ActionButtonType.ELLIPSIS_MENU]}else if(r(t)||!o||o?.err_info?.err_code)return[n.ActionButtonType.ELLIPSIS_MENU];let d=t.settings?.sample_count??1,u=t.settings?.resolution,m=t.extra_params?.is_my_voice!==!0&&!(0,i.isAdmissionTemplateTask)(t);return[..."video"===o.type&&void 0!==o.duration&&"music_video"!==t.type&&"lip_sync"!==t.type&&"offline_avatar"!==t.type&&(0,a.isVideoDurationWithinRange)({duration:o.duration,maxDuration:s.Q2_PRO_REFERENCE_VIDEO_MAX_DURATION})?[n.ActionButtonType.QUICK_EDIT]:[],...m&&1===d&&l?[n.ActionButtonType.SUBMIT]:[],n.ActionButtonType.DOWNLOAD,..."4k"!==u?[n.ActionButtonType.UPSCALE]:[],n.ActionButtonType.FRAME_SHOT,..."video"!==o.type||(0,i.isSceneTask)(t.type)||"music_video"===t.type||"lip_sync"===t.type||"offline_avatar"===t.type?[]:[n.ActionButtonType.EXTEND],n.ActionButtonType.SHARE,n.ActionButtonType.ELLIPSIS_MENU,n.ActionButtonType.STAR]},"isFailedOrCanceledTask",0,r],717008);var o=e.i(533930),l=e.i(933260);e.s(["getEstimateTime",0,(e,s,a,n)=>{if(e===t.SCENE)return a&&n&&n.templateScene===a&&void 0!==n.estimatedDuration?n.estimatedDuration:l.TEMPLATE_ESTIMATED_TIME;let r=s?.model_version;if("short_story"===e)return 33*l.MINUTES_IN_HOUR;if("motion_control"===e){let e=Math.max(0,s?.duration??15);return l.MOTION_CONTROL_BASE_ESTIMATED_TIME+e*l.MOTION_CONTROL_ESTIMATED_TIME_PER_SECOND}if((0,i.isImageTask)({type:e})){if((r===o.MODEL_VERSION.Q1||r===o.MODEL_VERSION.Q2)&&s?.resolution){let t=(0,i.isImageTask)({type:e})?e:"default";return l.IMG_ESTIMATED_TIME[r]?.[t]?.[s.resolution]??l.DEFAULT_IMG_ESTIMATED_TIME}}else{let t=s?.duration??4;if((r===o.MODEL_VERSION["2.0"]||r===o.MODEL_VERSION.Q1)&&s?.resolution){let i="character2video"===e?"character2video":"default";return l.ESTIMATED_TIME[r][i][s.resolution][t]}if((r===o.MODEL_VERSION.Q2||r===o.MODEL_VERSION.Q2_PRO)&&s){if("multi_frame"===e)return 30*l.MINUTES_IN_HOUR;let i=s.lip_sync?"lip_sync":s.with_audio?"with_audio":s.transition??"default";return l.ESTIMATED_TIME[r][e]?.[i]?.[t]??l.DEFAULT_ESTIMATED_TIME}if(r===o.MODEL_VERSION.Q3&&s){let i=s.transition??"pro";return l.ESTIMATED_TIME[r][e]?.[i]?.[t]??l.DEFAULT_ESTIMATED_TIME}if(r===o.MODEL_VERSION.Q4&&s){let i="720p"===s.resolution?"720p":"1080p";return l.ESTIMATED_TIME[r][e]?.[i]?.[t]??l.DEFAULT_ESTIMATED_TIME}}return l.DEFAULT_ESTIMATED_TIME},"getQueueI18nMessageConfig",0,function(e,t,s){if(t<=l.ONE_MINUTE)return{key:"waitLessThanOneMinute"};if(e>=l.MINUTES_IN_DAY)return{key:s?"waitMoreThanProlonged":"waitMoreThan",params:{min:24,max:24,unit:"hours"}};let i=e>=l.MINUTES_IN_HOUR?"hours":"minutes";return{key:s?"waitTimeProlonged":"waitTime",params:{min:Math.floor(e/("hours"===i?l.MINUTES_IN_HOUR:1)),max:Math.floor(t/("hours"===i?l.MINUTES_IN_HOUR:1)),unit:i}}}],497723);var c=e.i(639741),d=e.i(970890);let u=e=>(0,c.jsxs)("svg",{width:"1em",height:"1em",fill:"none",viewBox:"0 0 48 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,c.jsx)("path",{d:"M0 12C0 5.37258 5.37258 0 12 0H36C42.6274 0 48 5.37258 48 12C48 18.6274 42.6274 24 36 24H12C5.37258 24 0 18.6274 0 12Z",fill:"currentColor",fillOpacity:"0.24"}),(0,c.jsx)("path",{d:"M21.625 9V15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75"}),(0,c.jsx)("path",{d:"M26.375 9V15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75"})]}),m=e=>(0,c.jsxs)("svg",{width:"1em",height:"1em",fill:"none",viewBox:"0 0 48 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,c.jsx)("rect",{height:"24",width:"48",fill:"
2currentColor",fillOpacity:"0.24",rx:"12"}),(0,c.jsx)("path",{d:"M20.8047 12V8.57143C20.8047 7.42857 22.0419 6.71429 23.0316 7.28571L26.0008 9L28.9701 10.7143C29.9598 11.2857 29.9598 12.7143 28.9701 13.2857L26.0008 15L23.0316 16.7143C22.0419 17.2857 20.8047 16.5714 20.8047 15.4286V12Z",fill:"currentColor"})]});var p=e.i(258127);e.i(616048);var h=e.i(384767),x=e.i(665531);let g=(0,d.forwardRef)((e,t)=>{let{url:s,id:i,duration:a,onPlay:n}=e,{isPlaying:r,progress:o,handlePlayPause:l,setProgress:g}=(0,h.useAudioPlay)({url:s,id:i});return(0,d.useImperativeHandle)(t,()=>({handlePlayPause:l})),(0,d.useEffect)(()=>{n(r?i:null)},[r]),(0,c.jsxs)("div",{className:"flex items-center gap-6 md:gap-3",onClick:e=>e.stopPropagation(),children:[(0,c.jsx)("span",{className:"font-normal text-sm text-white/40",children:(0,x.formatTime)(o)}),(0,c.jsx)(p.Slider,{value:[o],max:a,step:.01,className:"flex-1",onValueChange:e=>{e.length>0&&g(e[0])},style:{"--slider-track-color":"rgba(255, 255, 255, 0.12)"}}),(0,c.jsx)("span",{className:"h-6 w-12 shrink-0 cursor-pointer text-white",onClick:l,children:r?(0,c.jsx)(u,{className:"h-full w-full"}):(0,c.jsx)(m,{className:"h-full w-full"})})]})});e.s(["AudioPlayer",0,g],129866)},208058,e=>{"use strict";var t=e.i(639741),s=e.i(847172),i=e.i(970890),a=e.i(569955),n=e.i(443414),r=e.i(995042),o=e.i(412949),l=e.i(82702),c=e.i(322559),d=e.i(94175),u=e.i(353398),m=e.i(396182),p=e.i(720859),h=e.i(804264),x=e.i(514546),g=e.i(997637),f=e.i(734976),y=e.i(734698),k=e.i(533797),v=e.i(163791),_=e.i(486825),T=e.i(647534);e.i(616048);var b=e.i(254168),j=e.i(84575),w=e.i(95119),E=e.i(734371),N=e.i(200987),C=e.i(290189),M=e.i(181195),S=e.i(758908),A=e.i(70852),I=e.i(688109),L=e.i(738337),P=e.i(48679),D=e.i(457316),B=e.i(104650),O=e.i(856297);e.s(["CreationActionButtons",0,e=>{let{creation:R,task:F,showActionList:U,onSubmit:V,onSelectedAction:q,onDropdownOpenChange:z}=e,H=(0,s.useTranslations)(),K=(0,B.useRouter)(),{isSmScreen:$,isMdScreen:Y,isLgScreen:W}=(0,w.useIsScreen)(),{navigateToUpscale:G}=(0,N.useUpscaleNavigation)(),{updateCreation:Q,userInfo:X,isFirstSuccessVideoTask:Z,openReferenceModalWithData:J,replaceExtensionToolDraft:ee,replaceQuickEditToolDraft:et,isTeamSpace:es}=(0,C.useStore)(e=>({updateCreation:e.updateCreation,userInfo:e.userInfo,isFirstSuccessVideoTask:e.isFirstSuccessVideoTask,openReferenceModalWithData:e.openReferenceModalWithData,replaceExtensionToolDraft:e.replaceExtensionToolDraft,replaceQuickEditToolDraft:e.replaceQuickEditToolDraft,isTeamSpace:e.isTeamSpace})),ei=X?.subs_plan==="free",{open:ea}=(0,j.useGlobalModal)("shareDialog"),{open:en}=(0,j.useGlobalModal)("frameShotDialog"),er=document.getElementById("taskHistoryContainer"),{checkCreateElementEnablePromise:eo}=(0,b.useCheckEnableCreateElement)(),{isNewFeature:el,markAsClicked:ec}=(0,E.useNewFeature)(),{type:ed,settings:eu,id:em}=F,ep=R?.id||"",eh=R?.is_favor||!1,ex=R?.vote,eg="text2audio"===ed||"tts"===ed,ef=(0,i.useMemo)(()=>!!(R?.type==="video"&&void 0!==R.duration&&(0,P.isVideoDurationWithinRange)({duration:R.duration,maxDuration:_.Q2_PRO_REFERENCE_VIDEO_MAX_DURATION})&&Z(em))&&!!el(v.NewFeatureKeys.QUICK_EDIT),[em,R?.type,R?.duration,el,Z]),ey={...(0,L.getReportParams)(ed,eu,F.scene),interaction_position:`${ed}_task_card`},ek=()=>{R&&V&&V(R)},ev=()=>{G(R,{taskId:em,reportParams:ey})},e_=()=>{if(!R)return;let e=document.querySelector(`#creation-${R.id} video`);en({videoDom:e,creation:R,videoCurrentTime:e?.currentTime||0,currentTask:F,containerDiv:er,showFlyTrace:!0,openInNewTab:!1}),(0,D.reportEvent)("extraction_click")},eT=async()=>{R&&ea({creationId:ep,creationType:R.type,taskId:em,reportParams:ey})},eb=e=>{Q(em,ep,{vote:e??"unspecified"})},ej=e=>{Q(em,ep,{is_favor:e})},ew=()=>{R&&(ee((0,A.buildExtensionToolDraftFromCreation)(R)),K.push((0,p.getExtensionToolPath)()))},eE=async()=>{if(R){if("image"===R.type){et("image",(0,A.buildQuickEditToolDraftFromCreation)({mode:"image",creation:R,originalMediaName:H("create.createForm.originalImageName"),userPlan:X?.subs_plan})),K.push((0,p.getQuickEditToolPath)("image"));return}
2"video"===R.type&&(ec(v.NewFeatureKeys.QUICK_EDIT),et("video",(0,A.buildQuickEditToolDraftFromCreation)({mode:"video",creation:R,originalMediaName:H("create.createForm.originalVideoName"),userPlan:X?.subs_plan,defaultAspectRatio:eu?.aspect_ratio})),K.push((0,p.getQuickEditToolPath)("video")))}},eN=()=>{if(!R||"image"!==R.type)return;let e=R.nomark_uri||R.uri;if(!e)return;let t={sourceImage:e,sourceImagePreview:e,selectedImage:e,selectedImagePreview:e};eo({query:{}}).then(e=>{let{error:s}=e;s||J({referenceModalOpen:!0,element:{modality:"image",optionalAssets:[t]},referenceModalMode:"create",referenceModalType:"reference",referenceModalFrom:"others"})})},eC=(0,i.useMemo)(()=>{let e=[eg?{action:M.EllipsisActionTypeEnum.T2AFeedback,icon:(0,t.jsx)(o.BaseLineFeedback,{})}:{action:M.EllipsisActionTypeEnum.Report,icon:(0,t.jsx)(o.BaseLineFeedback,{})},{action:M.EllipsisActionTypeEnum.Delete,icon:(0,t.jsx)(a.BaseLineDelete,{})}];return W&&U.includes(O.ActionButtonType.UPSCALE)&&eu?.resolution!=="4k"&&R&&e.push({key:O.ActionButtonType.UPSCALE,label:H("task.action.upscale"),icon:(0,t.jsx)(u.BaseLineUpscale,{}),onClick:ev}),W&&U.includes(O.ActionButtonType.SHARE)&&R&&e.push({key:O.ActionButtonType.SHARE,label:H("task.action.share"),icon:(0,t.jsx)(c.BaseLineShare2,{}),onClick:eT}),$&&U.includes(O.ActionButtonType.TRANSFORM_TO_ELEMENT)&&R?.type==="image"&&e.push({key:O.ActionButtonType.TRANSFORM_TO_ELEMENT,label:H("create.char2VideoForm.element.addToMyRef"),icon:(0,t.jsx)(m.ProductLineTransform,{}),onClick:eN}),e},[R,W,$,eu?.resolution,U,H,ed]);return 0===U.length?null:(0,t.jsx)(t.Fragment,{children:U.map(e=>{switch(e){case O.ActionButtonType.QUICK_EDIT:if(!R)return null;if("image"===R.type)return(0,t.jsx)(h.CustomTooltip,{trigger:"hover",content:H("task.action.quickEdit"),container:er,children:(0,t.jsx)(k.Button,{variant:"text",size:"original",className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",onClick:eE,children:(0,t.jsx)(l.BaseLineQuickEdit,{className:"text-system-white"})})},"quickEdit");if("video"===R.type)return(0,t.jsx)(f.NewFeatureTooltip,{isNew:ef,newText:H("task.action.quickEditNew"),normalText:H("task.action.quickEdit"),container:er,children:(0,t.jsx)(k.Button,{variant:"text",size:"original",className:(0,I.cn)("rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",ef&&"relative before:absolute before:inset-0 before:bg-system-blue02 before:shadow-[inset_0_0_10px_#0086FF,inset_0_0_2.5px_#0086FF] before:blur-[7px] before:drop-shadow-[0_0_2.5px_rgba(0,134,255,0.6)]"),onClick:eE,children:(0,t.jsx)(l.BaseLineQuickEdit,{className:(0,I.cn)("text-system-white",ef&&"z-10")})})},"quickEdit");return null;case O.ActionButtonType.TRANSFORM_TO_ELEMENT:if(!R||"image"!==R.type||$)return null;return(0,t.jsx)(h.CustomTooltip,{trigger:"hover",content:H("create.char2VideoForm.element.addToMyRef"),container:er,children:(0,t.jsx)(k.Button,{variant:"text",size:"original",className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",onClick:eN,children:(0,t.jsx)(m.ProductLineTransform,{className:"text-system-white"})})},"transformToElement");case O.ActionButtonType.SUBMIT:if(!R||es)return null;return(0,t.jsx)(h.CustomTooltip,{content:R.is_asset?H("task.action.submitted"):H("task.action.submit"),container:er,children:(0,t.jsx)(k.Button,{variant:"text",size:"original",className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",disabled:R.is_asset,onClick:ek,children:(0,t.jsx)(d.BaseLineSubmit3,{className:(0,I.cn)("text-system-white",R.is_asset&&"text-system-white opacity-[.40]")})})},"submit");case O.ActionButtonType.DOWNLOAD:{if(!R)return null;let e="both";return"china"===T.SITE&&(eg||ei)?e="watermarkOnly":"global"===T.SITE&&eg&&(e="noWatermarkOnly"),(0,t.jsx)(x.DownloadButton,{creationType:R.type,className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",waterMarkUri:R.uri||"",noWaterMarkUri:R.nomark_uri||"",audioUri:eg?R.uri:void 0,downloadFileName:(0,S.generateFileName)({type:R.type||"video",id:R.id||""}),watermarkMode:e,taskId:em,creationId:ep,reportParams:ey,container:er,hasCopyright:R.has_copyright},"download")}case O.ActionButtonType.UPSCALE:if(eu?.resolution==="4k"||!R)return null;return(0,t.jsx)(h.CustomTooltip,{trigger:"hover",content:H("task.action.upscale"),container:er,children:(0,t.jsx)(k.Button,{className:"flex aspect-square h-full cursor-pointer items-center justify-center rounded-8 bg-transparent p-1.5 text-lg hover:bg-system-hover01 lg:hidden",onClick:ev,children:(0,t.jsx)(u.BaseLineUpscale,{})})},"upscale");case O.ActionButtonType.FRAME_SHOT:if(Y||!R)return null;return(0,t.jsx)(h.CustomTooltip,{trigger:"hover",content:H("task.action.frameExtraction"),container:er,children:(0,t.jsx)(k.Button,{className:"flex aspect-square h-full cursor-pointer items-center justify-center rounded-8 bg-transparent p-1.5 text-lg hover:bg-system-hover01",onClick:e_,children:(0,t.jsx)(r.BaseLineExtractentrance,{})})},"frameShot");case O.ActionButtonType.SHARE:if(!R)return null;return(0,t.jsx)(h.CustomTooltip,{trigger:"hover",content:H("task.action.share"),container:er,children:(0,t.jsx)("div",{className:"skip-login-check flex aspect-square h-full cursor-pointer items-center justify-center rounded-8 bg-transparent p-1.5 text-lg hover:bg-system-hover01 lg:hidden",onClick:eT,children:(0,t.jsx)(c.BaseLineShare2,{})})},"share");case O.ActionButtonType.ELLIPSIS_MENU:return(0,t.jsx)(g.EllipsisDropdownMenu,{side:"top",className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01 data-[state=open]:bg-system-hover01",actions:eC,creationId:R?.err_info?.err_code?"":ep,creationType:R?.type,taskId:em,currentVote:ex,onVote:eb,reportParams:ey,onSelectedAction:q,onDropdownOpenChange:z},"ellipsisMenu");case O.ActionButtonType.STAR:if(!R)return null;return(0,t.jsx)(h.CustomTooltip,{trigger:"hover",content:H("task.action.mark"),container:er,children:(0,t.jsx)("div",{className:"aspect-square h-full rounded-8",children:(0,t.jsx)(y.StarButton,{className:"p-1.5 text-inherit text-xl hover:bg-system-hover01 aria-selected:text-system-white",id:ep,isStarred:eh,onStar:ej,reportParams:ey})})},"star");case O.ActionButtonType.EXTEND:{let e=R?.resolution?.resolution!=="1080p";return(0,t.jsx)(h.CustomTooltip,{trigger:"hover",content:e?H("task.extendOnly1080p"):H("task.action.extend"),container:er,children:(0,t.jsx)(k.Button,{className:"flex aspect-square h-full cursor-pointer items-center justify-center rounded-8 bg-transparent p-1.5 text-lg hover:bg-system-hover01",disabled:e,onClick:ew,children:(0,t.jsx)(n.BaseLineExtend,{className:"text-system-white"})})},"extend")}default:return null}}
2).filter(Boolean)})}])},191036,537182,42970,e=>{"use strict";var t=e.i(639741),s=e.i(290658),i=e.i(847172),a=e.i(970890),n=e.i(645524),r=e.i(135274),o=e.i(758908),l=e.i(607557),c=e.i(375250),d=e.i(503372),u=e.i(948179),m=e.i(804264),p=e.i(533797),h=e.i(163791);e.i(616048);var x=e.i(755843),g=e.i(84575),f=e.i(290189),y=e.i(688109),k=e.i(457316);e.i(862634);var v=e.i(217361),_=e.i(55232),T=e.i(717008),b=e.i(554985),j=e.i(628e3),w=e.i(200233),E=e.i(885414),N=e.i(585225),C=e.i(647534),M=e.i(181195),S=e.i(738337),A=e.i(394829),I=e.i(933260),L=e.i(497723),P=e.i(129866),D=e.i(876920),B=e.i(208058),O=e.i(460259),R=e.i(24094);let F=e=>{let{hasFinished:s,id:i,allWaitTime:a,stopProgress:n=100}=e,{progress:r}=(0,R.useTaskProgress)({id:i,hasFinished:s,allWaitTime:a,stopProgress:n});return(0,t.jsx)(O.Progress,{value:r})},U=e=>{let{creation:s,task:n,taskState:r,queueWaitTime:o,isWaitTimeProlonged:l,onOpenActionDialog:c,onOpenDetail:d,onCancelTask:u,onSubmit:m}=e,h=(0,i.useTranslations)(),{open:_}=(0,g.useGlobalModal)("planDetailDialog"),{open:O}=(0,g.useGlobalModal)("deleteDialog"),{isMobile:R}=(0,x.useDevice)(),{userInfo:U,removeTask:V}=(0,f.useStore)(e=>({userInfo:e.userInfo,removeTask:e.removeTask})),[q,z]=(0,a.useState)(null),H=(0,a.useRef)(null),{settings:K,type:$,id:Y,scene:W,input:{prompts:G}}=n,{id:Q="",uri:X="",audio_image:Z,duration:J=N.AUDIO_DURATION}=s||{},ee={...(0,S.getReportParams)($,K,W),interaction_position:`${$}_task_card`},et=I.FINISHED_STATES.includes(r),es="tts"===n.type,ei=es?(0,v.convertTTSPromptsToTextPrompt)(G):G?.filter(e=>"text"===e.type)[0]?.content,ea=e=>{e===M.EllipsisActionTypeEnum.Delete?O({type:"task",creationId:"",taskId:Y,reportParams:ee,creationType:s?.type,onDelete:()=>{V(Y)}}):e===M.EllipsisActionTypeEnum.Report?c({action:M.EllipsisActionTypeEnum.Report,type:Q?"creation":"task",id:Q||Y,reportParams:ee}):c({action:e,type:"creation",id:Q||Y,reportParams:ee})},en=(0,T.getAudioButtonConfig)({creation:s,task:n}),er=e=>{let{icon:i,title:a,content:o}=e;return(0,t.jsxs)("div",{className:(0,y.cn)("flex max-w-[600px] justify-between gap-8 rounded-12 bg-cover bg-no-repeat py-3 pr-4 pl-3","success"===r?"cursor-pointer bg-transparent hover:bg-white/10":"cursor-default bg-black/[48%]",Q===q&&"gap-10 md:gap-8"),style:{backgroundImage:"success"===r?`url(${(0,A.getBlurBackgroundImg)(Z?.blurHash,.1)})`:""},onClick:()=>{"success"===r&&s?.id&&d({...s,task:n})},children:[i&&(0,t.jsxs)("div",{className:(0,y.cn)("relative md:size-16",es?"size-[80px]":"size-[104px]"),children:[(0,t.jsx)("span",{className:(0,y.cn)("absolute inset-0 z-[1] flex aspect-square flex-shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-6 text-[32px] text-system-white/40","success"!==r&&"cursor-auto bg-system-bg03"),onClick:e=>{e.stopPropagation(),H.current?.handlePlayPause()},children:i}),(0,t.jsx)("img",{src:j.default.src,alt:"",className:(0,y.cn)("absolute inset-0 z-0 animate-spin-vinyl opacity-0 transition-[left]",Q===q&&"left-[30px] opacity-1 md:left-4")})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col justify-center overflow-hidden py-1 md:p-0",children:[(0,t.jsx)("h3",{className:(0,y.cn)("relative mb-1 font-medium text-base text-system-white leading-5",{hidden:"success"===r}),children:a}),(0,t.jsx)("div",{className:(0,y.cn)("font-normal text-sm text-system-white/40",{"flex-1":"success"===r}),children:o})]})]})};return et?(()=>{if("canceled"===r)return er({icon:(0,t.jsx)(w.Fail,{}),title:h("task.status.canceled.title"),content:h("task.status.canceled.content")});if("failed"===r){let e=n.err_code;return e===I.THIRD_PARTY_AUDIT_ILLEGAL_ERROR_CODE?er({icon:(0,t.jsx)(w.Fail,{}),title:h("task.status.thirdPartyAuditIllegal.title"),content:h("task.status.thirdPartyAuditIllegal.content")}):"CreationPolicyViolation"===e||"failed"===e?er({icon:(0,t.jsx)(w.Fail,{}),title:h("task.status.auditVideoFailed.title"),content:h("task.status.auditVideoFailed.content")}):er({icon:(0,t.jsx)(w.Fail,{}),title:h("task.status.otherFailed.title"),content:h("task.status.otherFailed.content")})}let e=s?.err_info?.err_code;return e?e===I.THIRD_PARTY_AUDIT_ILLEGAL_ERROR_CODE?er({icon:(0,t.jsx)(w.Fail,{}),title:h("task.status.thirdPartyAuditIllegal.title"),content:h("task.status.thirdPartyAuditIllegal.content")}):"CreationPolicyViolation"===e||"failed"===e?er({icon:(0,t.jsx)(w.Fail,{}),title:h("task.status.auditVideoFailed.title"),content:h("task.status.auditVideoFailed.content")}):er({icon:(0,t.jsx)(w.Fail,{}),title:h("task.status.otherFailed.title"),content:h("task.status.otherFailed.content")}):er({icon:(0,t.jsx)("img",{src:Z?.cover[C.SITE],alt:""}),content:(0,t.jsxs)("div",{className:"flex h-full flex-col justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 text-system-white",children:[(0,t.jsx)("div",{id:"prompt",className:"flex-1 truncate font-medium text-base leading-5 md:text-sm",children:ei}
2),!R&&(0,t.jsx)("div",{className:"flex items-center md:hidden",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(B.CreationActionButtons,{creation:s,task:n,showActionList:en,onSubmit:m,onSelectedAction:ea})})]}),(0,t.jsxs)("p",{className:"mt-1 font-normal text-sm text-system-white/40 md:mt-0",children:[J,"s","china"===C.SITE?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"mx-1 text-system-white/20",children:"|"}),"Vidu AI 生成"]}):""]})]}),(0,t.jsx)(P.AudioPlayer,{url:X,id:Q,duration:J,onPlay:e=>z(e),ref:H})]})})})():(()=>{let{key:e,params:s}=(0,L.getQueueI18nMessageConfig)(o?.min[0]||0,o?.max[0]||0,l);switch(r){case"queueing":return er({icon:(0,t.jsx)(E.Loading,{className:"animate-spin text-system-white"}),title:h("task.status.queue.title"),content:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{children:[o?.max[0]?(0,t.jsx)("p",{className:"mb-1",children:h(`task.status.queue.${e}`,s?{...s,unit:h(`task.status.queue.${s.unit}`)}:{})}):null,U?.subs_plan==="free"?h.rich("task.status.queue.free",{button:e=>(0,t.jsx)(p.Button,{variant:"text",size:"original",className:"font-normal text-sm text-system-blue02 lg:text-xs",onClick:()=>{_({fromPage:"audio_upgrade"}),(0,k.reportEvent)("vip_price_modal_exposure",{from_page:"audio_upgrade"}),(0,b.sendGAEvent)("event","subscription_exposure",{from_page:"audio_upgrade"})},children:e})}):h("task.status.queue.vip")]}),(0,t.jsx)(D.CancelButton,{className:"-translate-y-1/2 absolute top-1/2 right-0 border border-system-white24 text-system-white enabled:hover:bg-system-hover02 disabled:text-system-white64 sm:hidden",taskId:Y,onCancel:u})]})});case"processing":case"fetchingTaskDetail":return er({icon:(0,t.jsx)(E.Loading,{className:"animate-spin text-system-white"}),title:(0,t.jsx)("div",{className:"mb-4",children:h("task.status.creating.title")}),content:(0,t.jsx)(F,{hasFinished:"fetchingTaskDetail"===r,id:n.id,allWaitTime:(0,L.getEstimateTime)($,K,n.scene),stopProgress:95})});default:return null}})()},V=e=>{let{task:s,onOpenDetail:a,scrollToTop:n}=e,r=(0,i.useTranslations)(),{updateCreation:l}=(0,f.useStore)(e=>({updateCreation:e.updateCreation})),{open:b}=(0,g.useGlobalModal)("actionDialog"),{open:j}=(0,g.useGlobalModal)("postsModal"),{isMobile:w}=(0,x.useDevice)(),{taskState:E,hasFinished:N,canCancelTask:C,queueWaitTime:M,isWaitTimeProlonged:S,handleCancelTask:A,handleSelectedAction:I,handleRecreateAction:L}=(0,_.useTaskCard)({task:s,scrollToTop:n}),P=document.getElementById("taskHistoryContainer"),{input:O,id:R,created_at:F}=s,V=s.creations??[],q=O.prompts?.filter(e=>"text"===e.type)||[],z=(0,i.useFormatter)(),H=new Date(F),K=Intl.DateTimeFormat().resolvedOptions().timeZone,$=e=>{j({creation:{...e,task:s},mobileNextStep:w,onClose:t=>l(R,e.id,{is_asset:t})}),(0,k.reportEvent)("submit_click",{submit_position:"tools-submit"})},Y=(0,T.getAudioButtonConfig)({creation:V[0],task:s}),W="tts"===s.type?[(0,v.convertTTSPromptsToTextPrompt)(O.prompts)].filter(Boolean):q.map(e=>(0,o.renderT2APrompt)(e));return(0,t.jsxs)("div",{className:"sm:rounded-12 sm:bg-system-bg04 sm:p-3",children:[(0,t.jsxs)("div",{className:"flex items-center sm:hidden",children:[(0,t.jsx)("div",{className:"size-7 rounded-full bg-system-white10 p-1",children:(0,t.jsx)(d.BaseLineMusic,{className:"size-5"})}),(0,t.jsx)("p",{className:"ml-3 text-sm text-system-white opacity-90",children:r(`create.${h.TYPE_KEY_MAP[s.type]}`)}),(0,t.jsx)("div",{className:"ml-2 text-sm text-system-white36",children:z.dateTime(H,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",timeZone:K})})]}),(0,t.jsx)("div",{className:(0,y.cn)("mt-2 mb-3 ml-10 pr-3 text-sm text-system-white48 md:my-3 md:ml-0","h-auto max-w-[600px] lg:h-auto"),children:(0,t.jsx)("div",{className:"flex h-auto flex-1 items-center lg:h-auto",children:(0,t.jsx)("div",{className:"flex h-full w-full flex-1 items-center",children:!!q.length&&(0,t.jsx)(m.CustomTooltip,{collisionBoundary:P,contentClassName:"overflow-y-auto max-h-[400px] [word-break:break-word]",collisionTop:52,showOnlyOnOverflow:!0,maxLines:2,content:W.map(e=>(0,t.jsx)("p",{className:"whitespace-normal break-all",children:e},(0,c.v4)())),sideOffset:8,trigger:"auto",children:W.map(e=>(0,t.jsx)("span",{className:"mr-2",children:e},(0,c.v4)()))})})})}),(0,t.jsxs)("div",{className:(0,y.cn)("ml-10 md:mr-0 md:ml-0 md:max-w-full lg:mr-10","max-w-[600px]"),children:[(0,t.jsx)(U,{creation:V[0],task:s,taskState:E,queueWaitTime:M,isWaitTimeProlonged:S,onOpenActionDialog:e=>{b(e)},onOpenDetail:a,onCancelTask:A,onSubmit:$}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between sm:flex-row-reverse lg:mt-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(p.Button,{className:"h-8 gap-2 rounded-8 bg-system-bg02 px-3 font-normal enabled:hover:bg-system-hover01 disabled:text-system-white24",onClick:L,icon:(0,t.jsx)(u.BaseLineRecreate,{className:"text-base sm:hidden"}),children:r("task.action.reprompt")})}),w&&(0,t.jsx)("div",{className:"rounded-8 bg-system-bg02",children:(0,t.jsx)("div",{className:"flex h-full items-center aria-disabled:pointer-events-none aria-disabled:opacity-[.24] aria-disabled:sm:hidden","aria-disabled":!N,children:(0,t.jsx)(B.CreationActionButtons,{creation:V[0],task:s,showActionList:Y,onSubmit:$,onSelectedAction:I})})}),C&&(0,t.jsx)(D.CancelButton,{className:"hidden bg-system-bg02 enabled:hover:bg-system-hover01 disabled:text-system-white24 sm:flex",taskId:R,onCancel:A})]})]})]},R)};var q=e.i(443414),z=e.i(995198);let H=e=>(0,t.jsxs)("svg",{width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("path",{d:"M9.58333 12.5H5.83333C4.94928 12.5 4.10143 12.8512 3.47631 13.4763C2.85119 14.1014 2.5 14.9493 2.5 15.8333V17.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.01667"}),(0,t.jsx)("path",{d:"M17.8151 13.855C18.147 13.5231 18.3335 13.0728 18.3335 12.6034C18.3335 12.1339 18.147 11.6837 17.8151 11.3517C17.4831 11.0197 17.0329 10.8333 16.5634 10.8333C16.0939 10.8333 15.6437 11.0197 15.3117 11.3517L11.9701 14.695C11.7719 14.8931 11.6269 15.1378 11.5484 15.4067L10.8509 17.7984C10.83 17.8701 10.8287 17.9461 10.8473 18.0185C10.8658 
218.0908 10.9035 18.1569 10.9563 18.2097C11.0091 18.2625 11.0751 18.3001 11.1475 18.3187C11.2198 18.3372 11.2959 18.336 11.3676 18.315L13.7592 17.6175C14.0281 17.539 14.2729 17.394 14.4709 17.1959L17.8151 13.855Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.01667"}),(0,t.jsx)("path",{d:"M8.33333 9.16667C10.1743 9.16667 11.6667 7.67428 11.6667 5.83333C11.6667 3.99238 10.1743 2.5 8.33333 2.5C6.49238 2.5 5 3.99238 5 5.83333C5 7.67428 6.49238 9.16667 8.33333 9.16667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.01667"})]}),K=e=>(0,t.jsxs)("svg",{width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("path",{d:"M2 5.5C2 4.39543 2.89543 3.5 4 3.5H20C21.1046 3.5 22 4.39543 22 5.5V18.5C22 19.6046 21.1046 20.5 20 20.5H4C2.89543 20.5 2 19.6046 2 18.5V5.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M18.5 4V20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M5.5 4V20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M19 9H22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M19 15H22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M2 9H5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M2 15H5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M10.1367 8.84375C10.3751 8.71178 10.6664 8.71983 10.8975 8.86426L14.8975 11.3643C15.1167 11.5013 15.25 11.7414 15.25 12C15.25 12.2586 15.1167 12.4987 14.8975 12.6357L10.8975 15.1357C10.6664 15.2802 10.3751 15.2882 10.1367 15.1562C9.89825 15.0241 9.75 14.7726 9.75 14.5V9.5C9.75 9.22736 9.89825 8.97592 10.1367 8.84375Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]});var $=e.i(82702),Y=e.i(178034),W=e.i(94175),G=e.i(353398);let Q=e=>(0,t.jsxs)("svg",{width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("path",{d:"M6.49805 6.21775V3.9082C6.49805 3.13155 7.12765 2.50195 7.9043 2.50195H20.0918C20.8684 2.50195 21.498 3.13155 21.498 3.9082V16.0957C21.498 16.8724 20.8684 17.502 20.0918 17.502H17.7562",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M16.0957 6.49805H3.9082C3.13155 6.49805 2.50195 7.12765 2.50195 7.9043V20.0918C2.50195 20.8684 3.13155 21.498 3.9082 21.498H16.0957C16.8724 21.498 17.502 20.8684 17.502 20.0918V7.9043C17.502 7.12765 16.8724 6.49805 16.0957 6.49805Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M8.13672 10.8438C8.37512 10.7118 8.66637 10.7198 8.89746 10.8643L12.8975 13.3643C13.1167 13.5013 13.25 13.7414 13.25 14C13.25 14.2586 13.1167 14.4987 12.8975 14.6357L8.89746 17.1357C8.66637 17.2802 8.37512 17.2882 8.13672 17.1562C7.89825 17.0241 7.75 16.7726 7.75 16.5V11.5C7.75 11.2274 7.89825 10.9759 8.13672 10.8438Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]});var X=e.i(471024),Z=e.i(236234),J=e.i(772897),ee=e.i(507361),et=e.i(473632),es=e.i(334192),ei=e.i(996890),ea=e.i(685427),en=e.i(824944),er=e.i(24648),eo=e.i(91383),el=e.i(567470),ec=e.i(289580),ed=e.i(486548),eu=e.i(776845),em=e.i(446864),ep=e.i(271776),eh=e.i(60432),ex=e.i(48679),eg=e.i(104650);let ef=[{labelKey:"create.tabLipSync",key:M.BackfillTaskType.LIP_SYNC,path:"/create/lip-sync",minDuration:1,maxDuration:120},{labelKey:"create.tabFaceSwap",key:M.BackfillTaskType.FACE_SWAP,path:"/create/face-swap",minDuration:1,maxDuration:8},{labelKey:"create.tabMotionControl",key:M.BackfillTaskType.MOTION_CONTROL,path:"/create/motion-control",minDuration:2,maxDuration:30}],ey=e=>{let{className:s,creation:n,content:r,container:o,titleText:c}=e,d=(0,i.useTranslations)(),u=(0,eg.usePathname)(),m=(0,eg.useRouter)(),{supportsHover:p}=(0,x.useDevice)(),[h,g]=(0,a.useState)(M.BackfillTaskType.LIP_SYNC),[v,_]=(0,a.useState)(!1),{lipSyncSettings:T,faceSwapSettings:b,motionControlSettings:j,updateLipSyncFormParams:w,updateFaceSwapFormParams:E,updateMotionControlFormParams:N}=(0,f.useStore)(e=>({lipSyncSettings:e.lipSyncFormParams.settings,faceSwapSettings:e.faceSwapFormParams.settings,motionControlSettings:e.motionControlFormParams.settings,updateLipSyncFormParams:e.updateLipSyncFormParams,updateFaceSwapFormParams:e.updateFaceSwapFormParams,updateMotionControlFormParams:e.updateMotionControlFormParams})),C=(0,a.useMemo)(()=>"task"in n&&(0,l.isExtendTask)(n.task.type)?n.duration||0:"task"in n&&"number"==typeof n.task.settings?.duration?n.task.settings.duration:n.duration||0,[n]),S=(0,a.useMemo)(()=>ef.filter(e=>(0,ex.isVideoDurationWithinRange)({duration:C,minDuration:e.minDuration,maxDuration:e.maxDuration})),[C]),A=(0,a.useMemo)(()=>S.map(e=>({label:d(e.labelKey),key:e.key})),[S,d]);(0,a.useEffect)(()=>{p&&_(!1)},[p]),(0,a.useEffect)(()=>{S.some(e=>e.key===h)||g(S[0]?.key??M.BackfillTaskType.LIP_SYNC)},[S,h]);let I=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,s=S.find(e=>e.key===t)||S[0];s&&(((e,t)=>{let s=(0,ex.normalizeDiscreteVideoDurationToSeconds)(C);if(e===M.BackfillTaskType.LIP_SYNC){w("videoPrompts",[t]),w("settings",{...T,duration:s});return}if(e===M.BackfillTaskType.FACE_SWAP){E("videoPrompts",[t]),E("settings",{...b,duration:s});return}N("videoPrompts",[t]),N("settings",{...j,duration:s})})(t,(e=(0,eh.getResourceUrl)({uri:n.uri||"",noMarkUri:n.nomark_uri||""}),{id:n.id||"",status:"done",prompt:{video:n.uri||"",videoPreview:e,duration:n.duration,coverImage:n.cover_uri,coverImagePreview:n.cover_uri,resolution:n.resolution},reference:{creation_id:n.id||""}})),(0,k.reportEvent)("apply_click",{apply_type:t,apply_position:"create_task_card"}),u.endsWith(s.path)||m.push(s.path))};if(0===S.length)return null;let L=()=>{p?I():_(e=>!e)};return(0,t.jsxs)(ep.HoverCard,{openDelay:0,closeDelay:100,open:p?void 0:v,onOpenChange:p?void 0:_,children:[(0,t.jsx)(ep.HoverCardTrigger,{asChild:!0,children:r?(0,a.cloneElement)(r,{onClick:e=>{r.props.onClick?.(e),L()}}):(0,t.jsx)("div",{className:(0,y.cn)("flex cursor-pointer items-center justify-center rounded-8",s),onClick:L,children:(0,t.jsx)(Z.ProductLineApply1,{})})}),(0,t.jsx)(ep.HoverCardPortal,{container:o||document.body,children:(0,t.jsxs)(ep.HoverCardContent,{className:"w-fit bg-system-bg02 p-3 text-sm",align:"center",sideOffset:2,side:"top",children:[(0,t.jsx)(em.BackfillTargetOption,{selectedType:h,options:A,onApply:e=>{g(e),I(e),p||_(!1)},titleText:c}),(0,t.jsx)(ep.HoverCardArrow,{})]})})]})};var ek=e.i(95119),ev=e.i(700906),e_=e.i(91179),eT=e.i(211129),eb=e.i(382390),ej=e.i(292728);let ew=e=>(0,t.jsxs)("svg",{width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,t.jsx)("path",{d:"M12 22C16.6944 22 20.5 18.1944 20.5 13.5C20.5 8.8056 16.6944 5 12 5C7.3056 5 3.5 8.8056 3.5 13.5C3.5 18.1944 7.3056 22 12 22Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M9 2H15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M12 9.5V13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M16 13.5H12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,t.jsx)("path",{d:"M12 2V4.66667",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]});var eE=e.i(981802),eN=e.i(893005),eC=e.i(449817),eM=e.i(354224),eS=e.i(856297);let eA=1e3/30,eI=[[.2,.25],[.48,.15],[.8,.24],[.86,.52],[.72,.8],[.4,.84],[.14,.66],[.13,.38]],eL=[[.5,.5],[.39,.39],[.13,.296],eI[0]],eP=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(s,Math.max(t,e))},eD=(e,t,s)=>{let i;return(i=eP((s-e)/(t-e)))*i*(3-2*i)},eB=(e,t)=>{let s=43758.5453*Math.sin(127.1*e+311.7*t);return s-Math.floor(s)},eO=(e,t,s,i,a)=>{let n=a*a;return .5*(2*t+(-e+s)*a+(2*e-5*t+4*s-i)*n+n*a*(-e+3*t-3*s+i))},eR=(e,t)=>{let s=e(0),i=[{distance:0,...s}],a=s,n=0;for(let s=1;s<=t;s+=1){let r=e(s/t);n+=Math.hypot(r.x-a.x,r.y-a.y),i.push({distance:n,...r}),a=r}return i},eF=(e,t)=>{let s=0,i=e.length-1;for(;s+1<i;){let a=s+i>>1;e[a].distance<t?s=a:i=a}let a=e[s],n=e[i],r=Math.max(1e-6,n.distance-a.distance),o=eP((t-a.distance)/r);return{x:a.x+(n.x-a.x)*o,y:a.y+(n.y-a.y)*o}},eU=eR(e=>{let t=1-e,s=t*t*t,i=3*t*t*e,a=3*t*e*e,n=e*e*e;
2return{x:eL[0][0]*s+eL[1][0]*i+eL[2][0]*a+eL[3][0]*n,y:eL[0][1]*s+eL[1][1]*i+eL[2][1]*a+eL[3][1]*n}},160),eV=eR(e=>{var t;let s,i,a,n,r,o,l;return t=e*eI.length,i=Math.floor(t)%(s=eI.length),a=t-Math.floor(t),n=eI[(i-1+s)%s],r=eI[i],o=eI[(i+1)%s],l=eI[(i+2)%s],{x:eO(n[0],r[0],o[0],l[0],a),y:eO(n[1],r[1],o[1],l[1],a)}},720),eq=eU[eU.length-1].distance,ez=eV[eV.length-1].distance,eH=(e,t)=>{let s=0;for(let i=0;i<3;i+=1){let a=t.waves[i],n=Math.hypot((e.nx-a.sourceX)*t.scaleX,(e.ny-a.sourceY)*t.scaleY),r=(e.sin3*a.cos3+e.cos3*a.sin3)*.052+(e.sin7*a.cos7+e.cos7*a.sin7)*.022+(e.noise-.5)*.022,o=1-eD(.025,.16,Math.abs(n-a.radius-r)),l=.56+.34*e.noise;s+=o*a.birth*a.fade*l*.48}return Math.min(.54,s)},eK=()=>{let e=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let t=e.current,s=t?.getContext("2d");if(!t||!s)return;let i=document.createElement("canvas"),a=i.getContext("2d");if(!a)return;let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=1,o=1,l=1,c=[],d=0,u=!1,m=!0,p=0,h=performance.now(),x=()=>{let e=t.getBoundingClientRect();r=Math.max(1,e.width),o=Math.max(1,e.height),l=Math.min(window.devicePixelRatio||1,1.5),t.width=Math.round(r*l),t.height=Math.round(o*l),i.width=Math.max(120,Math.round(r/5)),i.height=Math.max(68,Math.round(o/5));let s=eP(Math.round(Math.min(r,o)/72),4,8),a=Math.max(.55,.105*s),n=Math.min(r,o),d=r/2,u=o/2,m=[];for(let e=s/2;e<o;e+=s)for(let t=s/2;t<r;t+=s){let s=t-d,i=e-u,l=Math.atan2(i,s);m.push({x:t,y:e,nx:t/r,ny:e/o,radius:a,centerDistance:Math.hypot(s,i)/n,noise:eB(t,e),sin3:Math.sin(3*l),cos3:Math.cos(3*l),sin7:Math.sin(7*l),cos7:Math.cos(7*l)})}c=m},g=e=>{let t=e-h,d=t%3600/3600,u=36e-5*t,m=u<eq?eF(eU,u):eF(eV,(u-eq)%ez),p=eP(u/eq),x=Math.min(r,o),g={scaleX:r/x,scaleY:o/x,waves:[]};for(let t=0;t<3;t+=1){let s=(d+t/3)%1,i=72e-5*e+t*Math.PI*2/3,a=p*(.018+.006*Math.sin(43e-5
2*e+t));g.waves.push({sourceX:m.x+Math.cos(i)*a,sourceY:m.y+Math.sin(.87*i)*a,radius:.76*s,birth:eD(0,.08,s),fade:1-eD(.48,.94,s),sin3:Math.sin(d*Math.PI*2+2.1*t),cos3:Math.cos(d*Math.PI*2+2.1*t),sin7:Math.sin(3.8*d-1.2*t),cos7:Math.cos(3.8*d-1.2*t)})}for(let t of(s.setTransform(l,0,0,l,0,0),s.clearRect(0,0,r,o),s.fillStyle="#000",s.fillRect(0,0,r,o),(e=>{let t=3e-4*e,n=i.width,l=i.height,c=Math.hypot(n,l);a.clearRect(0,0,n,l),a.fillStyle="#000",a.fillRect(0,0,n,l),a.save(),a.globalCompositeOperation="screen";for(let e=0;e<8;e+=1){let s=e%4,i=Math.floor(e/4),r=1.73*e,o=n*(.13+.247*s+.115*Math.sin(t*(.72+.037*e)+r)),d=l*(.27+.46*i+.16*Math.cos(t*(.61+.031*e)+.83*r)),u=.82+.24*Math.sin(.55*t+r),m=.62+.2*Math.cos(.47*t+1.2*r),p=.9*Math.sin(.31*t+r),h=c*(.36+e%3*.026);a.save(),a.translate(o,d),a.rotate(p),a.scale(u,m);let x=a.createRadialGradient(0,0,0,0,0,h),g=2===e||5===e;x.addColorStop(0,g?"rgba(63, 55, 180, 0.115)":e%2?"rgba(34, 94, 162, 0.15)":"rgba(25, 80, 150, 0.145)"),x.addColorStop(.18,g?"rgba(63, 55, 180, 0.115)":e%2?"rgba(34, 94, 162, 0.15)":"rgba(25, 80, 150, 0.145)"),x.addColorStop(.42,g?"rgba(50, 42, 154, 0.1)":"rgba(28, 82, 153, 0.14)"),x.addColorStop(.52,g?"rgba(38, 29, 126, 0.08)":"rgba(19, 70, 138, 0.12)"),x.addColorStop(.78,g?"rgba(22, 15, 82, 0.045)":"rgba(7, 40, 98, 0.062)"),x.addColorStop(1,"rgba(0, 0, 0, 0)"),a.fillStyle=x,a.fillRect(-h,-h,2*h,2*h),a.restore()}a.restore(),s.save(),s.imageSmoothingEnabled=!0,s.globalAlpha=.83;let d=.08*Math.max(r,o);s.drawImage(i,-d,-d,r+2*d,o+2*d),s.restore()})(e),c)){let i=n.matches?1-eD(.04,.15,Math.abs(t.centerDistance-.24)):eH(t,g);if(i<.015)continue;let a=.96+.04*Math.sin(.0018*e+5*t.noise),r=2.5*Math.sin(.0015*e+5*t.ny),o=2.5*Math.cos(.0013*e+5*t.nx);s.globalAlpha=Math.min(1,1.28*i),s.fillStyle="#d8f1ff",s.beginPath(),s.arc(t.x+r,t.y+o,t.radius*a,0,2*Math.PI),s.fill()}s.globalAlpha=1},f=()=>{u=!1,cancelAnimationFrame(d)},y=e=>{if(!u||!m||document.hidden){u=!1;return}if(n.matches){g(h),u=!1;return}d=requestAnimationFrame(y),e-p<eA||(g(e),p=e)},k=()=>{u||!m||document.hidden||(u=!0,p=0,d=requestAnimationFrame(y))},v=()=>{document.hidden?f():(h=performance.now(),k())},_=new ResizeObserver(()=>{x(),k()}),T=new IntersectionObserver(e=>{let t=e[e.length-1];(m=!!t?.isIntersecting)?(h=performance.now(),k()):f()},{threshold:.05});return _.observe(t),T.observe(t),document.addEventListener("visibilitychange",v),n.addEventListener("change",k),x(),k(),()=>{f(),_.disconnect(),T.disconnect(),document.removeEventListener("visibilitychange",v),n.removeEventListener("change",k)}},[]),(0,t.jsx)("canvas",{ref:e,className:"pointer-events-none absolute inset-0 size-full"})};e.s(["TaskStatusAnimation",0,eK],537182);let e$=new Set(["CreationPolicyViolation","failed","AuditSubmitIllegal"]),eY=e=>void 0!==e&&e$.has(e),eW=e=>{let{children:s}=e,i=(0,a.useId)().replace(/:/g,""),n=(0,a.useRef)(null),[r,o]=(0,a.useState)(0),l=a.Children.toArray(s).filter(e=>"string"==typeof e||"number"==typeof e).join("");(0,a.useLayoutEffect)(()=>{o(n.current?.getComputedTextLength()??0)},[l]);let c=Math.max(20,Math.ceil(r)+1),d=`task-upgrade-gradient-${i}`,u=`task-upgrade-mask-${i}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{"aria-hidden":"true",className:"block h-5 overflow-visible",width:c,height:"20",viewBox:`0 0 ${c} 20`,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:d,gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:c,y2:"0",spreadMethod:"repeat",children:[(0,t.jsx)("stop",{offset:"0",stopColor:"#5765f2"}),(0,t.jsx)("stop",{offset:"0.42",stopColor:"#babfff"}),(0,t.jsx)("stop",{offset:"1",stopColor:"#5765f2"}),(0,t.jsx)("animate",{attributeName:"x1",values:`0;${c}`,dur:"6s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"x2",values:`${c};${2*c}`,dur:"6s",repeatCount:"indefinite"})]}),(0,t.jsx)("mask",{id:u,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:c,height:"20",children:(0,t.jsx)("text",{ref:n,x:"0",y:"15",fill:"white",className:"text-sm",style:{fontFamily:"inherit"},children:l})})]}),(0,t.jsx)("rect",{width:c,height:"20",fill:`url(#${d})`,mask:`url(#${u})`})]}),(0,t.jsx)("span",{className:"sr-only",children:s})]})},eG=e=>{let{creation:s,creationsLength:n,task:r,taskState:o,queueWaitTime:l,isWaitTimeProlonged:c,onOpenActionDialog:d,onOpenDetail:u,onCancelTask:h,onSubmit:v}=e,_=(0,i.useTranslations)(),j=(0,eg.useLocale)(),{isMobile:E}=(0,x.useDevice)(),{isLgScreen:N}=(0,ek.useIsScreen)(),{open:A}=(0,g.useGlobalModal)("planDetailDialog"),{open:P}=(0,g.useGlobalModal)("deleteDialog"),{userInfo:O,updateTask:R,removeTask:U,sceneFormParams:V,isTeamSpace:q}=(0,f.useStore)(e=>({userInfo:e.userInfo,updateTask:e.updateTask,removeTask:e.removeTask,sceneFormParams:e.sceneFormParams,isTeamSpace:e.isTeamSpace})),[z,H]=(0,a.useState)(!1),[K,$]=(0,a.useState)(!1),[Y,G]=(0,a.useState)(!1),Q=(0,a.useRef)(""),{run:X}
2=(0,eb.useThrottleFn)(e=>H(e),{wait:100}),{settings:Z,type:J,id:ee}=r,et=s?.id||"",es={...(0,S.getReportParams)(J,Z,r.scene),interaction_position:`${J}_task_card`},ei=I.FINISHED_STATES.includes(o),ea=s?.is_favor||!1,en=document.getElementById("taskHistoryContainer"),er=(Z?.sample_count??1)>1&&!q&&r.extra_params?.is_my_voice!==!0,ec=r.input.prompts?.find(e=>"text"===e.type&&!e.multi_frame?.range)?.content||"";(0,a.useEffect)(()=>{G(!1),Q.current=""},[et]);let ed=(0,eT.useMemoizedFn)(async e=>{let t=Z?.codec||"unknown",s="h265"===t||"h265_pro"===t,i=e.error?.errorCode||"unknown",a=`${e.src}::${i}`;if(Q.current===a)return;Q.current=a;let n=(0,eM.isHevcPlaybackErrorCode)(i);if(s&&n)console.warn("HEVC decode error detected, marking as not supported"),(0,eM.markHevcNotSupported)(),G(!0);else{let s=await (0,eC.checkUrlAvailable)(e.src),i=e.error.errorCode??"unknown",a=e.error.errorDetails||e.error.message||"",r=e.error.error instanceof Error?e.error.error:void 0;e_.captureException(Error(`Video play failed: [${i}]${a?` ${a}`:""}`,r?{cause:r}:void 0),{tags:{"video.is_valid_url":s,"video.is_hevc_supported":(0,eM.isHevcSupported)(),"video.codec":t,"video.is_hevc_error":n,"video.error_code":String(i)},extra:{error:e.error}})}}),eu=s?.type==="image"?(0,T.getImageButtonConfig)({task:r,creation:s,isLgScreen:N,type:"creation"}):(0,T.getVideoButtonConfig)({task:r,creation:s,isLgScreen:N,type:"creation"}),em=e=>{let{icon:s,title:i,content:a,className:n}=e;return(0,t.jsxs)("div",{className:(0,y.cn)("flex h-full w-full flex-col items-center justify-center gap-2 px-5 py-8 text-center text-sm text-system-white64 lg:gap-1 lg:px-4 lg:text-xs",n),children:[s&&(0,t.jsx)("span",{className:"shrink-0 text-2xl lg:text-xl",children:s}),(0,t.jsx)("p",{className:"font-medium text-lg lg:text-base",children:i}),(0,t.jsx)("div",{className:"w-full",children:a})]})};return(0,t.jsx)("div",{className:"relative aspect-video max-w-[1080px] rounded-8 bg-system-black",onMouseEnter:()=>X(!0),onMouseLeave:()=>!K&&X(!1),children:ei?(0,t.jsxs)(t.Fragment,{children:[(()=>{if("canceled"===o)return em({title:_("task.status.canceled.title"),content:_("task.status.canceled.content")});if("failed"===o){let e=r.err_code;return e===I.THIRD_PARTY_AUDIT_ILLEGAL_ERROR_CODE?em({icon:(0,t.jsx)(w.Fail,{}),title:_("task.status.thirdPartyAuditIllegal.title"),content:_("task.status.thirdPartyAuditIllegal.content")}):eY(e)?em({icon:(0,t.jsx)(w.Fail,{}),title:_("task.status.auditVideoFailed.title"),content:_("task.status.auditVideoFailed.content")}):em({icon:(0,t.jsx)(w.Fail,{}),title:_("task.status.otherFailed.title"),content:_("task.status.otherFailed.content")})}let e=s?.err_info?.err_code;if(e)return e===I.THIRD_PARTY_AUDIT_ILLEGAL_ERROR_CODE?em({icon:(0,t.jsx)(w.Fail,{}),title:_("task.status.thirdPartyAuditIllegal.title"),content:_("task.status.thirdPartyAuditIllegal.content")}):"china"===C.SITE&&s?.err_info?.err_code==="Review"?em({icon:(0,t.jsx)(ew,{}),title:"审核中",content:"当前待审作品较多,请耐心等候~"}):eY(e)?em({icon:(0,t.jsx)(w.Fail,{}),title:_("task.status.auditVideoFailed.title"),content:_("task.status.auditVideoFailed.content")}):em({icon:(0,t.jsx)(w.Fail,{}),title:_("task.status.otherFailed.title"),content:_("task.status.otherFailed.content")});if(!s)return em({title:_("task.status.empty.title"),content:_("task.status.empty.c
2ontent")});let{id:i,cover_uri:a,uri:n,nomark_uri:l="",src_video_duration:c,has_audio:d,type:h,resolution:x}=s;if("image"===h){let e=x?.width||16,o=x?.height||9;return(0,t.jsx)("div",{className:"flex h-full w-full cursor-pointer items-center justify-center overflow-hidden rounded-8",children:(0,t.jsx)(eE.MediaWithWatermark,{width:e,height:o,className:"relative",showWatermark:"china"===C.SITE||O?.subs_plan==="free",children:(0,t.jsx)(el.ImageWithPlaceholder,{id:`creation_${i}`,src:a||l||n||"",alt:"creation image",loading:"eager",className:"h-full w-full bg-system-bg01 object-contain",placeHolderClassName:"bg-system-bg01",onClick:()=>{u({...s,task:r})}},i)})})}return(0,t.jsxs)("div",{className:"relative h-full w-full",children:[E?(0,t.jsx)(el.ImageWithPlaceholder,{src:a||"",alt:"creation video preview",className:"h-full w-full rounded-8 object-contain",onClick:()=>{u({...s,task:r})}},i):(0,t.jsx)(eN.VideoPlayer,{src:(0,eh.getResourceUrl)({uri:n,noMarkUri:l}),poster:a,startTime:c,creationId:i,playOnHover:!0,hoverTogglesControls:!0,isLazy:!0,hasAudio:d,onError:ed,handleClickVideo:()=>{u({...s,task:r})}},i),Y&&"video"===h&&(0,t.jsx)("div",{className:"absolute top-2 right-2 z-20 flex items-center gap-2",children:(0,t.jsx)(m.CustomTooltip,{content:(0,t.jsxs)("div",{className:"whitespace-pre-line text-sm leading-relaxed",children:[_("task.status.hevcNotSupported.content"),"zh"===j&&(0,t.jsxs)(t.Fragment,{children:["\n","更多解决方案参考:"," ",(0,t.jsx)("a",{href:"https://shengshu.feishu.cn/wiki/TVMAwqiauigsXIkgmsrcFEO2nYf",target:"_blank",rel:"noopener noreferrer",className:"text-system-blue02 hover:underline",children:"不支持的音频/视频格式 解决方案"})]})]}),contentClassName:"max-w-[320px] p-4",side:"bottom",sideOffset:8,children:(0,t.jsxs)(p.Button,{className:"items-center bg-system-black64 text-base text-system-white transition-colors hover:bg-system-black80",children:[_("task.status.hevcNotSupported.helpButton"),(0,t.jsx)(ej.BaseLineClose,{onClick:()=>G(!1),className:"ml-3 text-base"})]})})})]})})(),n>1&&s&&(0,t.jsx)("div",{className:(0,y.cn)("absolute top-2 right-2 z-10 rounded-8 bg-black/50 backdrop-blur-xl",!ea&&(E||!z)&&"hidden"),children:(0,t.jsx)("div",{className:"flex h-full items-center",children:(0,t.jsx)(B.CreationActionButtons,{creation:s,task:r,showActionList:ea&&!z?[eS.ActionButtonType.STAR]:eu,onSubmit:v,onSelectedAction:e=>{e===M.EllipsisActionTypeEnum.Delete?P({creationId:et,taskId:ee,type:"creation",creationType:s?.type,reportParams:es,onDelete:()=>{let e=(r.creations??[]).filter(e=>e.id!==et);e.length>0?R(ee,{creations:e}):U(ee)}}):e===M.EllipsisActionTypeEnum.Report?d({action:M.EllipsisActionTypeEnum.Report,type:et?"creation":"task",id:et||ee,reportParams:es}):d({action:e,type:"creation",id:et,reportParams:es})},onDropdownOpenChange:$})})}),n>1&&s&&("image"===s.type||"video"===s.type||er)&&!s.err_info?.err_code&&(0,t.jsxs)("div",{className:(0,y.cn)("absolute top-2 left-2 z-10 flex items-center rounded-8 bg-black/50 backdrop-blur-xl",(E||!z)&&"hidden"),children:["image"===s.type&&(0,t.jsx)(eo.ImageApplyButton,{className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",noMarkUri:s.nomark_uri||"",uri:s.uri||"",onApplyToTool:e=>{(0,k.reportEvent)("apply_click",{apply_type:e,apply_position:"create_task_card"})},backfillTextPrompt:ec,container:en,creationId:et,showFlyTrace:!0,titleText:_("task.action.continueCreate")}),"video"===s.type&&(0,t.jsx)(ey,{className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",creation:s,container:en,titleText:_("task.action.continueCreate")}),er&&(0,t.jsx)(m.CustomTooltip,{content:s.is_asset?_("task.action.submitted"):_("task.action.submit"),container:en,children:(0,t.jsx)(p.Button,{variant:"text",size:"original",className:"rounded-8 p-1.5 text-inherit text-xl hover:bg-system-hover01",disabled:s.is_asset,onClick:()=>v?.(s),children:(0,t.jsx)(W.BaseLineSubmit3,{className:(0,y.cn)("text-system-white",s.is_asset&&"text-system-white opacity-[.40]")})})})]})]}):(()=>{switch(o){case"queueing":{let e=(0,L.getQueueI18nMessageConfig)(l?.min[0]||0,l?.max[0]||0,c);return(0,t.jsxs)("div",{className:"relative size-full overflow-hidden rounded-8 bg-system-black",children:[(0,t.jsx)(eK,{}),(0,t.jsxs)("div",{className:(0,y.cn)("absolute z-10 flex flex-col items-start gap-3",n>1?"right-6 bottom-6 left-6":"right-8 bottom-[26px] left-8",1===n&&"right-32"),children:[(0,t.jsx)("p",{className:"font-medium text-lg text-system-white/70 leading-[26px]",children:_("task.status.queue.title")}),Z?.schedule_mode==="nopeak"?(0,t.jsx)("p",{className:"text-left text-[#b3b6b8] text-sm leading-5",children:_("task.status.queue.nopeak")}):(0,t.jsxs)("div",{className:"text-left text-sm text-system-white/70 leading-[1.4]",children:[l?.max[0]?(0,t.jsx)("p",{className:"mb-1",children:_(`task.status.queue.${e.key}`,e.params?{...e.params,unit:_(`task.status.queue.${e.params.unit}`)}:{})}):null,O?.subs_plan==="free"?(0,t.jsx)("span",{className:"inline-flex flex-wrap items-center gap-x-1",children:_.rich("task.status.queue.free",{button:e=>(0,t.jsx)("button",{type:"button",className:"relative inline-flex cursor-pointer items-center focus-visible:outline-none",onClick:()=>{A({fromPage:`${r.scene?"template -":""} queueing upgrade button`}),(0,k.reportEvent)("vip_price_modal_exposure",{from_page:`${r.scene?"template -":""} queueing upgrade button`}),(0,b.sendGAEvent)("event","subscription_exposure",{from_page:`${r.scene?"template -":""} queueing upgrade button`})},children:(0,t.jsx)(eW,{children:e})})})}):(0,t.jsx)("span",{className:"text-[#b3b6b8]",children:_("task.status.queue.vip")})]})]}),1===n&&(0,t.jsx)(D.CancelButton,{className:"absolute right-8 bottom-8 z-10 h-auto min-w-0 rounded-none border-0 bg-transparent p-0 font-normal text-system-white/40 text-xs leading-[1.4] enabled:hover:bg-transparent enabled:hover:text-system-white/60 disabled:text-system-white/30 sm:hidden",taskId:ee,onCancel:h})]})}case"processing":case"fetchingTaskDetail":{let e=(0,L.getEstimateTime)(J,Z,r.scene,V);
2return em({className:"gap-4 px-[12%] lg:px-[10%]",title:_("task.status.creating.title"),content:(0,t.jsx)(F,{hasFinished:"fetchingTaskDetail"===o,id:r.id,allWaitTime:e,stopProgress:95})})}default:return null}})()})},eQ=e=>{let{task:s,onOpenDetail:n,scrollToTop:r,isTemplates:o=!1}=e,c=(0,i.useTranslations)(),{updateCreation:d,isTeamSpace:v,clawPass:b}=(0,f.useStore)(e=>({updateCreation:e.updateCreation,isTeamSpace:e.isTeamSpace,clawPass:e.clawPass})),{open:j}=(0,g.useGlobalModal)("actionDialog"),{open:w}=(0,g.useGlobalModal)("postsModal"),{isMobile:E}=(0,x.useDevice)(),{isLgScreen:N}=(0,ek.useIsScreen)(),{taskState:C,hasFinished:M,canCancelTask:S,queueWaitTime:A,isWaitTimeProlonged:I,handleCancelTask:L,handleSelectedAction:P,handleRecreateAction:O}=(0,_.useTaskCard)({task:s,scrollToTop:r}),R=document.getElementById("taskHistoryContainer"),{input:F,type:U,id:V,created_at:em,settings:ep}=s,eh=s.creations??[],ex=ep?.sample_count??1,eg=F.prompts?.filter(e=>"image"===e.type||"material"===e.type||"video"===e.type||"audio"===e.type)||[],ef=(0,i.useFormatter)(),e_=new Date(em),eT=Intl.DateTimeFormat().resolvedOptions().timeZone,eb=("upscale"===U||"upscale_image"===U)&&s.origin_task_type?s.origin_task_type:U,ej="music_video"===eb?5:3,ew=function(e,t){let s="bg-[#8e8e8e] text-[#8e8e8e]",{valid_from:i,valid_to:a,claw_pass_plan_type:n}=t??{};return i&&a&&e.getTime()>=new Date(i).getTime()&&e.getTime()<=new Date(a).getTime()?"claw_pass_pro"===n?"bg-[#d7672a] text-[#d7672a]":"claw_pass_basic"===n?"bg-[#ba9d64] text-[#ba9d64]":s:s}(e_,b),eE=(0,a.useMemo)(()=>F.prompts?.find(e=>"text"===e.type&&!e.multi_frame?.range)?.content||"",[F.prompts,U]),eN=(0,a.useMemo)(()=>{let e=F.prompts?.filter(e=>"text"===e.type)||[];if("professional"===F.editor_mode){let t=e.map(e=>e.content)?.[0]||"";try{let e=JSON.parse(t);t=Object.entries(e).map(e=>{let[t,s]=e;return`${c(`create.proMode.${(0,ev.titleCaseToCamelCase)(t)}.title`)}: ${s}`}).join("\n")}catch{}return t}let t=e.filter(e=>e.multi_frame);return"multi_frame"===s.type&&t.length>0?t.map(e=>{let t=e.multi_frame,s="";return t?.range&&(s=c("create.img2VideoForm.transition.label",{from:t.range.from?t.range.from+1:1,to:t.range.to?t.range.to+1:2})),`${s} ${e.content}`}).join("; "):e.map(e=>e.content)?.[0]||""},[F,c]),eC=e=>{w({creation:{...e,task:s},mobileNextStep:E,onClose:t=>d(V,e.id,{is_asset:t})}),(0,k.reportEvent)("submit_click",{submit_position:"tools-submit"})},eM=e=>{j(e)},eS=(0,l.isImageTask)(s)?(0,T.getImageButtonConfig)({task:s,creation:eh[0],isLgScreen:N,type:"task"}):(0,T.getVideoButtonConfig)({task:s,creation:eh[0],isLgScreen:N,type:"task"}),eA=s.extra_params?.is_my_voice!==!0&&!(0,l.isAdmissionTemplateTask)(s);return(0,t.jsxs)("div",{className:"sm:rounded-12 sm:bg-system-bg04 sm:p-3",children:[!o&&(0,t.jsxs)("div",{className:"flex items-center sm:hidden",children:[(0,t.jsx)("div",{className:"size-7 rounded-full bg-system-white10 p-1",children:(e=>{switch(e){case"short_story":case"character2video":return(0,t.jsx)(et.ProductLineReference,{className:"size-5"});case"reference2image":return(0,t.jsx)(es.ProductLineReferenceToImage,{className:"size-5"});case"text2image":return(0,t.jsx)(en.ProductLineText2Image,{className:"size-5"});case"headtailimg2video":case"img2video":case"multi_frame":return(0,t.jsx)(J.ProductLineLoadingPic,{className:"size-5"});case"text2video":return(0,t.jsx)(ea.ProductLineText,{className:"size-5"});case"scene":return(0,t.jsx)(ei.ProductLineTemplates,{className:"size-5"});case"video2extail":case"video2extend":return(0,t.jsx)(q.BaseLineExtend,{className:"size-5"});case"image_edit":case"video_edit":return(0,t.jsx)($.BaseLineQuickEdit,{className:"size-5"});case"upscale":case"upscale_image":return(0,t.jsx)(G.BaseLineUpscale,{className:"size-5"});case"face_swap":return(0,t.jsx)(z.BaseLineFaceswap,{className:"size-5"});case"one_click":case"music_video":case"lip_sync":case"offline_avatar":return(0,t.jsx)(K,{className:"size-5"});case"remake":return(0,t.jsx)(Q,{className:"size-5"});case"style_transfer":return(0,t.jsx)(Y.BaseLineStyleTransfer,{className:"size-5"});case"motion_control":return(0,t.jsx)(H,{className:"size-5"});default:return null}})(U)}),(0,t.jsx)("p",{className:"ml-3 text-sm text-system-white opacity-90",children:c(`create.${h.TYPE_KEY_MAP[U]}`)}),(0,t.jsx)("div",{className:"ml-2 text-sm text-system-white36",children:ef.dateTime(e_,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",timeZone:eT})}),ep?.schedule_mode==="nopeak"&&(0,t.jsx)("span",{className:"scale-[.84] whitespace-nowrap rounded-6 bg-[#3EA3FF] bg-
2opacity-20 px-1 py-0.5 text-[#3EA3FF] text-xs",children:c("create.createForm.settings.nonPeakMode.title")}),ep?.schedule_mode==="claw_pass"&&(0,t.jsx)("span",{className:(0,y.cn)("scale-[.84] whitespace-nowrap rounded-6 bg-opacity-20 px-1 py-0.5 text-xs",ew),children:c("create.createForm.settings.clawPassMode.title")})]}),(0,t.jsxs)("div",{className:(0,y.cn)("mt-3 mb-4 ml-10 pr-3 text-sm text-system-white48 md:my-3 md:ml-0",1===ex&&"max-w-[800px]"),children:[(()=>{if(o){let e=[];return eg.forEach(t=>{t.src_imgs?.length&&t.src_imgs.length>1?(t.src_imgs||[]).forEach(t=>{e.push(t)}):e.push(t.content)}),(0,t.jsxs)("div",{className:(0,y.cn)("flex flex-1 items-end gap-1"),children:[e.map(e=>(0,t.jsx)(m.CustomTooltip,{content:(0,t.jsx)("img",{src:e,alt:"",loading:"lazy",decoding:"async",className:"max-h-[240px] max-w-full rounded-6 border border-system-white16 object-cover"}),children:(0,t.jsx)(el.ImageWithPlaceholder,{src:e,alt:"",className:"aspect-[3/4] w-10 rounded-6 border border-system-white16 object-cover"})},`${V}-tmpl-img-${e}`)),(0,t.jsx)("div",{className:"ml-1 flex h-5 items-center text-base text-white",children:s.extra_params?.template_type==="image"?(0,t.jsx)(ee.ProductLinePic,{}):(0,t.jsx)(X.ProductLineAiVideo,{})}),(0,t.jsx)("div",{className:"text-sm text-system-white",children:s.extra_params?.scene_name||s.scene}),(0,t.jsx)("div",{className:"ml-1 text-sm text-system-white36",children:ef.dateTime(e_,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",timeZone:eT})})]})}return(0,t.jsxs)("div",{className:"flex h-[40px] flex-1 items-center lg:h-9",children:[!(0,l.isExtendTask)(s?.type)&&eg?.length?(0,t.jsx)(ec.MediaPromptsDisplay,{className:"mr-3 h-full",prompts:eg,taskType:U,thumbnailClassName:"inline-block aspect-square h-full rounded-2 object-cover",collisionBoundary:R,collisionLeft:0,enableAudioPreviewDialog:!0}):null,(0,l.isExtendTask)(s?.type)&&s?.input.prompts?.length&&(0,t.jsx)(er.ExtendPromptsDisplay,{prompts:s?.input.prompts,className:"mr-3 h-full"}),(0,t.jsx)("div",{className:"relative flex h-full w-full flex-1 items-center",children:(0,t.jsxs)(m.CustomTooltip,{collisionBoundary:R,contentClassName:"overflow-y-auto max-h-[400px] [word-break:break-word]",collisionTop:52,showOnlyOnOverflow:!0,maxLines:2,content:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eu.TextWithTags,{text:eN,prompts:s.input.prompts}),(0,t.jsx)(ed.TaskSettingTags,{taskId:V,taskType:eb,settings:ep,sceneName:s.extra_params?.scene_name,showTaskType:!1})]}),sideOffset:8,side:"top",trigger:"auto",triggerClassName:"block w-full",children:[(0,t.jsx)(eu.TextWithTags,{text:eN,prompts:s.input.prompts}),(0,t.jsx)(ed.TaskSettingTags,{taskId:V,taskType:eb,settings:ep,sceneName:s.extra_params?.scene_name,showTaskType:!1,maxVisibleCount:ej,isHoverShowAll:!0,className:"items-bottom inline-flex select-none ps-2 align-bottom group-[.is-overflowing]:hidden"}),(0,t.jsxs)("div",{className:"lg:-bottom-0.5 pointer-events-none absolute right-0 bottom-0 flex h-[22px] opacity-0 transition-opacity duration-200 group-[.is-overflowing]:opacity-100",children:[(0,t.jsx)("div",{className:"h-full w-4 bg-gradient-to-l from-[#1A1C20] to-transparent opacity-0 transition-opacity duration-200 group-[.is-overflowing]:opacity-100"}),(0,t.jsx)(ed.TaskSettingTags,{taskId:V,taskType:eb,settings:ep,sceneName:s.extra_params?.scene_name,showTaskType:!1,maxVisibleCount:ej,className:"items-bottom inline-flex h-full select-none bg-[#1A1C20] align-bottom"})]})]})})]})})(),(s.stage_results??[]).length>0&&(0,t.jsx)("div",{className:"mt-4 grid grid-cols-2 gap-1",children:(s.stage_results??[]).map(e=>(0,t.jsx)(el.ImageWithPlaceholder,{src:e.uri??"",alt:"stage result",className:"h-20",fullScreen:!0},e.uri))})]}),(0,t.jsxs)("div",{className:(0,y.cn)("ml-10 md:mr-0 md:ml-0 md:max-w-full lg:mr-10",1===ex&&"max-w-[800px]"),children:[(0,t.jsx)("div",{className:(0,y.cn)("grid gap-2",ex>1&&"grid-cols-2 md:grid-cols-1"),children:Array(ex).fill(0).map((e,i)=>(0,t.jsx)(eG,{creation:eh[i],creationsLength:ex,task:s,taskState:C,queueWaitTime:A,isWaitTimeProlonged:I,onOpenActionDialog:eM,onOpenDetail:n,onCancelTask:L,onSubmit:eC},eh[i]?.id||i))}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between sm:flex-row-reverse lg:mt-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.isImageTask)(s)&&1===ex&&M&&eh[0]&&!eh[0]?.err_info?.err_code&&(0,t.jsx)(eo.ImageApplyButton,{noMarkUri:eh[0].nomark_uri||"",uri:eh[0].uri||"",onApplyToTool:e=>{(0,k.reportEvent)("apply_click",{apply_type:e,apply_position:"create_task_card"})}
2,backfillTextPrompt:eE,container:R,creationId:eh[0].id||"",showFlyTrace:!0,content:(0,t.jsxs)(p.Button,{className:"h-8 gap-1 rounded-8 bg-system-bg02 px-3 font-normal enabled:hover:bg-system-hover01",children:[(0,t.jsx)(Z.ProductLineApply1,{className:"text-base sm:hidden"}),c("task.action.continueCreate")]})}),eh[0]?.type==="video"&&1===ex&&M&&!eh[0]?.err_info?.err_code&&(0,t.jsx)(ey,{creation:eh[0],container:R,titleText:c("task.action.continueCreate"),content:(0,t.jsxs)(p.Button,{className:"h-8 gap-1 rounded-8 bg-system-bg02 px-3 font-normal enabled:hover:bg-system-hover01",children:[(0,t.jsx)(Z.ProductLineApply1,{className:"text-base sm:hidden"}),c("task.action.continueCreate")]})}),!(0,l.isNoRecreateTask)(U)&&!(0,l.isRecreateModelVersionUnavailable)(U,ep?.model_version)&&!(0,l.isAdmissionTemplateTask)(s)&&(0,t.jsx)(p.Button,{className:"h-8 gap-2 rounded-8 bg-system-bg02 px-3 font-normal enabled:hover:bg-system-hover01 disabled:text-system-white24",onClick:O,icon:(0,t.jsx)(u.BaseLineRecreate,{className:"text-base sm:hidden"}),children:c("task.action.recreate")}),ex>1&&S&&(0,t.jsx)(D.CancelButton,{className:"bg-system-bg02 enabled:hover:bg-system-hover01 disabled:text-system-white24 sm:hidden",taskId:V,onCancel:L}),!v&&eA&&!(0,l.isPostDisabledModelVersion)(ep?.model_version)&&"success"===C&&1===ex&&!eh[0]?.err_info?.err_code&&(0,t.jsx)(p.Button,{className:"h-8 gap-2 rounded-8 bg-system-bg02 px-3 font-normal enabled:hover:bg-system-hover01 disabled:text-white/40 lg:hidden",icon:(0,t.jsx)(W.BaseLineSubmit3,{className:(0,y.cn)("text-base text-system-white",eh[0]?.is_asset&&"text-system-white opacity-[.40]")}),disabled:!M||eh[0]?.is_asset,onClick:()=>eh[0]&&eC(eh[0]),children:c(eh[0]?.is_asset?"task.action.submitted":"task.action.submit")})]}),((0,T.isFailedOrCanceledTask)(s)||1===ex)&&(0,t.jsx)("div",{className:"rounded-8 bg-system-bg02",children:(0,t.jsx)("div",{className:"flex h-full items-center aria-disabled:pointer-events-none aria-disabled:opacity-[.24] aria-disabled:sm:hidden","aria-disabled":!M,children:(0,t.jsx)(B.CreationActionButtons,{creation:eh[0],task:s,showActionList:eS,onSubmit:eC,onSelectedAction:P})})}),S&&(0,t.jsx)(D.CancelButton,{className:"hidden bg-system-bg02 enabled:hover:bg-system-hover01 disabled:text-system-white24 sm:flex",taskId:V,onCancel:L})]})]})]},V)},eX=(0,a.memo)(e=>{let{task:s,onOpenDetail:i,scrollToTop:a,isTemplates:n=!1}=e;return(0,l.isAudioTask)(s.type)?(0,t.jsx)(V,{task:s,onOpenDetail:i,scrollToTop:a}):(0,t.jsx)(eQ,{task:s,onOpenDetail:i,scrollToTop:a,isTemplates:n})});eX.displayName="TaskCard";var eZ=e.i(975950);let eJ=e=>{let{width:s="440",height:i="1",stopColor:a="white"}=e;return(0,t.jsxs)("svg",{width:s,height:i,viewBox:"0 0 440 1",preserveAspectRatio:"none",fill:"none",role:"presentation",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M0 1V0L440 0.666667L0 1Z",fill:"url(#paint0_linear_872_59152)"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"paint0_linear_872_59152",x1:"0",y1:"0.5",x2:"440",y2:"0.5",gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{stopColor:"currentColor"}),(0,t.jsx)("stop",{offset:"0.68",stopColor:a,stopOpacity:"0"})]})})]})},e0=e=>{let{children:s,className:i}=e;return(0,t.jsxs)("div",{className:(0,y.cn)("flex items-center justify-center text-[rgba(255,255,255,.45)]",i),children:[(0,t.jsx)("div",{className:"rotate-180",children:(0,t.jsx)(eJ,{width:"100%"})}),s,(0,t.jsx)("div",{children:(0,t.jsx)(eJ,{width:"100%"})})]})};var e1=e.i(158680),e2=e.i(535113),e5=e.i(837082),e8=e.i(398436),e3=e.i(265154);let e4="VIDU_UPGRADE_BANNER_DISMISSED",e7=e=>{let{className:s}=e,n=(0,i.useTranslations)(),r=(0,f.useStore)(e=>e.userInfo),{freeCreditsTasks:o,fetchFreeCreditTasks:l}=(0,e8.useFreeCreditsTasks)(),{open:c}=(0,g.useGlobalModal)("taskCenterDrawer"),{open:d}=(0,g.useGlobalModal)("planDetailDialog"),[u,m]=(0,a.useState)(()=>"1"===e3.safeStorage.getItem(e4));(0,a.useEffect)(()=>{r&&0===o.length&&l()},[r,o.length,l]);let p=(0,a.useMemo)(()=>o.some(e=>e.name===h.NormalFreeCreditsTaskName.mission_watch_ad_credit),[o]);return r?.subs_plan!=="free"||u?null:(0,t.jsxs)("div",{className:(0,y.cn)("flex w-full items-center gap-3 overflow-clip rounded-t-12 px-8 py-3 backdrop-blur-[6px]","bg-[linear-gradient(90deg,rgba(224,221,255,0.12)_0%,rgba(148,216,255,0.12)_100%)]",s),children:[(0,t.jsx)("span",{className:"min-w-0 truncate font-normal text-base text-system-white",children:n(p?"upgradeBanner.adRegion":"upgradeBanner.default")}),(0,t.jsx)("button",{type:"button",onClick:()=>
2{if(p){(0,k.reportEvent)("element_click",{element_name:"upgrade_banner_ad",from_page:"task_history"}),c({fromPage:"create_page_banner"});return}(0,k.reportEvent)("vip_price_exposure",{from_page:"task_history_banner"}),d({fromPage:"task_history_banner"})},className:"shrink-0 bg-ShengshuButton bg-clip-text font-semibold text-base text-transparent transition-opacity hover:opacity-80",children:n(p?"upgradeBanner.adRegionAction":"upgradeBanner.defaultAction")}),(0,t.jsx)("button",{type:"button",onClick:()=>{e3.safeStorage.setItem(e4,"1"),m(!0),(0,k.reportEvent)("element_click",{element_name:"upgrade_banner_close",from_page:"task_history"})},"aria-label":n("payments.payResult.close"),className:"ml-auto shrink-0 text-system-white opacity-60 transition-opacity hover:opacity-100",children:(0,t.jsx)(ej.BaseLineClose,{className:"text-xl"})})]})};var e6=e.i(572842),e9=e.i(784797),te=e.i(155442),tt=e.i(524743),ts=e.i(792339),ti=e.i(511064);e.i(889040);var ta=e.i(216409),tn=e.i(788723);let tr=new Set(["CreationPolicyViolation","failed","AuditSubmitIllegal"]),to={contentKey:"task.status.auditVideoFailed.content",icon:"fail",titleKey:"task.status.auditVideoFailed.title"},tl={contentKey:"task.status.canceled.content",icon:"none",titleKey:"task.status.canceled.title"},tc={icon:"none",loading:"processing",titleKey:"task.status.creating.title"}
2,td={contentKey:"task.status.empty.content",icon:"none",titleKey:"task.status.empty.title"},tu={contentKey:"task.status.otherFailed.content",icon:"fail",titleKey:"task.status.otherFailed.title"},tm={icon:"none",loading:"queueing",titleKey:"task.status.queue.title"},tp=e=>void 0!==e&&tr.has(e),th=e=>{let{creation:t,task:s,taskState:i=s.state}=e,a="created"===i||"queueing"===i||"preparation"===i||"scheduling"===i?"queueing":"unspecified"===i?"failed":i;if("queueing"===a)return tm;if("processing"===a||"fetchingTaskDetail"===a)return tc;if("canceled"===a)return tl;if("failed"===a)return tp(s.err_code)?to:tu;let n=t?.err_info?.err_code;return n?tp(n)?to:tu:"success"!==a||t?null:td};e.s(["getCompactTaskHistoryStateMessage",0,th],42970);let tx=e=>{let{task:s,onOpenDetail:a,onCompactCreationSelect:n,onCompactTaskSelect:r,failedStateTitle:o}=e,l=(0,i.useTranslations)(),{taskState:c}=(0,tn.useTaskState)(s),d=s.creations?.[0],u=d?.cover_uri||d?.nomark_uri||d?.uri,p=th({creation:d,task:s,taskState:c}),h=p?"task.status.otherFailed.title"===p.titleKey&&o?o:l(p.titleKey):"",x=!!(d||p),g=(0,t.jsx)("button",{type:"button",disabled:!x,onClick:()=>{if(p){let e=d?{...d,task:s}:void 0;return r?void r(s,e,c):void(e&&n&&n(e))}if(!d)return;let e={...d,task:s};n?n(e):a(e)},className:"group relative mx-auto block aspect-square w-full overflow-hidden rounded-12 bg-system-white04 text-left transition-colors hover:bg-system-white08 disabled:cursor-default sm:size-[112px]",children:p?(0,t.jsxs)("span",{className:"relative flex size-full items-center justify-center text-system-white32",children:["queueing"===p.loading?(0,t.jsx)(eK,{}):null,"processing"===p.loading?(0,t.jsx)(E.Loading,{className:"relative z-10 size-5 animate-spin"}):null,(0,t.jsx)("span",{className:"relative z-10 line-clamp-2 px-1.5 text-center text-[10px] text-system-white64 leading-[1.25]",children:h})]}):u?(0,t.jsx)("img",{src:u,alt:"",className:"size-full object-cover transition-transform duration-300 group-hover:scale-[1.03]"}):(0,t.jsx)("span",{className:"flex size-full items-center justify-center text-system-white32",children:(0,t.jsx)("span",{className:"size-2 rounded-full bg-system-white24"})})});return p?(0,t.jsx)(m.CustomTooltip,{content:h,trigger:"hover",children:g}):g},tg=e=>{let{label:s,className:i}=e;return(0,t.jsx)("div",{className:(0,y.cn)("flex h-full min-h-20 w-full items-center justify-center rounded-10 px-2 text-center text-system-white48 text-xs",i),children:s})},tf=["img2video","character2video","text2video","reference2image","text2image","image_edit","video_edit","upscale","extend","headtailimg2video","multi_frame","controlnet","material2video","video2extend","video2extail","face_swap","upscale_image","one_click","music_video","lip_sync","offline_avatar","remake","short_story","style_transfer","motion_control"],ty=["scene","upscale"],tk=["text2audio"],tv=["tts"],t_="flex h-8 shrink-0 items-center gap-2 rounded-8 bg-system-white10 px-3 text-sm transition-colors cursor-pointer";e.s(["TaskHistory",0,e=>{let{text2audio:o=!1,ttsOnly:l=!1,className:c,align:d="left",showOngoingFilter:u=!0,showUpgradeBanner:p=!0,title:x,showTaskTypeFilter:v=!0,processingFilterClassName:_,isTemplates:T=!1,scrollableTargetId:b,allLoadedClassName:j,defaultTaskTypeKeys:w=[],tutorialEmptyState:N=null,compact:M=!1,onCompactCreationSelect:S,onCompactTaskSelect:A,compactFailedStateTitle:I}=e,{taskList:L,cachedTaskListInitSource:P,cachedTaskListQueryKey:D,cachedTaskListNextPageToken:B,cachedTaskListUserId:O,initTaskList:R,updateCreation:F,appendTaskList:U,userInfo:V,isUserInfoInitialized:q,syncCreationDetailConfig:z}=(0,f.useStore)(e=>({taskList:e.taskList,cachedTaskListInitSource:e.taskListInitSource,cachedTaskListQueryKey:e.taskListQueryKey,cachedTaskListNextPageToken:e.taskListNextPageToken,cachedTaskListUserId:e.taskListUserId,initTaskList:e.initTaskList,updateCreation:e.updateCreation,appendTaskList:e.appendTaskList,userInfo:e.userInfo,isUserInfoInitialized:e.isUserInfoInitialized,syncCreationDetailConfig:e.syncCreationDetailConfig})),H=(0,f.useStoreApi)(),K=(0,a.useMemo)(()=>L.map(e=>e?.type!=="text2audio"&&e?.type!=="tts"?e:{...e,creations:"success"===e.state?(e.creations??[]).map(e=>({...e,audio_image:te.TEXT_2_AUDIO_IMAGE[(0,ti.getAudioImageIndex)(e.id,te.TEXT_2_AUDIO_IMAGE.length)]})):e.creations}),[L]),$=(0,i.useTranslations)(),Y=(0,eg.usePathname)(),W=(0,eg.useRouter)(),{open:G}=(0,g.useGlobalModal)("loginDialog"),{isSmScreen:Q}=(0,ek.useIsScreen)(),X=(0,eg.useLocale)(),Z=(0,a.useRef)(void 0),[J,ee]=(0,a.useState)(!!V),[et,es]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(!1),[en,er]=(0,a.useState)(null),[eo,el]=(0,a.useState)(null),ec=(0,a.useId)(),ed="china"===C.SITE?"https://image01-aliyun.vidu.zone/vidu/media-asset/templates-empty-zh-9a1ab1fe.webp":"zh"===X?"https://image01.cf.vidu.studio/vidu/media-asset/templates-empty-zh-9a1ab1fe.webp":"https://image01.cf.vidu.studio/vidu/media-asset/templates-empty-en-df564106.webp";(0,a.useEffect)(()=>{el(document.getElementById("floating-buttons-container"))},[]);let[eu,em]=(0,a.useMemo)(()=>o?[tk,"text2audio"]:l?[tv,"tts"]:T?[ty,"template"]:[tf,"create"],[T,o,l]),ep=(0,a.useMemo)(()=>[{key:"character2video",label:$(`create.${h.TYPE_KEY_MAP.character2video}`),queryTypes:["character2video"]},{key:"img2video",label:$(`create.${h.TYPE_KEY_MAP.img2video}`),queryTypes:["img2video","headtailimg2video","multi_frame"]},{key:"text2video",label:$(`create.${h.TYPE_KEY_MAP.text2video}`),queryTypes:["text2video"]},{key:"reference2image",label:$(`create.${h.TYPE_KEY_MAP.reference2image}`),queryTypes:["reference2image"]},{key:"text2image",label:$(`create.${h.TYPE_KEY_MAP.text2image}`),queryTypes:["text2image"]},{key:"image_edit",label:$("task.action.imageEdit"),queryTypes:["image_edit"]},{key:"video_edit",label:$("task.action.videoEdit"),queryTypes:["video_edit"]},{key:"scene",label:$(`create.${h.TYPE_KEY_MAP.scene}`),queryTypes:["scene"]}
2,{key:"text2audio",label:$(`create.${h.TYPE_KEY_MAP.text2audio}`),queryTypes:["text2audio"]},{key:"upscale",label:$(`create.${h.TYPE_KEY_MAP.upscale}`),queryTypes:["upscale"]},{key:"extend",label:$(`create.${h.TYPE_KEY_MAP.video2extend}`),queryTypes:["extend","video2extend","video2extail"]},{key:"face_swap",label:$(`create.${h.TYPE_KEY_MAP.face_swap}`),queryTypes:["face_swap"]},{key:"upscale_image",label:$(`create.${h.TYPE_KEY_MAP.upscale_image}`),queryTypes:["upscale_image"]},{key:"one_click",label:$(`create.${h.TYPE_KEY_MAP.one_click}`),queryTypes:["one_click"]},{key:"music_video",label:$(`create.${h.TYPE_KEY_MAP.music_video}`),queryTypes:["music_video"]},{key:"lip_sync",label:$(`create.${h.TYPE_KEY_MAP.lip_sync}`),queryTypes:["lip_sync"]},{key:"offline_avatar",label:$(`create.${h.TYPE_KEY_MAP.offline_avatar}`),queryTypes:["offline_avatar"]},{key:"remake",label:$(`create.${h.TYPE_KEY_MAP.remake}`),queryTypes:["remake"]},{key:"short_story",label:$(`create.${h.TYPE_KEY_MAP.short_story}`),queryTypes:["short_story"]},{key:"style_transfer",label:$(`create.${h.TYPE_KEY_MAP.style_transfer}`),queryTypes:["style_transfer"]},{key:"motion_control",label:$(`create.${h.TYPE_KEY_MAP.motion_control}`),queryTypes:["motion_control"]}].filter(e=>e.queryTypes.some(e=>eu.includes(e))),[eu,$]),eh=(0,a.useMemo)(()=>o||T||l?[]:w,[w,T,o,l]),ex=en??eh,ef=(0,a.useMemo)(()=>0===ex.length?eu:Array.from(new Set(ep.filter(e=>ex.includes(e.key)).flatMap(e=>e.queryTypes).filter(e=>eu.includes(e)))),[ex,eu,ep]),ey=(0,a.useMemo)(()=>ep.filter(e=>ex.includes(e.key)).map(e=>e.label),[ex,ep]),ev=ey.length?ey.join(", "):$("creations.filters.labels.taskType"),e_=()=>eC&&N?"steps"===N.type?(0,t.jsxs)("div",{className:"w-full min-w-0 max-w-[792px] sm:max-w-full",children:[(0,t.jsx)("div",{className:"mb-10 px-4 text-center font-semibold text-[32px] text-system-white leading-[1.4] sm:mb-5 sm:px-0 sm:text-xl",children:$(N.messageKey)}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-6 sm:grid-cols-1 sm:gap-4",children:N.steps.map(e=>(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-4 text-left sm:gap-3 sm:p-3",children:[(0,t.jsx)("div",{className:"aspect-[4/3] overflow-hidden rounded-[16px] sm:aspect-[240/180]",children:(0,t.jsx)("img",{src:e.imageSrc,alt:"guide",className:"size-full rounded-[20px] bg-system-white04 object-cover"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,t.jsx)("div",{className:"text-sm text-system-white leading-[1.4]",children:$(e.titleKey)}),(0,t.jsx)("div",{className:"text-system-white64 text-xs leading-[1.4]",children:$(e.descriptionKey)})]})]},e.titleKey))})]}):"video"===N.type?(0,t.jsxs)("div",{className:"w-full min-w-0 max-w-[792px] sm:max-w-full",children:[(0,t.jsx)("div",{className:"mb-4 px-4 font-semibold text-lg text-system-white sm:px-0 sm:text-base",children:$(N.messageKey)}),(0,t.jsx)("video",{src:N.media.src,poster:N.media.posterSrc,className:"aspect-video w-full rounded-[20px] object-cover sm:rounded-[16px]",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,controls:!0})]}):(0,t.jsxs)("div",{className:"w-full min-w-0 max-w-[792px] sm:max-w-full",children:[(0,t.jsx)("div",{className:"mb-4 px-4 font-semibold text-lg text-system-white sm:px-0 sm:text-base",children:$(N.messageKey)}),(0,t.jsx)("img",{src:N.media.src,className:"w-full rounded-[20px] object-cover sm:rounded-[16px]",alt:"guide"})]}):null,{processingTaskCount:eT}=(0,tt.useProcessingCount)(ef),eb=(0,a.useMemo)(()=>JSON.stringify({sceneMode:T?"all":"none",states:ei?tt.PROCESSING_TASK_STATES:[],types:ef,source:em}),[em,ef,ei,T]),{loading:ej,run:ew,refresh:eE}=(0,ts.useFetch)(e=>(0,ta.tasksGetMyTaskHistory)({query:{"pager.page_token":e?Z.current:void 0,"pager.pagesz":20,scene_mode:T?"all":"none",states:ei?tt.PROCESSING_TASK_STATES:[],types:ef}}),{manual:!0,onSuccess:(e,t)=>{let{data:s,error:i}=e,[a]=t;if(ee(!1),i){a||es(!0);return}es(!1),s&&(a?U(s.tasks,s.next_page_token):R(s.tasks,em,{queryKey:eb,userId:V?.id,nextPageToken:s.next_page_token}),Z.current=s.next_page_token)}}),eN=!!Z.current,eC=!Q&&!!N&&(!V||!ej&&!J&&!K.length),eM=(0,a.useRef)(!1),eS=(0,a.useRef)(void 0),eA=(0,a.useRef)(!1),eI=(0,a.useCallback)(e=>e.filter(e=>"success"===e.state).flatMap(e=>(e.creations??[]).map(e=>({id:e.id,cover_uri:"audio"===e.type?te.TEXT_2_AUDIO_IMAGE[(0,ti.getAudioImageIndex)(e.id,te.TEXT_2_AUDIO_IMAGE.length)].cover[C.SITE]:e.cover_uri,is_favor:e.is_favor,origin_task_type:e.origin_task_type}))).filter(e=>!!e.id),[]),eL=(0,a.useCallback)(()=>({handleCollect:e=>{let{id:t,obj_type:s}=e;if("creation"!==s)return;let i=H.getState().taskList.find(e=>e.creations?.some(e=>e.id===t));i?.id&&F(i.id,t,{is_favor:!0})},handleUnCollect:e=>{let{id:t,obj_type:s}=e;if("creation"!==s)return;let i=H.getState().taskList.find(e=>e.creations?.some(e=>e.id===t));i?.id&&F(i.id,t,{is_favor:!1})},handleVote:e=>{let{id:t,obj_type:s,voteType:i}=e;if("creation"!==s||!i)return;let a=H.getState().taskList.find(e=>e.creations?.some(e=>e.id===t));a?.id&&F(a.id,t,{vote:i})},handleUnVote:e=>{let{id:t,obj_type:s}=e;if("creation"!==s)return;let i=H.getState().taskList.find(e=>e.creations?.some(e=>e.id===t));i?.id&&F(i.id,t,{vote:"unspecified"})}}),[H,F]),eP=(0,a.useCallback)(async()=>
2{if(eA.current||!eM.current||!eS.current)return;eA.current=!0;let{data:e,error:t}=await (0,ta.tasksGetMyTaskHistory)({query:{"pager.page_token":eS.current,"pager.pagesz":20,scene_mode:T?"all":"none",states:ei?tt.PROCESSING_TASK_STATES:[],types:ef}});if(eA.current=!1,t||!e)return;let s=eI(e.tasks??[]);eS.current=e.next_page_token,eM.current=!!e.next_page_token;let i=H.getState().creationDetailConfig?.thumbScrollListConfig,a=i?.list??[],n=[...a],r=new Set(a.map(e=>"id"in e?e.id:"").filter(Boolean));s.forEach(e=>{r.has(e.id)||(r.add(e.id),n.push(e))}),z({openInNewTab:!1,thumbScrollListConfig:{list:n,hasMore:eM.current,onLoadMore:eP,onThumbnailClick:e=>{W.push(`/creation-detail/${e}`)}},...eL(),onClose:()=>W.back()})},[ef,T,ei,eI,H,z,W,eL]),eD=(0,a.useRef)(null),eB=(0,a.useCallback)(e=>{if(eD.current=e,!e)return;let t=e.getElementsByClassName("infinite-scroll-component");t.length>0?t[0].style.overflow="visible":console.warn('Element with class "infinite-scroll-component" not found')},[]),eO=(0,a.useRef)(K[0]?.id),eR=(0,a.useCallback)(()=>Q&&b?document.getElementById(b):eD.current,[Q,b]),eF=(0,s.useVirtualizer)({count:K.length,getScrollElement:eR,estimateSize:()=>M?124:Q?400:600,overscan:Q?5:2,getItemKey:e=>K[e]?.id??e}),eU=(0,a.useCallback)(()=>{let e=eI(K);eS.current=Z.current||void 0,eM.current=!!eS.current,z({openInNewTab:!1,thumbScrollListConfig:{list:e,hasMore:eM.current,onLoadMore:eP,onThumbnailClick:e=>{W.push(`/creation-detail/${e}`)}},...eL(),onClose:()=>W.back()})},[eI,K,eP,W,z,eL]);(0,a.useEffect)(()=>{if(!q)return void ee(!0);if(!V){ee(!1),es(!1),R([],em,{queryKey:eb,nextPageToken:void 0}),Z.current=void 0;return}if(P===em&&D===eb&&O===V.id){ee(!1),es(!1),Z.current=B;return}ee(!0),ew(!1)},[P,B,D,O,em,eb,ew,R,q,V]),(0,a.useEffect)(()=>{er(null)},[eh]),(0,a.useEffect)(()=>{ei&&eE()},[eT]),(0,a.useEffect)(()=>{if(!Q){if(K.length>1&&eO.current===K[1]?.id){let e=eR();if(e?.scrollTop){let t=eF.getVirtualItems()[0]?.size??0;e.scrollTop+=t}}eO.current=K[0]?.id}},[K.length,eF,eR]);let eV=(0,a.useCallback)(e=>{e?.id&&(eU(),W.push(`/creation-detail/${e.id}`))},[W,eU]),eq=p&&(0,t.jsx)(e7,{}),ez=u&&(0,t.jsx)("div",{className:(0,y.cn)("sticky top-0 left-0 z-10 w-full bg-[#1A1C20]",!_&&"sm:static sm:bg-transparent",_),children:(0,t.jsxs)("div",{className:"mt-2 flex w-full flex-wrap items-center gap-2 py-2 pb-4",children:[x?(0,t.jsx)("h2",{className:"mr-auto font-semibold text-base text-system-white",children:x}):null,(0,t.jsxs)("div",{className:(0,y.cn)(t_,ei&&"bg-system-white24"),onClick:()=>{ea(!ei)},children:[(0,t.jsx)(e6.CheckboxFill,{checked:ei,className:"text-base"}),(0,t.jsx)("span",{children:$("task.filterProcessing")}),eT>0&&(0,t.jsx)("span",{className:"inline-flex h-[18px] min-w-[18px] shrink-0 items-center justify-center rounded-full bg-system-blue02 px-1 text-center text-system-white text-xs leading-none",children:eT})]}),v&&ep.length>1&&(0,t.jsxs)(e9.DropdownMenu,{children:[(0,t.jsx)(e9.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",className:(0,y.cn)(t_,"max-w-[128px]",ex.length>0&&"bg-system-white24"),children:[(0,t.jsx)(m.CustomTooltip,{content:ev,showOnlyOnOverflow:!0,maxLines:1,children:(0,t.jsx)("span",{children:ev})}),(0,t.jsx)(eZ.ChevronDown,{className:"shrink-0 text-base"})]})}),(0,t.jsxs)(e9.DropdownMenuContent,{align:"start",className:"max-h-[calc(100vh-300px)] space-y-1 overflow-y-auto border border-system-white12 bg-[#1A1A1A]",children:[(0,t.jsx)(e9.DropdownMenuCheckboxItem,{checked:0===ex.length,onSelect:e=>e.preventDefault(),onClick:()=>{er([])},children:$("creations.filters.all")}),ep.map(e=>(0,t.jsx)(e9.DropdownMenuCheckboxItem,{checked:ex.includes(e.key),onSelect:e=>e.preventDefault(),onClick:()=>{er(ex.includes(e.key)?ex.filter(t=>t!==e.key):[...ex,e.key])},children:e.label},e.key))]})]})]})}),eH=()=>{let e=eR();e&&(e.scrollTop=0,e!==document.documentElement&&(document.documentElement.scrollTop=0))};if(!q)return(0,t.jsxs)("div",{className:(0,y.cn)("relative flex h-full w-full flex-1 flex-col items-center rounded-12 bg-[#1A1C20] pr-6 pl-4 sm:h-auto sm:min-h-[152px] sm:bg-transparent sm:pr-0 sm:pl-0",c),children:[ez,(0,t.jsx)(e2.GlobalLoader,{className:"top-1/2"})]});if(!V)return M?(0,t.jsx)(tg,{label:$("task.loginToViewHistory"),className:c}):eC?(0,t.jsx)("div",{className:(0,y.cn)("relative flex h-full w-full flex-1 flex-col items-center justify-center rounded-12 bg-[#1A1C20] px-4 py-6 text-center sm:hidden sm:min-h-[152px] sm:items-stretch sm:justify-start sm:bg-transparent sm:px-0",c),children:e_()}):(0,t.jsxs)("div",{className:(0,y.cn)("relative flex h-full w-full flex-1 flex-col items-center justify-center rounded-12 bg-[#1A1C20] px-6 text-center sm:hidden sm:min-h-[152px] sm:bg-transparent sm:px-0",c),children:[(0,t.jsx)("div",{className:"font-semibold text-lg text-system-white",children:$("loginGuideDialog.title")}),(0,t.jsx)("div",{className:"mt-2 max-w-[280px] text-sm text-system-white64",children:$("loginGuideDialog.description")}),(0,t.jsx)("button",{type:"button",className:"mt-5 h-10 rounded-full bg-ShengshuButton px-6 font-semibold text-black hover:bg-ShengshuButtonHover",onClick:()=>{G(),(0,k.reportEvent)("login_pop_exposure",{refer_element:"task-
2history-login-guide",refer_page:Y})},children:$("header.navLogin")})]});if(ej&&!Z.current||J||et||!K.length)return(0,t.jsxs)("div",{className:(0,y.cn)("relative flex h-full w-full flex-1 flex-col rounded-12 bg-[#1A1C20] sm:h-auto sm:min-h-[152px] sm:bg-transparent",c),children:[eq,(0,t.jsx)("div",{className:"flex min-h-0 w-full flex-1 flex-col items-center pr-6 pl-4 sm:pr-0 sm:pl-0",children:ej||J?(0,t.jsxs)(t.Fragment,{children:[ez,(0,t.jsx)(e2.GlobalLoader,{className:"top-1/2"})]}):et?(0,t.jsx)("span",{className:"w-full text-center text-system-white64",children:$("loadError")}):(0,t.jsxs)(t.Fragment,{children:[ez,T?(0,t.jsx)("div",{className:"flex h-full flex-col items-center justify-center pb-12",children:(0,t.jsx)("img",{src:ed,alt:"",className:"w-[658px]"})}):eC&&!ei?(0,t.jsx)("div",{className:"flex h-full w-full min-w-0 flex-col items-center justify-center py-6 text-center sm:h-auto sm:items-stretch sm:py-4",children:e_()}):M?(0,t.jsx)("span",{className:"flex h-full items-center justify-center","aria-hidden":"true"}):(0,t.jsx)(e1.Empty,{emptyText:ei?$("task.processingEmpty"):$("task.empty")})]})})]});let eK=eF.getVirtualItems();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{id:"taskHistoryContainer",className:(0,y.cn)("relative flex h-full flex-1 flex-col rounded-12 bg-[#1A1C20] sm:h-fit sm:w-full sm:bg-transparent",c),children:[eq,(0,t.jsxs)("div",{id:ec,ref:eB,className:(0,y.cn)("min-h-0 flex-1 overflow-y-auto sm:overflow-y-visible sm:pr-0 sm:pl-0","left"===d&&!M&&"pr-6 pl-4"),children:[ez,(0,t.jsx)(r.default,{dataLength:K.length,next:()=>ew(!0),hasMore:eN&&!ej&&!et,loader:null,scrollThreshold:.95,scrollableTarget:Q?b:ec,children:(0,t.jsx)("div",{className:"relative w-full",style:{height:eF.getTotalSize()},children:(0,t.jsxs)("div",{className:(0,y.cn)("absolute top-0 w-full space-y-9 sm:space-y-4","left"===d&&"left-0 max-w-[1648px]","center"===d&&"left-1/2 max-w-[840px]"),style:{transform:"center"===d?`translateY(${eK[0]?.start??0}px) translateX(-50%)`:`translateY(${eK[0]?.start??0}px)`},children:[eK.map(e=>{let s=K[e.index];return(0,t.jsx)("div",{"data-index":e.index,ref:eF.measureElement,children:M?(0,t.jsx)(tx,{task:s,onOpenDetail:eV,onCompactCreationSelect:S,onCompactTaskSelect:A,failedStateTitle:I}):(0,t.jsx)(eX,{isTemplates:T,task:s,onOpenDetail:eV,scrollToTop:Q?eH:void 0},s.id)},e.key)}),ej&&(0,t.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,t.jsx)(E.Loading,{className:"animate-spin"})}),!eN&&K.length>0&&!ej&&!et&&(0,t.jsx)(e0,{className:(0,y.cn)("w-full select-none gap-1 whitespace-nowrap pb-[72px] text-system-blue02 group-hover:text-system-blue02 sm:pb-9",M&&"hidden",j),children:(0,t.jsx)("span",{children:$("task.allLoaded")})})]})})})]})]}),!M&&K.length&&eo?(0,n.createPortal)((0,t.jsx)(e5.default,{scrollDiv:eR(),topText:Q?"":$("task.toTop")}),eo):null]})}],191036)}]);
3
4//# debugId=ad36300b-e957-c024-2100-862398c54798
5//# sourceMappingURL=0crt8ww3m1txb.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.