@acedatacloud/nexior 3.329.2 → 3.329.3
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-DpyJUC7o.js → ApiCodeButton-DYEAsDAB.js} +1 -1
- package/dist/assets/{Artifacts-DT3wCVBL.js → Artifacts-1J9EJpje.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BfBsfiHC.js → AskUserQuestionCard-IhmU5xz7.js} +1 -1
- package/dist/assets/{AudioPreview-D6-IjBIh.js → AudioPreview-CfaWG6HL.js} +1 -1
- package/dist/assets/{Auth-B-Wgb8zT.js → Auth-B_ur3sCP.js} +1 -1
- package/dist/assets/{Bare-DREZRrOE.js → Bare-BA5ErudK.js} +1 -1
- package/dist/assets/{BotPlaceholder-BWTcdFIK.js → BotPlaceholder-CshzKiK2.js} +1 -1
- package/dist/assets/{BottomFooter-B5Q49OPu.js → BottomFooter-C2Xb1WTE.js} +1 -1
- package/dist/assets/{Callback-CRuzCrWd.js → Callback-CaRTM-OF.js} +1 -1
- package/dist/assets/{CodeSnippet-CunyGGML.js → CodeSnippet-B9suHgwr.js} +1 -1
- package/dist/assets/{Console-CLWD49fm.js → Console-DQgfiOol.js} +1 -1
- package/dist/assets/{Consumption-Mwj5RjX7.js → Consumption-OOugR-e4.js} +1 -1
- package/dist/assets/{Conversation-15TOVcDO.js → Conversation-Cqi_-YMc.js} +1 -1
- package/dist/assets/{Conversation-BTD_VA4M.js → Conversation-VUNsXAUO.js} +1 -1
- package/dist/assets/{CopyToClipboard-Bk1nRi-n.js → CopyToClipboard-B6HsusZG.js} +1 -1
- package/dist/assets/{Detail-2jbPql9F.js → Detail-CYoa8NYt.js} +2 -2
- package/dist/assets/{Extra-ChGnrFK9.js → Extra-CROqN5s-.js} +1 -1
- package/dist/assets/{FilePreview-CMTQuorI.js → FilePreview-C9dXaih4.js} +1 -1
- package/dist/assets/{Hailuo-Bb7VQwkv.js → Hailuo-Cf1PqMau.js} +1 -1
- package/dist/assets/{History-CXxCG7T4.js → History-Br9sYjwh.js} +1 -1
- package/dist/assets/{ImagePreview-CbaJ2SD9.js → ImagePreview-BFEnePFT.js} +1 -1
- package/dist/assets/{ImageWrapper-BQLEPXVj.js → ImageWrapper-Ddv3p9BH.js} +1 -1
- package/dist/assets/{Index-CALRyNnV.js → Index-B1GYdIv1.js} +1 -1
- package/dist/assets/{Index-CbesAGvB2.js → Index-B8DGbScD2.js} +1 -1
- package/dist/assets/{Index-CyVpxnVY.js → Index-BVrH8QYq.js} +1 -1
- package/dist/assets/{Index-CsIImPgC.js → Index-BfowYe8_.js} +1 -1
- package/dist/assets/{Index-9flP5h1j.js → Index-C-BOyDyw.js} +1 -1
- package/dist/assets/{Index-Bkv_PNoc.js → Index-C2VokLq-.js} +1 -1
- package/dist/assets/{Index-1qEXXP6g2.js → Index-C2jzwJ1n2.js} +1 -1
- package/dist/assets/{Index-DSP9EXdI.js → Index-CAuxXWIs.js} +1 -1
- package/dist/assets/{Index-BQt1cW1A.js → Index-CAxkPAlE.js} +1 -1
- package/dist/assets/{Index-BofWbs6Y2.js → Index-CEyU3DCj2.js} +1 -1
- package/dist/assets/{Index-DzlfgIbr.js → Index-CFk-Pnnx.js} +1 -1
- package/dist/assets/{Index-Di4lMl8s.js → Index-CW5xVs3S.js} +1 -1
- package/dist/assets/{Index-IhSDg1Gu2.js → Index-Cfn9jrCC2.js} +1 -1
- package/dist/assets/{Index-CgdIQ0Kh.js → Index-Cj0vNEoh.js} +1 -1
- package/dist/assets/{Index-Bu2sN3Ap.js → Index-CjnFXlcf.js} +1 -1
- package/dist/assets/{Index-CxSe_3IY.js → Index-CmFT-g6s.js} +1 -1
- package/dist/assets/{Index-Db1I-_sC.js → Index-CrS2dHDB.js} +1 -1
- package/dist/assets/{Index-3R_wKBp4.js → Index-CtF7oC1A.js} +1 -1
- package/dist/assets/{Index-CzclUObJ2.js → Index-DALysv5Q2.js} +1 -1
- package/dist/assets/{Index-Byb2v5z2.js → Index-DDwEXRY5.js} +1 -1
- package/dist/assets/{Index-DPDedaCl2.js → Index-DELfoPST2.js} +1 -1
- package/dist/assets/{Index-D7PnJ80S2.js → Index-D_MhsqRZ2.js} +1 -1
- package/dist/assets/{Index-BXXGLJrg.js → Index-DeoaxFNt.js} +1 -1
- package/dist/assets/{Index-DMj_04zq.js → Index-DkQoFYPY.js} +1 -1
- package/dist/assets/{Index-CaCCM6EW.js → Index-Dkm2dpsx.js} +1 -1
- package/dist/assets/{Index-O9lnW9H8.js → Index-FEeM0Vh4.js} +1 -1
- package/dist/assets/{Index-DZ6JZkAY.js → Index-K7MIOQcH.js} +1 -1
- package/dist/assets/{Index-n8CrivCG.js → Index-KIFO9Ncn.js} +1 -1
- package/dist/assets/{Index-Ccc9ea1S.js → Index-LgNlMecI.js} +1 -1
- package/dist/assets/{Index-CvvAULqH.js → Index-ZDpyNLhi.js} +1 -1
- package/dist/assets/{Invitees-BW3erziF.js → Invitees-DC1B14Hg.js} +1 -1
- package/dist/assets/{List-CwhgRNLS.js → List-B7ZsLYho.js} +1 -1
- package/dist/assets/{List-DViUqd9y.js → List-C3eielzk.js} +1 -1
- package/dist/assets/{List-BXbcCN-f.js → List-C8u3cFOE.js} +1 -1
- package/dist/assets/{LocalTools-D_wbqvvS.js → LocalTools-hx8nGfre.js} +1 -1
- package/dist/assets/{LocalTools-DwuhLEJv.js → LocalTools-jyNjH-zv.js} +1 -1
- package/dist/assets/{Logo-HhJ0MW7v.js → Logo-Da04kY9l.js} +1 -1
- package/dist/assets/{Main-CVBJB8TA.js → Main-DzYGCPS7.js} +1 -1
- package/dist/assets/{Message-DyLP9tkw.js → Message-D30dTHrl.js} +1 -1
- package/dist/assets/{Model-FCXV8UZG.js → Model-DMzeksc5.js} +1 -1
- package/dist/assets/Navigator-BwmJzSDQ.css +1 -0
- package/dist/assets/Navigator-C8W-E8HW.js +8 -0
- package/dist/assets/{NoTasks-BwTq2H9w.js → NoTasks-CkWyHQ7m.js} +1 -1
- package/dist/assets/{NotFound-BFZuoU2i.js → NotFound-BLuhP6fJ.js} +1 -1
- package/dist/assets/{Pay-BBBATHah.js → Pay-DeBqiala.js} +1 -1
- package/dist/assets/{Player-BYSf72YA.js → Player-DVIMTHm3.js} +1 -1
- package/dist/assets/{PromptTextarea-D7Fwzr_Y.js → PromptTextarea-CWjobThE.js} +1 -1
- package/dist/assets/{RealtimeCall-CajilFCh.js → RealtimeCall-yEje5bgS.js} +1 -1
- package/dist/assets/{ScheduledTasks-sqSeTZU9.js → ScheduledTasks-DCtvvHer.js} +1 -1
- package/dist/assets/{Status-BOy_2Cie.js → Status-BJGtNUh3.js} +1 -1
- package/dist/assets/{Subscribe-B_DB9lwi.js → Subscribe-C_HAS05G.js} +1 -1
- package/dist/assets/{TabSwitcher-CnRyc2my.js → TabSwitcher-D6o_Vhoz.js} +1 -1
- package/dist/assets/{Tts-DaYM4Mqs.js → Tts-Cwppv-dV.js} +1 -1
- package/dist/assets/{VideoPlayer-FouX7LHv.js → VideoPlayer-BghNES0-.js} +1 -1
- package/dist/assets/{alert-_xJIX9qr.js → alert-r5eyCYMk.js} +1 -1
- package/dist/assets/{basic-C2HYPtLG.js → basic-B4tcqGdl.js} +1 -1
- package/dist/assets/{chat-CfQknnqH.js → chat-iYE0So9O.js} +1 -1
- package/dist/assets/{codingBridge-bwOPU8tL.js → codingBridge-Cpi_T_0H.js} +1 -1
- package/dist/assets/{codingBridgeNotify-DO0hOI9C.js → codingBridgeNotify-6SfVVXUj.js} +2 -2
- package/dist/assets/{collapse-C3lFxKRG.js → collapse-DM4CFqEB.js} +1 -1
- package/dist/assets/{common-BPLiRCoF.js → common-7Q5o6gM-.js} +1 -1
- package/dist/assets/{common-D2tuBQCN.js → common-B-ohYxCX.js} +1 -1
- package/dist/assets/{common-DMhCLoSb.js → common-B1FHfW9v.js} +1 -1
- package/dist/assets/{common-oPoLs4in.js → common-Bd72w7MH.js} +1 -1
- package/dist/assets/{common-DIlsYjfU.js → common-C5ZmmHrA.js} +1 -1
- package/dist/assets/{common-Bi-9QQmh.js → common-Cf9CFOaz.js} +1 -1
- package/dist/assets/{common-4eWst1C6.js → common-CleVQgOe.js} +1 -1
- package/dist/assets/{common-iT6JmqME.js → common-CooYdLX1.js} +1 -1
- package/dist/assets/{common-CueiUtkx.js → common-Cs7AuUVP.js} +1 -1
- package/dist/assets/common-CtP4rahV.js +1 -0
- package/dist/assets/{common-Bk1l4VlZ.js → common-DEQEJoSQ.js} +1 -1
- package/dist/assets/{common-LP3eXUPq.js → common-DGTJNjb0.js} +1 -1
- package/dist/assets/{common-CrRsEu05.js → common-DGm_Ys8S.js} +1 -1
- package/dist/assets/{common-BeHbm3PH.js → common-Dgxvbj6q.js} +1 -1
- package/dist/assets/{common-BsKVFQp3.js → common-Din9qyzk.js} +1 -1
- package/dist/assets/{common-CHTz8m3E.js → common-DlQq8PNu.js} +1 -1
- package/dist/assets/{common-C8zseZhj.js → common-DuhIgjlk.js} +1 -1
- package/dist/assets/{common-ZUHlETmx.js → common-ZewnhqmB.js} +1 -1
- package/dist/assets/{constants-BYU0Mi8o.js → constants-D8dwgBQJ.js} +1 -1
- package/dist/assets/{createTaskActions-BC5j7kXt.js → createTaskActions-CzI1YE1u.js} +1 -1
- package/dist/assets/{date-picker-BL8VEdss.js → date-picker-CCW3QD58.js} +1 -1
- package/dist/assets/{digitalhuman-B850Z8JR.js → digitalhuman-Cog3Uxc3.js} +1 -1
- package/dist/assets/{drawer-DPh8Fl2E.js → drawer-nKUsNUqU.js} +1 -1
- package/dist/assets/{dropdown-BBqH0BFX.js → dropdown-CE3OnWHD.js} +1 -1
- package/dist/assets/{dropdown-BYgx8f2W.js → dropdown-DtxdOj7U.js} +1 -1
- package/dist/assets/{esm-fFUkarvh.js → esm-5UYqGz4K.js} +3 -3
- package/dist/assets/{esm-ZQptvXr4.js → esm-B8J6K146.js} +2 -2
- package/dist/assets/{esm-BgHbHgg8.js → esm-BFkaaWQL.js} +1 -1
- package/dist/assets/{esm-CMMJ2Gtl.js → esm-CeDDQAvK.js} +1 -1
- package/dist/assets/{esm-BZog_s2-.js → esm-CftRDIGa.js} +1 -1
- package/dist/assets/esm-D4-PA1wl.js +1 -0
- package/dist/assets/{esm-bTzyoOYV.js → esm-olbJxGuc.js} +2 -2
- package/dist/assets/{fish-wcvY8Yhh.js → fish-B0HCuEta.js} +1 -1
- package/dist/assets/{flux-DcsN3CAR.js → flux-CC2ReYJZ.js} +1 -1
- package/dist/assets/{grokvideo-Ckhxu_ye.js → grokvideo-BORaOUPh.js} +1 -1
- package/dist/assets/{hailuo-CUlnVVrg.js → hailuo-62EUGC6_.js} +1 -1
- package/dist/assets/{headshots-CNl98iOn.js → headshots-DQTDV6wL.js} +1 -1
- package/dist/assets/{i18n-CczuUNCK.js → i18n-BSdsVp0O.js} +1 -1
- package/dist/assets/{image-BjapOX8j.js → image-DaPFm5t3.js} +1 -1
- package/dist/assets/{index-s1lrp6nN.js → index-BrXcZpB0.js} +4 -4
- package/dist/assets/{index.browser.esm-B8hNRw1I.js → index.browser.esm-ht6Mtr3d.js} +1 -1
- package/dist/assets/{index.es-BtwnN9TZ.js → index.es-Cd6zh83v.js} +1 -1
- package/dist/assets/{input-number-B8yYDeUw.js → input-number-BmoiWw1O.js} +1 -1
- package/dist/assets/{kling-YaEqW24j.js → kling-CL0ENiY0.js} +1 -1
- package/dist/assets/{luma-B6swXiir.js → luma-DhXr4qaQ.js} +1 -1
- package/dist/assets/{maestro-DuAZI6qA.js → maestro-BYaN2I-_.js} +1 -1
- package/dist/assets/{maestro-BSA31vV2.js → maestro-DGSCGfJU.js} +1 -1
- package/dist/assets/{midjourney-Bun_rIWX.js → midjourney-0q7WYWKq.js} +1 -1
- package/dist/assets/{mobileLocalExec-DXKg5x1k.js → mobileLocalExec-BBXq2Mlq.js} +2 -2
- package/dist/assets/{nanobanana-1aJuNjuV.js → nanobanana-DfnHdYel.js} +1 -1
- package/dist/assets/{omni-pDIQ9Abh.js → omni-B1-GXSEt.js} +1 -1
- package/dist/assets/{openaiimage-BViQ9P0Z.js → openaiimage-C-4khEqI.js} +1 -1
- package/dist/assets/{pagination-q6_CA9Ta.js → pagination-B5FgucN9.js} +1 -1
- package/dist/assets/{pagination-BCc6JgI2.js → pagination-CJ-K0_n9.js} +1 -1
- package/dist/assets/{pika-BuUZEsCD.js → pika-BI9TROfU.js} +1 -1
- package/dist/assets/{pixverse-AJl_otVM.js → pixverse-CJ1qoHz1.js} +1 -1
- package/dist/assets/{popover-CQqNDogj.js → popover-DqyI0a54.js} +1 -1
- package/dist/assets/{producer-Dghy2j1o.js → producer-CLiHn7s2.js} +1 -1
- package/dist/assets/{qrart-zdV5UKk_.js → qrart-DAY7F-vK.js} +1 -1
- package/dist/assets/{realtime-2WByq0Uw.js → realtime-DHnYvIAZ.js} +1 -1
- package/dist/assets/{row-C_5ub9kH.js → row-BN4KFxVt.js} +1 -1
- package/dist/assets/{seedance-B62zKgZ0.js → seedance-BOUABcS1.js} +1 -1
- package/dist/assets/{seedream-6x0K87O3.js → seedream-DU6l_6kz.js} +1 -1
- package/dist/assets/{select-B-w4TTjR.js → select-D2kXNiIn.js} +1 -1
- package/dist/assets/{serp-BCz-oRoZ.js → serp-Ca2m5l4-.js} +1 -1
- package/dist/assets/{slider-Di9hdrCO.js → slider-4GcnH9S-.js} +1 -1
- package/dist/assets/{solana-wallets-C0YMX0g4.js → solana-wallets-Dwm69-NK.js} +2 -2
- package/dist/assets/{solana-wallets-vue-kJgRlNLC.js → solana-wallets-vue-xLXrngdf.js} +1 -1
- package/dist/assets/{sora-BrXEK2Gj.js → sora-D9i3p3Sj.js} +1 -1
- package/dist/assets/{suno-BTnmcB86.js → suno-D5dK8c0h.js} +1 -1
- package/dist/assets/{switch-FLE178ww.js → switch-Bk4IAKzq.js} +1 -1
- package/dist/assets/{table-Db9R06on.js → table-GkjhOaoE.js} +1 -1
- package/dist/assets/{tabs-CKJWx47c.js → tabs-DBYVHf_-.js} +1 -1
- package/dist/assets/{time-picker-Cw98mYlw.js → time-picker-M05wUVUl.js} +1 -1
- package/dist/assets/{tooltip-DAEtFoXl.js → tooltip-Bs8w_vsQ.js} +1 -1
- package/dist/assets/{upload-B6JNld1O.js → upload-CybC7d-7.js} +1 -1
- package/dist/assets/{veo-CKw5P1Qs.js → veo-iYlxkOPW.js} +1 -1
- package/dist/assets/{wan-B-arNjuC.js → wan-CXgib97M.js} +1 -1
- package/dist/assets/{web-rxpnQ8Rk.js → web-Baq1uXuL.js} +1 -1
- package/dist/assets/{web-BqqNjbPq.js → web-BsQW3qcn.js} +1 -1
- package/dist/assets/{web-CXMCfO-f.js → web-Cs2t72Ej.js} +1 -1
- package/dist/assets/{web-CLCqhn5u.js → web-JxZEpV2P.js} +1 -1
- package/dist/assets/{web-DHbVHDDZ.js → web-j71rnUTQ.js} +1 -1
- package/dist/assets/{webextrator-BhS9H8hF.js → webextrator-DcfhTP97.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/Navigator-CDnWLupN.css +0 -1
- package/dist/assets/Navigator-boGtYPk_.js +0 -8
- package/dist/assets/common-DoX6Rkj9.js +0 -1
- package/dist/assets/esm-BfOQELBi.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{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-B-w4TTjR.js";import{n as S,t as C}from"./tabs-CKJWx47c.js";import{t as w}from"./upload-B6JNld1O.js";import{t as T}from"./tooltip-DAEtFoXl.js";import{t as E}from"./image-BjapOX8j.js";import{t as D}from"./alert-_xJIX9qr.js";import{n as O,r as ee}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-DPh8Fl2E.js";import{t as A}from"./input-number-B8yYDeUw.js";import{t as j}from"./slider-Di9hdrCO.js";import{t as te}from"./switch-FLE178ww.js";import{di as ne,fi as re,si as ie,ui as ae}from"./constants-BYU0Mi8o.js";import{G as M,Mi as N,Qi as P,Ui as F,Vi as oe,_n as I,an as se,ar as L,cn as R,in as z,ji as B,jr as V,on as H,rn as U,vi as ce,xi as W}from"./index-s1lrp6nN.js";import{t as G}from"./index.es-BtwnN9TZ.js";import{t as le}from"./CopyToClipboard-Bk1nRi-n.js";import{t as ue}from"./FilePreview-CMTQuorI.js";import{t as K}from"./ImagePreview-CbaJ2SD9.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-Mwj5RjX7.js";import{i as J,n as fe,t as pe}from"./pagination-q6_CA9Ta.js";import{t as me}from"./VideoPlayer-FouX7LHv.js";import{t as he}from"./ApiCodeButton-DpyJUC7o.js";import{t as ge}from"./BotPlaceholder-BWTcdFIK.js";import{t as _e}from"./NoTasks-BwTq2H9w.js";import{t as ve}from"./PromptTextarea-D7Fwzr_Y.js";import{n as ye,t as be}from"./AudioPreview-D6-IjBIh.js";var xe=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:F,FontAwesomeIcon:G},mixins:[de]}),Se={class:`main flex flex-row flex-1 min-h-0`},Ce={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},we={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Te(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Se,[e(`div`,Ce,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,we,[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 Ee=M(xe,[[`render`,Te],[`__scopeId`,`data-v-b87958dc`]]),De={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!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,referenceVideo:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!1};case`kling-video-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0};default:return De}}var X=`<<<video_1>>>`;function Oe(e){return e?e.split(X).join(` `).replace(/\s{2,}/g,` `).trim():``}function Z(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`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),o}function Q(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),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Oe(n.prompt));return n}var ke=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=Z(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await B.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=Q({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),N.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})}}}),Ae={class:`field`},je={class:`title font-bold`};function Me(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Ae,[e(`h2`,je,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 Ne=M(ke,[[`render`,Me],[`__scopeId`,`data-v-04059875`]]),Pe=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 re.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=Z(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await B.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=Q({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),N.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})}}}),Fe={class:`field`},Ie={class:`header`},Le={class:`title font-bold`},Re={key:0,class:`opt-tip`};function ze(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`h2`,Le,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`,Re,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Be=M(Pe,[[`render`,ze],[`__scopeId`,`data-v-9a8fa3c5`]]),Ve=[3,5,8,10,12,15],He=[5,10],Ue=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 re.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Ve:He},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=Z(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await B.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=Q({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),N.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})}}}),We={class:`field`},Ge={class:`control`},Ke={class:`label`},qe={class:`title font-bold`};function Je(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,We,[e(`div`,Ge,[e(`div`,Ke,[e(`h2`,qe,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 Ye=M(Ue,[[`render`,Je],[`__scopeId`,`data-v-5ae55e28`]]),Xe=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`}}),Ze={class:`text-sm font-bold mb-2 block`},Qe={class:`items`},$e=[`onClick`],et={class:`name`};function tt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Ze,i(t.$t(`kling.name.ratio`)),1),e(`div`,Qe,[(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`,et,i(r.label),1)],10,$e))),128))])])}var nt=M(Xe,[[`render`,tt],[`__scopeId`,`data-v-cdb14b2f`]]),rt=v({name:`StartImage`,components:{ElUpload:w,ElButton:F,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[H,z],emits:[`change`],data(){return{fileList:[],uploadUrl:W()+`/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(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){N.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()}}}),it={class:`relative`},at={class:`flex justify-between`},ot={class:`flex justify-start items-center`},st={class:`text-sm font-bold`};function ct(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`,it,[e(`div`,at,[e(`div`,ot,[e(`span`,st,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 lt=M(rt,[[`render`,ct],[`__scopeId`,`data-v-756dc269`]]),ut=v({name:`EndImage`,components:{ElUpload:w,ElButton:F,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[H,z],data(){return{fileList:[],uploadUrl:W()+`/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:(N.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(N.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){N.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()}}}),dt={class:`relative`},ft={class:`flex justify-between`},pt={class:`flex justify-start items-center`},mt={class:`text-sm font-bold`};function ht(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`,dt,[e(`div`,ft,[e(`div`,pt,[e(`span`,mt,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 gt=M(ut,[[`render`,ht],[`__scopeId`,`data-v-c1b257e5`]]),_t=v({name:`ReferenceVideo`,components:{ElUpload:w,ElButton:F,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[z],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){N.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){N.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(N.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(N.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(X),i;if(e&&!r)i=n?`${n} ${X}`:X;else if(!e&&r)i=Oe(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:`base`,keep_original_sound:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:t}),this.ensurePromptToken(!!e)},async onSuccess(){this.onSetVideoList()}}}),vt={class:`relative`},yt={class:`flex justify-between`},bt={class:`flex justify-start items-center`},xt={class:`text-sm font-bold`};function St(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`,vt,[e(`div`,yt,[e(`div`,bt,[e(`span`,xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.referenceVideo`)},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.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ct=M(_t,[[`render`,St],[`__scopeId`,`data-v-dcdf8068`]]),wt=v({name:`CfgScaleSelector`,components:{ElSlider:j,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}}),Tt={class:`flex justify-between`},Et={class:`flex justify-start items-center`},Dt={class:`text-sm font-bold`},Ot={class:`flex justify-end items-center`},kt={class:`w-full`};function At(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`,Tt,[e(`div`,Et,[e(`span`,Dt,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Ot,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,kt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var jt=M(wt,[[`render`,At]]),Mt=v({name:`GenerateAudioSelector`,components:{ElSwitch:te,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(re.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})}}}),Nt={class:`relative`},Pt={class:`flex justify-between items-center`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,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 Rt=M(Mt,[[`render`,Lt]]),zt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],Bt=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:j,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:zt}},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)}}}),Vt={class:`field`},Ht={class:`header`},Ut={class:`text-sm font-bold`},Wt={key:0,class:`config-grid`},Gt={class:`cfg-row-head`},Kt={class:`cfg-name`};function qt(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`,Vt,[e(`div`,Ht,[e(`span`,Ut,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`,Wt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Gt,[e(`span`,Kt,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 Jt=M(Bt,[[`render`,qt],[`__scopeId`,`data-v-cd896060`]]),Yt=[{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`]}],$=`, `;function Xt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function Zt(e,t){if(!e||!t)return e||``;let n=[`${t}${$}`,`${$}${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 Qt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Yt.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=Zt(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),$t={key:0,class:`pills`,role:`list`},en={class:`pill-text`},tn=[`aria-label`,`onClick`];function nn(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,$t,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,en,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,tn)]))),128))])):o(``,!0)}var rn=v({name:`PromptInput`,components:{ElButton:F,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:M(Qt,[[`render`,nn],[`__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 an(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 on=M(rn,[[`render`,an],[`__scopeId`,`data-v-c01fc1a6`]]),sn=v({name:`NegativePromptInput`,components:{ElInput:P,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||=``}}),cn={class:`field`},ln={class:`box`},un={class:`title font-bold`};function dn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,cn,[e(`div`,ln,[e(`h2`,un,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 fn=M(sn,[[`render`,dn],[`__scopeId`,`data-v-de98cf01`]]),pn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:F,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Yt,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(Zt(this.prompt,e)):this.setPrompt(Xt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Zt(e,t);this.setPrompt(e)}}}),mn={class:`drawer-content`},hn={class:`drawer-header`},gn={class:`title-row`},_n={class:`title`},vn={class:`hint`},yn={key:0,class:`selected-bar`},bn={class:`selected-text`},xn={class:`groups`},Sn={class:`group-title`},Cn={class:`chip-grid`},wn=[`onClick`];function Tn(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`,mn,[e(`div`,hn,[e(`div`,gn,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,_n,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`,vn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,yn,[e(`span`,bn,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`,xn,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,Sn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Cn,[(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,wn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var En=M(pn,[[`render`,Tn],[`__scopeId`,`data-v-7d457a69`]]),Dn={"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`},On={std:`720p`,pro:`1080p`,"4k":`4K`},kn=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 Dn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return On[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),An={class:`summary-chip`},jn=[`title`],Mn=[`title`],Nn=[`title`],Pn=[`title`],Fn=[`title`];function In(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,An,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,jn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,Mn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Nn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Pn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,Fn)):o(``,!0)])}var Ln=v({name:`ConfigPanel`,components:{ElButton:F,Consumption:q,FontAwesomeIcon:G,PromptInput:on,NegativePromptInput:fn,ModelSelector:Ne,ModeSelector:Be,DurationSelector:Ye,RatioSelector:nt,StartImage:lt,CfgScaleSelector:jt,GenerateAudioSelector:Rt,CameraControlSelector:Jt,InspirationDrawer:En,SummaryChip:M(kn,[[`render`,In],[`__scopeId`,`data-v-418a6733`]]),EndImage:gt,ReferenceVideo:Ct},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Y(this.config?.model,this.config?.mode,this.config?.duration)},consumption(){return R(this.config,this.service?.cost)},service(){return this.$store.state.kling?.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,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-video`),b=l(`start-image`),x=l(`end-image`),S=l(`duration-selector`),C=l(`mode-selector`),w=l(`generate-audio-selector`),T=l(`camera-control-selector`),E=l(`cfg-scale-selector`),D=l(`negative-prompt-input`),O=l(`summary-chip`),ee=l(`consumption`),k=l(`font-awesome-icon`),A=l(`el-button`),j=l(`inspiration-drawer`);return g(),s(`div`,Rn,[e(`div`,zn,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceVideo?(g(),f(y,{key:0,class:`mb-2`})):o(``,!0),a(b,{class:`mb-2`}),a(x,{class:`mb-2`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,Bn,[a(O),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(A,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(A,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(j,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var Hn=M(Ln,[[`render`,Vn]]),Un=v({name:`MotionImage`,components:{ElUpload:w,ElButton:F,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[H,z],data(){return{fileList:[],uploadUrl:W()+`/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(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){N.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()}}}),Wn={class:`relative`},Gn={class:`flex justify-between`},Kn={class:`flex justify-start items-center`},qn={class:`text-sm font-bold`};function Jn(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`,Wn,[e(`div`,Gn,[e(`div`,Kn,[e(`span`,qn,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 Yn=M(Un,[[`render`,Jn],[`__scopeId`,`data-v-e52eaf2f`]]),Xn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:F,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[z],data(){return{fileList:[],uploadUrl:W()+`/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(){N.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){N.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:(N.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(N.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()}}}),Zn={class:`relative`},Qn={class:`flex justify-between`},$n={class:`flex justify-start items-center`},er={class:`text-sm font-bold`};function tr(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`,Zn,[e(`div`,Qn,[e(`div`,$n,[e(`span`,er,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 nr=M(Xn,[[`render`,tr],[`__scopeId`,`data-v-7019a8d2`]]),rr=v({name:`MotionPromptInput`,components:{ElInput:P,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})}}}}),ir={class:`field`},ar={class:`box`},or={class:`title font-bold`};function sr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,ir,[e(`div`,ar,[e(`h2`,or,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 cr=M(rr,[[`render`,sr],[`__scopeId`,`data-v-ca9fdbe5`]]),lr=`video`,ur=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:ee,ElRadioButton:O,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||lr},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=lr)}}),dr={class:`field`},fr={class:`header`},pr={class:`text-sm font-bold`};function mr(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`,dr,[e(`div`,fr,[e(`span`,pr,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 hr=M(ur,[[`render`,mr],[`__scopeId`,`data-v-7a91195b`]]),gr=`kling-v2-6`,_r=v({name:`MotionModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||gr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=gr)}}),vr={class:`field`},yr={class:`header`},br={class:`title font-bold`};function xr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,vr,[e(`div`,yr,[e(`h2`,br,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},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 Sr=M(_r,[[`render`,xr],[`__scopeId`,`data-v-480e8da2`]]),Cr=`std`,wr=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||Cr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Cr)}}),Tr={class:`field`},Er={class:`header`},Dr={class:`title font-bold`};function Or(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Tr,[e(`div`,Er,[e(`h2`,Dr,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 kr=M(wr,[[`render`,Or],[`__scopeId`,`data-v-1295688c`]]),Ar=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:te,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`})}}}}),jr={class:`relative`},Mr={class:`flex justify-between items-center`},Nr={class:`flex justify-start items-center`},Pr={class:`text-sm font-bold`};function Fr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,jr,[e(`div`,Mr,[e(`div`,Nr,[e(`span`,Pr,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 Ir=v({name:`MotionPanel`,components:{ElButton:F,FontAwesomeIcon:G,Consumption:q,MotionImage:Yn,MotionVideo:nr,MotionPromptInput:cr,CharacterOrientationSelector:hr,MotionModelSelector:Sr,MotionModeSelector:kr,KeepOriginalSoundSelector:M(Ar,[[`render`,Fr]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return R({...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`)}}}),Lr={class:`flex flex-col h-full`},Rr={class:`flex-1 overflow-y-auto p-5`},zr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Br(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-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`font-awesome-icon`),C=l(`el-button`);return g(),s(`div`,Lr,[e(`div`,Rr,[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`}),a(b,{class:`mb-4`})]),e(`div`,zr,[a(x,{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(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Vr=M(Ir,[[`render`,Br]]),Hr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:oe},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)}}}),Ur=[`title`],Wr={class:`text`};function Gr(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`,Wr,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,Ur)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Kr=M(Hr,[[`render`,Gr],[`__scopeId`,`data-v-fda33e4c`]]),qr={"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`},Jr=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ne.map(e=>({value:e,label:qr[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=ae)}}),Yr={class:`field`},Xr={class:`title font-bold`};function Zr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Yr,[e(`h2`,Xr,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 Qr=M(Jr,[[`render`,Zr],[`__scopeId`,`data-v-cbc83d11`]]),$r=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`)}}),ei={class:`field`},ti={class:`title font-bold`};function ni(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,ei,[e(`h2`,ti,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 ri=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:F,ElInput:P,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Qr,ModeSelector:M($r,[[`render`,ni],[`__scopeId`,`data-v-92525a1d`]])},mixins:[z],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:W()+`/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 R({...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(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){N.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(){N.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){N.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`)}}}),ii={class:`flex flex-col h-full`},ai={class:`flex-1 overflow-y-auto p-5`},oi={class:`relative mb-4`},si={class:`flex justify-start items-center`},ci={class:`text-sm font-bold`},li={class:`relative mb-4`},ui={class:`flex justify-start items-center`},di={class:`text-sm font-bold`},fi=[`src`],pi={class:`mb-4`},mi={class:`flex justify-start items-center`},hi={class:`text-sm font-bold`},gi={class:`flex flex-col items-center justify-center px-5 pb-5`};function _i(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`,ii,[e(`div`,ai,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,oi,[e(`div`,si,[e(`span`,ci,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`,li,[e(`div`,ui,[e(`span`,di,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,fi)):o(``,!0)]),e(`div`,pi,[e(`div`,mi,[e(`span`,hi,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`,gi,[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 vi=M(ri,[[`render`,_i],[`__scopeId`,`data-v-27261e35`]]),yi=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:D,VideoPlayer:me,ElTooltip:T,ElButton:F,ImagePreview:K,VideoPreview:ye,AudioPreview:be,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,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),bi={class:`preview`},xi={class:`left`},Si={class:`main`},Ci={class:`bot`},wi={class:`datetime`},Ti={class:`info`},Ei={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Di={key:1,class:`prompt mt-2`},Oi={key:0},ki={key:1},Ai={key:0,class:n({content:!0,failed:!0})},ji={key:0,class:`mb-4`},Mi={key:1,class:n({operations:!0,"mt-2":!0})},Ni={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Fi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ii={key:1,class:n({content:!0})},Li={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ri={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bi={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vi={key:2,class:n({content:!0})},Hi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ui={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Wi(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-preview`),x=l(`audio-preview`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`font-awesome-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`);return g(),s(`div`,bi,[e(`div`,xi,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,Si,[e(`div`,Ci,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,wi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Ti,[t.referenceImages.length>0||t.referenceVideos.length>0||t.referenceAudios.length>0?(g(),s(`div`,Ei,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceVideos,(e,t)=>(g(),f(b,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Di,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,Oi,` - (`+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`,ki,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,Ai,[t.modelValue?.response.video_url?(g(),s(`div`,ji,[a(S,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,Mi,[a(w,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(C,{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(T,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ni,[a(E,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,Pi,[a(E,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(D,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Fi,[a(E,{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`,Ii,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(E,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Li,[a(E,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(D,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,Ri,[a(E,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(D,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,zi,[a(E,{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`,Bi,[a(E,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(D,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Vi,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(E,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Hi,[a(E,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(D,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Ui,[a(E,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(D,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Gi=v({name:`RecentPanel`,components:{TaskPreview:M(yi,[[`render`,Wi],[`__scopeId`,`data-v-146c298d`]]),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?.()}}}),Ki={key:0},qi={key:2,class:`w-full h-full flex items-center justify-center`};function Ji(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`,Ki,[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`,qi,[a(v)])):o(``,!0)],64)}var Yi=v({name:`KlingIndex`,components:{ConfigPanel:Hn,MotionPanel:Vr,TalkingPhotoPanel:vi,TabSwitcher:Kr,Layout:Ee,RecentPanel:M(Gi,[[`render`,Ji]])},mixins:[se],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ce.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ce.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(!U(this.uploadTracker,e=>this.$t(e),e=>N.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){N.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))}:{}}),!I())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}N.info(this.$t(`kling.message.startingTask`)),V(`kling`,L.generate(n,{token:r})).then(()=>{N.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?N.error(this.$t(`kling.message.usedUp`)):N.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(!U(this.uploadTracker,e=>this.$t(e),e=>N.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){N.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.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}N.info(this.$t(`kling.message.startingTask`)),V(`kling`,L.motion(t,{token:n})).then(()=>{N.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?N.error(this.$t(`kling.message.usedUp`)):N.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!U(this.uploadTracker,e=>this.$t(e),e=>N.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){N.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(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}N.info(this.$t(`kling.message.startingTask`)),V(`kling`,L.talkingPhoto(t,{token:n})).then(()=>{N.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?N.error(this.$t(`kling.message.usedUp`)):N.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Xi={class:`flex flex-col h-full`},Zi={class:`flex-1 min-h-0`};function Qi(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`,Xi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Zi,[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 $i=M(Yi,[[`render`,Qi]]);export{$i 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-D2kXNiIn.js";import{n as S,t as C}from"./tabs-DBYVHf_-.js";import{t as w}from"./upload-CybC7d-7.js";import{t as T}from"./tooltip-Bs8w_vsQ.js";import{t as E}from"./image-DaPFm5t3.js";import{t as D}from"./alert-r5eyCYMk.js";import{n as O,r as ee}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-nKUsNUqU.js";import{t as A}from"./input-number-BmoiWw1O.js";import{t as j}from"./slider-4GcnH9S-.js";import{t as te}from"./switch-Bk4IAKzq.js";import{di as ne,fi as re,si as ie,ui as ae}from"./constants-D8dwgBQJ.js";import{G as M,Mi as N,Qi as P,Ui as F,Vi as oe,_n as I,an as se,ar as L,cn as R,in as z,ji as B,jr as V,on as H,rn as U,vi as ce,xi as W}from"./index-BrXcZpB0.js";import{t as G}from"./index.es-Cd6zh83v.js";import{t as le}from"./CopyToClipboard-B6HsusZG.js";import{t as ue}from"./FilePreview-C9dXaih4.js";import{t as K}from"./ImagePreview-BFEnePFT.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-OOugR-e4.js";import{i as J,n as fe,t as pe}from"./pagination-B5FgucN9.js";import{t as me}from"./VideoPlayer-BghNES0-.js";import{t as he}from"./ApiCodeButton-DYEAsDAB.js";import{t as ge}from"./BotPlaceholder-CshzKiK2.js";import{t as _e}from"./NoTasks-CkWyHQ7m.js";import{t as ve}from"./PromptTextarea-CWjobThE.js";import{n as ye,t as be}from"./AudioPreview-CfaWG6HL.js";var xe=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:F,FontAwesomeIcon:G},mixins:[de]}),Se={class:`main flex flex-row flex-1 min-h-0`},Ce={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},we={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Te(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Se,[e(`div`,Ce,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,we,[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 Ee=M(xe,[[`render`,Te],[`__scopeId`,`data-v-b87958dc`]]),De={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!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,referenceVideo:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!1};case`kling-video-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0};default:return De}}var X=`<<<video_1>>>`;function Oe(e){return e?e.split(X).join(` `).replace(/\s{2,}/g,` `).trim():``}function Z(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`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),o}function Q(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),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Oe(n.prompt));return n}var ke=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=Z(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await B.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=Q({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),N.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})}}}),Ae={class:`field`},je={class:`title font-bold`};function Me(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Ae,[e(`h2`,je,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 Ne=M(ke,[[`render`,Me],[`__scopeId`,`data-v-04059875`]]),Pe=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 re.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=Z(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await B.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=Q({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),N.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})}}}),Fe={class:`field`},Ie={class:`header`},Le={class:`title font-bold`},Re={key:0,class:`opt-tip`};function ze(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`h2`,Le,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`,Re,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Be=M(Pe,[[`render`,ze],[`__scopeId`,`data-v-9a8fa3c5`]]),Ve=[3,5,8,10,12,15],He=[5,10],Ue=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 re.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Ve:He},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=Z(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await B.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=Q({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),N.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})}}}),We={class:`field`},Ge={class:`control`},Ke={class:`label`},qe={class:`title font-bold`};function Je(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,We,[e(`div`,Ge,[e(`div`,Ke,[e(`h2`,qe,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 Ye=M(Ue,[[`render`,Je],[`__scopeId`,`data-v-5ae55e28`]]),Xe=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`}}),Ze={class:`text-sm font-bold mb-2 block`},Qe={class:`items`},$e=[`onClick`],et={class:`name`};function tt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Ze,i(t.$t(`kling.name.ratio`)),1),e(`div`,Qe,[(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`,et,i(r.label),1)],10,$e))),128))])])}var nt=M(Xe,[[`render`,tt],[`__scopeId`,`data-v-cdb14b2f`]]),rt=v({name:`StartImage`,components:{ElUpload:w,ElButton:F,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[H,z],emits:[`change`],data(){return{fileList:[],uploadUrl:W()+`/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(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){N.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()}}}),it={class:`relative`},at={class:`flex justify-between`},ot={class:`flex justify-start items-center`},st={class:`text-sm font-bold`};function ct(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`,it,[e(`div`,at,[e(`div`,ot,[e(`span`,st,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 lt=M(rt,[[`render`,ct],[`__scopeId`,`data-v-756dc269`]]),ut=v({name:`EndImage`,components:{ElUpload:w,ElButton:F,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[H,z],data(){return{fileList:[],uploadUrl:W()+`/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:(N.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(N.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){N.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()}}}),dt={class:`relative`},ft={class:`flex justify-between`},pt={class:`flex justify-start items-center`},mt={class:`text-sm font-bold`};function ht(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`,dt,[e(`div`,ft,[e(`div`,pt,[e(`span`,mt,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 gt=M(ut,[[`render`,ht],[`__scopeId`,`data-v-c1b257e5`]]),_t=v({name:`ReferenceVideo`,components:{ElUpload:w,ElButton:F,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[z],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){N.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){N.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(N.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(N.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(X),i;if(e&&!r)i=n?`${n} ${X}`:X;else if(!e&&r)i=Oe(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:`base`,keep_original_sound:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:t}),this.ensurePromptToken(!!e)},async onSuccess(){this.onSetVideoList()}}}),vt={class:`relative`},yt={class:`flex justify-between`},bt={class:`flex justify-start items-center`},xt={class:`text-sm font-bold`};function St(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`,vt,[e(`div`,yt,[e(`div`,bt,[e(`span`,xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.referenceVideo`)},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.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ct=M(_t,[[`render`,St],[`__scopeId`,`data-v-dcdf8068`]]),wt=v({name:`CfgScaleSelector`,components:{ElSlider:j,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}}),Tt={class:`flex justify-between`},Et={class:`flex justify-start items-center`},Dt={class:`text-sm font-bold`},Ot={class:`flex justify-end items-center`},kt={class:`w-full`};function At(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`,Tt,[e(`div`,Et,[e(`span`,Dt,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Ot,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,kt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var jt=M(wt,[[`render`,At]]),Mt=v({name:`GenerateAudioSelector`,components:{ElSwitch:te,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(re.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})}}}),Nt={class:`relative`},Pt={class:`flex justify-between items-center`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,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 Rt=M(Mt,[[`render`,Lt]]),zt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],Bt=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:j,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:zt}},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)}}}),Vt={class:`field`},Ht={class:`header`},Ut={class:`text-sm font-bold`},Wt={key:0,class:`config-grid`},Gt={class:`cfg-row-head`},Kt={class:`cfg-name`};function qt(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`,Vt,[e(`div`,Ht,[e(`span`,Ut,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`,Wt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Gt,[e(`span`,Kt,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 Jt=M(Bt,[[`render`,qt],[`__scopeId`,`data-v-cd896060`]]),Yt=[{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`]}],$=`, `;function Xt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function Zt(e,t){if(!e||!t)return e||``;let n=[`${t}${$}`,`${$}${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 Qt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Yt.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=Zt(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),$t={key:0,class:`pills`,role:`list`},en={class:`pill-text`},tn=[`aria-label`,`onClick`];function nn(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,$t,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,en,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,tn)]))),128))])):o(``,!0)}var rn=v({name:`PromptInput`,components:{ElButton:F,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:M(Qt,[[`render`,nn],[`__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 an(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 on=M(rn,[[`render`,an],[`__scopeId`,`data-v-c01fc1a6`]]),sn=v({name:`NegativePromptInput`,components:{ElInput:P,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||=``}}),cn={class:`field`},ln={class:`box`},un={class:`title font-bold`};function dn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,cn,[e(`div`,ln,[e(`h2`,un,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 fn=M(sn,[[`render`,dn],[`__scopeId`,`data-v-de98cf01`]]),pn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:F,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Yt,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(Zt(this.prompt,e)):this.setPrompt(Xt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Zt(e,t);this.setPrompt(e)}}}),mn={class:`drawer-content`},hn={class:`drawer-header`},gn={class:`title-row`},_n={class:`title`},vn={class:`hint`},yn={key:0,class:`selected-bar`},bn={class:`selected-text`},xn={class:`groups`},Sn={class:`group-title`},Cn={class:`chip-grid`},wn=[`onClick`];function Tn(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`,mn,[e(`div`,hn,[e(`div`,gn,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,_n,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`,vn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,yn,[e(`span`,bn,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`,xn,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,Sn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Cn,[(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,wn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var En=M(pn,[[`render`,Tn],[`__scopeId`,`data-v-7d457a69`]]),Dn={"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`},On={std:`720p`,pro:`1080p`,"4k":`4K`},kn=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 Dn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return On[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),An={class:`summary-chip`},jn=[`title`],Mn=[`title`],Nn=[`title`],Pn=[`title`],Fn=[`title`];function In(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,An,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,jn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,Mn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Nn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Pn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,Fn)):o(``,!0)])}var Ln=v({name:`ConfigPanel`,components:{ElButton:F,Consumption:q,FontAwesomeIcon:G,PromptInput:on,NegativePromptInput:fn,ModelSelector:Ne,ModeSelector:Be,DurationSelector:Ye,RatioSelector:nt,StartImage:lt,CfgScaleSelector:jt,GenerateAudioSelector:Rt,CameraControlSelector:Jt,InspirationDrawer:En,SummaryChip:M(kn,[[`render`,In],[`__scopeId`,`data-v-418a6733`]]),EndImage:gt,ReferenceVideo:Ct},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Y(this.config?.model,this.config?.mode,this.config?.duration)},consumption(){return R(this.config,this.service?.cost)},service(){return this.$store.state.kling?.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,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-video`),b=l(`start-image`),x=l(`end-image`),S=l(`duration-selector`),C=l(`mode-selector`),w=l(`generate-audio-selector`),T=l(`camera-control-selector`),E=l(`cfg-scale-selector`),D=l(`negative-prompt-input`),O=l(`summary-chip`),ee=l(`consumption`),k=l(`font-awesome-icon`),A=l(`el-button`),j=l(`inspiration-drawer`);return g(),s(`div`,Rn,[e(`div`,zn,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceVideo?(g(),f(y,{key:0,class:`mb-2`})):o(``,!0),a(b,{class:`mb-2`}),a(x,{class:`mb-2`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,Bn,[a(O),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(A,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(A,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(j,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var Hn=M(Ln,[[`render`,Vn]]),Un=v({name:`MotionImage`,components:{ElUpload:w,ElButton:F,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[H,z],data(){return{fileList:[],uploadUrl:W()+`/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(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){N.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()}}}),Wn={class:`relative`},Gn={class:`flex justify-between`},Kn={class:`flex justify-start items-center`},qn={class:`text-sm font-bold`};function Jn(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`,Wn,[e(`div`,Gn,[e(`div`,Kn,[e(`span`,qn,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 Yn=M(Un,[[`render`,Jn],[`__scopeId`,`data-v-e52eaf2f`]]),Xn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:F,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[z],data(){return{fileList:[],uploadUrl:W()+`/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(){N.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){N.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:(N.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(N.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()}}}),Zn={class:`relative`},Qn={class:`flex justify-between`},$n={class:`flex justify-start items-center`},er={class:`text-sm font-bold`};function tr(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`,Zn,[e(`div`,Qn,[e(`div`,$n,[e(`span`,er,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 nr=M(Xn,[[`render`,tr],[`__scopeId`,`data-v-7019a8d2`]]),rr=v({name:`MotionPromptInput`,components:{ElInput:P,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})}}}}),ir={class:`field`},ar={class:`box`},or={class:`title font-bold`};function sr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,ir,[e(`div`,ar,[e(`h2`,or,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 cr=M(rr,[[`render`,sr],[`__scopeId`,`data-v-ca9fdbe5`]]),lr=`video`,ur=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:ee,ElRadioButton:O,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||lr},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=lr)}}),dr={class:`field`},fr={class:`header`},pr={class:`text-sm font-bold`};function mr(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`,dr,[e(`div`,fr,[e(`span`,pr,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 hr=M(ur,[[`render`,mr],[`__scopeId`,`data-v-7a91195b`]]),gr=`kling-v2-6`,_r=v({name:`MotionModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||gr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=gr)}}),vr={class:`field`},yr={class:`header`},br={class:`title font-bold`};function xr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,vr,[e(`div`,yr,[e(`h2`,br,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},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 Sr=M(_r,[[`render`,xr],[`__scopeId`,`data-v-480e8da2`]]),Cr=`std`,wr=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||Cr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Cr)}}),Tr={class:`field`},Er={class:`header`},Dr={class:`title font-bold`};function Or(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Tr,[e(`div`,Er,[e(`h2`,Dr,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 kr=M(wr,[[`render`,Or],[`__scopeId`,`data-v-1295688c`]]),Ar=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:te,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`})}}}}),jr={class:`relative`},Mr={class:`flex justify-between items-center`},Nr={class:`flex justify-start items-center`},Pr={class:`text-sm font-bold`};function Fr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,jr,[e(`div`,Mr,[e(`div`,Nr,[e(`span`,Pr,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 Ir=v({name:`MotionPanel`,components:{ElButton:F,FontAwesomeIcon:G,Consumption:q,MotionImage:Yn,MotionVideo:nr,MotionPromptInput:cr,CharacterOrientationSelector:hr,MotionModelSelector:Sr,MotionModeSelector:kr,KeepOriginalSoundSelector:M(Ar,[[`render`,Fr]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return R({...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`)}}}),Lr={class:`flex flex-col h-full`},Rr={class:`flex-1 overflow-y-auto p-5`},zr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Br(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-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`font-awesome-icon`),C=l(`el-button`);return g(),s(`div`,Lr,[e(`div`,Rr,[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`}),a(b,{class:`mb-4`})]),e(`div`,zr,[a(x,{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(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Vr=M(Ir,[[`render`,Br]]),Hr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:oe},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)}}}),Ur=[`title`],Wr={class:`text`};function Gr(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`,Wr,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,Ur)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Kr=M(Hr,[[`render`,Gr],[`__scopeId`,`data-v-fda33e4c`]]),qr={"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`},Jr=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ne.map(e=>({value:e,label:qr[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=ae)}}),Yr={class:`field`},Xr={class:`title font-bold`};function Zr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Yr,[e(`h2`,Xr,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 Qr=M(Jr,[[`render`,Zr],[`__scopeId`,`data-v-cbc83d11`]]),$r=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`)}}),ei={class:`field`},ti={class:`title font-bold`};function ni(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,ei,[e(`h2`,ti,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 ri=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:F,ElInput:P,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Qr,ModeSelector:M($r,[[`render`,ni],[`__scopeId`,`data-v-92525a1d`]])},mixins:[z],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:W()+`/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 R({...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(){N.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){N.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(){N.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){N.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`)}}}),ii={class:`flex flex-col h-full`},ai={class:`flex-1 overflow-y-auto p-5`},oi={class:`relative mb-4`},si={class:`flex justify-start items-center`},ci={class:`text-sm font-bold`},li={class:`relative mb-4`},ui={class:`flex justify-start items-center`},di={class:`text-sm font-bold`},fi=[`src`],pi={class:`mb-4`},mi={class:`flex justify-start items-center`},hi={class:`text-sm font-bold`},gi={class:`flex flex-col items-center justify-center px-5 pb-5`};function _i(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`,ii,[e(`div`,ai,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,oi,[e(`div`,si,[e(`span`,ci,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`,li,[e(`div`,ui,[e(`span`,di,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,fi)):o(``,!0)]),e(`div`,pi,[e(`div`,mi,[e(`span`,hi,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`,gi,[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 vi=M(ri,[[`render`,_i],[`__scopeId`,`data-v-27261e35`]]),yi=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:D,VideoPlayer:me,ElTooltip:T,ElButton:F,ImagePreview:K,VideoPreview:ye,AudioPreview:be,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,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),bi={class:`preview`},xi={class:`left`},Si={class:`main`},Ci={class:`bot`},wi={class:`datetime`},Ti={class:`info`},Ei={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Di={key:1,class:`prompt mt-2`},Oi={key:0},ki={key:1},Ai={key:0,class:n({content:!0,failed:!0})},ji={key:0,class:`mb-4`},Mi={key:1,class:n({operations:!0,"mt-2":!0})},Ni={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Fi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ii={key:1,class:n({content:!0})},Li={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ri={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bi={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vi={key:2,class:n({content:!0})},Hi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ui={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Wi(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-preview`),x=l(`audio-preview`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`font-awesome-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`);return g(),s(`div`,bi,[e(`div`,xi,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,Si,[e(`div`,Ci,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,wi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Ti,[t.referenceImages.length>0||t.referenceVideos.length>0||t.referenceAudios.length>0?(g(),s(`div`,Ei,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceVideos,(e,t)=>(g(),f(b,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Di,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,Oi,` - (`+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`,ki,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,Ai,[t.modelValue?.response.video_url?(g(),s(`div`,ji,[a(S,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,Mi,[a(w,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(C,{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(T,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ni,[a(E,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,Pi,[a(E,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(D,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Fi,[a(E,{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`,Ii,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(E,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Li,[a(E,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(D,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,Ri,[a(E,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(D,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,zi,[a(E,{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`,Bi,[a(E,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(D,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Vi,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(E,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Hi,[a(E,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(D,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Ui,[a(E,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(D,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Gi=v({name:`RecentPanel`,components:{TaskPreview:M(yi,[[`render`,Wi],[`__scopeId`,`data-v-146c298d`]]),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?.()}}}),Ki={key:0},qi={key:2,class:`w-full h-full flex items-center justify-center`};function Ji(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`,Ki,[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`,qi,[a(v)])):o(``,!0)],64)}var Yi=v({name:`KlingIndex`,components:{ConfigPanel:Hn,MotionPanel:Vr,TalkingPhotoPanel:vi,TabSwitcher:Kr,Layout:Ee,RecentPanel:M(Gi,[[`render`,Ji]])},mixins:[se],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ce.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ce.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(!U(this.uploadTracker,e=>this.$t(e),e=>N.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){N.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))}:{}}),!I())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}N.info(this.$t(`kling.message.startingTask`)),V(`kling`,L.generate(n,{token:r})).then(()=>{N.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?N.error(this.$t(`kling.message.usedUp`)):N.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(!U(this.uploadTracker,e=>this.$t(e),e=>N.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){N.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.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}N.info(this.$t(`kling.message.startingTask`)),V(`kling`,L.motion(t,{token:n})).then(()=>{N.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?N.error(this.$t(`kling.message.usedUp`)):N.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!U(this.uploadTracker,e=>this.$t(e),e=>N.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){N.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(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}N.info(this.$t(`kling.message.startingTask`)),V(`kling`,L.talkingPhoto(t,{token:n})).then(()=>{N.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?N.error(this.$t(`kling.message.usedUp`)):N.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Xi={class:`flex flex-col h-full`},Zi={class:`flex-1 min-h-0`};function Qi(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`,Xi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Zi,[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 $i=M(Yi,[[`render`,Qi]]);export{$i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,T as o,at as s,j as ee,mt as c,rt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./image-BjapOX8j.js";import{t as te}from"./card-D-4S-l7a.js";import{n as p,t as m}from"./row-C_5ub9kH.js";import{G as ne,Ui as h}from"./index-s1lrp6nN.js";import{t as g}from"./index.es-BtwnN9TZ.js";var _=[{key:`chat`,titleKey:`index.title.chat`,subtitleKey:`index.subtitle.chat`,icon:`fa-regular fa-comment`,features:[[`chatgpt`,`/chatgpt`]]},{key:`image`,titleKey:`index.title.midjourney`,subtitleKey:`index.subtitle.midjourney`,icon:`fa-solid fa-palette`,features:[[`midjourney`,`/midjourney`],[`nanobanana`,`/nanobanana`],[`seedream`,`/seedream`],[`flux`,`/flux`],[`openaiimage`,`/openai-image`],[`qrart`,`/qrart`]]},{key:`music`,titleKey:`index.title.suno`,subtitleKey:`index.subtitle.suno`,icon:`fa-solid fa-music`,features:[[`suno`,`/suno`],[`producer`,`/producer`]]},{key:`video`,titleKey:`index.title.luma`,subtitleKey:`index.subtitle.luma`,icon:`fa-solid fa-film`,features:[[`luma`,`/luma`],[`veo`,`/veo`],[`sora`,`/sora`],[`kling`,`/kling`],[`hailuo`,`/hailuo`],[`seedance`,`/seedance`]]}],v=d({name:`Index`,components:{ElButton:h,ElRow:m,ElCol:p,ElCard:te,ElImage:f,FontAwesomeIcon:g},data(){return{comments:[{avatar:`https://cdn.acedata.cloud/avatar1.png`,name:this.$t(`index.customers.name1`),job:this.$t(`index.customers.job1`),content:this.$t(`index.customers.comment1`)},{avatar:`https://cdn.acedata.cloud/avatar2.png`,name:this.$t(`index.customers.name2`),job:this.$t(`index.customers.job2`),content:this.$t(`index.customers.comment2`)},{avatar:`https://cdn.acedata.cloud/avatar3.png`,name:this.$t(`index.customers.name3`),job:this.$t(`index.customers.job3`),content:this.$t(`index.customers.comment3`)}],models:[`ChatGPT`,`Claude`,`Gemini`,`Grok`,`DeepSeek`,`Kimi`,`Midjourney`,`Flux`,`Nano Banana`,`Seedream`,`GPT Image`,`Suno`,`Veo`,`Sora`,`Kling`,`Luma`,`Hailuo`,`Seedance`]}},computed:{site(){return this.$store.state.site},capabilities(){let e=this.site?.features??{},t=[];for(let n of _){let r=n.features.find(([t])=>e[t]?.enabled);r&&t.push({key:n.key,title:this.$t(n.titleKey),subtitle:this.$t(n.subtitleKey),icon:n.icon,path:r[1]})}return t},primaryPath(){return this.capabilities[0]?.path??`/chatgpt`}},methods:{onClickCapability(e){this.$router.push(e.path)},onStart(){this.$router.push({path:this.primaryPath})},scrollToServices(){document.getElementById(`introduction`)?.scrollIntoView({behavior:`smooth`,block:`start`})}}}),y={class:`wrapper`},b={id:`banner`},x={class:`container`},S={class:`info`},C={class:`badge-new`},w={class:`title`},T={class:`subtitle`},E={class:`tagline`},D={class:`operations`},O={id:`introduction`},k={class:`container`},A={class:`title`},j={class:`subtitle`},M={class:`icon-wrapper`},N={class:`title`},P={class:`subtitle`},F={key:0,id:`chat`,class:`block`},I={class:`container`},L=[`alt`],R={class:`title`},z={class:`subtitle`},B={key:1,id:`midjourney`,class:`block`},V={class:`container`},H={class:`title`},U={class:`subtitle`},W=[`alt`],re={key:2,id:`qrart`,class:`block`},G={class:`container`},K=[`alt`],q={class:`title`},J={class:`subtitle`},Y={key:3,id:`suno`,class:`block`},X={class:`container`},ie={class:`title`},ae={class:`subtitle`},oe=[`alt`],se={key:4,id:`luma`,class:`block`},ce={class:`container`},le=[`alt`],ue={class:`title`},de={class:`subtitle`},fe={key:5,id:`headshots`,class:`block`},pe={class:`container`},me={class:`title`},he={class:`subtitle`},Z=[`alt`],ge={id:`models`,class:`models`},_e={class:`container`},ve={class:`section-title`},ye={class:`section-subtitle`},be={class:`model-wall`},xe={id:`cta`,class:`cta`},Se={class:`container`},Ce={class:`cta__title`},we={class:`cta__subtitle`};function Q(d,f,te,p,m,ne){let h=s(`el-button`),g=s(`el-col`),_=s(`el-image`),v=s(`el-row`),Q=s(`font-awesome-icon`),$=s(`el-card`);return u(),a(`div`,y,[e(`div`,b,[e(`div`,x,[r(v,null,{default:c(()=>[r(g,{md:12,xs:24,class:`left`},{default:c(()=>[e(`div`,S,[e(`span`,C,n(d.$t(`index.badge.hero`)),1),e(`h1`,w,n(d.site?.title),1),e(`h3`,T,n(d.$t(`index.subtitle.banner`)),1),e(`p`,E,n(d.$t(`index.subtitle.hero`)),1),e(`div`,D,[r(h,{type:`primary`,round:``,class:`btn-apply`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),r(h,{round:``,class:`btn-explore`,onClick:d.scrollToServices},{default:c(()=>[t(n(d.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])])])]),_:1}),r(g,{md:12,xs:24,class:`right`},{default:c(()=>[r(_,{src:`https://cdn.acedata.cloud/illustration1.png`,class:`brand`,alt:d.site?.title,fit:`contain`},null,8,[`alt`])]),_:1})]),_:1})])]),e(`div`,O,[e(`div`,k,[r(v,{class:`mb-6`},{default:c(()=>[r(g,{span:24},{default:c(()=>[e(`h2`,A,n(d.$t(`index.title.introduction`)),1),e(`h5`,j,n(d.$t(`index.subtitle.introduction`)),1)]),_:1})]),_:1}),r(v,{gutter:15},{default:c(()=>[(u(!0),a(o,null,l(d.capabilities,(t,i)=>(u(),ee(g,{key:i,md:6,xs:24,class:`mb-4`},{default:c(()=>[r($,{class:`info text-center`,shadow:`hover`,onClick:e=>d.onClickCapability(t)},{default:c(()=>[e(`div`,M,[r(Q,{icon:t.icon,class:`icon`},null,8,[`icon`])]),e(`h2`,N,n(t.title),1),e(`p`,P,n(t.subtitle),1)]),_:2},1032,[`onClick`])]),_:2},1024))),128))]),_:1})])]),d.site?.features?.chatgpt?.enabled?(u(),a(`div`,F,[e(`div`,I,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/axynds.png`,class:`image desktop`,alt:d.$t(`index.title.chat`),loading:`lazy`,decoding:`async`},null,8,L),f[6]||=e(`img`,{src:`https://cdn.acedata.cloud/vds4i3.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,R,n(d.$t(`index.title.chat`)),1),e(`p`,z,n(d.$t(`index.subtitle.chat`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[0]||=e=>d.$router.push({path:`/chatgpt`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.midjourney?.enabled?(u(),a(`div`,B,[e(`div`,V,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,H,n(d.$t(`index.title.midjourney`)),1),e(`p`,U,n(d.$t(`index.subtitle.midjourney`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[1]||=e=>d.$router.push({path:`/midjourney`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/uk86mz.png`,class:`image desktop`,alt:d.$t(`index.title.midjourney`),loading:`lazy`,decoding:`async`},null,8,W),f[7]||=e(`img`,{src:`https://cdn.acedata.cloud/rvelwm.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.qrart?.enabled?(u(),a(`div`,re,[e(`div`,G,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/gyogar.png`,class:`image desktop`,alt:d.$t(`index.title.qrart`),loading:`lazy`,decoding:`async`},null,8,K),f[8]||=e(`img`,{src:`https://cdn.acedata.cloud/5kunm0.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,q,n(d.$t(`index.title.qrart`)),1),e(`p`,J,n(d.$t(`index.subtitle.qrart`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[2]||=e=>d.$router.push({path:`/qrart`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.suno?.enabled?(u(),a(`div`,Y,[e(`div`,X,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ie,n(d.$t(`index.title.suno`)),1),e(`p`,ae,n(d.$t(`index.subtitle.suno`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[3]||=e=>d.$router.push({path:`/suno`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/2m8fn.png`,class:`image desktop`,alt:d.$t(`index.title.suno`),loading:`lazy`,decoding:`async`},null,8,oe),f[9]||=e(`img`,{src:`https://cdn.acedata.cloud/23knvs.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.luma?.enabled?(u(),a(`div`,se,[e(`div`,ce,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/6kop1g.png`,class:`image desktop`,alt:d.$t(`index.title.luma`),loading:`lazy`,decoding:`async`},null,8,le),f[10]||=e(`img`,{src:`https://cdn.acedata.cloud/3kcjny.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ue,n(d.$t(`index.title.luma`)),1),e(`p`,de,n(d.$t(`index.subtitle.luma`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[4]||=e=>d.$router.push({path:`/luma`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.headshots?.enabled?(u(),a(`div`,fe,[e(`div`,pe,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,me,n(d.$t(`index.title.headshots`)),1),e(`p`,he,n(d.$t(`index.subtitle.headshots`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[5]||=e=>d.$router.push({path:`/headshots`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/zlyshj.png`,class:`image desktop`,alt:d.$t(`index.title.headshots`),loading:`lazy`,decoding:`async`},null,8,Z),f[11]||=e(`img`,{src:`https://cdn.acedata.cloud/8as0cx.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),i(``,!0),e(`div`,ge,[e(`div`,_e,[e(`h2`,ve,n(d.$t(`index.title.models`)),1),e(`h5`,ye,n(d.$t(`index.subtitle.models`)),1),e(`div`,be,[(u(!0),a(o,null,l(d.models,(e,t)=>(u(),a(`span`,{key:t,class:`model-chip`},n(e),1))),128))])])]),e(`div`,xe,[e(`div`,Se,[e(`h2`,Ce,n(d.$t(`index.title.cta`)),1),e(`p`,we,n(d.$t(`index.subtitle.cta`)),1),r(h,{type:`primary`,round:``,class:`cta__btn`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`])])])])}var $=ne(v,[[`render`,Q],[`__scopeId`,`data-v-2699cde4`]]);export{$ as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,T as o,at as s,j as ee,mt as c,rt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./image-DaPFm5t3.js";import{t as te}from"./card-D-4S-l7a.js";import{n as p,t as m}from"./row-BN4KFxVt.js";import{G as ne,Ui as h}from"./index-BrXcZpB0.js";import{t as g}from"./index.es-Cd6zh83v.js";var _=[{key:`chat`,titleKey:`index.title.chat`,subtitleKey:`index.subtitle.chat`,icon:`fa-regular fa-comment`,features:[[`chatgpt`,`/chatgpt`]]},{key:`image`,titleKey:`index.title.midjourney`,subtitleKey:`index.subtitle.midjourney`,icon:`fa-solid fa-palette`,features:[[`midjourney`,`/midjourney`],[`nanobanana`,`/nanobanana`],[`seedream`,`/seedream`],[`flux`,`/flux`],[`openaiimage`,`/openai-image`],[`qrart`,`/qrart`]]},{key:`music`,titleKey:`index.title.suno`,subtitleKey:`index.subtitle.suno`,icon:`fa-solid fa-music`,features:[[`suno`,`/suno`],[`producer`,`/producer`]]},{key:`video`,titleKey:`index.title.luma`,subtitleKey:`index.subtitle.luma`,icon:`fa-solid fa-film`,features:[[`luma`,`/luma`],[`veo`,`/veo`],[`sora`,`/sora`],[`kling`,`/kling`],[`hailuo`,`/hailuo`],[`seedance`,`/seedance`]]}],v=d({name:`Index`,components:{ElButton:h,ElRow:m,ElCol:p,ElCard:te,ElImage:f,FontAwesomeIcon:g},data(){return{comments:[{avatar:`https://cdn.acedata.cloud/avatar1.png`,name:this.$t(`index.customers.name1`),job:this.$t(`index.customers.job1`),content:this.$t(`index.customers.comment1`)},{avatar:`https://cdn.acedata.cloud/avatar2.png`,name:this.$t(`index.customers.name2`),job:this.$t(`index.customers.job2`),content:this.$t(`index.customers.comment2`)},{avatar:`https://cdn.acedata.cloud/avatar3.png`,name:this.$t(`index.customers.name3`),job:this.$t(`index.customers.job3`),content:this.$t(`index.customers.comment3`)}],models:[`ChatGPT`,`Claude`,`Gemini`,`Grok`,`DeepSeek`,`Kimi`,`Midjourney`,`Flux`,`Nano Banana`,`Seedream`,`GPT Image`,`Suno`,`Veo`,`Sora`,`Kling`,`Luma`,`Hailuo`,`Seedance`]}},computed:{site(){return this.$store.state.site},capabilities(){let e=this.site?.features??{},t=[];for(let n of _){let r=n.features.find(([t])=>e[t]?.enabled);r&&t.push({key:n.key,title:this.$t(n.titleKey),subtitle:this.$t(n.subtitleKey),icon:n.icon,path:r[1]})}return t},primaryPath(){return this.capabilities[0]?.path??`/chatgpt`}},methods:{onClickCapability(e){this.$router.push(e.path)},onStart(){this.$router.push({path:this.primaryPath})},scrollToServices(){document.getElementById(`introduction`)?.scrollIntoView({behavior:`smooth`,block:`start`})}}}),y={class:`wrapper`},b={id:`banner`},x={class:`container`},S={class:`info`},C={class:`badge-new`},w={class:`title`},T={class:`subtitle`},E={class:`tagline`},D={class:`operations`},O={id:`introduction`},k={class:`container`},A={class:`title`},j={class:`subtitle`},M={class:`icon-wrapper`},N={class:`title`},P={class:`subtitle`},F={key:0,id:`chat`,class:`block`},I={class:`container`},L=[`alt`],R={class:`title`},z={class:`subtitle`},B={key:1,id:`midjourney`,class:`block`},V={class:`container`},H={class:`title`},U={class:`subtitle`},W=[`alt`],re={key:2,id:`qrart`,class:`block`},G={class:`container`},K=[`alt`],q={class:`title`},J={class:`subtitle`},Y={key:3,id:`suno`,class:`block`},X={class:`container`},ie={class:`title`},ae={class:`subtitle`},oe=[`alt`],se={key:4,id:`luma`,class:`block`},ce={class:`container`},le=[`alt`],ue={class:`title`},de={class:`subtitle`},fe={key:5,id:`headshots`,class:`block`},pe={class:`container`},me={class:`title`},he={class:`subtitle`},Z=[`alt`],ge={id:`models`,class:`models`},_e={class:`container`},ve={class:`section-title`},ye={class:`section-subtitle`},be={class:`model-wall`},xe={id:`cta`,class:`cta`},Se={class:`container`},Ce={class:`cta__title`},we={class:`cta__subtitle`};function Q(d,f,te,p,m,ne){let h=s(`el-button`),g=s(`el-col`),_=s(`el-image`),v=s(`el-row`),Q=s(`font-awesome-icon`),$=s(`el-card`);return u(),a(`div`,y,[e(`div`,b,[e(`div`,x,[r(v,null,{default:c(()=>[r(g,{md:12,xs:24,class:`left`},{default:c(()=>[e(`div`,S,[e(`span`,C,n(d.$t(`index.badge.hero`)),1),e(`h1`,w,n(d.site?.title),1),e(`h3`,T,n(d.$t(`index.subtitle.banner`)),1),e(`p`,E,n(d.$t(`index.subtitle.hero`)),1),e(`div`,D,[r(h,{type:`primary`,round:``,class:`btn-apply`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),r(h,{round:``,class:`btn-explore`,onClick:d.scrollToServices},{default:c(()=>[t(n(d.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])])])]),_:1}),r(g,{md:12,xs:24,class:`right`},{default:c(()=>[r(_,{src:`https://cdn.acedata.cloud/illustration1.png`,class:`brand`,alt:d.site?.title,fit:`contain`},null,8,[`alt`])]),_:1})]),_:1})])]),e(`div`,O,[e(`div`,k,[r(v,{class:`mb-6`},{default:c(()=>[r(g,{span:24},{default:c(()=>[e(`h2`,A,n(d.$t(`index.title.introduction`)),1),e(`h5`,j,n(d.$t(`index.subtitle.introduction`)),1)]),_:1})]),_:1}),r(v,{gutter:15},{default:c(()=>[(u(!0),a(o,null,l(d.capabilities,(t,i)=>(u(),ee(g,{key:i,md:6,xs:24,class:`mb-4`},{default:c(()=>[r($,{class:`info text-center`,shadow:`hover`,onClick:e=>d.onClickCapability(t)},{default:c(()=>[e(`div`,M,[r(Q,{icon:t.icon,class:`icon`},null,8,[`icon`])]),e(`h2`,N,n(t.title),1),e(`p`,P,n(t.subtitle),1)]),_:2},1032,[`onClick`])]),_:2},1024))),128))]),_:1})])]),d.site?.features?.chatgpt?.enabled?(u(),a(`div`,F,[e(`div`,I,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/axynds.png`,class:`image desktop`,alt:d.$t(`index.title.chat`),loading:`lazy`,decoding:`async`},null,8,L),f[6]||=e(`img`,{src:`https://cdn.acedata.cloud/vds4i3.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,R,n(d.$t(`index.title.chat`)),1),e(`p`,z,n(d.$t(`index.subtitle.chat`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[0]||=e=>d.$router.push({path:`/chatgpt`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.midjourney?.enabled?(u(),a(`div`,B,[e(`div`,V,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,H,n(d.$t(`index.title.midjourney`)),1),e(`p`,U,n(d.$t(`index.subtitle.midjourney`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[1]||=e=>d.$router.push({path:`/midjourney`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/uk86mz.png`,class:`image desktop`,alt:d.$t(`index.title.midjourney`),loading:`lazy`,decoding:`async`},null,8,W),f[7]||=e(`img`,{src:`https://cdn.acedata.cloud/rvelwm.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.qrart?.enabled?(u(),a(`div`,re,[e(`div`,G,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/gyogar.png`,class:`image desktop`,alt:d.$t(`index.title.qrart`),loading:`lazy`,decoding:`async`},null,8,K),f[8]||=e(`img`,{src:`https://cdn.acedata.cloud/5kunm0.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,q,n(d.$t(`index.title.qrart`)),1),e(`p`,J,n(d.$t(`index.subtitle.qrart`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[2]||=e=>d.$router.push({path:`/qrart`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.suno?.enabled?(u(),a(`div`,Y,[e(`div`,X,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ie,n(d.$t(`index.title.suno`)),1),e(`p`,ae,n(d.$t(`index.subtitle.suno`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[3]||=e=>d.$router.push({path:`/suno`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/2m8fn.png`,class:`image desktop`,alt:d.$t(`index.title.suno`),loading:`lazy`,decoding:`async`},null,8,oe),f[9]||=e(`img`,{src:`https://cdn.acedata.cloud/23knvs.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.luma?.enabled?(u(),a(`div`,se,[e(`div`,ce,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/6kop1g.png`,class:`image desktop`,alt:d.$t(`index.title.luma`),loading:`lazy`,decoding:`async`},null,8,le),f[10]||=e(`img`,{src:`https://cdn.acedata.cloud/3kcjny.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ue,n(d.$t(`index.title.luma`)),1),e(`p`,de,n(d.$t(`index.subtitle.luma`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[4]||=e=>d.$router.push({path:`/luma`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.headshots?.enabled?(u(),a(`div`,fe,[e(`div`,pe,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,me,n(d.$t(`index.title.headshots`)),1),e(`p`,he,n(d.$t(`index.subtitle.headshots`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[5]||=e=>d.$router.push({path:`/headshots`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/zlyshj.png`,class:`image desktop`,alt:d.$t(`index.title.headshots`),loading:`lazy`,decoding:`async`},null,8,Z),f[11]||=e(`img`,{src:`https://cdn.acedata.cloud/8as0cx.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),i(``,!0),e(`div`,ge,[e(`div`,_e,[e(`h2`,ve,n(d.$t(`index.title.models`)),1),e(`h5`,ye,n(d.$t(`index.subtitle.models`)),1),e(`div`,be,[(u(!0),a(o,null,l(d.models,(e,t)=>(u(),a(`span`,{key:t,class:`model-chip`},n(e),1))),128))])])]),e(`div`,xe,[e(`div`,Se,[e(`h2`,Ce,n(d.$t(`index.title.cta`)),1),e(`p`,we,n(d.$t(`index.subtitle.cta`)),1),r(h,{type:`primary`,round:``,class:`cta__btn`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`])])])])}var $=ne(v,[[`render`,Q],[`__scopeId`,`data-v-2699cde4`]]);export{$ 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,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-B-w4TTjR.js";import{t as b}from"./upload-B6JNld1O.js";import{t as x}from"./tooltip-DAEtFoXl.js";import{t as S}from"./image-BjapOX8j.js";import{t as C}from"./alert-_xJIX9qr.js";import{t as w}from"./drawer-DPh8Fl2E.js";import{t as T}from"./switch-FLE178ww.js";import{ii as E,ni as ee,ri as D}from"./constants-BYU0Mi8o.js";import{G as O,Mi as k,Ui as A,_n as te,an as j,cn as M,in as N,ir as P,jr as F,on as I,rn as L,vi as R,xi as z}from"./index-s1lrp6nN.js";import{t as B}from"./index.es-BtwnN9TZ.js";import{t as V}from"./CopyToClipboard-Bk1nRi-n.js";import{t as H}from"./ImagePreview-CbaJ2SD9.js";import{n as U}from"./taskDrawerMixin-DyAUhFEq.js";import{t as W}from"./Consumption-Mwj5RjX7.js";import{i as G,n as K,t as q}from"./pagination-q6_CA9Ta.js";import{t as J}from"./VideoPlayer-FouX7LHv.js";import{t as Y}from"./ApiCodeButton-DpyJUC7o.js";import{t as X}from"./BotPlaceholder-BWTcdFIK.js";import{t as Z}from"./NoTasks-BwTq2H9w.js";import{t as Q}from"./PromptTextarea-D7Fwzr_Y.js";var ne=_({name:`LayoutVeo`,components:{ElDrawer:w,ElButton:A,FontAwesomeIcon:B},mixins:[U]}),re={class:`main flex flex-row flex-1`},ie={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,a,s,d){let p=c(`font-awesome-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,re,[e(`div`,ie,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[u(t.$slots,`result`,{},void 0,!0)]),l(i(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{icon:`fa-solid fa-magic`})]),_:1},512),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var se=O(ne,[[`render`,oe],[`__scopeId`,`data-v-12b82bc3`]]),ce=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`veo2`,label:`veo2`},{value:`veo2-fast`,label:`veo2-fast`},{value:`veo3`,label:`veo3`},{value:`veo3-fast`,label:`veo3-fast`},{value:`veo31-fast`,label:`veo31-fast`},{value:`veo31`,label:`veo31`},{value:`veo31-fast-ingredients`,label:`veo31-fast-ingredients`}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||=E}}),le={class:`field`},ue={class:`title font-bold`};function de(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,le,[e(`h2`,ue,r(t.$t(`veo.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var fe=O(ce,[[`render`,de],[`__scopeId`,`data-v-a59d89c9`]]),pe=_({name:`ActionSelector`,components:{ElSelect:v,ElOption:y},data(){return{}},computed:{options(){return[{value:`text2video`,label:this.$t(`veo.button.action1`)},{value:`image2video`,label:this.$t(`veo.button.action2`)},{value:`ingredients2video`,label:this.$t(`veo.button.actionIngredients`)}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||=ee}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,me,[e(`h2`,he,r(t.$t(`veo.name.action`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),clearable:``},{default:f(()=>[(h(!0),o(s,null,m(t.options,t=>(h(),d(g,{key:t.value,label:t.label,value:t.value},{default:f(()=>[e(`span`,ge,r(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=O(pe,[[`render`,_e],[`__scopeId`,`data-v-261798ae`]]),ye=_({name:`TranslationSelector`,components:{ElSwitch:T,InfoIcon:G},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug(`set translation`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`},we={class:`flex justify-end items-center`};function Te(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-switch`);return h(),o(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,r(t.$t(`veo.name.translation`)),1),i(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,we,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ee=O(ye,[[`render`,Te]]),De=_({name:`AspectRatioSelector`,data(){return{options:[{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.veo?.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||=D}}),Oe={class:`text-sm font-bold mb-2 block`},ke={class:`items`},Ae=[`onClick`],je={class:`name`};function Me(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,Oe,r(n.$t(`veo.name.ratio`)),1),e(`div`,ke,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,je,r(i.label),1)],10,Ae))),128))])])}var Ne=O(De,[[`render`,Me],[`__scopeId`,`data-v-28c472c4`]]),Pe=_({name:`StartEndImage`,components:{ElUpload:b,ElButton:A,InfoIcon:G,FontAwesomeIcon:B,ImagePreview:H},mixins:[I,N],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||=void 0,this.onSetStartEndImageUrl()},methods:{onExceed(){k.warning(this.$t(`veo.message.uploadReferencesExceed`))},onError(){k.error(this.$t(`veo.message.uploadReferencesError`))},onSetStartEndImageUrl(){let e=this.urls;this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),Fe={class:`relative`},Ie={class:`flex justify-between`},Le={class:`flex justify-start items-center`},Re={class:`text-sm font-bold`};function ze(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`font-awesome-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`span`,Re,r(t.$t(`veo.name.startEndImage`)),1),i(g,{content:t.$t(`veo.description.uploadStartEndImage`)},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:2,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:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{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`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),n(` `+r(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Be=O(Pe,[[`render`,ze],[`__scopeId`,`data-v-f9a79b4a`]]),Ve=_({name:`PromptInput`,components:{PromptTextarea:Q},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function He(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`veo.name.prompt`),info:e.$t(`veo.description.prompt`),placeholder:e.$t(`veo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ue=_({name:`ConfigPanel`,components:{ElButton:A,Consumption:W,FontAwesomeIcon:B,PromptInput:O(Ve,[[`render`,He]]),ModelSelector:fe,StartEndImage:Be,ActionSelector:ve,TranslationSelector:Ee,AspectRatioSelector:Ne},emits:[`generate`],computed:{config(){return this.$store.state.veo?.config},consumption(){return M(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),We={class:`flex flex-col h-full`},Ge={class:`flex-1 overflow-y-auto p-5`},Ke={class:`flex flex-col items-center justify-center px-5 pb-5`};function qe(t,s,l,u,p,m){let g=c(`action-selector`),_=c(`translation-selector`),v=c(`aspect-ratio-selector`),y=c(`prompt-input`),b=c(`model-selector`),x=c(`start-end-image`),S=c(`consumption`),C=c(`font-awesome-icon`),w=c(`el-button`);return h(),o(`div`,We,[e(`div`,Ge,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),i(y,{class:`mb-4`}),t.config?.action===`ingredients2video`?a(``,!0):(h(),d(b,{key:0,class:`mb-4`})),t.config?.action===`image2video`||t.config?.action===`ingredients2video`?(h(),d(x,{key:1,class:`mb-2`})):a(``,!0)]),e(`div`,Ke,[i(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(C,{icon:`fa-solid fa-magic`,class:`mr-2`}),n(` `+r(t.$t(`veo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Je=O(Ue,[[`render`,qe]]),Ye=_({name:`TaskPreview`,components:{ElImage:S,CopyToClipboard:V,FontAwesomeIcon:B,ElAlert:C,VideoPlayer:J,ElTooltip:x,ElButton:A,ApiCodeButton:Y},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Xe={class:`preview`},Ze={class:`left`},Qe={class:`main`},$e={class:`bot`},et={class:`datetime`},tt={class:`info`},nt={key:0,class:`prompt mt-2`},rt={key:0},it={key:1},at={key:0,class:t({content:!0,failed:!0})},ot={key:0,class:`mb-4`},st={key:1,class:t({operations:!0,"mt-2":!0})},ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ut={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},dt={key:1,class:t({content:!0})},ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ht={key:2,class:t({content:!0})},gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function vt(t,s,l,u,p,m){let g=c(`el-image`),_=c(`video-player`),v=c(`el-button`),y=c(`el-tooltip`),b=c(`api-code-button`),x=c(`font-awesome-icon`),S=c(`copy-to-clipboard`),C=c(`el-alert`);return h(),o(`div`,Xe,[e(`div`,Ze,[i(g,{src:`https://cdn.acedata.cloud/8nxyy9.jpg`,class:`avatar`})]),e(`div`,Qe,[e(`div`,$e,[n(r(t.$t(`veo.name.veoBot`))+` `,1),e(`span`,et,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,tt,[t.modelValue?.request?.prompt?(h(),o(`p`,nt,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(h(),o(`span`,rt,` - (`+r(t.$t(`veo.status.pending`))+`) `,1)),Array.isArray(t.modelValue?.response?.data)&&t.modelValue?.response?.data[0]?.state===`running`?(h(),o(`span`,it,` - (`+r(t.$t(`veo.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),t.modelValue?.response?.success===!0&&t.modelValue?.response?.data?(h(),o(`div`,at,[t.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,ot,[i(_,{src:t.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),t.modelValue?.response.success?(h(),o(`div`,st,[i(y,{class:`box-item`,effect:`dark`,content:t.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:f(()=>[t.modelValue?.response?.data[0]?.video_url?(h(),d(v,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:s[0]||=e=>t.onDownload(e,t.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(t.$t(`veo.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(b,{path:`/veo/videos`,body:t.modelValue?.request},null,8,[`body`])])):a(``,!0),i(C,{closable:!1,class:`mt-2 success`},{default:f(()=>[e(`p`,ct,[i(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.model`))+`: `+r(t.modelValue?.request?.model),1)]),e(`p`,lt,[i(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(S,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,ut,[i(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===!1?(h(),o(`div`,dt,[i(C,{closable:!1,class:`failure`},{template:f(()=>[i(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.failure`)),1)]),default:f(()=>[e(`p`,ft,[i(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(S,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,$,[i(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(S,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,pt,[i(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),t.modelValue?.response?.trace_id?(h(),o(`p`,mt,[i(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(S,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===void 0?(h(),o(`div`,ht,[i(C,{closable:!1,class:`info`},{template:f(()=>[i(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.failure`)),1)]),default:f(()=>[e(`p`,gt,[i(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(S,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(h(),o(`p`,_t,[i(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(S,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):a(``,!0)]),_:1})])):a(``,!0)])])}var yt=_({name:`RecentPanel`,components:{TaskPreview:O(Ye,[[`render`,vt],[`__scopeId`,`data-v-a44f5f6b`]]),NoTasks:Z,BotPlaceholder:X,ScrollList:K},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),bt={key:0},xt={key:2,class:`w-full h-full flex items-center justify-center`};function St(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,bt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,xt,[i(v)])):a(``,!0)],64)}var Ct=_({name:`VeoIndex`,components:{ConfigPanel:Je,Layout:se,RecentPanel:O(yt,[[`render`,St]])},mixins:[j],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===R.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.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 q({tasks:this.tasks,getTasks:()=>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(`veo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`veo/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(`veo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!L(this.uploadTracker,e=>this.$t(e),e=>k.warning(e)))return;let e={...this.config,async:!0};if(!te())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}if(e.action===`image2video`&&!(e.image_urls&&e.image_urls.length>0)){k.warning(this.$t(`veo.message.imageRequired`));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,k.info(this.$t(`veo.message.startingTask`)),F(`veo`,P.generate(e,{token:t})).then(()=>{k.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?k.error(this.$t(`veo.message.usedUp`)):k.error(this.$t(`veo.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function wt(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Tt=O(Ct,[[`render`,wt]]);export{Tt as default};
|
|
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,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-D2kXNiIn.js";import{t as b}from"./upload-CybC7d-7.js";import{t as x}from"./tooltip-Bs8w_vsQ.js";import{t as S}from"./image-DaPFm5t3.js";import{t as C}from"./alert-r5eyCYMk.js";import{t as w}from"./drawer-nKUsNUqU.js";import{t as T}from"./switch-Bk4IAKzq.js";import{ii as E,ni as ee,ri as D}from"./constants-D8dwgBQJ.js";import{G as O,Mi as k,Ui as A,_n as te,an as j,cn as M,in as N,ir as P,jr as F,on as I,rn as L,vi as R,xi as z}from"./index-BrXcZpB0.js";import{t as B}from"./index.es-Cd6zh83v.js";import{t as V}from"./CopyToClipboard-B6HsusZG.js";import{t as H}from"./ImagePreview-BFEnePFT.js";import{n as U}from"./taskDrawerMixin-DyAUhFEq.js";import{t as W}from"./Consumption-OOugR-e4.js";import{i as G,n as K,t as q}from"./pagination-B5FgucN9.js";import{t as J}from"./VideoPlayer-BghNES0-.js";import{t as Y}from"./ApiCodeButton-DYEAsDAB.js";import{t as X}from"./BotPlaceholder-CshzKiK2.js";import{t as Z}from"./NoTasks-CkWyHQ7m.js";import{t as Q}from"./PromptTextarea-CWjobThE.js";var ne=_({name:`LayoutVeo`,components:{ElDrawer:w,ElButton:A,FontAwesomeIcon:B},mixins:[U]}),re={class:`main flex flex-row flex-1`},ie={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,a,s,d){let p=c(`font-awesome-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,re,[e(`div`,ie,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[u(t.$slots,`result`,{},void 0,!0)]),l(i(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{icon:`fa-solid fa-magic`})]),_:1},512),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var se=O(ne,[[`render`,oe],[`__scopeId`,`data-v-12b82bc3`]]),ce=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`veo2`,label:`veo2`},{value:`veo2-fast`,label:`veo2-fast`},{value:`veo3`,label:`veo3`},{value:`veo3-fast`,label:`veo3-fast`},{value:`veo31-fast`,label:`veo31-fast`},{value:`veo31`,label:`veo31`},{value:`veo31-fast-ingredients`,label:`veo31-fast-ingredients`}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||=E}}),le={class:`field`},ue={class:`title font-bold`};function de(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,le,[e(`h2`,ue,r(t.$t(`veo.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var fe=O(ce,[[`render`,de],[`__scopeId`,`data-v-a59d89c9`]]),pe=_({name:`ActionSelector`,components:{ElSelect:v,ElOption:y},data(){return{}},computed:{options(){return[{value:`text2video`,label:this.$t(`veo.button.action1`)},{value:`image2video`,label:this.$t(`veo.button.action2`)},{value:`ingredients2video`,label:this.$t(`veo.button.actionIngredients`)}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||=ee}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,me,[e(`h2`,he,r(t.$t(`veo.name.action`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),clearable:``},{default:f(()=>[(h(!0),o(s,null,m(t.options,t=>(h(),d(g,{key:t.value,label:t.label,value:t.value},{default:f(()=>[e(`span`,ge,r(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=O(pe,[[`render`,_e],[`__scopeId`,`data-v-261798ae`]]),ye=_({name:`TranslationSelector`,components:{ElSwitch:T,InfoIcon:G},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug(`set translation`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`},we={class:`flex justify-end items-center`};function Te(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-switch`);return h(),o(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,r(t.$t(`veo.name.translation`)),1),i(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,we,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ee=O(ye,[[`render`,Te]]),De=_({name:`AspectRatioSelector`,data(){return{options:[{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.veo?.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||=D}}),Oe={class:`text-sm font-bold mb-2 block`},ke={class:`items`},Ae=[`onClick`],je={class:`name`};function Me(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,Oe,r(n.$t(`veo.name.ratio`)),1),e(`div`,ke,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,je,r(i.label),1)],10,Ae))),128))])])}var Ne=O(De,[[`render`,Me],[`__scopeId`,`data-v-28c472c4`]]),Pe=_({name:`StartEndImage`,components:{ElUpload:b,ElButton:A,InfoIcon:G,FontAwesomeIcon:B,ImagePreview:H},mixins:[I,N],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||=void 0,this.onSetStartEndImageUrl()},methods:{onExceed(){k.warning(this.$t(`veo.message.uploadReferencesExceed`))},onError(){k.error(this.$t(`veo.message.uploadReferencesError`))},onSetStartEndImageUrl(){let e=this.urls;this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),Fe={class:`relative`},Ie={class:`flex justify-between`},Le={class:`flex justify-start items-center`},Re={class:`text-sm font-bold`};function ze(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`font-awesome-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`span`,Re,r(t.$t(`veo.name.startEndImage`)),1),i(g,{content:t.$t(`veo.description.uploadStartEndImage`)},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:2,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:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{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`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),n(` `+r(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Be=O(Pe,[[`render`,ze],[`__scopeId`,`data-v-f9a79b4a`]]),Ve=_({name:`PromptInput`,components:{PromptTextarea:Q},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function He(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`veo.name.prompt`),info:e.$t(`veo.description.prompt`),placeholder:e.$t(`veo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ue=_({name:`ConfigPanel`,components:{ElButton:A,Consumption:W,FontAwesomeIcon:B,PromptInput:O(Ve,[[`render`,He]]),ModelSelector:fe,StartEndImage:Be,ActionSelector:ve,TranslationSelector:Ee,AspectRatioSelector:Ne},emits:[`generate`],computed:{config(){return this.$store.state.veo?.config},consumption(){return M(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),We={class:`flex flex-col h-full`},Ge={class:`flex-1 overflow-y-auto p-5`},Ke={class:`flex flex-col items-center justify-center px-5 pb-5`};function qe(t,s,l,u,p,m){let g=c(`action-selector`),_=c(`translation-selector`),v=c(`aspect-ratio-selector`),y=c(`prompt-input`),b=c(`model-selector`),x=c(`start-end-image`),S=c(`consumption`),C=c(`font-awesome-icon`),w=c(`el-button`);return h(),o(`div`,We,[e(`div`,Ge,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),i(y,{class:`mb-4`}),t.config?.action===`ingredients2video`?a(``,!0):(h(),d(b,{key:0,class:`mb-4`})),t.config?.action===`image2video`||t.config?.action===`ingredients2video`?(h(),d(x,{key:1,class:`mb-2`})):a(``,!0)]),e(`div`,Ke,[i(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(C,{icon:`fa-solid fa-magic`,class:`mr-2`}),n(` `+r(t.$t(`veo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Je=O(Ue,[[`render`,qe]]),Ye=_({name:`TaskPreview`,components:{ElImage:S,CopyToClipboard:V,FontAwesomeIcon:B,ElAlert:C,VideoPlayer:J,ElTooltip:x,ElButton:A,ApiCodeButton:Y},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Xe={class:`preview`},Ze={class:`left`},Qe={class:`main`},$e={class:`bot`},et={class:`datetime`},tt={class:`info`},nt={key:0,class:`prompt mt-2`},rt={key:0},it={key:1},at={key:0,class:t({content:!0,failed:!0})},ot={key:0,class:`mb-4`},st={key:1,class:t({operations:!0,"mt-2":!0})},ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ut={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},dt={key:1,class:t({content:!0})},ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ht={key:2,class:t({content:!0})},gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function vt(t,s,l,u,p,m){let g=c(`el-image`),_=c(`video-player`),v=c(`el-button`),y=c(`el-tooltip`),b=c(`api-code-button`),x=c(`font-awesome-icon`),S=c(`copy-to-clipboard`),C=c(`el-alert`);return h(),o(`div`,Xe,[e(`div`,Ze,[i(g,{src:`https://cdn.acedata.cloud/8nxyy9.jpg`,class:`avatar`})]),e(`div`,Qe,[e(`div`,$e,[n(r(t.$t(`veo.name.veoBot`))+` `,1),e(`span`,et,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,tt,[t.modelValue?.request?.prompt?(h(),o(`p`,nt,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(h(),o(`span`,rt,` - (`+r(t.$t(`veo.status.pending`))+`) `,1)),Array.isArray(t.modelValue?.response?.data)&&t.modelValue?.response?.data[0]?.state===`running`?(h(),o(`span`,it,` - (`+r(t.$t(`veo.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),t.modelValue?.response?.success===!0&&t.modelValue?.response?.data?(h(),o(`div`,at,[t.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,ot,[i(_,{src:t.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),t.modelValue?.response.success?(h(),o(`div`,st,[i(y,{class:`box-item`,effect:`dark`,content:t.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:f(()=>[t.modelValue?.response?.data[0]?.video_url?(h(),d(v,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:s[0]||=e=>t.onDownload(e,t.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(t.$t(`veo.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(b,{path:`/veo/videos`,body:t.modelValue?.request},null,8,[`body`])])):a(``,!0),i(C,{closable:!1,class:`mt-2 success`},{default:f(()=>[e(`p`,ct,[i(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.model`))+`: `+r(t.modelValue?.request?.model),1)]),e(`p`,lt,[i(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(S,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,ut,[i(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===!1?(h(),o(`div`,dt,[i(C,{closable:!1,class:`failure`},{template:f(()=>[i(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.failure`)),1)]),default:f(()=>[e(`p`,ft,[i(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(S,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,$,[i(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(S,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,pt,[i(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),t.modelValue?.response?.trace_id?(h(),o(`p`,mt,[i(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(S,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===void 0?(h(),o(`div`,ht,[i(C,{closable:!1,class:`info`},{template:f(()=>[i(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.failure`)),1)]),default:f(()=>[e(`p`,gt,[i(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(S,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(h(),o(`p`,_t,[i(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),n(` `+r(t.$t(`veo.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(S,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):a(``,!0)]),_:1})])):a(``,!0)])])}var yt=_({name:`RecentPanel`,components:{TaskPreview:O(Ye,[[`render`,vt],[`__scopeId`,`data-v-a44f5f6b`]]),NoTasks:Z,BotPlaceholder:X,ScrollList:K},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),bt={key:0},xt={key:2,class:`w-full h-full flex items-center justify-center`};function St(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,bt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,xt,[i(v)])):a(``,!0)],64)}var Ct=_({name:`VeoIndex`,components:{ConfigPanel:Je,Layout:se,RecentPanel:O(yt,[[`render`,St]])},mixins:[j],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===R.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.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 q({tasks:this.tasks,getTasks:()=>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(`veo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`veo/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(`veo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!L(this.uploadTracker,e=>this.$t(e),e=>k.warning(e)))return;let e={...this.config,async:!0};if(!te())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}if(e.action===`image2video`&&!(e.image_urls&&e.image_urls.length>0)){k.warning(this.$t(`veo.message.imageRequired`));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,k.info(this.$t(`veo.message.startingTask`)),F(`veo`,P.generate(e,{token:t})).then(()=>{k.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?k.error(this.$t(`veo.message.usedUp`)):k.error(this.$t(`veo.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function wt(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Tt=O(Ct,[[`render`,wt]]);export{Tt 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-BN4KFxVt.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-CE3OnWHD.js";import{i as S,n as C,r as w,t as T}from"./Logo-Da04kY9l.js";import{nr as E}from"./constants-D8dwgBQJ.js";import{Ei as D,G as O,J as k,Oi as A,Ot as j,Ui as M,_t as N,bi as P,gn as F,lt as I,wi as L,xn as R}from"./index-BrXcZpB0.js";import{t as z}from"./BottomFooter-C2Xb1WTE.js";var B=p({name:`TopHeader`,components:{ElCol:m,Logo:T,ElRow:h,ElDropdown:x,ElMenu:C,ElMenuItem:w,ElDropdownItem:b,ElButton:M,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},isMainOfficialHost(){return R()},isDesktopChrome(){return L()},isMacChrome(){return L()&&D()}},methods:{openTab(e){if(A()){k.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:j})},onLogin(){this.$store.dispatch(`login`,{redirect:this.$route.fullPath})},onDownload(){this.$router.push({name:N})},onProfile(){let e=P();this.openTab(F(`${e}/user/profile`))},onVerify(){let e=P();this.openTab(F(`${e}/user/verify`))},onConsole(){this.$router.push({name:I})},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`]),p.isMainOfficialHost?c((f(),l(x,{key:0,onRoute:e=>void 0,onClick:p.onDownload},null,8,[`onClick`])),[[j,`common.nav.mobileApp`]]):a(``,!0),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};
|