@acedatacloud/nexior 3.372.2 → 3.373.1
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-CKkXzWMv.js → ApiCodeButton-6CAkuLWs.js} +1 -1
- package/dist/assets/{ApiCodeDialog-DkwUjSVf.js → ApiCodeDialog-BBL3r0Ad.js} +2 -2
- package/dist/assets/{Artifacts-K51VaHXP.js → Artifacts-BBzKp95c.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-CL9vlZBG.js → AskUserQuestionCard-_HUmDFMG.js} +1 -1
- package/dist/assets/{AudioPreview-DnkEBADh.js → AudioPreview-c0cNd09Y.js} +1 -1
- package/dist/assets/{Auth-LSAEX251.js → Auth-D9Juhwc2.js} +1 -1
- package/dist/assets/{Bare-CBWTCHJh.js → Bare-BDD3PKuF.js} +1 -1
- package/dist/assets/{BotPlaceholder-BLnwiqsn.js → BotPlaceholder-Ctu1jmvN.js} +1 -1
- package/dist/assets/{BottomFooter-CDGAYamI.js → BottomFooter-DjyjSVNa.js} +1 -1
- package/dist/assets/{BrowseConnectors-BmtcDhTg.js → BrowseConnectors-D8RZgzhB.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-CaJJTNtS.js → BrowserPairingDialog-B0V2Yk4Q.js} +1 -1
- package/dist/assets/{Callback-C2HksfXH.js → Callback-DkyawxUo.js} +1 -1
- package/dist/assets/{CodeSnippet-Bghbyfg8.js → CodeSnippet-BZQBj7wp.js} +1 -1
- package/dist/assets/{Console-D6a0E2E7.js → Console-KuCIvdPp.js} +1 -1
- package/dist/assets/Conversation-1eQVGxUu.js +2 -0
- package/dist/assets/{Conversation-D9jZMyYU.js → Conversation-DhlQh49g.js} +1 -1
- package/dist/assets/Conversation-GudouywL.css +1 -0
- package/dist/assets/{CopyToClipboard-C0gYzJor.js → CopyToClipboard-42kl-Hqn.js} +1 -1
- package/dist/assets/{Detail-INf7yWic.js → Detail-hWf7-jBg.js} +1 -1
- package/dist/assets/{Extra-DCXraG2J.js → Extra-Y_yMguUA.js} +1 -1
- package/dist/assets/{FilePreview-Cqle_fL8.js → FilePreview-CbhJypON.js} +1 -1
- package/dist/assets/{Hailuo-BfeAbrtU.js → Hailuo-CzhTzWgO.js} +1 -1
- package/dist/assets/{History-xW71kV-g.js → History-CYEvAy2l.js} +1 -1
- package/dist/assets/{ImagePreview-CdsgVMhG.js → ImagePreview-B6S0ASYG.js} +1 -1
- package/dist/assets/{ImageWrapper-ZC_Sfj0f.js → ImageWrapper-B4zFub-J.js} +1 -1
- package/dist/assets/{Index-DiE_Bbvf.js → Index--SEOUDW7.js} +1 -1
- package/dist/assets/{Index-BfjcbD4E.js → Index-4v6BW26v.js} +1 -1
- package/dist/assets/{Index-CAYMD54w2.js → Index-AYgiT_XB2.js} +1 -1
- package/dist/assets/{Index-DWUflwU4.js → Index-B7Ij1yi3.js} +1 -1
- package/dist/assets/Index-BAgR7gw3.js +1 -0
- package/dist/assets/{Index-CQZFRSMZ.js → Index-BI88Wacf.js} +1 -1
- package/dist/assets/{Index-CyRgzsm9.js → Index-BVkewmRO.js} +1 -1
- package/dist/assets/Index-BeblsjhL.js +88 -0
- package/dist/assets/{Index-fJaYTgSD.css → Index-Bk4tRrlU.css} +1 -1
- package/dist/assets/{Index-Cz8HX98G.js → Index-Bmr0-RQ5.js} +1 -1
- package/dist/assets/{Index-DVMRj5WB.js → Index-C1trk8Th.js} +1 -1
- package/dist/assets/{Index-Cc7kYgaK.js → Index-C5qErJd6.js} +1 -1
- package/dist/assets/Index-CDocvss4.js +1 -0
- package/dist/assets/{Index-BiHxiIoz.js → Index-CfJjLZ8z.js} +1 -1
- package/dist/assets/{Index-IDBaigbx.js → Index-CgCORA14.js} +2 -2
- package/dist/assets/{Index-DQvVonef.js → Index-CmF2biql.js} +1 -1
- package/dist/assets/{Index-DesrimAr.js → Index-CqQ02v9L.js} +1 -1
- package/dist/assets/{Index-D0_u-6C_.js → Index-D-GFYH-g.js} +1 -1
- package/dist/assets/Index-D1mor9Ej.js +1 -0
- package/dist/assets/{Index-cx-ZVVUe.js → Index-D8-crPoz.js} +1 -1
- package/dist/assets/{Index-LN1ZBqqx.js → Index-DCywnW2_.js} +1 -1
- package/dist/assets/{Index-CugzCeA0.js → Index-DDe3nR8K.js} +1 -1
- package/dist/assets/{Index-DN5mqusD.js → Index-DMsd_sVU.js} +1 -1
- package/dist/assets/{Index-ydJtSl3H.js → Index-DVns9O0z.js} +1 -1
- package/dist/assets/{Index-nqv7lNVN.js → Index-DWV_YeN8.js} +1 -1
- package/dist/assets/{Index-C1DB360p.js → Index-DaADtvJI.js} +1 -1
- package/dist/assets/Index-Dbo4H6w5.js +1 -0
- package/dist/assets/Index-DiHLiOqk.js +1 -0
- package/dist/assets/{Index-DwV372nc.js → Index-DoZaeWIi.js} +1 -1
- package/dist/assets/Index-DvHze61J.js +1 -0
- package/dist/assets/Index-DvdA6Nu0.js +1 -0
- package/dist/assets/Index-Q8wIt4qf.js +1 -0
- package/dist/assets/Index-UtPL4ByD.js +1 -0
- package/dist/assets/Index-VKT6sBDC.js +1 -0
- package/dist/assets/{Index-B5ub5BUQ.js → Index-geRN98WC.js} +1 -1
- package/dist/assets/{Index-J_9j3Dqt.js → Index-o0v293WC.js} +2 -2
- package/dist/assets/{Index-BcUF-WIN.js → Index-w7hlMaP4.js} +1 -1
- package/dist/assets/{Invitees-VTAhab6J.js → Invitees-CI_dUxAr.js} +1 -1
- package/dist/assets/{List-DVoOkxLG.js → List-CrN9SiBT.js} +1 -1
- package/dist/assets/{List-B_s6dIRr.js → List-D1Y8JFie.js} +1 -1
- package/dist/assets/{List-C3lu2BS_.js → List-DQzikCYq.js} +1 -1
- package/dist/assets/{LocalTools-C0tAEVrZ.js → LocalTools-BXG86E3M.js} +1 -1
- package/dist/assets/LocalTools-D-gm27JN.js +5 -0
- package/dist/assets/{Logo-CiBsRxnE.js → Logo-BaD2szKx.js} +1 -1
- package/dist/assets/{Main-CcEfPK07.js → Main-Ht2ar0th.js} +1 -1
- package/dist/assets/{Message-D3c5RZct.js → Message-Bkc84sFE.js} +2 -2
- package/dist/assets/{Model-tyz3NALr.js → Model-BYKe0QPe.js} +1 -1
- package/dist/assets/{Navigator-CUr9GoJH.css → Navigator-CWAnHPzI.css} +1 -1
- package/dist/assets/Navigator-e7Bbrs9c.js +8 -0
- package/dist/assets/{NotFound-BOZLSLJO.js → NotFound-B3UuoSse.js} +1 -1
- package/dist/assets/{PageHeader-NzzVXT1S.js → PageHeader-DCdukDGp.js} +1 -1
- package/dist/assets/{Pay-BNgIzj3c.js → Pay-DiBk6FEg.js} +1 -1
- package/dist/assets/{Player-Dp4ru5KE.js → Player-evs53Tna.js} +1 -1
- package/dist/assets/{Poivelle-DqTacncN.js → Poivelle-CvtuHCAh.js} +1 -1
- package/dist/assets/{RealtimeCall-Y5TkXWTD.js → RealtimeCall-DAMOaV73.js} +1 -1
- package/dist/assets/{ReportButton-DVAC1onf.js → ReportButton-CpUpPvRI.js} +1 -1
- package/dist/assets/{ReportDialog-BcOKawKu.js → ReportDialog-CR7jTKVQ.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-CEv2vj4o.js → ScenarioPaymentMode-DBW7ha0H.js} +1 -1
- package/dist/assets/{ScheduledTasks-CtLxrxeR.css → ScheduledTasks-CQCV_-0Y.css} +1 -1
- package/dist/assets/ScheduledTasks-D2A6R_xR.js +2 -0
- package/dist/assets/{ServicePricingSummary-BcQNEFOO.js → ServicePricingSummary-CLl8JOoX.js} +1 -1
- package/dist/assets/{ShowcaseGrid-BVuTNSVR.js → ShowcaseGrid-CCJIHMUe.js} +1 -1
- package/dist/assets/{ShowcaseResultTabs-CiMvHQkO.js → ShowcaseResultTabs-Bk-qHuoo.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-DyatHa4L.js → SolanaWalletPickerDialog-Dvjxm_kZ.js} +1 -1
- package/dist/assets/Status-DwncBcIj.js +1 -0
- package/dist/assets/{Subscribe-DCAmrbo4.js → Subscribe-CRipH6Wg.js} +1 -1
- package/dist/assets/{TabSwitcher-CRlKcR6O.js → TabSwitcher-BNMmn14V.js} +1 -1
- package/dist/assets/{Tts-CrhWezQJ.js → Tts-DWgw7f7s.js} +1 -1
- package/dist/assets/{VideoPlayer-CMZjW-FQ.js → VideoPlayer-CK-MW_iJ.js} +1 -1
- package/dist/assets/{VideoPreview-DCVdozTJ.js → VideoPreview-7TXejh5Z.js} +1 -1
- package/dist/assets/WriteSkillDialog-DwFxHLQG.js +1 -0
- package/dist/assets/{airwallexCheckout-CY1beHWl.js → airwallexCheckout-BJV9_LJW.js} +1 -1
- package/dist/assets/arrow-down-C6PH3wUY.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-DLM0DYkX.js → arrow-down-wide-narrow--5ofOioK.js} +1 -1
- package/dist/assets/arrow-left-GGhlqnP6.js +1 -0
- package/dist/assets/arrow-right-BqdGi29k.js +1 -0
- package/dist/assets/arrow-up-Ciz6rN4y.js +1 -0
- package/dist/assets/{authorizeFlow-09cBaBYr.js → authorizeFlow-CaG4ng8r.js} +1 -1
- package/dist/assets/{avatar-CzcAdrIQ.js → avatar-D6CXRpI7.js} +1 -1
- package/dist/assets/{basic-COC7JHoS.js → basic-DNtfaQBU.js} +1 -1
- package/dist/assets/{book-open-ClW0ZzY6.js → book-open-DYIByPT-.js} +1 -1
- package/dist/assets/{box-DI_cIDSF.js → box-CYxKRYYM.js} +1 -1
- package/dist/assets/{boxes-BOz44Gmq.js → boxes-Dw2bJkLJ.js} +1 -1
- package/dist/assets/{brain-D0CtgPZ0.js → brain-BmEQTM8k.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-BGQhyUOT.js → chart-no-axes-combined-DuKodK5O.js} +1 -1
- package/dist/assets/chat-4B5e6M7H.js +1 -0
- package/dist/assets/chat-8q4HYSBH.js +1 -0
- package/dist/assets/chat-B_H4N5wh.js +1 -0
- package/dist/assets/chat-Bi4-iPLs.js +1 -0
- package/dist/assets/chat-Bk_GtTmW.js +1 -0
- package/dist/assets/chat-C2uqNw3P.js +1 -0
- package/dist/assets/chat-CJbcUBPg.js +1 -0
- package/dist/assets/chat-CX5gfKYF.js +2 -0
- package/dist/assets/chat-CsiZHLys.js +1 -0
- package/dist/assets/chat-D6FZdAFD.js +1 -0
- package/dist/assets/chat-D_cVYex_.js +1 -0
- package/dist/assets/chat-lBYpL1ru.js +1 -0
- package/dist/assets/chat-woD5EAiM.js +1 -0
- package/dist/assets/check-C-ennB_F.js +1 -0
- package/dist/assets/chevron-down-Bzg883mb.js +1 -0
- package/dist/assets/chevron-right-BTjgiXlI.js +1 -0
- package/dist/assets/{circle-alert-wQ2lvMKB.js → circle-alert-BlIS0Jfm.js} +1 -1
- package/dist/assets/circle-check-BS90WmVD.js +1 -0
- package/dist/assets/{circle-question-mark-o2xymndm.js → circle-question-mark-DRoOVKGO.js} +1 -1
- package/dist/assets/{clipboard-list-C1ZnP_1S.js → clipboard-list-BUJpitkP.js} +1 -1
- package/dist/assets/clock-DYMdqYCO.js +1 -0
- package/dist/assets/code-CXOEul0z.js +1 -0
- package/dist/assets/codingBridge-9ih3Chzb.js +2 -0
- package/dist/assets/{codingBridgeNotify-BBz0unCl.js → codingBridgeNotify-CFoOLcGh.js} +1 -1
- package/dist/assets/{coins-DNtsOeHt.js → coins-CggzhAj_.js} +1 -1
- package/dist/assets/{collapse-DXyUvlAf.js → collapse-0WRpvPa2.js} +1 -1
- package/dist/assets/constants-CiMGQy1r.js +1 -0
- package/dist/assets/{copy-BPvUTBZO.js → copy-CJUYDe36.js} +1 -1
- package/dist/assets/{createTaskActions-BFf6M0ny.js → createTaskActions-eR4Cscmj.js} +1 -1
- package/dist/assets/{date-picker-DUDMqOhC.js → date-picker-ChZFqgah.js} +1 -1
- package/dist/assets/{digitalhuman-CBG20iqV.js → digitalhuman-C9yVqvXe.js} +1 -1
- package/dist/assets/{dollar-sign-DZW245nV.js → dollar-sign-CNe-36Uv.js} +1 -1
- package/dist/assets/{download-i8oixJJ9.js → download-C8zVAyrZ.js} +1 -1
- package/dist/assets/{drawer-DFMxMQL-.js → drawer-J5GNVza3.js} +1 -1
- package/dist/assets/{dropdown-DzgmsJaE.js → dropdown-BR6uNtt2.js} +1 -1
- package/dist/assets/{dropdown-De5uSBT6.js → dropdown-i0RGfo2y.js} +1 -1
- package/dist/assets/{ellipsis-CdBC6W6y.js → ellipsis-CCh39LuA.js} +1 -1
- package/dist/assets/{esm-C9NBdYTi.js → esm-CN3-kzHz.js} +2 -2
- package/dist/assets/{external-link-BPdjHk_2.js → external-link-Cet6qhwN.js} +1 -1
- package/dist/assets/{eye-Du9vxQok.js → eye-HhQFGHu_.js} +1 -1
- package/dist/assets/{file-BiVmdIPR.js → file-97ImhQ6f.js} +1 -1
- package/dist/assets/{file-output-BS1mUoBE.js → file-output-vcUac5W4.js} +1 -1
- package/dist/assets/{file-text-CJib7nH0.js → file-text-xm0RmaAN.js} +1 -1
- package/dist/assets/{fish-DbqlL3DM.js → fish-D-X68Vq-.js} +1 -1
- package/dist/assets/{flux-DlgHsAoy.js → flux-CUB8ceYr.js} +1 -1
- package/dist/assets/{folder-C_ctRjSW.js → folder-CnTdyUhO.js} +1 -1
- package/dist/assets/gauge-BtDpPiyq.js +1 -0
- package/dist/assets/{generationInput-BykFQpQX.js → generationInput-Dg5BMVbU.js} +1 -1
- package/dist/assets/{globe-5cnxVUKw.js → globe-DE8EVD0V.js} +1 -1
- package/dist/assets/{seedance-Q-fk26d3.js → grokvideo-BBqbXeJR.js} +1 -1
- package/dist/assets/{hailuo-DTkn5PMg.js → hailuo-Cvp4WVkN.js} +1 -1
- package/dist/assets/{headphones-DoZZr-a5.js → headphones-C8lY6KTx.js} +1 -1
- package/dist/assets/{history-BtBj6gnU.js → history-D_WrDIVp.js} +1 -1
- package/dist/assets/{house-CrLYSDar.js → house-DzrROhH4.js} +1 -1
- package/dist/assets/{i18n-Bisg_INr.js → i18n-DBtpbeq0.js} +1 -1
- package/dist/assets/{image-DRUv5M5F.js → image-GcUfRlBM.js} +1 -1
- package/dist/assets/{imageRequests-BKHyzeHm.js → imageRequests-JgZOB_cZ.js} +1 -1
- package/dist/assets/{index-BpXJ9KrR.js → index-BhuKiXPa.js} +17 -17
- package/dist/assets/{index.es-D7LjPvzV.js → index.es-C7X0xHSX.js} +1 -1
- package/dist/assets/{info-CoDypBxc.js → info-xfm1EWy9.js} +1 -1
- package/dist/assets/{input-number-D0GDLMw6.js → input-number-BL-h5gxp.js} +1 -1
- package/dist/assets/{key-round-D4YDiEr_.js → key-round-Dk51vXgG.js} +1 -1
- package/dist/assets/{kling-CZE3MRRR.js → kling-C1l5dGOt.js} +1 -1
- package/dist/assets/{languages-qeLOzJr6.js → languages-BQAnKBsP.js} +1 -1
- package/dist/assets/{laptop-Dg_3AyVE.js → laptop-DYu7gsen.js} +1 -1
- package/dist/assets/{lightbulb-CFadsUUI.js → lightbulb-Dt12jwwA.js} +1 -1
- package/dist/assets/{link-CffzIXbU.js → link-CCG2W3lu.js} +1 -1
- package/dist/assets/loader-circle-BtiAasZD.js +1 -0
- package/dist/assets/{lock-CYUZnIvU.js → lock-D3d-n5wP.js} +1 -1
- package/dist/assets/luma-BsAvwyQA.js +1 -0
- package/dist/assets/maestro-CLwwA-d4.js +1 -0
- package/dist/assets/{maestroLanguages-BfUmWM7x.js → maestroLanguages-BDi0WKKu.js} +1 -1
- package/dist/assets/{mail-CniWVRx0.js → mail-Cu4RCOpK.js} +1 -1
- package/dist/assets/{message-circle-5xlLLwaW.js → message-circle-C9IQ0H_u.js} +1 -1
- package/dist/assets/{mic-tnRmX5ih.js → mic-CJBFDzvP.js} +1 -1
- package/dist/assets/{midjourney-As4aVNPu.js → midjourney-DYSxslML.js} +1 -1
- package/dist/assets/{pika-DPtVuwYP.js → minimax-O3mV0UwS.js} +1 -1
- package/dist/assets/{mobileLocalExec-B1emlXkg.js → mobileLocalExec-C1dCnnBV.js} +1 -1
- package/dist/assets/modelPresentation-C1qgMEpp.js +1 -0
- package/dist/assets/{models-DuW32zS6.js → models-DGI43qxx.js} +1 -1
- package/dist/assets/{monitor-U0ZPNoib.js → monitor-BCUneMbK.js} +1 -1
- package/dist/assets/{mouse-pointer-2-BVgTrCLp.js → mouse-pointer-2-BJnRqHoy.js} +1 -1
- package/dist/assets/music-2-RMxzVfwi.js +1 -0
- package/dist/assets/nanobanana-C1m-ntQ5.js +1 -0
- package/dist/assets/{omni-BmRtTbtS.js → omni-Bs1EFVhV.js} +1 -1
- package/dist/assets/openaiimage-PCQwKcFi.js +1 -0
- package/dist/assets/{pagination-CDpQzDsK.js → pagination-BLwt5f1y.js} +1 -1
- package/dist/assets/{pagination-COXSXbfS.js → pagination-DDQQplQX.js} +1 -1
- package/dist/assets/{pagination-BUNkflE4.js → pagination-DgncPTOk.js} +1 -1
- package/dist/assets/{palette-Ct6GMr9k.js → palette-CssI--5q.js} +1 -1
- package/dist/assets/{paperclip-BPjav70S.js → paperclip-DDXlPDyM.js} +1 -1
- package/dist/assets/{pause-UrvUFyTX.js → pause-BHUOotRm.js} +1 -1
- package/dist/assets/{pencil-BUAgWct6.js → pencil-BKyiUVnW.js} +1 -1
- package/dist/assets/{wan-DbsiDuzx.js → pika-om1cCtKw.js} +1 -1
- package/dist/assets/pixverse-BaAC8YPm.js +1 -0
- package/dist/assets/play-Dptgh_Ds.js +1 -0
- package/dist/assets/{plug-BQZMa9FI.js → plug-CBXDX2jR.js} +1 -1
- package/dist/assets/plus-CoKyfiTV.js +1 -0
- package/dist/assets/{poivelle-CORGLanp.js → poivelle-DA47r64N.js} +1 -1
- package/dist/assets/{popover-BB1nN76A.js → popover-B5MTy1rs.js} +1 -1
- package/dist/assets/{producer-DHCVgL5i.js → producer-ROyK86hn.js} +1 -1
- package/dist/assets/{qrart-B5PPsPyD.js → qrart-CHoDXnUG.js} +1 -1
- package/dist/assets/{qwenimage-_ETIW_E9.js → qwenimage-BaAjEv2f.js} +1 -1
- package/dist/assets/realtime-DZdbVOL9.js +1 -0
- package/dist/assets/{refresh-cw-CsCfrENY.js → refresh-cw-sqVwVwPK.js} +1 -1
- package/dist/assets/rotate-ccw-DDp04MFQ.js +1 -0
- package/dist/assets/rotate-cw-Dmw3pXHH.js +1 -0
- package/dist/assets/{row-l_uxgOVO.js → row-BUXbo_F4.js} +1 -1
- package/dist/assets/search-CopKlsH8.js +1 -0
- package/dist/assets/{grokvideo-DfjUtVQ-.js → seedance-D8kLKRTq.js} +1 -1
- package/dist/assets/{seedream-CCL-Ts4j.js → seedream-Cf2axOg0.js} +1 -1
- package/dist/assets/{select-DXBL73yh.js → select-CcTiPJUg.js} +1 -1
- package/dist/assets/{serp-Cx_C_YEH.js → serp-DFjXmbAr.js} +1 -1
- package/dist/assets/{shield-hgCw3f3P.js → shield-DOWHsriA.js} +1 -1
- package/dist/assets/{showcase-BwbIZhXd.js → showcase-IbVW17fO.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-Ci2NJ019.js → showcaseRecreateMixin-CH_5cLk1.js} +1 -1
- package/dist/assets/{shuffle-Bz1Db6tk.js → shuffle-BzzBe2lZ.js} +1 -1
- package/dist/assets/site-1pjTNxh5.js +1 -0
- package/dist/assets/{site-C2eN7w36.js → site-B0ySowjc.js} +1 -1
- package/dist/assets/{site-i_UOOXNy.js → site-B596s5Hy.js} +1 -1
- package/dist/assets/{site-CHTpzr8r.js → site-BOu2zV-d.js} +1 -1
- package/dist/assets/{site-D026YSSq.js → site-BtiNTH-u.js} +1 -1
- package/dist/assets/{site-unRXja4n.js → site-Bvh-2S-J.js} +1 -1
- package/dist/assets/site-Byfe5O5U.js +1 -0
- package/dist/assets/{site-BGyboRAB.js → site-C6oN2RaM.js} +1 -1
- package/dist/assets/{site-JC4Eghtp.js → site-C8eb5zY0.js} +1 -1
- package/dist/assets/{site-BjfdXmEW.js → site-CEPHwLgd.js} +1 -1
- package/dist/assets/{site-UFoeZk-H.js → site-CNEqbjRh.js} +1 -1
- package/dist/assets/{site-DE89m_v6.js → site-DDA2o_Id.js} +1 -1
- package/dist/assets/{siteHome-CDlAOGG8.js → siteHome-DVwKWe9w.js} +1 -1
- package/dist/assets/{slider-DhOKSiMc.js → slider-C13isRLl.js} +1 -1
- package/dist/assets/{solana-wallets-CnfdPsxS.js → solana-wallets-d_lHXJq2.js} +2 -2
- package/dist/assets/{sora-Dc37V-H4.js → sora-nqaJfWU_.js} +1 -1
- package/dist/assets/{sparkles-BPK9X2Lc.js → sparkles-CyOdWimh.js} +1 -1
- package/dist/assets/square-CEkRrDA9.js +1 -0
- package/dist/assets/{store-wnsyifGa.js → store-C3emekR6.js} +1 -1
- package/dist/assets/{suno-BsSwol8T.js → suno-D7WSaIq8.js} +1 -1
- package/dist/assets/{switch-TWe-AUkq.js → switch-ChU8jScg.js} +1 -1
- package/dist/assets/{table-BQ_XsQTw.js → table-LOal1inT.js} +1 -1
- package/dist/assets/{tabs-Du9Y7Xfu.js → tabs-C48-bEy8.js} +1 -1
- package/dist/assets/{tag-98INYFUc.js → tag-922BT0TI.js} +1 -1
- package/dist/assets/{taskPolling-CbowB6Zh.js → taskPolling-DHtgr2wI.js} +1 -1
- package/dist/assets/terminal-B1tT4mRf.js +1 -0
- package/dist/assets/{time-picker-BqKQ9e16.js → time-picker-ByEe4UNH.js} +1 -1
- package/dist/assets/{tooltip-DSST2mHF.js → tooltip-DqGMJJ6f.js} +1 -1
- package/dist/assets/{trash-2-ChReDJhv.js → trash-2-BhwPJFMz.js} +1 -1
- package/dist/assets/{triangle-alert-vAfwQulN.js → triangle-alert-DBKQGKg_.js} +1 -1
- package/dist/assets/{upload-DRH0-ycw.js → upload-C_YrWWV5.js} +1 -1
- package/dist/assets/{upload-C4WyrHeN.js → upload-DYQ-PwmP.js} +1 -1
- package/dist/assets/user-CdP-qT7t.js +1 -0
- package/dist/assets/{veo-CoJdP1FV.js → veo-DjM0yWo5.js} +1 -1
- package/dist/assets/{video-CWFvkhm5.js → video-BFTllrg6.js} +1 -1
- package/dist/assets/{volume-2-Dz_XRlUD.js → volume-2-DDZ8f74r.js} +1 -1
- package/dist/assets/{wallet-CHY8uwP2.js → wallet-D9ChTMGr.js} +1 -1
- package/dist/assets/{minimax-BeK9QGwF.js → wan-Cf4ZrOug.js} +1 -1
- package/dist/assets/{wand-sparkles-Cd-Dhae1.js → wand-sparkles-1fXELugW.js} +1 -1
- package/dist/assets/{web-pumP6ywU.js → web-B3zJ5vL_.js} +1 -1
- package/dist/assets/{webextrator-DldNP-_a.js → webextrator-BheSx6BK.js} +1 -1
- package/dist/assets/{zap-BTK08SUr.js → zap-CZz_Emt-.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +2 -4
- package/dist/assets/Conversation-BJr7Lj95.js +0 -2
- package/dist/assets/Conversation-DOaBBv4A.css +0 -1
- package/dist/assets/Index-1hcbys_g.js +0 -1
- package/dist/assets/Index-BdyxY30o.js +0 -1
- package/dist/assets/Index-CXvRE64B.js +0 -1
- package/dist/assets/Index-Cym9ggxK.js +0 -1
- package/dist/assets/Index-CzaQ-jKG.js +0 -47
- package/dist/assets/Index-DB53-7WT.js +0 -1
- package/dist/assets/Index-DFDZA13i.js +0 -1
- package/dist/assets/Index-DhK7ZdT_.js +0 -1
- package/dist/assets/Index-Dm_a1yI8.js +0 -1
- package/dist/assets/Index-DnYp5SMv.js +0 -1
- package/dist/assets/Index-Dwoqdnsv.js +0 -1
- package/dist/assets/LocalTools-DyMI_Z-o.js +0 -5
- package/dist/assets/Navigator-eYdM2fYf.js +0 -8
- package/dist/assets/ScheduledTasks-uTtZN8tS.js +0 -2
- package/dist/assets/Status-C70DHopU.js +0 -1
- package/dist/assets/WriteSkillDialog-BPp7whre.js +0 -1
- package/dist/assets/arrow-down-M01ojSb8.js +0 -1
- package/dist/assets/arrow-left-ZgHD-g89.js +0 -1
- package/dist/assets/arrow-right-D-t8YGRt.js +0 -1
- package/dist/assets/arrow-up-BtIm_gvo.js +0 -1
- package/dist/assets/chat-95naxcrO.js +0 -1
- package/dist/assets/chat-97K3ZkwH.js +0 -1
- package/dist/assets/chat-BMtYBq3u.js +0 -1
- package/dist/assets/chat-BnFwgt-s.js +0 -1
- package/dist/assets/chat-BphHEc4p.js +0 -1
- package/dist/assets/chat-BrBDMOgk.js +0 -1
- package/dist/assets/chat-C6nh0WEl.js +0 -1
- package/dist/assets/chat-CUQrTWAz.js +0 -1
- package/dist/assets/chat-Cm0eXyvl.js +0 -1
- package/dist/assets/chat-DIfvDYWx.js +0 -1
- package/dist/assets/chat-DImd0FHK.js +0 -1
- package/dist/assets/chat-Dv73XcXc.js +0 -1
- package/dist/assets/chat-DwHiPx5I.js +0 -1
- package/dist/assets/check-B-F0rCUz.js +0 -1
- package/dist/assets/chevron-down-BXcMDdCO.js +0 -1
- package/dist/assets/chevron-right-DxqakZ6z.js +0 -1
- package/dist/assets/circle-check-BV8XgqeG.js +0 -1
- package/dist/assets/clock-BWysuwF-.js +0 -1
- package/dist/assets/code-49GiMuHE.js +0 -1
- package/dist/assets/codingBridge-DIXMClJF.js +0 -2
- package/dist/assets/constants-DewCdI9V.js +0 -1
- package/dist/assets/gauge-G-844qAz.js +0 -1
- package/dist/assets/loader-circle-C8tBS65p.js +0 -1
- package/dist/assets/luma-BTD8zQqJ.js +0 -1
- package/dist/assets/maestro-CR0vLSVy.js +0 -1
- package/dist/assets/music-2-BS-hjzJ8.js +0 -1
- package/dist/assets/nanobanana-BZNdqS9k.js +0 -1
- package/dist/assets/openaiimage-Dz2AWjHM.js +0 -1
- package/dist/assets/pixverse-C3YWHjAH.js +0 -1
- package/dist/assets/play-BZXDaMop.js +0 -1
- package/dist/assets/plus-Bl9lrIqL.js +0 -1
- package/dist/assets/realtime-BysG9ELa.js +0 -1
- package/dist/assets/rotate-ccw-DcEQYEbu.js +0 -1
- package/dist/assets/rotate-cw-DpL7Air9.js +0 -1
- package/dist/assets/search-CkaAH9vc.js +0 -1
- package/dist/assets/site-CumIO4yh.js +0 -1
- package/dist/assets/site-VtPs9Wsn.js +0 -1
- package/dist/assets/square-DWiv04Ly.js +0 -1
- package/dist/assets/terminal-D7cslsOJ.js +0 -1
- package/dist/assets/user-BojLEnL0.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-DXBL73yh.js";import{n as x,t as S}from"./tabs-Du9Y7Xfu.js";import{t as C}from"./upload-DRH0-ycw.js";import{t as w}from"./tooltip-DSST2mHF.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-DuW32zS6.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-DFMxMQL-.js";import{t as j}from"./input-number-D0GDLMw6.js";import{t as M}from"./slider-DhOKSiMc.js";import{t as N}from"./switch-TWe-AUkq.js";import{t as P}from"./clock-BWysuwF-.js";import{a as F,i as ee,n as te,r as ne,s as re,t as ie}from"./pagination-BUNkflE4.js";import{t as ae}from"./headphones-DoZZr-a5.js";import{t as oe}from"./info-CoDypBxc.js";import{t as se}from"./lightbulb-CFadsUUI.js";import{t as ce}from"./trash-2-ChReDJhv.js";import{t as le}from"./triangle-alert-vAfwQulN.js";import{t as I}from"./upload-C4WyrHeN.js";import{t as L}from"./wand-sparkles-Cd-Dhae1.js";import{Mi as ue,Ni as R,Oi as de,ji as fe}from"./constants-DewCdI9V.js";import{$i as z,A as B,Bi as V,Br as pe,Cn as me,Hi as he,O as ge,Ri as H,Ua as U,Va as _e,Vr as W,at as G,ct as K,do as q,et as ve,fi as ye,it as be,li as xe,nt as Se,ot as Ce,ro as J,rt as we,sa as Te,st as Y,to as Ee,tt as De,za as X,zr as Oe}from"./index-BpXJ9KrR.js";import{t as ke}from"./CopyToClipboard-C0gYzJor.js";import{t as Ae}from"./ReportButton-DVAC1onf.js";import{t as je}from"./FilePreview-Cqle_fL8.js";import{t as Z}from"./ImagePreview-CdsgVMhG.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-BcQNEFOO.js";import{t as Pe}from"./AudioPreview-DnkEBADh.js";import{t as Fe}from"./VideoPlayer-CMZjW-FQ.js";import{t as Ie}from"./VideoPreview-DCVdozTJ.js";import{t as Le}from"./ScenarioPaymentMode-CEv2vj4o.js";import{t as Re}from"./ApiCodeButton-CKkXzWMv.js";import{t as ze}from"./BotPlaceholder-BLnwiqsn.js";import{t as Be}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ve}from"./ShowcaseResultTabs-CiMvHQkO.js";import{t as He}from"./showcaseRecreateMixin-Ci2NJ019.js";import{n as Ue,t as We}from"./generationInput-BykFQpQX.js";var Ge=v({name:`LayoutKling`,components:{MagicIcon:L,ElDrawer:A,ElButton:J},mixins:[Me]}),Ke={class:`main flex flex-row flex-1 min-h-0`},qe={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)]`},Je={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ke,[e(`div`,qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Je,[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 Xe=B(Ge,[[`render`,Ye],[`__scopeId`,`data-v-f4b791b5`]]),Ze={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(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 Ze}}var $=`<<<video_1>>>`,Qe=/<<<image_\d+>>>/g;function $e(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function et(e){return e?e.replace(Qe,` `).replace(/\s{2,}/g,` `).trim():``}function tt(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=Q(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 nt(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=$e(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=et(n.prompt));return n}var rt=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=tt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=nt({...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})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,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 st=B(rt,[[`render`,ot],[`__scopeId`,`data-v-a74e7f31`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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 R.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=tt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=nt({...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})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,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`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=B(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=[3,5,8,10,12,15],gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return R.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},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=tt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=nt({...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})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,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 wt=B(vt,[[`render`,Ct],[`__scopeId`,`data-v-496bf31c`]]),Tt=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`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(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`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=B(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:I,ElUpload:C,ElButton:J,ElTooltip:w,InfoIcon:F,ImagePreview:Z},mixins:[K,Y,G],emits:[`change`],data(){return{fileList:[],uploadUrl:X()+`/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()}}}),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`};function Lt(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`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"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 Rt=B(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:I,ElUpload:C,ElButton:J,ElTooltip:w,ImagePreview:Z,InfoIcon:F},mixins:[K,Y,G],data(){return{fileList:[],uploadUrl:X()+`/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 Q(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()}}}),Bt={class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`};function Wt(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`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,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 Gt=B(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:J,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:F,FilePreview:je,UploadIcon:I},mixins:[Y,G],data(){return{fileList:[],uploadUrl:X()+`/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=we(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Se(De)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=$e(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()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(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`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,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`,Zt,[e(`div`,Qt,[e(`span`,$t,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`,en,[e(`span`,tn,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 rn=B(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:J,ElUpload:C,UploadIcon:I,ImagePreview:Z,InfoIcon:F},mixins:[K,Y,G],data(){return{fileList:[],uploadUrl:X()+`/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=[et(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()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(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`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,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`,un,[(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 fn=B(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:F,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}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(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`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=B(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:F},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(R.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})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,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 Dn=B(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:F},data(){return{configKeys:On}},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 Q(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)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(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`,An,[e(`div`,jn,[e(`span`,Mn,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`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,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 Ln=B(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{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`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${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 Hn=v({name:`InspirationPills`,components:{CloseIcon:_e},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.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=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,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,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:se,ElButton:J,PromptTextarea:ee,InspirationPills:B(Hn,[[`render`,Kn],[`__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 Jn(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 Yn=B(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:q,InfoIcon:F},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||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,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 tr=B(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:_e,IdeaIcon:se,ElDrawer:A,ElButton:J},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},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(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(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`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,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`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,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`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(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,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=B(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"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`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:ae},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),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,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:J,ServicePricingSummary:Ne,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:B(vr,[[`render`,Tr],[`__scopeId`,`data-v-c800852a`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return We(`kling`,pe(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Q(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 me(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return H()&&V(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=V(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=V(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await W.quote(pe(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(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(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),P=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[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`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(P,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=B(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:I,ElUpload:C,ElButton:J,InfoIcon:F,ImagePreview:Z},mixins:[K,Y,G,ve],data(){return{fileList:[],uploadUrl:X()+`/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()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(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`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,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 Rr=B(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:I,ElUpload:C,ElButton:J,InfoIcon:F,FilePreview:je},mixins:[Y,G],data(){return{fileList:[],uploadUrl:X()+`/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()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(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`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,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 Gr=B(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:q,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=B(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:F},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},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=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(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`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=B($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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||ai},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=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,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 di=B(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,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 vi=B(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:F},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`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,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 Ti=v({name:`MotionPanel`,components:{MagicIcon:L,ElButton:J,ServicePricingSummary:Ne,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:B(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return me({...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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(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(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[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`,Oi,[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 Ai=B(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:Ee},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)}}}),Mi=[`title`],Ni={class:`text`};function Pi(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`,Ni,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,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=B(ji,[[`render`,Pi],[`__scopeId`,`data-v-e6a2bb26`]]),Ii={"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`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:ue.map(e=>({value:e,label:Ii[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=fe)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,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 Vi=B(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=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`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,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 Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:L,UploadIcon:I,ElUpload:C,ElButton:J,ElInput:q,ServicePricingSummary:Ne,InfoIcon:F,ImagePreview:Z,ModelSelector:Vi,ModeSelector:B(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[G,ve],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:X()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},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 me({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return H()&&V(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=V(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await W.quoteTalkingPhoto(Oe(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},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`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(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(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,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`,Qi,[e(`div`,$i,[e(`span`,ea,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,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,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`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,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(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=B(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:ce,ChannelIcon:re,InfoIcon:oe,MagicIcon:L,TimeIcon:P,WarningIcon:le,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:J,ImagePreview:Z,VideoPreview:Ie,AudioPreview:Pe,ApiCodeButton:Re,ReportButton:Ae},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 U.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`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(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`),P=l(`warning-icon`),F=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,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,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(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`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[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`,Ca,[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`,wa,[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`,Ta,[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`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[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`,Oa,[a(F,{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`,ka,[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`,Aa,[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`,ja,[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`,Ma,[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`,Na,[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 Fa=v({name:`RecentPanel`,components:{TaskPreview:B(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:ne,BotPlaceholder:ze,ScrollList:te},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?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Xe,RecentPanel:B(Fa,[[`render`,Ra]]),ShowcaseResultTabs:Ve},mixins:[Ce,He(`kling`),Be(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},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},walletMode(){return this.taskType!==`motion`&&H()&&V(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){he(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ie({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=pe(this.config),t=Ue(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!be(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>W.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),z(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!Te())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof xe||ge(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return ye(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},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(!be(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(!Te())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),z(`kling`,W.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{ge(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!be(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=Oe(e),n=this.createPaymentOperation(e=>W.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),z(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(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(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[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(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=B(za,[[`render`,Ha]]);export{Ua 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-CcTiPJUg.js";import{n as x,t as S}from"./tabs-C48-bEy8.js";import{t as C}from"./upload-C_YrWWV5.js";import{t as w}from"./tooltip-DqGMJJ6f.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-DGI43qxx.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-J5GNVza3.js";import{t as j}from"./input-number-BL-h5gxp.js";import{t as M}from"./slider-C13isRLl.js";import{t as N}from"./switch-ChU8jScg.js";import{t as P}from"./clock-DYMdqYCO.js";import{a as F,i as ee,n as te,r as ne,s as re,t as ie}from"./pagination-DgncPTOk.js";import{t as ae}from"./headphones-C8lY6KTx.js";import{t as oe}from"./info-xfm1EWy9.js";import{t as se}from"./lightbulb-Dt12jwwA.js";import{t as ce}from"./trash-2-BhwPJFMz.js";import{t as le}from"./triangle-alert-DBKQGKg_.js";import{t as I}from"./upload-DYQ-PwmP.js";import{t as L}from"./wand-sparkles-1fXELugW.js";import{Mi as ue,Ni as de,Pi as R,ki as fe}from"./constants-CiMGQy1r.js";import{A as z,Ba as B,Br as pe,Cn as V,Ha as me,Hr as H,O as he,Ui as ge,Vi as U,Vr as W,Wa as G,at as K,ca as _e,ct as q,ea as J,et as ve,fo as ye,io as Y,it as be,no as xe,nt as Se,ot as Ce,pi as we,rt as Te,st as X,tt as Ee,ui as De,zi as Oe}from"./index-BhuKiXPa.js";import{t as ke}from"./CopyToClipboard-42kl-Hqn.js";import{t as Ae}from"./ReportButton-CpUpPvRI.js";import{t as je}from"./FilePreview-CbhJypON.js";import{t as Z}from"./ImagePreview-B6S0ASYG.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-CLl8JOoX.js";import{t as Pe}from"./AudioPreview-c0cNd09Y.js";import{t as Fe}from"./VideoPlayer-CK-MW_iJ.js";import{t as Ie}from"./VideoPreview-7TXejh5Z.js";import{t as Le}from"./ScenarioPaymentMode-DBW7ha0H.js";import{t as Re}from"./ApiCodeButton-6CAkuLWs.js";import{t as ze}from"./BotPlaceholder-Ctu1jmvN.js";import{t as Be}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ve}from"./ShowcaseResultTabs-Bk-qHuoo.js";import{t as He}from"./showcaseRecreateMixin-CH_5cLk1.js";import{n as Ue,t as We}from"./generationInput-Dg5BMVbU.js";var Ge=v({name:`LayoutKling`,components:{MagicIcon:L,ElDrawer:A,ElButton:Y},mixins:[Me]}),Ke={class:`main flex flex-row flex-1 min-h-0`},qe={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)]`},Je={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ke,[e(`div`,qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Je,[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 Xe=z(Ge,[[`render`,Ye],[`__scopeId`,`data-v-f4b791b5`]]),Ze={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(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 Ze}}var $=`<<<video_1>>>`,Qe=/<<<image_\d+>>>/g;function $e(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function et(e){return e?e.replace(Qe,` `).replace(/\s{2,}/g,` `).trim():``}function tt(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=Q(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 nt(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=$e(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=et(n.prompt));return n}var rt=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(fe)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await G.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=nt({...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})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,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 st=z(rt,[[`render`,ot],[`__scopeId`,`data-v-a74e7f31`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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 R.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=tt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await G.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=nt({...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})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,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`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=z(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=[3,5,8,10,12,15],gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return R.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},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=tt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await G.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=nt({...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})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,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 wt=z(vt,[[`render`,Ct],[`__scopeId`,`data-v-496bf31c`]]),Tt=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`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(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`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=z(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:I,ElUpload:C,ElButton:Y,ElTooltip:w,InfoIcon:F,ImagePreview:Z},mixins:[q,X,K],emits:[`change`],data(){return{fileList:[],uploadUrl:B()+`/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()}}}),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`};function Lt(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`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"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 Rt=z(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:I,ElUpload:C,ElButton:Y,ElTooltip:w,ImagePreview:Z,InfoIcon:F},mixins:[q,X,K],data(){return{fileList:[],uploadUrl:B()+`/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 Q(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()}}}),Bt={class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`};function Wt(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`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,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 Gt=z(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:Y,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:F,FilePreview:je,UploadIcon:I},mixins:[X,K],data(){return{fileList:[],uploadUrl:B()+`/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=Te(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Se(Ee)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=$e(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()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(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`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,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`,Zt,[e(`div`,Qt,[e(`span`,$t,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`,en,[e(`span`,tn,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 rn=z(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:Y,ElUpload:C,UploadIcon:I,ImagePreview:Z,InfoIcon:F},mixins:[q,X,K],data(){return{fileList:[],uploadUrl:B()+`/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=[et(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()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(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`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,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`,un,[(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 fn=z(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:F,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}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(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`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=z(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:F},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(R.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})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,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 Dn=z(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:F},data(){return{configKeys:On}},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 Q(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)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(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`,An,[e(`div`,jn,[e(`span`,Mn,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`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,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 Ln=z(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{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`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${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 Hn=v({name:`InspirationPills`,components:{CloseIcon:me},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.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=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,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,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:se,ElButton:Y,PromptTextarea:ee,InspirationPills:z(Hn,[[`render`,Kn],[`__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 Jn(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 Yn=z(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:ye,InfoIcon:F},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||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,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 tr=z(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:me,IdeaIcon:se,ElDrawer:A,ElButton:Y},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},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(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(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`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,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`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,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`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(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,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=z(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"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`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:ae},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),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,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:Y,ServicePricingSummary:Ne,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:z(vr,[[`render`,Tr],[`__scopeId`,`data-v-c800852a`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return We(`kling`,W(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Q(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 V(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return Oe()&&U(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=U(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=U(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quote(W(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(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(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),P=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[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`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(P,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=z(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:I,ElUpload:C,ElButton:Y,InfoIcon:F,ImagePreview:Z},mixins:[q,X,K,ve],data(){return{fileList:[],uploadUrl:B()+`/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()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(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`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,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 Rr=z(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:I,ElUpload:C,ElButton:Y,InfoIcon:F,FilePreview:je},mixins:[X,K],data(){return{fileList:[],uploadUrl:B()+`/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()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(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`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,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 Gr=z(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:ye,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=z(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:F},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},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=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(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`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=z($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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||ai},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=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,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 di=z(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,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 vi=z(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:F},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`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,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 Ti=v({name:`MotionPanel`,components:{MagicIcon:L,ElButton:Y,ServicePricingSummary:Ne,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:z(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return V({...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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(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(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[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`,Oi,[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 Ai=z(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:xe},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)}}}),Mi=[`title`],Ni={class:`text`};function Pi(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`,Ni,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,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=z(ji,[[`render`,Pi],[`__scopeId`,`data-v-e6a2bb26`]]),Ii={"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`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:de.map(e=>({value:e,label:Ii[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=ue)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,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 Vi=z(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=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`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,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 Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:L,UploadIcon:I,ElUpload:C,ElButton:Y,ElInput:ye,ServicePricingSummary:Ne,InfoIcon:F,ImagePreview:Z,ModelSelector:Vi,ModeSelector:z(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[K,ve],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:B()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},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 V({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return Oe()&&U(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=U(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quoteTalkingPhoto(pe(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},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`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(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(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,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`,Qi,[e(`div`,$i,[e(`span`,ea,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,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,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`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,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(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=z(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:ce,ChannelIcon:re,InfoIcon:oe,MagicIcon:L,TimeIcon:P,WarningIcon:le,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:Y,ImagePreview:Z,VideoPreview:Ie,AudioPreview:Pe,ApiCodeButton:Re,ReportButton:Ae},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 G.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`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(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`),P=l(`warning-icon`),F=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,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,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(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`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[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`,Ca,[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`,wa,[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`,Ta,[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`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[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`,Oa,[a(F,{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`,ka,[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`,Aa,[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`,ja,[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`,Ma,[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`,Na,[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 Fa=v({name:`RecentPanel`,components:{TaskPreview:z(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:ne,BotPlaceholder:ze,ScrollList:te},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?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Xe,RecentPanel:z(Fa,[[`render`,Ra]]),ShowcaseResultTabs:Ve},mixins:[Ce,He(`kling`),Be(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},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},walletMode(){return this.taskType!==`motion`&&Oe()&&U(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){ge(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ie({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=W(this.config),t=Ue(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!be(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>H.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),J(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!_e())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof De||he(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return we(this.$wallet)},async confirmWalletPayment(e){return G.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},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(!be(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(!_e())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),J(`kling`,H.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{he(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!be(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=pe(e),n=this.createPaymentOperation(e=>H.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),J(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(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(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[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(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=z(za,[[`render`,Ha]]);export{Ua as default};
|
|
@@ -0,0 +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,S as c,T as l,at as u,bt as d,ht as f,it as p,j as m,mt as h,qt as g,rt as _,st as v,tt as y,x as ee,z as b}from"./vendor-chart-Dw-P17PN.js";import{F as x}from"./icon-CDmWyIgD.js";import{r as S,t as C}from"./select-CcTiPJUg.js";import{t as w}from"./upload-C_YrWWV5.js";import{t as T}from"./tooltip-DqGMJJ6f.js";import{t as E}from"./alert-BprQRUmf.js";import{h as D,v as O}from"./models-DGI43qxx.js";import{t as k}from"./drawer-J5GNVza3.js";import{t as A}from"./input-number-BL-h5gxp.js";import{t as j}from"./switch-ChU8jScg.js";import{t as M}from"./check-C-ennB_F.js";import{t as N}from"./clock-DYMdqYCO.js";import{t as P}from"./download-C8zVAyrZ.js";import{a as F,i as I,n as L,o as R,r as z,s as B,t as V}from"./pagination-DgncPTOk.js";import{t as te}from"./info-xfm1EWy9.js";import{t as H}from"./languages-BQAnKBsP.js";import{t as ne}from"./loader-circle-BtiAasZD.js";import{t as re}from"./palette-CssI--5q.js";import{t as ie}from"./paperclip-DDXlPDyM.js";import{t as ae}from"./pause-BHUOotRm.js";import{t as oe}from"./play-Dptgh_Ds.js";import{t as se}from"./rotate-cw-Dmw3pXHH.js";import{t as ce}from"./trash-2-BhwPJFMz.js";import{t as le}from"./triangle-alert-DBKQGKg_.js";import{t as ue}from"./video-BFTllrg6.js";import{t as U}from"./wand-sparkles-1fXELugW.js";import{Qr as de,ai as fe,di as pe,ei as me,li as he,ni as W,pi as ge,ri as _e,si as ve,ti as ye}from"./constants-CiMGQy1r.js";import{A as G,Ar as K,Ba as be,Ln as q,Nn as xe,O as Se,Pn as Ce,Vi as J,Wa as we,ca as Te,ea as Ee,et as De,io as Y,jr as Oe,kr as X,pi as ke,st as Ae,ui as je,zi as Me}from"./index-BhuKiXPa.js";import{t as Ne}from"./CopyToClipboard-42kl-Hqn.js";import{t as Pe}from"./ReportButton-CpUpPvRI.js";import{t as Fe}from"./FilePreview-CbhJypON.js";import{t as Ie}from"./ImagePreview-B6S0ASYG.js";import{n as Le}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Re}from"./ServicePricingSummary-CLl8JOoX.js";import{t as ze}from"./AudioPreview-c0cNd09Y.js";import{t as Be}from"./VideoPlayer-CK-MW_iJ.js";import{t as Ve}from"./VideoPreview-7TXejh5Z.js";import{t as He}from"./ScenarioPaymentMode-DBW7ha0H.js";import{t as Ue}from"./ApiCodeButton-6CAkuLWs.js";import{t as We}from"./BotPlaceholder-Ctu1jmvN.js";import{t as Ge}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ke}from"./ShowcaseResultTabs-Bk-qHuoo.js";import{t as qe}from"./showcaseRecreateMixin-CH_5cLk1.js";import{n as Je,t as Ye}from"./generationInput-Dg5BMVbU.js";import{i as Xe,n as Z,r as Ze,t as Qe}from"./maestroLanguages-BDi0WKKu.js";var $e=b({name:`LayoutMaestro`,components:{MagicIcon:U,ElDrawer:k,ElButton:Y},mixins:[Le]}),et={class:`main flex flex-row flex-1`},tt={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)]`},nt={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function rt(t,n,r,i,o,c){let l=u(`magic-icon`),d=u(`el-button`),m=u(`el-drawer`);return y(),s(`div`,et,[e(`div`,tt,[p(t.$slots,`config`,{},void 0,!0)]),e(`div`,nt,[p(t.$slots,`result`,{},void 0,!0)]),f(a(d,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:h(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[ee,!t.tasksEmpty]]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:h(()=>[p(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var it=G($e,[[`render`,rt],[`__scopeId`,`data-v-43f3f7f4`]]),at=b({name:`MaestroFileUrlsInput`,components:{AttachmentIcon:ie,ElUpload:w,ElButton:Y},mixins:[Ae,De],data(){return{fileList:[],uploadUrl:be()+`/api/v1/files/`,MAESTRO_FILE_ACCEPT:he,MAESTRO_FILE_LIMIT:20}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},value(){return this.$store.state.maestro?.config?.file_urls||[]}},watch:{value:{immediate:!0,handler(e){let t=new Map(this.fileList.map(e=>[e?.response?.file_url||e.url,e])),n=e.map(e=>t.get(e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}}),r=this.fileList.filter(e=>!(e?.response?.file_url||e.url));this.fileList=[...n,...r]}}},methods:{onExceed(){O.warning(this.$t(`maestro.message.uploadExceed`))},onError(){O.error(this.$t(`maestro.message.uploadError`))},onChange(){let e=this.fileList.map(e=>e?.response?.file_url||e.url).filter(e=>!!e);this.$store.commit(`maestro/setConfig`,{...this.$store.state.maestro?.config,file_urls:e})}}});function ot(e,t,n,o,c,l){let d=u(`attachment-icon`),f=u(`el-button`),p=u(`el-upload`);return y(),s(`div`,null,[a(p,{ref:`uploader`,"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,accept:e.MAESTRO_FILE_ACCEPT,name:`file`,class:`w-full`,limit:e.MAESTRO_FILE_LIMIT,multiple:!0,"before-upload":e.beforeUploadSizeGuard,action:e.uploadUrl,headers:e.headers,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onChange,"on-remove":e.onChange},{default:h(()=>[a(f,{size:`small`,round:``},{default:h(()=>[a(d,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`maestro.button.uploadFiles`)),1)]),_:1})]),_:1},8,[`file-list`,`accept`,`limit`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])])}var st=G(at,[[`render`,ot]]),ct=.6;function lt(e){return Math.min(300,Math.max(5,typeof e==`number`&&Number.isFinite(e)?Math.round(e):30))}function ut(e){return(e?.length?e:[`zh-cn`]).slice(0,4)}function dt(e,t=`auto`,n=1){let r=t===`drama`?1.35:t===`avatar`?1.15:1,i=Math.max(0,n-1)*6;return Number((e*ct*r+i).toFixed(2))}var ft={"9:16":{width:15,height:26},"16:9":{width:26,height:15},"1:1":{width:20,height:20}},pt=b({name:`ConfigPanel`,components:{MagicIcon:U,ElButton:Y,ElSelect:S,ElOption:C,ElInputNumber:A,ElAlert:E,ElSwitch:j,InfoIcon:F,PauseIcon:ae,PlayIcon:oe,PromptTextarea:I,FileUrlsInput:st,ScenarioPaymentMode:He,ServicePricingSummary:Re},emits:[`generate`],data(){return{MAESTRO_MIN_DURATION:5,MAESTRO_MAX_DURATION:300,MAESTRO_ALLOWED_SCENARIOS:me,MAESTRO_SCENARIO_THUMBNAILS:pe,MAESTRO_ALLOWED_STYLES:ye,MAESTRO_ALLOWED_VOICES:W,playing:!1,audioEl:null,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.maestro?.config},service(){return this.$store.state.maestro?.service},ratioOptions(){return de.map(e=>({value:e,...ft[e]??{width:20,height:20}}))},isRemixing(){let e=this.config?.action;return!!e&&e!==`generate`&&!!this.config?.ref_task_id},refTaskId(){return this.config?.ref_task_id},needsRequiredUpload(){if(!this.scenarioCustomizationEnabled)return!1;let e=this.config?.scenario;if(!e||!ge.includes(e))return!1;let t=this.config?.file_urls||[];return e===`captions`?!t.some(e=>q(e)):!t.some(e=>Ce(e))},canGenerate(){return Ye(`maestro`,X(this.config))&&!this.needsRequiredUpload},prompt:{get(){return this.config?.prompt},set(e){this.update({prompt:e})}},langs:{get(){return Z(this.config?.langs)},set(e){this.update({langs:Z(e)})}},languageOptions(){return Qe(this.$i18n.locale)},additionalLanguageOptions(){return this.languageOptions.filter(e=>e.value!==this.primaryLanguage)},primaryLanguage:{get(){return this.langs[0]||fe[0]},set(e){this.update({langs:Xe(this.langs,e)})}},additionalLanguages:{get(){return this.langs.slice(1)},set(e){this.update({langs:ut(Ze(this.langs,e))})}},additionalLanguageLimit(){return 3},estimatedCredits(){let e=this.scenarioCustomizationEnabled&&this.scenario||`auto`;return dt(this.duration||30,e,this.langs.length)},aspect:{get(){return this.config?.aspect},set(e){this.update({aspect:e})}},duration:{get(){return this.config?.duration},set(e){this.update({duration:lt(e)})}},scenarioCustomizationEnabled:{get(){return this.config?.scenario_customization_enabled??!1},set(e){this.update({scenario_customization_enabled:e})}},styleCustomizationEnabled:{get(){return this.config?.style_customization_enabled??!1},set(e){this.update({style_customization_enabled:e})}},voiceCustomizationEnabled:{get(){return this.config?.voice_customization_enabled??!1},set(e){e||this.stopSample(),this.update({voice_customization_enabled:e})}},scenario:{get(){return this.config?.scenario},set(e){this.update({scenario:e})}},style:{get(){return this.config?.style},set(e){let t=e?.trim();this.update({style:!t||t.toLowerCase()===`auto`?ve:t})}},voice:{get(){return this.config?.voice},set(e){this.stopSample(),this.update({voice:e||`warm-female`})}},currentSample(){return W.find(e=>e.key===this.voice)?.sample},walletMode(){return Me()&&J(`maestro`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},voiceCustomizationEnabled(e){e||this.stopSample()},voice(){this.stopSample()}},mounted(){let e=ut(Z(this.config?.langs));this.update({action:this.config?.action??`generate`,langs:e,aspect:this.config?.aspect??`9:16`,duration:lt(this.config?.duration),scenario:this.config?.scenario||`narrated`})},beforeUnmount(){this.stopSample(),window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=J(`maestro`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=J(`maestro`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await K.quote(X(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},update(e){this.$store.commit(`maestro/setConfig`,{...this.config,...e})},onClearRemix(){this.update({action:_e,ref_task_id:void 0})},onToggleSample(){let e=this.currentSample;if(e){if(this.audioEl||(this.audioEl=d(new Audio),this.audioEl.addEventListener(`ended`,()=>{this.playing=!1})),this.playing){this.audioEl.pause(),this.playing=!1;return}this.audioEl.src!==e&&(this.audioEl.src=e),this.audioEl.currentTime=0,this.audioEl.play().then(()=>{this.playing=!0}).catch(()=>{this.playing=!1})}},stopSample(){this.audioEl&&(this.audioEl.pause(),this.audioEl.currentTime=0),this.playing=!1},onGenerate(){this.$emit(`generate`)}}}),mt={class:`flex flex-col h-full`},ht={class:`flex-1 overflow-y-auto p-5`},gt={class:`text-xs mb-1`},_t={class:`field-block mb-5`},vt={class:`field-head`},yt={class:`field-title font-bold`},bt={class:`field-block mb-5`},xt={class:`field-head`},St={class:`field-title font-bold`},Ct={class:`language-picker`},wt={class:`language-role language-role--primary`},Tt={class:`language-role-label`},Et={class:`language-role`},Dt={class:`language-role-label`},Ot={class:`field-block mb-5`},kt={class:`field-head`},At={class:`field-title font-bold`},jt=[`aria-label`],Mt=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Nt={class:`ratio-preview`},Pt={class:`ratio-name`},Ft={class:`field-row mb-4`},It={class:`field-head`},Lt={class:`field-title font-bold`},Rt={class:`custom-field`},zt={class:`custom-field-header mb-2`},Bt={class:`field-head`},Vt={class:`field-title font-bold`},Ht=[`aria-label`,`aria-disabled`],Ut=[`aria-checked`,`aria-disabled`,`aria-label`,`tabindex`,`onClick`,`onKeydown`],Wt={class:`scenario-thumb`},Gt=[`src`,`alt`],Kt={class:`scenario-name`},qt={class:`custom-field`},Jt={class:`custom-field-header mb-2`},Yt={class:`field-head`},Xt={class:`field-title font-bold`},Zt={class:`custom-field`},Qt={class:`custom-field-header mb-2`},$t={class:`field-head`},en={class:`field-title font-bold`},tn={class:`voice-row`},nn={class:`flex flex-col items-center justify-center px-5 pb-5`};function rn(d,f,p,v,ee,b){let x=u(`magic-icon`),S=u(`el-button`),C=u(`el-alert`),w=u(`prompt-textarea`),T=u(`info-icon`),E=u(`file-urls-input`),D=u(`el-option`),O=u(`el-select`),k=u(`el-input-number`),A=u(`el-switch`),j=u(`pause-icon`),M=u(`play-icon`),N=u(`scenario-payment-mode`),P=u(`service-pricing-summary`);return y(),s(`div`,mt,[e(`div`,ht,[d.isRemixing?(y(),m(C,{key:0,closable:!1,type:`info`,class:`mb-5`},{default:h(()=>[e(`p`,gt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.name.remixing`))+`: `+i(d.refTaskId),1)]),a(S,{size:`small`,text:``,onClick:d.onClearRemix},{default:h(()=>[r(i(d.$t(`maestro.button.cancelRemix`)),1)]),_:1},8,[`onClick`])]),_:1})):o(``,!0),a(w,{modelValue:d.prompt,"onUpdate:modelValue":f[0]||=e=>d.prompt=e,class:`mb-5`,title:d.$t(`maestro.name.prompt`),info:d.$t(`maestro.description.prompt`),placeholder:d.$t(`maestro.placeholder.prompt`),"min-rows":6},null,8,[`modelValue`,`title`,`info`,`placeholder`]),e(`div`,_t,[e(`div`,vt,[e(`h2`,yt,i(d.$t(`maestro.name.files`)),1),a(T,{content:d.$t(`maestro.description.files`),class:`ml-1`},null,8,[`content`])]),a(E)]),e(`div`,bt,[e(`div`,xt,[e(`h2`,St,i(d.$t(`maestro.name.langs`)),1),a(T,{content:d.$t(`maestro.description.langs`),class:`ml-1`},null,8,[`content`])]),e(`div`,Ct,[e(`label`,wt,[e(`span`,Tt,i(d.$t(`maestro.name.primaryLanguage`)),1),a(O,{modelValue:d.primaryLanguage,"onUpdate:modelValue":f[1]||=e=>d.primaryLanguage=e,class:`w-full`},{default:h(()=>[(y(!0),s(l,null,_(d.languageOptions,e=>(y(),m(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`])]),e(`label`,Et,[e(`span`,Dt,i(d.$t(`maestro.name.additionalLanguages`)),1),a(O,{modelValue:d.additionalLanguages,"onUpdate:modelValue":f[2]||=e=>d.additionalLanguages=e,multiple:``,"collapse-tags":``,"collapse-tags-tooltip":``,"multiple-limit":d.additionalLanguageLimit,placeholder:d.$t(`maestro.placeholder.additionalLanguages`),class:`w-full`},{default:h(()=>[(y(!0),s(l,null,_(d.additionalLanguageOptions,e=>(y(),m(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`multiple-limit`,`placeholder`])])])]),e(`div`,Ot,[e(`div`,kt,[e(`h2`,At,i(d.$t(`maestro.name.aspect`)),1)]),e(`div`,{class:`ratio-items`,role:`radiogroup`,"aria-label":d.$t(`maestro.name.aspect`)},[(y(!0),s(l,null,_(d.ratioOptions,r=>(y(),s(`div`,{key:r.value,class:n([`ratio-item`,{active:d.aspect===r.value}]),role:`radio`,"aria-checked":d.aspect===r.value,"aria-label":r.value,tabindex:`0`,onClick:e=>d.aspect=r.value,onKeydown:[c(t(e=>d.aspect=r.value,[`prevent`]),[`enter`]),c(t(e=>d.aspect=r.value,[`prevent`]),[`space`])]},[e(`div`,Nt,[e(`div`,{class:`ratio-rect`,style:g({width:r.width+`px`,height:r.height+`px`})},null,4)]),e(`p`,Pt,i(r.value),1)],42,Mt))),128))],8,jt)]),e(`div`,Ft,[e(`div`,It,[e(`h2`,Lt,i(d.$t(`maestro.name.duration`)),1),a(T,{content:d.$t(`maestro.description.duration`),class:`ml-1`},null,8,[`content`])]),a(k,{modelValue:d.duration,"onUpdate:modelValue":f[3]||=e=>d.duration=e,class:`field-control`,min:d.MAESTRO_MIN_DURATION,max:d.MAESTRO_MAX_DURATION,step:5,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`])]),e(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`h2`,Vt,i(d.$t(`maestro.name.customizeScenario`)),1),a(T,{content:d.$t(`maestro.description.scenario`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.scenarioCustomizationEnabled,"onUpdate:modelValue":f[4]||=e=>d.scenarioCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeScenario`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,{class:n([`scenario-cards`,{"is-disabled":!d.scenarioCustomizationEnabled}]),role:`radiogroup`,"aria-label":d.$t(`maestro.name.scenario`),"aria-disabled":!d.scenarioCustomizationEnabled},[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_SCENARIOS,r=>(y(),s(`div`,{key:r,class:n([`scenario-card`,{active:d.scenarioCustomizationEnabled&&d.scenario===r,disabled:!d.scenarioCustomizationEnabled}]),role:`radio`,"aria-checked":d.scenarioCustomizationEnabled&&d.scenario===r,"aria-disabled":!d.scenarioCustomizationEnabled,"aria-label":d.$t(`maestro.option.scenario.${r}`),tabindex:d.scenarioCustomizationEnabled?0:-1,onClick:e=>d.scenarioCustomizationEnabled&&(d.scenario=r),onKeydown:[c(t(e=>d.scenarioCustomizationEnabled&&(d.scenario=r),[`prevent`]),[`enter`]),c(t(e=>d.scenarioCustomizationEnabled&&(d.scenario=r),[`prevent`]),[`space`])]},[e(`div`,Wt,[e(`img`,{src:d.MAESTRO_SCENARIO_THUMBNAILS[r],alt:d.$t(`maestro.option.scenario.${r}`),loading:`lazy`},null,8,Gt)]),e(`p`,Kt,i(d.$t(`maestro.option.scenario.${r}`)),1)],42,Ut))),128))],10,Ht),d.needsRequiredUpload?(y(),m(C,{key:0,title:d.$t(d.scenario===`avatar`?`maestro.message.avatarNeedsImage`:`maestro.message.captionsNeedVideo`),type:`warning`,closable:!1,"show-icon":``,class:`mt-2`},null,8,[`title`])):o(``,!0)]),e(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`h2`,Xt,i(d.$t(`maestro.name.customizeStyle`)),1),a(T,{content:d.$t(`maestro.description.style`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.styleCustomizationEnabled,"onUpdate:modelValue":f[5]||=e=>d.styleCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeStyle`)},null,8,[`modelValue`,`aria-label`])]),a(O,{modelValue:d.style,"onUpdate:modelValue":f[6]||=e=>d.style=e,class:`w-full`,filterable:``,"allow-create":``,"default-first-option":``,disabled:!d.styleCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeStyle`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_STYLES,e=>(y(),m(D,{key:e,label:d.$t(`maestro.option.style.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`])]),e(`div`,Zt,[e(`div`,Qt,[e(`div`,$t,[e(`h2`,en,i(d.$t(`maestro.name.customizeVoice`)),1),a(T,{content:d.$t(`maestro.description.voice`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.voiceCustomizationEnabled,"onUpdate:modelValue":f[7]||=e=>d.voiceCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeVoice`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,tn,[a(O,{modelValue:d.voice,"onUpdate:modelValue":f[8]||=e=>d.voice=e,class:`voice-select`,disabled:!d.voiceCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeVoice`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_VOICES,e=>(y(),m(D,{key:e.key,label:d.$t(`maestro.option.voice.${e.key}`),value:e.key},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`]),a(S,{class:`voice-play`,disabled:!d.voiceCustomizationEnabled||!d.currentSample,title:d.$t(`maestro.button.preview`),"aria-label":d.$t(`maestro.button.preview`),onClick:d.onToggleSample},{default:h(()=>[d.playing?(y(),m(j,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(y(),m(M,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])])])]),e(`div`,nn,[a(N,{scenario:`maestro`}),d.walletMode?o(``,!0):(y(),m(P,{key:0,value:d.estimatedCredits,service:d.service},null,8,[`value`,`service`])),a(S,{type:`primary`,class:`btn w-full`,round:``,disabled:!d.canGenerate,onClick:d.onGenerate},{default:h(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var an=G(pt,[[`render`,rn],[`__scopeId`,`data-v-282658e3`]]),on=50,sn=1e4,Q=new Map,$=new Map,cn=(e,t)=>{if(Q.set(e,t),Q.size>on){let e=Q.keys().next().value;e&&Q.delete(e)}};async function ln(e,t){let n=`${t.credentialKey}:${e}`,r=Q.get(n);if(r)return r;let i=$.get(n);if(i)return i.promise;let a=new AbortController,o,s={controller:a,promise:void 0},c=K.task(e,{token:t.token,signal:a.signal}).then(({data:e})=>{if(!a.signal.aborted)return cn(n,e),e}).catch(t=>{a.signal.aborted||console.warn(`failed to load maestro remix reference task`,e,t)}),l=new Promise(e=>{o=window.setTimeout(()=>{a.abort(),e(void 0)},sn)});return s.promise=Promise.race([c,l]).finally(()=>{o!==void 0&&window.clearTimeout(o),$.get(n)===s&&$.delete(n)}),$.set(n,s),s.promise}var un=[`plan`,`source`,`voice`,`compose`,`render`,`deliver`];function dn(e){if(!e)return-1;let t=e.toLowerCase(),n=un.indexOf(t);return n>=0?n:/plan|storyboard|script|brief/.test(t)?0:/source|search|image|photo|asset|media/.test(t)?1:/voice|tts|audio|narrat/.test(t)?2:/compose|composit|build|layout|scene/.test(t)?3:/render|encode/.test(t)?4:/deliver|upload|cdn|complete|done|finish/.test(t)?5:-1}var fn=b({name:`ProgressSteps`,components:{ElIcon:x,Loading:ne,Check:M},props:{modelValue:{type:Object,required:!0}},computed:{currentIndex(){let e=this.modelValue?.response?.data?.progress||[],t=-1;for(let n of e)t=Math.max(t,dn(n?.stage));return t=Math.max(t,dn(this.modelValue?.response?.data?.stage)),Math.max(t,0)},detail(){let e=this.modelValue?.response?.data;if(e?.activity)return e.activity;let t=e?.progress||[];for(let e=t.length-1;e>=0;e--)if(t[e]?.message)return t[e]?.message},steps(){return un.map(e=>({key:e}))}},methods:{stateOf(e){let t=this.currentIndex;return e<t?`done`:e===t?`active`:`pending`}}}),pn={class:`progress-steps`,"aria-live":`polite`},mn=[`aria-current`],hn={class:`ico`},gn={class:`txt`},_n={key:0,class:`detail`};function vn(t,r,c,d,f,p){let g=u(`loading`),v=u(`el-icon`),ee=u(`check`);return y(),s(`div`,pn,[(y(!0),s(l,null,_(t.steps,(r,c)=>(y(),s(`div`,{key:r.key,class:n([`step`,t.stateOf(c)]),"aria-current":c===t.currentIndex?`step`:void 0},[e(`span`,hn,[c===t.currentIndex?(y(),m(v,{key:0,class:`is-loading`,"aria-label":t.$t(`maestro.step.${r.key}`)},{default:h(()=>[a(g,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`])):c<t.currentIndex?(y(),m(v,{key:1},{default:h(()=>[a(ee,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):o(``,!0)]),e(`span`,gn,i(t.$t(`maestro.step.${r.key}`)),1)],10,mn))),128)),t.detail?(y(),s(`p`,_n,i(t.detail),1)):o(``,!0)])}var yn=G(fn,[[`render`,vn],[`__scopeId`,`data-v-8a883977`]]),bn=[`succeeded`,`failed`],xn=[1e3,3e3],Sn=b({name:`TaskPreview`,components:{DeleteIcon:ce,ElTooltip:T,ChannelIcon:B,DownloadIcon:P,InfoIcon:te,LanguageIcon:H,MagicIcon:U,RedoIcon:se,TimeIcon:N,WarningIcon:le,CopyToClipboard:Ne,ElAlert:E,VideoPlayer:Be,ElButton:Y,ApiCodeButton:Ue,ReportButton:Pe,ImagePreview:Ie,AudioPreview:ze,VideoPreview:Ve,FilePreview:Fe,ProgressSteps:yn},props:{modelValue:{type:Object,required:!0}},data(){return{fetchedReferenceTask:void 0,fetchedReferenceKey:void 0,referenceLoadAttempt:0,referenceLoadFailed:!1,referenceLoadTimer:void 0,referenceLoadVersion:0}},computed:{variants(){return this.modelValue?.response?.data?.variants||[]},files(){let e=[...this.modelValue?.request?.file_urls||[]];if(this.referenceTaskId)for(let t of this.referenceTask?.response?.data?.variants||[])t.output_url&&e.push(t.output_url);return[...new Set(e)].filter(e=>!!e).map(e=>{let t=e.split(`?`)[0].split(`#`)[0],n=Ce(t)?`image`:q(t)?`video`:xe(t)?`audio`:`file`;return{url:e,name:this.fileName(t),kind:n}})},referenceTaskId(){let e=this.modelValue?.request;return e?.action===`remix`?e?.ref_task_id:void 0},referenceLoadKey(){let e=this.$store.state.maestro?.credential,t=e?.token;if(!(!this.referenceTaskId||!t))return JSON.stringify([this.referenceTaskId,e?.id||e?.user_id||t,t])},referenceTask(){if(this.referenceTaskId)return this.$store.state.maestro?.tasks?.items?.find(e=>e.id===this.referenceTaskId)||(this.fetchedReferenceKey===this.referenceLoadKey?this.fetchedReferenceTask:void 0)},isTerminal(){return bn.includes(this.modelValue?.status||``)},traceId(){return this.modelValue?.trace_id||this.modelValue?.response?.trace_id},progressPct(){let e=this.modelValue?.response?.data?.progress,t=e?.length?e[e.length-1]:void 0;return typeof t?.pct==`number`?t.pct:void 0},progressText(){return this.progressPct===void 0?this.statusLabel:`${this.progressPct}%`},statusLabel(){let e=`maestro.status.${this.modelValue?.status||`pending`}`,t=this.$t(e);return t===e?this.$t(`maestro.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message},requestParams(){let e=this.modelValue?.request;if(!e)return[];let t=[];return e.action&&t.push({icon:d(U),label:this.$t(`maestro.name.mode`),value:this.optionLabel(`maestro.option.action`,e.action)}),e.scenario&&t.push({icon:d(ue),label:this.$t(`maestro.name.scenario`),value:this.optionLabel(`maestro.option.scenario`,e.scenario)}),e.style&&t.push({icon:d(re),label:this.$t(`maestro.name.style`),value:this.optionLabel(`maestro.option.style`,e.style)}),e.aspect&&t.push({icon:d(R),label:this.$t(`maestro.name.aspect`),value:e.aspect}),e.duration&&t.push({icon:d(N),label:this.$t(`maestro.name.duration`),value:`${e.duration}s`}),e.langs?.length&&t.push({icon:d(H),label:this.$t(`maestro.name.langs`),value:e.langs.join(` · `)}),t}},watch:{referenceLoadKey:{immediate:!0,handler(e){this.resetReferenceLoad(),e&&!this.referenceTask&&this.loadReferenceTask(e)}}},beforeUnmount(){this.resetReferenceLoad()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await we.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(`maestro/deleteTask`,{id:e}),O.success(this.$t(`common.message.deleteTaskSuccess`))}catch{O.error(this.$t(`common.message.deleteTaskFailed`))}}},resetReferenceLoad(){this.referenceLoadTimer!==void 0&&window.clearTimeout(this.referenceLoadTimer),this.referenceLoadTimer=void 0,this.referenceLoadVersion+=1,this.referenceLoadAttempt=0,this.referenceLoadFailed=!1,this.fetchedReferenceTask=void 0,this.fetchedReferenceKey=void 0},async loadReferenceTask(e){if(e!==this.referenceLoadKey||this.referenceTask)return;let t=this.$store.state.maestro?.credential,n=t?.token,r=this.referenceTaskId;if(!r||!n)return;let i=t?.id||t?.user_id||n,a=this.referenceLoadVersion;this.referenceLoadAttempt+=1;let o=await ln(r,{token:n,credentialKey:i});if(a!==this.referenceLoadVersion||e!==this.referenceLoadKey)return;if(o){this.fetchedReferenceTask=o,this.fetchedReferenceKey=e,this.referenceLoadFailed=!1;return}let s=xn[this.referenceLoadAttempt-1];s===void 0?this.referenceLoadFailed=!0:this.referenceLoadTimer=window.setTimeout(()=>{this.referenceLoadTimer=void 0,this.loadReferenceTask(e)},s)},retryReferenceTask(){let e=this.referenceLoadKey;this.resetReferenceLoad(),e&&this.loadReferenceTask(e)},optionLabel(e,t){let n=`${e}.${t}`,r=this.$t(n);return r===n?t:r},fileName(e){let t=e.substring(e.lastIndexOf(`/`)+1);try{return decodeURIComponent(t)||e}catch{return t||e}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)},onRemix(){if(!this.modelValue)return;let e=Oe(this.$store.state.maestro?.config,this.modelValue);this.$store.commit(`maestro/setConfig`,e),O.info(this.$t(`maestro.message.remixLoaded`))}}}),Cn={class:`preview`},wn={class:`left`},Tn={class:`main`},En={class:`bot`},Dn={class:`datetime`},On=[`aria-label`],kn={class:`info`},An={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},jn=[`href`,`title`],Mn={key:1,class:`reference-load-failed flex items-center gap-1 mt-2 text-xs text-[var(--el-text-color-secondary)]`},Nn={key:2,class:`prompt mt-2`},Pn={key:0,class:`progress-pct`},Fn={key:0,class:`content`},In={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ln={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rn={key:1,class:`content`},zn={class:`text-xs text-[var(--el-text-color-secondary)] mb-1`},Bn={key:0},Vn={class:`operations`},Hn={key:0},Un={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kn={key:2,class:`content`},qn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Zn(c,d,f,p,g,ee){let b=u(`capability-presentation`),x=u(`delete-icon`),S=u(`el-tooltip`),C=u(`image-preview`),w=u(`video-preview`),T=u(`audio-preview`),E=u(`file-preview`),D=u(`info-icon`),O=u(`redo-icon`),k=u(`el-button`),A=u(`progress-steps`),j=u(`magic-icon`),M=u(`copy-to-clipboard`),N=u(`channel-icon`),P=u(`el-alert`),F=u(`language-icon`),I=u(`video-player`),L=u(`download-icon`),R=u(`api-code-button`),z=u(`report-button`),B=u(`time-icon`),V=u(`warning-icon`);return y(),s(`div`,Cn,[e(`div`,wn,[a(b,{capability:`maestro`,part:`avatar`,class:`avatar`})]),e(`div`,Tn,[e(`div`,En,[a(b,{capability:`maestro`,part:`name`}),e(`span`,Dn,i(c.$dayjs.format(``+new Date(parseFloat((c.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:c.$t(`common.button.delete`),placement:`top`},{default:h(()=>[c.modelValue?.id?(y(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":c.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>c.onDelete&&c.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,On)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,kn,[c.files.length?(y(),s(`div`,An,[(y(!0),s(l,null,_(c.files,(e,t)=>(y(),s(l,{key:t},[e.kind===`image`?(y(),m(C,{key:0,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`])):e.kind===`video`?(y(),m(w,{key:1,url:e.url,name:e.name},null,8,[`url`,`name`])):e.kind===`audio`?(y(),m(T,{key:2,url:e.url,name:e.name},null,8,[`url`,`name`])):(y(),s(`a`,{key:3,href:e.url,title:e.name,target:`_blank`,rel:`noopener noreferrer`,class:`shrink-0 no-underline`},[a(E,{name:e.name,closable:!1},null,8,[`name`])],8,jn))],64))),128))])):o(``,!0),c.referenceLoadFailed&&c.referenceTaskId&&!c.referenceTask?(y(),s(`div`,Mn,[a(D,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(c.$t(`maestro.name.files`))+`: `+i(c.$t(`maestro.name.failure`)),1),a(k,{class:`reference-retry`,size:`small`,text:``,circle:``,title:c.$t(`codingBridge.session.retry`),"aria-label":c.$t(`codingBridge.session.retry`),onClick:c.retryReferenceTask},{default:h(()=>[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`aria-label`,`onClick`])])):o(``,!0),c.modelValue?.request?.prompt?(y(),s(`p`,Nn,[r(i(c.modelValue?.request?.prompt)+` `,1),c.isTerminal?o(``,!0):(y(),s(`span`,Pn,` · `+i(c.progressText),1))])):o(``,!0)]),c.isTerminal?o(``,!0):(y(),s(`div`,Fn,[a(P,{closable:!1,class:`mt-2 processing`},{default:h(()=>[a(A,{"model-value":c.modelValue},null,8,[`model-value`]),(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:n([`text-[var(--el-text-color-regular)] text-xs mb-2`,{"mt-3":t===0}])},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)],2))),128)),e(`p`,In,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.traceId?(y(),s(`p`,Ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])),c.modelValue?.response?.success===!0&&c.variants.length?(y(),s(`div`,Rn,[(y(!0),s(l,null,_(c.variants,(t,n)=>(y(),s(`div`,{key:n,class:`mb-4`},[e(`p`,zn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.lang),1),t.title?(y(),s(`span`,Bn,` · `+i(t.title),1)):o(``,!0)]),t.output_url?(y(),m(I,{key:0,src:t.output_url},null,8,[`src`])):o(``,!0)]))),128)),e(`div`,Vn,[(y(!0),s(l,null,_(c.variants,(e,t)=>(y(),s(l,{key:t},[e.output_url?(y(),m(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:t=>c.onDownload(t,e.output_url)},{default:h(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.download`)),1),c.variants.length>1?(y(),s(`span`,Hn,` · `+i(e.lang),1)):o(``,!0)]),_:2},1032,[`onClick`])):o(``,!0)],64))),128)),a(k,{size:`small`,type:`primary`,class:`btn-action`,onClick:c.onRemix},{default:h(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.remix`)),1)]),_:1},8,[`onClick`]),a(R,{path:`/maestro/videos`,body:c.modelValue?.request},null,8,[`body`]),a(z,{service:`maestro`,"target-id":c.modelValue?.id,snapshot:{prompt:c.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(P,{closable:!1,class:`mt-2 success`},{default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,Un,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.modelValue?.elapsed?(y(),s(`p`,Wn,[a(B,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,Gn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),c.modelValue?.response?.success===!1?(y(),s(`div`,Kn,[a(P,{closable:!1,class:`failure`},{template:h(()=>[a(V,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failure`)),1)]),default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,qn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.failureReason?(y(),s(`p`,Jn,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failureReason`))+`: `+i(c.failureReason),1)])):o(``,!0),c.modelValue?.elapsed?(y(),s(`p`,Yn,[a(B,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,Xn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Qn=b({name:`RecentPanel`,components:{TaskPreview:G(Sn,[[`render`,Zn],[`__scopeId`,`data-v-ef9ae897`]]),NoTasks:z,BotPlaceholder:We,ScrollList:L},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.maestro?.tasks,items:this.$store.state.maestro?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),$n={key:0},er={key:2,class:`w-full h-full flex items-center justify-center`};function tr(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),p=u(`scroll-list`),g=u(`no-tasks`);return y(),s(l,null,[e.tasks?.items===void 0?(y(),s(`div`,$n,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(y(),m(p,{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:h(()=>[(y(!0),s(l,null,_(e.tasks?.items,(e,t)=>(y(),m(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(y(),s(`div`,er,[a(g)])):o(``,!0)],64)}var nr=b({name:`MaestroIndex`,components:{ConfigPanel:an,Layout:it,RecentPanel:G(Qn,[[`render`,tr]]),ShowcaseResultTabs:Ke},mixins:[qe(`maestro`),Ge(`maestro`,!1)],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.maestro?.status?.getApplications===D.Request},tasksLoading(){return this.$store.state.maestro?.status?.getTasks===D.Request||this.fetchingTasks},credential(){return this.$store.state.maestro.credential},config(){return this.$store.state.maestro.config},tasks(){return this.$store.state.maestro.tasks},walletMode(){return Me()&&J(`maestro`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`maestro/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await V({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(){await this.$store.dispatch(`maestro/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`maestro/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=X(this.config),t=Je(`maestro`,e);if(t){O.error(this.$t(`common.message.${t}`));return}let n;if(this.walletMode){let t=this.getWalletContext();if(!t){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=K.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Te())return;let t=this.credential?.token;if(!t)return;n=K.generate(e,{token:t})}O.info(this.$t(`maestro.message.startingTask`)),Ee(`maestro`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),O.success(this.$t(`maestro.message.startTaskSuccess`))}).catch(e=>{e instanceof je||Se(e,`maestro`)||(this.walletMode?O.error(this.$t(`common.x402Scenario.paymentFailed`)):O.error(this.$t(`maestro.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return ke(this.$wallet)},async confirmWalletPayment(e){return we.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function rr(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`showcase-result-tabs`),d=u(`layout`);return y(),m(d,null,{config:h(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:h(()=>[a(l,{service:`maestro`},{tasks:h(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var ir=G(nr,[[`render`,rr]]);export{ir as default};
|
|
@@ -0,0 +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,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,qt as h,rt as g,tt as _,x as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-CcTiPJUg.js";import{t as S}from"./upload-C_YrWWV5.js";import{t as C}from"./tooltip-DqGMJJ6f.js";import{t as w}from"./alert-BprQRUmf.js";import{h as T,v as E}from"./models-DGI43qxx.js";import{t as D}from"./drawer-J5GNVza3.js";import{t as O}from"./box-CYxKRYYM.js";import{t as k}from"./clock-DYMdqYCO.js";import{t as A}from"./external-link-Cet6qhwN.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-DgncPTOk.js";import{t as L}from"./image-GcUfRlBM.js";import{t as ee}from"./info-xfm1EWy9.js";import{t as te}from"./trash-2-BhwPJFMz.js";import{t as ne}from"./triangle-alert-DBKQGKg_.js";import{t as R}from"./upload-DYQ-PwmP.js";import{t as z}from"./wand-sparkles-1fXELugW.js";import{t as re}from"./zap-CZz_Emt-.js";import{_r as B,gr as ie,hr as ae,pr as oe,vr as se}from"./constants-CiMGQy1r.js";import{S as ce}from"./i18n-DBtpbeq0.js";import{A as V,Ba as le,Cn as H,Mn as U,O as W,Vi as G,Wa as K,ar as q,at as ue,ca as J,ct as de,ea as fe,et as pe,io as Y,it as me,ot as he,pi as ge,st as _e,ui as ve,zi as X}from"./index-BhuKiXPa.js";import{t as ye}from"./CopyToClipboard-42kl-Hqn.js";import{t as be}from"./ReportButton-CpUpPvRI.js";import{t as Z}from"./ImagePreview-B6S0ASYG.js";import{n as xe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Se}from"./ServicePricingSummary-CLl8JOoX.js";import{t as Ce}from"./ScenarioPaymentMode-DBW7ha0H.js";import{t as we}from"./ApiCodeButton-6CAkuLWs.js";import{t as Te}from"./BotPlaceholder-Ctu1jmvN.js";import{t as Ee}from"./taskPollingMixin-CcLxtz8z.js";import{t as De}from"./ShowcaseResultTabs-Bk-qHuoo.js";import{t as Oe}from"./showcaseRecreateMixin-CH_5cLk1.js";import{t as ke}from"./ImageWrapper-B4zFub-J.js";import{t as Q}from"./imageRequests-JgZOB_cZ.js";var Ae=y({name:`LayoutNanobanana`,components:{MagicIcon:z,ElDrawer:D,ElButton:Y},mixins:[xe]}),je={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)]`},Ne={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Pe(t,n,r,i,o,c){let l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return _(),s(`div`,je,[e(`div`,Me,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ne,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[v,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Fe=V(Ae,[[`render`,Pe],[`__scopeId`,`data-v-6f553b1e`]]),Ie=y({name:`PromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.nanobanana?.config?.prompt},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Le(e,t,n,r,i,a){let o=u(`prompt-textarea`);return _(),p(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`nanobanana.name.prompt`),info:e.$t(`nanobanana.description.prompt`),placeholder:e.$t(`nanobanana.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Re=V(Ie,[[`render`,Le]]),ze=y({name:`ImageUrlsInput`,components:{UploadIcon:R,ElUpload:S,ElButton:Y,InfoIcon:j,ImagePreview:Z},mixins:[de,_e,ue,pe],data(){return{fileList:[],uploadUrl:le()+`/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.nanobanana?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){E.warning(this.$t(`nanobanana.message.uploadImageExceed`))},onError(){E.error(this.$t(`nanobanana.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Be={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Ve={class:`flex min-w-0 items-center`},He={class:`title m-0 text-[14px] font-bold`},Ue={class:`file-list flex flex-wrap gap-[10px]`};function We(t,n,o,c,d,f){let h=u(`info-icon`),v=u(`upload-icon`),y=u(`el-button`),b=u(`el-upload`),x=u(`image-preview`);return _(),s(`div`,null,[e(`div`,Be,[e(`div`,Ve,[e(`h2`,He,i(t.$t(`nanobanana.name.imageUrls`)),1),a(h,{content:t.$t(`nanobanana.description.imageUrls`)},null,8,[`content`])]),a(b,{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:5,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:m(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Ue,[(_(!0),s(l,null,g(t.fileList,(e,n)=>(_(),p(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Ge=V(ze,[[`render`,We]]),Ke=y({name:`AspectRatioSelector`,components:{InfoIcon:j},data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`3:2`,label:`3:2`,width:27,height:18},{value:`2:3`,label:`2:3`,width:18,height:27},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25},{value:`4:3`,label:`4:3`,width:24,height:18},{value:`3:4`,label:`3:4`,width:18,height:24}]}},computed:{value(){return this.$store.state.nanobanana?.config?.aspect_ratio}},methods:{onSelect(e){let t=this.value===e?void 0:e,n={...this.$store.state.nanobanana?.config||{}};t?n.aspect_ratio=t:delete n.aspect_ratio,this.$store.commit(`nanobanana/setConfig`,n)}}}),qe={class:`ratio`},Je={class:`header`},Ye={class:`title font-bold`},Xe=[`aria-label`],Ze=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Qe={class:`preview`},$e={class:`name`};function et(r,o,d,f,p,m){let v=u(`info-icon`);return _(),s(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(r.$t(`nanobanana.name.aspectRatio`)),1),a(v,{content:r.$t(`nanobanana.description.aspectRatio`),class:`ml-1`},null,8,[`content`])]),e(`div`,{class:`items`,role:`radiogroup`,"aria-label":r.$t(`nanobanana.name.aspectRatio`)},[(_(!0),s(l,null,g(r.options,a=>(_(),s(`div`,{key:a.value,class:n([`item`,{active:r.value===a.value}]),role:`radio`,"aria-checked":r.value===a.value,"aria-label":a.label,tabindex:`0`,onClick:e=>r.onSelect(a.value),onKeydown:[c(t(e=>r.onSelect(a.value),[`prevent`]),[`enter`]),c(t(e=>r.onSelect(a.value),[`prevent`]),[`space`])]},[e(`div`,Qe,[e(`div`,{class:`rect`,style:h({width:a.width+`px`,height:a.height+`px`})},null,4)]),e(`p`,$e,i(a.label),1)],42,Ze))),128))],8,Xe)])}var tt=V(Ke,[[`render`,et],[`__scopeId`,`data-v-7131eb97`]]),nt=y({name:`NanobananaModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:j},data(){return{options:[{value:ae,label:this.$t(`nanobanana.model.nanoBanana`)},{value:B,label:B},{value:se,label:this.$t(`nanobanana.model.nanoBananaPro`)},{value:ie,label:this.$t(`nanobanana.model.nanoBanana2`)}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.model},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,model:e})}},modelDescription(){return this.$t(`nanobanana.description.model`)}},mounted(){this.value||=oe}}),rt={class:`field`},it={class:`label`},at={class:`box`},ot={class:`title font-bold`};function st(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,rt,[e(`div`,it,[e(`div`,at,[e(`h2`,ot,i(t.$t(`nanobanana.name.model`)),1),a(f,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`)},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ct=V(nt,[[`render`,st],[`__scopeId`,`data-v-11cb675b`]]),lt=y({name:`NanobananaResolutionSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:j},data(){return{cachedResolution:`1K`,options:[{value:`1K`,label:`1K`},{value:`2K`,label:`2K`},{value:`4K`,label:`4K`}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.resolution},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:e})}},supportsResolution(){let e=this.$store.state.nanobanana?.config?.model;return e===`nano-banana-2`||e===`nano-banana-pro`}},watch:{value(e){this.supportsResolution&&e&&(this.cachedResolution=e)},supportsResolution(e){e?this.value||=this.cachedResolution||`1K`:(this.value&&(this.cachedResolution=this.value),this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}},mounted(){this.supportsResolution&&!this.value&&(this.value=`1K`),!this.supportsResolution&&this.value&&(this.cachedResolution=this.value,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}}),ut={class:`field`},dt={class:`label`},ft={class:`box`},pt={class:`title font-bold`};function mt(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,ut,[e(`div`,dt,[e(`div`,ft,[e(`h2`,pt,i(t.$t(`nanobanana.name.resolution`)),1),a(f,{content:t.$t(`nanobanana.description.resolutionProOnly`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`),disabled:!t.supportsResolution},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var ht=V(lt,[[`render`,mt],[`__scopeId`,`data-v-7ab9d4d4`]]),gt=350,_t=y({name:`ConfigPanel`,components:{MagicIcon:z,ElButton:Y,PromptInput:Re,ServicePricingSummary:Se,ImageUrlsInput:Ge,AspectRatioSelector:tt,ModelSelector:ct,ResolutionSelector:ht,ScenarioPaymentMode:Ce},props:{identityToken:{type:String,default:void 0}},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.nanobanana?.config},canGenerate(){return U(this.config?.prompt)},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;return H({...e,action:t?`edit`:`generate`},this.service?.cost)},service(){return this.$store.state.nanobanana?.service},walletMode(){return X()&&G(`nanobanana`).mode===`wallet`}},watch:{walletMode:{handler(e){e?this.scheduleQuote():this.clearQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},identityToken(){this.walletMode&&this.scheduleQuote()}},beforeUnmount(){this.clearQuote()},methods:{clearQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=G(`nanobanana`);e.quoteUsdc=void 0,e.quoteLoading=!1},scheduleQuote(){this.clearQuote(),!(!this.walletMode||!this.canGenerate)&&(this.quoteTimer=window.setTimeout(this.refreshQuote,gt))},async refreshQuote(){if(!this.walletMode||!this.canGenerate){this.clearQuote();return}let e=G(`nanobanana`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await q.quote(Q(this.config),this.identityToken);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),vt={class:`flex flex-col h-full`},yt={class:`flex-1 overflow-y-auto p-5`},bt={class:`flex flex-col items-center justify-center px-5 pb-5`};function xt(t,n,c,l,d,f){let h=u(`model-selector`),g=u(`resolution-selector`),v=u(`prompt-input`),y=u(`aspect-ratio-selector`),b=u(`image-urls-input`),x=u(`scenario-payment-mode`),S=u(`service-pricing-summary`),C=u(`magic-icon`),w=u(`el-button`);return _(),s(`div`,vt,[e(`div`,yt,[a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,bt,[a(x,{scenario:`nanobanana`}),t.walletMode?o(``,!0):(_(),p(S,{key:0,value:t.consumption,service:t.service,"pricing-unit-aliases":{count:`image`}},null,8,[`value`,`service`])),a(w,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:m(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var St=V(_t,[[`render`,xt]]),Ct=y({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:F,DeleteIcon:te,ExternalLinkIcon:A,ImageIcon:L,InfoIcon:ee,LightningIcon:re,MagicIcon:z,TimeIcon:k,WarningIcon:ne,CopyToClipboard:ye,ElAlert:w,ImageWrapper:ke,ElButton:Y,ElTooltip:C,ImagePreview:Z,ApiCodeButton:we,ReportButton:be},props:{modelValue:{type:Object,required:!0}},computed:{images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e},hasImages(){return this.images.some(e=>!!e?.image_url)},isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error},showResult(){let e=this.modelValue?.response;return!e||this.isFailure?!1:(e.success,this.hasImages)},reportSnapshot(){return{prompt:this.modelValue?.request?.prompt,image_urls:this.images.map(e=>e.image_url).filter(Boolean),model:this.modelValue?.request?.model,action:this.modelValue?.request?.action,task_id:this.modelValue?.id,trace_id:this.modelValue?.response?.trace_id}}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.nanobanana?.config||{}};delete t.action,t.image_urls=[e],this.$store.commit(`nanobanana/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await K.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(`nanobanana/deleteTask`,{id:e}),E.success(this.$t(`common.message.deleteTaskSuccess`))}catch{E.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),wt={class:`preview`},Tt={class:`left`},Et={class:`main`},Dt={class:`bot`},Ot={class:`datetime`},kt=[`aria-label`],At={class:`info`},jt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Mt={key:1,class:`prompt mt-2`},Nt={key:0},Pt={key:0,class:n({content:!0,failed:!0})},Ft={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},It={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Wt={key:1,class:n({content:!0})},Gt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Qt={key:2,class:n({content:!0})},$t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},en={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function an(n,c,d,f,h,v){let y=u(`capability-presentation`),b=u(`delete-icon`),x=u(`el-tooltip`),S=u(`image-preview`),C=u(`image-wrapper`),w=u(`el-button`),T=u(`api-code-button`),E=u(`report-button`),D=u(`application-icon`),O=u(`image-icon`),k=u(`external-link-icon`),A=u(`lightning-icon`),j=u(`magic-icon`),M=u(`copy-to-clipboard`),N=u(`time-icon`),P=u(`channel-icon`),F=u(`el-alert`),I=u(`warning-icon`),L=u(`info-icon`);return _(),s(`div`,wt,[e(`div`,Tt,[a(y,{capability:`nanobanana`,part:`avatar`,class:`avatar`})]),e(`div`,Et,[e(`div`,Dt,[a(y,{capability:`nanobanana`,part:`name`}),e(`span`,Ot,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:m(()=>[n.modelValue?.id?(_(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,kt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,At,[n.modelValue?.request?.image_urls&&n.modelValue?.request?.image_urls.length>0?(_(),s(`div`,jt,[(_(!0),s(l,null,g(n.modelValue?.request?.image_urls,(e,t)=>(_(),p(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(_(),s(`p`,Mt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(_(),s(`span`,Nt,` - (`+i(n.$t(`nanobanana.status.pending`))+`) `,1))])):o(``,!0)]),n.showResult?(_(),s(`div`,Pt,[e(`div`,Ft,[(_(!0),s(l,null,g(n.images,(e,t)=>(_(),p(C,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,It,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:m(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/nano-banana/images`,body:n.modelValue?.request},null,8,[`body`]),a(E,{service:`nanobanana`,"target-id":n.modelValue?.id,snapshot:n.reportSnapshot,"show-label":``},null,8,[`target-id`,`snapshot`])]),a(F,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Lt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,Rt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,zt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Bt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Vt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Ht,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Ut,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.isFailure?(_(),s(`div`,Wt,[a(F,{closable:!1,class:`failure`},{template:m(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failure`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Gt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,Kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,qt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,$,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Jt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Yt,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(M,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Xt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Zt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(_(),s(`div`,Qt,[a(F,{closable:!1,class:`info`},{template:m(()=>[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.status.pending`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,$t,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,en,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,tn,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,nn,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,rn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var on=y({name:`RecentPanel`,components:{TaskPreview:V(Ct,[[`render`,an],[`__scopeId`,`data-v-aa642ec8`]]),BotPlaceholder:Te,NoTasks:P,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.nanobanana?.tasks,items:this.$store.state.nanobanana?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),sn={key:0},cn={key:2,class:`w-full h-full flex items-center justify-center`};function ln(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),h=u(`scroll-list`),v=u(`no-tasks`);return _(),s(l,null,[e.tasks?.items===void 0?(_(),s(`div`,sn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(_(),p(h,{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:m(()=>[(_(!0),s(l,null,g(e.tasks?.items,e=>(_(),p(f,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(_(),s(`div`,cn,[a(v)])):o(``,!0)],64)}var un=y({name:`NanobananaIndex`,components:{ConfigPanel:St,Layout:Fe,RecentPanel:V(on,[[`render`,ln]]),ShowcaseResultTabs:De},mixins:[he,Oe(`nanobanana`),Ee(`nanobanana`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.nanobanana?.status?.getApplications===T.Request},tasksLoading(){return this.$store.state.nanobanana?.status?.getTasks===T.Request},credential(){return this.$store.state.nanobanana?.credential},config(){return this.$store.state.nanobanana?.config},application(){return this.$store.state.nanobanana?.application},tasks(){return this.$store.state.nanobanana?.tasks},walletMode(){return X()&&G(`nanobanana`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){t===void 0||e===t||(this.$store.commit(`nanobanana/setTasks`,void 0),await this.onGetTasks(),await this.onScrollDown())}},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.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await I({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`nanobanana/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`nanobanana/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.tasksLoading){console.debug(`loading`);return}let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};await this.$store.dispatch(`nanobanana/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})},async onGenerate(){if(ce()&&!J())return;if(!U(this.config?.prompt)){E.error(this.$t(`common.message.promptRequired`));return}if(!me(this.uploadTracker,e=>this.$t(e),e=>E.warning(e)))return;let e=Q(this.config),t;if(this.walletMode){let n=this.getWalletContext();if(!n){E.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=q.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!J())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}t=q.generate(e,{token:n})}E.info(this.$t(`nanobanana.message.startingTask`)),fe(`nanobanana`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),E.success(this.$t(`nanobanana.message.startTaskSuccess`))}).catch(e=>{if(e instanceof ve)return;let t=e?.response?.data;W(e,`nanobanana`)||(this.walletMode?E.error(this.$t(`common.x402Scenario.paymentFailed`)):E.error(this.$t(`nanobanana.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return ge(this.$wallet)},async confirmWalletPayment(e){return K.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function dn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`showcase-result-tabs`),d=u(`layout`);return _(),p(d,null,{config:m(()=>[a(s,{"identity-token":e.credential?.token,onGenerate:e.onGenerate},null,8,[`identity-token`,`onGenerate`])]),result:m(()=>[a(l,{service:`nano-banana`},{tasks:m(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var fn=V(un,[[`render`,dn]]);export{fn as default};
|