@acedatacloud/nexior 3.152.0 → 3.154.0
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/{Auth-Dqq3l2pU.js → Auth-BvIoOnG0.js} +1 -1
- package/dist/assets/{BotPlaceholder-CjLV0ALF.js → BotPlaceholder-CVNP81Ij.js} +1 -1
- package/dist/assets/{Callback-MvwFrclz.js → Callback-DXRlgUTY.js} +1 -1
- package/dist/assets/Console-C3Bs-OwN.js +1 -0
- package/dist/assets/{Consumption-BrRTFprj.js → Consumption-DezlNyb8.js} +1 -1
- package/dist/assets/{Conversation-Dq4euG4T.js → Conversation-D0tbBX3X.js} +17 -17
- package/dist/assets/{Conversation-jZmvVnod.css → Conversation-De5uaAaP.css} +1 -1
- package/dist/assets/{CopyToClipboard-DpLBFIyy.js → CopyToClipboard-DEQ2vUBW.js} +1 -1
- package/dist/assets/{Detail-DtkN6i5I.js → Detail-B0-LrDGH.js} +2 -2
- package/dist/assets/{EditArray-B2Ml48mM.js → EditArray-BQqciswi.js} +1 -1
- package/dist/assets/Extra-Dsr0mwrd.js +1 -0
- package/dist/assets/{FilePreview-BtyxNwVM.js → FilePreview-DygQVcir.js} +1 -1
- package/dist/assets/{History-DLby0a7S.js → History-_PS1dqx1.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-3ysMralK.js → IconPark.vue_vue_type_script_setup_true_lang-D1cGG8ik.js} +1 -1
- package/dist/assets/{ImagePreview-Bg_4MANc.js → ImagePreview-oKVovOna.js} +1 -1
- package/dist/assets/{ImageWrapper-DKVJ7ct4.js → ImageWrapper-CP1kri33.js} +1 -1
- package/dist/assets/{Index-CQkvvl35.js → Index-B6f_3k0F.js} +1 -1
- package/dist/assets/Index-BAOfgVc-.js +1 -0
- package/dist/assets/{Index-CcFKdQ35.js → Index-BIjYFMTS.js} +1 -1
- package/dist/assets/{Index-DKFIus8J.js → Index-BQChb1wW.js} +1 -1
- package/dist/assets/{Index-CtCOztTl.js → Index-Blu7kuxy.js} +2 -2
- package/dist/assets/Index-BnHFnhyQ.js +1 -0
- package/dist/assets/Index-C6NFEU_E.js +1 -0
- package/dist/assets/Index-CCQf3sHf.js +1 -0
- package/dist/assets/{Index-CODu-Lbe.js → Index-CI20mwJ5.js} +1 -1
- package/dist/assets/{Index-BoTUcjL-.js → Index-CV6Cik9T.js} +1 -1
- package/dist/assets/Index-CWEZ_TF8.js +1 -0
- package/dist/assets/Index-CeXQ5dsP.js +1 -0
- package/dist/assets/Index-CifEXRAm.js +1 -0
- package/dist/assets/Index-CobtPxq_.js +1 -0
- package/dist/assets/Index-Cqk75F8h.js +1 -0
- package/dist/assets/Index-DZzk-QeZ.js +1 -0
- package/dist/assets/Index-UqK4lb4L.js +1 -0
- package/dist/assets/Index-fjn8EiBJ.js +1 -0
- package/dist/assets/Index-g0ljrUNA.js +1 -0
- package/dist/assets/Index-gCuDVw_N.js +1 -0
- package/dist/assets/Index-mxdbECrG.js +1 -0
- package/dist/assets/Index-utxWAl4x.js +1 -0
- package/dist/assets/Index-uyPl8Nwp.js +1 -0
- package/dist/assets/{Index-DJ_qkqwO.js → Index-zg8V1ne0.js} +1 -1
- package/dist/assets/{Invitees-BQLq8RNK.js → Invitees-YSg8f6Qo.js} +1 -1
- package/dist/assets/{List-Cf9VMV0o.js → List-BUgmnGbP.js} +1 -1
- package/dist/assets/{List-Dm_dD6Pf.js → List-vKcd7tqF.js} +1 -1
- package/dist/assets/List-xXrTRwy0.js +1 -0
- package/dist/assets/Main-DXNpDRFO.js +1 -0
- package/dist/assets/{Navigator-DXXnGXkm.js → Navigator-CCFRjxYm.js} +1 -1
- package/dist/assets/{NoTasks-t-Nyk8v6.js → NoTasks-B-Z39N58.js} +1 -1
- package/dist/assets/{NotFound-jRGoEa55.js → NotFound-B4TK7gfs.js} +1 -1
- package/dist/assets/{OAuthCallback-BvoZu4Ol.js → OAuthCallback-BsBu50ob.js} +1 -1
- package/dist/assets/Pagination-Dh2p1EBn.js +1 -0
- package/dist/assets/Status-CUDuRYJW.js +1 -0
- package/dist/assets/Subscribe-9oySteAY.js +1 -0
- package/dist/assets/{VideoPlayer-DpOpCmlr.js → VideoPlayer-6MQ9sdIK.js} +1 -1
- package/dist/assets/_Uint8Array-yXrjWRgc.js +1 -0
- package/dist/assets/{_baseClone-DsJpkaTJ.js → _baseClone-BVstWSsi.js} +1 -1
- package/dist/assets/_baseIteratee-VgBkxc5c.js +1 -0
- package/dist/assets/_initCloneObject-ClZfVK4X.js +1 -0
- package/dist/assets/{add-BJi839SV.js → add-BZVpaynG.js} +1 -1
- package/dist/assets/{all-wallets-B2nEWvHE.js → all-wallets-D4SY2J-U.js} +1 -1
- package/dist/assets/{app-store-DQv6_Igb.js → app-store-DdK99FBK.js} +1 -1
- package/dist/assets/{apple-A1IdIeZ8.js → apple-B8881PDR.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-DtEY3c-v.js → arrow-bottom-circle-CwuF-nNI.js} +1 -1
- package/dist/assets/{arrow-bottom-BBJDi1Ji.js → arrow-bottom-rFdQoX0u.js} +1 -1
- package/dist/assets/{arrow-left-DplYfvXi.js → arrow-left-Bql6tiQ4.js} +1 -1
- package/dist/assets/{arrow-right-CdItrgJO.js → arrow-right-NEhzXUUA.js} +1 -1
- package/dist/assets/{arrow-top-CIxLNuyR.js → arrow-top-Cfpwd8Ix.js} +1 -1
- package/dist/assets/{avatar-B8gOg0rm.js → avatar-DCRaNRrU.js} +1 -1
- package/dist/assets/{bank-CkDX87RM.js → bank-CZzQhA0v.js} +1 -1
- package/dist/assets/{basic-wgmNqMQC.js → basic-DcHUnVsl.js} +1 -1
- package/dist/assets/{browser-BECYdLav.js → browser-GlZ0fS6I.js} +1 -1
- package/dist/assets/{byokCredential-CksBBmxL.js → byokCredential-D4aIqzYx.js} +1 -1
- package/dist/assets/{card-BVm7I4uQ.js → card-BR6aVLJQ.js} +1 -1
- package/dist/assets/{castArray-TnTy8FCf.js → castArray-BriRWb3C.js} +1 -1
- package/dist/assets/{chat-BrGSNOAP.js → chat-Ct28MdF6.js} +1 -1
- package/dist/assets/{checkmark-Cy0zlmmQ.js → checkmark-DyM8QxzE.js} +1 -1
- package/dist/assets/{checkmark-bold-CzguMPkI.js → checkmark-bold-DSAkWWbH.js} +1 -1
- package/dist/assets/{chevron-bottom-DNIhAWI7.js → chevron-bottom-Dnq-Rnm3.js} +1 -1
- package/dist/assets/{chevron-left-CDrpu-bq.js → chevron-left-Brp-805H.js} +1 -1
- package/dist/assets/{chevron-right-BelvhNkU.js → chevron-right-Dn-7Tevv.js} +1 -1
- package/dist/assets/{chevron-top-DHe1c75-.js → chevron-top-R2oN9TQ2.js} +1 -1
- package/dist/assets/{chrome-store-B4C9o6jy.js → chrome-store-ByHhiTTs.js} +1 -1
- package/dist/assets/{clock-DPLsWpHv.js → clock-B3Z4QBYS.js} +1 -1
- package/dist/assets/{close-BoQGvCDW.js → close-wZqSMpJ5.js} +1 -1
- package/dist/assets/{coinPlaceholder-ba9-tEKA.js → coinPlaceholder-nExzEsCx.js} +1 -1
- package/dist/assets/{compass-CqfE3hOQ.js → compass-BwzIgnOk.js} +1 -1
- package/dist/assets/{copy-Q-lsd-9l.js → copy-Dyl66nKd.js} +1 -1
- package/dist/assets/createTaskActions-CU4qQnIW.js +1 -0
- package/dist/assets/{cursor-transparent-DPL8havG.js → cursor-transparent-z7Bx4LkZ.js} +1 -1
- package/dist/assets/{cursor-BEORwjMu.js → cursor-uVOKud2k.js} +1 -1
- package/dist/assets/{debounce-CJZlaJSw.js → debounce-4A6U1So0.js} +1 -1
- package/dist/assets/{desktop-zaFGdbHl.js → desktop-zdWzl8HN.js} +1 -1
- package/dist/assets/{disconnect-DakeB3a9.js → disconnect-Cii3Imij.js} +1 -1
- package/dist/assets/{discord-CuY4XvUj.js → discord-DlCarF8P.js} +1 -1
- package/dist/assets/{distribution-DZlqyfeA.js → distribution-CsndrW5H.js} +1 -1
- package/dist/assets/{dropdown-DV2zOuyp.js → dropdown-BFrF5bX-.js} +1 -1
- package/dist/assets/{etherscan-Mw4NwTGp.js → etherscan-CcRVKpCq.js} +1 -1
- package/dist/assets/{exclamation-triangle-CdYP47hR.js → exclamation-triangle-B6_8ALl9.js} +1 -1
- package/dist/assets/{extension-BhAaMxGW.js → extension-BpY7b6PX.js} +1 -1
- package/dist/assets/{external-link-C88uJY7B.js → external-link-BvRr3TNN.js} +1 -1
- package/dist/assets/{facebook-BiEjTXKr.js → facebook-pgvq8oSq.js} +1 -1
- package/dist/assets/{farcaster-BAVNIdGS.js → farcaster-CQ1hc-WU.js} +1 -1
- package/dist/assets/{filters-qKl7YAPd.js → filters-Buwejpsz.js} +1 -1
- package/dist/assets/{github-DZvWOrJ9.js → github-DFNv1EVt.js} +1 -1
- package/dist/assets/{google-BNabQhh6.js → google-ZMUxz2T1.js} +1 -1
- package/dist/assets/{help-circle-x7-do3xz.js → help-circle-CHzvv45U.js} +1 -1
- package/dist/assets/{id-DrftRvTu.js → id-Dd31vKSO.js} +1 -1
- package/dist/assets/{image-BsenEtTZ.js → image-Mt55IY7t.js} +1 -1
- package/dist/assets/index--ymKFTY3.js +1 -0
- package/dist/assets/{index-kxM-uBwN.js → index-72lWSKXT.js} +1 -1
- package/dist/assets/index-94KpVqIp.js +1 -0
- package/dist/assets/index-B1LK_Bte.js +1 -0
- package/dist/assets/{index-CY478nhU.js → index-B36A8oMR.js} +1 -1
- package/dist/assets/index-B3G8wlqd.js +6 -0
- package/dist/assets/index-B92EsGM7.js +1 -0
- package/dist/assets/{index-CQuDdqyQ.js → index-BC5O4cBp.js} +1 -1
- package/dist/assets/{index-C-g8alJ1.js → index-BJacr6pl.js} +1 -1
- package/dist/assets/index-BO8lvgxo.js +1 -0
- package/dist/assets/index-BWRB2N9a.js +1 -0
- package/dist/assets/index-BZbOC1aH.js +1 -0
- package/dist/assets/{index-B8UzzWOK.js → index-Bkl6psGS.js} +1 -1
- package/dist/assets/{index-B-3bpbrW.js → index-BmKJdKX7.js} +1 -1
- package/dist/assets/index-Bt2gaRJ8.js +1 -0
- package/dist/assets/index-BzX0AJFl.js +1 -0
- package/dist/assets/index-C5mm4Ul4.js +1 -0
- package/dist/assets/index-C8DB3jho.js +1 -0
- package/dist/assets/index-C8VHl5rI.js +1 -0
- package/dist/assets/index-CB3VcJIN.js +1 -0
- package/dist/assets/{index-C8Q5dZvo.js → index-CCPTa97Y.js} +5 -5
- package/dist/assets/{index-BCChxDUd.js → index-CH624IiN.js} +1 -1
- package/dist/assets/{index-BqaautDS.js → index-CJHjCuCF.js} +1 -1
- package/dist/assets/{index-D_vMdvZ6.js → index-CJkudRsQ.js} +1 -1
- package/dist/assets/index-CQlsnJWW.js +1 -0
- package/dist/assets/index-CQxvolFQ.js +1 -0
- package/dist/assets/index-CRH2Cm9r.js +1 -0
- package/dist/assets/{index-BDUUWpA9.js → index-CgASjiIt.js} +1 -1
- package/dist/assets/{index-CtCHxxgE.js → index-CqopKWmx.js} +1 -1
- package/dist/assets/index-CuuZTUD5.js +1 -0
- package/dist/assets/index-D-si2sYc.js +1 -0
- package/dist/assets/{index-BNHrcREZ.js → index-D0sD9s3K.js} +1 -1
- package/dist/assets/index-D5JbrcHw.js +1 -0
- package/dist/assets/index-DCMJXdAH.js +1 -0
- package/dist/assets/{index-BIXkQkpn.js → index-DHFruKtB.js} +1 -1
- package/dist/assets/{index-DhyX8RK7.js → index-DPMnhmUj.js} +1 -1
- package/dist/assets/{index-CSsR-5G0.js → index-DRlwGKKR.js} +2 -2
- package/dist/assets/index-DSDL2TZm.js +1 -0
- package/dist/assets/index-DSQbC5ag.js +1 -0
- package/dist/assets/index-DUcr29Yw.js +1 -0
- package/dist/assets/index-DUgv8yNP.js +1 -0
- package/dist/assets/{index-BYhmWwMJ.js → index-DV2274e1.js} +1 -1
- package/dist/assets/{index-D9gfzD0d.js → index-DWKXJA_s.js} +1 -1
- package/dist/assets/index-DXVZYDaN.js +1 -0
- package/dist/assets/index-D_6Q6_hh.js +1 -0
- package/dist/assets/index-DbixaZn4.js +1 -0
- package/dist/assets/{index-C_-XxAWi.js → index-Diq2ZvhU.js} +1 -1
- package/dist/assets/index-DkY2Nfkn.js +1 -0
- package/dist/assets/index-DorrEU0d.js +1 -0
- package/dist/assets/index-Dtr8XpYQ.js +1 -0
- package/dist/assets/{index-DaTUtZCn.js → index-DvRp2u5y.js} +1 -1
- package/dist/assets/index-DvexfW2p.js +1 -0
- package/dist/assets/index-G0pQZCwm.js +1 -0
- package/dist/assets/{index-B26B3NRe.js → index-RKA7vcxG.js} +14 -14
- package/dist/assets/{index-BXXrwsD3.js → index-S60kU_7G.js} +2 -2
- package/dist/assets/index-ivi4l0FC.js +1 -0
- package/dist/assets/index-jeHN0aXR.js +1 -0
- package/dist/assets/{index-34n2Rkz4.js → index-kLUPyLRT.js} +1 -1
- package/dist/assets/{index-2l2HfBAG.js → index-nYGIzX0n.js} +1 -1
- package/dist/assets/{index-BQrDrMsg.js → index-qg6p-PEz.js} +3 -3
- package/dist/assets/{index.browser.esm-Cx59cflo.js → index.browser.esm-DyqiiqXv.js} +3 -3
- package/dist/assets/{index.es-C1Vw5-pU.js → index.es-Bt64eLCe.js} +1 -1
- package/dist/assets/{info-CB5svU1L.js → info-DNyDjHxN.js} +1 -1
- package/dist/assets/{info-circle-DLoERJRV.js → info-circle-CeY7VYc4.js} +1 -1
- package/dist/assets/{isEqual-7sLqoZ1L.js → isEqual-CxrfphK6.js} +1 -1
- package/dist/assets/{isPlainObject-Ct-jhvvz.js → isPlainObject-DYB82xcc.js} +1 -1
- package/dist/assets/{lightbulb-C99KZWw6.js → lightbulb-DWyYKlR7.js} +1 -1
- package/dist/assets/{mail-BlX82MeJ.js → mail-y5PcsuIl.js} +1 -1
- package/dist/assets/{midjourney-Bt9SwJ7S.js → midjourney-B-NiEd3S.js} +1 -1
- package/dist/assets/{mobile-QFOK14eu.js → mobile-DUuRyoz6.js} +1 -1
- package/dist/assets/{more-D6qxWF9W.js → more-Cu85qPJb.js} +1 -1
- package/dist/assets/{network-placeholder-xzS8m44W.js → network-placeholder-D-FyPiq3.js} +1 -1
- package/dist/assets/{nftPlaceholder-Ba4X6sGx.js → nftPlaceholder-BTzxX8zD.js} +1 -1
- package/dist/assets/{off-B5h8jjGL.js → off-ZcbSXmuy.js} +1 -1
- package/dist/assets/{order-C-AU0yGl.js → order-Blt7agKU.js} +1 -1
- package/dist/assets/{pagination-DcHHH5aU.js → pagination-Bsrwz5HQ.js} +1 -1
- package/dist/assets/pika-DpzVVVef.js +1 -0
- package/dist/assets/{play-store-D3byY3WP.js → play-store-Cf9cFLTO.js} +1 -1
- package/dist/assets/{plus-CUXunYBW.js → plus-CWiwLjw9.js} +1 -1
- package/dist/assets/{price-B76rlcGM.js → price-C4efiJpu.js} +1 -1
- package/dist/assets/{producer-TjBWKhZK.js → producer-DBr66fzd.js} +1 -1
- package/dist/assets/{qr-code-Dn3jrHJG.js → qr-code-CWYX4NBz.js} +1 -1
- package/dist/assets/qrart-C9yTZSh5.js +1 -0
- package/dist/assets/{recycle-horizontal-B-hYTNGc.js → recycle-horizontal-DiaJP3xI.js} +1 -1
- package/dist/assets/{refresh-Cf-Wzncr.js → refresh-BQtgHldl.js} +1 -1
- package/dist/assets/{reown-logo-hTLaX6IV.js → reown-logo-CUSx4SCj.js} +1 -1
- package/dist/assets/{search-D93I8tsf.js → search-DZ056JFa.js} +1 -1
- package/dist/assets/{secp256k1-C2kADhus.js → secp256k1-P0GVLqjY.js} +1 -1
- package/dist/assets/{secp256k1-CCjOIA2X.js → secp256k1-cZz2TUN6.js} +1 -1
- package/dist/assets/{seedream--KzRDA8F.js → seedream-BQAd-akf.js} +1 -1
- package/dist/assets/{send-BTNZdCR0.js → send-BxVbCMnD.js} +1 -1
- package/dist/assets/{service-DTe2kk8b.js → service-CS_tTi1s.js} +1 -1
- package/dist/assets/{solana-wallets-C7qi12W2.js → solana-wallets-Cqfynxec.js} +2 -2
- package/dist/assets/{solana-wallets-vue-C36f0RVv.js → solana-wallets-vue-BWamnaGz.js} +1 -1
- package/dist/assets/{suno-DLKmpYS6.js → suno-Dt-pL4du.js} +1 -1
- package/dist/assets/{swapHorizontal-ZTSCr7Tf.js → swapHorizontal-DxtTka3U.js} +1 -1
- package/dist/assets/{swapHorizontalBold-3xhkU-o-.js → swapHorizontalBold-C91tsNTH.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-Dqz2NSLL.js → swapHorizontalMedium-r-vP5eQN.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-B4outoeR.js → swapHorizontalRoundedBold-CxOAGy5t.js} +1 -1
- package/dist/assets/{swapVertical-B15ESwWE.js → swapVertical-BJGYg1c6.js} +1 -1
- package/dist/assets/{telegram-C3PGRjY_.js → telegram-C7ZBAeAz.js} +1 -1
- package/dist/assets/{three-dots-rNeoL-0B.js → three-dots-lIiTztJP.js} +1 -1
- package/dist/assets/{twitch-D9HUTTm3.js → twitch-Dgkvt8Hz.js} +1 -1
- package/dist/assets/{twitterIcon-CLhBopX6.js → twitterIcon-CmrA1-K8.js} +1 -1
- package/dist/assets/typescript-CZIRg0iX.js +1 -0
- package/dist/assets/{use-form-item-efgym_Md.js → use-form-item-Mz_lqNZY.js} +1 -1
- package/dist/assets/validator-BYOWCr9W.js +1 -0
- package/dist/assets/{verify-BQgXUE3o.js → verify-DYHLq0T9.js} +1 -1
- package/dist/assets/{verify-filled-1PZ6HKWd.js → verify-filled-4C6XlTyD.js} +1 -1
- package/dist/assets/{w3m-modal-DU2YB6Lr.js → w3m-modal-D6Hr0-xV.js} +1 -1
- package/dist/assets/{wallet-placeholder-CFZl5bLv.js → wallet-placeholder-_JLUjVoS.js} +1 -1
- package/dist/assets/{wallet-0fcteItf.js → wallet-wBUo5f8z.js} +1 -1
- package/dist/assets/{walletconnect-2_xaUe3Y.js → walletconnect-7vlKsEBe.js} +1 -1
- package/dist/assets/{warning-circle-Bwit4ykS.js → warning-circle-BtGmUpRX.js} +1 -1
- package/dist/assets/{web-CrzESj6z.js → web-BIz41RbW.js} +1 -1
- package/dist/assets/{web-CAGItaY8.js → web-xbiSDWpO.js} +1 -1
- package/dist/assets/{x-Cpz96MpH.js → x-yFtP-aPn.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Console-CbYuOHCk.js +0 -1
- package/dist/assets/Extra-Boc7BZ5Z.js +0 -1
- package/dist/assets/Index-5bq31Ev3.js +0 -1
- package/dist/assets/Index-B9G7ENiu.js +0 -1
- package/dist/assets/Index-BIuPs9K4.js +0 -1
- package/dist/assets/Index-BO8kBH-E.js +0 -1
- package/dist/assets/Index-BRmefocC.js +0 -1
- package/dist/assets/Index-BzYoa2nP.js +0 -1
- package/dist/assets/Index-C5PXBYfG.js +0 -1
- package/dist/assets/Index-CEQ7gIcq.js +0 -1
- package/dist/assets/Index-COneRfiv.js +0 -1
- package/dist/assets/Index-CP5k7VDj.js +0 -1
- package/dist/assets/Index-CaTBj0f0.js +0 -1
- package/dist/assets/Index-CthlSliP.js +0 -1
- package/dist/assets/Index-CwxqROK3.js +0 -1
- package/dist/assets/Index-D97A_umJ.js +0 -1
- package/dist/assets/Index-DcB0per_.js +0 -1
- package/dist/assets/Index-DhMzZuZj.js +0 -1
- package/dist/assets/Index-NaA26IGI.js +0 -1
- package/dist/assets/List-0mdKpx24.js +0 -1
- package/dist/assets/Main-CAl8EpBs.js +0 -1
- package/dist/assets/Pagination-DB9twOQI.js +0 -1
- package/dist/assets/Status-B_AYkhMM.js +0 -1
- package/dist/assets/Subscribe-vhYNhjV3.js +0 -1
- package/dist/assets/_Uint8Array-CIOAkFC8.js +0 -1
- package/dist/assets/_baseIteratee-y4F6_vaP.js +0 -1
- package/dist/assets/_initCloneObject--BkHfMCz.js +0 -1
- package/dist/assets/flux-D4BMGuWl.js +0 -1
- package/dist/assets/hailuo-DTLZcEUj.js +0 -1
- package/dist/assets/headshots-ikuv5nSy.js +0 -1
- package/dist/assets/index-36v1qVMv.js +0 -1
- package/dist/assets/index-B0A9C_-T.js +0 -1
- package/dist/assets/index-BGxp6OcW.js +0 -1
- package/dist/assets/index-BHzEr62G.js +0 -1
- package/dist/assets/index-BX4hurF9.js +0 -1
- package/dist/assets/index-BpKb-LSQ.js +0 -1
- package/dist/assets/index-Br5MWYkC.js +0 -1
- package/dist/assets/index-BtlinT_z.js +0 -1
- package/dist/assets/index-Bwap6Ldi.js +0 -1
- package/dist/assets/index-C-elEvQD.js +0 -1
- package/dist/assets/index-C40tNgF7.js +0 -1
- package/dist/assets/index-CF81VrvH.js +0 -1
- package/dist/assets/index-CI0nnbeu.js +0 -1
- package/dist/assets/index-CM53b4qu.js +0 -1
- package/dist/assets/index-CP58CVoz.js +0 -6
- package/dist/assets/index-CP8zORPR.js +0 -1
- package/dist/assets/index-CUvAZ3E0.js +0 -1
- package/dist/assets/index-CdKre72y.js +0 -1
- package/dist/assets/index-CeTdGr2-.js +0 -1
- package/dist/assets/index-D4p433Al.js +0 -1
- package/dist/assets/index-DHVwu-o_.js +0 -1
- package/dist/assets/index-DHbDN_k6.js +0 -1
- package/dist/assets/index-DKcnyM7y.js +0 -1
- package/dist/assets/index-DTGuhQIY.js +0 -1
- package/dist/assets/index-DgrmBeuw.js +0 -1
- package/dist/assets/index-MLK9z2al.js +0 -1
- package/dist/assets/index-UvZyD52G.js +0 -1
- package/dist/assets/index-WKh8tSM-.js +0 -1
- package/dist/assets/index-Y6InDSnm.js +0 -1
- package/dist/assets/index-Y6ecN3tB.js +0 -1
- package/dist/assets/index-f3A5WlbC.js +0 -1
- package/dist/assets/index-gYSEitMi.js +0 -1
- package/dist/assets/index-qKL3nmNJ.js +0 -1
- package/dist/assets/index-s1aJT5Lx.js +0 -1
- package/dist/assets/index-s4nuUgXJ.js +0 -1
- package/dist/assets/kling-vQvgGJWZ.js +0 -1
- package/dist/assets/luma-CFUwmRof.js +0 -1
- package/dist/assets/nanobanana-CC54XPie.js +0 -1
- package/dist/assets/openaiimage-CYu0XX-Y.js +0 -1
- package/dist/assets/pika-BY0m19Bk.js +0 -1
- package/dist/assets/pixverse-NTb6NgdU.js +0 -1
- package/dist/assets/qrart-0CTb9tcf.js +0 -1
- package/dist/assets/seedance-BtToQQt8.js +0 -1
- package/dist/assets/sora-CQKJmZbI.js +0 -1
- package/dist/assets/typescript-DilvQCGQ.js +0 -1
- package/dist/assets/validator-DuPh5qwz.js +0 -1
- package/dist/assets/veo-DMJuvLwk.js +0 -1
- package/dist/assets/wan-CHprjKEA.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as D}from"./index.es-C1Vw5-pU.js";import{E as W}from"./index-BX4hurF9.js";import{E as se}from"./index-CtCHxxgE.js";import{d as b,H as c,E as o,z as B,C as s,y as d,D as r,q as n,F as a,O as G,N as q,J as f,x as v,I as U,G as R,K as H,M as P,u as A,c as T,w as ne,L as re}from"./vendor-vue-NSDaktjZ.js";import{E as V,b7 as ie,ef as Y,eg as Q,S as K,H as ae,aw as L,ce as te,eh as Z,ei as le,cd as ce,a7 as de}from"./index-B26B3NRe.js";import{a as ue}from"./errorCode-Cqj9Td_Z.js";import{p as I}from"./producer-TjBWKhZK.js";import{b as pe}from"./producer-DP85fuAq.js";import{E as me}from"./index-C-elEvQD.js";import{E as fe,a as he}from"./index-BGxp6OcW.js";import{I as F,S as _e,l as $e}from"./pagination-DcHHH5aU.js";import{E as ge}from"./index-DHVwu-o_.js";import{E as w}from"./index-kxM-uBwN.js";import{E as z}from"./index-s4nuUgXJ.js";import{u as j,F as ve,O as ye,_ as ee,P as ke,a as be,V as we,E as Ce}from"./IconPark.vue_vue_type_script_setup_true_lang-3ysMralK.js";import{E as X}from"./index-C_-XxAWi.js";import{E as N}from"./index-MLK9z2al.js";import{E as Ve,a as Se}from"./index-2l2HfBAG.js";import{E as x}from"./index-34n2Rkz4.js";import{E as Ue,a as Ee}from"./index-WKh8tSM-.js";import{C as Pe}from"./Consumption-BrRTFprj.js";import{a as Ae}from"./price-B76rlcGM.js";import{E as Te,b as Fe,a as Ie}from"./index-CM53b4qu.js";import{E as Le}from"./index-Y6ecN3tB.js";import{E as Ge}from"./index-BDUUWpA9.js";import{N as je}from"./NoTasks-t-Nyk8v6.js";import{a as De,E as Re}from"./index-f3A5WlbC.js";import"./use-form-item-efgym_Md.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-DuPh5qwz.js";import"./index-Y6InDSnm.js";import"./index-D_vMdvZ6.js";import"./typescript-DilvQCGQ.js";import"./strings-beZM2Y-f.js";import"./isEqual-7sLqoZ1L.js";import"./_Uint8Array-CIOAkFC8.js";import"./castArray-TnTy8FCf.js";import"./debounce-CJZlaJSw.js";import"./_baseIteratee-y4F6_vaP.js";import"./index-DaTUtZCn.js";import"./index-CP58CVoz.js";import"./_baseClone-DsJpkaTJ.js";import"./_initCloneObject--BkHfMCz.js";import"./index-BCChxDUd.js";import"./index-Cu41y2Fl.js";import"./index-B-3bpbrW.js";import"./dropdown-DV2zOuyp.js";const Ze=b({name:"LayoutProducer",components:{ElDrawer:se,ElButton:W,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),ze={class:"main flex flex-row flex-1"},Ne={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Me={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},Oe={class:"preview h-full w-[300px] flex flex-col"};function Be(e,t,l,i,h,p){const u=r("font-awesome-icon"),m=r("el-button"),_=r("el-drawer");return n(),c("div",ze,[o("div",Ne,[B(e.$slots,"config",{},void 0,!0)]),o("div",Me,[B(e.$slots,"result",{},void 0,!0)]),o("div",Oe,[B(e.$slots,"preview",{},void 0,!0)]),s(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:d(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[B(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const qe=V(Ze,[["render",Be],["__scopeId","data-v-7453886f"]]),We=b({name:"TypeSelector",components:{ElSelect:he,ElOption:fe,ElSwitch:me},data(){return{options:[{label:"FUZZ-2.0 Pro",value:"FUZZ-2.0 Pro",info:"8 min"},{label:"FUZZ-2.0",value:"FUZZ-2.0",info:"8 min"},{label:"FUZZ-2.0 Raw",value:"FUZZ-2.0 Raw",info:"8 min"},{label:"FUZZ-1.1 Pro",value:"FUZZ-1.1 Pro",info:"4 min"},{label:"FUZZ-1.0 Pro",value:"FUZZ-1.0 Pro",info:"4 min"},{label:"FUZZ-1.1",value:"FUZZ-1.1",info:"4 min"},{label:"FUZZ-1.0",value:"FUZZ-1.0",info:"2 min"},{label:"FUZZ-0.8",value:"FUZZ-0.8",info:"2 min"}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||(this.model=pe)}}),He={class:"flex items-center justify-between mb-3"},Ke={class:"text-sm font-bold"},Je={class:"mb-3"},Ye={class:"flex items-center mb-1"},Qe={class:"text-sm font-bold"},Xe={class:"flex items-center justify-between w-full"},xe={class:"text-xs text-[var(--el-text-color-placeholder)]"},et={key:0,class:"flex items-center justify-between mb-3"},tt={class:"text-sm font-bold"};function ot(e,t,l,i,h,p){const u=r("el-switch"),m=r("el-option"),_=r("el-select");return n(),c("div",null,[o("div",He,[o("span",Ke,a(e.$t("producer.name.type")),1),s(u,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=$=>e.custom=$)},null,8,["modelValue"])]),o("div",Je,[o("div",Ye,[o("span",Qe,a(e.$t("producer.name.model")),1)]),s(_,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=$=>e.model=$),class:"w-full",size:"default",placeholder:e.$t("producer.placeholder.select")},{default:d(()=>[(n(!0),c(G,null,q(e.options,$=>(n(),v(m,{key:$.value,label:$.label,value:$.value},{default:d(()=>[o("div",Xe,[o("span",null,a($.label),1),o("span",xe,a($.info),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),c("div",et,[o("span",tt,a(e.$t("producer.name.instrumental")),1),s(u,{modelValue:e.instrumental,"onUpdate:modelValue":t[2]||(t[2]=$=>e.instrumental=$)},null,8,["modelValue"])])):f("",!0)])}const st=V(We,[["render",ot]]),nt=b({name:"UploadAudio",components:{ElUpload:ge,ElButton:W,InfoIcon:F,FontAwesomeIcon:D},emits:["change"],data(){return{fileList:[],uploadUrl:ie()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.producer?.config?.audio_id},set(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){w.warning(this.$t("producer.message.uploadReferencesExceed"))},onError(){w.error(this.$t("producer.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},l=this.credential?.token;if(!l){console.error("no token specified");return}w.info(this.$t("producer.message.startingUploadAudio")),I.upload(t,{token:l}).then(i=>{console.debug("get upload music success",i.data);const h=i.data?.data.audio_id;this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,audio_id:h,action:"upload_extend"}),w.success(this.$t("producer.message.startUploadAudioSuccess"))}).catch(i=>{w.error(i?.response?.data?.error?.message||this.$t("producer.message.startUploadAudioFailed"))})},onSetAudio(){}}}),rt={class:"relative"},it={class:"flex justify-between"},at={class:"flex justify-start items-center"},lt={class:"text-sm font-bold"};function ct(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-upload");return n(),c("div",rt,[o("div",it,[o("div",at,[o("span",lt,a(e.$t("producer.name.referenceAudios")),1),s(u,{content:e.$t("producer.description.uploadAudios")},null,8,["content"])])]),s($,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=k=>e.fileList=k),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:d(()=>[s(_,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:d(()=>[s(m,{icon:"fa-solid fa-upload",class:"icon mr-1"}),U(" "+a(e.$t("producer.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const dt=V(nt,[["render",ct],["__scopeId","data-v-e4cd0467"]]),ut="",pt=b({name:"PromptInput",components:{ElInput:z,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ut)}}),mt={class:"field"},ft={class:"flex items-center mb-1"},ht={class:"text-sm font-bold"};function _t(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",mt,[o("div",ft,[o("span",ht,a(e.$t("producer.name.songDescription")),1),s(u,{content:e.$t("producer.description.prompt")},null,8,["content"])]),s(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=_=>e.prompt=_),rows:4,type:"textarea",placeholder:e.$t("producer.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const $t=V(pt,[["render",_t]]),gt="",vt=b({name:"LyricInput",components:{ElInput:z,ElButton:W,FontAwesomeIcon:D,InfoIcon:F},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential}},mounted(){this.lyric||(this.lyric=gt)},methods:{async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,w.info(this.$t("producer.message.generatingLyrics"));try{const i=(await I.lyric({prompt:t},{token:e})).data?.data;i?.text&&(this.lyric=i.text,i?.title&&!this.config?.title&&this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:i.text,title:i.title}),w.success(this.$t("producer.message.generateLyricsSuccess")))}catch{w.error(this.$t("producer.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),yt={class:"field"},kt={class:"flex items-center justify-between mb-1"},bt={class:"flex items-center"},wt={class:"text-sm font-bold"};function Ct(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-input");return n(),c("div",yt,[o("div",kt,[o("div",bt,[o("span",wt,a(e.$t("producer.name.lyrics")),1),s(u,{content:e.$t("producer.description.lyrics")},null,8,["content"])]),e.config?.action!=="extend"?(n(),v(_,{key:0,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:d(()=>[e.generatingLyrics?f("",!0):(n(),v(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),U(" "+a(e.$t("producer.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):f("",!0)]),e.config?.action!=="extend"?(n(),v($,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),v($,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"]))])}const Vt=V(vt,[["render",Ct],["__scopeId","data-v-88c6da2b"]]),St=b({name:"StyleInput",components:{ElInput:z,InfoIcon:F},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style:e})}}}}),Ut={class:"field"},Et={class:"flex items-center justify-between mb-1"},Pt={class:"flex items-center"},At={class:"text-sm font-bold"};function Tt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Ut,[o("div",Et,[o("div",Pt,[o("span",At,a(e.$t("producer.name.style")),1),s(u,{content:e.$t("producer.description.style")},null,8,["content"])])]),s(m,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=_=>e.style=_),rows:2,type:"textarea",placeholder:e.$t("producer.placeholder.style")},null,8,["modelValue","placeholder"])])}const Ft=V(St,[["render",Tt]]),It=b({name:"TitleInput",components:{ElInput:z,InfoIcon:F},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,title:e})}}}}),Lt={class:"field"},Gt={class:"flex items-center mb-1"},jt={class:"text-sm font-bold"};function Dt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Lt,[o("div",Gt,[o("span",jt,a(e.$t("producer.name.title")),1),s(u,{content:e.$t("producer.description.title")},null,8,["content"])]),s(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=_=>e.title=_),placeholder:e.$t("producer.placeholder.title")},null,8,["modelValue","placeholder"])])}const Rt=V(It,[["render",Dt]]),Zt=b({name:"ExtendFromInput",components:{ElImage:N,ElIcon:K,ElInputNumber:X,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),zt={class:"field"},Nt={class:"box"},Mt={class:"title font-bold"},Ot={class:"input-wrapper"},Bt={class:"task"},qt={class:"left"},Wt={key:2,class:"duration"},Ht={class:"info"},Kt={class:"title"},Jt={class:"style"};function Yt(e,t,l,i,h,p){const u=r("el-input-number"),m=r("el-image"),_=r("video-pause"),$=r("el-icon"),k=r("video-play"),y=H("loading");return n(),c("div",zt,[o("div",Nt,[o("h2",Mt,a(e.$t("producer.name.extend")),1),o("div",Ot,[s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=E=>e.value=E),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),o("div",Bt,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[3]||(t[3]=E=>e.onClick(e.audio))},[R((n(),c("div",qt,[s(m,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=E=>e.onPause(e.audio))},[s($,null,{default:d(()=>[s(_)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=E=>e.onPlay(e.audio))},[s($,null,{default:d(()=>[s(k)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",Wt,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[y,!e.audio?.audio_url]]),o("div",Ht,[o("h2",Kt,a(e.audio?.title),1),o("p",Jt,a(e.audio?.style),1)])])):f("",!0)])])}const Qt=V(Zt,[["render",Yt],["__scopeId","data-v-26d43480"]]),Xt=b({name:"CoverFromInput",components:{ElImage:N,ElIcon:K,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),xt={class:"field"},eo={class:"box"},to={class:"title font-bold"},oo={class:"task"},so={class:"left"},no={key:2,class:"duration"},ro={class:"info"},io={class:"title"},ao={class:"style"};function lo(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=H("loading");return n(),c("div",xt,[o("div",eo,[o("h2",to,a(e.$t("producer.name.cover")),1)]),o("div",oo,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[2]||(t[2]=y=>e.onClick(e.audio))},[R((n(),c("div",so,[s(u,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=y=>e.onPause(e.audio))},[s(_,null,{default:d(()=>[s(m)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=y=>e.onPlay(e.audio))},[s(_,null,{default:d(()=>[s($)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",no,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[k,!e.audio?.audio_url]]),o("div",ro,[o("h2",io,a(e.audio?.title),1),o("p",ao,a(e.audio?.style),1)])])):f("",!0)])])}const co=V(Xt,[["render",lo],["__scopeId","data-v-d8a8e583"]]),uo=b({name:"VocalGenderSelector",components:{ElRadioGroup:Se,ElRadioButton:Ve,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),po={class:"mb-2"},mo={class:"flex items-center mb-1"},fo={class:"text-sm font-bold"};function ho(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-radio-button"),_=r("el-radio-group");return n(),c("div",po,[o("div",mo,[o("span",fo,a(e.$t("producer.name.vocalGender")),1),s(u,{content:e.$t("producer.description.vocalGender")},null,8,["content"])]),s(_,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$)},{default:d(()=>[s(m,{value:""},{default:d(()=>[U(a(e.$t("producer.gender.auto")),1)]),_:1}),s(m,{value:"f"},{default:d(()=>[U(a(e.$t("producer.gender.female")),1)]),_:1}),s(m,{value:"m"},{default:d(()=>[U(a(e.$t("producer.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const _o=V(uo,[["render",ho]]),$o=b({name:"AdvancedParams",components:{ElCollapse:Ee,ElCollapseItem:Ue,ElInput:z,ElSlider:x,ElInputNumber:X},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??0},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,weirdness:e||void 0})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,seed:e})}}}}),go={key:0,class:"mb-3"},vo={class:"flex items-center mb-1"},yo={class:"text-xs font-bold"},ko={key:1,class:"mb-3"},bo={class:"flex items-center mb-1"},wo={class:"text-xs font-bold"},Co={key:2,class:"mb-3"},Vo={class:"flex items-center justify-between mb-1"},So={class:"text-xs font-bold"},Uo={class:"text-xs text-[var(--el-text-color-secondary)]"},Eo={key:3,class:"mb-3"},Po={class:"flex items-center justify-between mb-1"},Ao={class:"text-xs font-bold"},To={class:"text-xs text-[var(--el-text-color-secondary)]"},Fo={key:4,class:"mb-3"},Io={class:"flex items-center justify-between mb-1"},Lo={class:"text-xs font-bold"},Go={class:"text-xs text-[var(--el-text-color-secondary)]"},jo={key:5,class:"mb-3"},Do={class:"flex items-center mb-1"},Ro={class:"text-xs font-bold"};function Zo(e,t,l,i,h,p){const u=r("el-input"),m=r("el-slider"),_=r("el-input-number"),$=r("el-collapse-item"),k=r("el-collapse");return n(),v(k,{modelValue:e.activeNames,"onUpdate:modelValue":t[6]||(t[6]=y=>e.activeNames=y),class:"advanced-collapse"},{default:d(()=>[s($,{title:e.$t("producer.name.advancedParams"),name:"advanced"},{default:d(()=>[e.config?.custom?(n(),c("div",go,[o("div",vo,[o("span",yo,a(e.$t("producer.name.styleNegative")),1)]),s(u,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=y=>e.styleNegative=y),placeholder:e.$t("producer.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",ko,[o("div",bo,[o("span",wo,a(e.$t("producer.name.lyricPrompt")),1)]),s(u,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=y=>e.lyricPrompt=y),placeholder:e.$t("producer.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom?(n(),c("div",Co,[o("div",Vo,[o("span",So,a(e.$t("producer.name.weirdness")),1),o("span",Uo,a(e.weirdness??0),1)]),s(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=y=>e.weirdness=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",Eo,[o("div",Po,[o("span",Ao,a(e.$t("producer.name.soundStrength")),1),o("span",To,a(e.soundStrength??50),1)]),s(m,{modelValue:e.soundStrength,"onUpdate:modelValue":t[3]||(t[3]=y=>e.soundStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",Fo,[o("div",Io,[o("span",Lo,a(e.$t("producer.name.lyricsStrength")),1),o("span",Go,a(e.lyricsStrength??50),1)]),s(m,{modelValue:e.lyricsStrength,"onUpdate:modelValue":t[4]||(t[4]=y=>e.lyricsStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",jo,[o("div",Do,[o("span",Ro,a(e.$t("producer.name.seed")),1)]),s(_,{modelValue:e.seed,"onUpdate:modelValue":t[5]||(t[5]=y=>e.seed=y),min:0,controls:!1,placeholder:e.$t("producer.placeholder.seed"),class:"w-full"},null,8,["modelValue","placeholder"])])):f("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const zo=V($o,[["render",Zo],["__scopeId","data-v-88e65aee"]]),No=b({name:"ReplaceSectionInput",components:{ElInputNumber:X,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"})}}}),Mo={class:"field"},Oo={class:"flex items-center mb-2"},Bo={class:"text-sm font-bold m-0"},qo={key:0,class:"task mb-2"},Wo={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ho={class:"info flex-1 min-w-0"},Ko={class:"text-sm font-bold m-0 truncate"},Jo={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Yo={class:"flex gap-2"};function Qo(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-image"),_=r("el-input-number"),$=H("loading");return n(),c("div",Mo,[o("div",Oo,[o("h2",Bo,a(e.$t("producer.name.replaceSection")),1),s(u,{content:e.$t("producer.description.replaceSection")},null,8,["content"])]),e.audio?(n(),c("div",qo,[o("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[R((n(),c("div",Wo,[s(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),o("div",Ho,[o("h2",Ko,a(e.audio?.title),1),o("p",Jo,a(e.audio?.style),1)])])])):f("",!0),o("div",Yo,[s(_,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.replaceSectionStart=k),class:"flex-1",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),s(_,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.replaceSectionEnd=k),class:"flex-1",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Xo=V(No,[["render",Qo]]),xo=b({name:"PresetPanel",components:{TypeSelector:st,PromptInput:$t,LyricInput:Vt,StyleInput:Ft,TitleInput:Rt,ExtendFromInput:Qt,CoverFromInput:co,UploadAudio:dt,VocalGenderSelector:_o,AdvancedParams:zo,ReplaceSectionInput:Xo,FontAwesomeIcon:D,ElButton:W,Consumption:Pe},emits:["generate"],computed:{config(){return this.$store.state.producer?.config},consumption(){return Ae(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("producer.button.extend"):e==="cover"?this.$t("producer.button.cover_music"):e==="variation"?this.$t("producer.button.variation"):e==="replace_section"?this.$t("producer.button.replace_section"):e==="stems"?this.$t("producer.button.get_stems"):e==="swap_vocals"?this.$t("producer.button.swap_vocals"):e==="swap_instrumentals"?this.$t("producer.button.swap_instrumentals"):this.$t("producer.button.generate")}},methods:{onGenerate(){this.$emit("generate")}}}),es={class:"flex flex-col h-full"},ts={class:"flex-1 overflow-y-auto p-5"},os={class:"flex flex-col items-center justify-center px-5 pb-5"};function ss(e,t,l,i,h,p){const u=r("type-selector"),m=r("upload-audio"),_=r("prompt-input"),$=r("lyric-input"),k=r("style-input"),y=r("title-input"),E=r("vocal-gender-selector"),S=r("extend-from-input"),M=r("cover-from-input"),O=r("replace-section-input"),J=r("advanced-params"),g=r("consumption"),C=r("font-awesome-icon"),oe=r("el-button");return n(),c("div",es,[o("div",ts,[s(u,{class:"mb-4"}),s(m,{class:"mb-4"}),e.config?.custom?f("",!0):(n(),v(_,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(n(),v($,{key:1,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(k,{key:2,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(y,{key:3,class:"mb-4"})):f("",!0),e.config?.custom&&!e.config.instrumental?(n(),v(E,{key:4,class:"mb-4"})):f("",!0),e.config?.action==="extend"?(n(),v(S,{key:5,class:"mb-4"})):f("",!0),e.config?.action==="cover"?(n(),v(M,{key:6,class:"mb-4"})):f("",!0),e.config?.action==="replace_section"?(n(),v(O,{key:7,class:"mb-4"})):f("",!0),s(J,{class:"mb-4"})]),o("div",os,[s(g,{value:e.consumption,service:e.service},null,8,["value","service"]),s(oe,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(C,{icon:"fa-solid fa-magic",class:"mr-2"}),U(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])}const ns=V(xo,[["render",ss],["__scopeId","data-v-6642bb3c"]]),rs=te("producer"),is=b({name:"TaskPreview",components:{ElImage:N,ElIcon:K,ElTooltip:Le,FontAwesomeIcon:D,VideoPlay:Q,VideoPause:Y,ElDropdown:Ie,ElDropdownMenu:Fe,ElDropdownItem:Te,Loading:ae},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===L.Request},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(l=>({...l,action:t})):e},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.debug("set config",t),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e&&e.stopPropagation();const i=new URL(t).pathname,h=i.substring(i.lastIndexOf("/")+1);fetch(t).then(p=>p.blob()).then(p=>{ve.saveAs(p,h)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;const t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(t){console.error("get videoUrl failed:",t),w.error(this.$t("producer.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,l)=>{const i={audio_id:e},h=this.credential?.token;if(!h){console.error("no token specified"),l(new Error("No token specified"));return}I.video(i,{token:h}).then(p=>{const u=p.data?.data?.video_url;u?t(u):l(new Error("Video URL not found in response"))}).catch(p=>{l(p)})})},onPreview(e,t){e.stopPropagation(),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},onVariation(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:"variation",audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl("swap_vocals",e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl("swap_instrumentals",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"replace_section",audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("producer.message.fetchingWav"));const i=(await I.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;i?this.onDownload(null,i):w.error(this.$t("producer.message.fetchWavFailed"))}catch{w.error(this.$t("producer.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){const l={action:e,audio_id:t,callback_url:rs},i=this.credential?.token;if(!i){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),I.audio(l,{token:i}).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(h=>{w.error(h?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("producer/getTasks",{limit:30,offset:0})}}}),as={class:"task"},ls=["onClick"],cs={class:"left"},ds=["onClick"],us=["onClick"],ps={key:2,class:"duration"},ms={class:"info"},fs={class:"title"},hs={class:"style"},_s={class:"right"},$s={class:"el-dropdown-link"},gs={class:"flex items-center min-w-[120px]"},vs={class:"flex items-center min-w-[120px]"},ys={class:"el-dropdown-link"};function ks(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=r("font-awesome-icon"),y=r("el-tooltip"),E=r("Loading"),S=r("el-dropdown-item"),M=r("el-dropdown-menu"),O=r("el-dropdown"),J=H("loading");return n(),c("div",as,[(n(!0),c(G,null,q(e.audios,g=>(n(),c("div",{key:g.id,class:"audio",onClick:P(C=>e.onClick(g),["stop"])},[R((n(),c("div",cs,[s(u,{src:g?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),g?.audio_url&&e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:P(C=>e.onPause(g),["stop"])},[s(_,null,{default:d(()=>[s(m)]),_:1})],8,ds)):f("",!0),g?.audio_url&&(e.$store.state?.producer?.audio?.id!==g.id||e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:P(C=>e.onPlay(g),["stop"])},[s(_,null,{default:d(()=>[s($)]),_:1})],8,us)):f("",!0),g?.duration?(n(),c("div",ps,a(e.useFormatDuring(g?.duration)),1)):f("",!0)])),[[J,!g?.audio_url]]),o("div",ms,[o("h2",fs,a(g?.title),1),o("p",hs,a(g?.style),1)]),o("div",_s,[s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[s(S,{disabled:e.isFetchingVideoUrl,onClick:C=>e.handleVideoDownload(g)},{default:d(()=>[o("div",gs,[e.isFetchingVideoUrl?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onDownload(C,g?.audio_url),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.download_audio")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{disabled:e.isFetchingWav,onClick:C=>e.handleWavDownload(g)},{default:d(()=>[o("div",vs,[e.isFetchingWav?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_wav")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:d(()=>[o("span",$s,[s(y,{effect:"dark",content:e.$t("producer.button.download"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onExtend(C,g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.extend")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:1,onClick:P(C=>e.onGetStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.get_stems")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:2,onClick:P(C=>e.onGetAllStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.all_stems")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{onClick:P(C=>e.onCover(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.cover_music")),1)]),_:1},8,["onClick"]),g?.id?(n(),v(S,{key:3,onClick:P(C=>e.onVariation(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.variation")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:4,onClick:P(C=>e.onSwapVocals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_vocals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:5,onClick:P(C=>e.onSwapInstrumentals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_instrumentals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:6,onClick:P(C=>e.onReplaceSection(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.replace_section")),1)]),_:1},8,["onClick"])):f("",!0)]),_:2},1024)]),default:d(()=>[o("span",ys,[s(y,{effect:"dark",content:e.$t("producer.button.more"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,ls))),128))])}const bs=V(is,[["render",ks]]),ws={class:"player-slider"},Cs=b({__name:"PlayerSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:u})}),i=T({get:()=>t.state.producer?.audio?.duration,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:u})}),h=()=>{},p=u=>t.dispatch("producer/setAudio",{...t.state.producer.audio,progress:u});return(u,m)=>(n(),c("div",ws,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=_=>l.value=_),"show-tooltip":!1,min:0,max:i.value,onChange:p,onInput:h},null,8,["modelValue","max"])]))}}),Vs={class:"flex player-song"},Ss=["src"],Us={class:"ml-2 text-xs flex flex-col justify-between"},Es={class:"w-52 2xl:w-96 cursor-pointer truncate"},Ps={class:"flex"},As={class:"ml-2 text-dc"},Ts=b({__name:"PlayerSong",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio,set:i=>t.commit("producer/setAudio",i)});return ne(l,(i,h)=>{if(i?.audio_url!==h?.audio_url){console.log("audio changed",i),i.object&&(console.log("111",i.object),i.object.pause(),delete i.object);const p=new Audio(i.audio_url);i.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("producer/setAudio",{...t.state.producer.audio,progress:p.currentTime})})}),t.commit("producer/setAudio",{...t.state.producer.audio,object:p})}else if(i?.progress!==h?.progress&&Math.abs(i.progress-i.object.currentTime)>2){console.log("progress changed",i.progress);const p=t.state.producer.audio;p.object&&(p.object.currentTime=p.progress)}else i?.state!==h?.state&&(console.log("state changed",i.state),i.object&&(i.state==="playing"?i.object.play():i.object.pause()));i?.volume!==h?.volume&&(console.log("volume changed",i.volume),i.object&&(i.object.volume=i.volume/100))}),(i,h)=>(n(),c("div",Vs,[o("img",{alt:"",class:"w-11 h-11 rounded",src:l.value?.image_url||A(ye)},null,8,Ss),o("div",Us,[o("div",Es,[o("div",Ps,[o("span",null,a(l.value?.title||"Music"),1),o("span",As,"- "+a(l.value?.style||"SmallRuralDog"),1)])])])]))}}),Fs={class:"flex justify-end items-center gap-x-2.5"},Is={class:"text-xs"},Ls=b({__name:"PlayerAction",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:h})}),i=T({get:()=>t.state.producer?.audio?.duration,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:h})});return(h,p)=>(n(),c("div",Fs,[o("span",Is,a(A(j)(l.value))+" / "+a(A(j)(i.value)),1)]))}}),Gs={class:"player-volume flex flex-col items-center pt-2"},js={class:"text-sm mt-3"},Ds=b({__name:"PlayerVolumeSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio?.volume,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,volume:p})}),i=T({get:()=>t.state.producer.audio?.muted,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,muted:p})}),h=p=>t.dispatch("producer/setVolume",p);return(p,u)=>(n(),c("div",Gs,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=m=>l.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:i.value,onInput:h},null,8,["modelValue","disabled"]),o("div",js,a(l.value),1)]))}}),Rs={class:"flex items-center justify-center gap-x-3"},Zs=b({__name:"PlayerController",setup(e){const t=Z(),l=()=>t.dispatch("producer/setAudio",{...t.state.producer.audio,state:t.state.producer.audio.state==="playing"?"paused":"playing"}),i=T(()=>t.state.producer.audio);return(h,p)=>(n(),c("div",Rs,[s(ee,{icon:i.value?.state==="playing"?A(ke):A(be),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:l},null,8,["icon"]),s(A(Ge),{placement:"top",width:"50px",trigger:"click"},{reference:d(()=>[s(ee,{icon:A(we),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:d(()=>[s(Ds)]),_:1})]))}}),zs={class:"flex flex-col items-stretch h-20"},Ns={class:"flex grow px-5 items-center"},Ms={class:"flex-1"},Os={class:"flex-1"},Bs={class:"flex-1"},qs=b({__name:"Player",setup(e){return(t,l)=>(n(),c("div",zs,[s(Cs),o("div",Ns,[o("div",Ms,[s(Ts)]),o("div",Os,[s(Zs)]),o("div",Bs,[s(Ls)])])]))}}),Ws=b({name:"RecentPanel",components:{ElSkeletonItem:Re,ElSkeleton:De,TaskPreview:bs,Player:qs,NoTasks:je,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Hs={key:0,class:"tasks"},Ks={class:"left w-[70px] p-[10px] flex items-center"},Js={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Ys={key:2,class:"w-full flex-1 flex items-center justify-center"},Qs={class:"h-20"};function Xs(e,t,l,i,h,p){const u=r("el-skeleton-item"),m=r("el-skeleton"),_=r("task-preview"),$=r("scroll-list"),k=r("no-tasks"),y=r("player");return n(),c(G,null,[e.tasks?.items===void 0?(n(),c("div",Hs,[(n(),c(G,null,q(3,E=>o("div",{key:E,class:"flex"},[o("div",Ks,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),o("div",Js,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),s(u,{variant:"text"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),v($,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[0]||(t[0]=E=>e.$emit("reach-top"))},{default:d(()=>[(n(!0),c(G,null,q(e.tasks?.items,(E,S)=>(n(),v(_,{key:S,"model-value":E,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):f("",!0),e.tasks?.items?.length===0?(n(),c("div",Ys,[s(k)])):f("",!0),R(o("div",Qs,[s(y)],512),[[re,!!e.$store?.state?.producer?.audio?.object]])],64)}const xs=V(Ws,[["render",Xs]]),en=b({name:"TaskPreview",components:{IconPicture:le,ElImage:N,ElAvatar:Ce,ElIcon:K},computed:{audio(){return this.$store.state.producer?.audio}}}),tn={key:0,class:"size-full overflow-hidden"},on={class:"relative h-[300px]"},sn={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},nn={class:"absolute bottom-0 left-0 right-0 m-0 p-4 text-white z-10 bg-gradient-to-t from-black/70 to-transparent"},rn={class:"p-4"},an={class:"flex items-center font-bold mb-2"},ln={class:"text-[var(--el-text-color-regular)] mb-2"},cn={class:"text-xs text-[var(--el-text-color-regular)]"},dn={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},un={key:1,class:"w-full h-full"};function pn(e,t,l,i,h,p){const u=r("icon-picture"),m=r("el-icon"),_=r("el-image"),$=r("el-avatar");return e.audio?.object?(n(),c("div",tn,[o("div",on,[s(_,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:d(()=>[o("div",sn,[s(m,{class:"text-3xl"},{default:d(()=>[s(u)]),_:1})])]),_:1},8,["src"]),o("h2",nn,a(e.audio?.title),1)]),o("div",rn,[o("div",an,[s($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),o("span",null,a(e.audio?.title),1)]),o("p",ln,a(e.audio?.style),1),o("p",cn,a(e.$dayjs.format(e.audio?.created_at)),1),o("div",dn,[o("p",null,a(e.audio?.lyric),1)])])])):(n(),c("div",un))}const mn=V(en,[["render",pn]]),fn=te("producer"),hn=b({name:"ProducerIndex",components:{Layout:qe,ConfigPanel:ns,RecentPanel:xs,PreviewPanel:mn},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===L.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===L.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===L.Request},needApply(){return this.$store.state.producer.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await $e({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("producer/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("producer/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){de.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===ue&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const 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);const{limit:t=5,createdAtMin:l,createdAtMax:i}=e||{};console.debug("limit",t,"createdAtMin",l,"createdAtMax",i),this.fetchingTasks=!0;try{await this.$store.dispatch("producer/getTasks",{limit:t,createdAtMin:l,createdAtMax:i})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:fn},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),ce("producer",I.audio(e,{token:t})).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(l=>{w.error(l?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function _n(e,t,l,i,h,p){const u=r("config-panel"),m=r("recent-panel"),_=r("preview-panel"),$=r("layout");return n(),v($,null,{config:d(()=>[s(u,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:d(()=>[s(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:d(()=>[s(_)]),_:1})}const mr=V(hn,[["render",_n],["__scopeId","data-v-d6806962"]]);export{mr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as E}from"./index.es-C1Vw5-pU.js";import{E as L}from"./index-BX4hurF9.js";import{E as me}from"./index-CtCHxxgE.js";import{d as b,H as m,E as i,z as j,C as n,y as h,D as o,q as l,F as r,x as V,O as T,N as I,Q as R,J as k,R as ye,I as w,M as we}from"./vendor-vue-NSDaktjZ.js";import{E as y,b7 as A,a0 as Ce,F as Ve,cd as te,aw as oe,ce as Se}from"./index-B26B3NRe.js";import{b as Te,c as ne,d as F,e as N,f as Ie,g as Ee,h as Le}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-BGxp6OcW.js";import{E as q}from"./index-s1aJT5Lx.js";import{E as C}from"./index-kxM-uBwN.js";import{I as S,S as Me,l as Ue}from"./pagination-DcHHH5aU.js";import{E as H}from"./index-34n2Rkz4.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-Bg_4MANc.js";import{E as J}from"./index-Y6ecN3tB.js";import{E as K}from"./index-DHVwu-o_.js";import{C as pe}from"./Consumption-BrRTFprj.js";import{E as ue}from"./index-C_-XxAWi.js";import{E as ge}from"./index-C-elEvQD.js";import{E as Q}from"./index-s4nuUgXJ.js";import{a as fe}from"./price-B76rlcGM.js";import{F as Re}from"./FilePreview-BtyxNwVM.js";import{E as Ae,a as Pe}from"./index-2l2HfBAG.js";import{E as De,a as Ge}from"./index-qKL3nmNJ.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-vQvgGJWZ.js";import{C as Ke}from"./CopyToClipboard-DpLBFIyy.js";import{V as Oe}from"./VideoPlayer-DpOpCmlr.js";import{E as je}from"./index-B0A9C_-T.js";import{E as Ne}from"./index-MLK9z2al.js";import{B as Be}from"./BotPlaceholder-CjLV0ALF.js";import{N as ze}from"./NoTasks-t-Nyk8v6.js";import"./use-form-item-efgym_Md.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-D_vMdvZ6.js";import"./typescript-DilvQCGQ.js";import"./index-Y6InDSnm.js";import"./strings-beZM2Y-f.js";import"./isEqual-7sLqoZ1L.js";import"./_Uint8Array-CIOAkFC8.js";import"./castArray-TnTy8FCf.js";import"./debounce-CJZlaJSw.js";import"./_baseIteratee-y4F6_vaP.js";import"./index-DaTUtZCn.js";import"./validator-DuPh5qwz.js";import"./index-CP58CVoz.js";import"./_baseClone-DsJpkaTJ.js";import"./_initCloneObject--BkHfMCz.js";import"./index-Cu41y2Fl.js";import"./index-BCChxDUd.js";import"./isPlainObject-Ct-jhvvz.js";import"./vue-plyr-BO2nlN4c.js";import"./index-f3A5WlbC.js";const Fe=b({name:"LayoutKling",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),qe={class:"main flex flex-row flex-1 min-h-0"},He={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},We={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Je(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",qe,[i("div",He,[j(e.$slots,"config",{},void 0,!0)]),i("div",We,[j(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:h(()=>[n(c,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Qe=y(Fe,[["render",Je],["__scopeId","data-v-8fa7523c"]]),Ye={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function he(e,t,s){const a=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Ye}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=he(s,a,u),c=[];return e.end_image_url&&!$.endImage&&c.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&c.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&!$.motionControl&&c.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),c}function X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Xe=b({name:"ModelSelector",components:{ElSelect:D,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Te)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Ze={class:"field"},xe={class:"title font-bold"};function et(e,t,s,a,u,$){const c=o("el-option"),p=o("el-select");return l(),m("div",Ze,[i("h2",xe,r(e.$t("pika.name.model")),1),(l(),V(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,f=>(l(),V(c,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const tt=y(Xe,[["render",et],["__scopeId","data-v-04059875"]]),ot=b({name:"ModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},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 F.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(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),nt={class:"field"},st={class:"header"},it={class:"title font-bold"},lt={key:0,class:"opt-tip"};function at(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",nt,[i("div",st,[i("h2",it,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),V(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value,disabled:d.disabled},{default:h(()=>[i("span",{class:R({"opt-disabled":d.disabled})},r(d.label),3),d.disabled&&d.disabledReason?(l(),m("span",lt,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const rt=y(ot,[["render",at],["__scopeId","data-v-9a8fa3c5"]]),le=[3,5,8,10,12,15],ae=[5,10],ct=b({name:"DurationSelector",components:{ElSlider:H,InfoIcon:S},props:{modelValue:{type:Number,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},sliderMin(){return this.isV3Model?3:5},sliderMax(){return this.isV3Model?15:10},sliderStep(){return this.isV3Model?1:5},marks(){const e=this.isV3Model?le:ae,t={};for(const s of e)t[s]=`${s}s`;return t},value(){return this.$store.state.kling?.config?.duration??N},sliderValue(){const e=this.value;return e<this.sliderMin?this.sliderMin:e>this.sliderMax?this.sliderMax:e}},watch:{isV3Model(e){(this.isV3Model?le:ae).includes(this.value)||this.applyDuration(N)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(N)},methods:{async onChange(e){const t=Array.isArray(e)?e[0]:e,s=this.$store.state.kling?.config||{},a=Y(s,{duration:t});if(a.length===0){this.applyDuration(t);return}const u=a.map($=>this.$t($.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:u}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const $=X({...s,duration:t},a);this.$store.commit("kling/setConfig",$),C.success(this.$t("kling.message.featureRemovedNotice",{fields:u}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),dt={class:"field"},mt={class:"header"},pt={class:"title font-bold"},ut={class:"value-display"};function gt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",dt,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(c,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"]),i("span",ut,r(e.value)+"s",1)]),(l(),V(p,{key:e.revertKey,"model-value":e.sliderValue,class:"slider",min:e.sliderMin,max:e.sliderMax,step:e.sliderStep,marks:e.marks,"show-tooltip":!1,onChange:e.onChange},null,8,["model-value","min","max","step","marks","onChange"]))])}const ft=y(ct,[["render",gt],["__scopeId","data-v-aa1a22a1"]]),ht=b({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||(this.value=Ie)}}),_t={class:"text-sm font-bold mb-2 block"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,u,$){return l(),m("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),m(T,null,I(e.options,(c,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:f=>e.value=c.value},[i("div",{class:R(["preview",c.label])},[i("div",{class:"rect",style:ye({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",kt,r(c.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ct={class:"relative"},Vt={class:"flex justify-between"},St={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function It(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Ct,[i("div",Vt,[i("div",St,[i("span",Tt,r(e.$t("kling.name.startImage")),1),n(c,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const Et=y(wt,[["render",It],["__scopeId","data-v-40832274"]]),Lt=b({name:"EndImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,ImagePreview:G,InfoIcon:S,FontAwesomeIcon:E},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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 he(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},uploadDisabled(){return this.reachedLimit||!this.endImageSupported},uploadTooltip(){return this.endImageSupported?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":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=[])}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?!0:(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Mt={class:"relative"},Ut={class:"flex justify-between"},Rt={class:"flex justify-start items-center"},At={class:"text-sm font-bold"};function Pt(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Mt,[i("div",Ut,[i("div",Rt,[i("span",At,r(e.$t("kling.name.endImage")),1),n(c,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$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"])])}const Dt=y(Lt,[["render",Pt],["__scopeId","data-v-6959ad44"]]),Gt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:ue},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||(this.value=Ee)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=d=>e.value=d),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ft=y(Gt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:ge,InfoIcon:S},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.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??Le:!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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,r(e.$t("kling.name.generateAudio")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:ue,InfoIcon:S},data(){return{configKeys:Zt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},disabled(){return this.selectedMode==="4k"},tooltipContent(){return this.disabled?this.$t("kling.description.cameraControlDisabled4k"):this.$t("kling.description.cameraControl")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="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){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select"),d=o("el-input-number"),v=o("el-slider");return l(),m("div",eo,[i("div",to,[i("span",oo,r(e.$t("kling.name.cameraControl")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(T,null,I(e.typeOptions,g=>(l(),V(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",no,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,r(e.$t(`kling.name.cc_${g}`)),1),n(d,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const ao=y(xt,[["render",lo],["__scopeId","data-v-fb7b34d0"]]),_e=[{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"]}],B=", ";function ro(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return _e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),mo={key:0,class:"pills",role:"list"},po={class:"pill-text"},uo=["aria-label","onClick"];function go(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",mo,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",po,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,uo)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:fo},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),d=o("inspiration-pills"),v=o("el-input");return l(),m("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(d),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",Vo=b({name:"NegativePromptInput",components:{ElInput:Q,InfoIcon:S},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||(this.prompt=Co)}}),So={class:"field"},To={class:"box"},Io={class:"title font-bold"};function Eo(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",So,[i("div",To,[i("h2",Io,r(e.$t("kling.name.negativePrompt")),1),n(c,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Lo=y(Vo,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:_e,Close:Ce}},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(t=>this.$t(`kling.inspiration.chip.${t}`)))},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(z(this.prompt,e)):this.setPrompt(ro(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Uo={class:"drawer-content"},Ro={class:"drawer-header"},Ao={class:"title-row"},Po={class:"title"},Do={class:"hint"},Go={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),V(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=d=>e.visible=d),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Uo,[i("div",Ro,[i("div",Ao,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Po,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Do,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Go,[i("span",Ko,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):k("",!0),i("div",Oo,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",No,[(l(!0),m(T,null,I(d.chipKeys,v=>(l(),m("button",{key:v,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"kling-v3":"v3","kling-v3-omni":"v3-Omni","kling-v2-6":"v2.6","kling-v2-5-turbo":"v2.5-Turbo","kling-v2-1-master":"v2.1-Master","kling-v2-master":"v2-Master","kling-v1-6":"v1.6","kling-v1":"v1","kling-video-o1":"Video-o1"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:tt,ModeSelector:rt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Dt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,u,$){const c=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),d=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),U=o("camera-control-selector"),O=o("cfg-scale-selector"),$e=o("negative-prompt-input"),ve=o("summary-chip"),ke=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),be=o("inspiration-drawer");return l(),m("div",nn,[i("div",sn,[n(c,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(d,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(U,{class:"mb-4"}),n(O,{class:"mb-4"}),n($e,{class:"mb-4"})]),i("div",ln,[n(ve),n(ke,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),V(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),V(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:K,ElButton:L,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),dn={class:"relative"},mn={class:"flex justify-between"},pn={class:"flex justify-start items-center"},un={class:"text-sm font-bold"};function gn(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",dn,[i("div",mn,[i("div",pn,[i("span",un,r(e.$t("kling.name.motionImage")),1),n(c,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),V(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Re,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,u,$){const c=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(c,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),V(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Vn={class:"box"},Sn={class:"title font-bold"};function Tn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Cn,[i("div",Vn,[i("h2",Sn,r(e.$t("kling.name.motionPrompt")),1),n(c,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const In=y(wn,[["render",Tn],["__scopeId","data-v-ca9fdbe5"]]),re="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Pe,ElRadioButton:Ae,InfoIcon:S},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},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=re)}}),Ln={class:"field"},Mn={class:"header"},Un={class:"text-sm font-bold"};function Rn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",Ln,[i("div",Mn,[i("span",Un,r(e.$t("kling.name.characterOrientation")),1),n(c,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const An=y(En,[["render",Rn],["__scopeId","data-v-7a91195b"]]),ce="std",Pn=b({name:"MotionModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},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||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Dn={class:"field"},Gn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Dn,[i("div",Gn,[i("h2",Kn,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(Pn,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ge,InfoIcon:S},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,r(e.$t("kling.name.keepOriginalSound")),1),n(c,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:fn,MotionVideo:yn,MotionPromptInput:In,CharacterOrientationSelector:An,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,u,$){const c=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),d=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Qn,[i("div",Yn,[n(c,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(d,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ge,ElTabPane:De,ElTag:Ve},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")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,u,$){const c=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),V(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(T,null,I(e.tabs,d=>(l(),V(p,{key:d.value,name:d.value,disabled:d.disabled},{label:h(()=>[i("span",{class:"tab-label",title:d.disabled?d.disabledReason:void 0},[i("span",os,r(d.label),1),d.badge?(l(),V(c,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(d.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:E,ElAlert:je,VideoPlayer:Oe,ElTooltip:J,ElButton:L,ImagePreview:G},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},ms={class:"info"},ps={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},us={key:1,class:"prompt mt-2"},gs={key:0},fs={key:1},hs={key:0,class:R({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:R({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:R({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ts={key:2,class:R({content:!0})},Is={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,u,$){const c=o("el-image"),p=o("image-preview"),f=o("video-player"),d=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",ls,[i("div",as,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ms,[e.referenceImages.length>0?(l(),m("div",ps,[(l(!0),m(T,null,I(e.referenceImages,(U,O)=>(l(),V(p,{key:O,url:U.url,name:U.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),m("p",us,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",gs," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",hs,[e.modelValue?.response.video_url?(l(),m("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",$s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),V(d,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=U=>e.onDownload(U,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",ks,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",bs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),m("div",ys,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",ws,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",Cs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0),e.modelValue?.response?.trace_id?(l(),m("p",Ss,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ts,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Is,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Es,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Us=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:ze,BotPlaceholder:Be,ScrollList:Me},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?.()}}}),Rs={key:0},As={key:2,class:"w-full h-full flex items-center justify-center"};function Ps(e,t,s,a,u,$){const c=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),d=o("no-tasks");return l(),m(T,null,[e.tasks?.items===void 0?(l(),m("div",Rs,[n(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),V(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(T,null,I(e.tasks?.items,v=>(l(),V(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),m("div",As,[n(d)])):k("",!0)],64)}const Ds=y(Us,[["render",Ps]]),de=Se("kling"),Gs=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:Qe,RecentPanel:Ds},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ue({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();const 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);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){C.warning(this.$t("kling.message.motionMissingInputs"));return}const t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||"video",mode:e.mode||"std",keep_original_sound:e.keep_original_sound??"yes",...e.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,u,$){const c=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),d=o("recent-panel"),v=o("layout");return l(),V(v,null,{config:h(()=>[i("div",Ks,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),V(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),V(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Bi=y(Gs,[["render",js]]);export{Bi as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as P}from"./index.es-C1Vw5-pU.js";import{E as L}from"./index-BX4hurF9.js";import{E as O}from"./index-CtCHxxgE.js";import{d as $,H as l,E as r,z as R,C as t,y as u,D as s,q as a,F as i,O as S,N as T,x as V,I as h,J as g,Q as U}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as q,cd as B,a7 as j,aw as C,ce as F}from"./index-B26B3NRe.js";import{a as N,b as z,c as K,p as H}from"./pika-BY0m19Bk.js";import{I as D,S as J,l as Q}from"./pagination-DcHHH5aU.js";import{E as W}from"./index-C-elEvQD.js";import{E as G,a as M}from"./index-BGxp6OcW.js";import{a as X,E as Y}from"./index-2l2HfBAG.js";import{p as Z}from"./pasteUploadMixin-BurWbGNQ.js";import{I as x}from"./ImagePreview-Bg_4MANc.js";import{E as ee}from"./index-DHVwu-o_.js";import{E}from"./index-kxM-uBwN.js";import{E as te}from"./index-s4nuUgXJ.js";import{C as oe}from"./Consumption-BrRTFprj.js";import{a as se}from"./price-B76rlcGM.js";import{b as ae,a as ne}from"./errorCode-Cqj9Td_Z.js";import{C as ie}from"./CopyToClipboard-DpLBFIyy.js";import{s as le}from"./vue-plyr-BO2nlN4c.js";import{E as re}from"./index-Y6ecN3tB.js";import{E as ce}from"./index-B0A9C_-T.js";import{E as pe}from"./index-MLK9z2al.js";import{B as de}from"./BotPlaceholder-CjLV0ALF.js";import{N as ue}from"./NoTasks-t-Nyk8v6.js";import"./use-form-item-efgym_Md.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-DuPh5qwz.js";import"./index-Y6InDSnm.js";import"./index-D_vMdvZ6.js";import"./typescript-DilvQCGQ.js";import"./strings-beZM2Y-f.js";import"./isEqual-7sLqoZ1L.js";import"./_Uint8Array-CIOAkFC8.js";import"./castArray-TnTy8FCf.js";import"./debounce-CJZlaJSw.js";import"./_baseIteratee-y4F6_vaP.js";import"./index-DaTUtZCn.js";import"./index-CP58CVoz.js";import"./_baseClone-DsJpkaTJ.js";import"./_initCloneObject--BkHfMCz.js";import"./index-BCChxDUd.js";import"./index-f3A5WlbC.js";const me=$({name:"LayoutPika",components:{ElDrawer:O,ElButton:L,FontAwesomeIcon:P},data(){return{drawer:!1}}}),fe={class:"main flex flex-row flex-1"},_e={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},he={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ge(e,o,c,d,v,b){const p=s("font-awesome-icon"),m=s("el-button"),n=s("el-drawer");return a(),l("div",fe,[r("div",_e,[R(e.$slots,"config",{},void 0,!0)]),r("div",he,[R(e.$slots,"result",{},void 0,!0)]),t(m,{circle:"",class:"menu",onClick:o[0]||(o[0]=y=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-magic"})]),_:1}),t(n,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=y=>e.drawer=y),direction:"ltr","with-header":!1,size:"350px"},{default:u(()=>[R(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const $e=k(me,[["render",ge],["__scopeId","data-v-11f71ab6"]]),ke=$({name:"IngredientsSelector",components:{ElSwitch:W,InfoIcon:D},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients},set(e){console.debug("set ingredients",e),e||this.$store.commit("pika/setConfig",{...this.$store.state.pika?.config,ingredients:e,ingredients_mode:void 0,image_url:void 0}),this.$store.commit("pika/setConfig",{...this.$store.state.pika?.config,ingredients:e,model:"2.0"})}}},mounted(){this.value===void 0&&(this.value=N)}}),ve={class:"field"},be={class:"title font-bold"};function ye(e,o,c,d,v,b){const p=s("el-switch"),m=s("info-icon");return a(),l("div",ve,[r("h2",be,i(e.$t("pika.name.ingredients")),1),t(p,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value"},null,8,["modelValue"]),t(m,{content:e.$t("pika.description.ingredients"),class:"info"},null,8,["content"])])}const we=k(ke,[["render",ye],["__scopeId","data-v-17c0af5c"]]),Ee=$({name:"EffectSelector",components:{ElSelect:M,ElOption:G},data(){return{}},computed:{options(){return[{value:"Levitate",label:this.$t("pika.style.effect1")},{value:"Decapitate",label:this.$t("pika.style.effect2")},{value:"Eye-pop",label:this.$t("pika.style.effect3")},{value:"Ta-da",label:this.$t("pika.style.effect4")},{value:"Deflate",label:this.$t("pika.style.effect5")},{value:"Crumble",label:this.$t("pika.style.effect6")},{value:"Dissolve",label:this.$t("pika.style.effect7")},{value:"Squish",label:this.$t("pika.style.effect8")},{value:"Inflate",label:this.$t("pika.style.effect9")},{value:"Melt",label:this.$t("pika.style.effect10")},{value:"Cake-ify",label:this.$t("pika.style.effect11")},{value:"Crush",label:this.$t("pika.style.effect12")},{value:"Explode",label:this.$t("pika.style.effect13")}]},value:{get(){return this.$store.state.pika?.config?.effect},set(e){this.$store.commit("pika/setConfig",{...this.$store.state.pika?.config,effect:e})}}}}),Ve={class:"field"},Ie={class:"title font-bold"},Se={class:"float-left"};function Te(e,o,c,d,v,b){const p=s("el-option"),m=s("el-select");return a(),l("div",Ve,[r("h2",Ie,i(e.$t("pika.name.effect")),1),t(m,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("pika.placeholder.select"),clearable:""},{default:u(()=>[(a(!0),l(S,null,T(e.options,n=>(a(),V(p,{key:n.value,label:n.label,value:n.value},{default:u(()=>[r("span",Se,i(n.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ce=k(Ee,[["render",Te],["__scopeId","data-v-d1c54475"]]),Pe=$({name:"IngredientsModelSelector",components:{ElRadioButton:Y,ElRadioGroup:X},data(){return{options:[{label:this.$t("pika.button.precise"),value:"precise"},{label:this.$t("pika.button.creative"),value:"creative"}]}},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients_mode},set(e){this.$store.commit("pika/setConfig",{...this.$store.state.pika?.config,ingredients_mode:e})}}},mounted(){this.value||(this.value=z)}}),Le={class:"field"},Ue={class:"title font-bold"};function Ae(e,o,c,d,v,b){const p=s("el-radio-button"),m=s("el-radio-group");return a(),l("div",Le,[r("h2",Ue,i(e.$t("pika.name.ingredientsModel")),1),t(m,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"quality"},{default:u(()=>[(a(!0),l(S,null,T(e.options,n=>(a(),V(p,{key:n.value,label:n.value},{default:u(()=>[h(i(n.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const Re=k(Pe,[["render",Ae],["__scopeId","data-v-b72865fa"]]),De=$({name:"ModelSelector",components:{ElSelect:M,ElOption:G},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"2.0",label:"2.0"},{value:"1.5",label:"1.5"}]}},computed:{value:{get(){return this.$store.state.pika?.config?.model},set(e){this.$store.commit("pika/setConfig",{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||(this.value=K)}}),Ge={class:"field"},Me={class:"title font-bold"};function Oe(e,o,c,d,v,b){const p=s("el-option"),m=s("el-select");return a(),l("div",Ge,[r("h2",Me,i(e.$t("pika.name.model")),1),t(m,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("pika.placeholder.select")},{default:u(()=>[(a(!0),l(S,null,T(e.options,n=>(a(),V(p,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const qe=k(De,[["render",Oe],["__scopeId","data-v-7b2e870a"]]),Be=$({name:"ImageUrlInput",components:{ElUpload:ee,ElButton:L,InfoIcon:D,ImagePreview:x,FontAwesomeIcon:P},mixins:[Z],data(){return{fileList:[],uploadUrl:q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.pika?.config?.image_url},set(){const e=this.urls?.[0];this.$store.commit("pika/setConfig",{...this.$store.state.pika?.config,image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("pika.message.uploadStartImageExceed"))},onError(){E.error(this.$t("pika.message.uploadStartImageError"))},async onRemove(){E.error(this.$t("pika.message.uploadStartImageError"))},onSetStartImageUrl(){this.$store.commit("pika/setConfig",{...this.$store.state.pika?.config,image_url:this.urls})},async onSuccess(){this.onSetStartImageUrl()}}}),je={class:"field"},Fe={class:"title font-bold"},Ne={class:"upload-wrapper"};function ze(e,o,c,d,v,b){const p=s("image-preview"),m=s("font-awesome-icon"),n=s("el-button"),y=s("el-upload"),f=s("info-icon");return a(),l("div",je,[r("h2",Fe,i(e.$t("pika.name.imageUrl")),1),r("div",Ne,[t(y,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:3,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:_})=>[t(p,{url:_.url||_.response?.file_url,name:_.name,percentage:_.percentage,onRemove:I=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])]),default:u(()=>[t(n,{size:"small",type:"primary",round:""},{default:u(()=>[t(m,{icon:"fa-solid fa-upload",class:"mr-1"}),h(" "+i(e.$t("pika.button.uploadImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),t(f,{content:e.$t("pika.description.imageUrl"),class:"info"},null,8,["content"])])}const Ke=k(Be,[["render",ze],["__scopeId","data-v-a948772f"]]),He="",Je=$({name:"PromptInput",components:{ElInput:te,InfoIcon:D},computed:{prompt:{get(){return this.$store.state.pika?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("pika/setConfig",{...this.$store.state.pika?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=He)}}),Qe={class:"field"},We={class:"box"},Xe={class:"title font-bold"};function Ye(e,o,c,d,v,b){const p=s("info-icon"),m=s("el-input");return a(),l("div",Qe,[r("div",We,[r("h2",Xe,i(e.$t("pika.name.prompt")),1),t(p,{content:e.$t("pika.description.prompt"),class:"info"},null,8,["content"])]),t(m,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=n=>e.prompt=n),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("pika.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ze=k(Je,[["render",Ye],["__scopeId","data-v-d7f7cedd"]]),xe=$({name:"PresetPanel",components:{ImageUrlInput:Ke,ElButton:L,FontAwesomeIcon:P,Consumption:oe,PromptInput:Ze,IngredientsSelector:we,IngredientsModelSelector:Re,ModelSelector:qe,EffectSelector:Ce},emits:["generate"],computed:{config(){return this.$store.state.pika?.config},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.pika?.service}},methods:{onGenerate(){this.$emit("generate")}}}),et={class:"flex flex-col h-full"},tt={class:"flex-1 overflow-y-auto p-5"},ot={class:"flex flex-col items-center justify-center px-5 pb-5"};function st(e,o,c,d,v,b){const p=s("prompt-input"),m=s("model-selector"),n=s("ingredients-selector"),y=s("effect-selector"),f=s("image-url-input"),_=s("ingredients-model-selector"),I=s("consumption"),w=s("font-awesome-icon"),A=s("el-button");return a(),l("div",et,[r("div",tt,[t(p,{class:"mb-4"}),t(m,{class:"mb-4"}),t(n,{class:"mb-4"}),t(y,{class:"mb-4"}),e.config?.ingredients?(a(),V(f,{key:0,class:"mb-4"})):g("",!0),e.config?.ingredients?(a(),V(_,{key:1,class:"mb-4"})):g("",!0)]),r("div",ot,[t(I,{value:e.consumption,service:e.service},null,8,["value","service"]),t(A,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(w,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+i(e.$t("pika.button.generate")),1)]),_:1},8,["onClick"])])])}const at=k(xe,[["render",st]]),nt=$({name:"VideoPlayer",components:{VuePlyr:le},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),it=["data-poster"],lt=["src"];function rt(e,o,c,d,v,b){const p=s("vue-plyr");return a(),l("div",null,[t(p,{options:e.options,class:"video"},{default:u(()=>[r("video",{controls:"",crossorigin:"",playsinline:"","data-poster":e.modelValue?.image_url},[r("source",{size:"1080",src:e.modelValue?.video_url,type:"video/mp4"},null,8,lt)],8,it)]),_:1},8,["options"])])}const ct=k(nt,[["render",rt],["__scopeId","data-v-fc420430"]]),pt=$({name:"TaskPreview",components:{ElImage:pe,CopyToClipboard:ie,FontAwesomeIcon:P,ElAlert:ce,VideoPlayer:ct,ElTooltip:re,ElButton:L},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pika?.application},config(){return this.$store.state.pika?.config},videos(){let e=[];const o=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(c=>{let d=c;o&&(d.action=o),e.push(d)}),e}},methods:{onDownload(e){console.log("on download"),window.open(e,"_blank")},onReload(e){const o=e.target,c=new URL(o.src),d=c.searchParams.get("retry");if(!d)c.searchParams.set("retry","1");else if(parseInt(d)<2)c.searchParams.set("retry",(parseInt(d)+1).toString());else return;o.src=c.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),dt={class:"left"},ut={class:"main"},mt={class:"bot"},ft={class:"datetime"},_t={class:"info"},ht={key:0,class:"prompt mt-2"},gt={key:0},$t={key:1},kt={key:0,class:U({content:!0,failed:!0})},vt={class:"image-wrapper"},bt={key:0,class:U({operations:!0,"mt-2":!0})},yt={key:0,class:"description"},wt={class:"description"},Et={key:1,class:"description"},Vt={key:1,class:U({content:!0})},It={class:"description"},St={class:"description"},Tt={key:0,class:"description"},Ct={class:"description"},Pt={key:2,class:U({content:!0})},Lt={class:"description"};function Ut(e,o,c,d,v,b){const p=s("el-image"),m=s("VideoPlayer"),n=s("el-button"),y=s("el-tooltip"),f=s("font-awesome-icon"),_=s("copy-to-clipboard"),I=s("el-alert");return a(!0),l(S,null,T(e.videos,(w,A)=>(a(),l("div",{key:A,class:"preview"},[r("div",dt,[t(p,{src:"https://cdn.acedata.cloud/i80tgn.png",class:"avatar"})]),r("div",ut,[r("div",mt,[h(i(e.$t("pika.name.pikaBot"))+" ",1),r("span",ft,i(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",_t,[e.modelValue?.request?.prompt?(a(),l("p",ht,[h(i(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?g("",!0):(a(),l("span",gt," - ("+i(e.$t("pika.status.pending"))+") ",1)),w?.state==="processing"||w?.state==="pending"?(a(),l("span",$t," - ("+i(e.$t("pika.status.processing"))+") ",1)):g("",!0)])):g("",!0)]),e.modelValue?.response?.success===!0?(a(),l("div",kt,[r("div",vt,[t(m,{"model-value":w},null,8,["model-value"])]),w?(a(),l("div",bt,[t(y,{class:"box-item",effect:"dark",content:e.$t("pika.message.downloadVideo"),placement:"top-start"},{default:u(()=>[w?.video_url?(a(),V(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:Ft=>e.onDownload(w?.video_url)},{default:u(()=>[h(i(e.$t("pika.button.download")),1)]),_:1},8,["onClick"])):g("",!0)]),_:2},1032,["content"])])):g("",!0),t(I,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(a(),l("p",yt,[t(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+i(e.$t("pika.name.model"))+": "+i(e.modelValue?.request?.model),1)])):g("",!0),r("p",wt,[t(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+i(e.$t("pika.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(_,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(a(),l("p",Et,[t(f,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+i(e.$t("pika.name.elapsed"))+": "+i(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):g("",!0)]),_:1})])):g("",!0),e.modelValue?.response?.success===!1?(a(),l("div",Vt,[t(I,{closable:!1,class:"failure"},{template:u(()=>[t(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+i(e.$t("pika.name.failure")),1)]),default:u(()=>[r("p",It,[t(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+i(e.$t("pika.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(_,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",St,[t(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+i(e.$t("pika.name.failureReason"))+": "+i(e.modelValue?.response?.error?.message)+" ",1),t(_,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(a(),l("p",Tt,[t(f,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+i(e.$t("pika.name.elapsed"))+": "+i(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):g("",!0),r("p",Ct,[t(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+i(e.$t("pika.name.traceId"))+": "+i(e.modelValue?.response?.trace_id)+" ",1),t(_,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):g("",!0),!e.modelValue?.response||w?.state==="processing"||w?.state==="pending"?(a(),l("div",Pt,[t(I,{closable:!1,class:"info"},{template:u(()=>[t(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+i(e.$t("pika.name.failure")),1)]),default:u(()=>[r("p",Lt,[t(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+i(e.$t("pika.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(_,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):g("",!0)])]))),128)}const At=k(pt,[["render",Ut],["__scopeId","data-v-41fe2be6"]]),Rt=$({name:"RecentPanel",components:{TaskPreview:At,BotPlaceholder:de,NoTasks:ue,ScrollList:J},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pika?.tasks,items:this.$store.state.pika?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Dt={key:0},Gt={key:2,class:"w-full h-full flex items-center justify-center"};function Mt(e,o,c,d,v,b){const p=s("bot-placeholder"),m=s("task-preview"),n=s("scroll-list"),y=s("no-tasks");return a(),l(S,null,[e.tasks?.items===void 0?(a(),l("div",Dt,[t(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),V(n,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=f=>e.$emit("reach-top"))},{default:u(()=>[(a(!0),l(S,null,T(e.tasks?.items,(f,_)=>(a(),V(m,{key:_,"model-value":f},null,8,["model-value"]))),128))]),_:1},8,["loading"])):g("",!0),e.tasks?.items?.length===0?(a(),l("div",Gt,[t(y)])):g("",!0)],64)}const Ot=k(Rt,[["render",Mt]]),qt=F("pika"),Bt=$({name:"PikaIndex",components:{ConfigPanel:at,Layout:$e,RecentPanel:Ot},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pika?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.pika?.status?.getTasks===C.Request||this.fetchingTasks},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===C.Request},needApply(){return this.$store.state.pika.status.getApplications===C.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Q({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("pika/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("pika/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){j.create({application:this.application}).then(({data:e})=>{this.application=e,E.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===ne&&E.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const 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);const{limit:o=5,createdAtMin:c,createdAtMax:d}=e||{};console.debug("limit",o,"createdAtMin",c,"createdAtMax",d),this.fetchingTasks=!0;try{await this.$store.dispatch("pika/getTasks",{limit:o,createdAtMin:c,createdAtMax:d})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:qt},o=this.credential?.token;if(!o){console.error("no token specified");return}E.info(this.$t("pika.message.startingTask")),B("pika",H.generate(e,{token:o})).then(()=>{E.success(this.$t("pika.message.startTaskSuccess")),this.$store.commit("pika/setConfig",{config:void 0})}).catch(c=>{c?.response?.data?.error?.code===ae?E.error(this.$t("pika.message.usedUp")):E.error(this.$t("pika.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function jt(e,o,c,d,v,b){const p=s("config-panel"),m=s("recent-panel"),n=s("layout");return a(),V(n,null,{config:u(()=>[t(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Go=k(Bt,[["render",jt],["__scopeId","data-v-3cd7cf5b"]]);export{Go as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a6 as u,F,a7 as A,a8 as T,a9 as G,aa as L,E as B}from"./index-B26B3NRe.js";import{I as V,a as N}from"./credential-CEfFFZzi.js";import{P as O}from"./Pagination-DB9twOQI.js";import{C as P}from"./CopyToClipboard-DpLBFIyy.js";import{F as z}from"./index.es-C1Vw5-pU.js";import{E as q}from"./index-DhyX8RK7.js";import{E as M,a as R}from"./index-B8UzzWOK.js";import{E as j}from"./index-C-elEvQD.js";import{a as H}from"./index-f3A5WlbC.js";import{E as J,a as K}from"./index-C-g8alJ1.js";import{E as X}from"./index-BX4hurF9.js";import{E as w}from"./index-kxM-uBwN.js";import{d as Q,x as p,y as o,C as t,E as l,F as i,H as $,I as m,J as b,G as W,D as s,K as Y,q as r}from"./vendor-vue-NSDaktjZ.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-BGxp6OcW.js";import"./index-Y6ecN3tB.js";import"./index-Y6InDSnm.js";import"./typescript-DilvQCGQ.js";import"./index-D_vMdvZ6.js";import"./strings-beZM2Y-f.js";import"./isEqual-7sLqoZ1L.js";import"./_Uint8Array-CIOAkFC8.js";import"./castArray-TnTy8FCf.js";import"./use-form-item-efgym_Md.js";import"./index-s4nuUgXJ.js";import"./index-BCChxDUd.js";import"./debounce-CJZlaJSw.js";import"./_baseIteratee-y4F6_vaP.js";import"./index-DaTUtZCn.js";import"./_initCloneObject--BkHfMCz.js";import"./isPlainObject-Ct-jhvvz.js";import"./index-CQuDdqyQ.js";import"./validator-DuPh5qwz.js";import"./index-BuyEbX8F.js";const Z=Q({name:"ConsoleApplicationList",components:{Pagination:O,CopyToClipboard:P,ElTable:R,ElRow:K,ElButton:X,ElCol:J,ElTag:F,ElSkeleton:H,ElSwitch:j,ElTableColumn:M,ElCard:q,FontAwesomeIcon:z},data(){return{credentialType:N,serviceType:V,individualApplications:[],globalApplications:[],individualApplicationsTotal:void 0,globalApplicationsTotal:void 0,loading:!1,buying:!1,limit:10,form:{amount:1},active:{service:void 0,application:void 0}}},computed:{redirect(){return this.$route.query?.redirect},page(){return parseInt(this.$route.query.page?.toString()||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onInitializeGlobalApplication(),this.onFetchData()},methods:{updateAllowConsumeGlobal(e,n){!e||!e.id||A.updateAllConsumeGlobal(e.id,{...e,allow_consume_global:!!n}).then(()=>{w.success(this.$t("application.message.updateSuccessfully").toString())}).catch(()=>{w.error(this.$t("application.message.updateFailed").toString())})},onGoUsage(e){this.$router.push({name:L,query:{application_id:e.id,type:e?.service?.type}})},onBuyMore(e){e?.id&&this.$router.push({name:G,params:{id:e.id}})},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{...this.$route.query,page:e}})},onFetchApplications(e=u.INDIVIDUAL){return new Promise((n,C)=>{A.getAll({limit:this.limit,...e===u.INDIVIDUAL?{offset:(this.page-1)*this.limit}:{},user_id:this.$store.getters.user.id,ordering:"-created_at",type:T.USAGE,scope:e}).then(({data:d})=>{e===u.INDIVIDUAL?(this.individualApplications=d.items,this.individualApplicationsTotal=d.count):(this.globalApplications=d.items,this.globalApplicationsTotal=d.count),n(d)}).catch(d=>{w.error(this.$t("application.message.fetchFailed").toString()),C(d)})})},onFetchData(){this.loading=!0,Promise.all([this.onFetchApplications(u.INDIVIDUAL),this.onFetchApplications(u.GLOBAL)]).then(()=>{this.loading=!1}).catch(()=>{this.loading=!1})},onInitializeGlobalApplication(){A.create({type:T.USAGE,scope:u.GLOBAL,user_id:this.$store.getters.user.id}).finally(()=>{this.onFetchApplications(u.GLOBAL)})},getRemainingAmount(e){if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const n=this.$t(`service.unit.${e?.service?.unit||"credit"}s`);return`${e.remaining_amount?.toFixed(6)} ${n}`},getUsedAmount(e){if(e.used_amount===void 0||e.used_amount===null)return"";const n=this.$t(`service.unit.${e?.service?.unit||"credit"}s`);return`${e.used_amount?.toFixed(6)} ${n}`}}}),ee={class:"title"},te={key:1,class:"summary-card"},oe={class:"icon-wrapper"},ae={class:"label"},ie={class:"value"},le={class:"description"},ne={key:1,class:"flex flex-row justify-between align-center"},se={class:"summary-card"},re={class:"flex justify-start items-center gap-2 mb-2 w-full"},pe={class:"icon-wrapper !mb-0"},de={class:"text-[var(--el-text-color-regular)] text-[14px] truncate"},ce={class:"label"},ue={class:"value"},me={class:"description"},fe={class:"flex flex-col items-end gap-2"},he={class:"copy"},ge={key:0,class:"expired-at"},_e={class:"flex flex-wrap items-center justify-end gap-1"},be={class:"pagination"};function ye(e,n,C,d,ve,Ae){const f=s("el-col"),g=s("el-row"),k=s("el-skeleton"),h=s("font-awesome-icon"),v=s("el-card"),E=s("copy-to-clipboard"),y=s("el-button"),c=s("el-table-column"),I=s("el-tag"),D=s("el-switch"),S=s("el-table"),U=s("pagination"),x=Y("loading");return r(),p(g,{class:"panel p-[30px]"},{default:o(()=>[t(f,{span:24},{default:o(()=>[t(g,null,{default:o(()=>[t(f,{span:24},{default:o(()=>[l("h2",ee,i(e.$t("common.title.allApplications")),1)]),_:1})]),_:1}),t(g,{gutter:15,class:"mb-3"},{default:o(()=>[t(f,{md:12,xs:24},{default:o(()=>[t(v,{shadow:"hover",class:"relative min-h-[180px] mb-2","body-style":{padding:"18px 20px"}},{default:o(()=>[e.loading?(r(),p(k,{key:0})):(r(),$("div",te,[l("div",oe,[t(h,{icon:"fa-solid fa-cubes-stacked"})]),l("p",ae,i(e.$t("application.title.count")),1),l("p",ie,i(e.individualApplicationsTotal),1),l("p",le,i(e.$t("application.message.countDescription")),1)]))]),_:1})]),_:1}),e.globalApplications?.length>0?(r(),p(f,{key:0,md:12,xs:24},{default:o(()=>[t(v,{shadow:"hover",class:"relative min-h-[180px] mb-2","body-style":{padding:"18px 20px"}},{default:o(()=>[e.loading?(r(),p(k,{key:0})):(r(),$("div",ne,[l("div",se,[l("div",re,[l("div",pe,[t(h,{icon:"fa-solid fa-wallet"})]),l("span",de,[m(i(e.$t("application.field.id"))+": "+i(e.globalApplications?.[0]?.id)+" ",1),e.globalApplications?.[0]?.id?(r(),p(E,{key:0,content:e.globalApplications?.[0]?.id,class:"inline-block"},null,8,["content"])):b("",!0)])]),l("p",ce,i(e.$t("application.title.globalBalance")),1),l("p",ue,i(e.globalApplications?.[0]?.remaining_amount?.toFixed(6)||"0.000000")+" "+i(e.$t("service.unit.credits")),1),l("p",me,i(e.$t("application.message.globalBalanceDescription")),1)]),l("div",fe,[t(y,{class:"!m-0 !px-2",size:"small",round:"",onClick:n[0]||(n[0]=a=>e.onGoUsage(e.globalApplications?.[0]))},{default:o(()=>[t(h,{icon:"fa-solid fa-chart-line",class:"mr-1 text-[12px]"}),m(" "+i(e.$t("application.button.usage")),1)]),_:1}),t(y,{class:"!m-0 !px-2",type:"primary",round:"",size:"small",onClick:n[1]||(n[1]=a=>e.onBuyMore(e.globalApplications?.[0]))},{default:o(()=>[t(h,{icon:"fa-solid fa-coins",class:"mr-1 text-[12px]"}),m(" "+i(e.$t("application.button.buyMore")),1)]),_:1})])]))]),_:1})]),_:1})):b("",!0)]),_:1}),t(g,null,{default:o(()=>[t(f,{span:24},{default:o(()=>[t(v,{shadow:"hover"},{default:o(()=>[W((r(),p(S,{data:e.individualApplications,stripe:"",class:"!min-h-[calc(100vh-420px)]","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:o(()=>[t(c,{prop:"id",label:e.$t("application.field.id"),width:"200px","class-name":"text-center"},{default:o(a=>[l("span",null,i(a.row.id),1),l("span",he,[t(E,{content:a?.row?.id,class:"inline-block"},null,8,["content"])])]),_:1},8,["label"]),t(c,{label:e.$t("application.field.type"),width:"90px"},{default:o(a=>[a.row?.type==="Period"?(r(),p(I,{key:0,type:"success",effect:"dark",round:""},{default:o(()=>[m(i(e.$t("application.type.period")),1)]),_:1})):a.row?.type==="Usage"?(r(),p(I,{key:1,effect:"dark",round:""},{default:o(()=>[m(i(e.$t("application.type.usage")),1)]),_:1})):b("",!0)]),_:1},8,["label"]),t(c,{label:e.$t("application.field.name"),width:"180px"},{default:o(a=>[l("span",null,i(a.row?.service?.title),1)]),_:1},8,["label"]),t(c,{prop:"remaining_amount",label:e.$t("application.field.remainingAmount"),width:"150px","class-name":"text-center"},{default:o(a=>[l("span",null,i(e.getRemainingAmount(a.row)),1)]),_:1},8,["label"]),t(c,{prop:"used_amount",label:e.$t("application.field.usedAmount"),width:"150px","class-name":"text-center"},{default:o(a=>[l("span",null,i(e.getUsedAmount(a.row)),1)]),_:1},8,["label"]),t(c,{prop:"allow_consume_global",label:e.$t("application.field.allowConsumeGlobal"),width:"120px","class-name":"text-center"},{default:o(a=>[a.row.service?.type===e.serviceType.API?(r(),p(D,{key:0,modelValue:a.row.allow_consume_global,"onUpdate:modelValue":_=>a.row.allow_consume_global=_,"active-value":!0,"inactive-value":!1,onChange:_=>e.updateAllowConsumeGlobal(a.row,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])):b("",!0)]),_:1},8,["label"]),t(c,{label:e.$t("application.field.expiredAt"),width:"180px"},{default:o(a=>[a.row.expired_at?(r(),$("span",ge,i(e.$dayjs.format(a.row.expired_at)),1)):b("",!0)]),_:1},8,["label"]),t(c,{fixed:"right",width:"200px"},{default:o(a=>[l("div",_e,[t(y,{class:"!m-0 !px-2",size:"small",round:"",onClick:_=>e.onGoUsage(a?.row)},{default:o(()=>[t(h,{icon:"fa-solid fa-chart-line",class:"mr-1 text-[12px]"}),m(" "+i(e.$t("application.button.usage")),1)]),_:1},8,["onClick"]),t(y,{class:"!m-0 !px-2",type:"primary",round:"",size:"small",onClick:_=>e.onBuyMore(a?.row)},{default:o(()=>[t(h,{icon:"fa-solid fa-coins",class:"mr-1 text-[12px]"}),m(" "+i(e.$t("application.button.buyMore")),1)]),_:1},8,["onClick"])])]),_:1})]),_:1},8,["data","empty-text"])),[[x,e.loading]])]),_:1})]),_:1})]),_:1}),t(g,null,{default:o(()=>[t(f,{span:24},{default:o(()=>[l("div",be,[t(U,{"current-page":e.page,"page-size":e.limit,total:e.individualApplicationsTotal,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}const it=B(Z,[["render",ye],["__scopeId","data-v-8a5d3554"]]);export{it as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as E}from"./Navigator-DXXnGXkm.js";import{A as N}from"./Status-B_AYkhMM.js";import{a6 as d,a8 as u,b7 as I,b8 as z,E as v,a7 as k,aw as x}from"./index-B26B3NRe.js";import{a as D}from"./errorCode-Cqj9Td_Z.js";import{E as C}from"./index-BX4hurF9.js";import{E as U}from"./index-CQuDdqyQ.js";import{E as B}from"./index-BIXkQkpn.js";import{E as y}from"./index-kxM-uBwN.js";import{d as _,x as w,y as $,E as m,F as h,C as l,I as L,D as a,q as A,c as V,H as P,J as S}from"./vendor-vue-NSDaktjZ.js";import"./midjourney-D43AbamE.js";import"./luma-DcySqBv2.js";import"./kling-CtoPhhA9.js";import"./veo-Dg8Zhpd-.js";import"./sora-Dyuoglk1.js";import"./pixverse-g-p4CgDy.js";import"./flux-BDAe6Szo.js";import"./hailuo-C8Dw-0xR.js";import"./suno-DFuCGH70.js";import"./producer-DP85fuAq.js";import"./serp-BcjVM9iR.js";import"./wan-DKq-jYOo.js";import"./avatar-B8gOg0rm.js";import"./index.es-C1Vw5-pU.js";import"./index-CM53b4qu.js";import"./index-Y6ecN3tB.js";import"./index-Y6InDSnm.js";import"./typescript-DilvQCGQ.js";import"./index-D_vMdvZ6.js";import"./dropdown-DV2zOuyp.js";import"./castArray-TnTy8FCf.js";import"./byokCredential-CksBBmxL.js";import"./vendor-axios-B8_nURbH.js";import"./index-BGxp6OcW.js";import"./strings-beZM2Y-f.js";import"./isEqual-7sLqoZ1L.js";import"./_Uint8Array-CIOAkFC8.js";import"./use-form-item-efgym_Md.js";import"./index-s4nuUgXJ.js";import"./index-BCChxDUd.js";import"./debounce-CJZlaJSw.js";import"./_baseIteratee-y4F6_vaP.js";import"./index-DaTUtZCn.js";import"./index-BXXrwsD3.js";import"./_baseClone-DsJpkaTJ.js";import"./_initCloneObject--BkHfMCz.js";import"./index-B8UzzWOK.js";import"./isPlainObject-Ct-jhvvz.js";import"./index-C-elEvQD.js";import"./validator-DuPh5qwz.js";import"./index-s1aJT5Lx.js";import"./EditArray-B2Ml48mM.js";import"./index-DHVwu-o_.js";import"./index-CP58CVoz.js";import"./index-MLK9z2al.js";import"./index-DhyX8RK7.js";import"./index-CY478nhU.js";import"./index-B-3bpbrW.js";import"./index-BuyEbX8F.js";import"./index-BDUUWpA9.js";import"./CopyToClipboard-DpLBFIyy.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";function O(i){if(!i?.expired_at)return!1;try{return new Date(i?.expired_at)<new Date}catch{return!1}}function R(i){return console.debug("application remaining amount",i,i?.remaining_amount),i?.remaining_amount&&i?.remaining_amount<0}function f(i){if(!i)return console.debug("application is undefined, return false"),!1;const t=R(i),o=O(i);return console.debug("is application exhausted",t),console.debug("is application expired",o),!t&&!o}function G(i,t){if(console.debug("start to execute getFinalApplication",i,t),t){const e=i?.find(c=>c.id===t.id);if(e)return console.debug("current application is preserved (respect user selection)",e),e}console.debug("get final application from applications",i);const o=i?.find(e=>e.scope===d.GLOBAL&&e.type===u.PERIOD);if(console.debug("application1",o),f(o))return console.debug("application with global scope and Period type",o),o;const p=i?.find(e=>e.scope===d.GLOBAL&&e.type===u.USAGE);if(console.debug("application2",p),f(p))return console.debug("application with global scope and Usage type",p),p;const s=i?.find(e=>(e.scope===d.INDIVIDUAL&&e?.type)===u.PERIOD);if(console.debug("application3",s),f(s))return console.debug("application with Period type",s),s;const n=i?.find(e=>(e.scope===d.INDIVIDUAL&&e?.type)===u.USAGE);return console.debug("application4",n),f(n)?(console.debug("application with Usage type",n),n):o||p||s||n}const F=_({name:"ApplicationConfirm",components:{ElDialog:z,ElDivider:B,ElCheckbox:U,ElButton:C},props:{visible:{type:Boolean,required:!1,default:!1}},emits:["update:visible","apply"],data(){return{checked:!0}},watch:{},methods:{getBaseUrlPlatform:I,onApply(){if(!this.checked){y.error(this.$t("application.message.notAgreePolicy"));return}this.$emit("apply")}}}),M={class:"content py-[10px] px-[40px]"},q={class:"my-4"},T={class:"policy mb-[10px]"},W={class:"policy-title text-[12px] relative -bottom-[3px]"},H=["href"];function J(i,t,o,p,s,n){const e=a("el-divider"),c=a("el-checkbox"),g=a("el-button"),b=a("el-dialog");return A(),w(b,{"model-value":i.visible,width:"500px",title:i.$t("application.message.welcome"),center:"",onClose:t[1]||(t[1]=r=>i.$emit("update:visible",!1))},{default:$(()=>[m("div",M,[m("p",q,h(i.$t("application.message.notApplied")),1),l(e,{class:"my-2"}),m("div",T,[l(c,{modelValue:i.checked,"onUpdate:modelValue":t[0]||(t[0]=r=>i.checked=r),size:"large",class:"policy-checkbox mr-[10px]"},null,8,["modelValue"]),m("span",W,h(i.$t("application.message.readPolicy")),1),m("a",{class:"policy-title text-[12px] relative -bottom-[3px] text-[var(--el-color-primary)] cursor-pointer no-underline",target:"_blank",href:i.getBaseUrlPlatform()+"/terms"}," "+h(i.$t("application.message.policy")),9,H)]),l(g,{round:"",type:"primary",onClick:i.onApply},{default:$(()=>[L(h(i.$t("common.button.start")),1)]),_:1},8,["onClick"])])]),_:1},8,["model-value","title"])}const j=v(F,[["render",J]]),K=_({name:"LayoutMain",components:{Navigator:E,ApplicationStatus:N,ApplicationConfirm:j},provide(){return{initialized:V(()=>this.initialized)}},data(){return{initialized:!1,applying:!1,mobile:window.innerWidth<768,initializeRunId:0}},computed:{appName(){return this.$route.meta.appName},application(){return this.$store.state[this.appName]?.application},applications(){const i=this.$store.state[this.appName]?.applications??[];console.debug("individualApplications",i);const t=this.$store.state.applications??[];return console.debug("globalApplications",t),t.concat(i)},loading(){return this.$store.state[this.appName]?.status?.getApplications===x.Request},service(){return this.$store.state[this.appName]?.service},userId(){return this.$store.state.user?.id}},watch:{appName(){this.initialize()},userId(i,t){i&&i!==t&&this.initialize()}},mounted(){this.initialize(),window.addEventListener("resize",()=>{this.mobile=window.innerWidth<768})},methods:{async initialize(){const i=++this.initializeRunId;if(this.initialized=!1,console.debug("Fetching all individual and global applications for",this.appName),await Promise.allSettled([this.$store.dispatch("getApplications"),this.$store.dispatch(`${this.appName}/getApplications`)]),i!==this.initializeRunId)return;console.debug("Fetched all applications",this.applications),this.$store.state.applications?.length===0&&(this.applying=!0);const t=this.$store.state[this.appName]?.application;console.debug("current application",t);const o=G(this.applications,t);console.debug("final application",o),o&&(console.debug("set final application",o,o?.type),await this.$store.dispatch(`${this.appName}/setApplication`,o)),console.debug("finished initialization"),this.initialized=!0},onApply(){k.create({type:u.USAGE,scope:d.GLOBAL,user_id:this.$store.getters.user.id}).then(()=>{y.success(this.$t("application.message.applySuccessfully")),this.initialize(),this.applying=!1}).catch(i=>{i?.response?.data?.code===D&&y.error(this.$t("application.message.alreadyApplied"))})}}}),Q={class:"wrapper"};function X(i,t,o,p,s,n){const e=a("router-view"),c=a("navigator"),g=a("application-status"),b=a("application-confirm");return A(),P("div",Q,[l(e,{class:"main"}),l(c,{class:"navigator",direction:i.mobile?"row":"column"},null,8,["direction"]),i.application?(A(),w(g,{key:0,class:"fixed right-2 top-2 z-[200]",application:i.application,applications:i.applications,"show-price":!1,authenticated:!!i.$store.state.token.access,service:i.service,onSelect:t[0]||(t[0]=r=>i.$store.dispatch(`${i.appName}/setApplication`,r))},null,8,["application","applications","authenticated","service"])):S("",!0),l(b,{modelValue:i.applying,"onUpdate:modelValue":t[1]||(t[1]=r=>i.applying=r),modelModifiers:{visible:!0},onApply:i.onApply},null,8,["modelValue","onApply"])])}const st=v(K,[["render",X],["__scopeId","data-v-658408eb"]]);export{st as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as q,O as H,z as j,ag as A,S as ae,h as te,J as ne,A as F,N as W,c9 as ce,ca as Y,cb as ge,cc as pe,af as de,R as fe,M,am as be,bq as ve,bp as me,D as Pe,E as Ce}from"./index-B26B3NRe.js";import{d as z,q as u,H as P,F as I,x as T,y as Q,V as re,u as a,c as C,i as he,b as E,w as R,C as ie,O as se,N as le,Q as _,g as ze,E as Z,a3 as ye,J,U as Se,k as _e,h as w,p as Ne,D as ke}from"./vendor-vue-NSDaktjZ.js";import{E as xe,a as Ee}from"./index-BGxp6OcW.js";import{m as oe}from"./typescript-DilvQCGQ.js";import{i as Te}from"./isEqual-7sLqoZ1L.js";import{E as $e}from"./index-s4nuUgXJ.js";const ue=Symbol("elPaginationKey"),Me=q({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:H}}),Be={click:e=>e instanceof MouseEvent},we=z({name:"ElPaginationPrev"}),Ie=z({...we,props:Me,emits:Be,setup(e){const l=e,{t:r}=A(),c=C(()=>l.disabled||l.currentPage<=1);return(s,p)=>(u(),P("button",{type:"button",class:"btn-prev",disabled:a(c),"aria-label":s.prevText||a(r)("el.pagination.prev"),"aria-disabled":a(c),onClick:f=>s.$emit("click",f)},[s.prevText?(u(),P("span",{key:0},I(s.prevText),1)):(u(),T(a(ae),{key:1},{default:Q(()=>[(u(),T(re(s.prevIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var qe=j(Ie,[["__file","prev.vue"]]);const Ae=q({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:H}}),Le=z({name:"ElPaginationNext"}),Fe=z({...Le,props:Ae,emits:["click"],setup(e){const l=e,{t:r}=A(),c=C(()=>l.disabled||l.currentPage===l.pageCount||l.pageCount===0);return(s,p)=>(u(),P("button",{type:"button",class:"btn-next",disabled:a(c),"aria-label":s.nextText||a(r)("el.pagination.next"),"aria-disabled":a(c),onClick:f=>s.$emit("click",f)},[s.nextText?(u(),P("span",{key:0},I(s.nextText),1)):(u(),T(a(ae),{key:1},{default:Q(()=>[(u(),T(re(s.nextIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var je=j(Fe,[["__file","next.vue"]]);const X=()=>he(ue,{}),De=q({pageSize:{type:Number,required:!0},pageSizes:{type:ne(Array),default:()=>oe([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:te},appendSizeTo:String}),Ke=z({name:"ElPaginationSizes"}),Ue=z({...Ke,props:De,emits:["page-size-change"],setup(e,{emit:l}){const r=e,{t:c}=A(),s=F("pagination"),p=X(),f=E(r.pageSize);R(()=>r.pageSizes,(o,S)=>{if(!Te(o,S)&&ze(o)){const g=o.includes(r.pageSize)?r.pageSize:r.pageSizes[0];l("page-size-change",g)}}),R(()=>r.pageSize,o=>{f.value=o});const y=C(()=>r.pageSizes);function k(o){var S;o!==f.value&&(f.value=o,(S=p.handleSizeChange)==null||S.call(p,Number(o)))}return(o,S)=>(u(),P("span",{class:_(a(s).e("sizes"))},[ie(a(Ee),{"model-value":f.value,disabled:o.disabled,"popper-class":o.popperClass,size:o.size,teleported:o.teleported,"validate-event":!1,"append-to":o.appendSizeTo,onChange:k},{default:Q(()=>[(u(!0),P(se,null,le(a(y),g=>(u(),T(a(xe),{key:g,value:g,label:g+a(c)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size","teleported","append-to"])],2))}});var Oe=j(Ue,[["__file","sizes.vue"]]);const Ve=q({size:{type:String,values:te}}),Je=z({name:"ElPaginationJumper"}),We=z({...Je,props:Ve,setup(e){const{t:l}=A(),r=F("pagination"),{pageCount:c,disabled:s,currentPage:p,changeEvent:f}=X(),y=E(),k=C(()=>{var g;return(g=y.value)!=null?g:p?.value});function o(g){y.value=g?+g:""}function S(g){g=Math.trunc(+g),f?.(g),y.value=void 0}return(g,D)=>(u(),P("span",{class:_(a(r).e("jump")),disabled:a(s)},[Z("span",{class:_([a(r).e("goto")])},I(a(l)("el.pagination.goto")),3),ie(a($e),{size:g.size,class:_([a(r).e("editor"),a(r).is("in-pagination")]),min:1,max:a(c),disabled:a(s),"model-value":a(k),"validate-event":!1,"aria-label":a(l)("el.pagination.page"),type:"number","onUpdate:modelValue":o,onChange:S},null,8,["size","class","max","disabled","model-value","aria-label"]),Z("span",{class:_([a(r).e("classifier")])},I(a(l)("el.pagination.pageClassifier")),3)],10,["disabled"]))}});var He=j(We,[["__file","jumper.vue"]]);const Re=q({total:{type:Number,default:1e3}}),Ge=z({name:"ElPaginationTotal"}),Qe=z({...Ge,props:Re,setup(e){const{t:l}=A(),r=F("pagination"),{disabled:c}=X();return(s,p)=>(u(),P("span",{class:_(a(r).e("total")),disabled:a(c)},I(a(l)("el.pagination.total",{total:s.total})),11,["disabled"]))}});var Xe=j(Qe,[["__file","total.vue"]]);const Ye=q({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),Ze=z({name:"ElPaginationPager"}),ea=z({...Ze,props:Ye,emits:[W],setup(e,{emit:l}){const r=e,c=F("pager"),s=F("icon"),{t:p}=A(),f=E(!1),y=E(!1),k=E(!1),o=E(!1),S=E(!1),g=E(!1),D=C(()=>{const i=r.pagerCount,t=(i-1)/2,n=Number(r.currentPage),b=Number(r.pageCount);let v=!1,$=!1;b>i&&(n>i-t&&(v=!0),n<b-t&&($=!0));const B=[];if(v&&!$){const h=b-(i-2);for(let N=h;N<b;N++)B.push(N)}else if(!v&&$)for(let h=2;h<i;h++)B.push(h);else if(v&&$){const h=Math.floor(i/2)-1;for(let N=n-h;N<=n+h;N++)B.push(N)}else for(let h=2;h<b;h++)B.push(h);return B}),L=C(()=>["more","btn-quickprev",s.b(),c.is("disabled",r.disabled)]),x=C(()=>["more","btn-quicknext",s.b(),c.is("disabled",r.disabled)]),d=C(()=>r.disabled?-1:0);ye(()=>{const i=(r.pagerCount-1)/2;f.value=!1,y.value=!1,r.pageCount>r.pagerCount&&(r.currentPage>r.pagerCount-i&&(f.value=!0),r.currentPage<r.pageCount-i&&(y.value=!0))});function K(i=!1){r.disabled||(i?k.value=!0:o.value=!0)}function O(i=!1){i?S.value=!0:g.value=!0}function G(i){const t=i.target;if(t.tagName.toLowerCase()==="li"&&Array.from(t.classList).includes("number")){const n=Number(t.textContent);n!==r.currentPage&&l(W,n)}else t.tagName.toLowerCase()==="li"&&Array.from(t.classList).includes("more")&&V(i)}function V(i){const t=i.target;if(t.tagName.toLowerCase()==="ul"||r.disabled)return;let n=Number(t.textContent);const b=r.pageCount,v=r.currentPage,$=r.pagerCount-2;t.className.includes("more")&&(t.className.includes("quickprev")?n=v-$:t.className.includes("quicknext")&&(n=v+$)),Number.isNaN(+n)||(n<1&&(n=1),n>b&&(n=b)),n!==v&&l(W,n)}return(i,t)=>(u(),P("ul",{class:_(a(c).b()),onClick:V,onKeyup:Se(G,["enter"])},[i.pageCount>0?(u(),P("li",{key:0,class:_([[a(c).is("active",i.currentPage===1),a(c).is("disabled",i.disabled)],"number"]),"aria-current":i.currentPage===1,"aria-label":a(p)("el.pagination.currentPage",{pager:1}),tabindex:a(d)}," 1 ",10,["aria-current","aria-label","tabindex"])):J("v-if",!0),f.value?(u(),P("li",{key:1,class:_(a(L)),tabindex:a(d),"aria-label":a(p)("el.pagination.prevPages",{pager:i.pagerCount-2}),onMouseenter:n=>K(!0),onMouseleave:n=>k.value=!1,onFocus:n=>O(!0),onBlur:n=>S.value=!1},[(k.value||S.value)&&!i.disabled?(u(),T(a(ce),{key:0})):(u(),T(a(Y),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):J("v-if",!0),(u(!0),P(se,null,le(a(D),n=>(u(),P("li",{key:n,class:_([[a(c).is("active",i.currentPage===n),a(c).is("disabled",i.disabled)],"number"]),"aria-current":i.currentPage===n,"aria-label":a(p)("el.pagination.currentPage",{pager:n}),tabindex:a(d)},I(n),11,["aria-current","aria-label","tabindex"]))),128)),y.value?(u(),P("li",{key:2,class:_(a(x)),tabindex:a(d),"aria-label":a(p)("el.pagination.nextPages",{pager:i.pagerCount-2}),onMouseenter:n=>K(),onMouseleave:n=>o.value=!1,onFocus:n=>O(),onBlur:n=>g.value=!1},[(o.value||g.value)&&!i.disabled?(u(),T(a(ge),{key:0})):(u(),T(a(Y),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):J("v-if",!0),i.pageCount>1?(u(),P("li",{key:3,class:_([[a(c).is("active",i.currentPage===i.pageCount),a(c).is("disabled",i.disabled)],"number"]),"aria-current":i.currentPage===i.pageCount,"aria-label":a(p)("el.pagination.currentPage",{pager:i.pageCount}),tabindex:a(d)},I(i.pageCount),11,["aria-current","aria-label","tabindex"])):J("v-if",!0)],42,["onKeyup"]))}});var aa=j(ea,[["__file","pager.vue"]]);const m=e=>typeof e!="number",ta=q({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:e=>M(e)&&Math.trunc(e)===e&&e>4&&e<22&&e%2===1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:ne(Array),default:()=>oe([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:H,default:()=>me},nextText:{type:String,default:""},nextIcon:{type:H,default:()=>ve},teleported:{type:Boolean,default:!0},small:Boolean,size:be,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),na={"update:current-page":e=>M(e),"update:page-size":e=>M(e),"size-change":e=>M(e),change:(e,l)=>M(e)&&M(l),"current-change":e=>M(e),"prev-click":e=>M(e),"next-click":e=>M(e)},ee="ElPagination";var ra=z({name:ee,props:ta,emits:na,setup(e,{emit:l,slots:r}){const{t:c}=A(),s=F("pagination"),p=_e().vnode.props||{},f=pe(),y=C(()=>{var t;return e.small?"small":(t=e.size)!=null?t:f.value});de({from:"small",replacement:"size",version:"3.0.0",scope:"el-pagination",ref:"https://element-plus.org/zh-CN/component/pagination.html"},C(()=>!!e.small));const k="onUpdate:currentPage"in p||"onUpdate:current-page"in p||"onCurrentChange"in p,o="onUpdate:pageSize"in p||"onUpdate:page-size"in p||"onSizeChange"in p,S=C(()=>{if(m(e.total)&&m(e.pageCount)||!m(e.currentPage)&&!k)return!1;if(e.layout.includes("sizes")){if(m(e.pageCount)){if(!m(e.total)&&!m(e.pageSize)&&!o)return!1}else if(!o)return!1}return!0}),g=E(m(e.defaultPageSize)?10:e.defaultPageSize),D=E(m(e.defaultCurrentPage)?1:e.defaultCurrentPage),L=C({get(){return m(e.pageSize)?g.value:e.pageSize},set(t){m(e.pageSize)&&(g.value=t),o&&(l("update:page-size",t),l("size-change",t))}}),x=C(()=>{let t=0;return m(e.pageCount)?m(e.total)||(t=Math.max(1,Math.ceil(e.total/L.value))):t=e.pageCount,t}),d=C({get(){return m(e.currentPage)?D.value:e.currentPage},set(t){let n=t;t<1?n=1:t>x.value&&(n=x.value),m(e.currentPage)&&(D.value=n),k&&(l("update:current-page",n),l("current-change",n))}});R(x,t=>{d.value>t&&(d.value=t)}),R([d,L],t=>{l(W,...t)},{flush:"post"});function K(t){d.value=t}function O(t){L.value=t;const n=x.value;d.value>n&&(d.value=n)}function G(){e.disabled||(d.value-=1,l("prev-click",d.value))}function V(){e.disabled||(d.value+=1,l("next-click",d.value))}function i(t,n){t&&(t.props||(t.props={}),t.props.class=[t.props.class,n].join(" "))}return Ne(ue,{pageCount:x,disabled:C(()=>e.disabled),currentPage:d,changeEvent:K,handleSizeChange:O}),()=>{var t,n;if(!S.value)return fe(ee,c("el.pagination.deprecationWarning")),null;if(!e.layout||e.hideOnSinglePage&&x.value<=1)return null;const b=[],v=[],$=w("div",{class:s.e("rightwrapper")},v),B={prev:w(qe,{disabled:e.disabled,currentPage:d.value,prevText:e.prevText,prevIcon:e.prevIcon,onClick:G}),jumper:w(He,{size:y.value}),pager:w(aa,{currentPage:d.value,pageCount:x.value,pagerCount:e.pagerCount,onChange:K,disabled:e.disabled}),next:w(je,{disabled:e.disabled,currentPage:d.value,pageCount:x.value,nextText:e.nextText,nextIcon:e.nextIcon,onClick:V}),sizes:w(Oe,{pageSize:L.value,pageSizes:e.pageSizes,popperClass:e.popperClass,disabled:e.disabled,teleported:e.teleported,size:y.value,appendSizeTo:e.appendSizeTo}),slot:(n=(t=r?.default)==null?void 0:t.call(r))!=null?n:null,total:w(Xe,{total:m(e.total)?0:e.total})},h=e.layout.split(",").map(U=>U.trim());let N=!1;return h.forEach(U=>{if(U==="->"){N=!0;return}N?v.push(B[U]):b.push(B[U])}),i(b[0],s.is("first")),i(b[b.length-1],s.is("last")),N&&v.length>0&&(i(v[0],s.is("first")),i(v[v.length-1],s.is("last")),b.push($)),w("div",{class:[s.b(),s.is("background",e.background),s.m(y.value)]},b)}}});const ia=Pe(ra),sa=z({name:"Pagination",components:{ElPagination:ia},props:{total:{type:Number,required:!1,default:void 0},currentPage:{type:Number,required:!0},pageSize:{type:Number,required:!0}},emits:["change"],data(){return{loaded:!1}},mounted(){setTimeout(()=>{this.loaded=!0},1e3)},methods:{onPageChange(e){this.loaded&&this.$emit("change",e)}}});function la(e,l,r,c,s,p){const f=ke("el-pagination");return u(),T(f,{class:"mt-3 mb-3",background:"","hide-on-single-page":!1,layout:"prev, pager, next","current-page":e.currentPage,total:e.total,"page-size":e.pageSize,onCurrentChange:e.onPageChange},null,8,["current-page","total","page-size","onCurrentChange"])}const fa=Ce(sa,[["render",la]]);export{fa as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as T,$ as E,E as $,b8 as B,a9 as I,aa as S,a8 as O}from"./index-B26B3NRe.js";import{F as y}from"./index.es-C1Vw5-pU.js";import{C as U}from"./CopyToClipboard-DpLBFIyy.js";import{E as N}from"./index-BX4hurF9.js";import{d as v,H as l,E as o,C as s,y as u,F as i,x as b,J as k,I as f,M as h,D as c,q as n,O as F,N as V,Q as L}from"./vendor-vue-NSDaktjZ.js";const M=v({name:"ApplicationInfo",components:{FontAwesomeIcon:y,ElButton:N,Check:E,ElIcon:T,CopyToClipboard:U},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}},emits:["buy","usage"]}),q={class:"flex flex-col min-w-0"},j={key:0,class:"app-id-row"},z={class:"icon !mb-0 flex-shrink-0"},D={class:"app-id-line"},G={class:"app-id-label"},P={class:"app-id-value"},R={key:1,class:"icon"},H={class:"text-left"},J={class:"description"},Q={key:0},X={key:1},K={class:"value"},W={class:"description2"},Y={key:0},Z={key:1},x={class:"actions"};function ee(e,t,w,g,A,C){const m=c("check"),_=c("el-icon"),p=c("font-awesome-icon"),a=c("copy-to-clipboard"),r=c("el-button");return n(),l("div",null,[o("div",q,[s(_,{class:"check"},{default:u(()=>[s(m)]),_:1}),e.showId?(n(),l("div",j,[o("div",z,[s(p,{icon:"fa-solid fa-wallet"})]),o("div",D,[o("span",G,i(e.$t("application.field.id"))+":",1),o("span",P,i(e.application.id),1),e.application.id?(n(),b(a,{key:0,content:e.application.id,class:"copy-small"},null,8,["content"])):k("",!0)])])):(n(),l("div",R,[s(p,{icon:"fa-solid fa-wallet"})])),o("div",H,[o("p",J,[e.application.service?(n(),l("span",X,i(e.$t("application.title.applicationBalance",{service:e.application.service?.title})),1)):(n(),l("span",Q,i(e.$t("application.title.globalBalance")),1))]),o("p",K,i(e.application?.remaining_amount?.toFixed(2))+" "+i(e.$t("service.unit."+(e.application?.service?.unit||"credit")+"s")),1),o("p",W,[e.application.type==="Period"?(n(),l("span",Y,i(e.$t("application.field.expiredAt"))+": "+i(e.$dayjs.format(e.application.expired_at)),1)):(n(),l("span",Z,i(e.$t("application.message.neverExpire")),1))])])]),o("div",x,[s(r,{size:"small",round:"",onClick:t[0]||(t[0]=h(d=>e.$emit("usage",e.application),["stop"]))},{default:u(()=>[s(p,{icon:"fa-solid fa-chart-line",class:"mr-1 text-[11px]"}),f(" "+i(e.$t("application.button.usage")),1)]),_:1}),s(r,{type:"primary",round:"",size:"small",onClick:t[1]||(t[1]=h(d=>e.$emit("buy",e.application),["stop"]))},{default:u(()=>[s(p,{icon:"fa-solid fa-coins",class:"mr-1 text-[11px]"}),f(" "+i(e.$t("application.button.buyMore")),1)]),_:1})])])}const te=$(M,[["render",ee],["__scopeId","data-v-9481c3d6"]]),oe=v({name:"ApplicationStatus",components:{ElDialog:B,FontAwesomeIcon:y,ApplicationInfo:te},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},service:{type:Object,required:!0}},emits:["select"],data(){return{visible:!1,applicationType:O}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user},balanceAmount(){return Number(this.application?.remaining_amount??0)},balanceUnit(){const t=`service.unit.${this.application?.service?.unit||"credit"}`+(this.balanceAmount===1?"":"s");return this.$t(t)},balanceText(){const e=this.balanceAmount;return Number.isFinite(e)?e>=1e3?Math.round(e).toLocaleString():e>=100?e.toFixed(1):e.toFixed(2):"0"},balanceTitle(){return`${this.balanceText} ${this.balanceUnit}`}},methods:{onGoUsage(e){const t=this.$router.resolve({name:S,query:{application_id:e.id}});window.open(t.href,"_blank")},onBuyMore(e){const t=this.$router.resolve({name:I,params:{id:e.id}}).href;window.open(t,"_blank")},onSelectApplication(e){this.$emit("select",e)}}}),ie={class:"status"},ne={key:0},ae={class:"text-center mb-4"},se={class:"flex flex-col gap-4 mb-6 overflow-y-auto"},le=["title"],ce={class:"entry-amount"},pe={class:"entry-unit"};function re(e,t,w,g,A,C){const m=c("application-info"),_=c("el-dialog"),p=c("font-awesome-icon");return n(),l("div",ie,[s(_,{modelValue:e.visible,"onUpdate:modelValue":t[0]||(t[0]=a=>e.visible=a),class:"mt-12",width:"450px"},{default:u(()=>[e.application?(n(),l("div",ne,[o("p",ae,i(e.$t("application.message.applicationSelection")),1),o("div",se,[(n(!0),l(F,null,V(e.applications,(a,r)=>(n(),b(m,{key:r,class:L({item:!0,active:e.application?.id===a.id}),application:a,"show-id":"",onClick:d=>e.onSelectApplication(a),onUsage:d=>e.onGoUsage(a),onBuy:d=>e.onBuyMore(a)},null,8,["class","application","onClick","onUsage","onBuy"]))),128))])])):k("",!0)]),_:1},8,["modelValue"]),o("button",{type:"button",class:"entry",title:e.balanceTitle,onClick:t[1]||(t[1]=a=>e.visible=!0)},[s(p,{icon:"fa-solid fa-wallet",class:"entry-icon"}),o("span",ce,i(e.balanceText),1),o("span",pe,i(e.balanceUnit),1)],8,le)])}const he=$(oe,[["render",re],["__scopeId","data-v-afd961d7"]]);export{he as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as R}from"./api-Ch0ZHArw.js";import{F as B,ab as C,ac as D,a7 as v,a8 as y,a9 as I,E as L}from"./index-B26B3NRe.js";import{g as x}from"./price-B76rlcGM.js";import{o as V}from"./order-C-AU0yGl.js";import{s as W}from"./service-DTe2kk8b.js";import{F as K}from"./index.es-C1Vw5-pU.js";import{E as M}from"./index-BX4hurF9.js";import{E as z}from"./index-DhyX8RK7.js";import{E as H,a as U}from"./index-C-g8alJ1.js";import{a as q}from"./index-f3A5WlbC.js";import{E as w}from"./index-kxM-uBwN.js";import{d as J,x as u,y as s,C as i,E as r,F as n,H as g,N as O,O as A,I as _,J as S,D as h,q as o,Q}from"./vendor-vue-NSDaktjZ.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./use-form-item-efgym_Md.js";import"./index-BuyEbX8F.js";import"./typescript-DilvQCGQ.js";const X=J({name:"ConsoleSubscriptionBuy",components:{ElSkeleton:q,ElRow:U,ElTag:B,ElCol:H,ElCard:z,FontAwesomeIcon:K,ElButton:M},data(){return{application:void 0,application2:void 0,type:y.PERIOD,services:[],loading:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){return this.$route.params?.id?.toString()},subscriptions(){const e=[{name:"WEEK",label:this.$t("console.subscription.weekly"),description:this.$t("console.subscription.weekly.description"),duration:604800},{name:"MONTH",label:this.$t("console.subscription.monthly"),description:this.$t("console.subscription.monthly.description"),duration:2592e3},{name:"YEAR",tag:this.$t("console.button.suggested"),label:this.$t("console.subscription.yearly"),description:this.$t("console.subscription.yearly.description"),duration:31536e3}];for(const t of e){console.log("item",t);const m=this.getPackages(t.duration);console.log("pkgs",m),m&&(t.price=m.reduce((c,d)=>c+d.price,0));for(const c of m)t.benefits||(t.benefits=[]),t.benefits.push({enabled:!0,content:`${c?.service?.title} - ${c.amount} `+this.$t("service.unit."+c?.service?.unit+"s")});t.benefits?.push({enabled:t.name!=="WEEK",content:this.$t("console.message.benefit1")}),t.benefits?.push({enabled:t.name!=="WEEK",content:this.$t("console.message.benefit2")})}return e},service(){return this.application?.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){this.loading=!0,await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.loading=!1,this.subscription=this.subscriptions[2]},methods:{getPriceString:x,onBuyExtra(){this.$router.push({name:I,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];const c=[this.service].sort((d,b)=>this.serviceIds.indexOf(d.id)-this.serviceIds.indexOf(b.id));for(const d of c){const l=d.packages?.find(p=>p.type===R.PERIOD&&p.duration===e);l&&t.push({...l,service:d})}return t},async onCreateApplications(){const e=[];if(this.application2||e.push(this.application?.service?.id),e.length>0){for(const t of e)await v.create({service_id:t,type:y.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log("onChangeType",this.type),this.$router.push({name:I,params:this.$route.params})},async onFetchServices(){const{data:e}=await W.getAll({id:this.serviceIds});this.services=e.items,console.debug("services",this.services)},async onFetchApplication(){const{data:e}=await v.get(this.applicationId);this.application=e,console.debug("application",this.application)},async onFetchApplication2(){const{data:e}=await v.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at",service_id:this.serviceIds,type:y.PERIOD});this.application2=e.items?.[0],console.debug("application2",this.application2)},onCreateOrder(e){if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){w.error(this.$t("console.message.applicationNotFound")),this.creating=!1;return}C("payment_initiated",{service:this.service?.alias,action:"subscribe",duration:e.duration}),V.create({application_ids:[this.application2.id],package_ids:this.getPackages(e.duration).map(t=>t.id),description:this.service?.title+" - "+e.label}).then(({data:t})=>{this.creating=!1,this.$router.push({name:D,params:{id:t.id}})}).catch(t=>{w.error(this.$t("order.message.createFailed")),this.creating=!1,C("payment_failed",{service:this.service?.alias,action:"subscribe",error:t?.response?.data?.error?.message??String(t)})})}}}),Y={class:"title"},j={class:"introduction"},G={class:"name"},Z={class:"price"},ee={class:"description"},te={class:"benefits"},se={class:"operations"},ie={key:2,class:"extra"};function oe(e,t,m,c,d,b){const l=h("el-col"),p=h("el-row"),F=h("el-skeleton"),P=h("el-tag"),k=h("font-awesome-icon"),E=h("el-button"),$=h("el-card");return o(),u(p,{class:"panel"},{default:s(()=>[i(l,{span:24},{default:s(()=>[i(p,null,{default:s(()=>[i(l,{span:24},{default:s(()=>[r("h2",Y,n(e.$t("common.title.buyMore")),1)]),_:1})]),_:1}),i(p,null,{default:s(()=>[i(l,{span:24},{default:s(()=>[i($,{shadow:"hover",class:"card"},{default:s(()=>[i(p,null,{default:s(()=>[i(l,{class:"max-w-4xl mx-auto"},{default:s(()=>[r("p",j,n(e.$t("console.subscription.title")),1),e.loading?(o(),u(F,{key:0})):(o(),u(p,{key:1,gutter:15,class:"subscriptions"},{default:s(()=>[(o(!0),g(A,null,O(e.subscriptions,(a,T)=>(o(),u(l,{key:T,xs:24,md:24/(e.subscriptions?.length||4)},{default:s(()=>[i($,{shadow:"hover",class:Q({subscription:!0,active:e.subscription?.name===a.name}),onClick:f=>e.subscription=a},{default:s(()=>[r("h4",G,[_(n(a.label)+" ",1),a.tag?(o(),u(P,{key:0,type:"warning"},{default:s(()=>[_(n(a.tag),1)]),_:2},1024)):S("",!0)]),r("h2",Z,n(e.getPriceString({value:a.price})),1),r("p",ee,n(a.description),1),r("div",te,[(o(!0),g(A,null,O(a.benefits,(f,N)=>(o(),g("div",{key:N,class:"benefit"},[f.enabled?(o(),u(k,{key:0,icon:"fa-solid fa-check",class:"icon icon-check"})):(o(),u(k,{key:1,icon:"fa-solid fa-xmark",class:"icon icon-xmark"})),r("span",null,n(f.content),1)]))),128))]),r("div",se,[i(E,{class:"btn btn-subscribe",type:e.subscription?.name===a?.name?"primary":"",round:"",onClick:f=>e.onCreateOrder(a)},{default:s(()=>[_(n(e.$t("common.button.buy")),1)]),_:1},8,["type","onClick"])])]),_:2},1032,["class","onClick"])]),_:2},1032,["md"]))),128))]),_:1})),e.loading?S("",!0):(o(),g("div",ie,[r("span",null,n(e.$t("console.message.doNotWantSubscribe")),1),i(E,{type:"primary",class:"btn btn-extra",round:"",size:"small",onClick:e.onBuyExtra},{default:s(()=>[_(n(e.$t("console.message.buyExtra")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const $e=L(X,[["render",oe],["__scopeId","data-v-e9151700"]]);export{$e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cR as l,b4 as i,cS as L,j as D,k as _,cT as F,cg as G,c as B,cU as A,cV as y,bV as K,cW as c}from"./index-B26B3NRe.js";import{b as E,c as R,a as W}from"./index-Y6InDSnm.js";var j=l(i,"WeakMap");function q(t){return t!=null&&E(t.length)&&!L(t)}var N=Object.prototype;function H(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||N;return t===r}function Y(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}function Z(){return!1}var U=typeof exports=="object"&&exports&&!exports.nodeType&&exports,w=U&&typeof module=="object"&&module&&!module.nodeType&&module,J=w&&w.exports===U,x=J?i.Buffer:void 0,Q=x?x.isBuffer:void 0,X=Q||Z,tt="[object Arguments]",rt="[object Array]",et="[object Boolean]",at="[object Date]",ot="[object Error]",nt="[object Function]",st="[object Map]",it="[object Number]",ct="[object Object]",ut="[object RegExp]",pt="[object Set]",ft="[object String]",gt="[object WeakMap]",bt="[object ArrayBuffer]",yt="[object DataView]",lt="[object Float32Array]",dt="[object Float64Array]",Tt="[object Int8Array]",jt="[object Int16Array]",ht="[object Int32Array]",vt="[object Uint8Array]",mt="[object Uint8ClampedArray]",_t="[object Uint16Array]",At="[object Uint32Array]",a={};a[lt]=a[dt]=a[Tt]=a[jt]=a[ht]=a[vt]=a[mt]=a[_t]=a[At]=!0;a[tt]=a[rt]=a[bt]=a[et]=a[yt]=a[at]=a[ot]=a[nt]=a[st]=a[it]=a[ct]=a[ut]=a[pt]=a[ft]=a[gt]=!1;function wt(t){return D(t)&&E(t.length)&&!!a[_(t)]}function xt(t){return function(e){return t(e)}}var z=typeof exports=="object"&&exports&&!exports.nodeType&&exports,g=z&&typeof module=="object"&&module&&!module.nodeType&&module,St=g&&g.exports===z,T=St&&F.process,S=(function(){try{var t=g&&g.require&&g.require("util").types;return t||T&&T.binding&&T.binding("util")}catch{}})(),O=S&&S.isTypedArray,Ot=O?xt(O):wt,Pt=Object.prototype,Mt=Pt.hasOwnProperty;function $t(t,e){var r=B(t),o=!r&&R(t),u=!r&&!o&&X(t),p=!r&&!o&&!u&&Ot(t),f=r||o||u||p,d=f?Y(t.length,String):[],V=d.length;for(var n in t)(e||Mt.call(t,n))&&!(f&&(n=="length"||u&&(n=="offset"||n=="parent")||p&&(n=="buffer"||n=="byteLength"||n=="byteOffset")||G(n,V)))&&d.push(n);return d}function Ct(t,e){return function(r){return t(e(r))}}var It=Ct(Object.keys,Object),kt=Object.prototype,Bt=kt.hasOwnProperty;function Et(t){if(!H(t))return It(t);var e=[];for(var r in Object(t))Bt.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ut(t){return q(t)?$t(t):Et(t)}function zt(){this.__data__=new A,this.size=0}function Vt(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Lt(t){return this.__data__.get(t)}function Dt(t){return this.__data__.has(t)}var Ft=200;function Gt(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!y||o.length<Ft-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new K(o)}return r.set(t,e),this.size=r.size,this}function b(t){var e=this.__data__=new A(t);this.size=e.size}b.prototype.clear=zt;b.prototype.delete=Vt;b.prototype.get=Lt;b.prototype.has=Dt;b.prototype.set=Gt;function Kt(t,e){for(var r=-1,o=t==null?0:t.length,u=0,p=[];++r<o;){var f=t[r];e(f,r,t)&&(p[u++]=f)}return p}function Rt(){return[]}var Wt=Object.prototype,qt=Wt.propertyIsEnumerable,P=Object.getOwnPropertySymbols,Nt=P?function(t){return t==null?[]:(t=Object(t),Kt(P(t),function(e){return qt.call(t,e)}))}:Rt;function Ht(t,e,r){var o=e(t);return B(t)?o:W(o,r(t))}function ar(t){return Ht(t,Ut,Nt)}var h=l(i,"DataView"),v=l(i,"Promise"),m=l(i,"Set"),M="[object Map]",Yt="[object Object]",$="[object Promise]",C="[object Set]",I="[object WeakMap]",k="[object DataView]",Zt=c(h),Jt=c(y),Qt=c(v),Xt=c(m),tr=c(j),s=_;(h&&s(new h(new ArrayBuffer(1)))!=k||y&&s(new y)!=M||v&&s(v.resolve())!=$||m&&s(new m)!=C||j&&s(new j)!=I)&&(s=function(t){var e=_(t),r=e==Yt?t.constructor:void 0,o=r?c(r):"";if(o)switch(o){case Zt:return k;case Jt:return M;case Qt:return $;case Xt:return C;case tr:return I}return e});var or=i.Uint8Array;export{b as S,or as U,q as a,$t as b,s as c,X as d,Ot as e,Nt as f,ar as g,Ht as h,H as i,xt as j,Ut as k,S as n,Ct as o,Rt as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as l,k as E}from"./_Uint8Array-CIOAkFC8.js";import{b as A}from"./isEqual-7sLqoZ1L.js";import{b3 as M,bK as c,bL as m,bM as O,bN as P,c as y}from"./index-B26B3NRe.js";import{h as _,i as g}from"./index-Y6InDSnm.js";var L=1,C=2;function I(n,r,e,t){var i=e.length,u=i;if(n==null)return!u;for(n=Object(n);i--;){var f=e[i];if(f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++i<u;){f=e[i];var s=f[0],o=n[s],b=f[1];if(f[2]){if(o===void 0&&!(s in n))return!1}else{var h=new l,a;if(!(a===void 0?A(b,o,L|C,t,h):a))return!1}}return!0}function p(n){return n===n&&!M(n)}function d(n){for(var r=E(n),e=r.length;e--;){var t=r[e],i=n[t];r[e]=[t,i,p(i)]}return r}function R(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function D(n){var r=d(n);return r.length==1&&r[0][2]?R(r[0][0],r[0][1]):function(e){return e===n||I(e,n,r)}}var G=1,w=2;function F(n,r){return c(n)&&p(r)?R(m(n),r):function(e){var t=O(e,n);return t===void 0&&t===r?_(e,n):A(r,t,G|w)}}function S(n){return function(r){return r?.[n]}}function K(n){return function(r){return P(r,n)}}function N(n){return c(n)?S(m(n)):K(n)}function q(n){return typeof n=="function"?n:n==null?g:typeof n=="object"?y(n)?F(n[0],n[1]):D(n):N(n)}export{q as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b3 as p,bO as y,bP as O,b4 as b}from"./index-B26B3NRe.js";import{i as v,a as m,b as x,o as w,U as i}from"./_Uint8Array-CIOAkFC8.js";var a=Object.create,P=(function(){function e(){}return function(r){if(!p(r))return{};if(a)return a(r);e.prototype=r;var n=new e;return e.prototype=void 0,n}})();function z(e,r){var n=-1,t=e.length;for(r||(r=Array(t));++n<t;)r[n]=e[n];return r}function M(e,r,n,t){var g=!n;n||(n={});for(var u=-1,h=r.length;++u<h;){var s=r[u],o=void 0;o===void 0&&(o=e[s]),g?y(n,s,o):O(n,s,o)}return n}function A(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}var U=Object.prototype,C=U.hasOwnProperty;function I(e){if(!p(e))return A(e);var r=v(e),n=[];for(var t in e)t=="constructor"&&(r||!C.call(e,t))||n.push(t);return n}function N(e){return m(e)?x(e,!0):I(e)}var K=w(Object.getPrototypeOf,Object),d=typeof exports=="object"&&exports&&!exports.nodeType&&exports,f=d&&typeof module=="object"&&module&&!module.nodeType&&module,L=f&&f.exports===d,c=L?b.Buffer:void 0,l=c?c.allocUnsafe:void 0;function k(e,r){if(r)return e.slice();var n=e.length,t=l?l(n):new e.constructor(n);return e.copy(t),t}function T(e){var r=new e.constructor(e.byteLength);return new i(r).set(new i(e)),r}function q(e,r){var n=r?T(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function D(e){return typeof e.constructor=="function"&&!v(e)?P(K(e)):{}}export{T as a,q as b,M as c,k as d,z as e,K as g,D as i,N as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./vendor-axios-B8_nURbH.js";import{B as o}from"./index-B26B3NRe.js";class n{async task(a,t){return await e.post("/flux/tasks",{action:"retrieve",id:a},{headers:{accept:"application/json","content-type":"application/json",authorization:`Bearer ${t.token}`,"x-record-exempt":"true"},baseURL:o})}async tasks(a,t){return await e.post("/flux/tasks",{action:"retrieve_batch",...a.ids?{ids:a.ids}:{},...a.applicationId?{application_id:a.applicationId}:{},...a.userId?{user_id:a.userId}:{},...a.type?{type:a.type}:{},...a.limit!==void 0?{limit:a.limit}:{},...a.offset!==void 0?{offset:a.offset}:{},...a.createdAtMax!==void 0?{created_at_max:a.createdAtMax}:{},...a.createdAtMin!==void 0?{created_at_min:a.createdAtMin}:{}},{headers:{accept:"application/json","content-type":"application/json",authorization:`Bearer ${t.token}`,"x-record-exempt":"true"},baseURL:o})}async generate(a,t){return await e.post("/flux/images",a,{headers:{authorization:`Bearer ${t.token}`,"content-type":"application/json",accept:"application/x-ndjson"},baseURL:o})}}const c=new n;export{c as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./vendor-axios-B8_nURbH.js";import{B as o}from"./index-B26B3NRe.js";class i{async task(a,t){return await e.post("/hailuo/tasks",{action:"retrieve",id:a},{headers:{accept:"application/json","content-type":"application/json",authorization:`Bearer ${t.token}`,"x-record-exempt":"true"},baseURL:o})}async tasks(a,t){return await e.post("/hailuo/tasks",{action:"retrieve_batch",...a.ids?{ids:a.ids}:{},...a.applicationId?{application_id:a.applicationId}:{},...a.userId?{user_id:a.userId}:{},...a.type?{type:a.type}:{},...a.limit!==void 0?{limit:a.limit}:{},...a.offset!==void 0?{offset:a.offset}:{},...a.createdAtMax!==void 0?{created_at_max:a.createdAtMax}:{},...a.createdAtMin!==void 0?{created_at_min:a.createdAtMin}:{}},{headers:{accept:"application/json","content-type":"application/json",authorization:`Bearer ${t.token}`,"x-record-exempt":"true"},baseURL:o})}async generate(a,t){return await e.post("/hailuo/videos",a,{headers:{authorization:`Bearer ${t.token}`,"content-type":"application/json",accept:"application/x-ndjson"},baseURL:o})}}const c=new i;export{c as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./vendor-axios-B8_nURbH.js";import{B as o}from"./index-B26B3NRe.js";class s{async task(a,t){return await e.post("/headshots/tasks",{action:"retrieve",id:a},{headers:{accept:"application/json","content-type":"application/json",authorization:`Bearer ${t.token}`,"x-record-exempt":"true"},baseURL:o})}async tasks(a,t){return await e.post("/headshots/tasks",{action:"retrieve_batch",...a.ids?{ids:a.ids}:{},...a.applicationId?{application_id:a.applicationId}:{},...a.userId?{user_id:a.userId}:{},...a.limit!==void 0?{limit:a.limit}:{},...a.offset!==void 0?{offset:a.offset}:{},...a.createdAtMax!==void 0?{created_at_max:a.createdAtMax}:{},...a.createdAtMin!==void 0?{created_at_min:a.createdAtMin}:{}},{headers:{accept:"application/json","content-type":"application/json",authorization:`Bearer ${t.token}`,"x-record-exempt":"true"},baseURL:o})}async generate(a,t){return await e.post("/headshots/generate",a,{headers:{authorization:`Bearer ${t.token}`,"content-type":"application/json",accept:"application/x-ndjson"},baseURL:o})}}const c=new s;export{c as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ay as T,aw as n,a7 as f,aF as u}from"./index-B26B3NRe.js";import{V as g}from"./veo-Dg8Zhpd-.js";import{s as b}from"./service-DTe2kk8b.js";import{v as w}from"./veo-DMJuvLwk.js";import{m as S}from"./merge-C5jDS2au.js";import"./vendor-vue-NSDaktjZ.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";const C=({commit:t})=>{t("resetAll")},I=async({commit:t,dispatch:e},s)=>{if(console.debug("set application",s),t("setApplication",s),!s){console.debug("application is null, return");return}const a=s?.credentials?.find(o=>o?.host===window.location.origin);a?(console.debug("credential exists, set credential",a),t("setCredential",a)):(console.debug("credential not exists, start to create credential for application",s),await e("createCredential"))},$=async({commit:t},e)=>{console.debug("set applications",e),t("setApplications",e)},y=async({commit:t},e)=>{console.debug("set service",e),t("setService",e)},h=async({commit:t},e)=>{console.debug("set credential",e),t("setCredential",e)},O=async({commit:t,state:e})=>{const s=e.application;if(console.debug("prepare to create credential for application",s),!s){console.error("Application not found");return}console.debug("creating create credential for application",s);const{data:a}=await T.create({application_id:s?.id,host:window.location.origin});return console.debug("created credential success",a),t("setCredential",a),console.debug("end createCredential"),a},x=async({commit:t,state:e})=>{e.status.getService=n.Request;try{const{data:s}=await b.get(g);return e.status.getService=n.Success,t("setService",s),s}catch{e.status.getService=n.Error,t("setService",void 0)}},E=async({commit:t,state:e,rootState:s})=>{console.debug("start to get applications for chat"),e.status.getApplications=n.Request;const a=e.application;console.debug("current application",a);try{const{data:o}=await f.getAll({user_id:s?.user?.id,service_id:g});return e.status.getApplications=n.Success,t("setApplications",o.items),o.items}catch(o){console.error("get applications failed",o),e.status.getApplications=n.Error,t("setApplications",void 0),t("setApplication",void 0)}},_=({commit:t},e)=>{t("setConfig",e)},P=({commit:t},e)=>{t("setTasks",e)},R=({commit:t},e)=>{t("setTasksItems",e)},V=({commit:t},e)=>{t("setTasksTotal",e)},q=({commit:t},e)=>{t("setTasksActive",e)},D=async({commit:t,state:e,rootState:s},{offset:a,limit:o,createdAtMin:k,createdAtMax:v})=>new Promise((m,c)=>{console.debug("start to get tasks",a,o);const r=e.credential;console.debug("current credential",r);const l=r?.token;if(!l)return c("no token");w.tasks({userId:s?.user?.id,createdAtMin:k,createdAtMax:v,type:"videos"},{token:l}).then(i=>{console.debug("get videos tasks success",i.data.items);const p=e?.tasks?.items||[];console.debug("existing items",p);const d=i.data.items||[];console.debug("new items",d);const A=S(p,d);t("setTasksItems",A),t("setTasksTotal",i.data.count),m(i.data.items)}).catch(i=>c(i))}),F={setService:y,getService:x,resetAll:C,setCredential:h,setConfig:_,setApplication:I,setApplications:$,getApplications:E,setTasks:P,setTasksItems:R,setTasksTotal:V,setTasksActive:q,getTasks:D,createCredential:O},L=t=>{Object.assign(t,u())},j=(t,e)=>{t.service=e},z=(t,e)=>{t.credential=e},B=(t,e)=>{t.application=e},G=(t,e)=>{t.applications=e},H=(t,e)=>{t.config=e},J=(t,e)=>{const s={...t.tasks,items:e};t.tasks=s},K=(t,e)=>{const s={...t.tasks,total:e};t.tasks=s},M=(t,e)=>{const s={...t.tasks,active:e};t.tasks=s},N=(t,e)=>{t.tasks=e},Q={setTasks:N,setApplication:B,setApplications:G,setConfig:H,setCredential:z,setService:j,setTasksActive:M,setTasksItems:J,setTasksTotal:K,resetAll:L},ot={namespaced:!0,state:u,mutations:Q,actions:F};export{ot as default,ot as veo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as T,X as N,q as o,x as i,y as u,G as V,E as g,Q as a,u as e,z as d,V as $,J as r,H as c,I as k,F as m,O as z,C as O,L as P,T as F,b as j,c as b,j as y}from"./vendor-vue-NSDaktjZ.js";import{a2 as q,I as G,a3 as H,a4 as w,z as J,A as L,b as M,S,a5 as Q,D as R}from"./index-B26B3NRe.js";import{u as U,a as X}from"./index-Y6ecN3tB.js";const K=["light","dark"],W=G({title:{type:String,default:""},description:{type:String,default:""},type:{type:String,values:H(w),default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,values:K,default:"light"},...U}),Y={open:()=>!0,close:n=>q(n)||n instanceof Event},Z=T({name:"ElAlert"}),_=T({...Z,props:W,emits:Y,setup(n,{emit:v}){const l=n,{Close:E}=Q,A=N(),t=L("alert"),p=j(!1),C=b(()=>w[l.type]),f=b(()=>!!(l.description||A.default)),B=()=>{p.value=!0,v("open")},h=s=>{p.value=!1,v("close",s)},{onOpen:D,onClose:I}=X({showAfter:y(l,"showAfter"),hideAfter:y(l,"hideAfter"),autoClose:y(l,"autoClose"),open:B,close:h});return M&&D(),(s,ee)=>(o(),i(F,{name:e(t).b("fade"),persisted:""},{default:u(()=>[V(g("div",{class:a([e(t).b(),e(t).m(s.type),e(t).is("center",s.center),e(t).is(s.effect)]),role:"alert"},[s.showIcon&&(s.$slots.icon||e(C))?(o(),i(e(S),{key:0,class:a([e(t).e("icon"),{[e(t).is("big")]:e(f)}])},{default:u(()=>[d(s.$slots,"icon",{},()=>[(o(),i($(e(C))))])]),_:3},8,["class"])):r("v-if",!0),g("div",{class:a(e(t).e("content"))},[s.title||s.$slots.title?(o(),c("span",{key:0,class:a([e(t).e("title"),{"with-description":e(f)}])},[d(s.$slots,"title",{},()=>[k(m(s.title),1)])],2)):r("v-if",!0),e(f)?(o(),c("p",{key:1,class:a(e(t).e("description"))},[d(s.$slots,"default",{},()=>[k(m(s.description),1)])],2)):r("v-if",!0),s.closable?(o(),c(z,{key:2},[s.closeText?(o(),c("div",{key:0,class:a([e(t).e("close-btn"),e(t).is("customed")]),onClick:h},m(s.closeText),3)):(o(),i(e(S),{key:1,class:a(e(t).e("close-btn")),onClick:e(I)},{default:u(()=>[O(e(E))]),_:1},8,["class","onClick"]))],64)):r("v-if",!0)],2)],2),[[P,p.value]])]),_:3},8,["name"]))}});var x=J(_,[["__file","alert.vue"]]);const ae=R(x);export{ae as E};
|