@acedatacloud/nexior 3.102.0 → 3.103.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-CdbP0nJ-.js → Auth-CTJPtak2.js} +1 -1
- package/dist/assets/{BotPlaceholder-C5ljOz4A.js → BotPlaceholder-BQlSeXx6.js} +1 -1
- package/dist/assets/{Callback-LbuDGgoN.js → Callback-gQq4823_.js} +1 -1
- package/dist/assets/{Console-3UBzdLjG.js → Console-CVAPqJVj.js} +1 -1
- package/dist/assets/{Consumption--BQQHppN.js → Consumption-GxTGyrc1.js} +1 -1
- package/dist/assets/{Conversation-DOsDZcAC.js → Conversation-DmN9rpRf.js} +1 -1
- package/dist/assets/{CopyToClipboard-B6G-wNJD.js → CopyToClipboard-C36KVGrD.js} +1 -1
- package/dist/assets/{Detail-W9MvITnq.js → Detail-CMaXz6ot.js} +2 -2
- package/dist/assets/{EditArray-BoF9JmTH.js → EditArray-DahW0kac.js} +1 -1
- package/dist/assets/{Extra-ThR5mb6h.js → Extra-Cz_Repo6.js} +1 -1
- package/dist/assets/{FilePreview-B7g5t6E1.js → FilePreview-71ciK0-o.js} +1 -1
- package/dist/assets/{History-YYxCN3nj.js → History-DDUmN4dI.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-CMyYNZf7.js → IconPark.vue_vue_type_script_setup_true_lang-KwnZP6Fc.js} +1 -1
- package/dist/assets/{ImagePreview-VbvXxzqA.js → ImagePreview-DArls9pq.js} +1 -1
- package/dist/assets/{ImageWrapper-BYRsN2IJ.js → ImageWrapper-D9des0o3.js} +1 -1
- package/dist/assets/{Index-DeXll_M3.js → Index-3qxxFhuQ.js} +1 -1
- package/dist/assets/{Index-BEjnHCTa.js → Index-7QvMjYth.js} +1 -1
- package/dist/assets/{Index-B9lAqI_n.js → Index-B4UT6bBZ.js} +1 -1
- package/dist/assets/{Index-BvzRhzvK.js → Index-BHOowMr_.js} +1 -1
- package/dist/assets/{Index-CQBUnzr3.css → Index-BKPWzmEE.css} +1 -1
- package/dist/assets/{Index-D76t73cr.js → Index-BUZeIcQV.js} +1 -1
- package/dist/assets/{Index-C140iFXJ.js → Index-BhL9l6og.js} +1 -1
- package/dist/assets/{Index-BS2CBQv0.js → Index-BsBkS34o.js} +1 -1
- package/dist/assets/{Index-DOQQKYhM.js → Index-C3BjVia4.js} +1 -1
- package/dist/assets/{Index-CKUXg3t8.js → Index-CLXyGz4t.js} +1 -1
- package/dist/assets/{Index-C19NgBRQ.js → Index-CXq2TcsS.js} +1 -1
- package/dist/assets/{Index-CvsC4xbJ.js → Index-CcDXGqSV.js} +1 -1
- package/dist/assets/{Index-qiNKc2h3.js → Index-Ck5lGzWe.js} +1 -1
- package/dist/assets/{Index-Dj61-pGD.js → Index-CqNdn39d.js} +1 -1
- package/dist/assets/{Index-DfC7rw93.js → Index-Cr7jMT2r.js} +1 -1
- package/dist/assets/{Index-B3zHOyRQ.js → Index-D0xTBLsX.js} +1 -1
- package/dist/assets/{Index-BTnIGNMv.js → Index-D75pvaOK.js} +1 -1
- package/dist/assets/{Index-BkRnvNYz.js → Index-DNhGVALP.js} +1 -1
- package/dist/assets/{Index-Hj5KZrXr.js → Index-DXxwtOyj.js} +1 -1
- package/dist/assets/{Index-DqGmWE6i.js → Index-DjBJRz20.js} +1 -1
- package/dist/assets/{Index-u3ORLq0t.js → Index-DyKZs7f6.js} +1 -1
- package/dist/assets/{Index-CRgRWNE4.js → Index-Dzuf7LOY.js} +1 -1
- package/dist/assets/{Index-DMlDIH35.js → Index-JyZxLo3T.js} +1 -1
- package/dist/assets/{Index-Bx3C0bOp.js → Index-_DCNZ2Kx.js} +1 -1
- package/dist/assets/{Index-BbxvHcEl.js → Index-nL0aAA0S.js} +1 -1
- package/dist/assets/Index-xzA3HAJY.js +1 -0
- package/dist/assets/{Invitees-C-KDgRnT.js → Invitees-DMIPfIqV.js} +1 -1
- package/dist/assets/{List-C1UxuI1p.js → List-DSRyeIBw.js} +1 -1
- package/dist/assets/{List-CJdjKtEN.js → List-DqzgHc8W.js} +1 -1
- package/dist/assets/{List-CTUY91vC.js → List-SyLvS327.js} +1 -1
- package/dist/assets/{Main-hxcdzbOZ.js → Main-BInr9HCw.js} +1 -1
- package/dist/assets/{Navigator-49FKfPmP.js → Navigator-Piz5b1Rk.js} +1 -1
- package/dist/assets/{NoTasks-BeyOLEbn.js → NoTasks-b4OJIqL7.js} +1 -1
- package/dist/assets/{NotFound-CRJAHy_K.js → NotFound-Dq0WF5Vl.js} +1 -1
- package/dist/assets/{OAuthCallback-D7hwoM8j.js → OAuthCallback-CNliSFnB.js} +1 -1
- package/dist/assets/{Pagination-B3SvX2do.js → Pagination-BIgoshVx.js} +1 -1
- package/dist/assets/{ScrollList-DRIMxtWX.js → ScrollList-Cu2yoCEI.js} +1 -1
- package/dist/assets/{Status-B3lDdQtb.js → Status-CXzrdUGd.js} +1 -1
- package/dist/assets/{Subscribe-DNEo_jp7.js → Subscribe-DnRR6CrI.js} +1 -1
- package/dist/assets/{TransportWebHID-g9MgA-Jz.js → TransportWebHID-D6AGgWf0.js} +1 -1
- package/dist/assets/{VideoPlayer-DEViwP6l.js → VideoPlayer-BIMxsfIZ.js} +1 -1
- package/dist/assets/{_Uint8Array-VygXE9xf.js → _Uint8Array-C9DPZS3B.js} +1 -1
- package/dist/assets/{_baseClone-8AWe3BQs.js → _baseClone-DroBZ78C.js} +1 -1
- package/dist/assets/{_baseIteratee-BUY84h9-.js → _baseIteratee-D0DKZ8mg.js} +1 -1
- package/dist/assets/{_initCloneObject-BrdqfTp3.js → _initCloneObject-CydGahMP.js} +1 -1
- package/dist/assets/{add-Cz1kQmIp.js → add-DtGebwEV.js} +1 -1
- package/dist/assets/{all-wallets-DNwIxMxC.js → all-wallets-DC21EKf4.js} +1 -1
- package/dist/assets/{app-store-D8BkL0Pq.js → app-store-Dp737OsB.js} +1 -1
- package/dist/assets/{apple-s9JjX4fM.js → apple-GO8TyQ1O.js} +1 -1
- package/dist/assets/{arrow-bottom-CUpL-Y4l.js → arrow-bottom-C1EyDGXo.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-BHUOfhpA.js → arrow-bottom-circle-D4d_GIP7.js} +1 -1
- package/dist/assets/{arrow-left-HCxu6ji3.js → arrow-left-J9Ug33DL.js} +1 -1
- package/dist/assets/{arrow-right-CzJNZYfm.js → arrow-right-BoNY2r6P.js} +1 -1
- package/dist/assets/{arrow-top-CsISK4MX.js → arrow-top-CUOUpNb-.js} +1 -1
- package/dist/assets/{avatar-Druy3-7L.js → avatar-BRO4h_va.js} +1 -1
- package/dist/assets/{bank-DdCI3wdq.js → bank-Cs9AHNiP.js} +1 -1
- package/dist/assets/{basic-CPTUqGmJ.js → basic-BRgO-LhX.js} +1 -1
- package/dist/assets/{browser-BExOlcM-.js → browser-xrt8NqBm.js} +1 -1
- package/dist/assets/{byokCredential-D5tWISzn.js → byokCredential-BWyhB5yo.js} +1 -1
- package/dist/assets/{card-CSD9HBr8.js → card-B0ZQq5CA.js} +1 -1
- package/dist/assets/{castArray--oY6r8jd.js → castArray-1sgHWSEQ.js} +1 -1
- package/dist/assets/{chat-CSZjuYbz.js → chat-CQJETiRv.js} +1 -1
- package/dist/assets/{checkmark-C_0D85BY.js → checkmark-DvPd6yfd.js} +1 -1
- package/dist/assets/{checkmark-bold-DtJVlIH-.js → checkmark-bold-DxkHWQVL.js} +1 -1
- package/dist/assets/{chevron-bottom-CZUbVowq.js → chevron-bottom-r1_-8pAP.js} +1 -1
- package/dist/assets/{chevron-left-BLWOs815.js → chevron-left-B3HQXHx3.js} +1 -1
- package/dist/assets/{chevron-right-vRSDvs9G.js → chevron-right-CA5qAJ_y.js} +1 -1
- package/dist/assets/{chevron-top-d6tu702T.js → chevron-top-ByhfTCXG.js} +1 -1
- package/dist/assets/{chrome-store-DWUOB4iI.js → chrome-store-BMT85Ide.js} +1 -1
- package/dist/assets/{clock-CFj_pPxo.js → clock-j5Gkbw1v.js} +1 -1
- package/dist/assets/{close-bTdc351z.js → close-LleiXHHk.js} +1 -1
- package/dist/assets/{coinPlaceholder-CBU85LNv.js → coinPlaceholder-eJUAIcDe.js} +1 -1
- package/dist/assets/{compass-B3RQv83E.js → compass-DfkjxM8y.js} +1 -1
- package/dist/assets/{copy-5pY7Ayo3.js → copy-FIGmXBDA.js} +1 -1
- package/dist/assets/{cursor-CMq2v_mY.js → cursor-Bq_Hmx9E.js} +1 -1
- package/dist/assets/{cursor-transparent-D-F5ahU6.js → cursor-transparent-fbz3OtNH.js} +1 -1
- package/dist/assets/{debounce-CxAObiU1.js → debounce-CoJflkTH.js} +1 -1
- package/dist/assets/{desktop-Bq1htwIJ.js → desktop-G8-OR2O5.js} +1 -1
- package/dist/assets/{disconnect-DJbJaxtW.js → disconnect-CBPOxCjB.js} +1 -1
- package/dist/assets/{discord-CDRkDssn.js → discord-t-2MHydK.js} +1 -1
- package/dist/assets/{distribution-ChTHyfcK.js → distribution-CCoYwfNr.js} +1 -1
- package/dist/assets/{dropdown-CstlYUUI.js → dropdown-tirkhRzQ.js} +1 -1
- package/dist/assets/{etherscan-D3LdU21t.js → etherscan-StM9nBKC.js} +1 -1
- package/dist/assets/{exclamation-triangle-BOrjzbIU.js → exclamation-triangle-DKyRff6O.js} +1 -1
- package/dist/assets/{extension-CMHLoo5V.js → extension-C7wLtMFl.js} +1 -1
- package/dist/assets/{external-link-COhAqVzU.js → external-link-2ndWx1UY.js} +1 -1
- package/dist/assets/{facebook-GThCgRsS.js → facebook-BCApj7JU.js} +1 -1
- package/dist/assets/{farcaster-9Spv58pg.js → farcaster-BpM4Vj2j.js} +1 -1
- package/dist/assets/{filters-D7HCq0TA.js → filters-B5cRYLTc.js} +1 -1
- package/dist/assets/{flux-xsUe0L4n.js → flux-BrJXpTSb.js} +1 -1
- package/dist/assets/{github-DVepsOcq.js → github-Bws2YO-I.js} +1 -1
- package/dist/assets/{google-Dm6wqwbi.js → google-iiHML0Qc.js} +1 -1
- package/dist/assets/{hailuo-JD2nPm3W.js → hailuo-D-Ki5EZ7.js} +1 -1
- package/dist/assets/{headshots-j6w4Z4nn.js → headshots-ZqZKMcC3.js} +1 -1
- package/dist/assets/{help-circle-NEsnZirR.js → help-circle-D1MoZRkU.js} +1 -1
- package/dist/assets/{id-DrlfbE0a.js → id-BInbZian.js} +1 -1
- package/dist/assets/{image-IwV28ybr.js → image-3--wZ0mb.js} +1 -1
- package/dist/assets/{index-CkXT0bp_.js → index-4GtYUXOf.js} +1 -1
- package/dist/assets/{index-CLrAgZuB.js → index-4aCvvTMg.js} +1 -1
- package/dist/assets/{index-CaqZ7tLA.js → index-6pYd0AQ5.js} +1 -1
- package/dist/assets/{index-CvURsQ8o.js → index-6zN8vY1F.js} +1 -1
- package/dist/assets/{index-DjxM9EqE.js → index-A5Wrpldv.js} +1 -1
- package/dist/assets/{index-5n1R-g2v.js → index-AOgCYNnF.js} +1 -1
- package/dist/assets/{index-BNRwk0yK.js → index-B-9fuxvl.js} +1 -1
- package/dist/assets/{index-BGhmZQJq.js → index-B0CLpJ23.js} +3 -3
- package/dist/assets/{index-DXexZRXn.js → index-B1-mbMYf.js} +1 -1
- package/dist/assets/{index-CybFZS6J.js → index-BEhjOYe0.js} +1 -1
- package/dist/assets/{index-BQA0Ltgm.js → index-BHgD_Zxj.js} +1 -1
- package/dist/assets/{index-8U5mSU__.js → index-BWkjL97f.js} +1 -1
- package/dist/assets/{index-B_KH4K5T.js → index-BXLjYm-G.js} +1 -1
- package/dist/assets/{index-B5NM1Heh.js → index-BcH9mRpC.js} +1 -1
- package/dist/assets/{index-DnRK--rq.js → index-Bp1kxQj2.js} +1 -1
- package/dist/assets/{index-DCfKukGX.js → index-Bsenx9YS.js} +1 -1
- package/dist/assets/{index-CzJ7fWUH.js → index-BtoTXqsU.js} +1 -1
- package/dist/assets/{index-BoYTY4-k.js → index-BuazHbxk.js} +1 -1
- package/dist/assets/{index-PL08ptsm.js → index-BxORwJfw.js} +1 -1
- package/dist/assets/{index-DwY9pOO3.js → index-C25CVHv_.js} +1 -1
- package/dist/assets/{index-D4saMGlC.js → index-C3-wmF1i.js} +3 -3
- package/dist/assets/{index-Bc1i9E6A.js → index-C5cfjEdy.js} +1 -1
- package/dist/assets/{index-DfqpKGYd.js → index-Cb8tajJB.js} +1 -1
- package/dist/assets/{index-BFQ62bjd.js → index-CcbKIWRj.js} +1 -1
- package/dist/assets/{index-DgDNtUBe.js → index-Cch-QkFj.js} +1 -1
- package/dist/assets/{index-Cd6ycYIQ.js → index-CiMjOeOc.js} +1 -1
- package/dist/assets/{index-CE0UbzLZ.js → index-CihVmYXl.js} +1 -1
- package/dist/assets/{index-Du9y3uS5.js → index-CjCBvUIY.js} +1 -1
- package/dist/assets/{index-DH6MtP3d.js → index-CqSMS5t2.js} +1 -1
- package/dist/assets/{index-D86qy_Ec.js → index-CtByCn_z.js} +1 -1
- package/dist/assets/{index-DM2nGTvC.js → index-CtQ4n-0n.js} +1 -1
- package/dist/assets/{index-px2Zhx04.js → index-Cts7upbQ.js} +6 -6
- package/dist/assets/{index-DmVTvMHH.js → index-CwP-L7Jn.js} +1 -1
- package/dist/assets/{index-xePR_VqC.js → index-Cyljc7xU.js} +1 -1
- package/dist/assets/{index-CibvFWzo.js → index-D1tQ9Y-0.js} +1 -1
- package/dist/assets/{index-CJscrYLa.js → index-D46zitkg.js} +1 -1
- package/dist/assets/{index-DrUZ3nqo.js → index-D9dJeeiF.js} +1 -1
- package/dist/assets/{index-BlKyot0X.js → index-DA-dD1Jl.js} +1 -1
- package/dist/assets/{index-Ba8cJ8BF.js → index-DIecc174.js} +1 -1
- package/dist/assets/{index-BE313nKI.js → index-DKUufmbc.js} +1 -1
- package/dist/assets/{index-BqeH5oSN.js → index-DP36lBp0.js} +1 -1
- package/dist/assets/{index-CsZ8sDyV.js → index-DUD734WH.js} +1 -1
- package/dist/assets/{index-C8RMr0ye.js → index-DUfDW12r.js} +1 -1
- package/dist/assets/{index-jv4wsHGw.js → index-D_hokSbg.js} +1 -1
- package/dist/assets/{index-BlnTs38h.js → index-DdJYPSZ8.js} +1 -1
- package/dist/assets/{index-BRIRllOW.js → index-DeECMBf_.js} +1 -1
- package/dist/assets/{index-B0aR0s7l.js → index-DeILm3Lm.js} +1 -1
- package/dist/assets/{index-lU2gLszB.js → index-DhMrctEM.js} +1 -1
- package/dist/assets/{index-dQUkT91P.js → index-DkRHsTiz.js} +1 -1
- package/dist/assets/{index-Cuy1fHGt.js → index-DktIFTNG.js} +1 -1
- package/dist/assets/{index-CcP3nmgG.js → index-DrwBl4LW.js} +1 -1
- package/dist/assets/{index-Ct-EZ76M.js → index-W-5lLi59.js} +1 -1
- package/dist/assets/{index-zSPYOXLf.js → index-d754nSEm.js} +1 -1
- package/dist/assets/{index-IijLqayZ.js → index-ehWXrG6r.js} +1 -1
- package/dist/assets/{index-Du-_eOOv.js → index-gRnWIuEI.js} +1 -1
- package/dist/assets/{index-DS08GEGQ.js → index-kmmj6O3H.js} +1 -1
- package/dist/assets/{index-kfKkDYoa.js → index-oVFD45UO.js} +1 -1
- package/dist/assets/{index-DZKKK7v1.js → index-ojQZ-0Na.js} +1 -1
- package/dist/assets/{index-BOzlIWgT.js → index-qjneaEWQ.js} +1 -1
- package/dist/assets/{index-Dk3syEoj.js → index-tVsQrQB3.js} +1 -1
- package/dist/assets/{index-C5TjNMIl.js → index-xvfpY1YX.js} +1 -1
- package/dist/assets/{index.browser.esm-eOaByinL.js → index.browser.esm-DxAE6bYB.js} +1 -1
- package/dist/assets/{index.es-CJsiWXMF.js → index.es-CgtdXCC6.js} +1 -1
- package/dist/assets/{info-BRW1e-ms.js → info-DTuVkhb8.js} +1 -1
- package/dist/assets/{info-circle-1_-AyHx1.js → info-circle-B8aZXj0a.js} +1 -1
- package/dist/assets/{isEqual-BGJ5u1aM.js → isEqual-BVwuIEtt.js} +1 -1
- package/dist/assets/{isPlainObject-FvgO03a8.js → isPlainObject-LE5Z0BKi.js} +1 -1
- package/dist/assets/{kling-BRVsFe9-.js → kling-CllgAB0N.js} +1 -1
- package/dist/assets/{lightbulb-zaKLXkeH.js → lightbulb-Bddoqd6f.js} +1 -1
- package/dist/assets/{luma-DfWUj8mH.js → luma-CrZwPZoW.js} +1 -1
- package/dist/assets/{mail-d1BdmBbl.js → mail-lxk9XrFu.js} +1 -1
- package/dist/assets/{midjourney-DSdTP5Tn.js → midjourney-BgaPEskw.js} +1 -1
- package/dist/assets/{mobile-4YqoweeP.js → mobile-D85WCQ74.js} +1 -1
- package/dist/assets/{more-Dlqz0Wmh.js → more-CkrCI7BU.js} +1 -1
- package/dist/assets/{nanobanana-C9LKS_-F.js → nanobanana-Du2hqGdp.js} +1 -1
- package/dist/assets/{network-placeholder-CHkxXSHz.js → network-placeholder-hlXffsa-.js} +1 -1
- package/dist/assets/{nftPlaceholder-CFm-dpil.js → nftPlaceholder-DKN0p6w-.js} +1 -1
- package/dist/assets/{off-CfRl1GFl.js → off-MQ0sA5Sf.js} +1 -1
- package/dist/assets/{openaiimage-BUKB6K30.js → openaiimage-BIemzuOc.js} +1 -1
- package/dist/assets/{order-CxrIyP-W.js → order-BdyaUXL1.js} +1 -1
- package/dist/assets/{pika-ClpqVGkS.js → pika-BkmNvjmj.js} +1 -1
- package/dist/assets/{pixverse-Db8L75Hi.js → pixverse-CUcd8zP7.js} +1 -1
- package/dist/assets/{play-store-B-sfJfHF.js → play-store-CtD1k_IV.js} +1 -1
- package/dist/assets/{plus-BtfywZ6R.js → plus-CHmxJMBE.js} +1 -1
- package/dist/assets/{price-B613-HvG.js → price-DFVz0G2x.js} +1 -1
- package/dist/assets/{producer-DJI_SemU.js → producer-C11oYAED.js} +1 -1
- package/dist/assets/{qr-code-CLnLRCmw.js → qr-code-BjyCVKUG.js} +1 -1
- package/dist/assets/{qrart-BKVimfc5.js → qrart-stzjYd7f.js} +1 -1
- package/dist/assets/{recycle-horizontal-BI_ebh8O.js → recycle-horizontal-gFcPvavZ.js} +1 -1
- package/dist/assets/{refresh-_PZdGsGX.js → refresh-DOo0dDz1.js} +1 -1
- package/dist/assets/{reown-logo-DAXTKp5Y.js → reown-logo-BMzy86Un.js} +1 -1
- package/dist/assets/{search-CnVf77t4.js → search-Bu2yWC61.js} +1 -1
- package/dist/assets/{secp256k1-HnMd7e19.js → secp256k1-C5uygoFx.js} +1 -1
- package/dist/assets/{secp256k1-7aDBzeS0.js → secp256k1-uTVZUax5.js} +1 -1
- package/dist/assets/{seedance-BsAeQbE1.js → seedance-CNA3BM5x.js} +1 -1
- package/dist/assets/{seedream-CwBlmKAY.js → seedream-BM6rc29H.js} +1 -1
- package/dist/assets/{send-DVIaP7Mb.js → send-lM2ABsZR.js} +1 -1
- package/dist/assets/{service-BUHkgbHC.js → service-DHjmK6Sn.js} +1 -1
- package/dist/assets/{solana-wallets-tx89ATa5.js → solana-wallets-CbDWY_Sx.js} +2 -2
- package/dist/assets/{solana-wallets-vue-BF-VzZci.js → solana-wallets-vue-FX4EgLdC.js} +1 -1
- package/dist/assets/{solanaEmbed.esm-Czl9MkQu.js → solanaEmbed.esm-CJWS0At0.js} +1 -1
- package/dist/assets/{sora-WcFwuWvC.js → sora-GraFvpkr.js} +1 -1
- package/dist/assets/{string_decoder-Cah4Ye0i.js → string_decoder-RZG7VgES.js} +1 -1
- package/dist/assets/{suno-C4isUiaT.js → suno-DorMHjy1.js} +1 -1
- package/dist/assets/{swapHorizontal-7y69r0kJ.js → swapHorizontal-CsF3En4b.js} +1 -1
- package/dist/assets/{swapHorizontalBold-CscWZwpS.js → swapHorizontalBold-BZVR2abG.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-DjZLxk5c.js → swapHorizontalMedium-TY64VjPd.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-CksUUifL.js → swapHorizontalRoundedBold-CmORS4ap.js} +1 -1
- package/dist/assets/{swapVertical-DQEW74eG.js → swapVertical-baqm-3CI.js} +1 -1
- package/dist/assets/{telegram-C0TZ8uk3.js → telegram-Cit6E9HT.js} +1 -1
- package/dist/assets/{three-dots-CNdNeyDX.js → three-dots-BeCoJ1XG.js} +1 -1
- package/dist/assets/{twitch-YWracmhG.js → twitch-CxwUOrfB.js} +1 -1
- package/dist/assets/{twitterIcon-DTaKm5Pg.js → twitterIcon-D7a7mvgZ.js} +1 -1
- package/dist/assets/{typescript-ClSWGTjJ.js → typescript-pqBgKOiU.js} +1 -1
- package/dist/assets/{use-form-item-DcOclXCw.js → use-form-item-DtuhYcUh.js} +1 -1
- package/dist/assets/validator-Dyj2d5gI.js +1 -0
- package/dist/assets/{veo-BFM7txtt.js → veo-CP2ukGMM.js} +1 -1
- package/dist/assets/{verify-BpxyocpC.js → verify-DC9wh4ku.js} +1 -1
- package/dist/assets/{verify-filled-Bg4tbt-Y.js → verify-filled-CbGZuYZ1.js} +1 -1
- package/dist/assets/{w3m-modal-B0NwKrWR.js → w3m-modal-p34KAyMv.js} +1 -1
- package/dist/assets/{wallet-DGOOLbkp.js → wallet-BHWNg1RN.js} +1 -1
- package/dist/assets/{wallet-placeholder-DF6j6Qx5.js → wallet-placeholder-BA8OOZwF.js} +1 -1
- package/dist/assets/{walletconnect-DMT_cel4.js → walletconnect-DR46CyF-.js} +1 -1
- package/dist/assets/{wan-BE7U8W1r.js → wan-C6x5qS0c.js} +1 -1
- package/dist/assets/{warning-circle-RVrUVt3i.js → warning-circle-DDRVgv8z.js} +1 -1
- package/dist/assets/{web-DJAybi8o.js → web-9VCOxlvD.js} +1 -1
- package/dist/assets/{web-WM85CJkA.js → web-C4FwrKNF.js} +1 -1
- package/dist/assets/{x-DchvA95X.js → x-B6rubTvu.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Index-BesDD4FO.js +0 -1
- package/dist/assets/validator-BVNDYkbY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as L}from"./index.es-CJsiWXMF.js";import{E as S}from"./index-DwY9pOO3.js";import{E as R}from"./index-C5TjNMIl.js";import{d as b,H as c,E as i,z as V,C as t,y as u,D as o,q as a,F as n,O as C,N as G,x as v,I as p,J as h,M as A,Q as I}from"./vendor-vue-DU0w5ewx.js";import{D as k,b0 as M,ao as U}from"./index-D4saMGlC.js";import{a as D}from"./hailuo-C8Dw-0xR.js";import{E as j,a as B}from"./index-CzJ7fWUH.js";import{p as q}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as O}from"./ScrollList-DRIMxtWX.js";import{I as z}from"./ImagePreview-VbvXxzqA.js";import{E as F}from"./index-dQUkT91P.js";import{E}from"./index-Ct-EZ76M.js";import{E as N}from"./index-DH6MtP3d.js";import{C as H}from"./Consumption--BQQHppN.js";import{a as J}from"./price-B613-HvG.js";import{b as K}from"./errorCode-Cqj9Td_Z.js";import{h as Q}from"./hailuo-JD2nPm3W.js";import{C as W}from"./CopyToClipboard-B6G-wNJD.js";import{V as X}from"./VideoPlayer-DEViwP6l.js";import{E as Y}from"./index-DXexZRXn.js";import{E as Z}from"./index-CcP3nmgG.js";import{E as x}from"./index-jv4wsHGw.js";import{B as ee}from"./BotPlaceholder-C5ljOz4A.js";import{N as te}from"./NoTasks-BeyOLEbn.js";import{l as oe}from"./pagination-CcnL0MdN.js";import"./use-form-item-DcOclXCw.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-DmVTvMHH.js";import"./typescript-ClSWGTjJ.js";import"./index-B_KH4K5T.js";import"./strings-DigWlKo9.js";import"./isEqual-BGJ5u1aM.js";import"./_Uint8Array-VygXE9xf.js";import"./castArray--oY6r8jd.js";import"./debounce-CxAObiU1.js";import"./_baseIteratee-BUY84h9-.js";import"./index-C8RMr0ye.js";import"./index-8U5mSU__.js";import"./_baseClone-8AWe3BQs.js";import"./_initCloneObject-BrdqfTp3.js";import"./index-Cuy1fHGt.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CvURsQ8o.js";const se=b({name:"LayoutHailuo",components:{ElDrawer:R,ElButton:S,FontAwesomeIcon:L},data(){return{drawer:!1}}}),ae={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)]"},le={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ie(e,s,f,g,w,y){const d=o("font-awesome-icon"),m=o("el-button"),r=o("el-drawer");return a(),c("div",ae,[i("div",ne,[V(e.$slots,"config",{},void 0,!0)]),i("div",le,[V(e.$slots,"result",{},void 0,!0)]),t(m,{circle:"",class:"menu",onClick:s[0]||(s[0]=_=>e.drawer=!0)},{default:u(()=>[t(d,{icon:"fa-solid fa-magic"})]),_:1}),t(r,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px"},{default:u(()=>[V(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const re=k(se,[["render",ie],["__scopeId","data-v-fa61db7a"]]),ce=b({name:"ModelSelector",components:{ElSelect:B,ElOption:j},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")},{value:"minimax-i2v-director",label:this.$t("hailuo.button.model3")}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||(this.value=D)}}),ue={class:"field"},de={class:"title font-bold"},me={class:"float-left"};function pe(e,s,f,g,w,y){const d=o("el-option"),m=o("el-select");return a(),c("div",ue,[i("h2",de,n(e.$t("hailuo.name.model")),1),t(m,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=r=>e.value=r),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:u(()=>[(a(!0),c(C,null,G(e.options,r=>(a(),v(d,{key:r.value,label:r.label,value:r.value},{default:u(()=>[i("span",me,n(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const he=k(ce,[["render",pe],["__scopeId","data-v-a768fbd9"]]),fe=b({name:"StartImageUrlInput",components:{ElUpload:F,ElButton:S,InfoIcon:P,ImagePreview:z},mixins:[q],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){E.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){E.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),ge={class:"relative"},_e={class:"flex justify-between"},$e={class:"flex justify-start items-center"},ve={class:"text-sm font-bold"};function be(e,s,f,g,w,y){const d=o("info-icon"),m=o("image-preview"),r=o("el-button"),_=o("el-upload");return a(),c("div",ge,[i("div",_e,[i("div",$e,[i("span",ve,n(e.$t("hailuo.name.startImageUrl")),1),t(d,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),t(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":s[0]||(s[0]=l=>e.fileList=l),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"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:l})=>[l.url&&l.percentage!==void 0?(a(),v(m,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:$=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):h("",!0)]),default:u(()=>[t(r,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:u(()=>[p(n(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const ke=k(fe,[["render",be],["__scopeId","data-v-48f4a681"]]),we="",ye=b({name:"PromptInput",components:{ElInput:N,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=we)}}),Ee={class:"field"},Se={class:"box"},Ie={class:"title font-bold"};function Te(e,s,f,g,w,y){const d=o("info-icon"),m=o("el-input");return a(),c("div",Ee,[i("div",Se,[i("h2",Ie,n(e.$t("hailuo.name.prompt")),1),t(d,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),t(m,{modelValue:e.prompt,"onUpdate:modelValue":s[0]||(s[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ve=k(ye,[["render",Te],["__scopeId","data-v-c601bcba"]]),Ce=b({name:"PresetPanel",components:{ElButton:S,FontAwesomeIcon:L,PromptInput:Ve,StartImageUrlInput:ke,ModelSelector:he,Consumption:H},emits:["generate"],computed:{config(){return this.$store.state.hailuo?.config},consumption(){return J(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Le={class:"flex flex-col h-full"},Ue={class:"flex-1 overflow-y-auto p-5"},Ge={class:"flex flex-col items-center justify-center px-5 pb-5"};function Pe(e,s,f,g,w,y){const d=o("prompt-input"),m=o("model-selector"),r=o("start-image-url-input"),_=o("consumption"),l=o("font-awesome-icon"),$=o("el-button");return a(),c("div",Le,[i("div",Ue,[t(d,{class:"mb-4"}),t(m,{class:"mb-4"}),e.config?.model==="minimax-i2v"?(a(),v(r,{key:0,class:"mb-2"})):h("",!0)]),i("div",Ge,[t(_,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),v($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),p(" "+n(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(a(),v($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),p(" "+n(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])}const Re=k(Ce,[["render",Pe]]),Ae=b({name:"TaskPreview",components:{ElImage:x,CopyToClipboard:W,FontAwesomeIcon:L,ElAlert:Z,VideoPlayer:X,ElTooltip:Y,ElButton:S},props:{modelValue:{type:Object,required:!0}},computed:{application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{onDownload(e){console.debug("on download hailuo video",e),window.open(e,"_blank")}}}),Me={class:"preview"},De={class:"left"},je={class:"main"},Be={class:"bot"},qe={class:"datetime"},Oe={class:"info"},ze={key:0,class:"prompt mt-2"},Fe={key:0},Ne={key:1},He={key:0,class:I({content:!0,failed:!0})},Je={key:0,class:"mb-4"},Ke={key:1,class:I({operations:!0,"mt-2":!0})},Qe={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},We={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Xe={key:1,class:I({content:!0})},Ye={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ze={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xe={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},et={key:2,class:I({content:!0})},tt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function ot(e,s,f,g,w,y){const d=o("el-image"),m=o("video-player"),r=o("el-button"),_=o("el-tooltip"),l=o("font-awesome-icon"),$=o("copy-to-clipboard"),T=o("el-alert");return a(),c("div",Me,[i("div",De,[t(d,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),i("div",je,[i("div",Be,[p(n(e.$t("hailuo.name.hailuoBot"))+" ",1),i("span",qe,n(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",Oe,[e.modelValue?.request?.prompt?(a(),c("p",ze,[p(n(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?h("",!0):(a(),c("span",Fe," - ("+n(e.$t("hailuo.status.pending"))+") ",1)),e.video?.state==="processing"||e.video?.state==="pending"||e.video?.state==="running"?(a(),c("span",Ne," - ("+n(e.$t("hailuo.status.processing"))+") ",1)):h("",!0)])):h("",!0)]),e.modelValue?.response?.success===!0?(a(),c("div",He,[e.video?.video_url?(a(),c("div",Je,[t(m,{src:e.video?.video_url},null,8,["src"])])):h("",!0),e.video?(a(),c("div",Ke,[t(_,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.video?.video_url?(a(),v(r,{key:0,type:"info",size:"small",class:"mb-2",onClick:s[0]||(s[0]=A(mt=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[p(n(e.$t("hailuo.button.download")),1)]),_:1})):h("",!0)]),_:1},8,["content"])])):h("",!0),t(T,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(a(),c("p",Qe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.model"))+": "+n(e.modelValue?.request?.model)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])):h("",!0),i("p",We,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):h("",!0),e.modelValue?.response?.success===!1?(a(),c("div",Xe,[t(T,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.failure")),1)]),default:u(()=>[i("p",Ye,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),i("p",Ze,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.failureReason"))+": "+n(e.modelValue?.response?.error?.message)+" ",1),t($,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),i("p",xe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t($,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):h("",!0),e.modelValue?.response?.success===void 0?(a(),c("div",et,[t(T,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.failure")),1)]),default:u(()=>[i("p",tt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):h("",!0)])])}const st=k(Ae,[["render",ot],["__scopeId","data-v-48b0ddf9"]]),at=b({name:"RecentPanel",components:{TaskPreview:st,BotPlaceholder:ee,NoTasks:te,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),nt={key:0},lt={key:2,class:"w-full h-full flex items-center justify-center"};function it(e,s,f,g,w,y){const d=o("bot-placeholder"),m=o("task-preview"),r=o("scroll-list"),_=o("no-tasks");return a(),c(C,null,[e.tasks?.items===void 0?(a(),c("div",nt,[t(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),v(r,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:s[0]||(s[0]=l=>e.$emit("reach-top"))},{default:u(()=>[(a(!0),c(C,null,G(e.tasks?.items,l=>(a(),v(m,{key:l.id,"model-value":l},null,8,["model-value"]))),128))]),_:1},8,["loading"])):h("",!0),e.tasks?.items?.length===0?(a(),c("div",lt,[t(_)])):h("",!0)],64)}const rt=k(at,[["render",it]]),ct="https://webhook.acedata.cloud/hailuo",ut=b({name:"HailuoIndex",components:{ConfigPanel:Re,Layout:re,RecentPanel:rt},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===U.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,s){e?.items?.length>s?.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 oe({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("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/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:s=5,createdAtMin:f,createdAtMax:g}=e||{};console.debug("limit",s,"createdAtMin",f,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("hailuo/getTasks",{limit:s,createdAtMin:f,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:ct},s=this.credential?.token;if(!s){console.error("no token specified");return}E.info(this.$t("hailuo.message.startingTask")),Q.generate(e,{token:s}).then(()=>{E.success(this.$t("hailuo.message.startTaskSuccess"))}).catch(f=>{f?.response?.data?.error?.code===K?E.error(this.$t("hailuo.message.usedUp")):E.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function dt(e,s,f,g,w,y){const d=o("config-panel"),m=o("recent-panel"),r=o("layout");return a(),v(r,null,{config:u(()=>[t(d,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(m,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const no=k(ut,[["render",dt]]);export{no as default};
|
|
1
|
+
import{F as L}from"./index.es-CgtdXCC6.js";import{E as S}from"./index-C25CVHv_.js";import{E as R}from"./index-xvfpY1YX.js";import{d as b,H as c,E as i,z as V,C as t,y as u,D as o,q as a,F as n,O as C,N as G,x as v,I as p,J as h,M as A,Q as I}from"./vendor-vue-DU0w5ewx.js";import{D as k,b0 as M,ao as U}from"./index-C3-wmF1i.js";import{a as D}from"./hailuo-C8Dw-0xR.js";import{E as j,a as B}from"./index-BtoTXqsU.js";import{p as q}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as O}from"./ScrollList-Cu2yoCEI.js";import{I as z}from"./ImagePreview-DArls9pq.js";import{E as F}from"./index-DkRHsTiz.js";import{E}from"./index-W-5lLi59.js";import{E as N}from"./index-CqSMS5t2.js";import{C as H}from"./Consumption-GxTGyrc1.js";import{a as J}from"./price-DFVz0G2x.js";import{b as K}from"./errorCode-Cqj9Td_Z.js";import{h as Q}from"./hailuo-D-Ki5EZ7.js";import{C as W}from"./CopyToClipboard-C36KVGrD.js";import{V as X}from"./VideoPlayer-BIMxsfIZ.js";import{E as Y}from"./index-B1-mbMYf.js";import{E as Z}from"./index-DrwBl4LW.js";import{E as x}from"./index-D_hokSbg.js";import{B as ee}from"./BotPlaceholder-BQlSeXx6.js";import{N as te}from"./NoTasks-b4OJIqL7.js";import{l as oe}from"./pagination-CcnL0MdN.js";import"./use-form-item-DtuhYcUh.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-CwP-L7Jn.js";import"./typescript-pqBgKOiU.js";import"./index-BXLjYm-G.js";import"./strings-DigWlKo9.js";import"./isEqual-BVwuIEtt.js";import"./_Uint8Array-C9DPZS3B.js";import"./castArray-1sgHWSEQ.js";import"./debounce-CoJflkTH.js";import"./_baseIteratee-D0DKZ8mg.js";import"./index-DUfDW12r.js";import"./index-BWkjL97f.js";import"./_baseClone-DroBZ78C.js";import"./_initCloneObject-CydGahMP.js";import"./index-DktIFTNG.js";import"./vue-plyr-BO2nlN4c.js";import"./index-6zN8vY1F.js";const se=b({name:"LayoutHailuo",components:{ElDrawer:R,ElButton:S,FontAwesomeIcon:L},data(){return{drawer:!1}}}),ae={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)]"},le={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ie(e,s,f,g,w,y){const d=o("font-awesome-icon"),m=o("el-button"),r=o("el-drawer");return a(),c("div",ae,[i("div",ne,[V(e.$slots,"config",{},void 0,!0)]),i("div",le,[V(e.$slots,"result",{},void 0,!0)]),t(m,{circle:"",class:"menu",onClick:s[0]||(s[0]=_=>e.drawer=!0)},{default:u(()=>[t(d,{icon:"fa-solid fa-magic"})]),_:1}),t(r,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px"},{default:u(()=>[V(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const re=k(se,[["render",ie],["__scopeId","data-v-fa61db7a"]]),ce=b({name:"ModelSelector",components:{ElSelect:B,ElOption:j},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")},{value:"minimax-i2v-director",label:this.$t("hailuo.button.model3")}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||(this.value=D)}}),ue={class:"field"},de={class:"title font-bold"},me={class:"float-left"};function pe(e,s,f,g,w,y){const d=o("el-option"),m=o("el-select");return a(),c("div",ue,[i("h2",de,n(e.$t("hailuo.name.model")),1),t(m,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=r=>e.value=r),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:u(()=>[(a(!0),c(C,null,G(e.options,r=>(a(),v(d,{key:r.value,label:r.label,value:r.value},{default:u(()=>[i("span",me,n(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const he=k(ce,[["render",pe],["__scopeId","data-v-a768fbd9"]]),fe=b({name:"StartImageUrlInput",components:{ElUpload:F,ElButton:S,InfoIcon:P,ImagePreview:z},mixins:[q],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){E.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){E.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),ge={class:"relative"},_e={class:"flex justify-between"},$e={class:"flex justify-start items-center"},ve={class:"text-sm font-bold"};function be(e,s,f,g,w,y){const d=o("info-icon"),m=o("image-preview"),r=o("el-button"),_=o("el-upload");return a(),c("div",ge,[i("div",_e,[i("div",$e,[i("span",ve,n(e.$t("hailuo.name.startImageUrl")),1),t(d,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),t(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":s[0]||(s[0]=l=>e.fileList=l),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"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:l})=>[l.url&&l.percentage!==void 0?(a(),v(m,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:$=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):h("",!0)]),default:u(()=>[t(r,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:u(()=>[p(n(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const ke=k(fe,[["render",be],["__scopeId","data-v-48f4a681"]]),we="",ye=b({name:"PromptInput",components:{ElInput:N,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=we)}}),Ee={class:"field"},Se={class:"box"},Ie={class:"title font-bold"};function Te(e,s,f,g,w,y){const d=o("info-icon"),m=o("el-input");return a(),c("div",Ee,[i("div",Se,[i("h2",Ie,n(e.$t("hailuo.name.prompt")),1),t(d,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),t(m,{modelValue:e.prompt,"onUpdate:modelValue":s[0]||(s[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ve=k(ye,[["render",Te],["__scopeId","data-v-c601bcba"]]),Ce=b({name:"PresetPanel",components:{ElButton:S,FontAwesomeIcon:L,PromptInput:Ve,StartImageUrlInput:ke,ModelSelector:he,Consumption:H},emits:["generate"],computed:{config(){return this.$store.state.hailuo?.config},consumption(){return J(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Le={class:"flex flex-col h-full"},Ue={class:"flex-1 overflow-y-auto p-5"},Ge={class:"flex flex-col items-center justify-center px-5 pb-5"};function Pe(e,s,f,g,w,y){const d=o("prompt-input"),m=o("model-selector"),r=o("start-image-url-input"),_=o("consumption"),l=o("font-awesome-icon"),$=o("el-button");return a(),c("div",Le,[i("div",Ue,[t(d,{class:"mb-4"}),t(m,{class:"mb-4"}),e.config?.model==="minimax-i2v"?(a(),v(r,{key:0,class:"mb-2"})):h("",!0)]),i("div",Ge,[t(_,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),v($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),p(" "+n(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(a(),v($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),p(" "+n(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])}const Re=k(Ce,[["render",Pe]]),Ae=b({name:"TaskPreview",components:{ElImage:x,CopyToClipboard:W,FontAwesomeIcon:L,ElAlert:Z,VideoPlayer:X,ElTooltip:Y,ElButton:S},props:{modelValue:{type:Object,required:!0}},computed:{application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{onDownload(e){console.debug("on download hailuo video",e),window.open(e,"_blank")}}}),Me={class:"preview"},De={class:"left"},je={class:"main"},Be={class:"bot"},qe={class:"datetime"},Oe={class:"info"},ze={key:0,class:"prompt mt-2"},Fe={key:0},Ne={key:1},He={key:0,class:I({content:!0,failed:!0})},Je={key:0,class:"mb-4"},Ke={key:1,class:I({operations:!0,"mt-2":!0})},Qe={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},We={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Xe={key:1,class:I({content:!0})},Ye={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ze={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xe={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},et={key:2,class:I({content:!0})},tt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function ot(e,s,f,g,w,y){const d=o("el-image"),m=o("video-player"),r=o("el-button"),_=o("el-tooltip"),l=o("font-awesome-icon"),$=o("copy-to-clipboard"),T=o("el-alert");return a(),c("div",Me,[i("div",De,[t(d,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),i("div",je,[i("div",Be,[p(n(e.$t("hailuo.name.hailuoBot"))+" ",1),i("span",qe,n(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",Oe,[e.modelValue?.request?.prompt?(a(),c("p",ze,[p(n(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?h("",!0):(a(),c("span",Fe," - ("+n(e.$t("hailuo.status.pending"))+") ",1)),e.video?.state==="processing"||e.video?.state==="pending"||e.video?.state==="running"?(a(),c("span",Ne," - ("+n(e.$t("hailuo.status.processing"))+") ",1)):h("",!0)])):h("",!0)]),e.modelValue?.response?.success===!0?(a(),c("div",He,[e.video?.video_url?(a(),c("div",Je,[t(m,{src:e.video?.video_url},null,8,["src"])])):h("",!0),e.video?(a(),c("div",Ke,[t(_,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.video?.video_url?(a(),v(r,{key:0,type:"info",size:"small",class:"mb-2",onClick:s[0]||(s[0]=A(mt=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[p(n(e.$t("hailuo.button.download")),1)]),_:1})):h("",!0)]),_:1},8,["content"])])):h("",!0),t(T,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(a(),c("p",Qe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.model"))+": "+n(e.modelValue?.request?.model)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])):h("",!0),i("p",We,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):h("",!0),e.modelValue?.response?.success===!1?(a(),c("div",Xe,[t(T,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.failure")),1)]),default:u(()=>[i("p",Ye,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),i("p",Ze,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.failureReason"))+": "+n(e.modelValue?.response?.error?.message)+" ",1),t($,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),i("p",xe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t($,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):h("",!0),e.modelValue?.response?.success===void 0?(a(),c("div",et,[t(T,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.failure")),1)]),default:u(()=>[i("p",tt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),p(" "+n(e.$t("hailuo.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):h("",!0)])])}const st=k(Ae,[["render",ot],["__scopeId","data-v-48b0ddf9"]]),at=b({name:"RecentPanel",components:{TaskPreview:st,BotPlaceholder:ee,NoTasks:te,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),nt={key:0},lt={key:2,class:"w-full h-full flex items-center justify-center"};function it(e,s,f,g,w,y){const d=o("bot-placeholder"),m=o("task-preview"),r=o("scroll-list"),_=o("no-tasks");return a(),c(C,null,[e.tasks?.items===void 0?(a(),c("div",nt,[t(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),v(r,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:s[0]||(s[0]=l=>e.$emit("reach-top"))},{default:u(()=>[(a(!0),c(C,null,G(e.tasks?.items,l=>(a(),v(m,{key:l.id,"model-value":l},null,8,["model-value"]))),128))]),_:1},8,["loading"])):h("",!0),e.tasks?.items?.length===0?(a(),c("div",lt,[t(_)])):h("",!0)],64)}const rt=k(at,[["render",it]]),ct="https://webhook.acedata.cloud/hailuo",ut=b({name:"HailuoIndex",components:{ConfigPanel:Re,Layout:re,RecentPanel:rt},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===U.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,s){e?.items?.length>s?.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 oe({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("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/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:s=5,createdAtMin:f,createdAtMax:g}=e||{};console.debug("limit",s,"createdAtMin",f,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("hailuo/getTasks",{limit:s,createdAtMin:f,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:ct},s=this.credential?.token;if(!s){console.error("no token specified");return}E.info(this.$t("hailuo.message.startingTask")),Q.generate(e,{token:s}).then(()=>{E.success(this.$t("hailuo.message.startTaskSuccess"))}).catch(f=>{f?.response?.data?.error?.code===K?E.error(this.$t("hailuo.message.usedUp")):E.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function dt(e,s,f,g,w,y){const d=o("config-panel"),m=o("recent-panel"),r=o("layout");return a(),v(r,null,{config:u(()=>[t(d,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(m,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const no=k(ut,[["render",dt]]);export{no as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as z}from"./index.es-CJsiWXMF.js";import{E as B}from"./index-DwY9pOO3.js";import{E as ye}from"./index-C5TjNMIl.js";import{d as A,H as u,E as s,z as ne,C as o,y as a,D as l,q as n,Q as G,F as i,O as M,N as D,J as c,x as b,I as v,U as ie,G as O,K as q,M as U,u as j,c as H,w as Pe,L as Ue}from"./vendor-vue-DU0w5ewx.js";import{D as E,E as Ee,aZ as le,b0 as Ie,e2 as re,e3 as de,R as x,G as be,ao as Z,e4 as ee,e5 as Re,a6 as Le}from"./index-D4saMGlC.js";import{a as Me}from"./errorCode-Cqj9Td_Z.js";import{s as L}from"./suno-C4isUiaT.js";import{b as Fe}from"./suno-DFuCGH70.js";import{E as De}from"./index-DnRK--rq.js";import{E as ue,a as ce}from"./index-CzJ7fWUH.js";import{I as F,S as ze}from"./ScrollList-DRIMxtWX.js";import{E as te,a as J,b as je}from"./index-CLrAgZuB.js";import{E as ke,a as we}from"./index-BoYTY4-k.js";import{E as Ge}from"./index-dQUkT91P.js";import{E as w}from"./index-Ct-EZ76M.js";import{E as W}from"./index-DH6MtP3d.js";import{E as pe}from"./index-DXexZRXn.js";import{u as X,F as Be,O as Oe,_ as fe,P as Ne,a as He,V as qe,E as We}from"./IconPark.vue_vue_type_script_setup_true_lang-CMyYNZf7.js";import{E as oe,a as me}from"./index-IijLqayZ.js";import{E as N}from"./index-jv4wsHGw.js";import{E as Ke,a as Qe}from"./index-Dk3syEoj.js";import{E as Je,a as Ye}from"./index-BFQ62bjd.js";import{E as Ce}from"./index-zSPYOXLf.js";import{C as Ze}from"./Consumption--BQQHppN.js";import{a as Xe}from"./price-B613-HvG.js";import{E as xe}from"./index-BQA0Ltgm.js";import{E as et}from"./index-8U5mSU__.js";import{E as Ve,b as Se,a as Te}from"./index-lU2gLszB.js";import{E as Ae}from"./index-BE313nKI.js";import{N as tt}from"./NoTasks-BeyOLEbn.js";import{a as ot,E as st}from"./index-CvURsQ8o.js";import{l as nt}from"./pagination-CcnL0MdN.js";import"./use-form-item-DcOclXCw.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./validator-BVNDYkbY.js";import"./index-B_KH4K5T.js";import"./index-DmVTvMHH.js";import"./typescript-ClSWGTjJ.js";import"./strings-DigWlKo9.js";import"./isEqual-BGJ5u1aM.js";import"./_Uint8Array-VygXE9xf.js";import"./castArray--oY6r8jd.js";import"./debounce-CxAObiU1.js";import"./_baseIteratee-BUY84h9-.js";import"./index-C8RMr0ye.js";import"./_baseClone-8AWe3BQs.js";import"./_initCloneObject-BrdqfTp3.js";import"./isPlainObject-FvgO03a8.js";import"./index-Cuy1fHGt.js";import"./index-Bz0iDXPF.js";import"./index-DfqpKGYd.js";import"./dropdown-CstlYUUI.js";const it=A({name:"LayoutSuno",components:{ElDrawer:ye,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1,preview:!1}},computed:{}}),at={class:"main flex flex-row flex-1"},lt={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},rt={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},dt={class:"preview h-full w-[300px] flex flex-col"};function ut(e,t,d,r,m,y){const $=l("font-awesome-icon"),p=l("el-button"),f=l("el-drawer");return n(),u("div",at,[s("div",lt,[ne(e.$slots,"config",{},void 0,!0)]),s("div",rt,[ne(e.$slots,"result",{},void 0,!0)]),s("div",dt,[ne(e.$slots,"preview",{},void 0,!0)]),o(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=k=>e.drawer=!0)},{default:a(()=>[o($,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=k=>e.drawer=k),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:a(()=>[ne(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ct=E(it,[["render",ut],["__scopeId","data-v-c6c85757"]]),pt=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:De,ElTag:Ee},data(){return{options:[{label:"v5.5",value:"chirp-v5-5",desc:this.$t("suno.model.v55desc"),pro:!0},{label:"v5",value:"chirp-v5",desc:this.$t("suno.model.v5desc"),pro:!0},{label:"v4.5+",value:"chirp-v4-5-plus",desc:this.$t("suno.model.v45plusdesc"),pro:!0},{label:"v4.5",value:"chirp-v4-5",desc:this.$t("suno.model.v45desc"),pro:!0,dividerAfter:!0},{label:"v4",value:"chirp-v4",desc:this.$t("suno.model.v4desc")},{label:"v3.5",value:"chirp-v3-5",desc:this.$t("suno.model.v35desc")},{label:"v3",value:"chirp-v3-0",desc:this.$t("suno.model.v3desc")}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||(this.model=Fe)}}),mt={class:"mode-tabs mb-3"},ft={class:"mb-3"},ht={class:"flex items-center mb-1"},gt={class:"text-sm font-bold"},$t={class:"model-option"},_t={class:"model-option-left"},vt={class:"model-option-name"},yt={class:"model-option-desc"},bt={key:0,class:"flex items-center justify-between mb-3"},kt={class:"text-sm font-bold"};function wt(e,t,d,r,m,y){const $=l("el-tag"),p=l("el-option"),f=l("el-select"),k=l("el-switch");return n(),u("div",null,[s("div",mt,[s("button",{class:G(["mode-tab",{active:!e.custom}]),onClick:t[0]||(t[0]=g=>e.custom=!1)},i(e.$t("suno.mode.simple")),3),s("button",{class:G(["mode-tab",{active:e.custom}]),onClick:t[1]||(t[1]=g=>e.custom=!0)},i(e.$t("suno.mode.custom")),3)]),s("div",ft,[s("div",ht,[s("span",gt,i(e.$t("suno.name.model")),1)]),o(f,{modelValue:e.model,"onUpdate:modelValue":t[2]||(t[2]=g=>e.model=g),class:"w-full model-select",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:a(()=>[(n(!0),u(M,null,D(e.options,g=>(n(),b(p,{key:g.value,label:g.label,value:g.value,class:G({"model-option-divider":g.dividerAfter})},{default:a(()=>[s("div",$t,[s("div",_t,[s("span",vt,i(g.label),1),g.pro?(n(),b($,{key:0,size:"small",type:"warning",effect:"plain",class:"model-option-pro"},{default:a(()=>[...t[4]||(t[4]=[v("Pro",-1)])]),_:1})):c("",!0)]),s("span",yt,i(g.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",bt,[s("span",kt,i(e.$t("suno.name.instrumental")),1),o(k,{modelValue:e.instrumental,"onUpdate:modelValue":t[3]||(t[3]=g=>e.instrumental=g)},null,8,["modelValue"])])):c("",!0)])}const Ct=E(pt,[["render",wt],["__scopeId","data-v-a6ada414"]]),Vt=A({name:"UploadAudio",components:{ElUpload:Ge,ElButton:B,ElDialog:le,ElTabs:we,ElTabPane:ke,InfoIcon:F,FontAwesomeIcon:z,ElRadioGroup:J,ElRadioButton:te},emits:["change"],data(){return{fileList:[],uploadUrl:Ie()+"/api/v1/files/",dialogVisible:!1,activeTab:"browse",recording:!1,recordedBlob:null,recordedAudioUrl:null,audioPreviewUrl:null,recordTimer:null,recordSeconds:0,mediaRecorder:null,mediaStream:null,recordedChunks:[],uploadingRecord:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}},hasUploadedAudio(){const e=this.$store.state.suno?.config?.action;return e==="upload_extend"||e==="upload_cover"},uploadAction:{get(){return this.$store.state.suno?.config?.action||"upload_extend"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,action:e})}},formattedTime(){const e=Math.floor(this.recordSeconds/60).toString().padStart(2,"0"),t=(this.recordSeconds%60).toString().padStart(2,"0");return`${e}:${t}`}},watch:{urls:{handler(e){this.$emit("change",e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){w.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){w.error(this.$t("suno.message.uploadReferencesError"))},async onBrowseSuccess(){const e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){const t={audio_url:e},d=this.credential?.token;if(!d){console.error("no token specified");return}w.info(this.$t("suno.message.startingUploadAudio"));try{const r=await L.upload(t,{token:d});console.debug("get upload music success",r.data);const m=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:m,action:"upload_extend"}),w.success(this.$t("suno.message.startUploadAudioSuccess"))}catch(r){w.error(r?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){w.error(this.$t("suno.message.recordingUnsupported"));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{const e=new Blob(this.recordedChunks,{type:"audio/webm"});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error("record error",e),w.error(this.$t("suno.message.recordingPermissionDenied"))}},stopRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{const e=new FormData,t=`recording-${Date.now()}.webm`;e.append("file",this.recordedBlob,t);const d=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!d.ok)throw new Error(`upload failed: ${d.status}`);const r=await d.json(),m=r?.file_url||r?.data?.file_url;if(!m)throw new Error("no file_url in response");this.audioPreviewUrl=m,await this.onGenerateAudioId(m),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),w.error(e?.message||this.$t("suno.message.uploadReferencesError"))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null)},cleanupRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.releaseStream(),this.recordedAudioUrl&&(URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=null)}}}),St={class:"relative"},Tt={class:"flex justify-between items-center mb-2"},At={class:"flex justify-start items-center"},Pt={class:"text-sm font-bold"},Ut={key:0,class:"mb-2"},Et=["src"],It={key:1,class:"mt-2"},Rt={class:"py-4"},Lt={class:"text-center py-6"},Mt={class:"text-sm"},Ft={class:"text-xs text-gray-400 mt-1"},Dt={class:"py-4 text-center"},zt={class:"recorder-display mb-4"},jt={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Gt={class:"text-2xl font-mono"},Bt={key:1,class:"text-green-600"},Ot={key:2,class:"text-gray-400 text-2xl font-mono"},Nt={key:0,class:"mb-4"},Ht=["src"],qt={class:"flex justify-center gap-3"};function Wt(e,t,d,r,m,y){const $=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-radio-button"),g=l("el-radio-group"),T=l("el-upload"),_=l("el-tab-pane"),V=l("el-tabs"),C=l("el-dialog");return n(),u("div",St,[s("div",Tt,[s("div",At,[s("span",Pt,i(e.$t("suno.name.referenceAudios")),1),o($,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])]),o(f,{round:"",type:"primary",size:"small",onClick:t[0]||(t[0]=I=>e.dialogVisible=!0)},{default:a(()=>[o(p,{icon:"fa-solid fa-plus",class:"icon mr-1"}),v(" "+i(e.$t("suno.button.addAudio")),1)]),_:1})]),e.audioPreviewUrl?(n(),u("div",Ut,[s("audio",{src:e.audioPreviewUrl,controls:"",class:"w-full"},null,8,Et)])):c("",!0),e.hasUploadedAudio?(n(),u("div",It,[o(g,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:a(()=>[o(k,{value:"upload_extend"},{default:a(()=>[v(i(e.$t("suno.button.extend")),1)]),_:1}),o(k,{value:"upload_cover"},{default:a(()=>[v(i(e.$t("suno.button.upload_cover")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),o(C,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||(t[4]=I=>e.dialogVisible=I),title:e.$t("suno.name.addAudio"),width:"520px","close-on-click-modal":!1,"append-to-body":""},{default:a(()=>[o(V,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||(t[3]=I=>e.activeTab=I),class:"add-audio-tabs"},{default:a(()=>[o(_,{name:"browse",label:e.$t("suno.tab.browse")},{default:a(()=>[s("div",Rt,[o(T,{"file-list":e.fileList,"onUpdate:fileList":t[2]||(t[2]=I=>e.fileList=I),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3,.wav,.m4a,audio/*","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onBrowseSuccess,headers:e.headers,drag:""},{default:a(()=>[s("div",Lt,[o(p,{icon:"fa-solid fa-upload",class:"text-4xl text-gray-400 mb-3"}),s("div",Mt,i(e.$t("suno.description.dropAudioHere")),1),s("div",Ft,i(e.$t("suno.description.audioFormats")),1)])]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])]),_:1},8,["label"]),o(_,{name:"record",label:e.$t("suno.tab.record")},{default:a(()=>[s("div",Dt,[s("div",zt,[e.recording?(n(),u("div",jt,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Gt,i(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",Bt,[o(p,{icon:"fa-solid fa-check-circle",class:"text-2xl mr-2"}),s("span",null,i(e.$t("suno.message.recordingReady"))+" ("+i(e.formattedTime)+")",1)])):(n(),u("div",Ot,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",Nt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Ht)])):c("",!0),s("div",qt,[!e.recording&&!e.recordedBlob?(n(),b(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+i(e.$t("suno.button.startRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recording?(n(),b(f,{key:1,type:"danger",round:"",onClick:e.stopRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-stop",class:"mr-1"}),v(" "+i(e.$t("suno.button.stopRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recordedBlob&&!e.recording?(n(),u(M,{key:2},[o(f,{round:"",onClick:e.resetRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+i(e.$t("suno.button.reRecord")),1)]),_:1},8,["onClick"]),o(f,{type:"primary",round:"",loading:e.uploadingRecord,onClick:e.uploadRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-upload",class:"mr-1"}),v(" "+i(e.$t("suno.button.useRecording")),1)]),_:1},8,["loading","onClick"])],64)):c("",!0)])])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])])}const Kt=E(Vt,[["render",Wt],["__scopeId","data-v-bfb6b53d"]]),Qt="",he=[{key:"lofi",label:"🎧 Lo-fi Chill",prompt:"a relaxing lo-fi hip hop beat for studying"},{key:"pop-love",label:"💕 Pop Love Song",prompt:"a catchy pop love song with sweet melodies"},{key:"rock-anthem",label:"🎸 Rock Anthem",prompt:"an energetic rock anthem with electric guitars"},{key:"jazz-night",label:"🎷 Jazz Night",prompt:"a smooth late-night jazz piece with saxophone"},{key:"edm-drop",label:"⚡ EDM Drop",prompt:"an intense EDM track with a massive drop"},{key:"folk-story",label:"🪕 Folk Story",prompt:"a warm folk song telling a story about traveling"},{key:"rnb-groove",label:"🎤 R&B Groove",prompt:"a smooth R&B groove with soulful vocals"},{key:"classical",label:"🎻 Classical",prompt:"an elegant classical piece for orchestra"},{key:"hip-hop",label:"🎤 Hip Hop",prompt:"a hard-hitting hip hop beat with bass"},{key:"country",label:"🤠 Country",prompt:"an upbeat country song with acoustic guitar and banjo"},{key:"reggae",label:"🌴 Reggae",prompt:"a laid-back reggae tune with island vibes"},{key:"latin",label:"💃 Latin",prompt:"a vibrant Latin dance track with percussion"},{key:"ambient",label:"🌊 Ambient",prompt:"a dreamy ambient soundscape for relaxation"},{key:"metal",label:"🤘 Metal",prompt:"a powerful metal song with heavy riffs and double bass drums"},{key:"soul",label:"🎵 Soul",prompt:"a heartfelt soul ballad with gospel harmonies"},{key:"synthwave",label:"🌃 Synthwave",prompt:"a retro synthwave track with 80s vibes"},{key:"kpop",label:"🇰🇷 K-Pop",prompt:"a catchy K-pop dance track with hook"},{key:"lullaby",label:"🌙 Lullaby",prompt:"a gentle lullaby for bedtime with soft piano"},{key:"cinematic",label:"🎬 Cinematic",prompt:"an epic cinematic orchestral score for a movie trailer"},{key:"blues",label:"🎸 Blues",prompt:"a soulful blues song with electric guitar bends"},{key:"disco",label:"🕺 Disco",prompt:"a funky disco track with groovy bassline"},{key:"punk",label:"🔥 Punk Rock",prompt:"a fast punk rock song with raw energy"},{key:"gospel",label:"⛪ Gospel",prompt:"an uplifting gospel choir song with piano"},{key:"trap",label:"🔊 Trap",prompt:"a dark trap beat with 808s and hi-hats"},{key:"bossa",label:"☕ Bossa Nova",prompt:"a gentle bossa nova with nylon guitar"},{key:"indie",label:"🎶 Indie",prompt:"a dreamy indie track with ethereal vocals"},{key:"cpop",label:"🇨🇳 C-Pop",prompt:"a beautiful Chinese pop ballad with emotional vocals"},{key:"jpop",label:"🇯🇵 J-Pop",prompt:"a cheerful J-pop song with anime vibes"},{key:"afrobeat",label:"🥁 Afrobeat",prompt:"a groovy Afrobeat track with layered percussion"},{key:"game",label:"🎮 Game BGM",prompt:"an adventurous video game background music"}],Jt=8;function ge(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const Yt=A({name:"PromptInput",components:{ElInput:W,FontAwesomeIcon:z,InfoIcon:F},data(){return{shuffledTags:ge(he)}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}},visibleTags(){return this.shuffledTags.slice(0,Jt)}},mounted(){this.prompt||(this.prompt=Qt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=ge(he)}}}),Zt={class:"field"},Xt={class:"flex items-center mb-1"},xt={class:"text-sm font-bold"},eo={class:"inspo-tags"},to=["onClick"];function oo(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-input"),f=l("font-awesome-icon");return n(),u("div",Zt,[s("div",Xt,[s("span",xt,i(e.$t("suno.name.songDescription")),1),o($,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=k=>e.prompt=k),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",eo,[(n(!0),u(M,null,D(e.visibleTags,k=>(n(),u("button",{key:k.key,class:"inspo-tag",onClick:g=>e.onTagClick(k)},i(k.label),9,to))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...k)=>e.onRefreshTags&&e.onRefreshTags(...k))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const so=E(Yt,[["render",oo],["__scopeId","data-v-378e4372"]]),no="",io=A({name:"LyricInput",components:{ElInput:W,ElButton:B,ElTooltip:pe,ElDialog:le,FontAwesomeIcon:z,InfoIcon:F},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:"",lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||(this.lyric=no)},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){const e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=""},async onEnhanceLyrics(){const e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,w.info(this.$t("suno.message.enhancingLyrics"));try{const t=`${this.enhancePrompt}
|
|
1
|
+
import{F as z}from"./index.es-CgtdXCC6.js";import{E as B}from"./index-C25CVHv_.js";import{E as ye}from"./index-xvfpY1YX.js";import{d as A,H as u,E as s,z as ne,C as o,y as a,D as l,q as n,Q as G,F as i,O as M,N as D,J as c,x as b,I as v,U as ie,G as O,K as q,M as U,u as j,c as H,w as Pe,L as Ue}from"./vendor-vue-DU0w5ewx.js";import{D as E,E as Ee,aZ as le,b0 as Ie,e2 as re,e3 as de,R as x,G as be,ao as Z,e4 as ee,e5 as Re,a6 as Le}from"./index-C3-wmF1i.js";import{a as Me}from"./errorCode-Cqj9Td_Z.js";import{s as L}from"./suno-DorMHjy1.js";import{b as Fe}from"./suno-DFuCGH70.js";import{E as De}from"./index-Bp1kxQj2.js";import{E as ue,a as ce}from"./index-BtoTXqsU.js";import{I as F,S as ze}from"./ScrollList-Cu2yoCEI.js";import{E as te,a as J,b as je}from"./index-4aCvvTMg.js";import{E as ke,a as we}from"./index-BuazHbxk.js";import{E as Ge}from"./index-DkRHsTiz.js";import{E as w}from"./index-W-5lLi59.js";import{E as W}from"./index-CqSMS5t2.js";import{E as pe}from"./index-B1-mbMYf.js";import{u as X,F as Be,O as Oe,_ as fe,P as Ne,a as He,V as qe,E as We}from"./IconPark.vue_vue_type_script_setup_true_lang-KwnZP6Fc.js";import{E as oe,a as me}from"./index-ehWXrG6r.js";import{E as N}from"./index-D_hokSbg.js";import{E as Ke,a as Qe}from"./index-tVsQrQB3.js";import{E as Je,a as Ye}from"./index-CcbKIWRj.js";import{E as Ce}from"./index-d754nSEm.js";import{C as Ze}from"./Consumption-GxTGyrc1.js";import{a as Xe}from"./price-DFVz0G2x.js";import{E as xe}from"./index-BHgD_Zxj.js";import{E as et}from"./index-BWkjL97f.js";import{E as Ve,b as Se,a as Te}from"./index-DhMrctEM.js";import{E as Ae}from"./index-DKUufmbc.js";import{N as tt}from"./NoTasks-b4OJIqL7.js";import{a as ot,E as st}from"./index-6zN8vY1F.js";import{l as nt}from"./pagination-CcnL0MdN.js";import"./use-form-item-DtuhYcUh.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./validator-Dyj2d5gI.js";import"./index-BXLjYm-G.js";import"./index-CwP-L7Jn.js";import"./typescript-pqBgKOiU.js";import"./strings-DigWlKo9.js";import"./isEqual-BVwuIEtt.js";import"./_Uint8Array-C9DPZS3B.js";import"./castArray-1sgHWSEQ.js";import"./debounce-CoJflkTH.js";import"./_baseIteratee-D0DKZ8mg.js";import"./index-DUfDW12r.js";import"./_baseClone-DroBZ78C.js";import"./_initCloneObject-CydGahMP.js";import"./isPlainObject-LE5Z0BKi.js";import"./index-DktIFTNG.js";import"./index-Bz0iDXPF.js";import"./index-Cb8tajJB.js";import"./dropdown-tirkhRzQ.js";const it=A({name:"LayoutSuno",components:{ElDrawer:ye,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1,preview:!1}},computed:{}}),at={class:"main flex flex-row flex-1"},lt={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},rt={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},dt={class:"preview h-full w-[300px] flex flex-col"};function ut(e,t,d,r,m,y){const $=l("font-awesome-icon"),p=l("el-button"),f=l("el-drawer");return n(),u("div",at,[s("div",lt,[ne(e.$slots,"config",{},void 0,!0)]),s("div",rt,[ne(e.$slots,"result",{},void 0,!0)]),s("div",dt,[ne(e.$slots,"preview",{},void 0,!0)]),o(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=k=>e.drawer=!0)},{default:a(()=>[o($,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=k=>e.drawer=k),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:a(()=>[ne(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ct=E(it,[["render",ut],["__scopeId","data-v-c6c85757"]]),pt=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:De,ElTag:Ee},data(){return{options:[{label:"v5.5",value:"chirp-v5-5",desc:this.$t("suno.model.v55desc"),pro:!0},{label:"v5",value:"chirp-v5",desc:this.$t("suno.model.v5desc"),pro:!0},{label:"v4.5+",value:"chirp-v4-5-plus",desc:this.$t("suno.model.v45plusdesc"),pro:!0},{label:"v4.5",value:"chirp-v4-5",desc:this.$t("suno.model.v45desc"),pro:!0,dividerAfter:!0},{label:"v4",value:"chirp-v4",desc:this.$t("suno.model.v4desc")},{label:"v3.5",value:"chirp-v3-5",desc:this.$t("suno.model.v35desc")},{label:"v3",value:"chirp-v3-0",desc:this.$t("suno.model.v3desc")}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||(this.model=Fe)}}),mt={class:"mode-tabs mb-3"},ft={class:"mb-3"},ht={class:"flex items-center mb-1"},gt={class:"text-sm font-bold"},$t={class:"model-option"},_t={class:"model-option-left"},vt={class:"model-option-name"},yt={class:"model-option-desc"},bt={key:0,class:"flex items-center justify-between mb-3"},kt={class:"text-sm font-bold"};function wt(e,t,d,r,m,y){const $=l("el-tag"),p=l("el-option"),f=l("el-select"),k=l("el-switch");return n(),u("div",null,[s("div",mt,[s("button",{class:G(["mode-tab",{active:!e.custom}]),onClick:t[0]||(t[0]=g=>e.custom=!1)},i(e.$t("suno.mode.simple")),3),s("button",{class:G(["mode-tab",{active:e.custom}]),onClick:t[1]||(t[1]=g=>e.custom=!0)},i(e.$t("suno.mode.custom")),3)]),s("div",ft,[s("div",ht,[s("span",gt,i(e.$t("suno.name.model")),1)]),o(f,{modelValue:e.model,"onUpdate:modelValue":t[2]||(t[2]=g=>e.model=g),class:"w-full model-select",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:a(()=>[(n(!0),u(M,null,D(e.options,g=>(n(),b(p,{key:g.value,label:g.label,value:g.value,class:G({"model-option-divider":g.dividerAfter})},{default:a(()=>[s("div",$t,[s("div",_t,[s("span",vt,i(g.label),1),g.pro?(n(),b($,{key:0,size:"small",type:"warning",effect:"plain",class:"model-option-pro"},{default:a(()=>[...t[4]||(t[4]=[v("Pro",-1)])]),_:1})):c("",!0)]),s("span",yt,i(g.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",bt,[s("span",kt,i(e.$t("suno.name.instrumental")),1),o(k,{modelValue:e.instrumental,"onUpdate:modelValue":t[3]||(t[3]=g=>e.instrumental=g)},null,8,["modelValue"])])):c("",!0)])}const Ct=E(pt,[["render",wt],["__scopeId","data-v-a6ada414"]]),Vt=A({name:"UploadAudio",components:{ElUpload:Ge,ElButton:B,ElDialog:le,ElTabs:we,ElTabPane:ke,InfoIcon:F,FontAwesomeIcon:z,ElRadioGroup:J,ElRadioButton:te},emits:["change"],data(){return{fileList:[],uploadUrl:Ie()+"/api/v1/files/",dialogVisible:!1,activeTab:"browse",recording:!1,recordedBlob:null,recordedAudioUrl:null,audioPreviewUrl:null,recordTimer:null,recordSeconds:0,mediaRecorder:null,mediaStream:null,recordedChunks:[],uploadingRecord:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}},hasUploadedAudio(){const e=this.$store.state.suno?.config?.action;return e==="upload_extend"||e==="upload_cover"},uploadAction:{get(){return this.$store.state.suno?.config?.action||"upload_extend"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,action:e})}},formattedTime(){const e=Math.floor(this.recordSeconds/60).toString().padStart(2,"0"),t=(this.recordSeconds%60).toString().padStart(2,"0");return`${e}:${t}`}},watch:{urls:{handler(e){this.$emit("change",e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){w.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){w.error(this.$t("suno.message.uploadReferencesError"))},async onBrowseSuccess(){const e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){const t={audio_url:e},d=this.credential?.token;if(!d){console.error("no token specified");return}w.info(this.$t("suno.message.startingUploadAudio"));try{const r=await L.upload(t,{token:d});console.debug("get upload music success",r.data);const m=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:m,action:"upload_extend"}),w.success(this.$t("suno.message.startUploadAudioSuccess"))}catch(r){w.error(r?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){w.error(this.$t("suno.message.recordingUnsupported"));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{const e=new Blob(this.recordedChunks,{type:"audio/webm"});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error("record error",e),w.error(this.$t("suno.message.recordingPermissionDenied"))}},stopRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{const e=new FormData,t=`recording-${Date.now()}.webm`;e.append("file",this.recordedBlob,t);const d=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!d.ok)throw new Error(`upload failed: ${d.status}`);const r=await d.json(),m=r?.file_url||r?.data?.file_url;if(!m)throw new Error("no file_url in response");this.audioPreviewUrl=m,await this.onGenerateAudioId(m),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),w.error(e?.message||this.$t("suno.message.uploadReferencesError"))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null)},cleanupRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.releaseStream(),this.recordedAudioUrl&&(URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=null)}}}),St={class:"relative"},Tt={class:"flex justify-between items-center mb-2"},At={class:"flex justify-start items-center"},Pt={class:"text-sm font-bold"},Ut={key:0,class:"mb-2"},Et=["src"],It={key:1,class:"mt-2"},Rt={class:"py-4"},Lt={class:"text-center py-6"},Mt={class:"text-sm"},Ft={class:"text-xs text-gray-400 mt-1"},Dt={class:"py-4 text-center"},zt={class:"recorder-display mb-4"},jt={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Gt={class:"text-2xl font-mono"},Bt={key:1,class:"text-green-600"},Ot={key:2,class:"text-gray-400 text-2xl font-mono"},Nt={key:0,class:"mb-4"},Ht=["src"],qt={class:"flex justify-center gap-3"};function Wt(e,t,d,r,m,y){const $=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-radio-button"),g=l("el-radio-group"),T=l("el-upload"),_=l("el-tab-pane"),V=l("el-tabs"),C=l("el-dialog");return n(),u("div",St,[s("div",Tt,[s("div",At,[s("span",Pt,i(e.$t("suno.name.referenceAudios")),1),o($,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])]),o(f,{round:"",type:"primary",size:"small",onClick:t[0]||(t[0]=I=>e.dialogVisible=!0)},{default:a(()=>[o(p,{icon:"fa-solid fa-plus",class:"icon mr-1"}),v(" "+i(e.$t("suno.button.addAudio")),1)]),_:1})]),e.audioPreviewUrl?(n(),u("div",Ut,[s("audio",{src:e.audioPreviewUrl,controls:"",class:"w-full"},null,8,Et)])):c("",!0),e.hasUploadedAudio?(n(),u("div",It,[o(g,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:a(()=>[o(k,{value:"upload_extend"},{default:a(()=>[v(i(e.$t("suno.button.extend")),1)]),_:1}),o(k,{value:"upload_cover"},{default:a(()=>[v(i(e.$t("suno.button.upload_cover")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),o(C,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||(t[4]=I=>e.dialogVisible=I),title:e.$t("suno.name.addAudio"),width:"520px","close-on-click-modal":!1,"append-to-body":""},{default:a(()=>[o(V,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||(t[3]=I=>e.activeTab=I),class:"add-audio-tabs"},{default:a(()=>[o(_,{name:"browse",label:e.$t("suno.tab.browse")},{default:a(()=>[s("div",Rt,[o(T,{"file-list":e.fileList,"onUpdate:fileList":t[2]||(t[2]=I=>e.fileList=I),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3,.wav,.m4a,audio/*","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onBrowseSuccess,headers:e.headers,drag:""},{default:a(()=>[s("div",Lt,[o(p,{icon:"fa-solid fa-upload",class:"text-4xl text-gray-400 mb-3"}),s("div",Mt,i(e.$t("suno.description.dropAudioHere")),1),s("div",Ft,i(e.$t("suno.description.audioFormats")),1)])]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])]),_:1},8,["label"]),o(_,{name:"record",label:e.$t("suno.tab.record")},{default:a(()=>[s("div",Dt,[s("div",zt,[e.recording?(n(),u("div",jt,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Gt,i(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",Bt,[o(p,{icon:"fa-solid fa-check-circle",class:"text-2xl mr-2"}),s("span",null,i(e.$t("suno.message.recordingReady"))+" ("+i(e.formattedTime)+")",1)])):(n(),u("div",Ot,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",Nt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Ht)])):c("",!0),s("div",qt,[!e.recording&&!e.recordedBlob?(n(),b(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+i(e.$t("suno.button.startRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recording?(n(),b(f,{key:1,type:"danger",round:"",onClick:e.stopRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-stop",class:"mr-1"}),v(" "+i(e.$t("suno.button.stopRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recordedBlob&&!e.recording?(n(),u(M,{key:2},[o(f,{round:"",onClick:e.resetRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+i(e.$t("suno.button.reRecord")),1)]),_:1},8,["onClick"]),o(f,{type:"primary",round:"",loading:e.uploadingRecord,onClick:e.uploadRecording},{default:a(()=>[o(p,{icon:"fa-solid fa-upload",class:"mr-1"}),v(" "+i(e.$t("suno.button.useRecording")),1)]),_:1},8,["loading","onClick"])],64)):c("",!0)])])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])])}const Kt=E(Vt,[["render",Wt],["__scopeId","data-v-bfb6b53d"]]),Qt="",he=[{key:"lofi",label:"🎧 Lo-fi Chill",prompt:"a relaxing lo-fi hip hop beat for studying"},{key:"pop-love",label:"💕 Pop Love Song",prompt:"a catchy pop love song with sweet melodies"},{key:"rock-anthem",label:"🎸 Rock Anthem",prompt:"an energetic rock anthem with electric guitars"},{key:"jazz-night",label:"🎷 Jazz Night",prompt:"a smooth late-night jazz piece with saxophone"},{key:"edm-drop",label:"⚡ EDM Drop",prompt:"an intense EDM track with a massive drop"},{key:"folk-story",label:"🪕 Folk Story",prompt:"a warm folk song telling a story about traveling"},{key:"rnb-groove",label:"🎤 R&B Groove",prompt:"a smooth R&B groove with soulful vocals"},{key:"classical",label:"🎻 Classical",prompt:"an elegant classical piece for orchestra"},{key:"hip-hop",label:"🎤 Hip Hop",prompt:"a hard-hitting hip hop beat with bass"},{key:"country",label:"🤠 Country",prompt:"an upbeat country song with acoustic guitar and banjo"},{key:"reggae",label:"🌴 Reggae",prompt:"a laid-back reggae tune with island vibes"},{key:"latin",label:"💃 Latin",prompt:"a vibrant Latin dance track with percussion"},{key:"ambient",label:"🌊 Ambient",prompt:"a dreamy ambient soundscape for relaxation"},{key:"metal",label:"🤘 Metal",prompt:"a powerful metal song with heavy riffs and double bass drums"},{key:"soul",label:"🎵 Soul",prompt:"a heartfelt soul ballad with gospel harmonies"},{key:"synthwave",label:"🌃 Synthwave",prompt:"a retro synthwave track with 80s vibes"},{key:"kpop",label:"🇰🇷 K-Pop",prompt:"a catchy K-pop dance track with hook"},{key:"lullaby",label:"🌙 Lullaby",prompt:"a gentle lullaby for bedtime with soft piano"},{key:"cinematic",label:"🎬 Cinematic",prompt:"an epic cinematic orchestral score for a movie trailer"},{key:"blues",label:"🎸 Blues",prompt:"a soulful blues song with electric guitar bends"},{key:"disco",label:"🕺 Disco",prompt:"a funky disco track with groovy bassline"},{key:"punk",label:"🔥 Punk Rock",prompt:"a fast punk rock song with raw energy"},{key:"gospel",label:"⛪ Gospel",prompt:"an uplifting gospel choir song with piano"},{key:"trap",label:"🔊 Trap",prompt:"a dark trap beat with 808s and hi-hats"},{key:"bossa",label:"☕ Bossa Nova",prompt:"a gentle bossa nova with nylon guitar"},{key:"indie",label:"🎶 Indie",prompt:"a dreamy indie track with ethereal vocals"},{key:"cpop",label:"🇨🇳 C-Pop",prompt:"a beautiful Chinese pop ballad with emotional vocals"},{key:"jpop",label:"🇯🇵 J-Pop",prompt:"a cheerful J-pop song with anime vibes"},{key:"afrobeat",label:"🥁 Afrobeat",prompt:"a groovy Afrobeat track with layered percussion"},{key:"game",label:"🎮 Game BGM",prompt:"an adventurous video game background music"}],Jt=8;function ge(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const Yt=A({name:"PromptInput",components:{ElInput:W,FontAwesomeIcon:z,InfoIcon:F},data(){return{shuffledTags:ge(he)}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}},visibleTags(){return this.shuffledTags.slice(0,Jt)}},mounted(){this.prompt||(this.prompt=Qt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=ge(he)}}}),Zt={class:"field"},Xt={class:"flex items-center mb-1"},xt={class:"text-sm font-bold"},eo={class:"inspo-tags"},to=["onClick"];function oo(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-input"),f=l("font-awesome-icon");return n(),u("div",Zt,[s("div",Xt,[s("span",xt,i(e.$t("suno.name.songDescription")),1),o($,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=k=>e.prompt=k),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",eo,[(n(!0),u(M,null,D(e.visibleTags,k=>(n(),u("button",{key:k.key,class:"inspo-tag",onClick:g=>e.onTagClick(k)},i(k.label),9,to))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...k)=>e.onRefreshTags&&e.onRefreshTags(...k))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const so=E(Yt,[["render",oo],["__scopeId","data-v-378e4372"]]),no="",io=A({name:"LyricInput",components:{ElInput:W,ElButton:B,ElTooltip:pe,ElDialog:le,FontAwesomeIcon:z,InfoIcon:F},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:"",lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||(this.lyric=no)},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){const e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=""},async onEnhanceLyrics(){const e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,w.info(this.$t("suno.message.enhancingLyrics"));try{const t=`${this.enhancePrompt}
|
|
2
2
|
|
|
3
3
|
Original lyrics:
|
|
4
4
|
${this.lyric}`,r=(await L.lyric({prompt:t},{token:e})).data?.data;r?.text&&(this.lyric=r.text,this.enhancePrompt="",w.success(this.$t("suno.message.enhanceLyricsSuccess")))}catch{w.error(this.$t("suno.message.enhanceLyricsFailed"))}finally{this.enhancingLyrics=!1}}},async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;this.pushHistory();const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,w.info(this.$t("suno.message.generatingLyrics"));try{const r=(await L.lyric({prompt:t},{token:e})).data?.data;r?.text&&(this.lyric=r.text,r?.title&&!this.config?.title&&this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:r.text,title:r.title}),w.success(this.$t("suno.message.generateLyricsSuccess")))}catch{w.error(this.$t("suno.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),ao={class:"field"},lo={class:"flex items-center justify-between mb-1"},ro={class:"flex items-center"},uo={class:"text-sm font-bold"},co={class:"flex items-center gap-1"},po={class:"relative"},mo={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},fo={key:0,class:"enhance-bar"},ho={key:0,class:"enhance-bar mt-3"},go={class:"flex items-center justify-between"},$o={class:"flex items-center gap-1"};function _o(e,t,d,r,m,y){const $=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-tooltip"),g=l("el-input"),T=l("el-dialog");return n(),u("div",ao,[s("div",lo,[s("div",ro,[s("span",uo,i(e.$t("suno.name.lyrics")),1),o($,{content:e.$t("suno.description.lyrics")},null,8,["content"])]),s("div",co,[e.lyricHistory.length>0?(n(),b(k,{key:0,content:e.$t("suno.button.undo"),placement:"top"},{default:a(()=>[o(f,{size:"small",circle:"",onClick:e.onUndo},{default:a(()=>[o(p,{icon:"fa-solid fa-rotate-left"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),e.lyric?(n(),b(k,{key:1,content:e.$t("suno.button.clear_lyrics"),placement:"top"},{default:a(()=>[o(f,{size:"small",circle:"",onClick:e.onClear},{default:a(()=>[o(p,{icon:"fa-solid fa-eraser"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),o(k,{content:e.$t("suno.button.expand_lyrics"),placement:"top"},{default:a(()=>[o(f,{size:"small",circle:"",onClick:t[0]||(t[0]=_=>e.expanded=!0)},{default:a(()=>[o(p,{icon:"fa-solid fa-expand"})]),_:1})]),_:1},8,["content"]),e.config?.action!=="extend"?(n(),b(f,{key:2,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:a(()=>[e.generatingLyrics?c("",!0):(n(),b(p,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+i(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)])]),s("div",po,[e.config?.action!=="extend"?(n(),b(g,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),b(g,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[2]||(t[2]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"])),s("div",mo,i(e.lyric?.length||0)+"/5000",1)]),e.lyric&&e.config?.action!=="extend"?(n(),u("div",fo,[o(g,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[3]||(t[3]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ie(e.onEnhanceLyrics,["enter"])},{append:a(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:a(()=>[e.enhancingLyrics?c("",!0):(n(),b(p,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+i(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0),o(T,{modelValue:e.expanded,"onUpdate:modelValue":t[7]||(t[7]=_=>e.expanded=_),title:e.$t("suno.name.lyrics"),width:"720px",top:"5vh","close-on-click-modal":!1,class:"lyrics-expand-dialog"},{footer:a(()=>[s("div",go,[s("div",$o,[e.lyricHistory.length>0?(n(),b(f,{key:0,size:"small",onClick:e.onUndo},{default:a(()=>[o(p,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+i(e.$t("suno.button.undo")),1)]),_:1},8,["onClick"])):c("",!0),e.lyric?(n(),b(f,{key:1,size:"small",onClick:e.onClear},{default:a(()=>[o(p,{icon:"fa-solid fa-eraser",class:"mr-1"}),v(" "+i(e.$t("suno.button.clear_lyrics")),1)]),_:1},8,["onClick"])):c("",!0),e.config?.action!=="extend"?(n(),b(f,{key:2,size:"small",loading:e.generatingLyrics,onClick:e.onGenerateLyrics},{default:a(()=>[e.generatingLyrics?c("",!0):(n(),b(p,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+i(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)]),o(f,{type:"primary",onClick:t[6]||(t[6]=_=>e.expanded=!1)},{default:a(()=>[v(i(e.$t("common.button.confirm")),1)]),_:1})])]),default:a(()=>[o(g,{modelValue:e.lyric,"onUpdate:modelValue":t[4]||(t[4]=_=>e.lyric=_),type:"textarea",rows:20,class:"lyrics-expanded",placeholder:e.$t("suno.placeholder.lyrics"),autofocus:""},null,8,["modelValue","placeholder"]),e.config?.action!=="extend"?(n(),u("div",ho,[o(g,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[5]||(t[5]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ie(e.onEnhanceLyrics,["enter"])},{append:a(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:a(()=>[e.enhancingLyrics?c("",!0):(n(),b(p,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+i(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0)]),_:1},8,["modelValue","title"])])}const vo=E(io,[["render",_o],["__scopeId","data-v-2b97a493"]]),$e=["Pop","Rock","Jazz","R&B","Hip Hop","Lo-fi","Electronic","Classical","Country","Blues","Folk","Reggae","Metal","Punk","Soul","Funk","Ambient","Indie","Latin","Acoustic","Dance","Disco","Gospel","K-Pop","J-Pop","C-Pop","Bossa Nova","Trap","Drill","House","Techno","Dubstep","Synthwave","Chill","Dreamy","Upbeat","Melancholic","Romantic","Epic","Cinematic","Orchestral","Piano","Guitar","Saxophone","Violin","Tribal","World Music","Afrobeat","Ska","Grunge"],yo=12;function _e(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const bo=A({name:"StyleInput",components:{ElInput:W,ElButton:B,FontAwesomeIcon:z,InfoIcon:F},data(){return{optimizing:!1,shuffledTags:_e($e)}},computed:{style:{get(){return this.$store.state.suno?.config?.style},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style:e})}},credential(){return this.$store.state.suno?.credential},visibleTags(){return this.shuffledTags.slice(0,yo)}},methods:{onTagClick(e){const t=this.style||"";t.toLowerCase().includes(e.toLowerCase())||(this.style=t?`${t}, ${e}`:e)},onRefreshTags(){this.shuffledTags=_e($e)},async onOptimizeStyle(){const e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,w.info(this.$t("suno.message.optimizingStyle"));try{const t=await L.style({prompt:this.style},{token:e}),d=t.data?.text||t.data?.data?.text;d&&(this.style=d,w.success(this.$t("suno.message.optimizeStyleSuccess")))}catch{w.error(this.$t("suno.message.optimizeStyleFailed"))}finally{this.optimizing=!1}}}}}),ko={class:"field"},wo={class:"flex items-center justify-between mb-1"},Co={class:"flex items-center"},Vo={class:"text-sm font-bold"},So={class:"relative"},To={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},Ao={class:"style-tags"},Po=["onClick"];function Uo(e,t,d,r,m,y){const $=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-input");return n(),u("div",ko,[s("div",wo,[s("div",Co,[s("span",Vo,i(e.$t("suno.name.style")),1),o($,{content:e.$t("suno.description.style")},null,8,["content"])]),o(f,{size:"small",loading:e.optimizing,round:"",onClick:e.onOptimizeStyle},{default:a(()=>[e.optimizing?c("",!0):(n(),b(p,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+i(e.$t("suno.button.optimize_style")),1)]),_:1},8,["loading","onClick"])]),s("div",So,[o(k,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=g=>e.style=g),rows:2,type:"textarea",placeholder:e.$t("suno.placeholder.style")},null,8,["modelValue","placeholder"]),s("div",To,i(e.style?.length||0)+"/1000",1)]),s("div",Ao,[(n(!0),u(M,null,D(e.visibleTags,g=>(n(),u("button",{key:g,class:"style-tag",onClick:T=>e.onTagClick(g)},i(g),9,Po))),128)),s("button",{class:"style-tag style-tag-refresh",onClick:t[1]||(t[1]=(...g)=>e.onRefreshTags&&e.onRefreshTags(...g))},[o(p,{icon:"fa-solid fa-arrows-rotate"})])])])}const Eo=E(bo,[["render",Uo],["__scopeId","data-v-ddebb076"]]),Io=A({name:"TitleInput",components:{ElInput:W,InfoIcon:F},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,title:e})}}}}),Ro={class:"field"},Lo={class:"flex items-center mb-1"},Mo={class:"text-sm font-bold"};function Fo(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-input");return n(),u("div",Ro,[s("div",Lo,[s("span",Mo,i(e.$t("suno.name.title")),1),o($,{content:e.$t("suno.description.title")},null,8,["content"])]),o(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=f=>e.title=f),placeholder:e.$t("suno.placeholder.title")},null,8,["modelValue","placeholder"])])}const Do=E(Io,[["render",Fo]]),zo=A({name:"ExtendFromInput",components:{ElImage:N,ElIcon:x,ElInputNumber:oe,VideoPlay:de,VideoPause:re},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.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:X,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),jo={class:"field"},Go={class:"box"},Bo={class:"title font-bold"},Oo={class:"input-wrapper"},No={class:"task"},Ho={class:"left"},qo={key:2,class:"duration"},Wo={class:"info"},Ko={class:"title"},Qo={class:"style"};function Jo(e,t,d,r,m,y){const $=l("el-input-number"),p=l("el-image"),f=l("video-pause"),k=l("el-icon"),g=l("video-play"),T=q("loading");return n(),u("div",jo,[s("div",Go,[s("h2",Bo,i(e.$t("suno.name.extend")),1),s("div",Oo,[o($,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=_=>e.value=_),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),s("div",No,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[3]||(t[3]=_=>e.onClick(e.audio))},[O((n(),u("div",Ho,[o(p,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=_=>e.onPause(e.audio))},[o(k,null,{default:a(()=>[o(f)]),_:1})])):c("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=_=>e.onPlay(e.audio))},[o(k,null,{default:a(()=>[o(g)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",qo,i(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[T,!e.audio?.audio_url]]),s("div",Wo,[s("h2",Ko,i(e.audio?.title),1),s("p",Qo,i(e.audio?.style),1)])])):c("",!0)])])}const Yo=E(zo,[["render",Jo],["__scopeId","data-v-bcce4821"]]),Zo=A({name:"CoverFromInput",components:{ElImage:N,ElIcon:x,VideoPlay:de,VideoPause:re},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.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:X,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Xo={class:"field"},xo={class:"box"},es={class:"title font-bold"},ts={class:"task"},os={class:"left"},ss={key:2,class:"duration"},ns={class:"info"},is={class:"title"},as={class:"style"};function ls(e,t,d,r,m,y){const $=l("el-image"),p=l("video-pause"),f=l("el-icon"),k=l("video-play"),g=q("loading");return n(),u("div",Xo,[s("div",xo,[s("h2",es,i(e.$t("suno.name.cover")),1)]),s("div",ts,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[2]||(t[2]=T=>e.onClick(e.audio))},[O((n(),u("div",os,[o($,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=T=>e.onPause(e.audio))},[o(f,null,{default:a(()=>[o(p)]),_:1})])):c("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=T=>e.onPlay(e.audio))},[o(f,null,{default:a(()=>[o(k)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",ss,i(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[g,!e.audio?.audio_url]]),s("div",ns,[s("h2",is,i(e.audio?.title),1),s("p",as,i(e.audio?.style),1)])])):c("",!0)])])}const rs=E(Zo,[["render",ls],["__scopeId","data-v-06640216"]]),ds=A({name:"VocalGenderSelector",components:{ElRadioGroup:J,ElRadioButton:te,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.suno?.config?.vocal_gender||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,vocal_gender:e||void 0})}}}}),us={class:"mb-2"},cs={class:"flex items-center mb-1"},ps={class:"text-sm font-bold"};function ms(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-radio-button"),f=l("el-radio-group");return n(),u("div",us,[s("div",cs,[s("span",ps,i(e.$t("suno.name.vocalGender")),1),o($,{content:e.$t("suno.description.vocalGender")},null,8,["content"])]),o(f,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=k=>e.vocalGender=k)},{default:a(()=>[o(p,{value:""},{default:a(()=>[v(i(e.$t("suno.gender.auto")),1)]),_:1}),o(p,{value:"f"},{default:a(()=>[v(i(e.$t("suno.gender.female")),1)]),_:1}),o(p,{value:"m"},{default:a(()=>[v(i(e.$t("suno.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const fs=E(ds,[["render",ms]]),hs=A({name:"AdvancedParams",components:{ElCollapse:Qe,ElCollapseItem:Ke,ElInput:W,ElSlider:me,ElRadioGroup:J,ElRadioButton:te},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){const e=this.config?.model||"";return["chirp-v5","chirp-v5-5"].includes(e)},styleNegative:{get(){return this.$store.state.suno?.config?.style_negative||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.suno?.config?.lyric_prompt||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.suno?.config?.weirdness??0},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,weirdness:e||void 0})}},styleInfluence:{get(){return this.$store.state.suno?.config?.style_influence??50},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style_influence:e})}},variationCategory:{get(){return this.$store.state.suno?.config?.variation_category||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,variation_category:e||void 0})}},audioWeight:{get(){return this.$store.state.suno?.config?.audio_weight??50},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_weight:e})}},lyricsMode:{get(){return this.$store.state.suno?.config?.lyrics_mode||"manual"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyrics_mode:e})}}}}),gs={key:0,class:"mb-3"},$s={class:"flex items-center mb-1"},_s={class:"text-xs font-bold"},vs={key:1,class:"mb-3"},ys={class:"flex items-center mb-1"},bs={class:"text-xs font-bold"},ks={key:2,class:"mb-3"},ws={class:"flex items-center justify-between mb-1"},Cs={class:"text-xs font-bold"},Vs={class:"text-xs text-[var(--el-text-color-secondary)]"},Ss={key:3,class:"mb-3"},Ts={class:"flex items-center justify-between mb-1"},As={class:"text-xs font-bold"},Ps={class:"text-xs text-[var(--el-text-color-secondary)]"},Us={key:4,class:"mb-3"},Es={class:"flex items-center mb-1"},Is={class:"text-xs font-bold"},Rs={key:5,class:"mb-3"},Ls={class:"flex items-center justify-between mb-1"},Ms={class:"text-xs font-bold"},Fs={class:"text-xs text-[var(--el-text-color-secondary)]"},Ds={key:6,class:"mb-3"},zs={class:"flex items-center mb-1"},js={class:"text-xs font-bold"};function Gs(e,t,d,r,m,y){const $=l("el-input"),p=l("el-slider"),f=l("el-radio-button"),k=l("el-radio-group"),g=l("el-collapse-item"),T=l("el-collapse");return n(),b(T,{modelValue:e.activeNames,"onUpdate:modelValue":t[7]||(t[7]=_=>e.activeNames=_),class:"advanced-collapse"},{default:a(()=>[o(g,{title:e.$t("suno.name.advancedParams"),name:"advanced"},{default:a(()=>[e.config?.custom?(n(),u("div",gs,[s("div",$s,[s("span",_s,i(e.$t("suno.name.styleNegative")),1)]),o($,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=_=>e.styleNegative=_),placeholder:e.$t("suno.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",vs,[s("div",ys,[s("span",bs,i(e.$t("suno.name.lyricPrompt")),1)]),o($,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyricPrompt=_),placeholder:e.$t("suno.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom?(n(),u("div",ks,[s("div",ws,[s("span",Cs,i(e.$t("suno.name.weirdness")),1),s("span",Vs,i(e.weirdness??0),1)]),o(p,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=_=>e.weirdness=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom?(n(),u("div",Ss,[s("div",Ts,[s("span",As,i(e.$t("suno.name.styleInfluence")),1),s("span",Ps,i(e.styleInfluence??50),1)]),o(p,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||(t[3]=_=>e.styleInfluence=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.isV5OrAbove?(n(),u("div",Us,[s("div",Es,[s("span",Is,i(e.$t("suno.name.variationCategory")),1)]),o(k,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||(t[4]=_=>e.variationCategory=_)},{default:a(()=>[o(f,{value:""},{default:a(()=>[v(i(e.$t("suno.gender.auto")),1)]),_:1}),o(f,{value:"high"},{default:a(()=>[v(i(e.$t("suno.variation.high")),1)]),_:1}),o(f,{value:"low"},{default:a(()=>[v(i(e.$t("suno.variation.low")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),e.config?.action==="cover"?(n(),u("div",Rs,[s("div",Ls,[s("span",Ms,i(e.$t("suno.name.audioWeight")),1),s("span",Fs,i(e.audioWeight??50),1)]),o(p,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||(t[5]=_=>e.audioWeight=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",Ds,[s("div",zs,[s("span",js,i(e.$t("suno.name.lyricsMode")),1)]),o(k,{modelValue:e.lyricsMode,"onUpdate:modelValue":t[6]||(t[6]=_=>e.lyricsMode=_)},{default:a(()=>[o(f,{value:"manual"},{default:a(()=>[v(i(e.$t("suno.lyricsMode.manual")),1)]),_:1}),o(f,{value:"auto"},{default:a(()=>[v(i(e.$t("suno.lyricsMode.auto")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Bs=E(hs,[["render",Gs],["__scopeId","data-v-505f8fc7"]]),Os=A({name:"ReplaceSectionInput",components:{ElInputNumber:oe,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},replaceSectionStart:{get(){return this.$store.state.suno?.config?.replace_section_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.suno?.config?.replace_section_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),Ns={class:"field"},Hs={class:"flex items-center mb-2"},qs={class:"text-sm font-bold m-0"},Ws={key:0,class:"task mb-2"},Ks={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Qs={class:"info flex-1 min-w-0"},Js={class:"text-sm font-bold m-0 truncate"},Ys={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Zs={class:"flex gap-2"};function Xs(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=q("loading");return n(),u("div",Ns,[s("div",Hs,[s("h2",qs,i(e.$t("suno.name.replaceSection")),1),o($,{content:e.$t("suno.description.replaceSection")},null,8,["content"])]),e.audio?(n(),u("div",Ws,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=g=>e.onClick(e.audio))},[O((n(),u("div",Ks,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",Qs,[s("h2",Js,i(e.audio?.title),1),s("p",Ys,i(e.audio?.style),1)])])])):c("",!0),s("div",Zs,[o(f,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=g=>e.replaceSectionStart=g),class:"flex-1",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=g=>e.replaceSectionEnd=g),class:"flex-1",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const xs=E(Os,[["render",Xs]]),en=A({name:"OverpaintingInput",components:{ElInputNumber:oe,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},overpaintingStart:{get(){return this.$store.state.suno?.config?.overpainting_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,overpainting_start:e})}},overpaintingEnd:{get(){return this.$store.state.suno?.config?.overpainting_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,overpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),tn={class:"field"},on={class:"flex items-center mb-2"},sn={class:"text-sm font-bold m-0"},nn={key:0,class:"task mb-2"},an={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},ln={class:"info flex-1 min-w-0"},rn={class:"text-sm font-bold m-0 truncate"},dn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},un={class:"flex gap-2"};function cn(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=q("loading");return n(),u("div",tn,[s("div",on,[s("h2",sn,i(e.$t("suno.name.overpaintingRange")),1),o($,{content:e.$t("suno.description.overpainting")},null,8,["content"])]),e.audio?(n(),u("div",nn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=g=>e.onClick(e.audio))},[O((n(),u("div",an,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",ln,[s("h2",rn,i(e.audio?.title),1),s("p",dn,i(e.audio?.style),1)])])])):c("",!0),s("div",un,[o(f,{modelValue:e.overpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=g=>e.overpaintingStart=g),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.overpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.overpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=g=>e.overpaintingEnd=g),class:"flex-1",size:"small",min:e.overpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.overpaintingEnd")},null,8,["modelValue","min","max","placeholder"])])])}const pn=E(en,[["render",cn]]),mn=A({name:"UnderpaintingInput",components:{ElInputNumber:oe,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},underpaintingStart:{get(){return this.$store.state.suno?.config?.underpainting_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,underpainting_start:e})}},underpaintingEnd:{get(){return this.$store.state.suno?.config?.underpainting_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,underpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),fn={class:"field"},hn={class:"flex items-center mb-2"},gn={class:"text-sm font-bold m-0"},$n={key:0,class:"task mb-2"},_n={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},vn={class:"info flex-1 min-w-0"},yn={class:"text-sm font-bold m-0 truncate"},bn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},kn={class:"flex gap-2"};function wn(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=q("loading");return n(),u("div",fn,[s("div",hn,[s("h2",gn,i(e.$t("suno.name.underpaintingRange")),1),o($,{content:e.$t("suno.description.underpainting")},null,8,["content"])]),e.audio?(n(),u("div",$n,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=g=>e.onClick(e.audio))},[O((n(),u("div",_n,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",vn,[s("h2",yn,i(e.audio?.title),1),s("p",bn,i(e.audio?.style),1)])])])):c("",!0),s("div",kn,[o(f,{modelValue:e.underpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=g=>e.underpaintingStart=g),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.underpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.underpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=g=>e.underpaintingEnd=g),class:"flex-1",size:"small",min:e.underpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.underpaintingEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Cn=E(mn,[["render",wn]]),Vn=A({name:"SamplesInput",components:{ElInputNumber:oe,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},samplesStart:{get(){return this.$store.state.suno?.config?.samples_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,samples_start:e})}},samplesEnd:{get(){return this.$store.state.suno?.config?.samples_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,samples_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),Sn={class:"field"},Tn={class:"flex items-center mb-2"},An={class:"text-sm font-bold m-0"},Pn={key:0,class:"task mb-2"},Un={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},En={class:"info flex-1 min-w-0"},In={class:"text-sm font-bold m-0 truncate"},Rn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Ln={class:"flex gap-2"};function Mn(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=q("loading");return n(),u("div",Sn,[s("div",Tn,[s("h2",An,i(e.$t("suno.name.samplesRange")),1),o($,{content:e.$t("suno.description.samples")},null,8,["content"])]),e.audio?(n(),u("div",Pn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=g=>e.onClick(e.audio))},[O((n(),u("div",Un,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",En,[s("h2",In,i(e.audio?.title),1),s("p",Rn,i(e.audio?.style),1)])])])):c("",!0),s("div",Ln,[o(f,{modelValue:e.samplesStart,"onUpdate:modelValue":t[1]||(t[1]=g=>e.samplesStart=g),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.samplesStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.samplesEnd,"onUpdate:modelValue":t[2]||(t[2]=g=>e.samplesEnd=g),class:"flex-1",size:"small",min:e.samplesStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.samplesEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Fn=E(Vn,[["render",Mn]]),Dn=[.5,.75,1,1.25,1.5,2],zn=A({name:"AdjustSpeedInput",components:{ElRadioGroup:J,ElRadioButton:te,ElImage:N,InfoIcon:F},data(){return{options:Dn}},computed:{audio(){return this.$store.state.suno?.config?.audio},speed:{get(){const e=this.$store.state.suno?.config?.speed;return typeof e=="number"?e:1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,speed:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),jn={class:"field"},Gn={class:"flex items-center mb-2"},Bn={class:"text-sm font-bold m-0"},On={key:0,class:"task mb-2"},Nn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Hn={class:"info flex-1 min-w-0"},qn={class:"text-sm font-bold m-0 truncate"},Wn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"};function Kn(e,t,d,r,m,y){const $=l("info-icon"),p=l("el-image"),f=l("el-radio-button"),k=l("el-radio-group"),g=q("loading");return n(),u("div",jn,[s("div",Gn,[s("h2",Bn,i(e.$t("suno.name.adjustSpeed")),1),o($,{content:e.$t("suno.description.adjustSpeed")},null,8,["content"])]),e.audio?(n(),u("div",On,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=T=>e.onClick(e.audio))},[O((n(),u("div",Nn,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[g,!e.audio?.audio_url]]),s("div",Hn,[s("h2",qn,i(e.audio?.title),1),s("p",Wn,i(e.audio?.style),1)])])])):c("",!0),o(k,{modelValue:e.speed,"onUpdate:modelValue":t[1]||(t[1]=T=>e.speed=T),size:"small",class:"speed-group"},{default:a(()=>[(n(!0),u(M,null,D(e.options,T=>(n(),b(f,{key:T,value:T},{default:a(()=>[v(i(T)+"x",1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])}const Qn=E(zn,[["render",Kn],["__scopeId","data-v-ba834628"]]),Jn=A({name:"VoiceCreateDialog",components:{ElDialog:le,ElForm:Ye,ElFormItem:Je,ElInput:W,ElButton:B,ElRadioGroup:J,ElRadio:je},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","created"],data(){return{sourceType:"song",form:{name:"",description:"",audio_id:"",audio_url:""},loading:!1}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},token(){return this.$store.state.suno?.credential?.token},canSubmit(){return!(!this.form.name||this.sourceType==="song"&&!this.form.audio_id||this.sourceType==="upload"&&!this.form.audio_url)}},methods:{onClose(){this.visible=!1,this.resetForm()},resetForm(){this.form={name:"",description:"",audio_id:"",audio_url:""},this.sourceType="song"},async onSubmit(){if(this.token){this.loading=!0;try{this.sourceType==="song"?await L.persona({audio_id:this.form.audio_id,name:this.form.name,description:this.form.description},{token:this.token}):await L.voices({audio_url:this.form.audio_url,name:this.form.name,description:this.form.description},{token:this.token}),w.success(this.$t("suno.voice.createSuccess")),this.$emit("created"),this.onClose()}catch{w.error(this.$t("suno.voice.createFailed"))}finally{this.loading=!1}}}}});function Yn(e,t,d,r,m,y){const $=l("el-input"),p=l("el-form-item"),f=l("el-radio"),k=l("el-radio-group"),g=l("el-form"),T=l("el-button"),_=l("el-dialog");return n(),b(_,{modelValue:e.visible,"onUpdate:modelValue":t[5]||(t[5]=V=>e.visible=V),title:e.$t("suno.voice.createTitle"),width:"480px","close-on-click-modal":!1,onClose:e.onClose},{footer:a(()=>[o(T,{onClick:e.onClose},{default:a(()=>[v(i(e.$t("common.button.cancel")),1)]),_:1},8,["onClick"]),o(T,{type:"primary",loading:e.loading,disabled:!e.canSubmit,onClick:e.onSubmit},{default:a(()=>[v(i(e.$t("suno.voice.create")),1)]),_:1},8,["loading","disabled","onClick"])]),default:a(()=>[o(g,{"label-position":"top",class:"voice-create-form"},{default:a(()=>[o(p,{label:e.$t("suno.voice.name")},{default:a(()=>[o($,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||(t[0]=V=>e.form.name=V),placeholder:e.$t("suno.voice.namePlaceholder"),maxlength:"50"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(p,{label:e.$t("suno.voice.description")},{default:a(()=>[o($,{modelValue:e.form.description,"onUpdate:modelValue":t[1]||(t[1]=V=>e.form.description=V),type:"textarea",rows:2,placeholder:e.$t("suno.voice.descriptionPlaceholder"),maxlength:"200"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(p,{label:e.$t("suno.voice.sourceType")},{default:a(()=>[o(k,{modelValue:e.sourceType,"onUpdate:modelValue":t[2]||(t[2]=V=>e.sourceType=V),class:"w-full"},{default:a(()=>[o(f,{value:"song"},{default:a(()=>[v(i(e.$t("suno.voice.fromSong")),1)]),_:1}),o(f,{value:"upload"},{default:a(()=>[v(i(e.$t("suno.voice.fromUpload")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),e.sourceType==="song"?(n(),b(p,{key:0,label:e.$t("suno.voice.audioId")},{default:a(()=>[o($,{modelValue:e.form.audio_id,"onUpdate:modelValue":t[3]||(t[3]=V=>e.form.audio_id=V),placeholder:e.$t("suno.voice.audioIdPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0),e.sourceType==="upload"?(n(),b(p,{key:1,label:e.$t("suno.voice.audioUrl")},{default:a(()=>[o($,{modelValue:e.form.audio_url,"onUpdate:modelValue":t[4]||(t[4]=V=>e.form.audio_url=V),placeholder:e.$t("suno.voice.audioUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0)]),_:1})]),_:1},8,["modelValue","title","onClose"])}const Zn=E(Jn,[["render",Yn]]),Xn=A({name:"VoiceManager",components:{ElButton:B,ElIcon:x,ElTabs:we,ElTabPane:ke,ElTooltip:pe,Loading:be,FontAwesomeIcon:z,VoiceCreateDialog:Zn},data(){return{showCreateDialog:!1,loading:!1,deletingId:null,activeTab:"all"}},computed:{personas(){return this.$store.state.suno?.personas||[]},favoriteIds(){return this.$store.state.suno?.favoritePersonaIds||[]},favoritePersonas(){return this.personas.filter(e=>e.persona_id&&this.favoriteIds.includes(e.persona_id))},visiblePersonas(){return this.activeTab==="favorites"?this.favoritePersonas:this.personas},selectedPersonaId(){return this.$store.state.suno?.config?.persona_id}},watch:{"$store.state.suno.credential":{handler(){this.loadPersonas()},immediate:!0}},methods:{isFavorite(e){return!!e&&this.favoriteIds.includes(e)},onToggleFavorite(e){e.persona_id&&this.$store.commit("suno/togglePersonaFavorite",e.persona_id)},async loadPersonas(){if(this.$store.state.suno?.credential?.token){this.loading=!0;try{await this.$store.dispatch("suno/getPersonas")}finally{this.loading=!1}}},selectPersona(e){const t={...this.$store.state.suno?.config};t.persona_id===e.persona_id?t.persona_id=void 0:t.persona_id=e.persona_id,this.$store.dispatch("suno/setConfig",t)},async onDelete(e){try{await Ce.confirm(this.$t("suno.voice.confirmDelete"),this.$t("suno.voice.delete"),{type:"warning",confirmButtonText:this.$t("common.button.confirm"),cancelButtonText:this.$t("common.button.cancel")})}catch{return}if(!e.persona_id)return;this.deletingId=e.persona_id;const t=await this.$store.dispatch("suno/deletePersona",e.persona_id);if(this.deletingId=null,t){if(w.success(this.$t("suno.voice.deleteSuccess")),this.selectedPersonaId===e.persona_id){const d={...this.$store.state.suno?.config,persona_id:void 0};this.$store.dispatch("suno/setConfig",d)}this.favoriteIds.includes(e.persona_id)&&this.$store.commit("suno/togglePersonaFavorite",e.persona_id)}else w.error(this.$t("suno.voice.deleteFailed"))},async onCreated(){await this.loadPersonas()}}}),xn={class:"voice-manager"},ei={class:"flex items-center justify-between mb-3"},ti={class:"text-sm font-medium"},oi={key:0,class:"text-center py-6"},si={key:1,class:"text-center py-6 text-gray-400 text-sm"},ni={key:2,class:"voice-list"},ii=["onClick"],ai={class:"flex-1 min-w-0"},li={class:"voice-name"},ri={key:0,class:"voice-desc"};function di(e,t,d,r,m,y){const $=l("font-awesome-icon"),p=l("el-button"),f=l("el-tab-pane"),k=l("el-tabs"),g=l("loading"),T=l("el-icon"),_=l("el-tooltip"),V=l("voice-create-dialog");return n(),u("div",xn,[s("div",ei,[s("span",ti,i(e.$t("suno.voice.title")),1),o(p,{type:"primary",size:"small",onClick:t[0]||(t[0]=C=>e.showCreateDialog=!0)},{default:a(()=>[o($,{icon:"fa-solid fa-plus",class:"mr-1"}),v(" "+i(e.$t("suno.voice.create")),1)]),_:1})]),o(k,{modelValue:e.activeTab,"onUpdate:modelValue":t[1]||(t[1]=C=>e.activeTab=C),class:"voice-tabs",size:"small"},{default:a(()=>[o(f,{name:"all",label:e.$t("suno.voice.tabAll")+" ("+(e.personas?.length||0)+")"},null,8,["label"]),o(f,{name:"favorites",label:e.$t("suno.voice.tabFavorites")+" ("+e.favoritePersonas.length+")"},null,8,["label"])]),_:1},8,["modelValue"]),e.loading?(n(),u("div",oi,[o(T,{class:"is-loading"},{default:a(()=>[o(g)]),_:1})])):e.visiblePersonas.length===0?(n(),u("div",si,i(e.activeTab==="favorites"?e.$t("suno.voice.emptyFavorites"):e.$t("suno.voice.empty")),1)):(n(),u("div",ni,[(n(!0),u(M,null,D(e.visiblePersonas,C=>(n(),u("div",{key:C.persona_id,class:G(["voice-item",{active:e.selectedPersonaId===C.persona_id}]),onClick:I=>e.selectPersona(C)},[s("div",ai,[s("div",li,[o($,{icon:C.source_type==="voice"?"fa-solid fa-microphone":"fa-solid fa-music",class:"mr-1.5 text-xs opacity-60"},null,8,["icon"]),v(" "+i(C.name||C.persona_id),1)]),C.description?(n(),u("div",ri,i(C.description),1)):c("",!0)]),s("div",{class:"voice-actions",onClick:t[2]||(t[2]=U(()=>{},["stop"]))},[o(_,{content:e.isFavorite(C.persona_id)?e.$t("suno.voice.unfavorite"):e.$t("suno.voice.favorite"),placement:"top"},{default:a(()=>[o(p,{size:"small",text:"",class:G({"voice-fav-active":e.isFavorite(C.persona_id)}),onClick:I=>e.onToggleFavorite(C)},{default:a(()=>[o($,{icon:e.isFavorite(C.persona_id)?"fa-solid fa-star":"fa-regular fa-star"},null,8,["icon"])]),_:2},1032,["class","onClick"])]),_:2},1032,["content"]),o(p,{type:"danger",size:"small",text:"",loading:e.deletingId===C.persona_id,onClick:I=>e.onDelete(C)},{default:a(()=>[o($,{icon:"fa-solid fa-trash"})]),_:1},8,["loading","onClick"])])],10,ii))),128))])),o(V,{modelValue:e.showCreateDialog,"onUpdate:modelValue":t[3]||(t[3]=C=>e.showCreateDialog=C),onCreated:e.onCreated},null,8,["modelValue","onCreated"])])}const ui=E(Xn,[["render",di],["__scopeId","data-v-8b8e36d9"]]),ci=A({name:"PersonaInput",components:{ElSelect:ce,ElOption:ue,ElButton:B,ElDrawer:ye,FontAwesomeIcon:z,InfoIcon:F,VoiceManager:ui},data(){return{showManager:!1}},computed:{personaId:{get(){return this.$store.state.suno?.config?.persona_id||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,persona_id:e||void 0})}},personas(){return this.$store.state.suno?.personas||[]}}}),pi={class:"field"},mi={class:"flex items-center justify-between mb-2"},fi={class:"flex items-center"},hi={class:"text-sm font-bold m-0"},gi={class:"flex items-center justify-between w-full"},$i={key:0,class:"text-xs text-gray-400 ml-2"};function _i(e,t,d,r,m,y){const $=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-option"),g=l("el-select"),T=l("voice-manager"),_=l("el-drawer");return n(),u("div",pi,[s("div",mi,[s("div",fi,[s("h2",hi,i(e.$t("suno.name.persona")),1),o($,{content:e.$t("suno.description.persona")},null,8,["content"])]),o(f,{type:"primary",size:"small",text:"",onClick:t[0]||(t[0]=V=>e.showManager=!0)},{default:a(()=>[o(p,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+i(e.$t("suno.voice.manage")),1)]),_:1})]),o(g,{modelValue:e.personaId,"onUpdate:modelValue":t[1]||(t[1]=V=>e.personaId=V),size:"small",placeholder:e.$t("suno.placeholder.personaId"),clearable:"",filterable:"",class:"w-full"},{default:a(()=>[(n(!0),u(M,null,D(e.personas,V=>(n(),b(k,{key:V.persona_id||"",value:V.persona_id||"",label:V.name||V.persona_id||""},{default:a(()=>[s("div",gi,[s("span",null,i(V.name||V.persona_id),1),V.source_type?(n(),u("span",$i,i(V.source_type),1)):c("",!0)])]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue","placeholder"]),o(_,{modelValue:e.showManager,"onUpdate:modelValue":t[2]||(t[2]=V=>e.showManager=V),title:e.$t("suno.voice.title"),size:"380px",direction:"rtl"},{default:a(()=>[o(T)]),_:1},8,["modelValue","title"])])}const vi=E(ci,[["render",_i]]),yi=A({name:"PresetPanel",components:{TypeSelector:Ct,PromptInput:so,LyricInput:vo,StyleInput:Eo,TitleInput:Do,ExtendFromInput:Yo,CoverFromInput:rs,UploadAudio:Kt,VocalGenderSelector:fs,AdvancedParams:Bs,ReplaceSectionInput:xs,OverpaintingInput:pn,UnderpaintingInput:Cn,SamplesInput:Fn,AdjustSpeedInput:Qn,PersonaInput:vi,FontAwesomeIcon:z,ElButton:B,Consumption:Ze},emits:["generate"],computed:{config(){return this.$store.state.suno?.config},consumption(){return Xe(this.config,this.service?.cost)},service(){return this.$store.state.suno?.service},supportsVocalGender(){const e=this.config?.model||"";return["chirp-v4-5-plus","chirp-v5","chirp-v5-5"].includes(e)},supportsPersona(){const e=this.config?.action;return!e||e==="generate"||e==="artist_consistency"||e==="artist_consistency_vox"},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("suno.button.extend"):e==="cover"?this.$t("suno.button.cover_music"):e==="remaster"?this.$t("suno.button.remaster"):e==="replace_section"?this.$t("suno.button.replace_section"):e==="mashup"?this.$t("suno.button.mashup"):e==="stems"?this.$t("suno.button.get_stems"):e==="concat"?this.$t("suno.button.concat_music"):e==="upload_cover"?this.$t("suno.button.upload_cover"):e==="artist_consistency"?this.$t("suno.button.artist_consistency"):e==="artist_consistency_vox"?this.$t("suno.button.artist_consistency_vox"):e==="overpainting"?this.$t("suno.button.overpainting"):e==="underpainting"?this.$t("suno.button.underpainting"):e==="samples"?this.$t("suno.button.samples"):e==="adjust_speed"?this.$t("suno.button.adjust_speed"):this.$t("suno.button.generate")}},methods:{onGenerate(){this.$emit("generate")},onClearAll(){this.$store.commit("suno/setConfig",{custom:!1,sounds:!1,instrumental:!1,lyric:"",style:"",title:"",lyrics_mode:"manual",model:this.$store.state.suno?.config?.model})}}}),bi={class:"flex flex-col h-full"},ki={class:"flex-1 overflow-y-auto p-5"},wi={class:"flex flex-col items-center justify-center px-5 pb-5 gap-2"},Ci={class:"flex gap-2 w-full"};function Vi(e,t,d,r,m,y){const $=l("type-selector"),p=l("upload-audio"),f=l("prompt-input"),k=l("lyric-input"),g=l("style-input"),T=l("title-input"),_=l("vocal-gender-selector"),V=l("persona-input"),C=l("extend-from-input"),I=l("cover-from-input"),P=l("replace-section-input"),K=l("overpainting-input"),Q=l("underpainting-input"),Y=l("samples-input"),h=l("adjust-speed-input"),S=l("advanced-params"),ae=l("consumption"),R=l("font-awesome-icon"),se=l("el-button");return n(),u("div",bi,[s("div",ki,[o($,{class:"mb-4"}),o(p,{class:"mb-4"}),e.config?.custom?c("",!0):(n(),b(f,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(n(),b(k,{key:1,class:"mb-4"})):c("",!0),e.config?.custom?(n(),b(g,{key:2,class:"mb-4"})):c("",!0),e.config?.custom?(n(),b(T,{key:3,class:"mb-4"})):c("",!0),e.config?.custom&&!e.config.instrumental&&e.supportsVocalGender?(n(),b(_,{key:4,class:"mb-4"})):c("",!0),e.config?.custom&&e.supportsPersona?(n(),b(V,{key:5,class:"mb-4"})):c("",!0),e.config?.action==="extend"?(n(),b(C,{key:6,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),b(I,{key:7,class:"mb-4"})):c("",!0),e.config?.action==="replace_section"?(n(),b(P,{key:8,class:"mb-4"})):c("",!0),e.config?.action==="overpainting"?(n(),b(K,{key:9,class:"mb-4"})):c("",!0),e.config?.action==="underpainting"?(n(),b(Q,{key:10,class:"mb-4"})):c("",!0),e.config?.action==="samples"?(n(),b(Y,{key:11,class:"mb-4"})):c("",!0),e.config?.action==="adjust_speed"?(n(),b(h,{key:12,class:"mb-4"})):c("",!0),o(S,{class:"mb-4"})]),s("div",wi,[o(ae,{value:e.consumption,service:e.service},null,8,["value","service"]),s("div",Ci,[o(se,{class:"flex-1",onClick:e.onClearAll},{default:a(()=>[o(R,{icon:"fa-solid fa-broom",class:"mr-1"}),v(" "+i(e.$t("suno.button.clear_all")),1)]),_:1},8,["onClick"]),o(se,{type:"primary",class:"flex-1",round:"",onClick:e.onGenerate},{default:a(()=>[o(R,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+i(e.generateButtonText),1)]),_:1},8,["onClick"])])])])}const Si=E(yi,[["render",Vi],["__scopeId","data-v-fa2936b9"]]),ve="https://webhook.acedata.cloud/suno",Ti=A({name:"TaskPreview",components:{ElImage:N,ElIcon:x,ElTooltip:pe,FontAwesomeIcon:z,VideoPlay:de,VideoPause:re,ElDropdown:Te,ElDropdownMenu:Se,ElDropdownItem:Ve,ElInput:W,ElProgress:et,ElCheckbox:xe,Loading:be},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1,editingAudioId:null,editingTitle:""}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===Z.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){return this.$store.state.suno?.tasks},audios(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(d=>({...d,action:t})):e},application(){return this.$store.state.suno?.application},active(){return this.$store.state.suno?.tasks?.active},isMashupMode(){return this.$store.state.suno?.config?.action==="mashup"},mashupAudioIds(){return this.$store.state.suno?.config?.mashup_audio_ids||[]}},methods:{useFormatDuring:X,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.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(),console.log("on download",t);const r=new URL(t).pathname,m=r.substring(r.lastIndexOf("/")+1);console.log("on preview",m),fetch(t).then(y=>y.blob()).then(y=>{Be.saveAs(y,m)})},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("suno.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,d)=>{const r={audio_id:e},m=this.credential?.token;if(!m){console.error("no token specified"),d(new Error("No token specified"));return}L.mp4(r,{token:m}).then(y=>{const $=y.data?.data?.video_url;$?t($):d(new Error("Video URL not found in response"))}).catch(y=>{d(y)})})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){console.log("on cover"),console.debug("set config",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl("concat",e)},async onRemaster(e){await this.onGenerateAudioUrl("remaster",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.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)})},onMashup(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"mashup",audio:e,audio_id:e.id,mashup_audio_ids:[e.id]})},onOverpainting(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"overpainting",audio:e,audio_id:e.id,overpainting_start:0,overpainting_end:Math.min(30,e.duration||30)})},onUnderpainting(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"underpainting",audio:e,audio_id:e.id,underpainting_start:0,underpainting_end:Math.min(30,e.duration||30)})},onSamples(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"samples",audio:e,audio_id:e.id,samples_start:0,samples_end:Math.min(30,e.duration||30)})},onArtistConsistency(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"artist_consistency",audio:e,audio_id:e.id})},onAdjustSpeed(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"adjust_speed",audio:e,audio_id:e.id,speed:1})},onReusePrompt(e){const t=this.modelValue?.request??{};if(!(t.prompt||t.lyric||t.style||t.title||t.lyric_prompt||t.style_negative||t.persona_id)){w.warning(this.$t("suno.message.reusePromptEmpty"));return}this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:t.model??e.model,custom:t.custom??!1,instrumental:t.instrumental??!1,prompt:t.prompt??"",lyric:t.lyric??"",lyric_prompt:t.lyric_prompt??"",lyrics_mode:t.lyrics_mode??"manual",title:t.title??"",style:t.style??"",style_negative:t.style_negative??"",vocal_gender:t.vocal_gender,weirdness:t.weirdness,style_influence:t.style_influence,variation_category:t.variation_category,audio_weight:t.audio_weight,persona_id:t.persona_id,action:void 0,audio:void 0,audio_id:void 0,mashup_audio_ids:void 0,continue_at:void 0,speed:void 0,replace_section_start:void 0,replace_section_end:void 0,overpainting_start:void 0,overpainting_end:void 0,underpainting_start:void 0,underpainting_end:void 0,samples_start:void 0,samples_end:void 0}),w.success(this.$t("suno.message.reusePromptSuccess"))},async onExtractVocals(e){const t=this.credential?.token;t&&(w.info(this.$t("suno.message.extractingVocals")),L.vox({audio_id:e,callback_url:ve},{token:t}).then(()=>{w.success(this.$t("suno.message.extractVocalsSuccess"))}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.extractVocalsFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()}))},async onGetTiming(e){const t=this.credential?.token;t&&(w.info(this.$t("suno.message.fetchingTiming")),L.timing({audio_id:e},{token:t}).then(d=>{w.success(this.$t("suno.message.fetchTimingSuccess")),console.debug("timing data",d.data)}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.fetchTimingFailed"))}))},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("suno.message.fetchingWav"));const r=(await L.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;r?this.onDownload(null,r):w.error(this.$t("suno.message.fetchWavFailed"))}catch{w.error(this.$t("suno.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async handleMidiDownload(e){if(!e?.id||this.isFetchingMidi)return;const t=this.credential?.token;if(t)try{this.isFetchingMidi=!0,w.info(this.$t("suno.message.fetchingMidi"));const r=(await L.midi({audio_id:e.id},{token:t})).data?.data?.midi_url;r?this.onDownload(null,r):w.error(this.$t("suno.message.fetchMidiFailed"))}catch{w.error(this.$t("suno.message.fetchMidiFailed"))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){const d={action:e,audio_id:t,callback_url:ve},r=this.credential?.token;if(!r){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),L.audio(d,{token:r}).then(()=>{w.success(this.$t("suno.message.startTaskSuccess"))}).catch(m=>{w.error(m?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},isMashupSelected(e){return!!e.id&&this.mashupAudioIds.includes(e.id)},onToggleMashup(e){if(!e.id)return;const t=[...this.mashupAudioIds],d=t.indexOf(e.id);d!==-1?t.splice(d,1):t.push(e.id),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,mashup_audio_ids:t})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},onStartTitleEdit(e){this.editingAudioId=e.id??null,this.editingTitle=e.title||"",this.$nextTick(()=>{this.$refs.titleInput?.focus?.()})},onSaveTitleEdit(e){if(this.editingAudioId!==e.id)return;const t=this.editingTitle.trim();if(t&&t!==e.title){const d=this.$store.state.suno?.tasks;if(d?.items)for(const r of d.items){const y=(r?.response?.data??[]).find($=>$.id===e.id);if(y){y.title=t;break}}}this.editingAudioId=null,this.editingTitle=""},onCancelTitleEdit(){this.editingAudioId=null,this.editingTitle=""},async onDelete(e){try{await Ce.confirm(this.$t("suno.message.confirmDelete"),{confirmButtonText:this.$t("suno.button.delete"),cancelButtonText:this.$t("common.button.cancel"),type:"warning"})}catch{return}const t=this.$store.state.suno?.tasks;if(t?.items)for(const d of t.items){const r=d?.response?.data??[],m=r.findIndex(y=>y.id===e.id);if(m!==-1){if(r.splice(m,1),r.length===0){const y=t.items.indexOf(d);y!==-1&&t.items.splice(y,1)}break}}this.$store.state?.suno?.audio?.id===e.id&&this.$store.dispatch("suno/setAudio",null),w.success(this.$t("suno.message.deleteSuccess"))},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),Ai={class:"task"},Pi=["onClick"],Ui=["onClick"],Ei={class:"left"},Ii=["onClick"],Ri=["onClick"],Li={key:2,class:"duration"},Mi={class:"info"},Fi={key:1,class:"title-row"},Di={class:"title"},zi={class:"style"},ji={key:2,class:"progress-row"},Gi={class:"progress-text"},Bi={class:"right"},Oi={class:"el-dropdown-link"},Ni={class:"flex items-center min-w-[120px]"},Hi={class:"flex items-center min-w-[120px]"},qi={class:"flex items-center min-w-[120px]"},Wi={class:"el-dropdown-link"};function Ki(e,t,d,r,m,y){const $=l("el-checkbox"),p=l("el-image"),f=l("video-pause"),k=l("el-icon"),g=l("video-play"),T=l("el-input"),_=l("font-awesome-icon"),V=l("el-progress"),C=l("el-tooltip"),I=l("Loading"),P=l("el-dropdown-item"),K=l("el-dropdown-menu"),Q=l("el-dropdown"),Y=q("loading");return n(),u("div",Ai,[(n(!0),u(M,null,D(e.audios,h=>(n(),u("div",{key:h.id,class:G(["audio",{"mashup-selected":e.isMashupSelected(h)}]),onClick:U(S=>e.onClick(h),["stop"])},[e.isMashupMode&&h?.audio_url?(n(),u("div",{key:0,class:"mashup-check",onClick:U(S=>e.onToggleMashup(h),["stop"])},[o($,{"model-value":e.isMashupSelected(h),onClick:t[0]||(t[0]=U(()=>{},["stop"]))},null,8,["model-value"])],8,Ui)):c("",!0),O((n(),u("div",Ei,[o(p,{src:h?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),h?.audio_url&&e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:U(S=>e.onPause(h),["stop"])},[o(k,null,{default:a(()=>[o(f)]),_:1})],8,Ii)):c("",!0),h?.audio_url&&(e.$store.state?.suno?.audio?.id!==h.id||e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:U(S=>e.onPlay(h),["stop"])},[o(k,null,{default:a(()=>[o(g)]),_:1})],8,Ri)):c("",!0),h?.duration?(n(),u("div",Li,i(e.useFormatDuring(h?.duration)),1)):c("",!0)])),[[Y,!h?.audio_url]]),s("div",Mi,[e.editingAudioId===h.id?(n(),u("div",{key:0,class:"title-edit",onClick:t[2]||(t[2]=U(()=>{},["stop"]))},[o(T,{ref_for:!0,ref:"titleInput",modelValue:e.editingTitle,"onUpdate:modelValue":t[1]||(t[1]=S=>e.editingTitle=S),size:"small",onKeyup:[ie(S=>e.onSaveTitleEdit(h),["enter"]),ie(e.onCancelTitleEdit,["escape"])],onBlur:S=>e.onSaveTitleEdit(h)},null,8,["modelValue","onKeyup","onBlur"])])):(n(),u("div",Fi,[s("h2",Di,i(h?.title),1),h?.audio_url?(n(),b(_,{key:0,icon:"fa-solid fa-pen",class:"edit-icon",onClick:U(S=>e.onStartTitleEdit(h),["stop"])},null,8,["onClick"])):c("",!0)])),s("p",zi,i(h?.style),1),!h?.audio_url&&h?.progress!=null&&h?.progress<100?(n(),u("div",ji,[o(V,{percentage:Math.round(h.progress),"stroke-width":4,"show-text":!1,status:"warning",class:"progress-bar"},null,8,["percentage"]),s("span",Gi,i(e.$t("suno.name.generating"))+" "+i(Math.round(h.progress))+"%",1)])):c("",!0)]),s("div",Bi,[o(Q,null,{dropdown:a(()=>[o(K,null,{default:a(()=>[o(P,{disabled:e.isFetchingVideoUrl,onClick:S=>e.handleVideoDownload(h)},{default:a(()=>[s("div",Ni,[e.isFetchingVideoUrl?(n(),b(k,{key:0,class:"is-loading mr-2"},{default:a(()=>[o(I)]),_:1})):c("",!0),s("span",null,i(e.$t("suno.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),h?.audio_url?(n(),b(P,{key:0,onClick:U(S=>e.onDownload(S,h?.audio_url),["stop"])},{default:a(()=>[v(i(e.$t("suno.button.download_audio")),1)]),_:1},8,["onClick"])):c("",!0),o(P,{disabled:e.isFetchingWav,onClick:S=>e.handleWavDownload(h)},{default:a(()=>[s("div",Hi,[e.isFetchingWav?(n(),b(k,{key:0,class:"is-loading mr-2"},{default:a(()=>[o(I)]),_:1})):c("",!0),s("span",null,i(e.$t("suno.button.download_wav")),1)])]),_:1},8,["disabled","onClick"]),o(P,{disabled:e.isFetchingMidi,onClick:S=>e.handleMidiDownload(h)},{default:a(()=>[s("div",qi,[e.isFetchingMidi?(n(),b(k,{key:0,class:"is-loading mr-2"},{default:a(()=>[o(I)]),_:1})):c("",!0),s("span",null,i(e.$t("suno.button.download_midi")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:a(()=>[s("span",Oi,[o(C,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:a(()=>[h?.audio_url||h?.video_url?(n(),b(_,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):c("",!0)]),_:2},1032,["content"])])]),_:2},1024),o(Q,null,{dropdown:a(()=>[o(K,{class:"suno-action-menu"},{default:a(()=>[h?.audio_url?(n(),b(P,{key:0,onClick:U(S=>e.onExtend(S,h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-forward",class:"menu-icon"}),v(" "+i(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"])):c("",!0),o(P,{onClick:U(S=>e.onCover(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-music",class:"menu-icon"}),v(" "+i(e.$t("suno.button.cover_music")),1)]),_:1},8,["onClick"]),h?.id?(n(),b(P,{key:1,onClick:U(S=>e.onMashup(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-shuffle",class:"menu-icon"}),v(" "+i(e.$t("suno.button.mashup")),1)]),_:1},8,["onClick"])):c("",!0),h?.id&&h?.action==="extend"?(n(),b(P,{key:2,onClick:U(S=>e.onConcatMusic(h?.id),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-link",class:"menu-icon"}),v(" "+i(e.$t("suno.button.concat_music")),1)]),_:1},8,["onClick"])):c("",!0),t[3]||(t[3]=s("div",{class:"menu-divider"},null,-1)),h?.id?(n(),b(P,{key:3,onClick:U(S=>e.onReplaceSection(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-scissors",class:"menu-icon"}),v(" "+i(e.$t("suno.button.replace_section")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),b(P,{key:4,onClick:U(S=>e.onOverpainting(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-microphone",class:"menu-icon"}),v(" "+i(e.$t("suno.button.overpainting")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),b(P,{key:5,onClick:U(S=>e.onUnderpainting(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-guitar",class:"menu-icon"}),v(" "+i(e.$t("suno.button.underpainting")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),b(P,{key:6,onClick:U(S=>e.onSamples(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-drum",class:"menu-icon"}),v(" "+i(e.$t("suno.button.samples")),1)]),_:1},8,["onClick"])):c("",!0),t[4]||(t[4]=s("div",{class:"menu-divider"},null,-1)),h.id?(n(),b(P,{key:7,onClick:U(S=>e.onGetStems(h.id),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-layer-group",class:"menu-icon"}),v(" "+i(e.$t("suno.button.get_stems")),1)]),_:1},8,["onClick"])):c("",!0),h.id?(n(),b(P,{key:8,onClick:U(S=>e.onGetAllStems(h.id),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-bars-staggered",class:"menu-icon"}),v(" "+i(e.$t("suno.button.all_stems")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),b(P,{key:9,onClick:U(S=>e.onRemaster(h.id),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-wand-magic-sparkles",class:"menu-icon"}),v(" "+i(e.$t("suno.button.remaster")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),b(P,{key:10,onClick:U(S=>e.onExtractVocals(h.id),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-headphones",class:"menu-icon"}),v(" "+i(e.$t("suno.button.extract_vocals")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),b(P,{key:11,onClick:U(S=>e.onArtistConsistency(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-palette",class:"menu-icon"}),v(" "+i(e.$t("suno.button.artist_consistency")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),b(P,{key:12,onClick:U(S=>e.onAdjustSpeed(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-gauge-high",class:"menu-icon"}),v(" "+i(e.$t("suno.button.adjust_speed")),1)]),_:1},8,["onClick"])):c("",!0),t[5]||(t[5]=s("div",{class:"menu-divider"},null,-1)),o(P,{onClick:U(S=>e.onReusePrompt(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-rotate-left",class:"menu-icon"}),v(" "+i(e.$t("suno.button.reuse_prompt")),1)]),_:1},8,["onClick"]),h?.id?(n(),b(P,{key:13,onClick:U(S=>e.onGetTiming(h.id),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-clock",class:"menu-icon"}),v(" "+i(e.$t("suno.button.get_timing")),1)]),_:1},8,["onClick"])):c("",!0),t[6]||(t[6]=s("div",{class:"menu-divider"},null,-1)),h?.id?(n(),b(P,{key:14,class:"delete-item",onClick:U(S=>e.onDelete(h),["stop"])},{default:a(()=>[o(_,{icon:"fa-solid fa-trash",class:"menu-icon delete-icon"}),v(" "+i(e.$t("suno.button.delete")),1)]),_:1},8,["onClick"])):c("",!0)]),_:2},1024)]),default:a(()=>[s("span",Wi,[o(C,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:a(()=>[h?.audio_url||h?.video_url?(n(),b(_,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):c("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],10,Pi))),128))])}const Qi=E(Ti,[["render",Ki]]),Ji={class:"player-slider"},Yi=A({__name:"PlayerSlider",setup(e){const t=ee(),d=H({get:()=>t.state.suno?.audio?.progress,set:$=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:$})}),r=H({get:()=>t.state.suno?.audio?.duration,set:$=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:$})}),m=()=>{},y=$=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:$});return($,p)=>(n(),u("div",Ji,[o(j(me),{modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=f=>d.value=f),"show-tooltip":!1,min:0,max:r.value,onChange:y,onInput:m},null,8,["modelValue","max"])]))}}),Zi={class:"flex player-song"},Xi=["src"],xi={class:"ml-2 text-xs flex flex-col justify-between"},ea={class:"w-52 2xl:w-96 cursor-pointer truncate"},ta={class:"flex"},oa={class:"ml-2 text-dc"},sa=A({__name:"PlayerSong",setup(e){const t=ee(),d=H({get:()=>t.state.suno.audio,set:r=>t.commit("suno/setAudio",r)});return Pe(d,(r,m)=>{if(r?.audio_url!==m?.audio_url){console.log("audio changed",r),r.object&&(console.log("111",r.object),r.object.pause(),delete r.object);const y=new Audio(r.audio_url);r.state==="playing"?y.play():y.pause(),y.addEventListener("loadedmetadata",()=>{y.currentTime=0,y.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:y.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:y})}else if(r?.progress!==m?.progress&&Math.abs(r.progress-r.object.currentTime)>2){console.log("progress changed",r.progress);const y=t.state.suno.audio;y.object&&(y.object.currentTime=y.progress)}else r?.state!==m?.state&&(console.log("state changed",r.state),r.object&&(r.state==="playing"?r.object.play():r.object.pause()));r?.volume!==m?.volume&&(console.log("volume changed",r.volume),r.object&&(r.object.volume=r.volume/100))}),(r,m)=>(n(),u("div",Zi,[s("img",{alt:"",class:"w-11 h-11 rounded",src:d.value?.image_url||j(Oe)},null,8,Xi),s("div",xi,[s("div",ea,[s("div",ta,[s("span",null,i(d.value?.title||"Music"),1),s("span",oa,"- "+i(d.value?.style||"SmallRuralDog"),1)])])])]))}}),na={class:"flex justify-end items-center gap-x-2.5"},ia={class:"text-xs"},aa=A({__name:"PlayerAction",setup(e){const t=ee(),d=H({get:()=>t.state.suno?.audio?.progress,set:m=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:m})}),r=H({get:()=>t.state.suno?.audio?.duration,set:m=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:m})});return(m,y)=>(n(),u("div",na,[s("span",ia,i(j(X)(d.value))+" / "+i(j(X)(r.value)),1)]))}}),la={class:"player-volume flex flex-col items-center pt-2"},ra={class:"text-sm mt-3"},da=A({__name:"PlayerVolumeSlider",setup(e){const t=ee(),d=H({get:()=>t.state.suno.audio?.volume,set:y=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:y})}),r=H({get:()=>t.state.suno.audio?.muted,set:y=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:y})}),m=y=>t.dispatch("suno/setVolume",y);return(y,$)=>(n(),u("div",la,[o(j(me),{modelValue:d.value,"onUpdate:modelValue":$[0]||($[0]=p=>d.value=p),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:r.value,onInput:m},null,8,["modelValue","disabled"]),s("div",ra,i(d.value),1)]))}}),ua={class:"flex items-center justify-center gap-x-3"},ca=A({__name:"PlayerController",setup(e){const t=ee(),d=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),r=H(()=>t.state.suno.audio);return(m,y)=>(n(),u("div",ua,[o(fe,{icon:r.value?.state==="playing"?j(Ne):j(He),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:d},null,8,["icon"]),o(j(Ae),{placement:"top",width:"50px",trigger:"click"},{reference:a(()=>[o(fe,{icon:j(qe),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:a(()=>[o(da)]),_:1})]))}}),pa={class:"flex flex-col items-stretch h-20"},ma={class:"flex grow px-5 items-center"},fa={class:"flex-1"},ha={class:"flex-1"},ga={class:"flex-1"},$a=A({__name:"Player",setup(e){return(t,d)=>(n(),u("div",pa,[o(Yi),s("div",ma,[s("div",fa,[o(sa)]),s("div",ha,[o(ca)]),s("div",ga,[o(aa)])])]))}}),_a=A({name:"RecentPanel",components:{ElSkeletonItem:st,ElSkeleton:ot,ElInput:W,ElButton:B,ElDropdown:Te,ElDropdownMenu:Se,ElDropdownItem:Ve,ElPopover:Ae,ElRadioGroup:J,ElRadioButton:te,ElSelect:ce,ElOption:ue,FontAwesomeIcon:z,TaskPreview:Qi,Player:$a,NoTasks:tt,ScrollList:ze},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0,searchQuery:"",sortBy:"newest",filterType:"all",filterDuration:"all",filterVideo:"all",filterModel:"all"}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}},sortLabel(){return this.sortBy==="newest"?this.$t("suno.sort.newest"):this.$t("suno.sort.oldest")},activeFilterCount(){let e=0;return this.filterType!=="all"&&e++,this.filterDuration!=="all"&&e++,this.filterVideo!=="all"&&e++,this.filterModel&&this.filterModel!=="all"&&e++,e},availableModels(){const e=this.tasks?.items||[],t=new Set;for(const d of e){const r=d?.response?.data??[];for(const m of r)m.model&&t.add(m.model)}return Array.from(t).sort()},filteredTasks(){let e=this.tasks?.items||[];if(this.searchQuery){const t=this.searchQuery.toLowerCase();e=e.filter(d=>(d?.response?.data??[]).some(m=>m.title?.toLowerCase().includes(t)||m.style?.toLowerCase().includes(t)||m.prompt?.toLowerCase().includes(t)))}return this.activeFilterCount>0&&(e=e.filter(t=>{const d=t?.request??{},r=t?.response?.data??[];return this.filterType==="vocal"&&d.instrumental===!0||this.filterType==="instrumental"&&d.instrumental!==!0?!1:this.filterDuration!=="all"||this.filterVideo!=="all"||this.filterModel&&this.filterModel!=="all"?r.some(m=>!(this.filterDuration==="short"&&!(typeof m.duration=="number"&&m.duration<60)||this.filterDuration==="medium"&&!(typeof m.duration=="number"&&m.duration>=60&&m.duration<=180)||this.filterDuration==="long"&&!(typeof m.duration=="number"&&m.duration>180)||this.filterVideo==="with"&&!m.video_url||this.filterVideo==="without"&&m.video_url||this.filterModel&&this.filterModel!=="all"&&m.model!==this.filterModel)):!0})),this.sortBy==="oldest"&&(e=[...e].reverse()),e}},methods:{onSortChange(e){this.sortBy=e},onResetFilters(){this.filterType="all",this.filterDuration="all",this.filterVideo="all",this.filterModel="all"},getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),va={key:0,class:"tasks"},ya={class:"left w-[70px] p-[10px] flex items-center"},ba={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},ka={key:0,class:"task-toolbar"},wa={key:0,class:"filter-badge"},Ca={class:"filter-popover"},Va={class:"filter-row"},Sa={class:"filter-label"},Ta={class:"filter-row"},Aa={class:"filter-label"},Pa={class:"filter-row"},Ua={class:"filter-label"},Ea={key:0,class:"filter-row"},Ia={class:"filter-label"},Ra={class:"filter-actions"},La={key:2,class:"w-full flex-1 flex items-center justify-center"},Ma={class:"text-sm text-gray-400"},Fa={key:3,class:"w-full flex-1 flex flex-col items-center justify-center gap-2"},Da={class:"text-sm text-gray-400"},za={key:4,class:"w-full flex-1 flex items-center justify-center"},ja={class:"h-20"};function Ga(e,t,d,r,m,y){const $=l("el-skeleton-item"),p=l("el-skeleton"),f=l("font-awesome-icon"),k=l("el-input"),g=l("el-button"),T=l("el-dropdown-item"),_=l("el-dropdown-menu"),V=l("el-dropdown"),C=l("el-radio-button"),I=l("el-radio-group"),P=l("el-option"),K=l("el-select"),Q=l("el-popover"),Y=l("task-preview"),h=l("scroll-list"),S=l("no-tasks"),ae=l("player");return n(),u(M,null,[e.tasks?.items===void 0?(n(),u("div",va,[(n(),u(M,null,D(3,R=>s("div",{key:R,class:"flex"},[s("div",ya,[o(p,{animated:""},{template:a(()=>[o($,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),s("div",ba,[o(p,{animated:""},{template:a(()=>[o($,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),o($,{variant:"text"})]),_:1})])])),64))])):(n(),u(M,{key:1},[e.tasks?.items?.length?(n(),u("div",ka,[o(k,{modelValue:e.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=R=>e.searchQuery=R),size:"small",placeholder:e.$t("suno.placeholder.searchSongs"),clearable:"",class:"task-search"},{prefix:a(()=>[o(f,{icon:"fa-solid fa-magnifying-glass",class:"text-xs"})]),_:1},8,["modelValue","placeholder"]),o(V,{trigger:"click",onCommand:e.onSortChange},{dropdown:a(()=>[o(_,null,{default:a(()=>[o(T,{command:"newest",class:G({"is-active":e.sortBy==="newest"})},{default:a(()=>[v(i(e.$t("suno.sort.newest")),1)]),_:1},8,["class"]),o(T,{command:"oldest",class:G({"is-active":e.sortBy==="oldest"})},{default:a(()=>[v(i(e.$t("suno.sort.oldest")),1)]),_:1},8,["class"])]),_:1})]),default:a(()=>[o(g,{size:"small",class:"sort-btn"},{default:a(()=>[o(f,{icon:"fa-solid fa-arrow-down-wide-short",class:"mr-1"}),v(" "+i(e.sortLabel),1)]),_:1})]),_:1},8,["onCommand"]),o(Q,{trigger:"click",placement:"bottom-end",width:260},{reference:a(()=>[o(g,{size:"small",class:G(["filter-btn",{"has-active-filter":e.activeFilterCount>0}])},{default:a(()=>[o(f,{icon:"fa-solid fa-filter",class:"mr-1"}),v(" "+i(e.$t("suno.filter.title"))+" ",1),e.activeFilterCount>0?(n(),u("span",wa,i(e.activeFilterCount),1)):c("",!0)]),_:1},8,["class"])]),default:a(()=>[s("div",Ca,[s("div",Va,[s("div",Sa,i(e.$t("suno.filter.type")),1),o(I,{modelValue:e.filterType,"onUpdate:modelValue":t[1]||(t[1]=R=>e.filterType=R),size:"small"},{default:a(()=>[o(C,{value:"all"},{default:a(()=>[v(i(e.$t("suno.filter.typeAll")),1)]),_:1}),o(C,{value:"vocal"},{default:a(()=>[v(i(e.$t("suno.filter.typeVocal")),1)]),_:1}),o(C,{value:"instrumental"},{default:a(()=>[v(i(e.$t("suno.filter.typeInstrumental")),1)]),_:1})]),_:1},8,["modelValue"])]),s("div",Ta,[s("div",Aa,i(e.$t("suno.filter.duration")),1),o(I,{modelValue:e.filterDuration,"onUpdate:modelValue":t[2]||(t[2]=R=>e.filterDuration=R),size:"small"},{default:a(()=>[o(C,{value:"all"},{default:a(()=>[v(i(e.$t("suno.filter.durationAll")),1)]),_:1}),o(C,{value:"short"},{default:a(()=>[v(i(e.$t("suno.filter.durationShort")),1)]),_:1}),o(C,{value:"medium"},{default:a(()=>[v(i(e.$t("suno.filter.durationMedium")),1)]),_:1}),o(C,{value:"long"},{default:a(()=>[v(i(e.$t("suno.filter.durationLong")),1)]),_:1})]),_:1},8,["modelValue"])]),s("div",Pa,[s("div",Ua,i(e.$t("suno.filter.video")),1),o(I,{modelValue:e.filterVideo,"onUpdate:modelValue":t[3]||(t[3]=R=>e.filterVideo=R),size:"small"},{default:a(()=>[o(C,{value:"all"},{default:a(()=>[v(i(e.$t("suno.filter.videoAll")),1)]),_:1}),o(C,{value:"with"},{default:a(()=>[v(i(e.$t("suno.filter.videoWith")),1)]),_:1}),o(C,{value:"without"},{default:a(()=>[v(i(e.$t("suno.filter.videoWithout")),1)]),_:1})]),_:1},8,["modelValue"])]),e.availableModels.length>0?(n(),u("div",Ea,[s("div",Ia,i(e.$t("suno.filter.model")),1),o(K,{modelValue:e.filterModel,"onUpdate:modelValue":t[4]||(t[4]=R=>e.filterModel=R),size:"small",placeholder:e.$t("suno.filter.modelAll"),clearable:""},{default:a(()=>[o(P,{label:e.$t("suno.filter.modelAll"),value:"all"},null,8,["label"]),(n(!0),u(M,null,D(e.availableModels,R=>(n(),b(P,{key:R,label:R,value:R},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])):c("",!0),s("div",Ra,[o(g,{size:"small",text:"",onClick:e.onResetFilters},{default:a(()=>[v(i(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])])]),_:1})])):c("",!0),e.filteredTasks?.length>0?(n(),b(h,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[5]||(t[5]=R=>e.$emit("reach-top"))},{default:a(()=>[(n(!0),u(M,null,D(e.filteredTasks,(R,se)=>(n(),b(Y,{key:se,"model-value":R,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):e.searchQuery&&e.tasks?.items?.length>0?(n(),u("div",La,[s("p",Ma,i(e.$t("suno.message.noSearchResults")),1)])):e.activeFilterCount>0&&e.tasks?.items?.length>0?(n(),u("div",Fa,[s("p",Da,i(e.$t("suno.message.noFilterResults")),1),o(g,{size:"small",text:"",onClick:e.onResetFilters},{default:a(()=>[v(i(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])):e.tasks?.items?.length===0?(n(),u("div",za,[o(S)])):c("",!0)],64)),O(s("div",ja,[o(ae)],512),[[Ue,!!e.$store?.state?.suno?.audio?.object]])],64)}const Ba=E(_a,[["render",Ga],["__scopeId","data-v-4ab3f8f2"]]),Oa=A({name:"TaskPreview",components:{IconPicture:Re,ElImage:N,ElAvatar:We,ElIcon:x},computed:{audio(){return this.$store.state.suno?.audio}}}),Na={key:0,class:"size-full overflow-hidden"},Ha={class:"relative h-[300px]"},qa={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},Wa={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"},Ka={class:"p-4"},Qa={class:"flex items-center font-bold mb-2"},Ja={class:"text-[var(--el-text-color-regular)] mb-2"},Ya={class:"text-xs text-[var(--el-text-color-regular)]"},Za={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},Xa={key:1,class:"w-full h-full"};function xa(e,t,d,r,m,y){const $=l("icon-picture"),p=l("el-icon"),f=l("el-image"),k=l("el-avatar");return e.audio?.object?(n(),u("div",Na,[s("div",Ha,[o(f,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:a(()=>[s("div",qa,[o(p,{class:"text-3xl"},{default:a(()=>[o($)]),_:1})])]),_:1},8,["src"]),s("h2",Wa,i(e.audio?.title),1)]),s("div",Ka,[s("div",Qa,[o(k,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),s("span",null,i(e.audio?.title),1)]),s("p",Ja,i(e.audio?.style),1),s("p",Ya,i(e.$dayjs.format(e.audio?.created_at)),1),s("div",Za,[s("p",null,i(e.audio?.lyric),1)])])])):(n(),u("div",Xa))}const el=E(Oa,[["render",xa]]),tl="https://webhook.acedata.cloud/suno",ol=A({name:"SunoIndex",components:{Layout:ct,ConfigPanel:Si,RecentPanel:Ba,PreviewPanel:el},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===Z.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===Z.Request||this.fetchingTasks},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===Z.Request},needApply(){return this.$store.state.suno.status.getApplications===Z.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.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 nt({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("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){Le.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Me&&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:d,createdAtMax:r}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",r),this.fetchingTasks=!0;try{await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:d,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:tl},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),L.audio(e,{token:t}).then(()=>{w.success(this.$t("suno.message.startTaskSuccess"))}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function sl(e,t,d,r,m,y){const $=l("config-panel"),p=l("recent-panel"),f=l("preview-panel"),k=l("layout");return n(),b(k,null,{config:a(()=>[o($,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:a(()=>[o(p,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:a(()=>[o(f)]),_:1})}const ir=E(ol,[["render",sl],["__scopeId","data-v-d1296b1a"]]);export{ir as default};
|