@acedatacloud/nexior 3.356.2 → 3.356.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-CiYVI-BW.js → ApiCodeButton-DnW2mEEl.js} +1 -1
- package/dist/assets/{Artifacts-oV-cxX6-.js → Artifacts-BbXNE0MY.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BJ5H7v3C.js → AskUserQuestionCard-Cbw3Hxlr.js} +1 -1
- package/dist/assets/{Auth-DmbX4IcG.js → Auth-Csf5NVN-.js} +1 -1
- package/dist/assets/{Bare-CKC6gxoC.js → Bare-CtV6pjUP.js} +1 -1
- package/dist/assets/{BotPlaceholder-CWVuEjbL.js → BotPlaceholder-hcIRfy3i.js} +1 -1
- package/dist/assets/{BottomFooter-C80gDUXR.js → BottomFooter-DzQdavFJ.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-NGsMVfzJ.js → BrowserPairingDialog-Cl__jmX7.js} +1 -1
- package/dist/assets/{Callback-CEITpQWh.js → Callback-CaJlsIlI.js} +1 -1
- package/dist/assets/{CodeSnippet-BUumFIYE.js → CodeSnippet-PjDE_CEu.js} +1 -1
- package/dist/assets/{Console-DaKR60hu.js → Console-B2Ek4SCM.js} +1 -1
- package/dist/assets/{Consumption-64yHTpsG.js → Consumption-C1nuDweL.js} +1 -1
- package/dist/assets/{Conversation-fDmuX-NP.js → Conversation-BMSIKWqv.js} +1 -1
- package/dist/assets/{Conversation-Br3QCbxZ.js → Conversation-inS0U5qq.js} +1 -1
- package/dist/assets/{CopyToClipboard-BoetcLMP.js → CopyToClipboard-CLVp5I29.js} +1 -1
- package/dist/assets/{Detail-xLit1ZcQ.js → Detail-4_enJ6qH.js} +2 -2
- package/dist/assets/{Extra-C2v1moyP.js → Extra-Ce7_Kba0.js} +1 -1
- package/dist/assets/{FilePreview-CL9QnaXZ.js → FilePreview-BlCzWGSp.js} +1 -1
- package/dist/assets/{Hailuo-BgKkSb1Z.js → Hailuo-CRu4cYR4.js} +1 -1
- package/dist/assets/{History-Csx7tGHq.js → History-CyDH3_w6.js} +1 -1
- package/dist/assets/{ImagePreview-Bc9stSGF.js → ImagePreview-DIR230rQ.js} +1 -1
- package/dist/assets/{ImageWrapper-BU9rTzRE.js → ImageWrapper-DTMYPBbG.js} +1 -1
- package/dist/assets/{Index-CbYgQHvA.js → Index-7-jB-rrs.js} +1 -1
- package/dist/assets/{Index-CxtAOMuR2.js → Index-B5t18uMS2.js} +1 -1
- package/dist/assets/{Index-BLkVvuW1.js → Index-B8Wivqji.js} +1 -1
- package/dist/assets/Index-BU-Jt2iC.css +1 -0
- package/dist/assets/{Index-Dp4r7Gxt.js → Index-BXIajqur.js} +1 -1
- package/dist/assets/{Index-C7sDNFdr.js → Index-Bh0MSga2.js} +1 -1
- package/dist/assets/{Index-MJKawRgO.js → Index-Bhge0Ye3.js} +1 -1
- package/dist/assets/{Index-BZIytdwE.js → Index-BjUC4Qy2.js} +1 -1
- package/dist/assets/{Index-Dy27xVwA.js → Index-BlIY8K2y.js} +1 -1
- package/dist/assets/{Index-B1r3Gul3.js → Index-Bp4mYiWT.js} +1 -1
- package/dist/assets/{Index-CFxfsEB3.js → Index-Bpv_QguW.js} +1 -1
- package/dist/assets/{Index-ip9nThQe.js → Index-BrILi0-c.js} +1 -1
- package/dist/assets/{Index-D29WuERC.js → Index-C-wEZgIN.js} +1 -1
- package/dist/assets/Index-CBybAWmy.js +1 -0
- package/dist/assets/{Index-ByElOcMX.js → Index-CGHYkqjO.js} +1 -1
- package/dist/assets/{Index-fb0d5Ij8.js → Index-CMihZ-nT.js} +1 -1
- package/dist/assets/{Index-D1kTVn4v.js → Index-CNdFXrFF.js} +1 -1
- package/dist/assets/{Index-CUKoS2jG2.js → Index-CVhzkBCU2.js} +1 -1
- package/dist/assets/{Index-CzZIKZir.js → Index-CWPkVAGu.js} +1 -1
- package/dist/assets/{Index-fCMXDMdR.js → Index-CbuI24qA.js} +1 -1
- package/dist/assets/{Index-BSOYkVrY2.js → Index-CyI5B5Iw2.js} +1 -1
- package/dist/assets/{Index-cmED8Wf82.js → Index-D2n66vom2.js} +1 -1
- package/dist/assets/{Index-DVZYw8Ti.js → Index-D5cJIMqk.js} +1 -1
- package/dist/assets/{Index-D1mfppvZ.js → Index-D89ynFEG.js} +1 -1
- package/dist/assets/{Index-BWKAgE_L.js → Index-DExxCDca.js} +1 -1
- package/dist/assets/{Index-BMvzcOYA.js → Index-DYxSLsTm.js} +1 -1
- package/dist/assets/{Index-BbpkGoZb.js → Index-DZ8exWOg.js} +1 -1
- package/dist/assets/{Index-C79dNjpN.js → Index-DgR8EjvG.js} +1 -1
- package/dist/assets/{Index-BzEW9qOH.js → Index-F5FVH4XA.js} +1 -1
- package/dist/assets/{Index-B7ZIhLPz.js → Index-IWedAkVJ.js} +1 -1
- package/dist/assets/{Index-DVb4v3oF.js → Index-KWeUZuBG.js} +1 -1
- package/dist/assets/{Index-EXzPO3cH.js → Index-KigOtr6Q.js} +1 -1
- package/dist/assets/{Index-d0Ax26tm.js → Index-Q9SnXeG5.js} +1 -1
- package/dist/assets/{Index-CHjMy5ex2.js → Index-b_bVC-2v2.js} +1 -1
- package/dist/assets/{Index-DHDKggl22.js → Index-fAKzMOZY2.js} +1 -1
- package/dist/assets/{Invitees-Cjh_HkSH.js → Invitees-t8LjUtox.js} +1 -1
- package/dist/assets/{List-pfCsf92F.js → List-BcdTB0xZ.js} +1 -1
- package/dist/assets/{List-dw1Xv1Kt.js → List-CiRlLqQi.js} +1 -1
- package/dist/assets/{List-Dj0wsQZF.js → List-D0ppoVM_.js} +1 -1
- package/dist/assets/{LocalTools-Dz6pS18B.js → LocalTools-8f1nIu1i.js} +1 -1
- package/dist/assets/{LocalTools-L1Z9CYWz.js → LocalTools-TuBOV-fy.js} +1 -1
- package/dist/assets/{Logo-IS52iyq3.js → Logo-BIQjmFe8.js} +1 -1
- package/dist/assets/{Main-CKzyMm5n.js → Main-BM7WSyw6.js} +1 -1
- package/dist/assets/{Message-CYvcKMlp.js → Message-CrGhKWMq.js} +2 -2
- package/dist/assets/{Model-C2N_nPmj.js → Model-BDoRG1y3.js} +1 -1
- package/dist/assets/{Navigator-DbZtnb_p.js → Navigator-Uk0XBf21.js} +3 -3
- package/dist/assets/{NotFound-P7fqDiGG.js → NotFound-BxmMuusa.js} +1 -1
- package/dist/assets/{PageHeader-SdNvT1p3.js → PageHeader-B7aH63od.js} +1 -1
- package/dist/assets/{Pay-CkRLPLzC.js → Pay-a8uYoEfm.js} +1 -1
- package/dist/assets/{Player-cWxD5Tss.js → Player-tEjbz8km.js} +1 -1
- package/dist/assets/{Poivelle-BnqjulQy.js → Poivelle-D2Pg88fJ.js} +1 -1
- package/dist/assets/{RealtimeCall-Bp8EL62t.js → RealtimeCall-Dh_EECLN.js} +1 -1
- package/dist/assets/{ReportButton-D7JGzuC6.js → ReportButton-CYa13w8h.js} +1 -1
- package/dist/assets/{ReportDialog-DmMuOP3a.js → ReportDialog-BdPWn65b.js} +1 -1
- package/dist/assets/{ScheduledTasks-DTSyAEUZ.js → ScheduledTasks-d52JFkP6.js} +1 -1
- package/dist/assets/{Status-CSRYA8fU.js → Status-xxs4gXOB.js} +1 -1
- package/dist/assets/{Subscribe-Ci1vhdb7.js → Subscribe-DgrTtF4n.js} +1 -1
- package/dist/assets/{TabSwitcher-ClLXbedz.js → TabSwitcher-C_N_7W5M.js} +1 -1
- package/dist/assets/{Tts-BtFmYfFd.js → Tts-ZE4EzLsJ.js} +1 -1
- package/dist/assets/{VideoPlayer-DZajGyHg.js → VideoPlayer-C44SsSWU.js} +1 -1
- package/dist/assets/{VideoPreview-yy9EIf_l.js → VideoPreview-D2JHTDU8.js} +1 -1
- package/dist/assets/arrow-down-DfZZ6O9V.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-Bh9l3U0_.js → arrow-down-wide-narrow-CXsartjU.js} +1 -1
- package/dist/assets/arrow-left-uQ2QSI6E.js +1 -0
- package/dist/assets/arrow-right-DLK8H_c3.js +1 -0
- package/dist/assets/arrow-up-CySfbL5G.js +1 -0
- package/dist/assets/{authorizeFlow-B9aZMxfA.js → authorizeFlow-qoRgSMcK.js} +1 -1
- package/dist/assets/{avatar-D8dj7T0j.js → avatar-B9amXRqx.js} +1 -1
- package/dist/assets/{basic-BRAq7Qs_.js → basic-POh0fuWQ.js} +1 -1
- package/dist/assets/{book-open-Bgt2CzJP.js → book-open-DJntghzP.js} +1 -1
- package/dist/assets/{box-K1AOg2Dt.js → box-BgafcOxN.js} +1 -1
- package/dist/assets/{boxes-nkCCYn_H.js → boxes-BxwF-h52.js} +1 -1
- package/dist/assets/{brain-OfFe2iNh.js → brain-DRAL5UnC.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-NmmizHnk.js → chart-no-axes-combined-C2XBdAJR.js} +1 -1
- package/dist/assets/{chat-fmefJyfA.js → chat-C-QhdNDG.js} +1 -1
- package/dist/assets/check-C1SSXE37.js +1 -0
- package/dist/assets/chevron-down-D54yUG_W.js +1 -0
- package/dist/assets/chevron-right-kcQrk7a4.js +1 -0
- package/dist/assets/circle-check-B7M0eLJf.js +1 -0
- package/dist/assets/{circle-question-mark-J5LrgC7z.js → circle-question-mark-CkrnC9TN.js} +1 -1
- package/dist/assets/{clipboard-list-D6rxrE8d.js → clipboard-list-BQu_m5lA.js} +1 -1
- package/dist/assets/clock-DcgPnVJa.js +1 -0
- package/dist/assets/code-Cx-HLyjl.js +1 -0
- package/dist/assets/{codingBridge-CWXTjgaq.js → codingBridge-5Younw34.js} +2 -2
- package/dist/assets/{codingBridgeNotify-CNQGGqEk.js → codingBridgeNotify-dNV0kJQ8.js} +2 -2
- package/dist/assets/{coins-CA8lophH.js → coins-gBDFWv_r.js} +1 -1
- package/dist/assets/{collapse-LIyzteME.js → collapse-B_99IkFQ.js} +1 -1
- package/dist/assets/{constants-CQR8cCBL.js → constants-C44cV5UH.js} +1 -1
- package/dist/assets/{copy-B489PY7H.js → copy-DpODTAxb.js} +1 -1
- package/dist/assets/{createTaskActions-hQu69zYP.js → createTaskActions-bHjJf96C.js} +1 -1
- package/dist/assets/{digitalhuman-C-m4TlWk.js → digitalhuman-DgSMt73W.js} +1 -1
- package/dist/assets/{dollar-sign-d8zK5thl.js → dollar-sign-BGeaa3gL.js} +1 -1
- package/dist/assets/{download-CoMPboZJ.js → download-CZLXh4-2.js} +1 -1
- package/dist/assets/{drawer-BMRGHI-3.js → drawer-CL63mgQu.js} +1 -1
- package/dist/assets/{dropdown-DzzmAJqH.js → dropdown-B8Z-l-iE.js} +1 -1
- package/dist/assets/{dropdown-fFM8TrPr.js → dropdown-kUTe8e-9.js} +1 -1
- package/dist/assets/{ellipsis-Cxuin38H.js → ellipsis-Du3lY52z.js} +1 -1
- package/dist/assets/esm-B1tUH8kr.js +1 -0
- package/dist/assets/{esm-DWKsBcY1.js → esm-BGOjVEnk.js} +3 -3
- package/dist/assets/{esm-DlTz8W4O.js → esm-DHZANs_t.js} +2 -2
- package/dist/assets/{esm-xG4UB0yZ.js → esm-DOo7uPDb.js} +2 -2
- package/dist/assets/{esm-DtlST3qG.js → esm-DTElW73d.js} +1 -1
- package/dist/assets/{esm-BDC0wUT8.js → esm-aYaknvQ1.js} +1 -1
- package/dist/assets/{esm-E98t4dD8.js → esm-j1DgBTjx.js} +1 -1
- package/dist/assets/{external-link-CgEa7yis.js → external-link-dZgWEqL4.js} +1 -1
- package/dist/assets/{eye-C4SyrpXf.js → eye-DFp2jfce.js} +1 -1
- package/dist/assets/{file-BNfEG5IF.js → file-DvOzOx_P.js} +1 -1
- package/dist/assets/{file-output-DNvvFeOx.js → file-output-19dlKJBf.js} +1 -1
- package/dist/assets/{file-text--Qjz57wL.js → file-text-mDCcsztI.js} +1 -1
- package/dist/assets/{fish-BhaYIY2P.js → fish-D60Al1yj.js} +1 -1
- package/dist/assets/{flux-SeBD2b5R.js → flux-d_SeQnk9.js} +1 -1
- package/dist/assets/{folder-DcItLXw1.js → folder-DbyunSbX.js} +1 -1
- package/dist/assets/gauge-CdYwce4s.js +1 -0
- package/dist/assets/{globe-DcRbETD-.js → globe-BhHHcHQD.js} +1 -1
- package/dist/assets/{grokvideo-CwVElxKX.js → grokvideo-S1pCi5Tr.js} +1 -1
- package/dist/assets/{hailuo-maOTnYd1.js → hailuo-M_qwVpNw.js} +1 -1
- package/dist/assets/{headphones-DCnnsYrD.js → headphones-Dr9_CJTJ.js} +1 -1
- package/dist/assets/{history-5dWDE2j4.js → history-CCILjiNN.js} +1 -1
- package/dist/assets/{house-BIolUNvl.js → house-BTwHBckD.js} +1 -1
- package/dist/assets/{i18n-D69rWLe_.js → i18n-Cqi3MO17.js} +1 -1
- package/dist/assets/{image-l7GEfh5m.js → image-ltLE0_B2.js} +1 -1
- package/dist/assets/{index-DIgS5Gvp.js → index-CREYJmGZ.js} +6 -6
- package/dist/assets/{index.browser.esm-BglHW4F-.js → index.browser.esm-NRFegStZ.js} +1 -1
- package/dist/assets/{index.es-Ci-Vjlrb.js → index.es-Dp5oaXS7.js} +1 -1
- package/dist/assets/{info-C40CnPeL.js → info-B6zz-sKo.js} +1 -1
- package/dist/assets/{input-number-ByXVBT4t.js → input-number-u0MGro2n.js} +1 -1
- package/dist/assets/intro-2CIeLa4V.js +1 -0
- package/dist/assets/intro-BQHGX5HW.js +1 -0
- package/dist/assets/intro-BTSbJEHO.js +1 -0
- package/dist/assets/intro-BuaD45ZB.js +1 -0
- package/dist/assets/intro-CVqOAs0d.js +1 -0
- package/dist/assets/intro-CX-tVM1n.js +1 -0
- package/dist/assets/intro-CumGy2RC.js +1 -0
- package/dist/assets/intro-D26BGrp9.js +1 -0
- package/dist/assets/intro-D7SWXPm3.js +1 -0
- package/dist/assets/intro-DFfBLUfo.js +1 -0
- package/dist/assets/intro-Dq8aF71M.js +1 -0
- package/dist/assets/intro-HirJwSQO.js +1 -0
- package/dist/assets/intro-JkrATbbK.js +1 -0
- package/dist/assets/intro-Y10dLinG.js +1 -0
- package/dist/assets/intro-Z5WuhH2a.js +1 -0
- package/dist/assets/intro-bo9fZbK4.js +1 -0
- package/dist/assets/intro-msK-p0lY.js +1 -0
- package/dist/assets/intro-zxCwJqFb.js +1 -0
- package/dist/assets/{key-round-D4yW8b4H.js → key-round-CgK5ul3S.js} +1 -1
- package/dist/assets/{kling-BBObHQ4y.js → kling-DdPnVX2L.js} +1 -1
- package/dist/assets/{languages-DPAWujhs.js → languages-CVKa6GSx.js} +1 -1
- package/dist/assets/{laptop-CkMMUQQ5.js → laptop-C1UtQchD.js} +1 -1
- package/dist/assets/{lightbulb-BYkyNQBq.js → lightbulb-DMMH-itQ.js} +1 -1
- package/dist/assets/{link-DKCPP9JK.js → link-Ck182LqI.js} +1 -1
- package/dist/assets/loader-circle-BJdKG6dp.js +1 -0
- package/dist/assets/{lock-D-SCAKKf.js → lock-DGLRMLsk.js} +1 -1
- package/dist/assets/{luma-CWo2eJhn.js → luma-D08kYXX2.js} +1 -1
- package/dist/assets/{maestro-D6pCMVdC.js → maestro-BSTyCJsV.js} +1 -1
- package/dist/assets/{maestro-Dk0xw1uy.js → maestro-wC6egBQw.js} +1 -1
- package/dist/assets/{mail-DsWU4MNx.js → mail-Dte9tFt2.js} +1 -1
- package/dist/assets/{message-circle-PQt0Q2mh.js → message-circle-DWzinnDO.js} +1 -1
- package/dist/assets/{mic-CrSotd0p.js → mic-Dow6VrJE.js} +1 -1
- package/dist/assets/{midjourney-w3B_dqpl.js → midjourney-BPtltduI.js} +1 -1
- package/dist/assets/{mobileLocalExec-CN1GlgN2.js → mobileLocalExec-DaDhbwJt.js} +2 -2
- package/dist/assets/{models-CwEjR6Nf.js → models-DcpkDkjF.js} +1 -1
- package/dist/assets/{monitor-BHx1oad3.js → monitor-DkCq84E2.js} +1 -1
- package/dist/assets/{mouse-pointer-2-BSu7sguX.js → mouse-pointer-2-9VJBV_22.js} +1 -1
- package/dist/assets/music-2-iJ0GWVrl.js +1 -0
- package/dist/assets/{nanobanana-CtkE9yDF.js → nanobanana-CYmgToNy.js} +1 -1
- package/dist/assets/{omni-DXnPbKHE.js → omni-CldP_ZwX.js} +1 -1
- package/dist/assets/{openaiimage-6vtOuJFv.js → openaiimage-d3GjQIMh.js} +1 -1
- package/dist/assets/{pagination-CebMKB63.js → pagination-BbFTEjBg.js} +1 -1
- package/dist/assets/{pagination-CP5QlGv2.js → pagination-IckkXpUO.js} +1 -1
- package/dist/assets/{pagination-BNPMPfyr.js → pagination-uq23xZEg.js} +1 -1
- package/dist/assets/{palette-DGHTNrTx.js → palette-D_hzvJDa.js} +1 -1
- package/dist/assets/{paperclip-D7VNr9Qq.js → paperclip-BYNr5XFL.js} +1 -1
- package/dist/assets/{pause-Ck2Rq3YJ.js → pause-BWpPJP_R.js} +1 -1
- package/dist/assets/{pencil-Djn9Hc9z.js → pencil-BhwkvOrn.js} +1 -1
- package/dist/assets/{pika-HczyW99B.js → pika-CLJeCDA-.js} +1 -1
- package/dist/assets/{pixverse-b652Co6y.js → pixverse-CmbNyRQT.js} +1 -1
- package/dist/assets/play-CJx7xQc1.js +1 -0
- package/dist/assets/{plug-B6e7XxKm.js → plug-Bm5lTQdF.js} +1 -1
- package/dist/assets/plus--lrUTaV9.js +1 -0
- package/dist/assets/{poivelle-BkvmnyzU.js → poivelle-BCa_2ckb.js} +1 -1
- package/dist/assets/{popover-Br-sCBHH.js → popover-s9P5QTaN.js} +1 -1
- package/dist/assets/{producer-D0wRhvwS.js → producer-CJpFQFtR.js} +1 -1
- package/dist/assets/{qrart-BrgI_rXw.js → qrart-j4X6G25p.js} +1 -1
- package/dist/assets/{realtime-mVqPss9r.js → realtime-DGslBgjF.js} +1 -1
- package/dist/assets/{refresh-cw-DqyQYIrN.js → refresh-cw-DsZHH-ne.js} +1 -1
- package/dist/assets/rotate-ccw-CwG8Tr4q.js +1 -0
- package/dist/assets/rotate-cw-is7J0f7E.js +1 -0
- package/dist/assets/{row-Cbv7FLTy.js → row-DQqpuvYH.js} +1 -1
- package/dist/assets/search-B-v-GhMv.js +1 -0
- package/dist/assets/{seedance-K37GcyFq.js → seedance-DyH2BqTs.js} +1 -1
- package/dist/assets/{seedream-DHdTsMrg.js → seedream-LGwBa99t.js} +1 -1
- package/dist/assets/{select-CUw_YhcY.js → select-jRFQ1Hzk.js} +1 -1
- package/dist/assets/{serp-b5iBdcvx.js → serp-BdAsrKwn.js} +1 -1
- package/dist/assets/{shield-CzPrLCPw.js → shield-41WYVrpG.js} +1 -1
- package/dist/assets/{shuffle-DI8PXiNu.js → shuffle-bmih4UqZ.js} +1 -1
- package/dist/assets/{slider-508i2Vb5.js → slider-B_xhGTdh.js} +1 -1
- package/dist/assets/{solana-wallets-DLq6-GrY.js → solana-wallets-DYmoNImk.js} +2 -2
- package/dist/assets/{solana-wallets-vue-Crh7p7UD.js → solana-wallets-vue-B5OBaahJ.js} +1 -1
- package/dist/assets/{sora-D5EIXmmO.js → sora-o-5xigw-.js} +1 -1
- package/dist/assets/{sparkles-BFNqXTZL.js → sparkles-BIuDjfQg.js} +1 -1
- package/dist/assets/square-OXtSEmlD.js +1 -0
- package/dist/assets/{store-BaH2jfBX.js → store-Co9jwnq8.js} +1 -1
- package/dist/assets/{suno-BuLDW1Vh.js → suno-FRCRn1YL.js} +1 -1
- package/dist/assets/{switch-BHE5VSJC.js → switch-CP09CWeK.js} +1 -1
- package/dist/assets/{table-C42opMok.js → table-Cg2N5b5E.js} +1 -1
- package/dist/assets/{tabs-BFs4t-aK.js → tabs-DsmI05G2.js} +1 -1
- package/dist/assets/{tag-CScqQXGX.js → tag-YwN0l1gW.js} +1 -1
- package/dist/assets/terminal-D9ZMN0k5.js +1 -0
- package/dist/assets/{time-picker-CEYuPPVi.js → time-picker-BqcqHMtN.js} +1 -1
- package/dist/assets/{tooltip-xGYGkgTR.js → tooltip-bfg-03mE.js} +1 -1
- package/dist/assets/{trash-2-xb-Jm4i0.js → trash-2-CDz5PwCk.js} +1 -1
- package/dist/assets/{triangle-alert-COLtfogn.js → triangle-alert-Z8DwGNFK.js} +1 -1
- package/dist/assets/{upload-Bu37nR-5.js → upload-CYgk_oSr.js} +1 -1
- package/dist/assets/{upload-CI1ZP51F.js → upload-DerPm8IS.js} +1 -1
- package/dist/assets/user-C8SZiVQC.js +1 -0
- package/dist/assets/{veo-Bl64NYd7.js → veo-DUuufx00.js} +1 -1
- package/dist/assets/{video-CYTJ80IP.js → video-Brn0_a8G.js} +1 -1
- package/dist/assets/{volume-2-Cd9jV3NX.js → volume-2-ovELC7ze.js} +1 -1
- package/dist/assets/{wallet-g88KrNyB.js → wallet-9ymkHmqV.js} +1 -1
- package/dist/assets/{wan-a4X7kt1x.js → wan-Bw9kZwn9.js} +1 -1
- package/dist/assets/{wand-sparkles-DDyMsIR4.js → wand-sparkles-yU_7R4u-.js} +1 -1
- package/dist/assets/{web-BK1giVaU.js → web-BHLJMImD.js} +1 -1
- package/dist/assets/{web-Bk36mANR.js → web-BoThAuaz.js} +1 -1
- package/dist/assets/{web-BrXDDpbD.js → web-BzrH1Vlj.js} +1 -1
- package/dist/assets/{web-BSXd6Enl.js → web-Dc_YylFI.js} +1 -1
- package/dist/assets/{web-CN5hmZ5J.js → web-Dgy8v0wC.js} +1 -1
- package/dist/assets/{webextrator-J-SZn-nF.js → webextrator-D-jr1MFk.js} +1 -1
- package/dist/assets/{zap-UpSN-PKO.js → zap-C0PdDJso.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/Index-DNp3_EIy.js +0 -1
- package/dist/assets/Index-Dt0MGZVR.css +0 -1
- package/dist/assets/arrow-down-D1ze7Zz7.js +0 -1
- package/dist/assets/arrow-left-i-SsgbVR.js +0 -1
- package/dist/assets/arrow-right-HPaEW4ct.js +0 -1
- package/dist/assets/arrow-up-DPsaJu0u.js +0 -1
- package/dist/assets/check-D7wYAXxh.js +0 -1
- package/dist/assets/chevron-down-7kJMC2ch.js +0 -1
- package/dist/assets/chevron-right-BaNlttpH.js +0 -1
- package/dist/assets/circle-check-BlfTJ16z.js +0 -1
- package/dist/assets/clock-CS3ZX4nf.js +0 -1
- package/dist/assets/code-C18Pb5Rt.js +0 -1
- package/dist/assets/esm-BL-lS1AO.js +0 -1
- package/dist/assets/gauge-DMrbDCVd.js +0 -1
- package/dist/assets/intro-7jC51zyA.js +0 -1
- package/dist/assets/intro-B4j8G6Wn.js +0 -1
- package/dist/assets/intro-B7ZR6MnR.js +0 -1
- package/dist/assets/intro-B_1eX0NN.js +0 -1
- package/dist/assets/intro-Bcw1QD06.js +0 -1
- package/dist/assets/intro-C9lKNVJp.js +0 -1
- package/dist/assets/intro-CIqtCCxn.js +0 -1
- package/dist/assets/intro-CSc4mVpE.js +0 -1
- package/dist/assets/intro-CuHGodEn.js +0 -1
- package/dist/assets/intro-CzRUcQTo.js +0 -1
- package/dist/assets/intro-D-bQZq5n.js +0 -1
- package/dist/assets/intro-D3xF3uFy.js +0 -1
- package/dist/assets/intro-DhjBVTet.js +0 -1
- package/dist/assets/intro-SJ6J3iZY.js +0 -1
- package/dist/assets/intro-eclZL9RF.js +0 -1
- package/dist/assets/intro-mc9fOYHH.js +0 -1
- package/dist/assets/intro-mnSZn8oq.js +0 -1
- package/dist/assets/intro-tDJyt_-M.js +0 -1
- package/dist/assets/loader-circle-DC7tP4px.js +0 -1
- package/dist/assets/music-2-C2YDBG9V.js +0 -1
- package/dist/assets/play-DFR_GqpJ.js +0 -1
- package/dist/assets/plus-lIyMOEZf.js +0 -1
- package/dist/assets/rotate-ccw-D9mZ9lfD.js +0 -1
- package/dist/assets/rotate-cw-CwiEEFRc.js +0 -1
- package/dist/assets/search-iterppMr.js +0 -1
- package/dist/assets/square-Bl9we4gC.js +0 -1
- package/dist/assets/terminal-BlBAbz4X.js +0 -1
- package/dist/assets/user-DV5LrGq4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-CUw_YhcY.js";import{n as x,t as S}from"./tabs-BFs4t-aK.js";import{t as C}from"./upload-CI1ZP51F.js";import{t as w}from"./tooltip-xGYGkgTR.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-CwEjR6Nf.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-BMRGHI-3.js";import{t as j}from"./input-number-ByXVBT4t.js";import{t as M}from"./slider-508i2Vb5.js";import{t as N}from"./switch-BHE5VSJC.js";import{t as ee}from"./clock-CS3ZX4nf.js";import{a as te,c as ne,n as re,o as P,r as ie,t as ae}from"./pagination-CebMKB63.js";import{t as oe}from"./headphones-DCnnsYrD.js";import{t as se}from"./info-C40CnPeL.js";import{t as ce}from"./lightbulb-BYkyNQBq.js";import{t as le}from"./trash-2-xb-Jm4i0.js";import{t as ue}from"./triangle-alert-COLtfogn.js";import{t as F}from"./upload-Bu37nR-5.js";import{t as I}from"./wand-sparkles-DDyMsIR4.js";import{_i as L,fi as de,gi as fe,hi as pe}from"./constants-CQR8cCBL.js";import{$t as R,Fi as z,Jt as me,Mr as B,Ni as he,O as V,Qt as H,Ui as ge,Xt as _e,Yt as ve,Zt as ye,en as be,in as xe,ir as U,nn as W,pn as G,si as K,tn as q,xi as J,yi as Se}from"./index-DIgS5Gvp.js";import{t as Ce}from"./CopyToClipboard-BoetcLMP.js";import{t as we}from"./ReportButton-D7JGzuC6.js";import{t as Te}from"./FilePreview-CL9QnaXZ.js";import{t as Y}from"./ImagePreview-Bc9stSGF.js";import{n as Ee}from"./taskDrawerMixin-DyAUhFEq.js";import{t as X}from"./Consumption-64yHTpsG.js";import{n as De,t as Oe}from"./VideoPreview-yy9EIf_l.js";import{t as ke}from"./VideoPlayer-DZajGyHg.js";import{t as Ae}from"./ApiCodeButton-CiYVI-BW.js";import{t as je}from"./BotPlaceholder-CWVuEjbL.js";var Me=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:z},mixins:[Ee]}),Ne={class:`main flex flex-row flex-1 min-h-0`},Pe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Fe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ie(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ne,[e(`div`,Pe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Fe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Le=V(Me,[[`render`,Ie],[`__scopeId`,`data-v-2d826924`]]),Re={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Z(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,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Re}}var Q=`<<<video_1>>>`,ze=/<<<image_\d+>>>/g;function Be(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function Ve(e){return e?e.replace(ze,` `).replace(/\s{2,}/g,` `).trim():``}function He(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=Z(n,r,i),o=[];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`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function $(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===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Be(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Ve(n.prompt));return n}var Ue=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},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-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(de)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=He(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.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=$({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),We={class:`field`},Ge={class:`title font-bold`};function Ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,We,[e(`h2`,Ge,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 qe=V(Ue,[[`render`,Ke],[`__scopeId`,`data-v-a74e7f31`]]),Je=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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 L.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=He(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.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=$({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),Ye={class:`field`},Xe={class:`header`},Ze={class:`title font-bold`},Qe={key:0,class:`opt-tip`};function $e(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,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`,Qe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var et=V(Je,[[`render`,$e],[`__scopeId`,`data-v-9a8fa3c5`]]),tt=[3,5,8,10,12,15],nt=[5,10],rt=[5],it=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return L.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?rt:this.isV3Model?tt:nt},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:{selectedModel(){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=He(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.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=$({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),at={class:`field`},ot={class:`control`},st={class:`label`},ct={class:`title font-bold`};function lt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,at,[e(`div`,ot,[e(`div`,st,[e(`h2`,ct,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 ut=V(it,[[`render`,lt],[`__scopeId`,`data-v-496bf31c`]]),dt=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`}}),ft={class:`text-sm font-bold mb-2 block`},pt={class:`items`},mt=[`onClick`],ht={class:`name`};function gt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,ft,i(t.$t(`kling.name.ratio`)),1),e(`div`,pt,[(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`,ht,i(r.label),1)],10,mt))),128))])])}var _t=V(dt,[[`render`,gt],[`__scopeId`,`data-v-cdb14b2f`]]),vt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:z,ElTooltip:w,InfoIcon:P,ImagePreview:Y},mixins:[W,q,R],emits:[`change`],data(){return{fileList:[],uploadUrl:K()+`/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(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),yt={class:`relative`},bt={class:`flex min-h-8 items-center pr-20`},xt={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(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[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`,"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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 wt=V(vt,[[`render`,Ct],[`__scopeId`,`data-v-60844ac3`]]),Tt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:z,ElTooltip:w,ImagePreview:Y,InfoIcon:P},mixins:[W,q,R],data(){return{fileList:[],uploadUrl:K()+`/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 Z(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(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Et={class:`relative`},Dt={class:`flex min-h-8 items-center pr-20`},Ot={class:`flex justify-start items-center`},kt={class:`text-sm font-bold`};function At(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Et,[e(`div`,Dt,[e(`div`,Ot,[e(`span`,kt,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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 jt=V(Tt,[[`render`,At],[`__scopeId`,`data-v-b286c4d0`]]),Mt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:z,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:Te,UploadIcon:F},mixins:[q,R],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ye(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:_e(ve)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Q),i;if(e&&!r)i=n?`${n} ${Q}`:Q;else if(!e&&r)i=Be(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:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`},Lt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Rt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},zt={class:`text-sm`},Bt={class:`flex items-center justify-between gap-3`},Vt={class:`text-sm`};function Ht(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Lt,[e(`div`,Rt,[e(`span`,zt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Bt,[e(`span`,Vt,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Ut=V(Mt,[[`render`,Ht],[`__scopeId`,`data-v-e3a9dfab`]]),Wt=v({name:`KlingReferenceImages`,components:{ElButton:z,ElUpload:C,UploadIcon:F,ImagePreview:Y,InfoIcon:P},mixins:[W,q,R],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Ve(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),Gt={class:`relative`},Kt={class:`flex justify-between items-center`},qt={class:`flex justify-start items-center`},Jt={class:`text-sm font-bold`},Yt={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function Xt(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,Gt,[e(`div`,Kt,[e(`div`,qt,[e(`span`,Jt,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,Yt,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Zt=V(Wt,[[`render`,Xt]]),Qt=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},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}}),$t={class:`flex justify-between`},en={class:`flex justify-start items-center`},tn={class:`text-sm font-bold`},nn={class:`flex justify-end items-center`},rn={class:`w-full`};function an(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`,$t,[e(`div`,en,[e(`span`,tn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,nn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,rn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var on=V(Qt,[[`render`,an]]),sn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(L.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})}}}),cn={class:`relative`},ln={class:`flex justify-between items-center`},un={class:`flex justify-start items-center`},dn={class:`text-sm font-bold`};function fn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,cn,[e(`div`,ln,[e(`div`,un,[e(`span`,dn,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 pn=V(sn,[[`render`,fn]]),mn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],hn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:mn}},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 Z(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)}}}),gn={class:`field`},_n={class:`header`},vn={class:`text-sm font-bold`},yn={key:0,class:`config-grid`},bn={class:`cfg-row-head`},xn={class:`cfg-name`};function Sn(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`,gn,[e(`div`,_n,[e(`span`,vn,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`,yn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,bn,[e(`span`,xn,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 Cn=V(hn,[[`render`,Sn],[`__scopeId`,`data-v-cd896060`]]),wn=[{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`]}],Tn=`, `;function En(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Tn}${t}`:t}function Dn(e,t){if(!e||!t)return e||``;let n=[`${t}${Tn}`,`${Tn}${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 On=v({name:`InspirationPills`,components:{CloseIcon:Se},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return wn.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=Dn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),kn={key:0,class:`pills`,role:`list`},An={class:`pill-text`},jn=[`aria-label`,`title`,`onClick`];function Mn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,kn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,An,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,jn)]))),128))])):o(``,!0)}var Nn=v({name:`PromptInput`,components:{IdeaIcon:ce,ElButton:z,PromptTextarea:te,InspirationPills:V(On,[[`render`,Mn],[`__scopeId`,`data-v-6be01bcf`]])},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 Pn(e,t,n,o,s,c){let u=l(`idea-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,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Fn=V(Nn,[[`render`,Pn],[`__scopeId`,`data-v-5754ae54`]]),In=v({name:`NegativePromptInput`,components:{ElInput:ge,InfoIcon:P},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||=``}}),Ln={class:`field`},Rn={class:`box`},zn={class:`title font-bold`};function Bn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Ln,[e(`div`,Rn,[e(`h2`,zn,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 Vn=V(In,[[`render`,Bn],[`__scopeId`,`data-v-de98cf01`]]),Hn=v({name:`InspirationDrawer`,components:{Close:Se,IdeaIcon:ce,ElDrawer:A,ElButton:z},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:wn}},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(Dn(this.prompt,e)):this.setPrompt(En(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Dn(e,t);this.setPrompt(e)}}}),Un={class:`drawer-content`},Wn={class:`drawer-header`},Gn={class:`title-row`},Kn={class:`title`},qn={class:`hint`},Jn={key:0,class:`selected-bar`},Yn={class:`selected-text`},Xn={class:`groups`},Zn={class:`group-title`},Qn={class:`chip-grid`},$n=[`onClick`];function er(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{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`,Un,[e(`div`,Wn,[e(`div`,Gn,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Kn,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,qn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,Jn,[e(`span`,Yn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{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`,Zn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Qn,[(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,$n))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var tr=V(Hn,[[`render`,er],[`__scopeId`,`data-v-8b2e6a5d`]]),nr={"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-o1":`Kling O1`},rr={std:`720p`,pro:`1080p`,"4k":`4K`},ir=v({name:`SummaryChip`,components:{AudioIcon:oe},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return nr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return rr[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),ar={class:`summary-chip`},or=[`title`],sr=[`title`],cr=[`title`],lr=[`title`],ur=[`title`];function dr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,ar,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,or),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,sr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,cr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,lr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ur)):o(``,!0)])}var fr=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:z,Consumption:X,PromptInput:Fn,NegativePromptInput:Vn,ModelSelector:qe,ModeSelector:et,DurationSelector:ut,RatioSelector:_t,StartImage:wt,CfgScaleSelector:on,GenerateAudioSelector:pn,CameraControlSelector:Cn,InspirationDrawer:tr,SummaryChip:V(ir,[[`render`,dr],[`__scopeId`,`data-v-c800852a`]]),EndImage:jt,ReferenceImages:Zt,ReferenceVideo:Ut},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Z(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return xe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={class:`flex flex-col items-center justify-center px-5 pb-5`};function gr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`consumption`),j=l(`magic-icon`),M=l(`el-button`),N=l(`inspiration-drawer`);return g(),s(`div`,pr,[e(`div`,mr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,hr,[a(k),a(A,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(M,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(M,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(N,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var _r=V(fr,[[`render`,gr]]),vr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:z,InfoIcon:P,ImagePreview:Y},mixins:[W,q,R,me],data(){return{fileList:[],uploadUrl:K()+`/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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),yr={class:`relative`},br={class:`flex justify-between`},xr={class:`flex justify-start items-center`},Sr={class:`text-sm font-bold`};function Cr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,yr,[e(`div`,br,[e(`div`,xr,[e(`span`,Sr,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,"before-upload":t.beforeUploadSizeGuard,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var wr=V(vr,[[`render`,Cr],[`__scopeId`,`data-v-4a95ef2c`]]),Tr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:z,InfoIcon:P,FilePreview:Te},mixins:[q,R],data(){return{fileList:[],uploadUrl:K()+`/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(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.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:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.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()}}}),Er={class:`relative`},Dr={class:`flex justify-between`},Or={class:`flex justify-start items-center`},kr={class:`text-sm font-bold`};function Ar(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Er,[e(`div`,Dr,[e(`div`,Or,[e(`span`,kr,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var jr=V(Tr,[[`render`,Ar],[`__scopeId`,`data-v-630c4521`]]),Mr=v({name:`MotionPromptInput`,components:{ElInput:ge,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Nr={class:`field`},Pr={class:`box`},Fr={class:`title font-bold`};function Ir(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Nr,[e(`div`,Pr,[e(`h2`,Fr,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 Lr=V(Mr,[[`render`,Ir],[`__scopeId`,`data-v-ca9fdbe5`]]),Rr=`video`,zr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Rr},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=Rr)}}),Br={class:`field`},Vr={class:`header`},Hr={class:`text-sm font-bold`};function Ur(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`,Br,[e(`div`,Vr,[e(`span`,Hr,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 Wr=V(zr,[[`render`,Ur],[`__scopeId`,`data-v-7a91195b`]]),Gr=`kling-v2-6`,Kr=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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)}}),qr={class:`field`},Jr={class:`header`},Yr={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`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=V(Kr,[[`render`,Xr],[`__scopeId`,`data-v-480e8da2`]]),Qr=`std`,$r=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||Qr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`title font-bold`};function ri(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ei,[e(`div`,ti,[e(`h2`,ni,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 ii=V($r,[[`render`,ri],[`__scopeId`,`data-v-1295688c`]]),ai=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},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`})}}}}),oi={class:`relative`},si={class:`flex justify-between items-center`},ci={class:`flex justify-start items-center`},li={class:`text-sm font-bold`};function ui(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,oi,[e(`div`,si,[e(`div`,ci,[e(`span`,li,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 di=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:z,Consumption:X,MotionImage:wr,MotionVideo:jr,MotionPromptInput:Lr,CharacterOrientationSelector:Wr,MotionModelSelector:Zr,MotionModeSelector:ii,KeepOriginalSoundSelector:V(ai,[[`render`,ui]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return xe({...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`)}}}),fi={class:`flex flex-col h-full`},pi={class:`flex-1 overflow-y-auto p-5`},mi={class:`flex flex-col items-center justify-center px-5 pb-5`};function hi(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(`magic-icon`),C=l(`el-button`);return g(),s(`div`,fi,[e(`div`,pi,[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`,mi,[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,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var gi=V(di,[[`render`,hi]]),_i=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:he},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)}}}),vi=[`title`],yi={class:`text`};function bi(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 scenario-tabs scenario-tabs--divided`,"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`,yi,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,vi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var xi=V(_i,[[`render`,bi],[`__scopeId`,`data-v-e6a2bb26`]]),Si={"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`},Ci=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:fe.map(e=>({value:e,label:Si[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=pe)}}),wi={class:`field`},Ti={class:`title font-bold`};function Ei(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,wi,[e(`h2`,Ti,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 Di=V(Ci,[[`render`,Ei],[`__scopeId`,`data-v-cbc83d11`]]),Oi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},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`)}}),ki={class:`field`},Ai={class:`title font-bold`};function ji(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,ki,[e(`h2`,Ai,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 Mi=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:z,ElInput:ge,Consumption:X,InfoIcon:P,ImagePreview:Y,ModelSelector:Di,ModeSelector:V(Oi,[[`render`,ji],[`__scopeId`,`data-v-92525a1d`]])},mixins:[R,me],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:K()+`/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 xe({...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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.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(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.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`)}}}),Ni={class:`flex flex-col h-full`},Pi={class:`flex-1 overflow-y-auto p-5`},Fi={class:`relative mb-4`},Ii={class:`flex justify-start items-center`},Li={class:`text-sm font-bold`},Ri={class:`relative mb-4`},zi={class:`flex justify-start items-center`},Bi={class:`text-sm font-bold`},Vi=[`src`],Hi={class:`mb-4`},Ui={class:`flex justify-start items-center`},Wi={class:`text-sm font-bold`},Gi={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ki(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`),T=l(`magic-icon`);return g(),s(`div`,Ni,[e(`div`,Pi,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Fi,[e(`div`,Ii,[e(`span`,Li,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,"before-upload":t.beforeUploadSizeGuard,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Ri,[e(`div`,zi,[e(`span`,Bi,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,"before-upload":t.beforeUploadSizeGuard,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`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,Vi)):o(``,!0)]),e(`div`,Hi,[e(`div`,Ui,[e(`span`,Wi,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(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var qi=V(Mi,[[`render`,Ki],[`__scopeId`,`data-v-b47b80bd`]]),Ji=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:ne,InfoIcon:se,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:Ce,ElAlert:T,VideoPlayer:ke,ElTooltip:w,ElButton:z,ImagePreview:Y,VideoPreview:Oe,AudioPreview:De,ApiCodeButton:Ae,ReportButton:we},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await J.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Yi={class:`preview`},Xi={class:`left`},Zi={class:`main`},Qi={class:`bot`},$i={class:`datetime`},ea=[`aria-label`],ta={key:0,class:`info`},na={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},ra={key:1,class:`prompt`},ia={key:0},aa={key:1},oa={key:1,class:n({content:!0,failed:!0})},sa={key:0,class:`mb-4`},ca={key:1,class:n({operations:!0,"mt-2":!0})},la={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ua={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},fa={key:2,class:n({content:!0})},pa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ha={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ga={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_a={key:3,class:n({content:!0})},va={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ya={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ba(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),te=l(`info-icon`);return g(),s(`div`,Yi,[e(`div`,Xi,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,Zi,[e(`div`,Qi,[a(y,{capability:`kling`,part:`name`}),e(`span`,$i,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ea)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ta,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,na,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,ra,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,aa,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,ia,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,oa,[n.modelValue?.response.video_url?(g(),s(`div`,sa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,ca,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,la,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,ua,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,da,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,fa,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,pa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,ma,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ha,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,ga,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,_a,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,va,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,ya,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var xa=v({name:`RecentPanel`,components:{TaskPreview:V(Ji,[[`render`,ba],[`__scopeId`,`data-v-73637147`]]),NoTasks:ie,BotPlaceholder:je,ScrollList:re},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?.()}}}),Sa={key:0},Ca={key:2,class:`w-full h-full flex items-center justify-center`};function wa(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`,Sa,[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`,Ca,[a(v)])):o(``,!0)],64)}var Ta=v({name:`KlingIndex`,components:{ConfigPanel:_r,MotionPanel:gi,TalkingPhotoPanel:qi,TabSwitcher:xi,Layout:Le,RecentPanel:V(xa,[[`render`,wa]])},mixins:[be],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.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 ae({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(!H(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0},r=Number(!!n.start_image_url)+Number(!!n.end_image_url),i=n.image_list?.length||0,a=n.video_list?.length?4:7;if(r+i>a){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:a}));return}if(n.video_list?.[0]?.refer_type===`base`&&(n.start_image_url||n.end_image_url||n.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){D.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))}:{}}),!G())return;let o=this.credential?.token;if(!o){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),B(`kling`,U.generate(n,{token:o})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.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(!H(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.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(!G())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),B(`kling`,U.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!H(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.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(!G())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),B(`kling`,U.talkingPhoto(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ea={class:`flex flex-col h-full`},Da={class:`flex-1 min-h-0`};function Oa(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`,Ea,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Da,[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 ka=V(Ta,[[`render`,Oa]]);export{ka as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-jRFQ1Hzk.js";import{n as x,t as S}from"./tabs-DsmI05G2.js";import{t as C}from"./upload-DerPm8IS.js";import{t as w}from"./tooltip-bfg-03mE.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-DcpkDkjF.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-CL63mgQu.js";import{t as j}from"./input-number-u0MGro2n.js";import{t as M}from"./slider-B_xhGTdh.js";import{t as N}from"./switch-CP09CWeK.js";import{t as ee}from"./clock-DcgPnVJa.js";import{a as te,c as ne,n as re,o as P,r as ie,t as ae}from"./pagination-BbFTEjBg.js";import{t as oe}from"./headphones-Dr9_CJTJ.js";import{t as se}from"./info-B6zz-sKo.js";import{t as ce}from"./lightbulb-DMMH-itQ.js";import{t as le}from"./trash-2-CDz5PwCk.js";import{t as ue}from"./triangle-alert-Z8DwGNFK.js";import{t as F}from"./upload-CYgk_oSr.js";import{t as I}from"./wand-sparkles-yU_7R4u-.js";import{_i as L,fi as de,gi as fe,hi as pe}from"./constants-C44cV5UH.js";import{$t as R,Fi as z,Jt as me,Mr as B,Ni as he,O as V,Qt as H,Ui as ge,Xt as _e,Yt as ve,Zt as ye,en as be,in as xe,ir as U,nn as W,pn as G,si as K,tn as q,xi as J,yi as Se}from"./index-CREYJmGZ.js";import{t as Ce}from"./CopyToClipboard-CLVp5I29.js";import{t as we}from"./ReportButton-CYa13w8h.js";import{t as Te}from"./FilePreview-BlCzWGSp.js";import{t as Y}from"./ImagePreview-DIR230rQ.js";import{n as Ee}from"./taskDrawerMixin-DyAUhFEq.js";import{t as X}from"./Consumption-C1nuDweL.js";import{n as De,t as Oe}from"./VideoPreview-D2JHTDU8.js";import{t as ke}from"./VideoPlayer-C44SsSWU.js";import{t as Ae}from"./ApiCodeButton-DnW2mEEl.js";import{t as je}from"./BotPlaceholder-hcIRfy3i.js";var Me=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:z},mixins:[Ee]}),Ne={class:`main flex flex-row flex-1 min-h-0`},Pe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Fe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ie(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ne,[e(`div`,Pe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Fe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Le=V(Me,[[`render`,Ie],[`__scopeId`,`data-v-2d826924`]]),Re={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Z(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,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Re}}var Q=`<<<video_1>>>`,ze=/<<<image_\d+>>>/g;function Be(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function Ve(e){return e?e.replace(ze,` `).replace(/\s{2,}/g,` `).trim():``}function He(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=Z(n,r,i),o=[];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`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function $(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===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Be(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Ve(n.prompt));return n}var Ue=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},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-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(de)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=He(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.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=$({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),We={class:`field`},Ge={class:`title font-bold`};function Ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,We,[e(`h2`,Ge,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 qe=V(Ue,[[`render`,Ke],[`__scopeId`,`data-v-a74e7f31`]]),Je=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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 L.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=He(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.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=$({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),Ye={class:`field`},Xe={class:`header`},Ze={class:`title font-bold`},Qe={key:0,class:`opt-tip`};function $e(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,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`,Qe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var et=V(Je,[[`render`,$e],[`__scopeId`,`data-v-9a8fa3c5`]]),tt=[3,5,8,10,12,15],nt=[5,10],rt=[5],it=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return L.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?rt:this.isV3Model?tt:nt},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:{selectedModel(){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=He(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.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=$({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),at={class:`field`},ot={class:`control`},st={class:`label`},ct={class:`title font-bold`};function lt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,at,[e(`div`,ot,[e(`div`,st,[e(`h2`,ct,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 ut=V(it,[[`render`,lt],[`__scopeId`,`data-v-496bf31c`]]),dt=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`}}),ft={class:`text-sm font-bold mb-2 block`},pt={class:`items`},mt=[`onClick`],ht={class:`name`};function gt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,ft,i(t.$t(`kling.name.ratio`)),1),e(`div`,pt,[(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`,ht,i(r.label),1)],10,mt))),128))])])}var _t=V(dt,[[`render`,gt],[`__scopeId`,`data-v-cdb14b2f`]]),vt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:z,ElTooltip:w,InfoIcon:P,ImagePreview:Y},mixins:[W,q,R],emits:[`change`],data(){return{fileList:[],uploadUrl:K()+`/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(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),yt={class:`relative`},bt={class:`flex min-h-8 items-center pr-20`},xt={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(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[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`,"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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 wt=V(vt,[[`render`,Ct],[`__scopeId`,`data-v-60844ac3`]]),Tt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:z,ElTooltip:w,ImagePreview:Y,InfoIcon:P},mixins:[W,q,R],data(){return{fileList:[],uploadUrl:K()+`/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 Z(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(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Et={class:`relative`},Dt={class:`flex min-h-8 items-center pr-20`},Ot={class:`flex justify-start items-center`},kt={class:`text-sm font-bold`};function At(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Et,[e(`div`,Dt,[e(`div`,Ot,[e(`span`,kt,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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 jt=V(Tt,[[`render`,At],[`__scopeId`,`data-v-b286c4d0`]]),Mt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:z,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:Te,UploadIcon:F},mixins:[q,R],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ye(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:_e(ve)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Q),i;if(e&&!r)i=n?`${n} ${Q}`:Q;else if(!e&&r)i=Be(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:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`},Lt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Rt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},zt={class:`text-sm`},Bt={class:`flex items-center justify-between gap-3`},Vt={class:`text-sm`};function Ht(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Lt,[e(`div`,Rt,[e(`span`,zt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Bt,[e(`span`,Vt,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Ut=V(Mt,[[`render`,Ht],[`__scopeId`,`data-v-e3a9dfab`]]),Wt=v({name:`KlingReferenceImages`,components:{ElButton:z,ElUpload:C,UploadIcon:F,ImagePreview:Y,InfoIcon:P},mixins:[W,q,R],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Ve(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),Gt={class:`relative`},Kt={class:`flex justify-between items-center`},qt={class:`flex justify-start items-center`},Jt={class:`text-sm font-bold`},Yt={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function Xt(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,Gt,[e(`div`,Kt,[e(`div`,qt,[e(`span`,Jt,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,Yt,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Zt=V(Wt,[[`render`,Xt]]),Qt=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},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}}),$t={class:`flex justify-between`},en={class:`flex justify-start items-center`},tn={class:`text-sm font-bold`},nn={class:`flex justify-end items-center`},rn={class:`w-full`};function an(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`,$t,[e(`div`,en,[e(`span`,tn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,nn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,rn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var on=V(Qt,[[`render`,an]]),sn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(L.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})}}}),cn={class:`relative`},ln={class:`flex justify-between items-center`},un={class:`flex justify-start items-center`},dn={class:`text-sm font-bold`};function fn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,cn,[e(`div`,ln,[e(`div`,un,[e(`span`,dn,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 pn=V(sn,[[`render`,fn]]),mn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],hn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:mn}},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 Z(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)}}}),gn={class:`field`},_n={class:`header`},vn={class:`text-sm font-bold`},yn={key:0,class:`config-grid`},bn={class:`cfg-row-head`},xn={class:`cfg-name`};function Sn(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`,gn,[e(`div`,_n,[e(`span`,vn,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`,yn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,bn,[e(`span`,xn,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 Cn=V(hn,[[`render`,Sn],[`__scopeId`,`data-v-cd896060`]]),wn=[{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`]}],Tn=`, `;function En(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Tn}${t}`:t}function Dn(e,t){if(!e||!t)return e||``;let n=[`${t}${Tn}`,`${Tn}${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 On=v({name:`InspirationPills`,components:{CloseIcon:Se},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return wn.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=Dn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),kn={key:0,class:`pills`,role:`list`},An={class:`pill-text`},jn=[`aria-label`,`title`,`onClick`];function Mn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,kn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,An,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,jn)]))),128))])):o(``,!0)}var Nn=v({name:`PromptInput`,components:{IdeaIcon:ce,ElButton:z,PromptTextarea:te,InspirationPills:V(On,[[`render`,Mn],[`__scopeId`,`data-v-6be01bcf`]])},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 Pn(e,t,n,o,s,c){let u=l(`idea-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,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Fn=V(Nn,[[`render`,Pn],[`__scopeId`,`data-v-5754ae54`]]),In=v({name:`NegativePromptInput`,components:{ElInput:ge,InfoIcon:P},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||=``}}),Ln={class:`field`},Rn={class:`box`},zn={class:`title font-bold`};function Bn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Ln,[e(`div`,Rn,[e(`h2`,zn,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 Vn=V(In,[[`render`,Bn],[`__scopeId`,`data-v-de98cf01`]]),Hn=v({name:`InspirationDrawer`,components:{Close:Se,IdeaIcon:ce,ElDrawer:A,ElButton:z},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:wn}},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(Dn(this.prompt,e)):this.setPrompt(En(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Dn(e,t);this.setPrompt(e)}}}),Un={class:`drawer-content`},Wn={class:`drawer-header`},Gn={class:`title-row`},Kn={class:`title`},qn={class:`hint`},Jn={key:0,class:`selected-bar`},Yn={class:`selected-text`},Xn={class:`groups`},Zn={class:`group-title`},Qn={class:`chip-grid`},$n=[`onClick`];function er(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{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`,Un,[e(`div`,Wn,[e(`div`,Gn,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Kn,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,qn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,Jn,[e(`span`,Yn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{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`,Zn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Qn,[(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,$n))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var tr=V(Hn,[[`render`,er],[`__scopeId`,`data-v-8b2e6a5d`]]),nr={"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-o1":`Kling O1`},rr={std:`720p`,pro:`1080p`,"4k":`4K`},ir=v({name:`SummaryChip`,components:{AudioIcon:oe},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return nr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return rr[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),ar={class:`summary-chip`},or=[`title`],sr=[`title`],cr=[`title`],lr=[`title`],ur=[`title`];function dr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,ar,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,or),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,sr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,cr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,lr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ur)):o(``,!0)])}var fr=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:z,Consumption:X,PromptInput:Fn,NegativePromptInput:Vn,ModelSelector:qe,ModeSelector:et,DurationSelector:ut,RatioSelector:_t,StartImage:wt,CfgScaleSelector:on,GenerateAudioSelector:pn,CameraControlSelector:Cn,InspirationDrawer:tr,SummaryChip:V(ir,[[`render`,dr],[`__scopeId`,`data-v-c800852a`]]),EndImage:jt,ReferenceImages:Zt,ReferenceVideo:Ut},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Z(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return xe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={class:`flex flex-col items-center justify-center px-5 pb-5`};function gr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`consumption`),j=l(`magic-icon`),M=l(`el-button`),N=l(`inspiration-drawer`);return g(),s(`div`,pr,[e(`div`,mr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,hr,[a(k),a(A,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(M,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(M,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(N,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var _r=V(fr,[[`render`,gr]]),vr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:z,InfoIcon:P,ImagePreview:Y},mixins:[W,q,R,me],data(){return{fileList:[],uploadUrl:K()+`/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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),yr={class:`relative`},br={class:`flex justify-between`},xr={class:`flex justify-start items-center`},Sr={class:`text-sm font-bold`};function Cr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,yr,[e(`div`,br,[e(`div`,xr,[e(`span`,Sr,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,"before-upload":t.beforeUploadSizeGuard,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var wr=V(vr,[[`render`,Cr],[`__scopeId`,`data-v-4a95ef2c`]]),Tr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:z,InfoIcon:P,FilePreview:Te},mixins:[q,R],data(){return{fileList:[],uploadUrl:K()+`/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(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.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:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.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()}}}),Er={class:`relative`},Dr={class:`flex justify-between`},Or={class:`flex justify-start items-center`},kr={class:`text-sm font-bold`};function Ar(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Er,[e(`div`,Dr,[e(`div`,Or,[e(`span`,kr,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var jr=V(Tr,[[`render`,Ar],[`__scopeId`,`data-v-630c4521`]]),Mr=v({name:`MotionPromptInput`,components:{ElInput:ge,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Nr={class:`field`},Pr={class:`box`},Fr={class:`title font-bold`};function Ir(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Nr,[e(`div`,Pr,[e(`h2`,Fr,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 Lr=V(Mr,[[`render`,Ir],[`__scopeId`,`data-v-ca9fdbe5`]]),Rr=`video`,zr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Rr},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=Rr)}}),Br={class:`field`},Vr={class:`header`},Hr={class:`text-sm font-bold`};function Ur(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`,Br,[e(`div`,Vr,[e(`span`,Hr,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 Wr=V(zr,[[`render`,Ur],[`__scopeId`,`data-v-7a91195b`]]),Gr=`kling-v2-6`,Kr=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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)}}),qr={class:`field`},Jr={class:`header`},Yr={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`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=V(Kr,[[`render`,Xr],[`__scopeId`,`data-v-480e8da2`]]),Qr=`std`,$r=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||Qr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`title font-bold`};function ri(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ei,[e(`div`,ti,[e(`h2`,ni,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 ii=V($r,[[`render`,ri],[`__scopeId`,`data-v-1295688c`]]),ai=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},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`})}}}}),oi={class:`relative`},si={class:`flex justify-between items-center`},ci={class:`flex justify-start items-center`},li={class:`text-sm font-bold`};function ui(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,oi,[e(`div`,si,[e(`div`,ci,[e(`span`,li,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 di=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:z,Consumption:X,MotionImage:wr,MotionVideo:jr,MotionPromptInput:Lr,CharacterOrientationSelector:Wr,MotionModelSelector:Zr,MotionModeSelector:ii,KeepOriginalSoundSelector:V(ai,[[`render`,ui]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return xe({...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`)}}}),fi={class:`flex flex-col h-full`},pi={class:`flex-1 overflow-y-auto p-5`},mi={class:`flex flex-col items-center justify-center px-5 pb-5`};function hi(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(`magic-icon`),C=l(`el-button`);return g(),s(`div`,fi,[e(`div`,pi,[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`,mi,[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,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var gi=V(di,[[`render`,hi]]),_i=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:he},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)}}}),vi=[`title`],yi={class:`text`};function bi(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 scenario-tabs scenario-tabs--divided`,"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`,yi,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,vi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var xi=V(_i,[[`render`,bi],[`__scopeId`,`data-v-e6a2bb26`]]),Si={"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`},Ci=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:fe.map(e=>({value:e,label:Si[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=pe)}}),wi={class:`field`},Ti={class:`title font-bold`};function Ei(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,wi,[e(`h2`,Ti,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 Di=V(Ci,[[`render`,Ei],[`__scopeId`,`data-v-cbc83d11`]]),Oi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},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`)}}),ki={class:`field`},Ai={class:`title font-bold`};function ji(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,ki,[e(`h2`,Ai,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 Mi=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:z,ElInput:ge,Consumption:X,InfoIcon:P,ImagePreview:Y,ModelSelector:Di,ModeSelector:V(Oi,[[`render`,ji],[`__scopeId`,`data-v-92525a1d`]])},mixins:[R,me],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:K()+`/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 xe({...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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.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(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.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`)}}}),Ni={class:`flex flex-col h-full`},Pi={class:`flex-1 overflow-y-auto p-5`},Fi={class:`relative mb-4`},Ii={class:`flex justify-start items-center`},Li={class:`text-sm font-bold`},Ri={class:`relative mb-4`},zi={class:`flex justify-start items-center`},Bi={class:`text-sm font-bold`},Vi=[`src`],Hi={class:`mb-4`},Ui={class:`flex justify-start items-center`},Wi={class:`text-sm font-bold`},Gi={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ki(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`),T=l(`magic-icon`);return g(),s(`div`,Ni,[e(`div`,Pi,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Fi,[e(`div`,Ii,[e(`span`,Li,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,"before-upload":t.beforeUploadSizeGuard,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Ri,[e(`div`,zi,[e(`span`,Bi,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,"before-upload":t.beforeUploadSizeGuard,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`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,Vi)):o(``,!0)]),e(`div`,Hi,[e(`div`,Ui,[e(`span`,Wi,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(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var qi=V(Mi,[[`render`,Ki],[`__scopeId`,`data-v-b47b80bd`]]),Ji=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:ne,InfoIcon:se,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:Ce,ElAlert:T,VideoPlayer:ke,ElTooltip:w,ElButton:z,ImagePreview:Y,VideoPreview:Oe,AudioPreview:De,ApiCodeButton:Ae,ReportButton:we},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await J.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Yi={class:`preview`},Xi={class:`left`},Zi={class:`main`},Qi={class:`bot`},$i={class:`datetime`},ea=[`aria-label`],ta={key:0,class:`info`},na={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},ra={key:1,class:`prompt`},ia={key:0},aa={key:1},oa={key:1,class:n({content:!0,failed:!0})},sa={key:0,class:`mb-4`},ca={key:1,class:n({operations:!0,"mt-2":!0})},la={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ua={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},fa={key:2,class:n({content:!0})},pa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ha={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ga={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_a={key:3,class:n({content:!0})},va={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ya={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ba(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),te=l(`info-icon`);return g(),s(`div`,Yi,[e(`div`,Xi,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,Zi,[e(`div`,Qi,[a(y,{capability:`kling`,part:`name`}),e(`span`,$i,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ea)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ta,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,na,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,ra,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,aa,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,ia,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,oa,[n.modelValue?.response.video_url?(g(),s(`div`,sa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,ca,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,la,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,ua,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,da,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,fa,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,pa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,ma,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ha,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,ga,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,_a,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,va,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,ya,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var xa=v({name:`RecentPanel`,components:{TaskPreview:V(Ji,[[`render`,ba],[`__scopeId`,`data-v-73637147`]]),NoTasks:ie,BotPlaceholder:je,ScrollList:re},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?.()}}}),Sa={key:0},Ca={key:2,class:`w-full h-full flex items-center justify-center`};function wa(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`,Sa,[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`,Ca,[a(v)])):o(``,!0)],64)}var Ta=v({name:`KlingIndex`,components:{ConfigPanel:_r,MotionPanel:gi,TalkingPhotoPanel:qi,TabSwitcher:xi,Layout:Le,RecentPanel:V(xa,[[`render`,wa]])},mixins:[be],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.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 ae({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(!H(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0},r=Number(!!n.start_image_url)+Number(!!n.end_image_url),i=n.image_list?.length||0,a=n.video_list?.length?4:7;if(r+i>a){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:a}));return}if(n.video_list?.[0]?.refer_type===`base`&&(n.start_image_url||n.end_image_url||n.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){D.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))}:{}}),!G())return;let o=this.credential?.token;if(!o){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),B(`kling`,U.generate(n,{token:o})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.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(!H(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.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(!G())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),B(`kling`,U.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!H(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.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(!G())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),B(`kling`,U.talkingPhoto(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ea={class:`flex flex-col h-full`},Da={class:`flex-1 min-h-0`};function Oa(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`,Ea,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Da,[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 ka=V(Ta,[[`render`,Oa]]);export{ka 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,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-HPaEW4ct.js";import{t as h}from"./check-D7wYAXxh.js";import{t as g}from"./external-link-CgEa7yis.js";import{t as ee}from"./globe-DcRbETD-.js";import{t as te}from"./wand-sparkles-DDyMsIR4.js";import{Fi as _,M as v,O as y,_n as b,i as x,r as S}from"./index-DIgS5Gvp.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:_,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||b()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:x.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?x:x.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(v())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe 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,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-DLK8H_c3.js";import{t as h}from"./check-C1SSXE37.js";import{t as g}from"./external-link-dZgWEqL4.js";import{t as ee}from"./globe-BhHHcHQD.js";import{t as te}from"./wand-sparkles-yU_7R4u-.js";import{Fi as _,M as v,O as y,_n as b,i as x,r as S}from"./index-CREYJmGZ.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:_,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||b()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:x.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?x:x.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(v())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,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-CUw_YhcY.js";import{t as b}from"./upload-CI1ZP51F.js";import{t as x}from"./tooltip-xGYGkgTR.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-CwEjR6Nf.js";import{n as T,r as E}from"./radio-BNhFzeBO.js";import{t as D}from"./drawer-BMRGHI-3.js";import{t as O}from"./switch-BHE5VSJC.js";import{t as k}from"./clock-CS3ZX4nf.js";import{a as A,c as j,n as M,o as N,r as P,t as F}from"./pagination-CebMKB63.js";import{t as I}from"./info-C40CnPeL.js";import{t as ee}from"./trash-2-xb-Jm4i0.js";import{t as te}from"./triangle-alert-COLtfogn.js";import{t as L}from"./upload-Bu37nR-5.js";import{t as R}from"./wand-sparkles-DDyMsIR4.js";import{vi as z}from"./constants-CQR8cCBL.js";import{$t as B,Fi as V,Jt as H,Mr as U,O as W,Qt as G,Tr as K,ar as q,en as J,in as Y,nn as X,pn as Z,si as Q,tn as ne,xi as re}from"./index-DIgS5Gvp.js";import{t as ie}from"./CopyToClipboard-BoetcLMP.js";import{t as ae}from"./ReportButton-D7JGzuC6.js";import{t as oe}from"./ImagePreview-Bc9stSGF.js";import{n as se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ce}from"./Consumption-64yHTpsG.js";import{t as le}from"./vue-plyr-wiIKa-zl.js";import{t as ue}from"./ApiCodeButton-CiYVI-BW.js";import{t as de}from"./BotPlaceholder-CWVuEjbL.js";var fe=_({name:`LayoutPika`,components:{MagicIcon:R,ElDrawer:D,ElButton:V},mixins:[se]}),pe={class:`main flex flex-row flex-1`},me={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},he={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ge(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,pe,[e(`div`,me,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,he,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var _e=W(fe,[[`render`,ge],[`__scopeId`,`data-v-14cc52c3`]]),ve=_({name:`IngredientsSelector`,components:{ElSwitch:O,InfoIcon:N},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients},set(e){if(!e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,ingredients_mode:void 0,image_url:void 0});return}this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,model:`2.0`})}}},mounted(){this.value===void 0&&(this.value=!1)}}),ye={class:`field`},be={class:`label`},xe={class:`title font-bold`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,ye,[e(`div`,be,[e(`h2`,xe,i(t.$t(`pika.name.ingredients`)),1),a(d,{content:t.$t(`pika.description.ingredients`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Ce=W(ve,[[`render`,Se],[`__scopeId`,`data-v-606e1d1a`]]),we=_({name:`EffectSelector`,components:{ElSelect:v,ElOption:y},data(){return{}},computed:{options(){return[{value:`Levitate`,label:this.$t(`pika.style.effect1`)},{value:`Decapitate`,label:this.$t(`pika.style.effect2`)},{value:`Eye-pop`,label:this.$t(`pika.style.effect3`)},{value:`Ta-da`,label:this.$t(`pika.style.effect4`)},{value:`Deflate`,label:this.$t(`pika.style.effect5`)},{value:`Crumble`,label:this.$t(`pika.style.effect6`)},{value:`Dissolve`,label:this.$t(`pika.style.effect7`)},{value:`Squish`,label:this.$t(`pika.style.effect8`)},{value:`Inflate`,label:this.$t(`pika.style.effect9`)},{value:`Melt`,label:this.$t(`pika.style.effect10`)},{value:`Cake-ify`,label:this.$t(`pika.style.effect11`)},{value:`Crush`,label:this.$t(`pika.style.effect12`)},{value:`Explode`,label:this.$t(`pika.style.effect13`)}]},value:{get(){return this.$store.state.pika?.config?.effect},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,effect:e})}}}}),Te={class:`field`},Ee={class:`title font-bold`},De={class:`float-left`};function Oe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Te,[e(`h2`,Ee,i(t.$t(`pika.name.effect`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`),clearable:``},{default:p(()=>[(h(!0),s(c,null,m(t.options,t=>(h(),f(g,{key:t.value,label:t.label,value:t.value},{default:p(()=>[e(`span`,De,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ke=W(we,[[`render`,Oe],[`__scopeId`,`data-v-d1c54475`]]),Ae=_({name:`IngredientsModelSelector`,components:{ElRadioButton:T,ElRadioGroup:E},data(){return{options:[{label:this.$t(`pika.button.precise`),value:`precise`},{label:this.$t(`pika.button.creative`),value:`creative`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients_mode},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients_mode:e})}}},mounted(){this.value||=z}}),je={class:`field`},Me={class:`title font-bold`};function Ne(t,n,o,u,d,g){let _=l(`el-radio-button`),v=l(`el-radio-group`);return h(),s(`div`,je,[e(`h2`,Me,i(t.$t(`pika.name.ingredientsModel`)),1),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`quality`},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.value},{default:p(()=>[r(i(e.label),1)]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])])}var Pe=W(Ae,[[`render`,Ne],[`__scopeId`,`data-v-b72865fa`]]),Fe=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`2.0`,label:`2.0`},{value:`1.5`,label:`1.5`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.model},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||=`2.0`}}),Ie={class:`field`},Le={class:`title font-bold`};function Re(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Ie,[e(`h2`,Le,i(t.$t(`pika.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ze=W(Fe,[[`render`,Re],[`__scopeId`,`data-v-7b2e870a`]]),Be=_({name:`ImageUrlInput`,components:{UploadIcon:L,ElUpload:b,ElButton:V,InfoIcon:N,ImagePreview:oe},mixins:[X,ne,B,H],data(){return{fileList:[],uploadUrl:Q()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.pika?.config?.image_url}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;let t=this.fileList.filter(e=>!e.response?.file_url),n=(e||[]).map(e=>this.fileList.find(t=>t.response?.file_url===e||t.url===e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}});this.fileList=[...n,...t.filter(e=>!n.includes(e))]}}},methods:{onChange(e){!e.url&&e.raw&&(e.url=URL.createObjectURL(e.raw))},onExceed(){w.warning(this.$t(`pika.message.uploadStartImageExceed`))},onError(){w.error(this.$t(`pika.message.uploadStartImageError`))},onRemove(){this.onSetStartImageUrl()},onSetStartImageUrl(){this.suppressWatch=!0,this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,image_url:this.urls}),this.$nextTick(()=>{this.suppressWatch=!1})},onSuccess(){this.onSetStartImageUrl()},onRemovePreview(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),e.url?.startsWith(`blob:`)&&URL.revokeObjectURL(e.url),this.onSetStartImageUrl()}}}),Ve={class:`field`},He={class:`label`},Ue={class:`title font-bold`},We={key:0,class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ge(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ve,[e(`div`,He,[e(`h2`,Ue,i(t.$t(`pika.name.imageUrl`)),1),a(v,{content:t.$t(`pika.description.imageUrl`),class:`info`},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:3,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-change":t.onChange,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`pika.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-change`,`on-remove`,`on-success`,`headers`])]),t.fileList.length?(h(),s(`div`,We,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemovePreview(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Ke=W(Be,[[`render`,Ge],[`__scopeId`,`data-v-637337bb`]]),qe=_({name:`PromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.pika?.config?.prompt},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Je(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`pika.name.prompt`),info:e.$t(`pika.description.prompt`),placeholder:e.$t(`pika.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ye=_({name:`PresetPanel`,components:{MagicIcon:R,ImageUrlInput:Ke,ElButton:V,Consumption:ce,PromptInput:W(qe,[[`render`,Je]]),IngredientsSelector:Ce,IngredientsModelSelector:Pe,ModelSelector:ze,EffectSelector:ke},emits:[`generate`],computed:{config(){return this.$store.state.pika?.config},consumption(){return Y(this.config,this.service?.cost)},service(){return this.$store.state.pika?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Xe={class:`flex flex-col h-full`},Ze={class:`flex-1 overflow-y-auto p-5`},Qe={class:`flex flex-col items-center justify-center px-5 pb-5`};function $e(t,n,c,u,d,m){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`ingredients-selector`),y=l(`effect-selector`),b=l(`image-url-input`),x=l(`ingredients-model-selector`),S=l(`consumption`),C=l(`magic-icon`),w=l(`el-button`);return h(),s(`div`,Xe,[e(`div`,Ze,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),t.config?.ingredients?(h(),f(b,{key:0,class:`mb-4`})):o(``,!0),t.config?.ingredients?(h(),f(x,{key:1,class:`mb-4`})):o(``,!0)]),e(`div`,Qe,[a(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`pika.button.generate`)),1)]),_:1},8,[`onClick`])])])}var et=W(Ye,[[`render`,$e]]),tt=_({name:`VideoPlayer`,components:{VuePlyr:le},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:1080,options:[1080]}}}}}),nt=[`data-poster`],rt=[`src`];function it(t,n,r,i,o,c){let u=l(`vue-plyr`);return h(),s(`div`,null,[a(u,{options:t.options,class:`video`},{default:p(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,"data-poster":t.modelValue?.image_url},[e(`source`,{size:`1080`,src:t.modelValue?.video_url,type:`video/mp4`},null,8,rt)],8,nt)]),_:1},8,[`options`])])}var at=_({name:`TaskPreview`,components:{DeleteIcon:ee,ChannelIcon:j,InfoIcon:I,MagicIcon:R,TimeIcon:k,WarningIcon:te,CopyToClipboard:ie,ElAlert:S,VideoPlayer:W(tt,[[`render`,it],[`__scopeId`,`data-v-897d9fe0`]]),ElTooltip:x,ElButton:V,ApiCodeButton:ue,ReportButton:ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pika?.application},config(){return this.$store.state.pika?.config},videos(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e.length===0&&e.push({}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await re.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`pika/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},isFailure(e){let t=this.modelValue?.response;return t?.success===!1||!!t?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(e){return this.modelValue?.response?this.isFailure(e)||e?.video_url?!1:!e?.state||[`queued`,`pending`,`processing`,`running`].includes(e.state):!0},onDownload(e){console.log(`on download`),window.open(e,`_blank`)},onReload(e){let t=e.target,n=new URL(t.src),r=n.searchParams.get(`retry`);if(!r)n.searchParams.set(`retry`,`1`);else if(parseInt(r)<2)n.searchParams.set(`retry`,(parseInt(r)+1).toString());else return;t.src=n.toString()},onOpenVideo(e){window.open(e,`_blank`)}}}),ot={class:`left`},st={class:`main`},ct={class:`bot`},lt={class:`datetime`},ut=[`aria-label`],dt={class:`info`},ft={key:0,class:`prompt mt-2`},pt={key:0},mt={key:1},ht={key:0,class:n({content:!0,failed:!0})},gt={class:`image-wrapper`},_t={key:0,class:n({operations:!0,"mt-2":!0})},vt={key:0,class:`description`},yt={class:`description`},$={key:1,class:`description`},bt={key:1,class:n({content:!0})},xt={class:`description`},St={class:`description`},Ct={key:0,class:`description`},wt={class:`description`},Tt={key:2,class:n({content:!0})},Et={class:`description`};function Dt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`VideoPlayer`),C=l(`el-button`),w=l(`api-code-button`),T=l(`report-button`),E=l(`channel-icon`),D=l(`magic-icon`),O=l(`copy-to-clipboard`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`);return h(!0),s(c,null,m(n.videos,(c,l)=>(h(),s(`div`,{key:l,class:`preview`},[e(`div`,ot,[a(y,{capability:`pika`,part:`avatar`,class:`avatar`})]),e(`div`,st,[e(`div`,ct,[a(y,{capability:`pika`,part:`name`}),e(`span`,lt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ut)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,dt,[n.modelValue?.request?.prompt?(h(),s(`p`,ft,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,pt,` - (`+i(n.$t(`pika.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting(c)?(h(),s(`span`,mt,` - (`+i(n.$t(`pika.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&c?.video_url?(h(),s(`div`,ht,[e(`div`,gt,[a(S,{"model-value":c},null,8,[`model-value`])]),c?(h(),s(`div`,_t,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`pika.message.downloadVideo`),placement:`top-start`},{default:p(()=>[c?.video_url?(h(),f(C,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:e=>n.onDownload(c?.video_url)},{default:p(()=>[r(i(n.$t(`pika.button.download`)),1)]),_:1},8,[`onClick`])):o(``,!0)]),_:2},1032,[`content`]),a(w,{path:`/pika/videos`,body:n.modelValue?.request},null,8,[`body`]),a(T,{service:`pika`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,vt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),e(`p`,yt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure(c)?(h(),s(`div`,bt,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.failure`)),1)]),default:p(()=>[e(`p`,xt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,St,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(O,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Ct,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,wt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(O,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting(c)?(h(),s(`div`,Tt,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`pika.status.processing`:`pika.status.pending`)),1)]),default:p(()=>[e(`p`,Et,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0)])]))),128)}var Ot=_({name:`RecentPanel`,components:{TaskPreview:W(at,[[`render`,Dt],[`__scopeId`,`data-v-4c95d941`]]),BotPlaceholder:de,NoTasks:P,ScrollList:M},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pika?.tasks,items:this.$store.state.pika?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),kt={key:0},At={key:2,class:`w-full h-full flex items-center justify-center`};function jt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,kt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{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:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,(e,t)=>(h(),f(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,At,[a(v)])):o(``,!0)],64)}var Mt=_({name:`PikaIndex`,components:{ConfigPanel:et,Layout:_e,RecentPanel:W(Ot,[[`render`,jt]])},mixins:[J],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pika?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.pika?.status?.getTasks===C.Request||this.fetchingTasks},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===C.Request},needApply(){return this.$store.state.pika.status.getApplications===C.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.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 F({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(`pika/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pika/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},onApply(){K.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&w.error(this.$t(`application.message.alreadyApplied`))})},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(`pika/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!G(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let e={...this.config,async:!0};if(!Z())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}w.info(this.$t(`pika.message.startingTask`)),U(`pika`,q.generate(e,{token:t})).then(()=>{w.success(this.$t(`pika.message.startTaskSuccess`)),this.$store.commit(`pika/setConfig`,{config:void 0})}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?w.error(this.$t(`pika.message.usedUp`)):w.error(this.$t(`pika.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Nt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Pt=W(Mt,[[`render`,Nt],[`__scopeId`,`data-v-fee6c9ea`]]);export{Pt 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,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-jRFQ1Hzk.js";import{t as b}from"./upload-DerPm8IS.js";import{t as x}from"./tooltip-bfg-03mE.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-DcpkDkjF.js";import{n as T,r as E}from"./radio-BNhFzeBO.js";import{t as D}from"./drawer-CL63mgQu.js";import{t as O}from"./switch-CP09CWeK.js";import{t as k}from"./clock-DcgPnVJa.js";import{a as A,c as j,n as M,o as N,r as P,t as F}from"./pagination-BbFTEjBg.js";import{t as I}from"./info-B6zz-sKo.js";import{t as ee}from"./trash-2-CDz5PwCk.js";import{t as te}from"./triangle-alert-Z8DwGNFK.js";import{t as L}from"./upload-CYgk_oSr.js";import{t as R}from"./wand-sparkles-yU_7R4u-.js";import{vi as z}from"./constants-C44cV5UH.js";import{$t as B,Fi as V,Jt as H,Mr as U,O as W,Qt as G,Tr as K,ar as q,en as J,in as Y,nn as X,pn as Z,si as Q,tn as ne,xi as re}from"./index-CREYJmGZ.js";import{t as ie}from"./CopyToClipboard-CLVp5I29.js";import{t as ae}from"./ReportButton-CYa13w8h.js";import{t as oe}from"./ImagePreview-DIR230rQ.js";import{n as se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ce}from"./Consumption-C1nuDweL.js";import{t as le}from"./vue-plyr-wiIKa-zl.js";import{t as ue}from"./ApiCodeButton-DnW2mEEl.js";import{t as de}from"./BotPlaceholder-hcIRfy3i.js";var fe=_({name:`LayoutPika`,components:{MagicIcon:R,ElDrawer:D,ElButton:V},mixins:[se]}),pe={class:`main flex flex-row flex-1`},me={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},he={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ge(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,pe,[e(`div`,me,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,he,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var _e=W(fe,[[`render`,ge],[`__scopeId`,`data-v-14cc52c3`]]),ve=_({name:`IngredientsSelector`,components:{ElSwitch:O,InfoIcon:N},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients},set(e){if(!e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,ingredients_mode:void 0,image_url:void 0});return}this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,model:`2.0`})}}},mounted(){this.value===void 0&&(this.value=!1)}}),ye={class:`field`},be={class:`label`},xe={class:`title font-bold`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,ye,[e(`div`,be,[e(`h2`,xe,i(t.$t(`pika.name.ingredients`)),1),a(d,{content:t.$t(`pika.description.ingredients`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Ce=W(ve,[[`render`,Se],[`__scopeId`,`data-v-606e1d1a`]]),we=_({name:`EffectSelector`,components:{ElSelect:v,ElOption:y},data(){return{}},computed:{options(){return[{value:`Levitate`,label:this.$t(`pika.style.effect1`)},{value:`Decapitate`,label:this.$t(`pika.style.effect2`)},{value:`Eye-pop`,label:this.$t(`pika.style.effect3`)},{value:`Ta-da`,label:this.$t(`pika.style.effect4`)},{value:`Deflate`,label:this.$t(`pika.style.effect5`)},{value:`Crumble`,label:this.$t(`pika.style.effect6`)},{value:`Dissolve`,label:this.$t(`pika.style.effect7`)},{value:`Squish`,label:this.$t(`pika.style.effect8`)},{value:`Inflate`,label:this.$t(`pika.style.effect9`)},{value:`Melt`,label:this.$t(`pika.style.effect10`)},{value:`Cake-ify`,label:this.$t(`pika.style.effect11`)},{value:`Crush`,label:this.$t(`pika.style.effect12`)},{value:`Explode`,label:this.$t(`pika.style.effect13`)}]},value:{get(){return this.$store.state.pika?.config?.effect},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,effect:e})}}}}),Te={class:`field`},Ee={class:`title font-bold`},De={class:`float-left`};function Oe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Te,[e(`h2`,Ee,i(t.$t(`pika.name.effect`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`),clearable:``},{default:p(()=>[(h(!0),s(c,null,m(t.options,t=>(h(),f(g,{key:t.value,label:t.label,value:t.value},{default:p(()=>[e(`span`,De,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ke=W(we,[[`render`,Oe],[`__scopeId`,`data-v-d1c54475`]]),Ae=_({name:`IngredientsModelSelector`,components:{ElRadioButton:T,ElRadioGroup:E},data(){return{options:[{label:this.$t(`pika.button.precise`),value:`precise`},{label:this.$t(`pika.button.creative`),value:`creative`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients_mode},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients_mode:e})}}},mounted(){this.value||=z}}),je={class:`field`},Me={class:`title font-bold`};function Ne(t,n,o,u,d,g){let _=l(`el-radio-button`),v=l(`el-radio-group`);return h(),s(`div`,je,[e(`h2`,Me,i(t.$t(`pika.name.ingredientsModel`)),1),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`quality`},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.value},{default:p(()=>[r(i(e.label),1)]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])])}var Pe=W(Ae,[[`render`,Ne],[`__scopeId`,`data-v-b72865fa`]]),Fe=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`2.0`,label:`2.0`},{value:`1.5`,label:`1.5`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.model},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||=`2.0`}}),Ie={class:`field`},Le={class:`title font-bold`};function Re(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Ie,[e(`h2`,Le,i(t.$t(`pika.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ze=W(Fe,[[`render`,Re],[`__scopeId`,`data-v-7b2e870a`]]),Be=_({name:`ImageUrlInput`,components:{UploadIcon:L,ElUpload:b,ElButton:V,InfoIcon:N,ImagePreview:oe},mixins:[X,ne,B,H],data(){return{fileList:[],uploadUrl:Q()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.pika?.config?.image_url}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;let t=this.fileList.filter(e=>!e.response?.file_url),n=(e||[]).map(e=>this.fileList.find(t=>t.response?.file_url===e||t.url===e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}});this.fileList=[...n,...t.filter(e=>!n.includes(e))]}}},methods:{onChange(e){!e.url&&e.raw&&(e.url=URL.createObjectURL(e.raw))},onExceed(){w.warning(this.$t(`pika.message.uploadStartImageExceed`))},onError(){w.error(this.$t(`pika.message.uploadStartImageError`))},onRemove(){this.onSetStartImageUrl()},onSetStartImageUrl(){this.suppressWatch=!0,this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,image_url:this.urls}),this.$nextTick(()=>{this.suppressWatch=!1})},onSuccess(){this.onSetStartImageUrl()},onRemovePreview(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),e.url?.startsWith(`blob:`)&&URL.revokeObjectURL(e.url),this.onSetStartImageUrl()}}}),Ve={class:`field`},He={class:`label`},Ue={class:`title font-bold`},We={key:0,class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ge(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ve,[e(`div`,He,[e(`h2`,Ue,i(t.$t(`pika.name.imageUrl`)),1),a(v,{content:t.$t(`pika.description.imageUrl`),class:`info`},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:3,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-change":t.onChange,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`pika.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-change`,`on-remove`,`on-success`,`headers`])]),t.fileList.length?(h(),s(`div`,We,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemovePreview(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Ke=W(Be,[[`render`,Ge],[`__scopeId`,`data-v-637337bb`]]),qe=_({name:`PromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.pika?.config?.prompt},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Je(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`pika.name.prompt`),info:e.$t(`pika.description.prompt`),placeholder:e.$t(`pika.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ye=_({name:`PresetPanel`,components:{MagicIcon:R,ImageUrlInput:Ke,ElButton:V,Consumption:ce,PromptInput:W(qe,[[`render`,Je]]),IngredientsSelector:Ce,IngredientsModelSelector:Pe,ModelSelector:ze,EffectSelector:ke},emits:[`generate`],computed:{config(){return this.$store.state.pika?.config},consumption(){return Y(this.config,this.service?.cost)},service(){return this.$store.state.pika?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Xe={class:`flex flex-col h-full`},Ze={class:`flex-1 overflow-y-auto p-5`},Qe={class:`flex flex-col items-center justify-center px-5 pb-5`};function $e(t,n,c,u,d,m){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`ingredients-selector`),y=l(`effect-selector`),b=l(`image-url-input`),x=l(`ingredients-model-selector`),S=l(`consumption`),C=l(`magic-icon`),w=l(`el-button`);return h(),s(`div`,Xe,[e(`div`,Ze,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),t.config?.ingredients?(h(),f(b,{key:0,class:`mb-4`})):o(``,!0),t.config?.ingredients?(h(),f(x,{key:1,class:`mb-4`})):o(``,!0)]),e(`div`,Qe,[a(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`pika.button.generate`)),1)]),_:1},8,[`onClick`])])])}var et=W(Ye,[[`render`,$e]]),tt=_({name:`VideoPlayer`,components:{VuePlyr:le},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:1080,options:[1080]}}}}}),nt=[`data-poster`],rt=[`src`];function it(t,n,r,i,o,c){let u=l(`vue-plyr`);return h(),s(`div`,null,[a(u,{options:t.options,class:`video`},{default:p(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,"data-poster":t.modelValue?.image_url},[e(`source`,{size:`1080`,src:t.modelValue?.video_url,type:`video/mp4`},null,8,rt)],8,nt)]),_:1},8,[`options`])])}var at=_({name:`TaskPreview`,components:{DeleteIcon:ee,ChannelIcon:j,InfoIcon:I,MagicIcon:R,TimeIcon:k,WarningIcon:te,CopyToClipboard:ie,ElAlert:S,VideoPlayer:W(tt,[[`render`,it],[`__scopeId`,`data-v-897d9fe0`]]),ElTooltip:x,ElButton:V,ApiCodeButton:ue,ReportButton:ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pika?.application},config(){return this.$store.state.pika?.config},videos(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e.length===0&&e.push({}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await re.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`pika/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},isFailure(e){let t=this.modelValue?.response;return t?.success===!1||!!t?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(e){return this.modelValue?.response?this.isFailure(e)||e?.video_url?!1:!e?.state||[`queued`,`pending`,`processing`,`running`].includes(e.state):!0},onDownload(e){console.log(`on download`),window.open(e,`_blank`)},onReload(e){let t=e.target,n=new URL(t.src),r=n.searchParams.get(`retry`);if(!r)n.searchParams.set(`retry`,`1`);else if(parseInt(r)<2)n.searchParams.set(`retry`,(parseInt(r)+1).toString());else return;t.src=n.toString()},onOpenVideo(e){window.open(e,`_blank`)}}}),ot={class:`left`},st={class:`main`},ct={class:`bot`},lt={class:`datetime`},ut=[`aria-label`],dt={class:`info`},ft={key:0,class:`prompt mt-2`},pt={key:0},mt={key:1},ht={key:0,class:n({content:!0,failed:!0})},gt={class:`image-wrapper`},_t={key:0,class:n({operations:!0,"mt-2":!0})},vt={key:0,class:`description`},yt={class:`description`},$={key:1,class:`description`},bt={key:1,class:n({content:!0})},xt={class:`description`},St={class:`description`},Ct={key:0,class:`description`},wt={class:`description`},Tt={key:2,class:n({content:!0})},Et={class:`description`};function Dt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`VideoPlayer`),C=l(`el-button`),w=l(`api-code-button`),T=l(`report-button`),E=l(`channel-icon`),D=l(`magic-icon`),O=l(`copy-to-clipboard`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`);return h(!0),s(c,null,m(n.videos,(c,l)=>(h(),s(`div`,{key:l,class:`preview`},[e(`div`,ot,[a(y,{capability:`pika`,part:`avatar`,class:`avatar`})]),e(`div`,st,[e(`div`,ct,[a(y,{capability:`pika`,part:`name`}),e(`span`,lt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ut)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,dt,[n.modelValue?.request?.prompt?(h(),s(`p`,ft,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,pt,` - (`+i(n.$t(`pika.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting(c)?(h(),s(`span`,mt,` - (`+i(n.$t(`pika.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&c?.video_url?(h(),s(`div`,ht,[e(`div`,gt,[a(S,{"model-value":c},null,8,[`model-value`])]),c?(h(),s(`div`,_t,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`pika.message.downloadVideo`),placement:`top-start`},{default:p(()=>[c?.video_url?(h(),f(C,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:e=>n.onDownload(c?.video_url)},{default:p(()=>[r(i(n.$t(`pika.button.download`)),1)]),_:1},8,[`onClick`])):o(``,!0)]),_:2},1032,[`content`]),a(w,{path:`/pika/videos`,body:n.modelValue?.request},null,8,[`body`]),a(T,{service:`pika`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,vt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),e(`p`,yt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure(c)?(h(),s(`div`,bt,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.failure`)),1)]),default:p(()=>[e(`p`,xt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,St,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(O,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Ct,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,wt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(O,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting(c)?(h(),s(`div`,Tt,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`pika.status.processing`:`pika.status.pending`)),1)]),default:p(()=>[e(`p`,Et,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0)])]))),128)}var Ot=_({name:`RecentPanel`,components:{TaskPreview:W(at,[[`render`,Dt],[`__scopeId`,`data-v-4c95d941`]]),BotPlaceholder:de,NoTasks:P,ScrollList:M},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pika?.tasks,items:this.$store.state.pika?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),kt={key:0},At={key:2,class:`w-full h-full flex items-center justify-center`};function jt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,kt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{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:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,(e,t)=>(h(),f(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,At,[a(v)])):o(``,!0)],64)}var Mt=_({name:`PikaIndex`,components:{ConfigPanel:et,Layout:_e,RecentPanel:W(Ot,[[`render`,jt]])},mixins:[J],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pika?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.pika?.status?.getTasks===C.Request||this.fetchingTasks},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===C.Request},needApply(){return this.$store.state.pika.status.getApplications===C.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.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 F({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(`pika/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pika/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},onApply(){K.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&w.error(this.$t(`application.message.alreadyApplied`))})},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(`pika/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!G(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let e={...this.config,async:!0};if(!Z())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}w.info(this.$t(`pika.message.startingTask`)),U(`pika`,q.generate(e,{token:t})).then(()=>{w.success(this.$t(`pika.message.startTaskSuccess`)),this.$store.commit(`pika/setConfig`,{config:void 0})}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?w.error(this.$t(`pika.message.usedUp`)):w.error(this.$t(`pika.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Nt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Pt=W(Mt,[[`render`,Nt],[`__scopeId`,`data-v-fee6c9ea`]]);export{Pt as default};
|