@acedatacloud/nexior 3.320.1 → 3.320.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ApiCodeButton-wEJZV72l.js → ApiCodeButton-B70yUVoU.js} +1 -1
- package/dist/assets/{Artifacts-ogXI2c6N.js → Artifacts-9k1-UtWx.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-Dm9b3X8j.js → AskUserQuestionCard-C9-Jb_fp.js} +1 -1
- package/dist/assets/{Auth-CnEKPR6y.js → Auth-P9k2hWWU.js} +1 -1
- package/dist/assets/{Bare-nyzVVoNI.js → Bare-B6SIjEp_.js} +1 -1
- package/dist/assets/{BotPlaceholder-ChvD1MjR.js → BotPlaceholder-DadzfRCY.js} +1 -1
- package/dist/assets/{BottomFooter-BmfTphHS.js → BottomFooter-DuJCGnkg.js} +1 -1
- package/dist/assets/{Callback-BlVcgT8t.js → Callback-sREW6ayd.js} +1 -1
- package/dist/assets/{CodeSnippet-T9wePzna.js → CodeSnippet-BpOHY5w7.js} +1 -1
- package/dist/assets/{Console-BYx2zupf.js → Console-bEquErqU.js} +1 -1
- package/dist/assets/Consumption-tsEBkXA_.js +1 -0
- package/dist/assets/{Conversation-DR_KGRkG.js → Conversation-C0LgOwHe.js} +1 -1
- package/dist/assets/{Conversation-CZEK4bUq.js → Conversation-Db6jHt35.js} +1 -1
- package/dist/assets/{CopyToClipboard-rM37oGeG.js → CopyToClipboard-DyeZXE6t.js} +1 -1
- package/dist/assets/{Detail-DnoUq72E.js → Detail-D4o7l4-u.js} +2 -2
- package/dist/assets/{Extra-XjzSmwc6.js → Extra-BivklVMc.js} +1 -1
- package/dist/assets/{FilePreview-BB5S0Xlq.js → FilePreview-DTcjqstx.js} +1 -1
- package/dist/assets/{Hailuo-Ce75Jnok.js → Hailuo-CGu4PIG_.js} +1 -1
- package/dist/assets/{History-ChIzO2UC.js → History-BehrIJ7n.js} +1 -1
- package/dist/assets/{ImagePreview-Bnd4O5p2.js → ImagePreview-CKbTygXY.js} +1 -1
- package/dist/assets/{ImageWrapper-B4CQCE-4.js → ImageWrapper-D7q8-9s_.js} +1 -1
- package/dist/assets/{Index-BF6FR1uX.js → Index-4CVAh5xi.js} +1 -1
- package/dist/assets/{Index-BxG6cctU.js → Index-8AyISHH4.js} +1 -1
- package/dist/assets/{Index-DE1CEPfK.js → Index-B3HDtkGk.js} +1 -1
- package/dist/assets/{Index-DcpKHSAm.js → Index-BEREF2-V.js} +1 -1
- package/dist/assets/{Index-CwoVRQ9o.js → Index-BJXJ6byu.js} +1 -1
- package/dist/assets/{Index-Csvjp3JM.js → Index-BQbf5RIl.js} +1 -1
- package/dist/assets/{Index-BsvLkZ_m.js → Index-BymE30lZ.js} +1 -1
- package/dist/assets/{Index-BZdtUKmV.js → Index-C-TnjHGo.js} +1 -1
- package/dist/assets/{Index-Cr9loE6D.js → Index-C94DK_up.js} +1 -1
- package/dist/assets/{Index-DfYs5hV_.js → Index-C9QGsdNy.js} +1 -1
- package/dist/assets/{Index-acA4-6T1.js → Index-CH3MWNH6.js} +1 -1
- package/dist/assets/{Index-Bl2u9eoU.js → Index-CMvPSuHx.js} +1 -1
- package/dist/assets/{Index-Bpz8i3JF.js → Index-CPVDoDmm.js} +1 -1
- package/dist/assets/{Index-iPtY8GMk.js → Index-CVvraQyZ.js} +1 -1
- package/dist/assets/{Index-Bvm8fbFC.js → Index-CiqvyUaE.js} +1 -1
- package/dist/assets/{Index-DhnwSFxi.js → Index-CxIeS6MZ.js} +1 -1
- package/dist/assets/{Index-CfkOrDdT.js → Index-DRyIPPGu.js} +1 -1
- package/dist/assets/{Index-CbkUkpRO.js → Index-DUIT3xzj.js} +1 -1
- package/dist/assets/{Index-Ret4inMs.js → Index-D_jM2WQk.js} +1 -1
- package/dist/assets/{Index-CC7jxssV.js → Index-DsHFBWiK.js} +1 -1
- package/dist/assets/{Index-Cz0d5ymO.js → Index-DsbvY2kJ.js} +1 -1
- package/dist/assets/{Index-BQlNjAis.js → Index-DtWgdQY1.js} +1 -1
- package/dist/assets/{Index-B5oPLGT1.js → Index-Iy-667dW.js} +1 -1
- package/dist/assets/{Index-DauyXIDr.js → Index-VZsEGw3w.js} +1 -1
- package/dist/assets/{Index-CnhDK0kk.js → Index-Vz12VTlz.js} +1 -1
- package/dist/assets/{Index-BmRR64xy.js → Index-dDW40Xn9.js} +1 -1
- package/dist/assets/{Index-BbD69oNe.js → Index-gNJCCNG_.js} +1 -1
- package/dist/assets/{Index-3VlL1O00.js → Index-iZegffyI.js} +1 -1
- package/dist/assets/{Invitees-C3PgeTqy.js → Invitees-zYGA-sSG.js} +1 -1
- package/dist/assets/{List-Cvmlh17q.js → List-C669DpuW.js} +1 -1
- package/dist/assets/{List-oOuttKPj.js → List-Cno8lRtI.js} +1 -1
- package/dist/assets/{List-CCXODCGA.js → List-CoeJ13-v.js} +1 -1
- package/dist/assets/{LocalTools-B4WaD6Z1.js → LocalTools-B7bIEiEA.js} +1 -1
- package/dist/assets/{LocalTools-DkrwFS2q.js → LocalTools-BKrqejHw.js} +1 -1
- package/dist/assets/{Main-BcbpvG6r.js → Main-W7d_IN5I.js} +1 -1
- package/dist/assets/{Message-BD6FOp7C.js → Message-Bgam7RKt.js} +1 -1
- package/dist/assets/{Model-BAes8A9w.js → Model-BTIRABA9.js} +1 -1
- package/dist/assets/{Navigator-CVL8oL2N.js → Navigator-DgrjziWY.js} +3 -3
- package/dist/assets/{NoTasks-B91TpTIf.js → NoTasks-ZvwF_hcs.js} +1 -1
- package/dist/assets/{NotFound-DHElxosx.js → NotFound-C5ilq-2f.js} +1 -1
- package/dist/assets/{Pagination-G4AAWX0T.js → Pagination-BwPv-lnJ.js} +1 -1
- package/dist/assets/{Pay-CFQo69rY.js → Pay-BkLDOoWJ.js} +1 -1
- package/dist/assets/{Player-CfZf4XOe.js → Player-n3y4XxQf.js} +1 -1
- package/dist/assets/{PromptTextarea-CFxezHFm.js → PromptTextarea-BOJjxXFh.js} +1 -1
- package/dist/assets/{RealtimeCall-PJ27aaWa.js → RealtimeCall-9LwbAtq3.js} +1 -1
- package/dist/assets/{ScheduledTasks-DqviE-uu.js → ScheduledTasks-Cf2OVKkA.js} +1 -1
- package/dist/assets/{Status-DmKG-iuS.js → Status-6xJjI_2e.js} +1 -1
- package/dist/assets/{Subscribe-D1jndABu.js → Subscribe-DnOZJayQ.js} +1 -1
- package/dist/assets/{TabSwitcher-DsKB96TI.js → TabSwitcher-C5oq5UyK.js} +1 -1
- package/dist/assets/{Tts-D2Eu9pLi.js → Tts-CK50wBg1.js} +1 -1
- package/dist/assets/{VideoPlayer-BpLkm53d.js → VideoPlayer-CriAR22U.js} +1 -1
- package/dist/assets/{VideoPreview-QsgePooK.js → VideoPreview-DT8Phj-T.js} +1 -1
- package/dist/assets/{alert-Cb065PHL.js → alert-DW2f5QJd.js} +1 -1
- package/dist/assets/{avatar-B77sUM6J.js → avatar-QKkgqHOi.js} +1 -1
- package/dist/assets/{basic-DOGyHnX7.js → basic-BLLvM7JK.js} +1 -1
- package/dist/assets/{chat-Be7hQ1C4.js → chat-D2RVFQ9i.js} +1 -1
- package/dist/assets/{codingBridge-pWwZmVC0.js → codingBridge-BOPoX1Ro.js} +1 -1
- package/dist/assets/{codingBridgeNotify-B3iKMBIe.js → codingBridgeNotify-B3p1GaY2.js} +2 -2
- package/dist/assets/{collapse-DPe-_wfz.js → collapse-B2uIaEou.js} +1 -1
- package/dist/assets/{constants-DP-FlaZs.js → constants-m8v8ZYCt.js} +1 -1
- package/dist/assets/{createTaskActions-NlU4k5er.js → createTaskActions-DaoCXJ0l.js} +1 -1
- package/dist/assets/{date-picker-Cp3m4Pqm.js → date-picker-rJGTxqFu.js} +1 -1
- package/dist/assets/{digitalhuman-D1h-T91R.js → digitalhuman-Bevsk5qN.js} +1 -1
- package/dist/assets/{drawer-Db5ghYmn.js → drawer-CvYmKHDT.js} +1 -1
- package/dist/assets/{dropdown-_0iOep2O.js → dropdown-DCtIyw3a.js} +1 -1
- package/dist/assets/{dropdown-k0OTzW4-.js → dropdown-xzpfa4_z.js} +1 -1
- package/dist/assets/{esm-BkAJo8Hd.js → esm-B8vYGbKt.js} +1 -1
- package/dist/assets/{esm-DsqIB2JW.js → esm-BpifJ6ka.js} +1 -1
- package/dist/assets/{esm-CnPzsCOK.js → esm-D8uai8h3.js} +1 -1
- package/dist/assets/esm-D9gb9RfK.js +1 -0
- package/dist/assets/{esm-CyK9YRdq.js → esm-DCgrQSGm.js} +2 -2
- package/dist/assets/{esm-70Vuuy7d.js → esm-DK6JNYBF.js} +3 -3
- package/dist/assets/{esm-DJ1JqeQk.js → esm-IDItksz9.js} +2 -2
- package/dist/assets/{fish-CW7FNubq.js → fish-4pKa8Tbe.js} +1 -1
- package/dist/assets/{flux-CeuEdmHw.js → flux-DGfmoM89.js} +1 -1
- package/dist/assets/{grokvideo-CcWu1P_A.js → grokvideo-DWioFbCq.js} +1 -1
- package/dist/assets/{hailuo-DEq7--Zb.js → hailuo-P_vZm6mU.js} +1 -1
- package/dist/assets/{headshots-CGANALAJ.js → headshots-BHTKowVb.js} +1 -1
- package/dist/assets/{i18n-CjAZ1Lhn.js → i18n-j_9Xk2RS.js} +1 -1
- package/dist/assets/{image-C55jrtEM.js → image-BvgUWmMy.js} +1 -1
- package/dist/assets/{index-BZN2RZZS.css → index-BqwZ3nPK.css} +1 -1
- package/dist/assets/{index--0mdiv6n.js → index-fG4UBOrU.js} +4 -4
- package/dist/assets/{index.browser.esm-nXI8DyH1.js → index.browser.esm-EmKaZM_E.js} +1 -1
- package/dist/assets/{index.es-CqDk1POS.js → index.es-B6As_4fv.js} +1 -1
- package/dist/assets/{input-number-hdHVvFlb.js → input-number-CCXEBkO1.js} +1 -1
- package/dist/assets/kling-BLSICnGT.js +1 -0
- package/dist/assets/kling-BLZu-_yt.js +1 -0
- package/dist/assets/kling-BOKDjQ6F.js +1 -0
- package/dist/assets/kling-BRkAOJlT.js +1 -0
- package/dist/assets/kling-BW5jAllG.js +1 -0
- package/dist/assets/kling-BXjsugvi.js +1 -0
- package/dist/assets/kling-Bx4FFnR3.js +1 -0
- package/dist/assets/kling-CfTVHiYr.js +1 -0
- package/dist/assets/kling-CuVoW7Vi.js +1 -0
- package/dist/assets/kling-DIcQkEJ_.js +1 -0
- package/dist/assets/kling-DOJOoAT6.js +1 -0
- package/dist/assets/kling-DPvRMx_H.js +1 -0
- package/dist/assets/kling-DUx1Z4-V.js +1 -0
- package/dist/assets/kling-DhkxBQiC.js +1 -0
- package/dist/assets/kling-DioYK9i_.js +1 -0
- package/dist/assets/kling-Dlag9WyK.js +1 -0
- package/dist/assets/{kling-BBoJeWti.js → kling-ElTq4uMM.js} +1 -1
- package/dist/assets/kling-IiAZssjO.js +1 -0
- package/dist/assets/kling-hlOmnGZq.js +1 -0
- package/dist/assets/{luma-Dynrf-n4.js → luma-DMmaHmig.js} +1 -1
- package/dist/assets/{maestro-CH2li485.js → maestro-CwRhMP51.js} +1 -1
- package/dist/assets/{midjourney-CoVrTdgU.js → midjourney-DmtyTg-L.js} +1 -1
- package/dist/assets/{mobileLocalExec-DbG07Vpu.js → mobileLocalExec-BYadO5NY.js} +2 -2
- package/dist/assets/{nanobanana-27NYVdBe.js → nanobanana-C0-I4gRU.js} +1 -1
- package/dist/assets/{openaiimage-B9QXJj5o.js → openaiimage-DNoQ5JsP.js} +1 -1
- package/dist/assets/{pagination-axQOBWbU.js → pagination-Cyrdi4fl.js} +1 -1
- package/dist/assets/{pika-B-a2N3qz.js → pika-D9ekgkdf.js} +1 -1
- package/dist/assets/{pixverse-DXeIXr3U.js → pixverse-CjAgrV4_.js} +1 -1
- package/dist/assets/{popover-DsnL_ywp.js → popover-ojCxtRrg.js} +1 -1
- package/dist/assets/{producer-2YQsgbrY.js → producer-C4msxmiU.js} +1 -1
- package/dist/assets/{qrart-BWy3pt5q.js → qrart-CxCJvd5i.js} +1 -1
- package/dist/assets/{realtime-BLREPzrh.js → realtime-WP9aRGmw.js} +1 -1
- package/dist/assets/{row-DUmvEYDi.js → row-BHMvnAoT.js} +1 -1
- package/dist/assets/{seedance-C_RaGGmy.js → seedance-CHUmk8iw.js} +1 -1
- package/dist/assets/{seedream-BQYLY76t.js → seedream-Bv7VvPhb.js} +1 -1
- package/dist/assets/{select-bWj6JKOh.js → select-cneeY9MM.js} +1 -1
- package/dist/assets/{serp-eMTTNt9U.js → serp-D6yeSjyu.js} +1 -1
- package/dist/assets/{slider-PZkyQm3l.js → slider-CupVoLKb.js} +1 -1
- package/dist/assets/{solana-wallets-CyQxV9lR.js → solana-wallets-DnTo7ymj.js} +2 -2
- package/dist/assets/{solana-wallets-vue-VXMPQGH1.js → solana-wallets-vue-CIskBQrC.js} +1 -1
- package/dist/assets/{sora-BfYhWOlv.js → sora-B10LUlnp.js} +1 -1
- package/dist/assets/{suno-gf5bLrId.js → suno-Bx-Iinep.js} +1 -1
- package/dist/assets/{switch-B5S0_DEy.js → switch-5_7n8H4N.js} +1 -1
- package/dist/assets/{table-BNAiO3uA.js → table-D-wvH2_t.js} +1 -1
- package/dist/assets/{tabs-fJFBL7Ec.js → tabs-1RRUdwoi.js} +1 -1
- package/dist/assets/{time-picker-Cbar97LC.js → time-picker-C2tmRiJZ.js} +1 -1
- package/dist/assets/{tooltip-DkQKkjH2.js → tooltip-CTq93bCk.js} +1 -1
- package/dist/assets/{upload-CI6V1Tmp.js → upload-ohhqrmbr.js} +1 -1
- package/dist/assets/{veo-BU6zE3Ll.js → veo-CbzyHO7f.js} +1 -1
- package/dist/assets/{wan-D3udmeJW.js → wan-D3HSKxC0.js} +1 -1
- package/dist/assets/{web-CIl0Wkbl.js → web-1-Soq5b4.js} +1 -1
- package/dist/assets/{web-Cn2_00m6.js → web-BCjE5lTr.js} +1 -1
- package/dist/assets/{web-BU3vcpB6.js → web-CsIr22sw.js} +1 -1
- package/dist/assets/{web-B_VgIul5.js → web-CtCHb5W4.js} +1 -1
- package/dist/assets/{web-DBd0XZ6Y.js → web-IQrU4N96.js} +1 -1
- package/dist/assets/{webextrator-WDylv1Zl.js → webextrator-CeBsEIZf.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/Consumption-plQZIePZ.js +0 -1
- package/dist/assets/esm-BItw8biP.js +0 -1
- package/dist/assets/kling-BKREZvru.js +0 -1
- package/dist/assets/kling-BKpEDeic.js +0 -1
- package/dist/assets/kling-BMGe7ood.js +0 -1
- package/dist/assets/kling-BXi151lQ.js +0 -1
- package/dist/assets/kling-B_Ukofur.js +0 -1
- package/dist/assets/kling-Bgwfubfp.js +0 -1
- package/dist/assets/kling-BofdxfZO.js +0 -1
- package/dist/assets/kling-BuNJpozy.js +0 -1
- package/dist/assets/kling-CSFWU-Pu.js +0 -1
- package/dist/assets/kling-CY1mfMIg.js +0 -1
- package/dist/assets/kling-Cj2RuL2Z.js +0 -1
- package/dist/assets/kling-D3pLJVQU.js +0 -1
- package/dist/assets/kling-DB_Z8Vil.js +0 -1
- package/dist/assets/kling-DWNWcob0.js +0 -1
- package/dist/assets/kling-DZfmSQ2u.js +0 -1
- package/dist/assets/kling-DpxvZTwB.js +0 -1
- package/dist/assets/kling-lG_TWbZX.js +0 -1
- package/dist/assets/kling-pkulSODP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-bWj6JKOh.js";import{t as x}from"./upload-CI6V1Tmp.js";import{t as S}from"./tooltip-DkQKkjH2.js";import{t as C}from"./image-C55jrtEM.js";import{t as w}from"./alert-Cb065PHL.js";import{t as T}from"./drawer-Db5ghYmn.js";import{t as E}from"./input-number-hdHVvFlb.js";import{t as D}from"./switch-B5S0_DEy.js";import{$t as O,Bt as k,Gt as A,Ht as j,Jt as ee,Kt as te,Lt as M,Qt as N,Rt as P,Ut as F,Vt as I,Wt as L,Xt as ne,Yt as re,Zt as ie,an as ae,en as oe,nn as R,on as se,qt as ce,rn as z,sn as B,tn as V}from"./constants-DP-FlaZs.js";import{A as H,Gr as U,Hr as W,Ht as G,Kt as le,Ut as ue,Vt as de,Wt as K,_n as fe,en as pe,ni as q,nr as me,pi as J}from"./index--0mdiv6n.js";import{t as Y}from"./index.es-CqDk1POS.js";import{t as he}from"./CopyToClipboard-rM37oGeG.js";import{t as X}from"./ImagePreview-Bnd4O5p2.js";import{n as ge}from"./taskDrawerMixin-DyAUhFEq.js";import{t as _e}from"./Consumption-plQZIePZ.js";import{i as Z,n as ve,t as ye}from"./pagination-axQOBWbU.js";import{t as be}from"./VideoPlayer-BpLkm53d.js";import{t as xe}from"./ApiCodeButton-wEJZV72l.js";import{t as Se}from"./BotPlaceholder-ChvD1MjR.js";import{t as Ce}from"./NoTasks-B91TpTIf.js";import{t as we}from"./PromptTextarea-CFxezHFm.js";import{t as Te}from"./ImageWrapper-B4CQCE-4.js";import{n as Ee,t as De}from"./VideoPreview-QsgePooK.js";var Oe=v({name:`LayoutSeedance`,components:{ElDrawer:T,ElButton:J,FontAwesomeIcon:Y},mixins:[ge]}),ke={class:`main flex flex-row flex-1`},Ae={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},je={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Me(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ke,[e(`div`,Ae,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,je,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ne=H(Oe,[[`render`,Me],[`__scopeId`,`data-v-ec312952`]]),Pe=v({name:`SeedancePromptInput`,components:{PromptTextarea:we},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Fe(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ie=H(Pe,[[`render`,Fe]]),Le=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ce,label:this.$t(`seedance.model.seedance20`)},{value:ee,label:this.$t(`seedance.model.seedance20Fast`)},{value:re,label:this.$t(`seedance.model.seedance20Mini`)},{value:te,label:this.$t(`seedance.model.seedance15pro`)},{value:L,label:this.$t(`seedance.model.seedance10pro`)},{value:A,label:this.$t(`seedance.model.seedance10proFast`)},{value:F,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:j,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=M}}),Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`};function He(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`h2`,Ve,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ue=H(Le,[[`render`,He],[`__scopeId`,`data-v-deb4c429`]]),We=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[];for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=H(We,[[`render`,Ye],[`__scopeId`,`data-v-216def8f`]]),Q={[R]:0,[z]:1,[V]:2,"4k":3},Ze=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Z,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[{value:R,label:`480p`},{value:z,label:`720p`},{value:V,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),Qe={class:`resolution`},$e={class:`header`},et={class:`title font-bold`},tt={class:`items`},nt=[`onClick`];function rt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,Qe,[e(`div`,$e,[e(`h2`,et,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,tt,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,nt)]),_:2},1032,[`content`,`disabled`]))),128))])])}var it=H(Ze,[[`render`,rt],[`__scopeId`,`data-v-db7e8aff`]]),at=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Z},computed:{options(){return[{value:ie,label:`16:9`,w:32,h:18},{value:O,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:N,label:`21:9`,w:34,h:14},{value:oe,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=P}}),ot={class:`ratio`},st={class:`header`},ct={class:`title font-bold`},lt={class:`items`},ut=[`onClick`],dt={class:`preview`},ft={key:1,class:`rect rect-auto`},pt={class:`name`};function mt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,ot,[e(`div`,st,[e(`h2`,ct,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,lt,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,dt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,ft,`A`))]),e(`div`,pt,i(r.label),1)],10,ut))),128))])])}var ht=H(at,[[`render`,mt],[`__scopeId`,`data-v-8ddec2dd`]]),gt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return B(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),_t={key:0,class:`field`},vt={class:`label`},yt={class:`box`},bt={class:`title font-bold`},xt={class:`value`};function St(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,_t,[e(`div`,vt,[e(`div`,yt,[e(`h2`,bt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,xt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Ct=H(gt,[[`render`,St],[`__scopeId`,`data-v-df51dfbd`]]),wt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Tt={class:`field`},Et={class:`label`},Dt={class:`box`},Ot={class:`title font-bold`},kt={class:`value`};function At(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Tt,[e(`div`,Et,[e(`div`,Dt,[e(`h2`,Ot,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,kt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var jt=H(wt,[[`render`,At],[`__scopeId`,`data-v-ae777d61`]]),Mt=v({name:`SeedanceFirstFrameImage`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[K,G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),Nt={key:0,class:`relative`},Pt={class:`flex justify-between`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`},Lt={key:0,class:`required-badge`};function Rt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Lt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var zt=H(Mt,[[`render`,Rt],[`__scopeId`,`data-v-e2597f23`]]),Bt=v({name:`SeedanceLastFrameImage`,components:{ElUpload:x,ElButton:J,ImagePreview:X,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[K,G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Vt={key:0,class:`relative`},Ht={class:`flex justify-between`},Ut={class:`flex justify-start items-center`},Wt={class:`text-sm font-bold`};function Gt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Vt,[e(`div`,Ht,[e(`div`,Ut,[e(`span`,Wt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Kt=H(Bt,[[`render`,Gt],[`__scopeId`,`data-v-3a191e51`]]),qt=v({name:`SeedanceReferenceImage`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[K,G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),Jt={key:0,class:`relative`},Yt={class:`flex justify-between`},Xt={class:`flex justify-start items-center`},Zt={class:`text-sm font-bold`};function Qt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,Jt,[e(`div`,Yt,[e(`div`,Xt,[e(`span`,Zt,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var $t=H(qt,[[`render`,Qt],[`__scopeId`,`data-v-230a67f6`]]),en=v({name:`SeedanceReferenceAudio`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),tn={key:0,class:`relative`},nn={class:`flex justify-between`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var sn=H(en,[[`render`,on],[`__scopeId`,`data-v-49515675`]]),cn=v({name:`SeedanceReferenceVideo`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),ln={key:0,class:`relative`},un={class:`flex justify-between`},dn={class:`flex justify-start items-center`},fn={class:`text-sm font-bold`};function pn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,ln,[e(`div`,un,[e(`div`,dn,[e(`span`,fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var mn=H(cn,[[`render`,pn],[`__scopeId`,`data-v-b212c474`]]),hn=v({name:`SeedanceServiceTierSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ae,label:this.$t(`seedance.serviceTier.default`)},{value:se,label:this.$t(`seedance.serviceTier.flex`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.service_tier},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,service_tier:e})}}},mounted(){this.value||=k}}),gn={class:`field`},_n={class:`label`},vn={class:`box`},yn={class:`title font-bold`};function bn(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,gn,[e(`div`,_n,[e(`div`,vn,[e(`h2`,yn,i(t.$t(`seedance.name.serviceTier`)),1),a(m,{content:t.$t(`seedance.description.serviceTier`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var xn=H(hn,[[`render`,bn],[`__scopeId`,`data-v-cc938de2`]]),Sn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return B(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),Cn={key:0,class:`field`},wn={class:`label`},Tn={class:`box`},En={class:`title font-bold`},Dn={class:`value`};function On(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Cn,[e(`div`,wn,[e(`div`,Tn,[e(`h2`,En,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Dn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var kn=H(Sn,[[`render`,On],[`__scopeId`,`data-v-edea5451`]]),An=v({name:`SeedanceSeedInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),jn={class:`field`},Mn={class:`label`},Nn={class:`box`},Pn={class:`title font-bold`},Fn={class:`value`};function In(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,jn,[e(`div`,Mn,[e(`div`,Nn,[e(`h2`,Pn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Fn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Ln=v({name:`SeedanceConfigPanel`,components:{ElButton:J,FontAwesomeIcon:Y,PromptInput:Ie,ModelSelector:Ue,DurationSelector:Xe,ResolutionSelector:it,RatioSelector:ht,GenerateAudioSwitch:Ct,CameraFixedSwitch:jt,ServiceTierSelector:xn,ReturnLastFrameSwitch:kn,SeedInput:H(An,[[`render`,In],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:zt,LastFrameImage:Kt,ReferenceImage:$t,ReferenceAudio:sn,ReferenceVideo:mn,Consumption:_e},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return le(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Rn={class:`flex flex-col h-full`},zn={class:`flex-1 overflow-y-auto p-5`},Bn={class:`flex flex-col items-center justify-center px-5 pb-5`};function Vn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`service-tier-selector`),b=l(`generate-audio-switch`),x=l(`camera-fixed-switch`),S=l(`return-last-frame-switch`),C=l(`seed-input`),w=l(`first-frame-image`),T=l(`last-frame-image`),E=l(`reference-image`),D=l(`reference-audio`),O=l(`reference-video`),k=l(`consumption`),A=l(`font-awesome-icon`),j=l(`el-button`);return g(),s(`div`,Rn,[e(`div`,zn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-2`}),a(T,{class:`mb-2`}),a(E,{class:`mb-2`}),a(D,{class:`mb-2`}),a(O,{class:`mb-2`})]),e(`div`,Bn,[a(k,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(j,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(A,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Hn=H(Ln,[[`render`,Vn]]),Un=v({name:`SeedanceTaskPreview`,components:{ElImage:C,CopyToClipboard:he,FontAwesomeIcon:Y,ElAlert:w,VideoPlayer:be,ElTooltip:S,ElButton:J,ImageWrapper:Te,ImagePreview:X,AudioPreview:Ee,VideoPreview:De,ApiCodeButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{seedanceLogo:I}},computed:{video(){return this.modelValue?.response?.data},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Wn={class:`preview`},Gn={class:`left`},Kn={class:`main`},qn={class:`bot`},Jn={class:`datetime`},Yn={class:`info`},Xn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Zn={key:1,class:`prompt mt-2`},Qn={key:0},$n={key:1},er={key:0,class:n({content:!0})},tr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},nr={key:1,class:n({content:!0})},rr={key:0,class:`mb-4`},ir={key:1,class:`mb-4`},ar={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},or={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:0},lr={key:1},ur={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},mr={key:2,class:n({content:!0})},hr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_r={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},yr={key:3,class:n({content:!0})},br={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Sr(n,u,d,m,_,v){let y=l(`el-image`),b=l(`image-preview`),x=l(`audio-preview`),S=l(`video-preview`),C=l(`font-awesome-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`video-player`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`el-tooltip`),A=l(`api-code-button`);return g(),s(`div`,Wn,[e(`div`,Gn,[a(y,{src:n.seedanceLogo,class:`avatar`},null,8,[`src`])]),e(`div`,Kn,[e(`div`,qn,[r(i(n.$t(`seedance.name.seedanceBot`))+` `,1),e(`span`,Jn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Yn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Xn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(b,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(S,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Zn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,$n,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Qn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,nr,[n.video?.video_url?(g(),s(`div`,rr,[a(E,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,ir,[a(D,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,ar,[a(k,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(A,{path:`/seedance/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,or,[a(C,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,sr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,$,[a(C,{icon:`fa-solid fa-expand`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,cr,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,lr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,ur,[a(C,{icon:`fa-solid fa-volume-up`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,dr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,fr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,pr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,mr,[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(C,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,hr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,gr,[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,_r,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,vr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,yr,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,br,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,xr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,er,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-regular fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,tr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Cr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:H(Un,[[`render`,Sr],[`__scopeId`,`data-v-be65e8a9`]]),BotPlaceholder:Se,NoTasks:Ce,ScrollList:ve},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),wr={key:0},Tr={key:2,class:`w-full h-full flex items-center justify-center`};function Er(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,wr,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Tr,[a(v)])):o(``,!0)],64)}var Dr=v({name:`SeedanceIndex`,components:{ConfigPanel:Hn,Layout:Ne,RecentPanel:H(Cr,[[`render`,Er]])},mixins:[ue],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===W.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===W.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ye({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!de(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.images)){e.images=e.images.filter(e=>!!e?.url);let t=e.images.some(e=>e?.role===`first_frame`),n=e.images.some(e=>e?.role===`last_frame`);!t&&n&&(e.images=e.images.map(e=>e?.role===`last_frame`?{...e,role:`first_frame`}:e))}let t=Array.isArray(e?.images)&&e.images.length>0;if(!t&&`images`in e&&delete e.images,e?.model&&!ne[e.model]){q.warning(this.$t(`seedance.message.modelUnsupported`));return}let n=B(e?.model);if(n.requiresImage&&!t){q.warning(this.$t(`seedance.message.modelRequiresImage`));return}if(!n.acceptsImage&&t){q.warning(this.$t(`seedance.message.modelRejectsImage`));return}if(!n.acceptsText&&!t){q.warning(this.$t(`seedance.message.modelRequiresImage`));return}!n.acceptsAudio&&e.generate_audio&&(e.generate_audio=!1),!n.acceptsReturnLastFrame&&e.return_last_frame&&(e.return_last_frame=!1),!n.acceptsLastFrame&&t&&(e.images=e.images.filter(e=>e?.role!==`last_frame`)),n.acceptsReferenceAudio&&Array.isArray(e?.audios)&&(e.audios=e.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(e?.audios)||e.audios.length===0)&&delete e.audios,n.acceptsReferenceVideo&&Array.isArray(e?.videos)&&(e.videos=e.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(e?.videos)||e.videos.length===0)&&delete e.videos,!n.acceptsReferenceImage&&Array.isArray(e?.images)&&(e.images=e.images.filter(e=>e?.role!==`reference_image`),e.images.length===0&&delete e.images);let r=Array.isArray(e?.images)&&e.images.some(e=>e?.role===`reference_image`);if(Array.isArray(e?.audios)&&e.audios.length>0&&!r){q.warning(this.$t(`seedance.message.audioRequiresReferenceImage`));return}let i={...e,async:!0};if(!pe())return;let a=this.credential?.token;if(!a){console.error(`no token specified`);return}q.info(this.$t(`seedance.message.startingTask`)),me(`seedance`,fe.generate(i,{token:a})).then(()=>{q.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?q.error(this.$t(`seedance.message.usedUp`)):q.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Or(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var kr=H(Dr,[[`render`,Or]]);export{kr as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-cneeY9MM.js";import{t as x}from"./upload-ohhqrmbr.js";import{t as S}from"./tooltip-CTq93bCk.js";import{t as C}from"./image-BvgUWmMy.js";import{t as w}from"./alert-DW2f5QJd.js";import{t as T}from"./drawer-CvYmKHDT.js";import{t as E}from"./input-number-CCXEBkO1.js";import{t as D}from"./switch-5_7n8H4N.js";import{$t as O,Bt as k,Gt as A,Ht as j,Jt as ee,Kt as te,Lt as M,Qt as N,Rt as P,Ut as F,Vt as I,Wt as L,Xt as ne,Yt as re,Zt as ie,an as ae,en as oe,nn as R,on as se,qt as ce,rn as z,sn as B,tn as V}from"./constants-m8v8ZYCt.js";import{A as H,Gr as U,Hr as W,Ht as G,Kt as le,Ut as ue,Vt as de,Wt as K,_n as fe,en as pe,ni as q,nr as me,pi as J}from"./index-fG4UBOrU.js";import{t as Y}from"./index.es-B6As_4fv.js";import{t as he}from"./CopyToClipboard-DyeZXE6t.js";import{t as X}from"./ImagePreview-CKbTygXY.js";import{n as ge}from"./taskDrawerMixin-DyAUhFEq.js";import{t as _e}from"./Consumption-tsEBkXA_.js";import{i as Z,n as ve,t as ye}from"./pagination-Cyrdi4fl.js";import{t as be}from"./VideoPlayer-CriAR22U.js";import{t as xe}from"./ApiCodeButton-B70yUVoU.js";import{t as Se}from"./BotPlaceholder-DadzfRCY.js";import{t as Ce}from"./NoTasks-ZvwF_hcs.js";import{t as we}from"./PromptTextarea-BOJjxXFh.js";import{t as Te}from"./ImageWrapper-D7q8-9s_.js";import{n as Ee,t as De}from"./VideoPreview-DT8Phj-T.js";var Oe=v({name:`LayoutSeedance`,components:{ElDrawer:T,ElButton:J,FontAwesomeIcon:Y},mixins:[ge]}),ke={class:`main flex flex-row flex-1`},Ae={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},je={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Me(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ke,[e(`div`,Ae,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,je,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ne=H(Oe,[[`render`,Me],[`__scopeId`,`data-v-ec312952`]]),Pe=v({name:`SeedancePromptInput`,components:{PromptTextarea:we},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Fe(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ie=H(Pe,[[`render`,Fe]]),Le=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ce,label:this.$t(`seedance.model.seedance20`)},{value:ee,label:this.$t(`seedance.model.seedance20Fast`)},{value:re,label:this.$t(`seedance.model.seedance20Mini`)},{value:te,label:this.$t(`seedance.model.seedance15pro`)},{value:L,label:this.$t(`seedance.model.seedance10pro`)},{value:A,label:this.$t(`seedance.model.seedance10proFast`)},{value:F,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:j,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=M}}),Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`};function He(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`h2`,Ve,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ue=H(Le,[[`render`,He],[`__scopeId`,`data-v-deb4c429`]]),We=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[];for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=H(We,[[`render`,Ye],[`__scopeId`,`data-v-216def8f`]]),Q={[R]:0,[z]:1,[V]:2,"4k":3},Ze=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Z,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[{value:R,label:`480p`},{value:z,label:`720p`},{value:V,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),Qe={class:`resolution`},$e={class:`header`},et={class:`title font-bold`},tt={class:`items`},nt=[`onClick`];function rt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,Qe,[e(`div`,$e,[e(`h2`,et,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,tt,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,nt)]),_:2},1032,[`content`,`disabled`]))),128))])])}var it=H(Ze,[[`render`,rt],[`__scopeId`,`data-v-db7e8aff`]]),at=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Z},computed:{options(){return[{value:ie,label:`16:9`,w:32,h:18},{value:O,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:N,label:`21:9`,w:34,h:14},{value:oe,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=P}}),ot={class:`ratio`},st={class:`header`},ct={class:`title font-bold`},lt={class:`items`},ut=[`onClick`],dt={class:`preview`},ft={key:1,class:`rect rect-auto`},pt={class:`name`};function mt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,ot,[e(`div`,st,[e(`h2`,ct,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,lt,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,dt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,ft,`A`))]),e(`div`,pt,i(r.label),1)],10,ut))),128))])])}var ht=H(at,[[`render`,mt],[`__scopeId`,`data-v-8ddec2dd`]]),gt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return B(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),_t={key:0,class:`field`},vt={class:`label`},yt={class:`box`},bt={class:`title font-bold`},xt={class:`value`};function St(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,_t,[e(`div`,vt,[e(`div`,yt,[e(`h2`,bt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,xt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Ct=H(gt,[[`render`,St],[`__scopeId`,`data-v-df51dfbd`]]),wt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Tt={class:`field`},Et={class:`label`},Dt={class:`box`},Ot={class:`title font-bold`},kt={class:`value`};function At(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Tt,[e(`div`,Et,[e(`div`,Dt,[e(`h2`,Ot,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,kt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var jt=H(wt,[[`render`,At],[`__scopeId`,`data-v-ae777d61`]]),Mt=v({name:`SeedanceFirstFrameImage`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[K,G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),Nt={key:0,class:`relative`},Pt={class:`flex justify-between`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`},Lt={key:0,class:`required-badge`};function Rt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Lt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var zt=H(Mt,[[`render`,Rt],[`__scopeId`,`data-v-e2597f23`]]),Bt=v({name:`SeedanceLastFrameImage`,components:{ElUpload:x,ElButton:J,ImagePreview:X,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[K,G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Vt={key:0,class:`relative`},Ht={class:`flex justify-between`},Ut={class:`flex justify-start items-center`},Wt={class:`text-sm font-bold`};function Gt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Vt,[e(`div`,Ht,[e(`div`,Ut,[e(`span`,Wt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Kt=H(Bt,[[`render`,Gt],[`__scopeId`,`data-v-3a191e51`]]),qt=v({name:`SeedanceReferenceImage`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[K,G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),Jt={key:0,class:`relative`},Yt={class:`flex justify-between`},Xt={class:`flex justify-start items-center`},Zt={class:`text-sm font-bold`};function Qt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,Jt,[e(`div`,Yt,[e(`div`,Xt,[e(`span`,Zt,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var $t=H(qt,[[`render`,Qt],[`__scopeId`,`data-v-230a67f6`]]),en=v({name:`SeedanceReferenceAudio`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),tn={key:0,class:`relative`},nn={class:`flex justify-between`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var sn=H(en,[[`render`,on],[`__scopeId`,`data-v-49515675`]]),cn=v({name:`SeedanceReferenceVideo`,components:{ElUpload:x,ElButton:J,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[G],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){q.warning(this.$t(`seedance.message.uploadExceed`))},onError(){q.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),ln={key:0,class:`relative`},un={class:`flex justify-between`},dn={class:`flex justify-start items-center`},fn={class:`text-sm font-bold`};function pn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,ln,[e(`div`,un,[e(`div`,dn,[e(`span`,fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var mn=H(cn,[[`render`,pn],[`__scopeId`,`data-v-b212c474`]]),hn=v({name:`SeedanceServiceTierSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ae,label:this.$t(`seedance.serviceTier.default`)},{value:se,label:this.$t(`seedance.serviceTier.flex`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.service_tier},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,service_tier:e})}}},mounted(){this.value||=k}}),gn={class:`field`},_n={class:`label`},vn={class:`box`},yn={class:`title font-bold`};function bn(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,gn,[e(`div`,_n,[e(`div`,vn,[e(`h2`,yn,i(t.$t(`seedance.name.serviceTier`)),1),a(m,{content:t.$t(`seedance.description.serviceTier`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var xn=H(hn,[[`render`,bn],[`__scopeId`,`data-v-cc938de2`]]),Sn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return B(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),Cn={key:0,class:`field`},wn={class:`label`},Tn={class:`box`},En={class:`title font-bold`},Dn={class:`value`};function On(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Cn,[e(`div`,wn,[e(`div`,Tn,[e(`h2`,En,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Dn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var kn=H(Sn,[[`render`,On],[`__scopeId`,`data-v-edea5451`]]),An=v({name:`SeedanceSeedInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),jn={class:`field`},Mn={class:`label`},Nn={class:`box`},Pn={class:`title font-bold`},Fn={class:`value`};function In(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,jn,[e(`div`,Mn,[e(`div`,Nn,[e(`h2`,Pn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Fn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Ln=v({name:`SeedanceConfigPanel`,components:{ElButton:J,FontAwesomeIcon:Y,PromptInput:Ie,ModelSelector:Ue,DurationSelector:Xe,ResolutionSelector:it,RatioSelector:ht,GenerateAudioSwitch:Ct,CameraFixedSwitch:jt,ServiceTierSelector:xn,ReturnLastFrameSwitch:kn,SeedInput:H(An,[[`render`,In],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:zt,LastFrameImage:Kt,ReferenceImage:$t,ReferenceAudio:sn,ReferenceVideo:mn,Consumption:_e},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return le(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Rn={class:`flex flex-col h-full`},zn={class:`flex-1 overflow-y-auto p-5`},Bn={class:`flex flex-col items-center justify-center px-5 pb-5`};function Vn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`service-tier-selector`),b=l(`generate-audio-switch`),x=l(`camera-fixed-switch`),S=l(`return-last-frame-switch`),C=l(`seed-input`),w=l(`first-frame-image`),T=l(`last-frame-image`),E=l(`reference-image`),D=l(`reference-audio`),O=l(`reference-video`),k=l(`consumption`),A=l(`font-awesome-icon`),j=l(`el-button`);return g(),s(`div`,Rn,[e(`div`,zn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-2`}),a(T,{class:`mb-2`}),a(E,{class:`mb-2`}),a(D,{class:`mb-2`}),a(O,{class:`mb-2`})]),e(`div`,Bn,[a(k,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(j,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(A,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Hn=H(Ln,[[`render`,Vn]]),Un=v({name:`SeedanceTaskPreview`,components:{ElImage:C,CopyToClipboard:he,FontAwesomeIcon:Y,ElAlert:w,VideoPlayer:be,ElTooltip:S,ElButton:J,ImageWrapper:Te,ImagePreview:X,AudioPreview:Ee,VideoPreview:De,ApiCodeButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{seedanceLogo:I}},computed:{video(){return this.modelValue?.response?.data},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Wn={class:`preview`},Gn={class:`left`},Kn={class:`main`},qn={class:`bot`},Jn={class:`datetime`},Yn={class:`info`},Xn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Zn={key:1,class:`prompt mt-2`},Qn={key:0},$n={key:1},er={key:0,class:n({content:!0})},tr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},nr={key:1,class:n({content:!0})},rr={key:0,class:`mb-4`},ir={key:1,class:`mb-4`},ar={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},or={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:0},lr={key:1},ur={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},mr={key:2,class:n({content:!0})},hr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_r={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},yr={key:3,class:n({content:!0})},br={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Sr(n,u,d,m,_,v){let y=l(`el-image`),b=l(`image-preview`),x=l(`audio-preview`),S=l(`video-preview`),C=l(`font-awesome-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`video-player`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`el-tooltip`),A=l(`api-code-button`);return g(),s(`div`,Wn,[e(`div`,Gn,[a(y,{src:n.seedanceLogo,class:`avatar`},null,8,[`src`])]),e(`div`,Kn,[e(`div`,qn,[r(i(n.$t(`seedance.name.seedanceBot`))+` `,1),e(`span`,Jn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Yn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Xn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(b,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(S,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Zn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,$n,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Qn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,nr,[n.video?.video_url?(g(),s(`div`,rr,[a(E,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,ir,[a(D,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,ar,[a(k,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(A,{path:`/seedance/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,or,[a(C,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,sr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,$,[a(C,{icon:`fa-solid fa-expand`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,cr,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,lr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,ur,[a(C,{icon:`fa-solid fa-volume-up`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,dr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,fr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,pr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,mr,[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(C,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,hr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,gr,[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,_r,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,vr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,yr,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,br,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,xr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,er,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-regular fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,tr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Cr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:H(Un,[[`render`,Sr],[`__scopeId`,`data-v-be65e8a9`]]),BotPlaceholder:Se,NoTasks:Ce,ScrollList:ve},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),wr={key:0},Tr={key:2,class:`w-full h-full flex items-center justify-center`};function Er(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,wr,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Tr,[a(v)])):o(``,!0)],64)}var Dr=v({name:`SeedanceIndex`,components:{ConfigPanel:Hn,Layout:Ne,RecentPanel:H(Cr,[[`render`,Er]])},mixins:[ue],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===W.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===W.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ye({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!de(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.images)){e.images=e.images.filter(e=>!!e?.url);let t=e.images.some(e=>e?.role===`first_frame`),n=e.images.some(e=>e?.role===`last_frame`);!t&&n&&(e.images=e.images.map(e=>e?.role===`last_frame`?{...e,role:`first_frame`}:e))}let t=Array.isArray(e?.images)&&e.images.length>0;if(!t&&`images`in e&&delete e.images,e?.model&&!ne[e.model]){q.warning(this.$t(`seedance.message.modelUnsupported`));return}let n=B(e?.model);if(n.requiresImage&&!t){q.warning(this.$t(`seedance.message.modelRequiresImage`));return}if(!n.acceptsImage&&t){q.warning(this.$t(`seedance.message.modelRejectsImage`));return}if(!n.acceptsText&&!t){q.warning(this.$t(`seedance.message.modelRequiresImage`));return}!n.acceptsAudio&&e.generate_audio&&(e.generate_audio=!1),!n.acceptsReturnLastFrame&&e.return_last_frame&&(e.return_last_frame=!1),!n.acceptsLastFrame&&t&&(e.images=e.images.filter(e=>e?.role!==`last_frame`)),n.acceptsReferenceAudio&&Array.isArray(e?.audios)&&(e.audios=e.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(e?.audios)||e.audios.length===0)&&delete e.audios,n.acceptsReferenceVideo&&Array.isArray(e?.videos)&&(e.videos=e.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(e?.videos)||e.videos.length===0)&&delete e.videos,!n.acceptsReferenceImage&&Array.isArray(e?.images)&&(e.images=e.images.filter(e=>e?.role!==`reference_image`),e.images.length===0&&delete e.images);let r=Array.isArray(e?.images)&&e.images.some(e=>e?.role===`reference_image`);if(Array.isArray(e?.audios)&&e.audios.length>0&&!r){q.warning(this.$t(`seedance.message.audioRequiresReferenceImage`));return}let i={...e,async:!0};if(!pe())return;let a=this.credential?.token;if(!a){console.error(`no token specified`);return}q.info(this.$t(`seedance.message.startingTask`)),me(`seedance`,fe.generate(i,{token:a})).then(()=>{q.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?q.error(this.$t(`seedance.message.usedUp`)):q.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Or(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var kr=H(Dr,[[`render`,Or]]);export{kr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,at as s,ht as c,j as l,mt as u,ot as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{n as m,t as h}from"./row-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,at as s,ht as c,j as l,mt as u,ot as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{n as m,t as h}from"./row-BHMvnAoT.js";import{i as g,n as _,r as v,t as y}from"./container-VI0MzukK.js";import{n as b,t as x}from"./dropdown-DCtIyw3a.js";import{a as S,i as C,n as w,r as T,t as E}from"./avatar-QKkgqHOi.js";import{$t as D,A as O,J as k,Jr as A,N as j,P as M,Qr as N,Wr as P,Xr as F,nt as I,pi as L,pt as R}from"./index-fG4UBOrU.js";import{t as z}from"./BottomFooter-DuJCGnkg.js";var B=p({name:`TopHeader`,components:{ElCol:m,Logo:w,ElRow:h,ElDropdown:x,ElMenu:T,ElMenuItem:C,ElDropdownItem:b,ElButton:L,ElSubMenu:S},data(){return{defaultAvatar:E,products:`chat`}},computed:{site(){return this.$store.state?.site},dark(){return this.$store.getters?.dark},active(){return this.$route.matched?.[0]?.path},user(){return this.$store.getters?.user},authenticated(){return this.$store.getters?.authenticated},isDesktopChrome(){return A()},isMacChrome(){return A()&&F()}},methods:{openTab(e){if(N()){j.open({url:e}).catch(t=>{console.warn(`Browser.open failed, falling back to window.open`,t),window.open(e,`_blank`)});return}window.open(e,`_blank`)},onSelect(e){e&&this.$router.push(e)},onHome(){this.$router.push({name:R})},onLogin(){this.$router.push({name:M})},onDownload(){this.$router.push({name:I})},onProfile(){let e=P();this.openTab(D(`${e}/user/profile`))},onVerify(){let e=P();this.openTab(D(`${e}/user/verify`))},onConsole(){this.$router.push({name:k})},async onLogout(){this.$store.dispatch(`logout`)}}}),V={key:0,class:`mt-4 pr-10`},H={key:1,class:`float-right`},U=[`src`];function W(p,m,h,g,_,v){let y=s(`logo`),b=s(`el-col`),x=s(`el-menu-item`),S=s(`el-sub-menu`),C=s(`el-menu`),w=s(`el-button`),T=s(`language-selector`),E=s(`dark-selector`),D=s(`el-dropdown-item`),O=s(`el-dropdown-menu`),k=s(`el-dropdown`),A=s(`el-row`),j=d(`t`);return f(),l(A,{class:t([`header`,{"desktop-chrome":p.isDesktopChrome,"is-mac":p.isMacChrome}])},{default:u(()=>[i(b,{md:4,xs:24,class:`brand-col`},{default:u(()=>[i(y,{onClick:p.onHome},null,8,[`onClick`])]),_:1}),i(b,{md:16,xs:13},{default:u(()=>[i(C,{"default-active":p.active,mode:`horizontal`,class:`menu`,ellipsis:!0,onSelect:p.onSelect},{default:u(()=>[i(S,{index:p.products},{title:u(()=>[n(r(p.$t(`common.nav.products`)),1)]),default:u(()=>[p.site?.features?.chatgpt?.enabled?c((f(),l(x,{key:0,index:`/chat`},null,512)),[[j,`index.title.chat`]]):a(``,!0),p.site?.features?.midjourney?.enabled?c((f(),l(x,{key:1,index:`/midjourney`},null,512)),[[j,`index.title.midjourney`]]):a(``,!0),p.site?.features?.qrart?.enabled?c((f(),l(x,{key:2,index:`/qrart`},null,512)),[[j,`index.title.qrart`]]):a(``,!0),p.site?.features?.suno?.enabled?c((f(),l(x,{key:3,index:`/suno`},null,512)),[[j,`index.title.suno`]]):a(``,!0),p.site?.features?.luma?.enabled?c((f(),l(x,{key:4,index:`/luma`},null,512)),[[j,`index.title.luma`]]):a(``,!0),p.site?.features?.headshots?.enabled?c((f(),l(x,{key:5,index:`/headshots`},null,512)),[[j,`index.title.headshots`]]):a(``,!0)]),_:1},8,[`index`]),c(i(x,{onRoute:e=>void 0,onClick:p.onDownload},null,8,[`onClick`]),[[j,`common.nav.mobileApp`]]),c(i(x,{onRoute:e=>void 0,onClick:m[0]||=e=>p.openTab(`https://platform.acedata.cloud`)},null,512),[[j,`common.nav.apiPlatform`]]),c(i(x,{onRoute:e=>void 0,onClick:m[1]||=e=>p.openTab(`https://platform.acedata.cloud/support`)},null,512),[[j,`common.nav.support`]]),c(i(x,{onRoute:e=>void 0,onClick:m[2]||=e=>p.openTab(`https://platform.acedata.cloud/earning`)},null,512),[[j,`common.nav.referral`]])]),_:1},8,[`default-active`,`onSelect`])]),_:1}),i(b,{md:4,xs:11},{default:u(()=>[p.authenticated?(f(),o(`div`,H,[e(`div`,{class:`console`,onClick:m[3]||=(...e)=>p.onConsole&&p.onConsole(...e)},r(p.$t(`common.button.console`)),1),i(k,{trigger:`click`},{dropdown:u(()=>[i(O,null,{default:u(()=>[i(D,{onClick:p.onProfile},{default:u(()=>[n(r(p.$t(`common.button.profile`)),1)]),_:1},8,[`onClick`]),i(D,{onClick:p.onLogout},{default:u(()=>[n(r(p.$t(`common.button.logout`)),1)]),_:1},8,[`onClick`])]),_:1})]),default:u(()=>[e(`img`,{src:p.user?.avatar||p.defaultAvatar,class:`avatar`},null,8,U)]),_:1})])):(f(),o(`div`,V,[i(w,{type:`primary`,class:`float-right`,size:`small`,round:``,onClick:p.onLogin},{default:u(()=>[n(r(p.$t(`common.button.login`)),1)]),_:1},8,[`onClick`]),i(T,{class:`locale float-right mr-4`}),i(E,{class:`float-right mr-4`})]))]),_:1})]),_:1},8,[`class`])}var G=p({name:`LayoutIndex`,components:{TopHeader:O(B,[[`render`,W]]),BottomFooter:z,ElContainer:y,ElMain:g,ElFooter:_,ElHeader:v}});function K(e,t,n,r,a,o){let c=s(`top-header`),d=s(`el-header`),p=s(`router-view`),m=s(`el-main`),h=s(`bottom-footer`),g=s(`el-footer`),_=s(`el-container`);return f(),l(_,{class:`wrapper min-h-[100vh]`},{default:u(()=>[i(d,{class:`header p-0 h-auto`},{default:u(()=>[i(c)]),_:1}),i(m,{class:`main`},{default:u(()=>[i(p)]),_:1}),i(g,{class:`footer p-0 h-auto`},{default:u(()=>[i(h)]),_:1})]),_:1})}var q=O(G,[[`render`,K]]);export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-bWj6JKOh.js";import{n as S,t as C}from"./tabs-fJFBL7Ec.js";import{t as w}from"./upload-CI6V1Tmp.js";import{t as T}from"./tooltip-DkQKkjH2.js";import{t as E}from"./image-C55jrtEM.js";import{t as ee}from"./alert-Cb065PHL.js";import{n as D,r as O}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-Db5ghYmn.js";import{t as A}from"./input-number-hdHVvFlb.js";import{t as te}from"./slider-PZkyQm3l.js";import{t as ne}from"./switch-B5S0_DEy.js";import{ci as j,oi as re,ri as ie,si as ae}from"./constants-DP-FlaZs.js";import{A as M,Gr as N,Hr as oe,Ht as P,Kt as F,Pn as I,Si as L,Ut as se,Vt as R,Wt as z,di as ce,en as B,ni as V,nr as H,pi as U,ti as W}from"./index--0mdiv6n.js";import{t as G}from"./index.es-CqDk1POS.js";import{t as le}from"./CopyToClipboard-rM37oGeG.js";import{t as ue}from"./FilePreview-BB5S0Xlq.js";import{t as K}from"./ImagePreview-Bnd4O5p2.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-plQZIePZ.js";import{i as J,n as fe,t as pe}from"./pagination-axQOBWbU.js";import{t as me}from"./VideoPlayer-BpLkm53d.js";import{t as he}from"./ApiCodeButton-wEJZV72l.js";import{t as ge}from"./BotPlaceholder-ChvD1MjR.js";import{t as _e}from"./NoTasks-B91TpTIf.js";import{t as ve}from"./PromptTextarea-CFxezHFm.js";var ye=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:U,FontAwesomeIcon:G},mixins:[de]}),be={class:`main flex flex-row flex-1 min-h-0`},xe={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ce(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,be,[e(`div`,xe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Se,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=M(ye,[[`render`,Ce],[`__scopeId`,`data-v-b87958dc`]]),Te={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case`kling-video-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Te}}function X(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Y(n,r,i),o=[];return e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),o}function Z(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0);return n}var Ee=v({name:`ModelSelector`,components:{ElSelect:b,ElOption:x},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-video-o1`,label:`Video-o1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),V.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),De={class:`field`},Oe={class:`title font-bold`};function ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,De,[e(`h2`,Oe,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ae=M(Ee,[[`render`,ke],[`__scopeId`,`data-v-04059875`]]),je=v({name:`ModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return j.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),V.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),Me={class:`field`},Ne={class:`header`},Pe={class:`title font-bold`},Fe={key:0,class:`opt-tip`};function Ie(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Me,[e(`div`,Ne,[e(`h2`,Pe,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,Fe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Le=M(je,[[`render`,Ie],[`__scopeId`,`data-v-9a8fa3c5`]]),Re=[3,5,8,10,12,15],ze=[5,10],Be=v({name:`DurationSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return j.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Re:ze},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),V.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),Ve={class:`field`},He={class:`control`},Ue={class:`label`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var Ke=M(Be,[[`render`,Ge],[`__scopeId`,`data-v-5ae55e28`]]),qe=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Je,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ye,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,Ze,i(r.label),1)],10,Xe))),128))])])}var $e=M(qe,[[`render`,Qe],[`__scopeId`,`data-v-cdb14b2f`]]),et=v({name:`StartImage`,components:{ElUpload:w,ElButton:U,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[z,P],emits:[`change`],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ot=M(et,[[`render`,at],[`__scopeId`,`data-v-756dc269`]]),st=v({name:`EndImage`,components:{ElUpload:w,ElButton:U,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[z,P],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Y(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(V.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(V.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),ct={class:`relative`},lt={class:`flex justify-between`},ut={class:`flex justify-start items-center`},dt={class:`text-sm font-bold`};function ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`span`,dt,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var pt=M(st,[[`render`,ft],[`__scopeId`,`data-v-c1b257e5`]]),mt=v({name:`CfgScaleSelector`,components:{ElSlider:te,InfoIcon:J,ElInputNumber:A},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),ht={class:`flex justify-between`},gt={class:`flex justify-start items-center`},_t={class:`text-sm font-bold`},vt={class:`flex justify-end items-center`},yt={class:`w-full`};function bt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,ht,[e(`div`,gt,[e(`span`,_t,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xt=M(mt,[[`render`,bt]]),St=v({name:`GenerateAudioSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(j.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Ct={class:`relative`},wt={class:`flex justify-between items-center`},Tt={class:`flex justify-start items-center`},Et={class:`text-sm font-bold`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`span`,Et,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var Ot=M(St,[[`render`,Dt]]),kt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],At=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:te,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:kt}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Y(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),jt={class:`field`},Mt={class:`header`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`config-grid`},Ft={class:`cfg-row-head`},It={class:`cfg-name`};function Lt(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Pt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Rt=M(At,[[`render`,Lt],[`__scopeId`,`data-v-cd896060`]]),zt=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],Q=`, `;function Bt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Q}${t}`:t}function $(e,t){if(!e||!t)return e||``;let n=[`${t}${Q}`,`${Q}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Vt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zt.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=$(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ht={key:0,class:`pills`,role:`list`},Ut={class:`pill-text`},Wt=[`aria-label`,`onClick`];function Gt(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,Ht,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Ut,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{icon:`fa-solid fa-xmark`})],8,Wt)]))),128))])):o(``,!0)}var Kt=v({name:`PromptInput`,components:{ElButton:U,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:M(Vt,[[`render`,Gt],[`__scopeId`,`data-v-5fc4fa65`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function qt(e,t,n,o,s,c){let u=l(`font-awesome-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{icon:`fa-regular fa-lightbulb`,class:`mr-1`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Jt=M(Kt,[[`render`,qt],[`__scopeId`,`data-v-c01fc1a6`]]),Yt=v({name:`NegativePromptInput`,components:{ElInput:L,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Xt={class:`field`},Zt={class:`box`},Qt={class:`title font-bold`};function $t(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Xt,[e(`div`,Zt,[e(`h2`,Qt,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var en=M(Yt,[[`render`,$t],[`__scopeId`,`data-v-de98cf01`]]),tn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:U,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zt,Close:y}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt($(this.prompt,e)):this.setPrompt(Bt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=$(e,t);this.setPrompt(e)}}}),nn={class:`drawer-content`},rn={class:`drawer-header`},an={class:`title-row`},on={class:`title`},sn={class:`hint`},cn={key:0,class:`selected-bar`},ln={class:`selected-text`},un={class:`groups`},dn={class:`group-title`},fn={class:`chip-grid`},pn=[`onClick`];function mn(t,u,d,m,_,v){let y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-drawer`);return g(),f(x,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,nn,[e(`div`,rn,[e(`div`,an,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,on,i(t.$t(`kling.inspiration.title`)),1)]),a(b,{text:``,icon:t.Close,class:`close-btn`,onClick:u[0]||=e=>t.visible=!1},null,8,[`icon`])]),e(`div`,sn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cn,[e(`span`,ln,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(b,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fn,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hn=M(tn,[[`render`,mn],[`__scopeId`,`data-v-7d457a69`]]),gn={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-video-o1":`Video-o1`},_n={std:`720p`,pro:`1080p`,"4k":`4K`},vn=v({name:`SummaryChip`,components:{FontAwesomeIcon:G},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _n[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yn={class:`summary-chip`},bn=[`title`],xn=[`title`],Sn=[`title`],Cn=[`title`],wn=[`title`];function Tn(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,yn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,bn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,wn)):o(``,!0)])}var En=v({name:`ConfigPanel`,components:{ElButton:U,Consumption:q,FontAwesomeIcon:G,PromptInput:Jt,NegativePromptInput:en,ModelSelector:Ae,ModeSelector:Le,DurationSelector:Ke,RatioSelector:$e,StartImage:ot,CfgScaleSelector:xt,GenerateAudioSelector:Ot,CameraControlSelector:Rt,InspirationDrawer:hn,SummaryChip:M(vn,[[`render`,Tn],[`__scopeId`,`data-v-418a6733`]]),EndImage:pt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return F(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Dn={class:`flex flex-col h-full`},On={class:`flex-1 overflow-y-auto p-5`},kn={class:`flex flex-col items-center justify-center px-5 pb-5`};function An(t,n,o,c,u,d){let m=l(`prompt-input`),h=l(`model-selector`),_=l(`ratio-selector`),v=l(`start-image`),y=l(`end-image`),b=l(`duration-selector`),x=l(`mode-selector`),S=l(`generate-audio-selector`),C=l(`camera-control-selector`),w=l(`cfg-scale-selector`),T=l(`negative-prompt-input`),E=l(`summary-chip`),ee=l(`consumption`),D=l(`font-awesome-icon`),O=l(`el-button`),k=l(`inspiration-drawer`);return g(),s(`div`,Dn,[e(`div`,On,[a(m,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-2`}),a(y,{class:`mb-2`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`})]),e(`div`,kn,[a(E),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(O,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(O,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(k,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jn=M(En,[[`render`,An]]),Mn=v({name:`MotionImage`,components:{ElUpload:w,ElButton:U,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[z,P],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nn={class:`relative`},Pn={class:`flex justify-between`},Fn={class:`flex justify-start items-center`},In={class:`text-sm font-bold`};function Ln(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nn,[e(`div`,Pn,[e(`div`,Fn,[e(`span`,In,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rn=M(Mn,[[`render`,Ln],[`__scopeId`,`data-v-e52eaf2f`]]),zn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:U,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[P],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){V.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){V.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(V.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(V.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Bn={class:`relative`},Vn={class:`flex justify-between`},Hn={class:`flex justify-start items-center`},Un={class:`text-sm font-bold`};function Wn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gn=M(zn,[[`render`,Wn],[`__scopeId`,`data-v-7019a8d2`]]),Kn=v({name:`MotionPromptInput`,components:{ElInput:L,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qn={class:`field`},Jn={class:`box`},Yn={class:`title font-bold`};function Xn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qn,[e(`div`,Jn,[e(`h2`,Yn,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zn=M(Kn,[[`render`,Xn],[`__scopeId`,`data-v-ca9fdbe5`]]),Qn=`video`,$n=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:O,ElRadioButton:D,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qn},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Qn)}}),er={class:`field`},tr={class:`header`},nr={class:`text-sm font-bold`};function rr(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ir=M($n,[[`render`,rr],[`__scopeId`,`data-v-7a91195b`]]),ar=`std`,or=v({name:`MotionModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ar},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ar)}}),sr={class:`field`},cr={class:`header`},lr={class:`title font-bold`};function ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var dr=M(or,[[`render`,ur],[`__scopeId`,`data-v-1295688c`]]),fr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),pr={class:`relative`},mr={class:`flex justify-between items-center`},hr={class:`flex justify-start items-center`},gr={class:`text-sm font-bold`};function _r(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,pr,[e(`div`,mr,[e(`div`,hr,[e(`span`,gr,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var vr=v({name:`MotionPanel`,components:{ElButton:U,FontAwesomeIcon:G,Consumption:q,MotionImage:Rn,MotionVideo:Gn,MotionPromptInput:Zn,CharacterOrientationSelector:ir,MotionModeSelector:dr,KeepOriginalSoundSelector:M(fr,[[`render`,_r]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return F(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),yr={class:`flex flex-col h-full`},br={class:`flex-1 overflow-y-auto p-5`},xr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Sr(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-mode-selector`),y=l(`keep-original-sound-selector`),b=l(`consumption`),x=l(`font-awesome-icon`),S=l(`el-button`);return g(),s(`div`,yr,[e(`div`,br,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`})]),e(`div`,xr,[a(b,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(S,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(x,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Cr=M(vr,[[`render`,Sr]]),wr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:ce},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Tr=[`title`],Er={class:`text`};function Dr(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs`,stretch:``,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Er,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Tr)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Or=M(wr,[[`render`,Dr],[`__scopeId`,`data-v-fda33e4c`]]),kr={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},Ar=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ae.map(e=>({value:e,label:kr[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=re)}}),jr={class:`field`},Mr={class:`title font-bold`};function Nr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,jr,[e(`h2`,Mr,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Pr=M(Ar,[[`render`,Nr],[`__scopeId`,`data-v-cbc83d11`]]),Fr=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:b,ElOption:x},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ir={class:`field`},Lr={class:`title font-bold`};function Rr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ir,[e(`h2`,Lr,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var zr=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:U,ElInput:L,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Pr,ModeSelector:M(Fr,[[`render`,Rr],[`__scopeId`,`data-v-92525a1d`]])},mixins:[P],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:N()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return F({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){V.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){V.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),Br={class:`flex flex-col h-full`},Vr={class:`flex-1 overflow-y-auto p-5`},Hr={class:`relative mb-4`},Ur={class:`flex justify-start items-center`},Wr={class:`text-sm font-bold`},Gr={class:`relative mb-4`},Kr={class:`flex justify-start items-center`},qr={class:`text-sm font-bold`},Jr=[`src`],Yr={class:`mb-4`},Xr={class:`flex justify-start items-center`},Zr={class:`text-sm font-bold`},Qr={class:`flex flex-col items-center justify-center px-5 pb-5`};function $r(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`font-awesome-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`);return g(),s(`div`,Br,[e(`div`,Vr,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Hr,[e(`div`,Ur,[e(`span`,Wr,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Gr,[e(`div`,Kr,[e(`span`,qr,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,Jr)):o(``,!0)]),e(`div`,Yr,[e(`div`,Xr,[e(`span`,Zr,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,Qr,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(b,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var ei=M(zr,[[`render`,$r],[`__scopeId`,`data-v-27261e35`]]),ti=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:ee,VideoPlayer:me,ElTooltip:T,ElButton:U,ImagePreview:K,ApiCodeButton:he},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),ni={class:`preview`},ri={class:`left`},ii={class:`main`},ai={class:`bot`},oi={class:`datetime`},si={class:`info`},ci={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},li={key:1,class:`prompt mt-2`},ui={key:0},di={key:1},fi={key:0,class:n({content:!0,failed:!0})},pi={key:0,class:`mb-4`},mi={key:1,class:n({operations:!0,"mt-2":!0})},hi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_i={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},vi={key:1,class:n({content:!0})},yi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Si={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ci={key:2,class:n({content:!0})},wi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ti={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ei(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-player`),x=l(`el-button`),S=l(`el-tooltip`),C=l(`api-code-button`),w=l(`font-awesome-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`);return g(),s(`div`,ni,[e(`div`,ri,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,ii,[e(`div`,ai,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,oi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,si,[t.referenceImages.length>0?(g(),s(`div`,ci,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:t,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,li,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,ui,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,di,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,fi,[t.modelValue?.response.video_url?(g(),s(`div`,pi,[a(b,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,mi,[a(S,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(x,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(C,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,hi,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,gi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,_i,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,vi,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,yi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,bi,[a(w,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(T,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,xi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,Si,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Ci,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,wi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Ti,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Di=v({name:`RecentPanel`,components:{TaskPreview:M(ti,[[`render`,Ei],[`__scopeId`,`data-v-c36bfd7f`]]),NoTasks:_e,BotPlaceholder:ge,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Oi={key:0},ki={key:2,class:`w-full h-full flex items-center justify-center`};function Ai(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Oi,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ki,[a(v)])):o(``,!0)],64)}var ji=v({name:`KlingIndex`,components:{ConfigPanel:jn,MotionPanel:Cr,TalkingPhotoPanel:ei,TabSwitcher:Or,Layout:we,RecentPanel:M(Di,[[`render`,Ai]])},mixins:[se],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await pe({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!R(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0};if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){V.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!B())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}V.info(this.$t(`kling.message.startingTask`)),H(`kling`,I.generate(n,{token:r})).then(()=>{V.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`kling.message.usedUp`)):V.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!R(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){V.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.prompt?{prompt:e.prompt}:{},async:!0};if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}V.info(this.$t(`kling.message.startingTask`)),H(`kling`,I.motion(t,{token:n})).then(()=>{V.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`kling.message.usedUp`)):V.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!R(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){V.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}V.info(this.$t(`kling.message.startingTask`)),H(`kling`,I.talkingPhoto(t,{token:n})).then(()=>{V.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`kling.message.usedUp`)):V.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Mi={class:`flex flex-col h-full`},Ni={class:`flex-1 min-h-0`};function Pi(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,Mi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Ni,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Fi=M(ji,[[`render`,Pi]]);export{Fi as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-cneeY9MM.js";import{n as S,t as C}from"./tabs-1RRUdwoi.js";import{t as w}from"./upload-ohhqrmbr.js";import{t as T}from"./tooltip-CTq93bCk.js";import{t as E}from"./image-BvgUWmMy.js";import{t as ee}from"./alert-DW2f5QJd.js";import{n as D,r as O}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-CvYmKHDT.js";import{t as A}from"./input-number-CCXEBkO1.js";import{t as te}from"./slider-CupVoLKb.js";import{t as ne}from"./switch-5_7n8H4N.js";import{ci as j,oi as re,ri as ie,si as ae}from"./constants-m8v8ZYCt.js";import{A as M,Gr as N,Hr as oe,Ht as P,Kt as F,Pn as I,Si as L,Ut as se,Vt as R,Wt as z,di as ce,en as B,ni as V,nr as H,pi as U,ti as W}from"./index-fG4UBOrU.js";import{t as G}from"./index.es-B6As_4fv.js";import{t as le}from"./CopyToClipboard-DyeZXE6t.js";import{t as ue}from"./FilePreview-DTcjqstx.js";import{t as K}from"./ImagePreview-CKbTygXY.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-tsEBkXA_.js";import{i as J,n as fe,t as pe}from"./pagination-Cyrdi4fl.js";import{t as me}from"./VideoPlayer-CriAR22U.js";import{t as he}from"./ApiCodeButton-B70yUVoU.js";import{t as ge}from"./BotPlaceholder-DadzfRCY.js";import{t as _e}from"./NoTasks-ZvwF_hcs.js";import{t as ve}from"./PromptTextarea-BOJjxXFh.js";var ye=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:U,FontAwesomeIcon:G},mixins:[de]}),be={class:`main flex flex-row flex-1 min-h-0`},xe={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ce(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,be,[e(`div`,xe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Se,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=M(ye,[[`render`,Ce],[`__scopeId`,`data-v-b87958dc`]]),Te={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case`kling-video-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Te}}function X(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Y(n,r,i),o=[];return e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),o}function Z(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0);return n}var Ee=v({name:`ModelSelector`,components:{ElSelect:b,ElOption:x},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-video-o1`,label:`Video-o1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),V.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),De={class:`field`},Oe={class:`title font-bold`};function ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,De,[e(`h2`,Oe,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ae=M(Ee,[[`render`,ke],[`__scopeId`,`data-v-04059875`]]),je=v({name:`ModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return j.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),V.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),Me={class:`field`},Ne={class:`header`},Pe={class:`title font-bold`},Fe={key:0,class:`opt-tip`};function Ie(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Me,[e(`div`,Ne,[e(`h2`,Pe,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,Fe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Le=M(je,[[`render`,Ie],[`__scopeId`,`data-v-9a8fa3c5`]]),Re=[3,5,8,10,12,15],ze=[5,10],Be=v({name:`DurationSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return j.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Re:ze},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),V.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),Ve={class:`field`},He={class:`control`},Ue={class:`label`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var Ke=M(Be,[[`render`,Ge],[`__scopeId`,`data-v-5ae55e28`]]),qe=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Je,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ye,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,Ze,i(r.label),1)],10,Xe))),128))])])}var $e=M(qe,[[`render`,Qe],[`__scopeId`,`data-v-cdb14b2f`]]),et=v({name:`StartImage`,components:{ElUpload:w,ElButton:U,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[z,P],emits:[`change`],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ot=M(et,[[`render`,at],[`__scopeId`,`data-v-756dc269`]]),st=v({name:`EndImage`,components:{ElUpload:w,ElButton:U,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[z,P],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Y(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(V.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(V.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),ct={class:`relative`},lt={class:`flex justify-between`},ut={class:`flex justify-start items-center`},dt={class:`text-sm font-bold`};function ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`span`,dt,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var pt=M(st,[[`render`,ft],[`__scopeId`,`data-v-c1b257e5`]]),mt=v({name:`CfgScaleSelector`,components:{ElSlider:te,InfoIcon:J,ElInputNumber:A},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),ht={class:`flex justify-between`},gt={class:`flex justify-start items-center`},_t={class:`text-sm font-bold`},vt={class:`flex justify-end items-center`},yt={class:`w-full`};function bt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,ht,[e(`div`,gt,[e(`span`,_t,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xt=M(mt,[[`render`,bt]]),St=v({name:`GenerateAudioSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(j.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Ct={class:`relative`},wt={class:`flex justify-between items-center`},Tt={class:`flex justify-start items-center`},Et={class:`text-sm font-bold`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`span`,Et,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var Ot=M(St,[[`render`,Dt]]),kt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],At=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:te,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:kt}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Y(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),jt={class:`field`},Mt={class:`header`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`config-grid`},Ft={class:`cfg-row-head`},It={class:`cfg-name`};function Lt(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Pt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Rt=M(At,[[`render`,Lt],[`__scopeId`,`data-v-cd896060`]]),zt=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],Q=`, `;function Bt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Q}${t}`:t}function $(e,t){if(!e||!t)return e||``;let n=[`${t}${Q}`,`${Q}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Vt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zt.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=$(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ht={key:0,class:`pills`,role:`list`},Ut={class:`pill-text`},Wt=[`aria-label`,`onClick`];function Gt(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,Ht,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Ut,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{icon:`fa-solid fa-xmark`})],8,Wt)]))),128))])):o(``,!0)}var Kt=v({name:`PromptInput`,components:{ElButton:U,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:M(Vt,[[`render`,Gt],[`__scopeId`,`data-v-5fc4fa65`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function qt(e,t,n,o,s,c){let u=l(`font-awesome-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{icon:`fa-regular fa-lightbulb`,class:`mr-1`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Jt=M(Kt,[[`render`,qt],[`__scopeId`,`data-v-c01fc1a6`]]),Yt=v({name:`NegativePromptInput`,components:{ElInput:L,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Xt={class:`field`},Zt={class:`box`},Qt={class:`title font-bold`};function $t(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Xt,[e(`div`,Zt,[e(`h2`,Qt,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var en=M(Yt,[[`render`,$t],[`__scopeId`,`data-v-de98cf01`]]),tn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:U,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zt,Close:y}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt($(this.prompt,e)):this.setPrompt(Bt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=$(e,t);this.setPrompt(e)}}}),nn={class:`drawer-content`},rn={class:`drawer-header`},an={class:`title-row`},on={class:`title`},sn={class:`hint`},cn={key:0,class:`selected-bar`},ln={class:`selected-text`},un={class:`groups`},dn={class:`group-title`},fn={class:`chip-grid`},pn=[`onClick`];function mn(t,u,d,m,_,v){let y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-drawer`);return g(),f(x,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,nn,[e(`div`,rn,[e(`div`,an,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,on,i(t.$t(`kling.inspiration.title`)),1)]),a(b,{text:``,icon:t.Close,class:`close-btn`,onClick:u[0]||=e=>t.visible=!1},null,8,[`icon`])]),e(`div`,sn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cn,[e(`span`,ln,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(b,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fn,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hn=M(tn,[[`render`,mn],[`__scopeId`,`data-v-7d457a69`]]),gn={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-video-o1":`Video-o1`},_n={std:`720p`,pro:`1080p`,"4k":`4K`},vn=v({name:`SummaryChip`,components:{FontAwesomeIcon:G},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _n[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yn={class:`summary-chip`},bn=[`title`],xn=[`title`],Sn=[`title`],Cn=[`title`],wn=[`title`];function Tn(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,yn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,bn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,wn)):o(``,!0)])}var En=v({name:`ConfigPanel`,components:{ElButton:U,Consumption:q,FontAwesomeIcon:G,PromptInput:Jt,NegativePromptInput:en,ModelSelector:Ae,ModeSelector:Le,DurationSelector:Ke,RatioSelector:$e,StartImage:ot,CfgScaleSelector:xt,GenerateAudioSelector:Ot,CameraControlSelector:Rt,InspirationDrawer:hn,SummaryChip:M(vn,[[`render`,Tn],[`__scopeId`,`data-v-418a6733`]]),EndImage:pt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return F(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Dn={class:`flex flex-col h-full`},On={class:`flex-1 overflow-y-auto p-5`},kn={class:`flex flex-col items-center justify-center px-5 pb-5`};function An(t,n,o,c,u,d){let m=l(`prompt-input`),h=l(`model-selector`),_=l(`ratio-selector`),v=l(`start-image`),y=l(`end-image`),b=l(`duration-selector`),x=l(`mode-selector`),S=l(`generate-audio-selector`),C=l(`camera-control-selector`),w=l(`cfg-scale-selector`),T=l(`negative-prompt-input`),E=l(`summary-chip`),ee=l(`consumption`),D=l(`font-awesome-icon`),O=l(`el-button`),k=l(`inspiration-drawer`);return g(),s(`div`,Dn,[e(`div`,On,[a(m,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-2`}),a(y,{class:`mb-2`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`})]),e(`div`,kn,[a(E),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(O,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(O,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(k,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jn=M(En,[[`render`,An]]),Mn=v({name:`MotionImage`,components:{ElUpload:w,ElButton:U,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[z,P],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nn={class:`relative`},Pn={class:`flex justify-between`},Fn={class:`flex justify-start items-center`},In={class:`text-sm font-bold`};function Ln(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nn,[e(`div`,Pn,[e(`div`,Fn,[e(`span`,In,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rn=M(Mn,[[`render`,Ln],[`__scopeId`,`data-v-e52eaf2f`]]),zn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:U,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[P],data(){return{fileList:[],uploadUrl:N()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){V.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){V.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(V.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(V.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Bn={class:`relative`},Vn={class:`flex justify-between`},Hn={class:`flex justify-start items-center`},Un={class:`text-sm font-bold`};function Wn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gn=M(zn,[[`render`,Wn],[`__scopeId`,`data-v-7019a8d2`]]),Kn=v({name:`MotionPromptInput`,components:{ElInput:L,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qn={class:`field`},Jn={class:`box`},Yn={class:`title font-bold`};function Xn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qn,[e(`div`,Jn,[e(`h2`,Yn,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zn=M(Kn,[[`render`,Xn],[`__scopeId`,`data-v-ca9fdbe5`]]),Qn=`video`,$n=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:O,ElRadioButton:D,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qn},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Qn)}}),er={class:`field`},tr={class:`header`},nr={class:`text-sm font-bold`};function rr(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ir=M($n,[[`render`,rr],[`__scopeId`,`data-v-7a91195b`]]),ar=`std`,or=v({name:`MotionModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ar},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ar)}}),sr={class:`field`},cr={class:`header`},lr={class:`title font-bold`};function ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var dr=M(or,[[`render`,ur],[`__scopeId`,`data-v-1295688c`]]),fr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),pr={class:`relative`},mr={class:`flex justify-between items-center`},hr={class:`flex justify-start items-center`},gr={class:`text-sm font-bold`};function _r(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,pr,[e(`div`,mr,[e(`div`,hr,[e(`span`,gr,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var vr=v({name:`MotionPanel`,components:{ElButton:U,FontAwesomeIcon:G,Consumption:q,MotionImage:Rn,MotionVideo:Gn,MotionPromptInput:Zn,CharacterOrientationSelector:ir,MotionModeSelector:dr,KeepOriginalSoundSelector:M(fr,[[`render`,_r]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return F({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),yr={class:`flex flex-col h-full`},br={class:`flex-1 overflow-y-auto p-5`},xr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Sr(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-mode-selector`),y=l(`keep-original-sound-selector`),b=l(`consumption`),x=l(`font-awesome-icon`),S=l(`el-button`);return g(),s(`div`,yr,[e(`div`,br,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`})]),e(`div`,xr,[a(b,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(S,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(x,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Cr=M(vr,[[`render`,Sr]]),wr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:ce},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Tr=[`title`],Er={class:`text`};function Dr(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs`,stretch:``,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Er,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Tr)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Or=M(wr,[[`render`,Dr],[`__scopeId`,`data-v-fda33e4c`]]),kr={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},Ar=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ae.map(e=>({value:e,label:kr[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=re)}}),jr={class:`field`},Mr={class:`title font-bold`};function Nr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,jr,[e(`h2`,Mr,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Pr=M(Ar,[[`render`,Nr],[`__scopeId`,`data-v-cbc83d11`]]),Fr=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:b,ElOption:x},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ir={class:`field`},Lr={class:`title font-bold`};function Rr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ir,[e(`h2`,Lr,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var zr=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:U,ElInput:L,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Pr,ModeSelector:M(Fr,[[`render`,Rr],[`__scopeId`,`data-v-92525a1d`]])},mixins:[P],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:N()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return F({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){V.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){V.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){V.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){V.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),Br={class:`flex flex-col h-full`},Vr={class:`flex-1 overflow-y-auto p-5`},Hr={class:`relative mb-4`},Ur={class:`flex justify-start items-center`},Wr={class:`text-sm font-bold`},Gr={class:`relative mb-4`},Kr={class:`flex justify-start items-center`},qr={class:`text-sm font-bold`},Jr=[`src`],Yr={class:`mb-4`},Xr={class:`flex justify-start items-center`},Zr={class:`text-sm font-bold`},Qr={class:`flex flex-col items-center justify-center px-5 pb-5`};function $r(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`font-awesome-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`);return g(),s(`div`,Br,[e(`div`,Vr,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Hr,[e(`div`,Ur,[e(`span`,Wr,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Gr,[e(`div`,Kr,[e(`span`,qr,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,Jr)):o(``,!0)]),e(`div`,Yr,[e(`div`,Xr,[e(`span`,Zr,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,Qr,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(b,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var ei=M(zr,[[`render`,$r],[`__scopeId`,`data-v-27261e35`]]),ti=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:ee,VideoPlayer:me,ElTooltip:T,ElButton:U,ImagePreview:K,ApiCodeButton:he},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),ni={class:`preview`},ri={class:`left`},ii={class:`main`},ai={class:`bot`},oi={class:`datetime`},si={class:`info`},ci={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},li={key:1,class:`prompt mt-2`},ui={key:0},di={key:1},fi={key:0,class:n({content:!0,failed:!0})},pi={key:0,class:`mb-4`},mi={key:1,class:n({operations:!0,"mt-2":!0})},hi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_i={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},vi={key:1,class:n({content:!0})},yi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Si={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ci={key:2,class:n({content:!0})},wi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ti={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ei(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-player`),x=l(`el-button`),S=l(`el-tooltip`),C=l(`api-code-button`),w=l(`font-awesome-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`);return g(),s(`div`,ni,[e(`div`,ri,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,ii,[e(`div`,ai,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,oi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,si,[t.referenceImages.length>0?(g(),s(`div`,ci,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:t,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,li,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,ui,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,di,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,fi,[t.modelValue?.response.video_url?(g(),s(`div`,pi,[a(b,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,mi,[a(S,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(x,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(C,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,hi,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,gi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,_i,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,vi,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,yi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,bi,[a(w,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(T,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,xi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,Si,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Ci,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,wi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Ti,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Di=v({name:`RecentPanel`,components:{TaskPreview:M(ti,[[`render`,Ei],[`__scopeId`,`data-v-c36bfd7f`]]),NoTasks:_e,BotPlaceholder:ge,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Oi={key:0},ki={key:2,class:`w-full h-full flex items-center justify-center`};function Ai(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Oi,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ki,[a(v)])):o(``,!0)],64)}var ji=v({name:`KlingIndex`,components:{ConfigPanel:jn,MotionPanel:Cr,TalkingPhotoPanel:ei,TabSwitcher:Or,Layout:we,RecentPanel:M(Di,[[`render`,Ai]])},mixins:[se],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await pe({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!R(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0};if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){V.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!B())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}V.info(this.$t(`kling.message.startingTask`)),H(`kling`,I.generate(n,{token:r})).then(()=>{V.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`kling.message.usedUp`)):V.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!R(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){V.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.prompt?{prompt:e.prompt}:{},async:!0};if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}V.info(this.$t(`kling.message.startingTask`)),H(`kling`,I.motion(t,{token:n})).then(()=>{V.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`kling.message.usedUp`)):V.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!R(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){V.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}V.info(this.$t(`kling.message.startingTask`)),H(`kling`,I.talkingPhoto(t,{token:n})).then(()=>{V.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`kling.message.usedUp`)):V.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Mi={class:`flex flex-col h-full`},Ni={class:`flex-1 min-h-0`};function Pi(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,Mi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Ni,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Fi=M(ji,[[`render`,Pi]]);export{Fi as default};
|