@acedatacloud/nexior 3.379.0 → 3.380.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/{ApiCodeButton-BVdwvbqZ.js → ApiCodeButton-D1lki4F_.js} +1 -1
- package/dist/assets/{ApiCodeDialog-DnvWQSux.js → ApiCodeDialog-DOfgYEmc.js} +2 -2
- package/dist/assets/Artifacts-DtQ_fGVP.css +1 -0
- package/dist/assets/Artifacts-uBtRFFPC.js +1 -0
- package/dist/assets/{AskUserQuestionCard-BnGXxHXH.js → AskUserQuestionCard-CETMYX8R.js} +1 -1
- package/dist/assets/{AudioPreview-BW-v9N1F.js → AudioPreview-l0EbbuHD.js} +1 -1
- package/dist/assets/{Auth-2sHUtbN3.js → Auth-CeBzNFsR.js} +1 -1
- package/dist/assets/{Bare-MY2982fx.js → Bare-vhj6gyvi.js} +1 -1
- package/dist/assets/{BotPlaceholder-BMvZ2r7e.js → BotPlaceholder-9sRMAfGp.js} +1 -1
- package/dist/assets/{BottomFooter-BK8fSgo8.js → BottomFooter-Cs-D5cy1.js} +1 -1
- package/dist/assets/{BrowseConnectors-BynonX3o.js → BrowseConnectors-B-5SE7mG.js} +1 -1
- package/dist/assets/BrowseConnectors-C6nnJYLy.css +1 -0
- package/dist/assets/{BrowserPairingDialog-BpL_PLZ2.js → BrowserPairingDialog-Wv5nX_mI.js} +1 -1
- package/dist/assets/{Callback-CftlVK5U.js → Callback--ui2SI2r.js} +1 -1
- package/dist/assets/{CodeSnippet-CWKbGbqf.js → CodeSnippet-CRDQll3K.js} +1 -1
- package/dist/assets/Console-BiM696t3.css +1 -0
- package/dist/assets/Console-CwieVXV0.js +1 -0
- package/dist/assets/Conversation-CH_xbgvX.js +2 -0
- package/dist/assets/{Conversation-DyPJerS9.js → Conversation-CILeQvtB.js} +1 -1
- package/dist/assets/{CopyToClipboard-DwbsH1C3.js → CopyToClipboard-CnWeQakr.js} +1 -1
- package/dist/assets/{Detail-60SJz85a.js → Detail-60M_EAcz.js} +1 -1
- package/dist/assets/Extra-BKzAUHuT.js +1 -0
- package/dist/assets/{FilePreview-LQggJd0m.js → FilePreview-CEeMVJs0.js} +1 -1
- package/dist/assets/{Hailuo-wSOJTcJX.js → Hailuo-BxGPHs5P.js} +1 -1
- package/dist/assets/History-CXbnjB0O.css +1 -0
- package/dist/assets/History-DP2va2AE.js +1 -0
- package/dist/assets/{ImagePreview-BLcOkAKu.js → ImagePreview-DzG8rluG.js} +1 -1
- package/dist/assets/{ImageWrapper-CbWVwZRD.js → ImageWrapper-BHq01Ilv.js} +1 -1
- package/dist/assets/{Index-CVJaenIO.js → Index--E3wAp0q.js} +1 -1
- package/dist/assets/Index-1lUQ0p6e.js +1 -0
- package/dist/assets/Index-2FXyG_eF.js +1 -0
- package/dist/assets/{Index-Bi6tCc2m.js → Index-6qhvmL75.js} +1 -1
- package/dist/assets/{Index-D-Y3090O.js → Index-B5T1B0rn.js} +1 -1
- package/dist/assets/Index-BApQZrK1.js +1 -0
- package/dist/assets/Index-BBLK5tA4.js +1 -0
- package/dist/assets/Index-BdqL4tvM.css +1 -0
- package/dist/assets/{Index-HacBQi5S.js → Index-BpEUpB3A.js} +1 -1
- package/dist/assets/Index-BsxF7YJ7.js +1 -0
- package/dist/assets/Index-BucEDFrW.css +1 -0
- package/dist/assets/{Index-BiXFhCWk.js → Index-BzJyb5Xo.js} +1 -1
- package/dist/assets/Index-BzUrN2i4.css +1 -0
- package/dist/assets/{Index-LByTkG1R.js → Index-C8TcdUi5.js} +1 -1
- package/dist/assets/{Index-PWI4LACm.js → Index-C8sDARwT.js} +2 -2
- package/dist/assets/{Index-C4b0Sbyi.js → Index-CG_s3bD2.js} +1 -1
- package/dist/assets/{Index-CpvCmtSL.js → Index-CGfIJWQO.js} +1 -1
- package/dist/assets/{Index-BEXZOWNw.js → Index-CKW8vwJG.js} +1 -1
- package/dist/assets/Index-CSTwqFsu.js +1 -0
- package/dist/assets/Index-CWorVwXb.css +1 -0
- package/dist/assets/Index-CXjV-IcE.js +1 -0
- package/dist/assets/Index-CYAAZPDa.js +1 -0
- package/dist/assets/Index-CZLHsGUU.js +2 -0
- package/dist/assets/Index-CogPPD-N.css +1 -0
- package/dist/assets/Index-Cr2EP9kp.js +1 -0
- package/dist/assets/{Index-C7nNUO1i.js → Index-CugiM4u7.js} +2 -2
- package/dist/assets/Index-D8axMOjB.js +1 -0
- package/dist/assets/Index-DBGNC98g.js +1 -0
- package/dist/assets/{Index-f7b3Hnhj.js → Index-DCinbJRH.js} +2 -2
- package/dist/assets/Index-DDlUGofL2.js +1 -0
- package/dist/assets/Index-DZHGmLTh.js +1 -0
- package/dist/assets/{Index-C63AcaAz.js → Index-Dkbg4XSA.js} +1 -1
- package/dist/assets/Index-Dl5lsxVP.js +1 -0
- package/dist/assets/Index-DnS8VEpN.js +1 -0
- package/dist/assets/Index-DuM-OiDF.js +1 -0
- package/dist/assets/{Index-DHcNXOjD.js → Index-DyP8vfqs.js} +1 -1
- package/dist/assets/{Index-DNXXlgZI.js → Index-DyZcKa4T.js} +1 -1
- package/dist/assets/{Index-CYbuu0Uy.js → Index-UyM4pJLL.js} +1 -1
- package/dist/assets/Index-lh94eK8o.js +1 -0
- package/dist/assets/Index-pGo7ljza.js +1 -0
- package/dist/assets/Index-ujvHWtuM.js +1 -0
- package/dist/assets/{Invitees-BG-VxiML.js → Invitees-CZa15gnk.js} +1 -1
- package/dist/assets/List-BNYeLdKL.js +1 -0
- package/dist/assets/{List-C_5R7MsB.js → List-BUh5m93I.js} +1 -1
- package/dist/assets/List-DJDgPDG5.css +1 -0
- package/dist/assets/List-fgJcmTqj.js +1 -0
- package/dist/assets/List-hn11bxUq.css +1 -0
- package/dist/assets/List-yswj7BDV.css +1 -0
- package/dist/assets/LocalTools-3Yi1GHAY.css +1 -0
- package/dist/assets/{LocalTools-d_Cpvudx.js → LocalTools-DOQVy8gG.js} +1 -1
- package/dist/assets/LocalTools-FwMni0ml.js +5 -0
- package/dist/assets/{Logo-vsdlOXNx.js → Logo-mH6QiWkU.js} +1 -1
- package/dist/assets/{Main-z44znHEo.js → Main-B6-yG6PU.js} +1 -1
- package/dist/assets/Message-BB4Jq2tN.js +3 -0
- package/dist/assets/Message-DiN-4_V0.css +1 -0
- package/dist/assets/{Model-CS9NafTK.js → Model-j6vEfP4p.js} +1 -1
- package/dist/assets/Navigator-BwKl-gZi.js +8 -0
- package/dist/assets/Navigator-D6w9S8hu.css +1 -0
- package/dist/assets/{NotFound-B7O570we.js → NotFound-BZ4JA1rq.js} +1 -1
- package/dist/assets/{PageHeader-XQ2ZI5oi.js → PageHeader-B3WB8K81.js} +1 -1
- package/dist/assets/{Pay-CJMoRNwf.js → Pay-DvoqG3sq.js} +1 -1
- package/dist/assets/{Player-BjAhlM5i.js → Player-DKtF2LiP.js} +1 -1
- package/dist/assets/{Poivelle-gikHHTGX.js → Poivelle-C0U744It.js} +1 -1
- package/dist/assets/{RealtimeCall-BqLTAntp.js → RealtimeCall-jb_0uRGr.js} +3 -3
- package/dist/assets/{ReportButton-Bzz2CkcM.js → ReportButton-B7cDB8LW.js} +1 -1
- package/dist/assets/{ReportDialog-2njW70jE.js → ReportDialog-JGNMr7QD.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-BaLVOrFz.js → ScenarioPaymentMode-CxM3rfl_.js} +1 -1
- package/dist/assets/ScheduledTasks-C2tvSPlw.js +2 -0
- package/dist/assets/ScheduledTasks-q2I0mfE4.css +1 -0
- package/dist/assets/{ServicePricingSummary-CDYYBNdf.js → ServicePricingSummary-BI_c3bg7.js} +1 -1
- package/dist/assets/{SharedMarkdown-DgMJ5yS6.js → SharedMarkdown-BZ-t6rHr.js} +1 -1
- package/dist/assets/{ShowcaseGrid-_w8hiwu_.css → ShowcaseGrid-9vxJV458.css} +1 -1
- package/dist/assets/ShowcaseGrid-BI6yjON0.js +1 -0
- package/dist/assets/{ShowcaseResultTabs-BrMvxK_-.js → ShowcaseResultTabs-CHdyEJpt.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-ZEJq2-js.js → SolanaWalletPickerDialog-BXKfNGsx.js} +1 -1
- package/dist/assets/Status-CTBt9OJ5.js +1 -0
- package/dist/assets/{Subscribe-CHJXeMK_.js → Subscribe-BJfnDW6z.js} +1 -1
- package/dist/assets/Subscribe-PwC876Nj.css +1 -0
- package/dist/assets/{TabSwitcher-B68j0iog.js → TabSwitcher-C_BTrTXh.js} +1 -1
- package/dist/assets/{Tts-kUJ8t6Tj.js → Tts-CmDrhSSe.js} +1 -1
- package/dist/assets/{VideoPlayer-D5QyowLz.js → VideoPlayer-B1ohzmMz.js} +1 -1
- package/dist/assets/{VideoPreview-B3Ge1y5k.js → VideoPreview-NzdYWDEq.js} +1 -1
- package/dist/assets/{VueMarkdown-CnCNB7jR.js → VueMarkdown-C2ymEiAE.js} +2 -2
- package/dist/assets/WriteSkillDialog-CZ9kJuKG.css +1 -0
- package/dist/assets/WriteSkillDialog-D08WH6SA.js +1 -0
- package/dist/assets/{airwallexCheckout-Cxx1AabL.js → airwallexCheckout-C7yv_WB3.js} +1 -1
- package/dist/assets/arrow-down-BHUGpfMP.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-BlIlUIjt.js → arrow-down-wide-narrow-iAFgcIWq.js} +1 -1
- package/dist/assets/arrow-left-C_eF64-4.js +1 -0
- package/dist/assets/arrow-right-rteUvLQ3.js +1 -0
- package/dist/assets/arrow-up-BKbUjWHK.js +1 -0
- package/dist/assets/{authorizeFlow-BJdepJ3R.js → authorizeFlow-BS5vrsk4.js} +1 -1
- package/dist/assets/{avatar-CGtlW6zU.js → avatar-CkETARKn.js} +1 -1
- package/dist/assets/{back-navigation-BIrHIWJy.js → back-navigation-hIJmgci9.js} +1 -1
- package/dist/assets/{basic-DFEogfXq.js → basic-DasRiMtW.js} +1 -1
- package/dist/assets/{book-open-_guxQcoA.js → book-open-LXRfyjum.js} +1 -1
- package/dist/assets/{box-CYBPc1Rz.js → box-BELXS1Xk.js} +1 -1
- package/dist/assets/{boxes-Dczys5iR.js → boxes-CfEsIxhR.js} +1 -1
- package/dist/assets/{brain-C3F88E04.js → brain-DSPtYkVQ.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-sr2W-cy-.js → chart-no-axes-combined-CBK7pfM4.js} +1 -1
- package/dist/assets/chat-B93qedYt.js +1 -0
- package/dist/assets/chat-BH0Bn4st.js +1 -0
- package/dist/assets/chat-BIMHcNJl.js +1 -0
- package/dist/assets/{chat-KmdJ9Xcn.js → chat-BO13M-mU.js} +1 -1
- package/dist/assets/chat-BmBpsJ7j.js +1 -0
- package/dist/assets/chat-C3ifI9F6.js +1 -0
- package/dist/assets/chat-CPD_Lonc.js +1 -0
- package/dist/assets/chat-CnVC2OCy.js +1 -0
- package/dist/assets/chat-CnsQm6eE.js +1 -0
- package/dist/assets/chat-DCeCHp-5.js +1 -0
- package/dist/assets/chat-DHBWDJxa.js +1 -0
- package/dist/assets/chat-DQhSx6RW.js +1 -0
- package/dist/assets/chat-DlRtNTzK.js +1 -0
- package/dist/assets/check-B7vVuom4.js +1 -0
- package/dist/assets/chevron-down-DXJm9C-R.js +1 -0
- package/dist/assets/chevron-right-Dn3_TU6r.js +1 -0
- package/dist/assets/{circle-alert-CMUvmX0p.js → circle-alert-CChOfA1T.js} +1 -1
- package/dist/assets/circle-check-Cb4rTFEe.js +1 -0
- package/dist/assets/{circle-question-mark-BXwYW3M_.js → circle-question-mark-1JVdFmtu.js} +1 -1
- package/dist/assets/{clipboard-list-D3Jcr1wW.js → clipboard-list-D2WXa_ar.js} +1 -1
- package/dist/assets/clock-D-MIHQUu.js +1 -0
- package/dist/assets/code-k_kSMWEL.js +1 -0
- package/dist/assets/{codingBridge-CMi6fCj5.js → codingBridge-6mz0Fzzc.js} +1 -1
- package/dist/assets/{codingBridgeNotify-Bwf5NQbl.js → codingBridgeNotify-BuMCCwp6.js} +2 -2
- package/dist/assets/{coins-BQ6zVtEX.js → coins-BbzvNpjh.js} +1 -1
- package/dist/assets/{collapse-B0Wi9F4l.js → collapse-D3mLm9pK.js} +1 -1
- package/dist/assets/{common-BJ-Az-vA.js → common-B2AoKgbo.js} +1 -1
- package/dist/assets/{common-DlE175vL.js → common-B3_-avWv.js} +1 -1
- package/dist/assets/{common-B0IDRASJ.js → common-BE0Xmr95.js} +1 -1
- package/dist/assets/common-CBVzbTrP.js +1 -0
- package/dist/assets/{common-DeqClFGz.js → common-CXswbOnv.js} +1 -1
- package/dist/assets/{common-kO_UBrO5.js → common-DbzUSWn7.js} +1 -1
- package/dist/assets/{common-CUZl0lkV.js → common-DqrrCjnH.js} +1 -1
- package/dist/assets/{common-BnGMhmEr.js → common-DrLKSG8e.js} +1 -1
- package/dist/assets/{common-MVvgvCjP.js → common-ZC7JtzuW.js} +1 -1
- package/dist/assets/{common-RzLnaRJN.js → common-dHkeewzM.js} +1 -1
- package/dist/assets/{common-DKecTXML.js → common-ipmBN2GB.js} +1 -1
- package/dist/assets/{common-D8s1fMEF.js → common-ooTeYm20.js} +1 -1
- package/dist/assets/constants-WMYSVfpe.js +3 -0
- package/dist/assets/{copy-VxF2BScc.js → copy-D79cGaAL.js} +1 -1
- package/dist/assets/{createTaskActions-DoijteH6.js → createTaskActions-BpAJh50M.js} +1 -1
- package/dist/assets/{date-picker-CCvbZlsC.js → date-picker-GSBLkZuj.js} +1 -1
- package/dist/assets/{digitalhuman-COquG9OT.js → digitalhuman-tAysywFN.js} +1 -1
- package/dist/assets/{distribution-D9OF7j8R.js → distribution-B7DZZh7d.js} +1 -1
- package/dist/assets/{distribution-D60ESr4w.js → distribution-BYrnDp0s.js} +1 -1
- package/dist/assets/{distribution-DYe_3hS7.js → distribution-CGqwK1cw.js} +1 -1
- package/dist/assets/{distribution-BuGlQh86.js → distribution-CNfWAQTU.js} +1 -1
- package/dist/assets/{distribution-B6rpEDSh.js → distribution-CPmrvfZ7.js} +1 -1
- package/dist/assets/{distribution-BD_UlcWf.js → distribution-CQG0Z5iE.js} +1 -1
- package/dist/assets/{distribution-CYbeU4Kx.js → distribution-Cy8JC7Pm.js} +1 -1
- package/dist/assets/{distribution-Dx7f4qch.js → distribution-JpZ39xJ9.js} +1 -1
- package/dist/assets/{distribution-ATagO31u.js → distribution-Zl9x3ZOh.js} +1 -1
- package/dist/assets/{distribution-D1tzKj8Z.js → distribution-cGGLxu6P.js} +1 -1
- package/dist/assets/{distribution-BUdflwwz.js → distribution-lqXSS4g8.js} +1 -1
- package/dist/assets/{distribution-ryO3eAPQ.js → distribution-xL28-fwX.js} +1 -1
- package/dist/assets/{dollar-sign-DUccWNag.js → dollar-sign-6gQn2E0o.js} +1 -1
- package/dist/assets/{download-e2JcTyyo.js → download-CAxzUu_u.js} +1 -1
- package/dist/assets/{drawer-BVEcNx1I.js → drawer-DkbSBBLh.js} +1 -1
- package/dist/assets/{dropdown-6Dhj8aGv.js → dropdown-C3gQJom4.js} +1 -1
- package/dist/assets/{dropdown-DVWMF6_3.js → dropdown-n067bA9H.js} +1 -1
- package/dist/assets/{ellipsis-BtC3IBcT.js → ellipsis-BnzW2SUZ.js} +1 -1
- package/dist/assets/{esm-BWUcVVKJ.js → esm-CNvzHsA6.js} +2 -2
- package/dist/assets/esm-Cv_X14Y5.js +1 -0
- package/dist/assets/{esm-BF1E2FMw.js → esm-Dt5Fl66W.js} +2 -2
- package/dist/assets/{external-link-DHAxzeng.js → external-link-Dmjio2ae.js} +1 -1
- package/dist/assets/{eye-D_qht_hF.js → eye-CiLZ5Q2y.js} +1 -1
- package/dist/assets/{file-DpjGg0Y_.js → file-C5sGq-in.js} +1 -1
- package/dist/assets/{file-output-Bi4vq7Ue.js → file-output-CfVEr-P9.js} +1 -1
- package/dist/assets/{file-text-Cy_bvnO7.js → file-text-mgrXd7Fc.js} +1 -1
- package/dist/assets/{fish-DnPwoPWE.js → fish-G6E0apAS.js} +1 -1
- package/dist/assets/{pixverse-CdoZ8UDF.js → flux-D3gm8Tem.js} +1 -1
- package/dist/assets/{folder-mtavbhFP.js → folder-C-kE9L8l.js} +1 -1
- package/dist/assets/gauge-CnI5ffDq.js +1 -0
- package/dist/assets/{generationInput-ClY8zxHb.js → generationInput-DCC9j_iS.js} +1 -1
- package/dist/assets/{globe-t_hc2uvW.js → globe-7jfAXQmq.js} +1 -1
- package/dist/assets/{grokvideo-wIrAkg60.js → grokvideo-DLi-N3-W.js} +1 -1
- package/dist/assets/{hailuo-CLFyD3vr.js → hailuo-AKPvPb3Q.js} +1 -1
- package/dist/assets/{hash-CGhR3E3W.js → hash-XGo8nwFc.js} +1 -1
- package/dist/assets/{headphones-BGX9rE2z.js → headphones-A3K1FVN_.js} +1 -1
- package/dist/assets/{history-BNoxEv4L.js → history-jiGKS_Y6.js} +1 -1
- package/dist/assets/{house-Cq29AjkF.js → house-BI0OsEXZ.js} +1 -1
- package/dist/assets/{image-D-Qn2R2s.js → image-BNpIV_kk.js} +1 -1
- package/dist/assets/{imageRequests-Dpxiq1GM.js → imageRequests-CEgD9YBi.js} +1 -1
- package/dist/assets/{index-B_mDD17T.js → index-DNgm0O4R.js} +15 -15
- package/dist/assets/index-DuRtbnbf.css +1 -0
- package/dist/assets/{index.es-DbG45pQU.js → index.es--QtP43qh.js} +1 -1
- package/dist/assets/{info-AarYb6UU.js → info-DiJCV4qJ.js} +1 -1
- package/dist/assets/{input-number-BweR5GSS.js → input-number-Z9VlgVmG.js} +1 -1
- package/dist/assets/{kling-Bu2NuHka.js → kling-fXkHiMRx.js} +1 -1
- package/dist/assets/{languages-q4pS3WIA.js → languages-cyvc2npG.js} +1 -1
- package/dist/assets/{laptop-D3ytrLBJ.js → laptop--8Zu6Vfi.js} +1 -1
- package/dist/assets/{lightbulb-C5S29mMv.js → lightbulb-CJFqSHO7.js} +1 -1
- package/dist/assets/{link-CwjIRcQu.js → link-DMihcn5u.js} +1 -1
- package/dist/assets/loader-circle-CxuVnfcI.js +1 -0
- package/dist/assets/{luma-DSTa_ctL.js → luma-SnGxaw5M.js} +1 -1
- package/dist/assets/{maestro-Cgi6iLeE.js → maestro-DF3jESmq.js} +1 -1
- package/dist/assets/{maestroLanguages-DwLnUjSV.js → maestroLanguages-Ybsvi9JQ.js} +1 -1
- package/dist/assets/{mail-VqGM1wzH.js → mail-CnDlEeWi.js} +1 -1
- package/dist/assets/{message-circle-BIELZnpU.js → message-circle-DuKW7reT.js} +1 -1
- package/dist/assets/{mic-DhjvDuzZ.js → mic-CTs0jfqq.js} +1 -1
- package/dist/assets/{midjourney-YlQQ7xGW.js → midjourney-CZv9cLly.js} +1 -1
- package/dist/assets/minimax-BT0nSB_a.js +1 -0
- package/dist/assets/{mobileLocalExec-BGEH-cVh.js → mobileLocalExec-BQ1kBGve.js} +2 -2
- package/dist/assets/{monitor-w2z0MlEY.js → monitor-C-Jerg7U.js} +1 -1
- package/dist/assets/{mouse-pointer-2-Dktit1x1.js → mouse-pointer-2-B-J1shs-.js} +1 -1
- package/dist/assets/music-2-C65WMr4S.js +1 -0
- package/dist/assets/{nanobanana-B5-IKS73.js → nanobanana-Bf6ZR2h8.js} +1 -1
- package/dist/assets/{omni-ROlnzeCN.js → omni-xNo4Fbqp.js} +1 -1
- package/dist/assets/{openaiimage-DoIMIVMy.js → openaiimage-DxutopRU.js} +1 -1
- package/dist/assets/{pagination-DkzSLsHS.js → pagination-19y2LGQl.js} +1 -1
- package/dist/assets/{pagination-CVG3qxWX.js → pagination-Cfo3CagM.js} +1 -1
- package/dist/assets/{pagination-7tCwz5Wb.js → pagination-DV8T-tqj.js} +1 -1
- package/dist/assets/{palette-B-I3eqTr.js → palette-CynhsCMe.js} +1 -1
- package/dist/assets/{paperclip-CiVURlUk.js → paperclip-CBL7RqTM.js} +1 -1
- package/dist/assets/{pause-hlQVsPkR.js → pause-DTHJdCRg.js} +1 -1
- package/dist/assets/{pencil-B83LjyZM.js → pencil-CVaC19gj.js} +1 -1
- package/dist/assets/{pika-CsJCe7Ud.js → pika-D1zbf-uS.js} +1 -1
- package/dist/assets/{qrart-ggf6-aqL.js → pixverse-B5r7NLUO.js} +1 -1
- package/dist/assets/play-nNwhAh75.js +1 -0
- package/dist/assets/{plug-BJ2TKjcm.js → plug-CFa0M51H.js} +1 -1
- package/dist/assets/plus-LeXJrpvP.js +1 -0
- package/dist/assets/{poivelle-B_KpomXv.js → poivelle-DoPLyFMb.js} +1 -1
- package/dist/assets/{popover-BNuza1no.js → popover-uQ8dK-N-.js} +1 -1
- package/dist/assets/{producer-Cftxullw.js → producer-f8Z5dCar.js} +1 -1
- package/dist/assets/{veo-DJ8zjGWr.js → qrart-BlkGVDXz.js} +1 -1
- package/dist/assets/{qwenimage-CbH5cDWi.js → qwenimage-D1JaKlci.js} +1 -1
- package/dist/assets/{realtime-C3GP19Ox.js → realtime-bhXNb6O5.js} +1 -1
- package/dist/assets/{refresh-cw-Bvqf2cXR.js → refresh-cw-DWhrdWmh.js} +1 -1
- package/dist/assets/rotate-ccw-BXF7BHR_.js +1 -0
- package/dist/assets/rotate-cw-DQwFlqL-.js +1 -0
- package/dist/assets/{row-CgEMxZUK.js → row-Ct3SHHKo.js} +1 -1
- package/dist/assets/{scroll-text-DNioxlF3.js → scroll-text-IW5F7Rzs.js} +1 -1
- package/dist/assets/search-jHt37O6Y.js +1 -0
- package/dist/assets/{seedance-vjO0LxfY.js → seedance-BAG2S-Sn.js} +1 -1
- package/dist/assets/{seedream-DDubAk0V.js → seedream-CSHXjRHt.js} +1 -1
- package/dist/assets/{select-BqzezbgS.js → select-DpCwbg2P.js} +1 -1
- package/dist/assets/{serp-B9uitIQK.js → serp-BjxFrKtx.js} +1 -1
- package/dist/assets/{shield-BidAVgcr.js → shield-CqzgUjRL.js} +1 -1
- package/dist/assets/{showcase-C-f0cCbc.js → showcase-BKwYXfaj.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-BWDEj-jO.js → showcaseRecreateMixin-CXfW6PxO.js} +1 -1
- package/dist/assets/{shuffle-C-ey6c0w.js → shuffle-Cb3EluSZ.js} +1 -1
- package/dist/assets/{siteHome-Cm4ERvnr.js → siteHome-_xdRaJDq.js} +1 -1
- package/dist/assets/{skill-0g_luo5R.js → skill-BlMbz87N.js} +1 -1
- package/dist/assets/{skill-DIEOWjK5.js → skill-C2K6cbrP.js} +1 -1
- package/dist/assets/{skill-Byo5cYNZ.js → skill-CKUPPxyb.js} +1 -1
- package/dist/assets/{skill-Dx9sM0VW.js → skill-CaNjUkgB.js} +1 -1
- package/dist/assets/{skill-CQGW8Q1T.js → skill-Cr-g7FwZ.js} +1 -1
- package/dist/assets/{skill-B07Ijn5i.js → skill-CsXnh9VR.js} +1 -1
- package/dist/assets/{skill-l_jxXvUb.js → skill-Cz3gbHCB.js} +1 -1
- package/dist/assets/{skill-iYzmeC7M.js → skill-D7ykoMRP.js} +1 -1
- package/dist/assets/{skill-BJgaq7OZ.js → skill-DSiB2L6V.js} +1 -1
- package/dist/assets/{skill-DH20CjXt.js → skill-HEAXadiu.js} +1 -1
- package/dist/assets/{skill-qbrFbNq8.js → skill-ruT0_gQC.js} +1 -1
- package/dist/assets/{skill-CpCuyQYr.js → skill-zkJF-Hre.js} +1 -1
- package/dist/assets/{slider-fnY2n6px.js → slider-D_5tNLXv.js} +1 -1
- package/dist/assets/{solana-wallets-BERlGY2O.js → solana-wallets-LBXCjIar.js} +2 -2
- package/dist/assets/{sora-BUctVwZa.js → sora-DxQB-JH3.js} +1 -1
- package/dist/assets/{sparkles-BvDv6ds2.js → sparkles-BJp3fwnS.js} +1 -1
- package/dist/assets/square-wbuKXONv.js +1 -0
- package/dist/assets/{suno-Be9UhEcX.js → suno-CMtc4n9z.js} +1 -1
- package/dist/assets/{switch-C6gnvMgV.js → switch-D3WZiAvp.js} +1 -1
- package/dist/assets/{table-dVwxM5TO.js → table-CUMQdD-Z.js} +1 -1
- package/dist/assets/{tabs-CwdrUb8P.js → tabs-DRQeG1Ya.js} +1 -1
- package/dist/assets/{tag-BOA3YC3-.js → tag-DxDJAghe.js} +1 -1
- package/dist/assets/{taskPolling-BRIyWeSm.js → taskPolling-CXL7oa51.js} +1 -1
- package/dist/assets/terminal-Cf2tnanz.js +1 -0
- package/dist/assets/{time-picker-B7Amze8v.js → time-picker-ug51pxrU.js} +1 -1
- package/dist/assets/{tooltip-BBrV3AZK.js → tooltip-CBYmo1Dy.js} +1 -1
- package/dist/assets/{trash-2-BPjzpfWl.js → trash-2-COs0p2Nt.js} +1 -1
- package/dist/assets/{triangle-alert-hVh_-DcV.js → triangle-alert-Bepd3LHY.js} +1 -1
- package/dist/assets/{upload-Cra0_3dJ.js → upload-3n-8FFny.js} +1 -1
- package/dist/assets/{upload-XUGlysu6.js → upload-DNSrVlZy.js} +1 -1
- package/dist/assets/user-C6lesopI.js +1 -0
- package/dist/assets/veo-DiQVfBj3.js +1 -0
- package/dist/assets/{video-DM7P7XL-.js → video-CI8Hz7NN.js} +1 -1
- package/dist/assets/{volume-2-DoGYvPKH.js → volume-2-Ydz_oaC9.js} +1 -1
- package/dist/assets/{vuex.esm-bundler-BxNPLO2l.js → vuex.esm-bundler-LBWCZBn7.js} +1 -1
- package/dist/assets/{wallet-DCbr1SCc.js → wallet-WRlfAkep.js} +1 -1
- package/dist/assets/{wan-CJgJf4gd.js → wan-BSn0CRCR.js} +1 -1
- package/dist/assets/{wand-sparkles-B3s3EW_F.js → wand-sparkles-DAxQpus4.js} +1 -1
- package/dist/assets/{web-CMCs3BWX.js → web-B8GaBxif.js} +1 -1
- package/dist/assets/{web-nb5LyGMf.js → web-B9J6valC.js} +1 -1
- package/dist/assets/{web-OTda-796.js → web-BRGudU6E.js} +1 -1
- package/dist/assets/{web-DOauQbLK.js → web-CM_69Bh3.js} +1 -1
- package/dist/assets/{web-B0taMipw.js → web-DrYXzoHz.js} +1 -1
- package/dist/assets/webextrator-CzKXuJam.js +1 -0
- package/dist/assets/{zap-CLXFE1AD.js → zap-DOKxH-m_.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +2 -2
- package/dist/assets/Artifacts-BXalS4q3.css +0 -1
- package/dist/assets/Artifacts-DBlRS6V-.js +0 -1
- package/dist/assets/BrowseConnectors-CE_N0wln.css +0 -1
- package/dist/assets/Console-CLcCfD95.css +0 -1
- package/dist/assets/Console-D5tMRa4O.js +0 -1
- package/dist/assets/Conversation-Dvzqt09M.js +0 -2
- package/dist/assets/Extra-a9kjI6xu.js +0 -1
- package/dist/assets/History-BKuvOkpU.css +0 -1
- package/dist/assets/History-CotgV_jP.js +0 -1
- package/dist/assets/Index-B2iSDu_B.js +0 -2
- package/dist/assets/Index-B5eICayB.js +0 -1
- package/dist/assets/Index-BTN8UlrZ.js +0 -1
- package/dist/assets/Index-BkELRl77.js +0 -1
- package/dist/assets/Index-BmqhuNpp.js +0 -1
- package/dist/assets/Index-BptenMvy.js +0 -1
- package/dist/assets/Index-BtYp1mWJ.js +0 -1
- package/dist/assets/Index-BytvhA-o.css +0 -1
- package/dist/assets/Index-Bz1tQjLN.js +0 -1
- package/dist/assets/Index-C7jnoMyw.js +0 -1
- package/dist/assets/Index-CB-LRpKw.js +0 -1
- package/dist/assets/Index-CC8t-QBU2.js +0 -1
- package/dist/assets/Index-CDo_fKen.js +0 -1
- package/dist/assets/Index-CFwbMt9f.js +0 -1
- package/dist/assets/Index-CYCyIq0c.js +0 -1
- package/dist/assets/Index-CjA_cn01.js +0 -1
- package/dist/assets/Index-CljLq_wO.js +0 -1
- package/dist/assets/Index-CljMeIn4.css +0 -1
- package/dist/assets/Index-CnfZftjV.js +0 -1
- package/dist/assets/Index-DLo_vG5b.css +0 -1
- package/dist/assets/Index-InwJndDx.js +0 -1
- package/dist/assets/Index-KeKnmleO.js +0 -1
- package/dist/assets/Index-OnGb6jh7.css +0 -1
- package/dist/assets/Index-TKC7spBk.css +0 -1
- package/dist/assets/Index-vUiofO0R.js +0 -1
- package/dist/assets/List-BZZ7J6hV.js +0 -1
- package/dist/assets/List-Bh_b_SzR.css +0 -1
- package/dist/assets/List-C3QVP8Qo.css +0 -1
- package/dist/assets/List-CRykp5Ti.css +0 -1
- package/dist/assets/List-CVQKqACY.js +0 -1
- package/dist/assets/LocalTools-B-v6mWjd.js +0 -5
- package/dist/assets/LocalTools-C2jVUnzB.css +0 -1
- package/dist/assets/Message-BgnTwf4e.css +0 -1
- package/dist/assets/Message-DvXog9lv.js +0 -3
- package/dist/assets/Navigator-ByU36BlB.js +0 -8
- package/dist/assets/Navigator-DzzTUqkr.css +0 -1
- package/dist/assets/ScheduledTasks-DtkfcITj.css +0 -1
- package/dist/assets/ScheduledTasks-UXKOx_R9.js +0 -2
- package/dist/assets/ShowcaseGrid-CQU8y-_p.js +0 -1
- package/dist/assets/Status-CbijUb1r.js +0 -1
- package/dist/assets/Subscribe-CTT35EgT.css +0 -1
- package/dist/assets/WriteSkillDialog-D6u0DtZm.js +0 -1
- package/dist/assets/WriteSkillDialog-Dq7Pnanc.css +0 -1
- package/dist/assets/arrow-down-CrxnnUzu.js +0 -1
- package/dist/assets/arrow-left-Do_3QC8F.js +0 -1
- package/dist/assets/arrow-right-BQL1_QMW.js +0 -1
- package/dist/assets/arrow-up-BQh_uho_.js +0 -1
- package/dist/assets/chat-5TeQeXg6.js +0 -1
- package/dist/assets/chat-AWH1Eq66.js +0 -1
- package/dist/assets/chat-BEbedEUX.js +0 -1
- package/dist/assets/chat-BKEDECw4.js +0 -1
- package/dist/assets/chat-CKgKfR3G.js +0 -1
- package/dist/assets/chat-CqOSpk1j.js +0 -1
- package/dist/assets/chat-DIFZYTnO.js +0 -1
- package/dist/assets/chat-DYjIMAVw.js +0 -1
- package/dist/assets/chat-DYmT0Yvc.js +0 -1
- package/dist/assets/chat-Dd6tIvLp.js +0 -1
- package/dist/assets/chat-DjkaNaEt.js +0 -1
- package/dist/assets/chat-ObhnlF43.js +0 -1
- package/dist/assets/check-CvzlOh9y.js +0 -1
- package/dist/assets/chevron-down-B4V8oKg4.js +0 -1
- package/dist/assets/chevron-right-BC5ylckn.js +0 -1
- package/dist/assets/circle-check-DtG7_-0o.js +0 -1
- package/dist/assets/clock-IAci-Zzy.js +0 -1
- package/dist/assets/code-C0f79oRQ.js +0 -1
- package/dist/assets/common-DIFVLaNh.js +0 -1
- package/dist/assets/constants-XMLzMJVJ.js +0 -3
- package/dist/assets/esm-CoJds8QY.js +0 -1
- package/dist/assets/flux-WBOJvTOp.js +0 -1
- package/dist/assets/gauge-Dr0RTbvf.js +0 -1
- package/dist/assets/index-DKAHKezv.css +0 -1
- package/dist/assets/loader-circle-ly_u_IQt.js +0 -1
- package/dist/assets/minimax-CYpaxOzz.js +0 -1
- package/dist/assets/music-2-TpIjRQXw.js +0 -1
- package/dist/assets/play-BHPb6zRT.js +0 -1
- package/dist/assets/plus-BgGyj7OG.js +0 -1
- package/dist/assets/rotate-ccw-B1viIggk.js +0 -1
- package/dist/assets/rotate-cw-BFAaVvoq.js +0 -1
- package/dist/assets/search-D9sS2zks.js +0 -1
- package/dist/assets/square-RZDqdJlO.js +0 -1
- package/dist/assets/terminal-CihWj-P8.js +0 -1
- package/dist/assets/user-BEv2qjci.js +0 -1
- package/dist/assets/webextrator-CgBbtaN5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-BqzezbgS.js";import{t as x}from"./upload-XUGlysu6.js";import{t as S}from"./tooltip-BBrV3AZK.js";import{t as C}from"./alert-BprQRUmf.js";import{_ as w,v as T}from"./vuex.esm-bundler-BxNPLO2l.js";import{t as E}from"./drawer-BVEcNx1I.js";import{t as D}from"./input-number-BweR5GSS.js";import{t as O}from"./switch-C6gnvMgV.js";import{t as k}from"./box-CYBPc1Rz.js";import{t as A}from"./clock-IAci-Zzy.js";import{t as j}from"./hash-CGhR3E3W.js";import{t as M}from"./image-D-Qn2R2s.js";import{t as N}from"./info-AarYb6UU.js";import{a as P,i as F,n as I,r as ee,t as te}from"./pagination-DkzSLsHS.js";import{t as ne}from"./trash-2-BPjzpfWl.js";import{t as re}from"./triangle-alert-hVh_-DcV.js";import{t as ie}from"./upload-Cra0_3dJ.js";import{t as L}from"./wand-sparkles-B3s3EW_F.js";import{t as ae}from"./zap-CLXFE1AD.js";import{Bn as R,Fn as z,In as oe,Ln as se,Mn as B,Nn as ce,Pn as V,jn as H,kn as U,zn as W}from"./constants-XMLzMJVJ.js";import{D as G,Ki as le,Ma as ue,Ra as K,T as de,Yn as fe,Za as q,at as pe,ct as me,ea as he,lt as ge,ot as _e,st as ve,tt as ye,wn as be}from"./index-B_mDD17T.js";import{t as xe}from"./CopyToClipboard-DwbsH1C3.js";import{t as Se}from"./ReportButton-Bzz2CkcM.js";import{t as J}from"./ImagePreview-BLcOkAKu.js";import{n as Ce}from"./taskDrawerMixin-DyAUhFEq.js";import{t as we}from"./ServicePricingSummary-CDYYBNdf.js";import{t as Te}from"./ApiCodeButton-BVdwvbqZ.js";import{t as Ee}from"./BotPlaceholder-BMvZ2r7e.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-BrMvxK_-.js";import{t as ke}from"./showcaseRecreateMixin-BWDEj-jO.js";import{n as Ae,t as je}from"./generationInput-ClY8zxHb.js";import{t as Me}from"./ImageWrapper-CbWVwZRD.js";var Ne=_({name:`LayoutSeedream`,components:{MagicIcon:L,ElDrawer:E,ElButton:q},mixins:[Ce]}),Pe={class:`main flex flex-row flex-1`},Fe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ie={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Le(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Pe,[e(`div`,Fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ie,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Re=G(Ne,[[`render`,Le],[`__scopeId`,`data-v-fa2db192`]]),ze=_({name:`SeedreamPromptInput`,components:{PromptTextarea:F},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Be(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ve=G(ze,[[`render`,Be]]),He={image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`1K`,`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[],layerDecomposition:!1,transparentBackground:!1};function Y(e){switch(e){case z:return{image:!0,imageRequired:!1,maxInputImages:10,sizeTiers:[`1K`,W,`2K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!0,transparentBackground:!0};case V:case ce:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`3K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!0,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case B:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case H:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`1K`,`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!1,transparentBackground:!1};default:return He}}function Ue(e,t){return t?.length?`edit`:`generate`}var We=[`1K`,W,`2K`,`3K`,`4K`];function X(e,t){if(!e)return[];let n=Y(t.model??e.model),r=[],i=typeof e.size==`string`?e.size:void 0;Array.isArray(e.image)&&e.image.length>n.maxInputImages&&r.push({field:`image`,i18nLabel:`seedream.name.imageUrls`}),i&&(i===`adaptive`||We.includes(i)&&!n.sizeTiers.includes(i))&&r.push({field:`size`,i18nLabel:`seedream.name.size`}),e.sequential_image_generation===`auto`&&!n.groupGeneration&&r.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&r.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&r.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!n.outputFormat&&r.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),e.tools?.length&&!n.webSearch&&r.push({field:`tools`,i18nLabel:`seedream.name.webSearch`});let a=e.optimize_prompt_options?.mode;return a&&!n.promptOptimization.includes(a)&&r.push({field:`optimize_prompt_options`,i18nLabel:`seedream.name.promptOptimization`}),e.layer_decomposition&&!n.layerDecomposition&&r.push({field:`layer_decomposition`,i18nLabel:`seedream.name.layerDecomposition`}),e.background&&!n.transparentBackground&&r.push({field:`background`,i18nLabel:`seedream.name.background`}),r}function Z(e,t,n){let r={...e};for(let e of t)switch(e.field){case`image`:r.image=(r.image||[]).slice(0,Y(r.model).maxInputImages);break;case`size`:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:case`guidance_scale`:case`output_format`:case`tools`:case`optimize_prompt_options`:case`layer_decomposition`:case`background`:delete r[e.field];break}return r}var Ge=_({name:`SeedreamImageInput`,components:{UploadIcon:ie,ElUpload:x,ElButton:q,InfoIcon:P,ImagePreview:J},mixins:[ge,me,_e,ye],data(){return{fileList:[],uploadUrl:ue()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){let e=this.$store.state.seedream?.config?.image;return typeof e==`string`?[e]:Array.isArray(e)?e:void 0},model(){return this.$store.state.seedream?.config?.model},supported(){return Y(this.model).image},limit(){return(this.$store.state.seedream?.config||{}).layer_decomposition?1:Y(this.model).maxInputImages}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){T.warning(this.$t(`seedream.message.uploadImageExceed`,{count:this.limit}))},onError(){T.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ke={key:0},qe={class:`field`},Je={class:`label`},Ye={class:`box`},Xe={class:`title font-bold`},Ze={class:`value`},Qe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function $e(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ze,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:t.limit,multiple:t.limit>1,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Qe,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var et=G(Ge,[[`render`,$e],[`__scopeId`,`data-v-500d9564`]]),tt=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0,options:[{value:z,label:this.$t(`seedream.model.seedream50pro`)},{value:V,label:this.$t(`seedream.model.seedream50`)},{value:B,label:this.$t(`seedream.model.seedream45`)},{value:H,label:this.$t(`seedream.model.seedream40`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){let e=this.value===`doubao-seedream-5-0-260128`?V:this.value;if(e&&this.options.some(t=>t.value===e)){e!==this.value&&this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e});return}let t={...this.$store.state.seedream?.config||{},model:U},n=X(t,{model:U});this.$store.commit(`seedream/setConfig`,Z(t,n,{model:U}))},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await K.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),T.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),nt={class:`field`},rt={class:`label`},it={class:`box`},at={class:`title font-bold`};function ot(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,nt,[e(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=G(tt,[[`render`,ot],[`__scopeId`,`data-v-dd2c4aee`]]),ct=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:P},data(){return{allPixelOptions:se}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Y(this.model)},pixelOptions(){let e=this.model===`doubao-seedream-5-0-lite-260128`||this.model===`doubao-seedream-5-0-260128`||this.model===`doubao-seedream-4-5-251128`?3686400:921600;return this.allPixelOptions.filter(t=>{let[n,r]=t.value.split(`x`).map(Number);return n*r>=e})},layerDecomposition(){return this.$store.state.seedream?.config?.layer_decomposition===!0},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),lt={class:`field`},ut={class:`label`},dt={class:`box`},ft={class:`title font-bold`};function pt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,lt,[e(`div`,ut,[e(`div`,dt,[e(`h2`,ft,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128)),t.layerDecomposition?(h(),f(v,{key:0,label:`AUTO`,value:`auto`})):o(``,!0)]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var mt=G(ct,[[`render`,pt],[`__scopeId`,`data-v-810b7ca9`]]),ht=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:D,InfoIcon:P},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),gt={key:0,class:`field`},_t={class:`label`},vt={class:`box`},yt={class:`title font-bold`},bt={class:`value`};function xt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,gt,[e(`div`,_t,[e(`div`,vt,[e(`h2`,yt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,bt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var St=G(ht,[[`render`,xt],[`__scopeId`,`data-v-f079fd20`]]),Ct=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{options:[...oe]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),wt={key:0,class:`field`},Tt={class:`label`},Et={class:`box`},Dt={class:`title font-bold`};function Ot(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,wt,[e(`div`,Tt,[e(`div`,Et,[e(`h2`,Dt,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var kt=G(Ct,[[`render`,Ot],[`__scopeId`,`data-v-69ea4c07`]]),At=_({name:`SeedreamAdvancedOptions`,components:{ElOption:b,ElSelect:y,ElSwitch:O},computed:{config(){return this.$store.state.seedream?.config||{}},capabilities(){return Y(this.config.model)},hasSingleImage(){return Array.isArray(this.config.image)&&this.config.image.length===1},mode:{get(){return this.config.layer_decomposition?`layers`:`image`},set(e){let t={...this.config};e===`layers`?(t.layer_decomposition=!0,t.image=(t.image||[]).slice(0,1),t.size=`auto`,delete t.background,delete t.sequential_image_generation,delete t.sequential_image_generation_options,delete t.tools):(delete t.layer_decomposition,t.size===`auto`&&delete t.size),this.$store.commit(`seedream/setConfig`,t)}},background:{get(){return this.config.background},set(e){let t={...this.config,background:e};e===`transparent`&&(t.output_format=`png`),e||delete t.background,this.$store.commit(`seedream/setConfig`,t)}},promptOptimization:{get(){return this.config.optimize_prompt_options?.mode},set(e){let t={...this.config};e?t.optimize_prompt_options={mode:e}:delete t.optimize_prompt_options,this.$store.commit(`seedream/setConfig`,t)}},webSearch:{get(){return this.config.tools?.some(e=>e?.type===`web_search`)===!0},set(e){let t={...this.config};e?t.tools=[{type:`web_search`}]:delete t.tools,this.$store.commit(`seedream/setConfig`,t)}}}}),jt={class:`advanced-options`},Mt={key:0,class:`field`},Nt={class:`label`},Pt={class:`title font-bold`},Ft={key:1,class:`field`},It={class:`label`},Lt={class:`title font-bold`},Rt={key:2,class:`field`},zt={class:`label`},Bt={class:`title font-bold`},Vt={key:3,class:`field`},Ht={class:`label`},Ut={class:`title font-bold`};function Wt(t,n,r,u,d,g){let _=l(`el-option`),v=l(`el-select`),y=l(`el-switch`);return h(),s(`div`,jt,[t.capabilities.layerDecomposition?(h(),s(`div`,Mt,[e(`div`,Nt,[e(`h2`,Pt,i(t.$t(`seedream.name.mode`)),1)]),a(v,{modelValue:t.mode,"onUpdate:modelValue":n[0]||=e=>t.mode=e,class:`value`},{default:p(()=>[a(_,{label:t.$t(`seedream.mode.image`),value:`image`},null,8,[`label`]),a(_,{label:t.$t(`seedream.mode.layers`),value:`layers`},null,8,[`label`])]),_:1},8,[`modelValue`])])):o(``,!0),t.capabilities.transparentBackground&&t.mode===`image`&&t.hasSingleImage?(h(),s(`div`,Ft,[e(`div`,It,[e(`h2`,Lt,i(t.$t(`seedream.name.background`)),1)]),a(v,{modelValue:t.background,"onUpdate:modelValue":n[1]||=e=>t.background=e,class:`value`,clearable:``},{default:p(()=>[a(_,{label:t.$t(`seedream.background.opaque`),value:`opaque`},null,8,[`label`]),a(_,{label:t.$t(`seedream.background.transparent`),value:`transparent`},null,8,[`label`])]),_:1},8,[`modelValue`])])):o(``,!0),t.capabilities.promptOptimization.length?(h(),s(`div`,Rt,[e(`div`,zt,[e(`h2`,Bt,i(t.$t(`seedream.name.promptOptimization`)),1)]),a(v,{modelValue:t.promptOptimization,"onUpdate:modelValue":n[2]||=e=>t.promptOptimization=e,class:`value`,clearable:``},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.promptOptimization,e=>(h(),f(_,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`])])):o(``,!0),t.capabilities.webSearch&&t.mode===`image`?(h(),s(`div`,Vt,[e(`div`,Ht,[e(`h2`,Ut,i(t.$t(`seedream.name.webSearch`)),1)]),a(y,{modelValue:t.webSearch,"onUpdate:modelValue":n[3]||=e=>t.webSearch=e},null,8,[`modelValue`])])):o(``,!0)])}var Gt=G(At,[[`render`,Wt],[`__scopeId`,`data-v-085ad2ee`]]),Kt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:D,InfoIcon:P},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),qt={key:0,class:`field`},Jt={class:`label`},Yt={class:`box`},Xt={class:`title font-bold`},Zt={class:`value`};function Qt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`h2`,Xt,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Zt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var $t=G(Kt,[[`render`,Qt],[`__scopeId`,`data-v-10cdc1e0`]]),en=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:D,InfoIcon:P},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).guidanceScale},defaultValue(){return Y(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),tn={key:0,class:`field`},nn={class:`label`},rn={class:`box`},an={class:`title font-bold`},on={class:`value`};function sn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`h2`,an,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,on,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var cn=G(en,[[`render`,sn],[`__scopeId`,`data-v-7386f064`]]),Q=e=>{let t={...e||{}};typeof t.prompt==`string`&&(t.prompt=t.prompt.trim()),delete t.action,delete t.stream,delete t.seed,delete t.guidance_scale,t.watermark=!1;let n=Y(t.model),r=t.model===`doubao-seedream-5-0-pro-260628`&&t.layer_decomposition===!0;t.image?.length||delete t.image,t.size||delete t.size,r?(t.image=t.image?.slice(0,1),t.size=t.size||`auto`,t.prompt||delete t.prompt,delete t.background,delete t.sequential_image_generation,delete t.sequential_image_generation_options,delete t.tools):(delete t.layer_decomposition,n.transparentBackground||delete t.background,t.background===`transparent`&&(t.output_format=`png`),(!n.groupGeneration||t.sequential_image_generation!==`auto`)&&(n.groupGeneration||delete t.sequential_image_generation,delete t.sequential_image_generation_options),n.webSearch||delete t.tools),n.outputFormat||delete t.output_format;let i=t.optimize_prompt_options?.mode;return(!i||!n.promptOptimization.includes(i))&&delete t.optimize_prompt_options,{...t,async:!0}},ln=_({name:`SeedreamConfigPanel`,components:{MagicIcon:L,ElButton:q,PromptInput:Ve,ServicePricingSummary:we,ImageInput:et,ModelSelector:st,SizeSelector:mt,MaxImagesSelector:St,OutputFormatSelector:kt,AdvancedOptions:Gt,SeedInput:$t,GuidanceScaleInput:cn},emits:[`generate`],computed:{action(){let e=this.config?.image;return Ue(this.config?.model,typeof e==`string`?[e]:e)},capabilities(){return Y(this.config?.model)},canGenerate(){let e=Q(this.config);return e.layer_decomposition?e.image?.length===1:je(`seedream`,e)},config(){return this.$store.state.seedream?.config},consumption(){let e=Q(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1,n=typeof e.size==`string`&&/^\d+x\d+$/i.test(e.size)?e.size.split(`x`).map(Number).reduce((e,t)=>e*t):e.size===`2K`?4194304:1e6,r=e.model===`doubao-seedream-5-0-pro-260628`;return be({...e,action:this.action,model:R(e.model),input_image_count:Array.isArray(e.image)?e.image.length:+!!e.image,count:t,layer_decomposition:e.layer_decomposition===!0,layer_low_count:+!!e.layer_decomposition,regular_low_count:r&&!e.layer_decomposition&&n<=261e4?1:0,regular_high_count:r&&!e.layer_decomposition&&n>261e4?1:0},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),un={class:`flex flex-col h-full`},dn={class:`flex-1 overflow-y-auto p-5`},fn={class:`flex flex-col items-center justify-center px-5 pb-5`};function pn(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`advanced-options`),x=l(`seed-input`),S=l(`guidance-scale-input`),C=l(`prompt-input`),w=l(`image-input`),T=l(`service-pricing-summary`),E=l(`magic-icon`),D=l(`el-button`);return h(),s(`div`,un,[e(`div`,dn,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),t.capabilities.image?(h(),f(w,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,fn,[a(T,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(D,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var mn=G(ln,[[`render`,pn]]),hn=_({name:`SeedreamTaskPreview`,components:{DeleteIcon:ne,ApplicationIcon:k,ChannelIcon:j,ImageIcon:M,InfoIcon:N,LightningIcon:ae,MagicIcon:L,TimeIcon:A,WarningIcon:re,CopyToClipboard:xe,ElAlert:C,ImageWrapper:Me,ElButton:q,ElTooltip:S,ImagePreview:J,ApiCodeButton:Te,ReportButton:Se},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return Q(this.modelValue?.request)},requestImages(){let e=this.modelValue?.request?.image;return typeof e==`string`?[e]:Array.isArray(e)?e:[]},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=this.modelValue?.response?.data;return Array.isArray(e)?[...e].sort((e,t)=>(e.z_index??2**53-1)-(t.z_index??2**53-1)):[]},isLayerResult(){return this.modelValue?.request?.layer_decomposition===!0||this.images.some(e=>e.z_index!==void 0)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await K.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`seedream/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},shortModel(e){return R(e)||e},layerTitle(e,t){return e.error?this.$t(`seedream.name.failedLayer`,{index:t+1}):e.z_index===0?this.$t(`seedream.name.baseLayer`):e.name||this.$t(`seedream.name.layer`,{index:e.z_index??t+1})},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),gn={class:`preview`},_n={class:`left`},vn={class:`main`},yn={class:`bot`},bn={class:`datetime`},xn=[`aria-label`],Sn={class:`info`},Cn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},wn={key:1,class:`prompt mt-2`},Tn={key:0},En={key:0,class:n({content:!0})},Dn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},On={key:1,class:n({content:!0,failed:!0})},kn={class:`layer-grid`},An={key:1,class:`layer-meta`},jn={key:0},Mn={key:1},Nn={key:2},Pn={key:3,class:`layer-error`},Fn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},In={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ln={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vn={key:2,class:`content`},Hn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Un={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Yn={key:3,class:n({content:!0})},Xn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Qn(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`time-icon`),w=l(`magic-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`api-code-button`),A=l(`report-button`),j=l(`application-icon`),M=l(`image-icon`),N=l(`lightning-icon`),P=l(`channel-icon`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,gn,[e(`div`,_n,[a(y,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,vn,[e(`div`,yn,[a(y,{capability:`seedream`,part:`name`}),e(`span`,bn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,xn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Sn,[n.requestImages.length>0?(h(),s(`div`,Cn,[(h(!0),s(c,null,m(n.requestImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,wn,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Tn,` - (`+i(n.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,On,[e(`div`,kn,[(h(!0),s(c,null,m(n.images,(t,r)=>(h(),s(`article`,{key:r,class:`layer-card`},[t?.image_url?(h(),f(D,{key:0,src:t.image_url,"raw-src":t.image_url},null,8,[`src`,`raw-src`])):o(``,!0),n.isLayerResult||t.error?(h(),s(`div`,An,[e(`strong`,null,i(n.layerTitle(t,r)),1),t.size?(h(),s(`span`,jn,i(t.size)+` · `+i(t.output_format?.toUpperCase()),1)):o(``,!0),t.description?(h(),s(`span`,Mn,i(t.description),1)):o(``,!0),t.bounding_box?.absolute?(h(),s(`code`,Nn,i(t.bounding_box.absolute.join(`, `)),1)):o(``,!0),t.error?(h(),s(`span`,Pn,i(t.error.message||t.error.code),1)):o(``,!0)])):o(``,!0)]))),128))]),e(`div`,Fn,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:n.apiRequest},null,8,[`body`]),a(A,{service:`seedream`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,In,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Ln,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,zn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Bn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,$,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Vn,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Hn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Un,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Wn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,Gn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(h(),s(`p`,Kn,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(h(),s(`p`,qn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Jn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Yn,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,Xn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(h(),s(`p`,Zn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,En,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,Dn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var $n=_({name:`SeedreamRecentPanel`,components:{TaskPreview:G(hn,[[`render`,Qn],[`__scopeId`,`data-v-3411e2b0`]]),BotPlaceholder:Ee,NoTasks:ee,ScrollList:I},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),er={key:0},tr={key:2,class:`w-full h-full flex items-center justify-center`};function nr(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,er,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,tr,[a(v)])):o(``,!0)],64)}var rr=_({name:`SeedreamIndex`,components:{ConfigPanel:mn,Layout:Re,RecentPanel:G($n,[[`render`,nr]]),ShowcaseResultTabs:Oe},mixins:[ve,ke(`seedream`),De(`seedream`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===w.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await te({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){let e=Q(this.config),t=Ae(`seedream`,e);if(t){T.error(this.$t(`common.message.${t}`));return}if(!pe(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;if(Y(this.config?.model).imageRequired&&!this.config?.image?.length){T.warning(this.$t(`seedream.message.referenceImageRequired`));return}if(!he())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}T.info(this.$t(`seedream.message.startingTask`)),le(`seedream`,fe.generate(e,{token:n})).then(()=>{T.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;de(e,`seedream`)||T.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ir(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return h(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`seedream`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var ar=G(rr,[[`render`,ir]]);export{ar as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-DpCwbg2P.js";import{t as x}from"./upload-DNSrVlZy.js";import{t as S}from"./tooltip-CBYmo1Dy.js";import{t as C}from"./alert-BprQRUmf.js";import{_ as w,v as T}from"./vuex.esm-bundler-LBWCZBn7.js";import{t as E}from"./drawer-DkbSBBLh.js";import{t as D}from"./input-number-Z9VlgVmG.js";import{t as O}from"./switch-D3WZiAvp.js";import{t as k}from"./box-BELXS1Xk.js";import{t as A}from"./clock-D-MIHQUu.js";import{t as j}from"./hash-XGo8nwFc.js";import{t as M}from"./image-BNpIV_kk.js";import{t as N}from"./info-DiJCV4qJ.js";import{a as P,i as F,n as I,r as ee,t as te}from"./pagination-19y2LGQl.js";import{t as ne}from"./trash-2-COs0p2Nt.js";import{t as re}from"./triangle-alert-Bepd3LHY.js";import{t as ie}from"./upload-3n-8FFny.js";import{t as L}from"./wand-sparkles-DAxQpus4.js";import{t as ae}from"./zap-DOKxH-m_.js";import{Bn as R,Fn as z,In as oe,Ln as se,Mn as B,Nn as ce,Pn as V,jn as H,kn as U,zn as W}from"./constants-WMYSVfpe.js";import{D as G,Na as le,Qa as K,T as ue,Tn as de,Xn as fe,at as pe,ct as me,lt as he,ot as ge,qi as _e,st as ve,ta as ye,tt as be,za as q}from"./index-DNgm0O4R.js";import{t as xe}from"./CopyToClipboard-CnWeQakr.js";import{t as Se}from"./ReportButton-B7cDB8LW.js";import{t as J}from"./ImagePreview-DzG8rluG.js";import{n as Ce}from"./taskDrawerMixin-DyAUhFEq.js";import{t as we}from"./ServicePricingSummary-BI_c3bg7.js";import{t as Te}from"./ApiCodeButton-D1lki4F_.js";import{t as Ee}from"./BotPlaceholder-9sRMAfGp.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-CHdyEJpt.js";import{t as ke}from"./showcaseRecreateMixin-CXfW6PxO.js";import{n as Ae,t as je}from"./generationInput-DCC9j_iS.js";import{t as Me}from"./ImageWrapper-BHq01Ilv.js";var Ne=_({name:`LayoutSeedream`,components:{MagicIcon:L,ElDrawer:E,ElButton:K},mixins:[Ce]}),Pe={class:`main flex flex-row flex-1`},Fe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ie={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Le(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Pe,[e(`div`,Fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ie,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Re=G(Ne,[[`render`,Le],[`__scopeId`,`data-v-fa2db192`]]),ze=_({name:`SeedreamPromptInput`,components:{PromptTextarea:F},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Be(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ve=G(ze,[[`render`,Be]]),He={image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`1K`,`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[],layerDecomposition:!1,transparentBackground:!1};function Y(e){switch(e){case z:return{image:!0,imageRequired:!1,maxInputImages:10,sizeTiers:[`1K`,W,`2K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!0,transparentBackground:!0};case V:case ce:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`3K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!0,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case B:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case H:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`1K`,`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!1,transparentBackground:!1};default:return He}}function Ue(e,t){return t?.length?`edit`:`generate`}var We=[`1K`,W,`2K`,`3K`,`4K`];function X(e,t){if(!e)return[];let n=Y(t.model??e.model),r=[],i=typeof e.size==`string`?e.size:void 0;Array.isArray(e.image)&&e.image.length>n.maxInputImages&&r.push({field:`image`,i18nLabel:`seedream.name.imageUrls`}),i&&(i===`adaptive`||We.includes(i)&&!n.sizeTiers.includes(i))&&r.push({field:`size`,i18nLabel:`seedream.name.size`}),e.sequential_image_generation===`auto`&&!n.groupGeneration&&r.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&r.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&r.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!n.outputFormat&&r.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),e.tools?.length&&!n.webSearch&&r.push({field:`tools`,i18nLabel:`seedream.name.webSearch`});let a=e.optimize_prompt_options?.mode;return a&&!n.promptOptimization.includes(a)&&r.push({field:`optimize_prompt_options`,i18nLabel:`seedream.name.promptOptimization`}),e.layer_decomposition&&!n.layerDecomposition&&r.push({field:`layer_decomposition`,i18nLabel:`seedream.name.layerDecomposition`}),e.background&&!n.transparentBackground&&r.push({field:`background`,i18nLabel:`seedream.name.background`}),r}function Z(e,t,n){let r={...e};for(let e of t)switch(e.field){case`image`:r.image=(r.image||[]).slice(0,Y(r.model).maxInputImages);break;case`size`:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:case`guidance_scale`:case`output_format`:case`tools`:case`optimize_prompt_options`:case`layer_decomposition`:case`background`:delete r[e.field];break}return r}var Ge=_({name:`SeedreamImageInput`,components:{UploadIcon:ie,ElUpload:x,ElButton:K,InfoIcon:P,ImagePreview:J},mixins:[he,me,ge,be],data(){return{fileList:[],uploadUrl:le()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){let e=this.$store.state.seedream?.config?.image;return typeof e==`string`?[e]:Array.isArray(e)?e:void 0},model(){return this.$store.state.seedream?.config?.model},supported(){return Y(this.model).image},limit(){return(this.$store.state.seedream?.config||{}).layer_decomposition?1:Y(this.model).maxInputImages}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){T.warning(this.$t(`seedream.message.uploadImageExceed`,{count:this.limit}))},onError(){T.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ke={key:0},qe={class:`field`},Je={class:`label`},Ye={class:`box`},Xe={class:`title font-bold`},Ze={class:`value`},Qe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function $e(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ze,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:t.limit,multiple:t.limit>1,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Qe,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var et=G(Ge,[[`render`,$e],[`__scopeId`,`data-v-500d9564`]]),tt=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0,options:[{value:z,label:this.$t(`seedream.model.seedream50pro`)},{value:V,label:this.$t(`seedream.model.seedream50`)},{value:B,label:this.$t(`seedream.model.seedream45`)},{value:H,label:this.$t(`seedream.model.seedream40`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){let e=this.value===`doubao-seedream-5-0-260128`?V:this.value;if(e&&this.options.some(t=>t.value===e)){e!==this.value&&this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e});return}let t={...this.$store.state.seedream?.config||{},model:U},n=X(t,{model:U});this.$store.commit(`seedream/setConfig`,Z(t,n,{model:U}))},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await q.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),T.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),nt={class:`field`},rt={class:`label`},it={class:`box`},at={class:`title font-bold`};function ot(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,nt,[e(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=G(tt,[[`render`,ot],[`__scopeId`,`data-v-dd2c4aee`]]),ct=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:P},data(){return{allPixelOptions:se}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Y(this.model)},pixelOptions(){let e=this.model===`doubao-seedream-5-0-lite-260128`||this.model===`doubao-seedream-5-0-260128`||this.model===`doubao-seedream-4-5-251128`?3686400:921600;return this.allPixelOptions.filter(t=>{let[n,r]=t.value.split(`x`).map(Number);return n*r>=e})},layerDecomposition(){return this.$store.state.seedream?.config?.layer_decomposition===!0},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),lt={class:`field`},ut={class:`label`},dt={class:`box`},ft={class:`title font-bold`};function pt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,lt,[e(`div`,ut,[e(`div`,dt,[e(`h2`,ft,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128)),t.layerDecomposition?(h(),f(v,{key:0,label:`AUTO`,value:`auto`})):o(``,!0)]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var mt=G(ct,[[`render`,pt],[`__scopeId`,`data-v-810b7ca9`]]),ht=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:D,InfoIcon:P},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),gt={key:0,class:`field`},_t={class:`label`},vt={class:`box`},yt={class:`title font-bold`},bt={class:`value`};function xt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,gt,[e(`div`,_t,[e(`div`,vt,[e(`h2`,yt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,bt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var St=G(ht,[[`render`,xt],[`__scopeId`,`data-v-f079fd20`]]),Ct=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{options:[...oe]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),wt={key:0,class:`field`},Tt={class:`label`},Et={class:`box`},Dt={class:`title font-bold`};function Ot(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,wt,[e(`div`,Tt,[e(`div`,Et,[e(`h2`,Dt,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var kt=G(Ct,[[`render`,Ot],[`__scopeId`,`data-v-69ea4c07`]]),At=_({name:`SeedreamAdvancedOptions`,components:{ElOption:b,ElSelect:y,ElSwitch:O},computed:{config(){return this.$store.state.seedream?.config||{}},capabilities(){return Y(this.config.model)},hasSingleImage(){return Array.isArray(this.config.image)&&this.config.image.length===1},mode:{get(){return this.config.layer_decomposition?`layers`:`image`},set(e){let t={...this.config};e===`layers`?(t.layer_decomposition=!0,t.image=(t.image||[]).slice(0,1),t.size=`auto`,delete t.background,delete t.sequential_image_generation,delete t.sequential_image_generation_options,delete t.tools):(delete t.layer_decomposition,t.size===`auto`&&delete t.size),this.$store.commit(`seedream/setConfig`,t)}},background:{get(){return this.config.background},set(e){let t={...this.config,background:e};e===`transparent`&&(t.output_format=`png`),e||delete t.background,this.$store.commit(`seedream/setConfig`,t)}},promptOptimization:{get(){return this.config.optimize_prompt_options?.mode},set(e){let t={...this.config};e?t.optimize_prompt_options={mode:e}:delete t.optimize_prompt_options,this.$store.commit(`seedream/setConfig`,t)}},webSearch:{get(){return this.config.tools?.some(e=>e?.type===`web_search`)===!0},set(e){let t={...this.config};e?t.tools=[{type:`web_search`}]:delete t.tools,this.$store.commit(`seedream/setConfig`,t)}}}}),jt={class:`advanced-options`},Mt={key:0,class:`field`},Nt={class:`label`},Pt={class:`title font-bold`},Ft={key:1,class:`field`},It={class:`label`},Lt={class:`title font-bold`},Rt={key:2,class:`field`},zt={class:`label`},Bt={class:`title font-bold`},Vt={key:3,class:`field`},Ht={class:`label`},Ut={class:`title font-bold`};function Wt(t,n,r,u,d,g){let _=l(`el-option`),v=l(`el-select`),y=l(`el-switch`);return h(),s(`div`,jt,[t.capabilities.layerDecomposition?(h(),s(`div`,Mt,[e(`div`,Nt,[e(`h2`,Pt,i(t.$t(`seedream.name.mode`)),1)]),a(v,{modelValue:t.mode,"onUpdate:modelValue":n[0]||=e=>t.mode=e,class:`value`},{default:p(()=>[a(_,{label:t.$t(`seedream.mode.image`),value:`image`},null,8,[`label`]),a(_,{label:t.$t(`seedream.mode.layers`),value:`layers`},null,8,[`label`])]),_:1},8,[`modelValue`])])):o(``,!0),t.capabilities.transparentBackground&&t.mode===`image`&&t.hasSingleImage?(h(),s(`div`,Ft,[e(`div`,It,[e(`h2`,Lt,i(t.$t(`seedream.name.background`)),1)]),a(v,{modelValue:t.background,"onUpdate:modelValue":n[1]||=e=>t.background=e,class:`value`,clearable:``},{default:p(()=>[a(_,{label:t.$t(`seedream.background.opaque`),value:`opaque`},null,8,[`label`]),a(_,{label:t.$t(`seedream.background.transparent`),value:`transparent`},null,8,[`label`])]),_:1},8,[`modelValue`])])):o(``,!0),t.capabilities.promptOptimization.length?(h(),s(`div`,Rt,[e(`div`,zt,[e(`h2`,Bt,i(t.$t(`seedream.name.promptOptimization`)),1)]),a(v,{modelValue:t.promptOptimization,"onUpdate:modelValue":n[2]||=e=>t.promptOptimization=e,class:`value`,clearable:``},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.promptOptimization,e=>(h(),f(_,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`])])):o(``,!0),t.capabilities.webSearch&&t.mode===`image`?(h(),s(`div`,Vt,[e(`div`,Ht,[e(`h2`,Ut,i(t.$t(`seedream.name.webSearch`)),1)]),a(y,{modelValue:t.webSearch,"onUpdate:modelValue":n[3]||=e=>t.webSearch=e},null,8,[`modelValue`])])):o(``,!0)])}var Gt=G(At,[[`render`,Wt],[`__scopeId`,`data-v-085ad2ee`]]),Kt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:D,InfoIcon:P},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),qt={key:0,class:`field`},Jt={class:`label`},Yt={class:`box`},Xt={class:`title font-bold`},Zt={class:`value`};function Qt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`h2`,Xt,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Zt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var $t=G(Kt,[[`render`,Qt],[`__scopeId`,`data-v-10cdc1e0`]]),en=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:D,InfoIcon:P},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Y(this.config?.model).guidanceScale},defaultValue(){return Y(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),tn={key:0,class:`field`},nn={class:`label`},rn={class:`box`},an={class:`title font-bold`},on={class:`value`};function sn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`h2`,an,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,on,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var cn=G(en,[[`render`,sn],[`__scopeId`,`data-v-7386f064`]]),Q=e=>{let t={...e||{}};typeof t.prompt==`string`&&(t.prompt=t.prompt.trim()),delete t.action,delete t.stream,delete t.seed,delete t.guidance_scale,t.watermark=!1;let n=Y(t.model),r=t.model===`doubao-seedream-5-0-pro-260628`&&t.layer_decomposition===!0;t.image?.length||delete t.image,t.size||delete t.size,r?(t.image=t.image?.slice(0,1),t.size=t.size||`auto`,t.prompt||delete t.prompt,delete t.background,delete t.sequential_image_generation,delete t.sequential_image_generation_options,delete t.tools):(delete t.layer_decomposition,n.transparentBackground||delete t.background,t.background===`transparent`&&(t.output_format=`png`),(!n.groupGeneration||t.sequential_image_generation!==`auto`)&&(n.groupGeneration||delete t.sequential_image_generation,delete t.sequential_image_generation_options),n.webSearch||delete t.tools),n.outputFormat||delete t.output_format;let i=t.optimize_prompt_options?.mode;return(!i||!n.promptOptimization.includes(i))&&delete t.optimize_prompt_options,{...t,async:!0}},ln=_({name:`SeedreamConfigPanel`,components:{MagicIcon:L,ElButton:K,PromptInput:Ve,ServicePricingSummary:we,ImageInput:et,ModelSelector:st,SizeSelector:mt,MaxImagesSelector:St,OutputFormatSelector:kt,AdvancedOptions:Gt,SeedInput:$t,GuidanceScaleInput:cn},emits:[`generate`],computed:{action(){let e=this.config?.image;return Ue(this.config?.model,typeof e==`string`?[e]:e)},capabilities(){return Y(this.config?.model)},canGenerate(){let e=Q(this.config);return e.layer_decomposition?e.image?.length===1:je(`seedream`,e)},config(){return this.$store.state.seedream?.config},consumption(){let e=Q(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1,n=typeof e.size==`string`&&/^\d+x\d+$/i.test(e.size)?e.size.split(`x`).map(Number).reduce((e,t)=>e*t):e.size===`2K`?4194304:1e6,r=e.model===`doubao-seedream-5-0-pro-260628`;return de({...e,action:this.action,model:R(e.model),input_image_count:Array.isArray(e.image)?e.image.length:+!!e.image,count:t,layer_decomposition:e.layer_decomposition===!0,layer_low_count:+!!e.layer_decomposition,regular_low_count:r&&!e.layer_decomposition&&n<=261e4?1:0,regular_high_count:r&&!e.layer_decomposition&&n>261e4?1:0},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),un={class:`flex flex-col h-full`},dn={class:`flex-1 overflow-y-auto p-5`},fn={class:`flex flex-col items-center justify-center px-5 pb-5`};function pn(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`advanced-options`),x=l(`seed-input`),S=l(`guidance-scale-input`),C=l(`prompt-input`),w=l(`image-input`),T=l(`service-pricing-summary`),E=l(`magic-icon`),D=l(`el-button`);return h(),s(`div`,un,[e(`div`,dn,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),t.capabilities.image?(h(),f(w,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,fn,[a(T,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(D,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var mn=G(ln,[[`render`,pn]]),hn=_({name:`SeedreamTaskPreview`,components:{DeleteIcon:ne,ApplicationIcon:k,ChannelIcon:j,ImageIcon:M,InfoIcon:N,LightningIcon:ae,MagicIcon:L,TimeIcon:A,WarningIcon:re,CopyToClipboard:xe,ElAlert:C,ImageWrapper:Me,ElButton:K,ElTooltip:S,ImagePreview:J,ApiCodeButton:Te,ReportButton:Se},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return Q(this.modelValue?.request)},requestImages(){let e=this.modelValue?.request?.image;return typeof e==`string`?[e]:Array.isArray(e)?e:[]},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=this.modelValue?.response?.data;return Array.isArray(e)?[...e].sort((e,t)=>(e.z_index??2**53-1)-(t.z_index??2**53-1)):[]},isLayerResult(){return this.modelValue?.request?.layer_decomposition===!0||this.images.some(e=>e.z_index!==void 0)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`seedream/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},shortModel(e){return R(e)||e},layerTitle(e,t){return e.error?this.$t(`seedream.name.failedLayer`,{index:t+1}):e.z_index===0?this.$t(`seedream.name.baseLayer`):e.name||this.$t(`seedream.name.layer`,{index:e.z_index??t+1})},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),gn={class:`preview`},_n={class:`left`},vn={class:`main`},yn={class:`bot`},bn={class:`datetime`},xn=[`aria-label`],Sn={class:`info`},Cn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},wn={key:1,class:`prompt mt-2`},Tn={key:0},En={key:0,class:n({content:!0})},Dn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},On={key:1,class:n({content:!0,failed:!0})},kn={class:`layer-grid`},An={key:1,class:`layer-meta`},jn={key:0},Mn={key:1},Nn={key:2},Pn={key:3,class:`layer-error`},Fn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},In={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ln={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vn={key:2,class:`content`},Hn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Un={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Yn={key:3,class:n({content:!0})},Xn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Qn(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`time-icon`),w=l(`magic-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`api-code-button`),A=l(`report-button`),j=l(`application-icon`),M=l(`image-icon`),N=l(`lightning-icon`),P=l(`channel-icon`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,gn,[e(`div`,_n,[a(y,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,vn,[e(`div`,yn,[a(y,{capability:`seedream`,part:`name`}),e(`span`,bn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,xn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Sn,[n.requestImages.length>0?(h(),s(`div`,Cn,[(h(!0),s(c,null,m(n.requestImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,wn,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Tn,` - (`+i(n.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,On,[e(`div`,kn,[(h(!0),s(c,null,m(n.images,(t,r)=>(h(),s(`article`,{key:r,class:`layer-card`},[t?.image_url?(h(),f(D,{key:0,src:t.image_url,"raw-src":t.image_url},null,8,[`src`,`raw-src`])):o(``,!0),n.isLayerResult||t.error?(h(),s(`div`,An,[e(`strong`,null,i(n.layerTitle(t,r)),1),t.size?(h(),s(`span`,jn,i(t.size)+` · `+i(t.output_format?.toUpperCase()),1)):o(``,!0),t.description?(h(),s(`span`,Mn,i(t.description),1)):o(``,!0),t.bounding_box?.absolute?(h(),s(`code`,Nn,i(t.bounding_box.absolute.join(`, `)),1)):o(``,!0),t.error?(h(),s(`span`,Pn,i(t.error.message||t.error.code),1)):o(``,!0)])):o(``,!0)]))),128))]),e(`div`,Fn,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:n.apiRequest},null,8,[`body`]),a(A,{service:`seedream`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,In,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Ln,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,zn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Bn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,$,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Vn,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Hn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Un,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Wn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,Gn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(h(),s(`p`,Kn,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(h(),s(`p`,qn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Jn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Yn,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,Xn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(h(),s(`p`,Zn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,En,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,Dn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var $n=_({name:`SeedreamRecentPanel`,components:{TaskPreview:G(hn,[[`render`,Qn],[`__scopeId`,`data-v-3411e2b0`]]),BotPlaceholder:Ee,NoTasks:ee,ScrollList:I},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),er={key:0},tr={key:2,class:`w-full h-full flex items-center justify-center`};function nr(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,er,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,tr,[a(v)])):o(``,!0)],64)}var rr=_({name:`SeedreamIndex`,components:{ConfigPanel:mn,Layout:Re,RecentPanel:G($n,[[`render`,nr]]),ShowcaseResultTabs:Oe},mixins:[ve,ke(`seedream`),De(`seedream`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===w.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await te({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){let e=Q(this.config),t=Ae(`seedream`,e);if(t){T.error(this.$t(`common.message.${t}`));return}if(!pe(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;if(Y(this.config?.model).imageRequired&&!this.config?.image?.length){T.warning(this.$t(`seedream.message.referenceImageRequired`));return}if(!ye())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}T.info(this.$t(`seedream.message.startingTask`)),_e(`seedream`,fe.generate(e,{token:n})).then(()=>{T.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;ue(e,`seedream`)||T.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ir(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return h(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`seedream`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var ar=G(rr,[[`render`,ir]]);export{ar as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,I as n,Jt as r,L as i,M as a,N as o,S as s,T as c,at as l,ht as u,it as d,j as f,mt as p,ot as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{F as y}from"./icon-CDmWyIgD.js";import{r as b,t as x}from"./select-DpCwbg2P.js";import{n as S,t as C}from"./tabs-DRQeG1Ya.js";import{t as w}from"./upload-DNSrVlZy.js";import{t as T}from"./tooltip-CBYmo1Dy.js";import{t as E}from"./alert-BprQRUmf.js";import{_ as D,v as O}from"./vuex.esm-bundler-LBWCZBn7.js";import{t as k}from"./avatar-DEN_WCPo.js";import{n as A,r as j}from"./radio-BNhFzeBO.js";import{n as M,t as N}from"./collapse-D3mLm9pK.js";import{t as ee}from"./drawer-DkbSBBLh.js";import{n as P,r as F,t as I}from"./dropdown-n067bA9H.js";import{t as L}from"./input-number-Z9VlgVmG.js";import{n as te,t as ne}from"./skeleton-Dj_a_iIP.js";import{t as re}from"./slider-D_5tNLXv.js";import{t as ie}from"./switch-D3WZiAvp.js";import{i as ae,n as oe,r as R,t as se}from"./Player-DKtF2LiP.js";import{t as ce}from"./code-k_kSMWEL.js";import{t as le}from"./download-CAxzUu_u.js";import{t as ue}from"./ellipsis-BnzW2SUZ.js";import{t as de}from"./hash-XGo8nwFc.js";import{t as fe}from"./image-BNpIV_kk.js";import{t as pe}from"./info-DiJCV4qJ.js";import{t as me}from"./loader-circle-CxuVnfcI.js";import{a as z,i as he,n as ge,r as _e,t as ve}from"./pagination-19y2LGQl.js";import{t as B}from"./pause-DTHJdCRg.js";import{t as V}from"./play-nNwhAh75.js";import{t as ye}from"./triangle-alert-Bepd3LHY.js";import{t as be}from"./upload-3n-8FFny.js";import{t as H}from"./wand-sparkles-DAxQpus4.js";import{Ga as xe,br as Se}from"./constants-WMYSVfpe.js";import{$n as U,D as W,Ha as G,Mi as K,Na as Ce,Pi as q,Qa as J,Tn as we,Ui as Te,at as Ee,ct as De,er as Y,oi as X,oo as Z,ot as Oe,qi as ke,ri as Q,st as Ae,ta as je,tt as Me,za as $}from"./index-DNgm0O4R.js";import{t as Ne}from"./CopyToClipboard-CnWeQakr.js";import{t as Pe}from"./ReportDialog-JGNMr7QD.js";import{n as Fe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ie}from"./ServicePricingSummary-BI_c3bg7.js";import{t as Le}from"./ScenarioPaymentMode-CxM3rfl_.js";import{t as Re}from"./ApiCodeDialog-DOfgYEmc.js";import{t as ze}from"./taskPollingMixin-CcLxtz8z.js";import{t as Be}from"./showcaseRecreateMixin-CXfW6PxO.js";import{n as Ve,t as He}from"./generationInput-DCC9j_iS.js";var Ue=v({name:`LayoutProducer`,components:{MagicIcon:H,ElDrawer:ee,ElButton:J},mixins:[Fe],data(){return{preview:!1}},computed:{}}),We={class:`main flex flex-row flex-1`},Ge={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ke={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},qe={class:`preview h-full w-[300px] flex flex-col`};function Je(t,n,r,a,s,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),o(`div`,We,[e(`div`,Ge,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ke,[d(t.$slots,`result`,{},void 0,!0)]),e(`div`,qe,[d(t.$slots,`preview`,{},void 0,!0)]),u(i(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[i(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),i(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ye=W(Ue,[[`render`,Je],[`__scopeId`,`data-v-6461643a`]]),Xe=v({name:`TypeSelector`,components:{ElSelect:b,ElOption:x,ElSwitch:ie,InfoIcon:z},data(){return{options:[{label:`FUZZ-2.0 Pro`,value:`FUZZ-2.0 Pro`,desc:this.$t(`producer.model.fuzz20proDesc`)},{label:`FUZZ-2.0`,value:`FUZZ-2.0`,desc:this.$t(`producer.model.fuzz20desc`)},{label:`FUZZ-2.0 Raw`,value:`FUZZ-2.0 Raw`,desc:this.$t(`producer.model.fuzz20rawDesc`)},{label:`FUZZ-1.1 Pro`,value:`FUZZ-1.1 Pro`,desc:this.$t(`producer.model.fuzz11proDesc`)},{label:`FUZZ-1.1`,value:`FUZZ-1.1`,desc:this.$t(`producer.model.fuzz11desc`)},{label:`FUZZ-1.0 Pro`,value:`FUZZ-1.0 Pro`,desc:this.$t(`producer.model.fuzz10proDesc`)},{label:`FUZZ-1.0`,value:`FUZZ-1.0`,desc:this.$t(`producer.model.fuzz10desc`)},{label:`FUZZ-0.8`,value:`FUZZ-0.8`,desc:this.$t(`producer.model.fuzz08desc`)}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||=Se}}),Ze={class:`mb-3`},Qe={class:`flex items-center mb-1`},$e={class:`text-sm font-bold`},et={class:`model-option`},tt={class:`model-option-name`},nt={class:`model-option-desc`},rt={key:0,class:`flex items-center justify-between mb-3`},it={class:`flex items-center`},at={class:`text-sm font-bold`};function ot(t,n,s,u,d,m){let _=l(`el-option`),v=l(`el-select`),y=l(`info-icon`),b=l(`el-switch`);return g(),o(`div`,null,[e(`div`,Ze,[e(`div`,Qe,[e(`span`,$e,r(t.$t(`producer.name.model`)),1)]),i(v,{modelValue:t.model,"onUpdate:modelValue":n[0]||=e=>t.model=e,class:`w-full model-select`,size:`default`,placeholder:t.$t(`producer.placeholder.select`)},{default:p(()=>[(g(!0),o(c,null,h(t.options,t=>(g(),f(_,{key:t.value,label:t.label,value:t.value},{default:p(()=>[e(`div`,et,[e(`span`,tt,r(t.label),1),e(`span`,nt,r(t.desc),1)])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),t.custom?(g(),o(`div`,rt,[e(`div`,it,[e(`span`,at,r(t.$t(`producer.name.instrumental`)),1),i(y,{content:t.$t(`producer.description.instrumental`)},null,8,[`content`])]),i(b,{modelValue:t.instrumental,"onUpdate:modelValue":n[1]||=e=>t.instrumental=e},null,8,[`modelValue`])])):a(``,!0)])}var st=W(Xe,[[`render`,ot],[`__scopeId`,`data-v-42496b9a`]]),ct=v({name:`UploadAudio`,components:{UploadIcon:be,ElUpload:w,ElButton:J,ElRadioGroup:j,ElRadioButton:A,InfoIcon:z},mixins:[De,Oe,Me],emits:[`change`],data(){return{fileList:[],uploadUrl:Ce()+`/api/v1/files/`,audioPreviewUrl:null,uploading:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},hasUploadedAudio(){let e=this.$store.state.producer?.config?.action;return e===`upload_extend`||e===`upload_cover`},uploadAction:{get(){return this.$store.state.producer?.config?.action||`upload_extend`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,action:e})}}},watch:{urls:{handler(e){this.$emit(`change`,e)}}},methods:{onExceed(){O.warning(this.$t(`producer.message.uploadReferencesExceed`))},onError(){this.uploading=!1,O.error(this.$t(`producer.message.uploadReferencesError`))},async onSuccess(){let e=this.urls?.[0];if(!e){this.uploading=!1;return}this.audioPreviewUrl=e,await this.onGenerateAudioId(e)},async onGenerateAudioId(e){let t={audio_url:e},n=this.credential?.token;if(!n){console.error(`no token specified`),this.uploading=!1;return}this.uploading=!0,O.info(this.$t(`producer.message.startingUploadAudio`));try{let e=(await Y.upload(t,{token:n})).data?.data.audio_id;this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,audio_id:e,action:`upload_extend`}),O.success(this.$t(`producer.message.startUploadAudioSuccess`))}catch(e){O.error(e?.response?.data?.error?.message||this.$t(`producer.message.startUploadAudioFailed`))}finally{this.uploading=!1}}}}),lt={class:`relative`},ut={class:`flex justify-between items-center mb-2`},dt={class:`flex justify-start items-center`},ft={class:`text-sm font-bold`},pt={key:0,class:`mb-2`},mt=[`src`],ht={key:1,class:`mt-1`};function gt(t,s,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`el-radio-button`),b=l(`el-radio-group`);return g(),o(`div`,lt,[e(`div`,ut,[e(`div`,dt,[e(`span`,ft,r(t.$t(`producer.name.referenceAudios`)),1),i(m,{content:t.$t(`producer.description.uploadAudios`)},null,8,[`content`])]),i(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,limit:1,class:`upload-wrapper inline-upload`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,accept:`.mp3,.wav,.m4a,audio/*`,"show-file-list":!1,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[i(_,{round:``,type:`primary`,size:`small`,loading:t.uploading},{default:p(()=>[i(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`producer.button.uploadAudios`)),1)]),_:1},8,[`loading`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.audioPreviewUrl?(g(),o(`div`,pt,[e(`audio`,{src:t.audioPreviewUrl,controls:``,class:`w-full`},null,8,mt)])):a(``,!0),t.hasUploadedAudio?(g(),o(`div`,ht,[i(b,{modelValue:t.uploadAction,"onUpdate:modelValue":s[1]||=e=>t.uploadAction=e,size:`small`},{default:p(()=>[i(y,{value:`upload_extend`},{default:p(()=>[n(r(t.$t(`producer.button.extend`)),1)]),_:1}),i(y,{value:`upload_cover`},{default:p(()=>[n(r(t.$t(`producer.button.cover_music`)),1)]),_:1})]),_:1},8,[`modelValue`])])):a(``,!0)])}var _t=W(ct,[[`render`,gt],[`__scopeId`,`data-v-3938abc2`]]),vt=v({name:`PromptInput`,components:{PromptTextarea:he},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||=``}});function yt(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`producer.name.songDescription`),info:e.$t(`producer.description.prompt`),placeholder:e.$t(`producer.placeholder.prompt`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var bt=W(vt,[[`render`,yt]]),xt=v({name:`LyricInput`,components:{MagicIcon:H,ElInput:Z,ElButton:J,InfoIcon:z},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential},walletMode(){return K()&&q(`producer`).mode===`wallet`}},mounted(){this.lyric||=``},methods:{paymentOptions(){if(!this.walletMode){let e=this.credential?.token;return e?{token:e}:void 0}let e=this.getWalletContext();if(!e){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}}},async onGenerateLyrics(){let e=this.paymentOptions();if(!e)return;let t=this.config?.style||this.config?.title||`a beautiful song`;this.generatingLyrics=!0,O.info(this.$t(`producer.message.generatingLyrics`));try{let n=(await Y.lyric({prompt:t},e)).data?.data;n?.text&&(this.lyric=n.text,n?.title&&!this.config?.title&&this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:n.text,title:n.title}),O.success(this.$t(`producer.message.generateLyricsSuccess`)))}catch(e){if(e instanceof Q)return;O.error(this.$t(`producer.message.generateLyricsFailed`))}finally{this.generatingLyrics=!1}},getWalletContext(){return X(this.$wallet)},async confirmWalletPayment(e){return $.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)}}}),St={class:`field`},Ct={class:`flex items-center justify-between mb-1`},wt={class:`flex items-center`},Tt={class:`text-sm font-bold`};function Et(t,s,c,u,d,m){let h=l(`info-icon`),_=l(`magic-icon`),v=l(`el-button`),y=l(`el-input`);return g(),o(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`span`,Tt,r(t.$t(`producer.name.lyrics`)),1),i(h,{content:t.$t(`producer.description.lyrics`)},null,8,[`content`])]),t.config?.action===`extend`?a(``,!0):(g(),f(v,{key:0,size:`small`,loading:t.generatingLyrics,round:``,onClick:t.onGenerateLyrics},{default:p(()=>[t.generatingLyrics?a(``,!0):(g(),f(_,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),n(` `+r(t.$t(`producer.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))]),t.config?.action===`extend`?(g(),f(y,{key:1,modelValue:t.lyric,"onUpdate:modelValue":s[1]||=e=>t.lyric=e,rows:5,type:`textarea`,class:`lyrics`,placeholder:t.$t(`producer.placeholder.extend.lyrics`)},null,8,[`modelValue`,`placeholder`])):(g(),f(y,{key:0,modelValue:t.lyric,"onUpdate:modelValue":s[0]||=e=>t.lyric=e,rows:5,type:`textarea`,class:`lyrics`,placeholder:t.$t(`producer.placeholder.lyrics`)},null,8,[`modelValue`,`placeholder`]))])}var Dt=W(xt,[[`render`,Et],[`__scopeId`,`data-v-548b9253`]]),Ot=v({name:`StyleInput`,components:{ElInput:Z,InfoIcon:z},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style:e})}}}}),kt={class:`field`},At={class:`flex items-center justify-between mb-1`},jt={class:`flex items-center`},Mt={class:`text-sm font-bold`};function Nt(t,n,a,s,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),o(`div`,kt,[e(`div`,At,[e(`div`,jt,[e(`span`,Mt,r(t.$t(`producer.name.style`)),1),i(d,{content:t.$t(`producer.description.style`)},null,8,[`content`])])]),i(f,{modelValue:t.style,"onUpdate:modelValue":n[0]||=e=>t.style=e,rows:2,type:`textarea`,placeholder:t.$t(`producer.placeholder.style`)},null,8,[`modelValue`,`placeholder`])])}var Pt=W(Ot,[[`render`,Nt]]),Ft=v({name:`TitleInput`,components:{ElInput:Z,InfoIcon:z},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,title:e})}}}}),It={class:`field`},Lt={class:`flex items-center mb-1`},Rt={class:`text-sm font-bold`};function zt(t,n,a,s,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),o(`div`,It,[e(`div`,Lt,[e(`span`,Rt,r(t.$t(`producer.name.title`)),1),i(d,{content:t.$t(`producer.description.title`)},null,8,[`content`])]),i(f,{modelValue:t.title,"onUpdate:modelValue":n[0]||=e=>t.title=e,placeholder:t.$t(`producer.placeholder.title`)},null,8,[`modelValue`,`placeholder`])])}var Bt=W(Ft,[[`render`,zt]]),Vt=v({name:`ExtendFromInput`,components:{ElImage:G,ElIcon:y,ElInputNumber:L,VideoPlay:V,VideoPause:B},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=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:R,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Ht={class:`field`},Ut={class:`box`},Wt={class:`title font-bold`},Gt={class:`input-wrapper`},Kt={class:`task`},qt={class:`left`},Jt=[`aria-label`,`title`],Yt=[`aria-label`,`title`],Xt={key:2,class:`duration`},Zt={class:`info`},Qt={class:`title`},$t={class:`style`};function en(n,c,d,f,h,_){let v=l(`el-input-number`),y=l(`el-image`),b=l(`video-pause`),x=l(`el-icon`),S=l(`video-play`),C=m(`loading`);return g(),o(`div`,Ht,[e(`div`,Ut,[e(`h2`,Wt,r(n.$t(`producer.name.extend`)),1),e(`div`,Gt,[i(v,{modelValue:n.value,"onUpdate:modelValue":c[0]||=e=>n.value=e,class:`value`,min:0,max:n.audio?.duration,controls:!1,placeholder:n.$t(`producer.placeholder.extend.continue_at`),onChange:n.handleChange},null,8,[`modelValue`,`max`,`placeholder`,`onChange`])])]),e(`div`,Kt,[n.audio?(g(),o(`div`,{key:0,class:`audio`,onClick:c[7]||=e=>n.onClick(n.audio)},[u((g(),o(`div`,qt,[i(y,{src:n.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),n.audio?.audio_url&&n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`playing`?(g(),o(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.pause`),title:n.$t(`common.player.pause`),onClick:c[1]||=e=>n.onPause(n.audio),onKeydown:[c[2]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`enter`]),c[3]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`space`])]},[i(x,null,{default:p(()=>[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Jt)):a(``,!0),n.audio?.audio_url&&(n.$store.state?.producer?.audio?.id!==n.audio.id||n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`paused`)?(g(),o(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.play`),title:n.$t(`common.player.play`),onClick:c[4]||=e=>n.onPlay(n.audio),onKeydown:[c[5]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`enter`]),c[6]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`space`])]},[i(x,null,{default:p(()=>[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Yt)):a(``,!0),n.audio?.duration?(g(),o(`div`,Xt,r(n.useFormatDuring(n.audio?.duration)),1)):a(``,!0)])),[[C,!n.audio?.audio_url]]),e(`div`,Zt,[e(`h2`,Qt,r(n.audio?.title),1),e(`p`,$t,r(n.audio?.style),1)])])):a(``,!0)])])}var tn=W(Vt,[[`render`,en],[`__scopeId`,`data-v-96005bd8`]]),nn=v({name:`CoverFromInput`,components:{ElImage:G,ElIcon:y,VideoPlay:V,VideoPause:B},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:R,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),rn={class:`field`},an={class:`box`},on={class:`title font-bold`},sn={class:`task`},cn={class:`left`},ln=[`aria-label`,`title`],un=[`aria-label`,`title`],dn={key:2,class:`duration`},fn={class:`info`},pn={class:`title`},mn={class:`style`};function hn(n,c,d,f,h,_){let v=l(`el-image`),y=l(`video-pause`),b=l(`el-icon`),x=l(`video-play`),S=m(`loading`);return g(),o(`div`,rn,[e(`div`,an,[e(`h2`,on,r(n.$t(`producer.name.cover`)),1)]),e(`div`,sn,[n.audio?(g(),o(`div`,{key:0,class:`audio`,onClick:c[6]||=e=>n.onClick(n.audio)},[u((g(),o(`div`,cn,[i(v,{src:n.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),n.audio?.audio_url&&n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`playing`?(g(),o(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.pause`),title:n.$t(`common.player.pause`),onClick:c[0]||=e=>n.onPause(n.audio),onKeydown:[c[1]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`enter`]),c[2]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`space`])]},[i(b,null,{default:p(()=>[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,ln)):a(``,!0),n.audio?.audio_url&&(n.$store.state?.producer?.audio?.id!==n.audio.id||n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`paused`)?(g(),o(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.play`),title:n.$t(`common.player.play`),onClick:c[3]||=e=>n.onPlay(n.audio),onKeydown:[c[4]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`enter`]),c[5]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`space`])]},[i(b,null,{default:p(()=>[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,un)):a(``,!0),n.audio?.duration?(g(),o(`div`,dn,r(n.useFormatDuring(n.audio?.duration)),1)):a(``,!0)])),[[S,!n.audio?.audio_url]]),e(`div`,fn,[e(`h2`,pn,r(n.audio?.title),1),e(`p`,mn,r(n.audio?.style),1)])])):a(``,!0)])])}var gn=W(nn,[[`render`,hn],[`__scopeId`,`data-v-9a4b0b16`]]),_n=v({name:`VocalGenderSelector`,components:{ElRadioGroup:j,ElRadioButton:A,InfoIcon:z},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),vn={class:`mb-2`},yn={class:`flex items-center mb-1`},bn={class:`text-sm font-bold`};function xn(t,a,s,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),o(`div`,vn,[e(`div`,yn,[e(`span`,bn,r(t.$t(`producer.name.vocalGender`)),1),i(f,{content:t.$t(`producer.description.vocalGender`)},null,8,[`content`])]),i(h,{modelValue:t.vocalGender,"onUpdate:modelValue":a[0]||=e=>t.vocalGender=e},{default:p(()=>[i(m,{value:``},{default:p(()=>[n(r(t.$t(`producer.gender.auto`)),1)]),_:1}),i(m,{value:`f`},{default:p(()=>[n(r(t.$t(`producer.gender.female`)),1)]),_:1}),i(m,{value:`m`},{default:p(()=>[n(r(t.$t(`producer.gender.male`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Sn=W(_n,[[`render`,xn]]),Cn=v({name:`AdvancedParams`,components:{ElCollapse:N,ElCollapseItem:M,ElInput:Z,ElSlider:re,ElInputNumber:L,InfoIcon:z},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??.5},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,weirdness:e})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,seed:e})}}},mounted(){let e=this.$store.state.producer?.config;if(!e)return;let t={};typeof e.weirdness==`number`&&e.weirdness>1&&(t.weirdness=e.weirdness/100),typeof e.sound_strength==`number`&&e.sound_strength>1&&(t.sound_strength=e.sound_strength/100),typeof e.lyrics_strength==`number`&&e.lyrics_strength>1&&(t.lyrics_strength=e.lyrics_strength/100),Object.keys(t).length>0&&this.$store.commit(`producer/setConfig`,{...e,...t})}}),wn={key:0,class:`mb-3`},Tn={class:`flex items-center mb-1`},En={class:`text-xs font-bold`},Dn={key:1,class:`mb-3`},On={class:`flex items-center mb-1`},kn={class:`text-xs font-bold`},An={class:`mb-3`},jn={class:`flex items-center justify-between mb-1`},Mn={class:`flex items-center`},Nn={class:`text-xs font-bold`},Pn={class:`text-xs text-[var(--el-text-color-secondary)]`},Fn={class:`mb-3`},In={class:`flex items-center justify-between mb-1`},Ln={class:`flex items-center`},Rn={class:`text-xs font-bold`},zn={class:`text-xs text-[var(--el-text-color-secondary)]`},Bn={key:2,class:`mb-3`},Vn={class:`flex items-center justify-between mb-1`},Hn={class:`flex items-center`},Un={class:`text-xs font-bold`},Wn={class:`text-xs text-[var(--el-text-color-secondary)]`},Gn={class:`mb-3`},Kn={class:`flex items-center mb-1`},qn={class:`text-xs font-bold`};function Jn(t,n,s,c,u,d){let m=l(`info-icon`),h=l(`el-input`),_=l(`el-slider`),v=l(`el-input-number`),y=l(`el-collapse-item`),b=l(`el-collapse`);return g(),f(b,{modelValue:t.activeNames,"onUpdate:modelValue":n[6]||=e=>t.activeNames=e,class:`advanced-collapse`},{default:p(()=>[i(y,{title:t.$t(`producer.name.advancedParams`),name:`advanced`},{default:p(()=>[t.config?.custom?(g(),o(`div`,wn,[e(`div`,Tn,[e(`span`,En,r(t.$t(`producer.name.styleNegative`)),1),i(m,{content:t.$t(`producer.description.styleNegative`)},null,8,[`content`])]),i(h,{modelValue:t.styleNegative,"onUpdate:modelValue":n[0]||=e=>t.styleNegative=e,size:`small`,placeholder:t.$t(`producer.placeholder.styleNegative`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),t.config?.custom&&!t.config?.instrumental?(g(),o(`div`,Dn,[e(`div`,On,[e(`span`,kn,r(t.$t(`producer.name.lyricPrompt`)),1),i(m,{content:t.$t(`producer.description.lyricPrompt`)},null,8,[`content`])]),i(h,{modelValue:t.lyricPrompt,"onUpdate:modelValue":n[1]||=e=>t.lyricPrompt=e,size:`small`,placeholder:t.$t(`producer.placeholder.lyricPrompt`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),e(`div`,An,[e(`div`,jn,[e(`div`,Mn,[e(`span`,Nn,r(t.$t(`producer.name.weirdness`)),1),i(m,{content:t.$t(`producer.description.weirdness`)},null,8,[`content`])]),e(`span`,Pn,r(t.weirdness??.5),1)]),i(_,{modelValue:t.weirdness,"onUpdate:modelValue":n[2]||=e=>t.weirdness=e,min:0,max:1,step:.01},null,8,[`modelValue`])]),e(`div`,Fn,[e(`div`,In,[e(`div`,Ln,[e(`span`,Rn,r(t.$t(`producer.name.soundStrength`)),1),i(m,{content:t.$t(`producer.description.soundStrength`)},null,8,[`content`])]),e(`span`,zn,r(t.soundStrength??.7),1)]),i(_,{modelValue:t.soundStrength,"onUpdate:modelValue":n[3]||=e=>t.soundStrength=e,min:.2,max:1,step:.01},null,8,[`modelValue`])]),t.config?.custom&&!t.config?.instrumental?(g(),o(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,r(t.$t(`producer.name.lyricsStrength`)),1),i(m,{content:t.$t(`producer.description.lyricsStrength`)},null,8,[`content`])]),e(`span`,Wn,r(t.lyricsStrength??.7),1)]),i(_,{modelValue:t.lyricsStrength,"onUpdate:modelValue":n[4]||=e=>t.lyricsStrength=e,min:0,max:1,step:.01},null,8,[`modelValue`])])):a(``,!0),e(`div`,Gn,[e(`div`,Kn,[e(`span`,qn,r(t.$t(`producer.name.seed`)),1),i(m,{content:t.$t(`producer.description.seed`)},null,8,[`content`])]),i(v,{modelValue:t.seed,"onUpdate:modelValue":n[5]||=e=>t.seed=e,min:0,controls:!1,size:`small`,placeholder:t.$t(`producer.placeholder.seed`),class:`w-full`},null,8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Yn=W(Cn,[[`render`,Jn],[`__scopeId`,`data-v-f9296888`]]),Xn=v({name:`ReplaceSectionInput`,components:{ElInputNumber:L,ElImage:G,InfoIcon:z},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`})}}}),Zn={class:`field`},Qn={class:`flex items-center mb-2`},$n={class:`text-sm font-bold m-0`},er={key:0,class:`task mb-2`},tr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},nr={class:`info flex-1 min-w-0`},rr={class:`text-sm font-bold m-0 truncate`},ir={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},ar={class:`flex gap-2`};function or(t,n,s,c,d,f){let p=l(`info-icon`),h=l(`el-image`),_=l(`el-input-number`),v=m(`loading`);return g(),o(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,r(t.$t(`producer.name.replaceSection`)),1),i(p,{content:t.$t(`producer.description.replaceSection`)},null,8,[`content`])]),t.audio?(g(),o(`div`,er,[e(`div`,{class:`audio flex items-center`,onClick:n[0]||=e=>t.onClick(t.audio)},[u((g(),o(`div`,tr,[i(h,{src:t.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!t.audio?.audio_url]]),e(`div`,nr,[e(`h2`,rr,r(t.audio?.title),1),e(`p`,ir,r(t.audio?.style),1)])])])):a(``,!0),e(`div`,ar,[i(_,{modelValue:t.replaceSectionStart,"onUpdate:modelValue":n[1]||=e=>t.replaceSectionStart=e,class:`flex-1`,min:0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`producer.placeholder.replaceSectionStart`)},null,8,[`modelValue`,`max`,`placeholder`]),i(_,{modelValue:t.replaceSectionEnd,"onUpdate:modelValue":n[2]||=e=>t.replaceSectionEnd=e,class:`flex-1`,min:t.replaceSectionStart||0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`producer.placeholder.replaceSectionEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var sr=v({name:`PresetPanel`,components:{CleanupIcon:ae,MagicIcon:H,TypeSelector:st,PromptInput:bt,LyricInput:Dt,StyleInput:Pt,TitleInput:Bt,ExtendFromInput:tn,CoverFromInput:gn,UploadAudio:_t,VocalGenderSelector:Sn,AdvancedParams:Yn,ReplaceSectionInput:W(Xn,[[`render`,or]]),ElButton:J,ElTabs:S,ElTabPane:C,ServicePricingSummary:Ie,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return He(`producer`,U(this.config))},config(){return this.$store.state.producer?.config},mode:{get(){return this.$store.state.producer?.config?.custom?`custom`:`simple`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e===`custom`})}},consumption(){return we(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},walletMode(){return K()&&q(`producer`).mode===`wallet`},generateButtonText(){let e=this.config?.action;return e===`extend`||e===`upload_extend`?this.$t(`producer.button.extend`):e===`cover`||e===`upload_cover`?this.$t(`producer.button.cover_music`):e===`variation`?this.$t(`producer.button.variation`):e===`replace_section`?this.$t(`producer.button.replace_section`):e===`stems`?this.$t(`producer.button.get_stems`):e===`swap_vocals`?this.$t(`producer.button.swap_vocals`):e===`swap_instrumentals`?this.$t(`producer.button.swap_instrumentals`):this.$t(`producer.button.generate`)}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=q(`producer`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=q(`producer`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await Y.quoteAudio(U(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)},onClearAll(){this.$store.commit(`producer/setConfig`,{custom:this.$store.state.producer?.config?.custom||!1,instrumental:!1,prompt:``,lyric:``,style:``,title:``,model:this.$store.state.producer?.config?.model})}}}),cr={class:`flex flex-col h-full`},lr={class:`flex-1 min-h-0 overflow-hidden`},ur={class:`p-5`},dr={class:`p-5`},fr={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},pr={class:`flex gap-2 w-full`};function mr(t,s,c,u,d,m){let h=l(`type-selector`),_=l(`upload-audio`),v=l(`prompt-input`),y=l(`extend-from-input`),b=l(`cover-from-input`),x=l(`replace-section-input`),S=l(`advanced-params`),C=l(`el-tab-pane`),w=l(`lyric-input`),T=l(`style-input`),E=l(`title-input`),D=l(`vocal-gender-selector`),O=l(`el-tabs`),k=l(`scenario-payment-mode`),A=l(`service-pricing-summary`),j=l(`cleanup-icon`),M=l(`el-button`),N=l(`magic-icon`);return g(),o(`div`,cr,[e(`div`,lr,[i(O,{modelValue:t.mode,"onUpdate:modelValue":s[0]||=e=>t.mode=e,class:`producer-mode-tabs scenario-tabs scenario-tabs--scrollable scenario-tabs--divided`},{default:p(()=>[i(C,{label:t.$t(`producer.mode.simple`),name:`simple`},{default:p(()=>[e(`div`,ur,[i(h,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),t.config?.action===`extend`?(g(),f(y,{key:0,class:`mb-4`})):a(``,!0),t.config?.action===`cover`?(g(),f(b,{key:1,class:`mb-4`})):a(``,!0),t.config?.action===`replace_section`?(g(),f(x,{key:2,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`]),i(C,{label:t.$t(`producer.mode.custom`),name:`custom`},{default:p(()=>[e(`div`,dr,[i(h,{class:`mb-4`}),i(_,{class:`mb-4`}),t.config?.instrumental?a(``,!0):(g(),f(w,{key:0,class:`mb-4`})),i(T,{class:`mb-4`}),i(E,{class:`mb-4`}),t.config?.instrumental?a(``,!0):(g(),f(D,{key:1,class:`mb-4`})),t.config?.action===`extend`?(g(),f(y,{key:2,class:`mb-4`})):a(``,!0),t.config?.action===`cover`?(g(),f(b,{key:3,class:`mb-4`})):a(``,!0),t.config?.action===`replace_section`?(g(),f(x,{key:4,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,fr,[i(k,{scenario:`producer`}),t.walletMode?a(``,!0):(g(),f(A,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),e(`div`,pr,[i(M,{class:`flex-1`,onClick:t.onClearAll},{default:p(()=>[i(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`producer.button.clear_all`)),1)]),_:1},8,[`onClick`]),i(M,{type:`primary`,class:`flex-1`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[i(N,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.generateButtonText),1)]),_:1},8,[`disabled`,`onClick`])])])])}var hr=W(sr,[[`render`,mr],[`__scopeId`,`data-v-647162cb`]]),gr=oe(),_r=v({name:`TaskPreview`,components:{ChannelIcon:de,CodeIcon:ce,DownloadIcon:le,InfoIcon:pe,MagicIcon:H,MoreIcon:ue,WarningIcon:ye,ElAlert:E,ElImage:G,ElIcon:y,ElTooltip:T,VideoPlay:V,VideoPause:B,ElDropdown:I,ElDropdownMenu:F,ElDropdownItem:P,Loading:me,ApiCodeDialog:Re,ReportDialog:Pe,CopyToClipboard:Ne},props:{modelValue:{type:Object,required:!0}},emits:[`wallet-task`],data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,apiCodeVisible:!1,reportVisible:!1,reportTargetId:``,reportSnapshot:void 0,apiCodePath:`/producer/audios`,apiCodeBody:{}}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===D.Request},showViewCode(){return xe()},credential(){return this.$store.state.producer.credential},walletMode(){return K()&&q(`producer`).mode===`wallet`},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){let e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(e=>({...e,action:t})):e},isFailure(){return this.audios.length===0&&(this.modelValue?.response?.success===!1||!!this.modelValue?.response?.error)},failureReason(){let e=this.modelValue?.response?.error;return typeof e==`string`?e:e?.message},traceId(){return this.modelValue?.response?.trace_id||this.modelValue?.trace_id},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{paymentOptions(){if(!this.walletMode){let e=this.credential?.token;return e?{token:e}:void 0}let e=this.getWalletContext();if(!e){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}}},getWalletContext(){return X(this.$wallet)},async confirmWalletPayment(e){return $.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},onReport(e){this.reportTargetId=e?.id||``,this.reportSnapshot={prompt:e?.prompt,title:e?.title},this.reportVisible=!0},useFormatDuring:R,onViewCode(){let e=this.modelValue?.request||{},t={};Object.entries(e).forEach(([e,n])=>{e===`application_id`||e===`callback_url`||n!=null&&(typeof n==`string`&&n===``||Array.isArray(n)&&n.length===0||(t[e]=n))}),this.apiCodeBody=t,this.apiCodePath=`/producer/audios`,this.apiCodeVisible=!0},onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e?.stopPropagation(),console.debug(`set config`,t),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:`extend`,audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e&&e?.stopPropagation();let n=new URL(t).pathname,r=n.substring(n.lastIndexOf(`/`)+1);fetch(t).then(e=>e.blob()).then(e=>{(0,gr.saveAs)(e,r)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;let t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(e){if(e instanceof Q)return;console.error(`get videoUrl failed:`,e),O.error(this.$t(`producer.message.getVideoUrlFailed`))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,n)=>{let r={audio_id:e},i=this.paymentOptions();if(!i)return n(new Q);Y.video(r,i).then(e=>{let r=e.data?.data?.video_url;r?t(r):n(Error(`Video URL not found in response`))}).catch(e=>{n(e)})})},onPreview(e,t){e?.stopPropagation(),window.open(t,`_blank`)},async onGetStems(e){await this.onGenerateAudioUrl(`stems`,e)},onCover(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`cover`,audio:e,audio_id:e.id})},onVariation(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:`variation`,audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl(`swap_vocals`,e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl(`swap_instrumentals`,e)},async onGetAllStems(e){await this.onGenerateAudioUrl(`all_stems`,e)},onReplaceSection(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`replace_section`,audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;let t=this.paymentOptions();if(t)try{this.isFetchingWav=!0,O.info(this.$t(`producer.message.fetchingWav`));let n=(await Y.wav({audio_id:e.id},t)).data?.data,r=Array.isArray(n)?n[0]?.file_url:n?.file_url||n?.audio_url;r?this.onDownload(null,r):O.error(this.$t(`producer.message.fetchWavFailed`))}catch(e){if(e instanceof Q)return;O.error(this.$t(`producer.message.fetchWavFailed`))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){let n={action:e,audio_id:t,async:!0},r=this.paymentOptions();r&&(O.info(this.$t(`producer.message.startingTask`)),Y.audio(n,r).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&this.$emit(`wallet-task`,t),O.success(this.$t(`producer.message.startTaskSuccess`))}).catch(e=>{e instanceof Q||O.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`))}))},async onScrollDown(){setTimeout(()=>{let e=document.querySelector(`.tasks`);e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug(`loading`);return}await this.$store.dispatch(`producer/getTasks`,{limit:30,offset:0})}}}),vr={class:`task`},yr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},br={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Sr=[`onClick`],Cr={class:`left`},wr=[`aria-label`,`title`,`onClick`,`onKeydown`],Tr=[`aria-label`,`title`,`onClick`,`onKeydown`],Er={key:2,class:`duration`},Dr={class:`info`},Or={class:`title`},kr={class:`style`},Ar={class:`right`},jr={class:`el-dropdown-link`},Mr={class:`flex items-center min-w-[120px]`},Nr={class:`flex items-center min-w-[120px]`},Pr={class:`el-dropdown-link`};function Fr(d,_,v,y,b,x){let S=l(`warning-icon`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`info-icon`),E=l(`channel-icon`),D=l(`el-alert`),O=l(`el-image`),k=l(`video-pause`),A=l(`el-icon`),j=l(`video-play`),M=l(`download-icon`),N=l(`el-tooltip`),ee=l(`Loading`),P=l(`el-dropdown-item`),F=l(`el-dropdown-menu`),I=l(`el-dropdown`),L=l(`more-icon`),te=l(`code-icon`),ne=l(`api-code-dialog`),re=l(`report-dialog`),ie=m(`loading`);return g(),o(`div`,vr,[d.isFailure?(g(),f(D,{key:0,closable:!1,class:`task-failure`},{title:p(()=>[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.failure`)),1)]),default:p(()=>[e(`p`,yr,[i(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.taskId`))+`: `+r(d.modelValue?.id)+` `,1),i(w,{content:d.modelValue?.id},null,8,[`content`])]),d.failureReason?(g(),o(`p`,br,[i(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.failureReason`))+`: `+r(d.failureReason)+` `,1),i(w,{content:d.failureReason},null,8,[`content`])])):a(``,!0),d.traceId?(g(),o(`p`,xr,[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.traceId`))+`: `+r(d.traceId)+` `,1),i(w,{content:d.traceId},null,8,[`content`])])):a(``,!0)]),_:1})):a(``,!0),(g(!0),o(c,null,h(d.audios,c=>(g(),o(`div`,{key:c.id,class:`audio`,onClick:t(e=>d.onClick(c),[`stop`])},[u((g(),o(`div`,Cr,[i(O,{src:c?.image_url,class:`cover`,fit:`cover`,lazy:``},null,8,[`src`]),c?.audio_url&&d.$store.state?.producer?.audio?.id===c.id&&d.$store.state?.producer?.audio?.state===`playing`?(g(),o(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":d.$t(`common.player.pause`),title:d.$t(`common.player.pause`),onClick:t(e=>d.onPause(c),[`stop`]),onKeydown:[s(t(e=>d.onPause(c),[`stop`,`prevent`]),[`enter`]),s(t(e=>d.onPause(c),[`stop`,`prevent`]),[`space`])]},[i(A,null,{default:p(()=>[i(k,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,wr)):a(``,!0),c?.audio_url&&(d.$store.state?.producer?.audio?.id!==c.id||d.$store.state?.producer?.audio?.id===c.id&&d.$store.state?.producer?.audio?.state===`paused`)?(g(),o(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":d.$t(`common.player.play`),title:d.$t(`common.player.play`),onClick:t(e=>d.onPlay(c),[`stop`]),onKeydown:[s(t(e=>d.onPlay(c),[`stop`,`prevent`]),[`enter`]),s(t(e=>d.onPlay(c),[`stop`,`prevent`]),[`space`])]},[i(A,null,{default:p(()=>[i(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Tr)):a(``,!0),c?.duration?(g(),o(`div`,Er,r(d.useFormatDuring(c?.duration)),1)):a(``,!0)])),[[ie,!c?.audio_url]]),e(`div`,Dr,[e(`h2`,Or,r(c?.title),1),e(`p`,kr,r(c?.style),1)]),e(`div`,Ar,[i(I,null,{dropdown:p(()=>[i(F,null,{default:p(()=>[i(P,{disabled:d.isFetchingVideoUrl,onClick:e=>d.handleVideoDownload(c)},{default:p(()=>[e(`div`,Mr,[d.isFetchingVideoUrl?(g(),f(A,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(ee,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):a(``,!0),e(`span`,null,r(d.$t(`producer.button.download_video`)),1)])]),_:1},8,[`disabled`,`onClick`]),c?.audio_url?(g(),f(P,{key:0,onClick:t(e=>d.onDownload(e,c?.audio_url),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.download_audio`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(P,{disabled:d.isFetchingWav,onClick:e=>d.handleWavDownload(c)},{default:p(()=>[e(`div`,Nr,[d.isFetchingWav?(g(),f(A,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(ee,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):a(``,!0),e(`span`,null,r(d.$t(`producer.button.download_wav`)),1)])]),_:1},8,[`disabled`,`onClick`])]),_:2},1024)]),default:p(()=>[e(`span`,jr,[i(N,{effect:`dark`,content:d.$t(`common.button.download`),placement:`top`},{default:p(()=>[c?.audio_url||c?.video_url?(g(),f(M,{key:0,class:`icon icon-download`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024),i(I,null,{dropdown:p(()=>[i(F,null,{default:p(()=>[c?.audio_url?(g(),f(P,{key:0,onClick:t(e=>d.onExtend(e,c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.extend`)),1)]),_:1},8,[`onClick`])):a(``,!0),c.id?(g(),f(P,{key:1,onClick:t(e=>d.onGetStems(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.get_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),c.id?(g(),f(P,{key:2,onClick:t(e=>d.onGetAllStems(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.all_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(P,{onClick:t(e=>d.onCover(c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.cover_music`)),1)]),_:1},8,[`onClick`]),c?.id?(g(),f(P,{key:3,onClick:t(e=>d.onVariation(c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.variation`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(P,{key:4,onClick:t(e=>d.onSwapVocals(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.swap_vocals`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(P,{key:5,onClick:t(e=>d.onSwapInstrumentals(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.swap_instrumentals`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(P,{key:6,onClick:t(e=>d.onReplaceSection(c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.replace_section`)),1)]),_:1},8,[`onClick`])):a(``,!0),d.showViewCode?(g(),f(P,{key:7,onClick:t(d.onViewCode,[`stop`])},{default:p(()=>[i(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`common.button.viewCode`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(P,{key:8,onClick:t(e=>d.onReport(c),[`stop`])},{default:p(()=>[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`common.button.report`)),1)]),_:1},8,[`onClick`])):a(``,!0)]),_:2},1024)]),default:p(()=>[e(`span`,Pr,[i(N,{effect:`dark`,content:d.$t(`producer.button.more`),placement:`top`},{default:p(()=>[c?.audio_url||c?.video_url?(g(),f(L,{key:0,class:`icon icon-ellipsis`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024)])],8,Sr))),128)),i(ne,{visible:d.apiCodeVisible,"onUpdate:visible":_[0]||=e=>d.apiCodeVisible=e,method:`POST`,path:d.apiCodePath,body:d.apiCodeBody,token:d.$store.state.producer?.credential?.token||``},null,8,[`visible`,`path`,`body`,`token`]),i(re,{visible:d.reportVisible,"onUpdate:visible":_[1]||=e=>d.reportVisible=e,service:`producer`,"target-id":d.reportTargetId,snapshot:d.reportSnapshot},null,8,[`visible`,`target-id`,`snapshot`])])}var Ir=v({name:`RecentPanel`,components:{ElSkeletonItem:te,ElSkeleton:ne,TaskPreview:W(_r,[[`render`,Fr]]),Player:se,NoTasks:_e,ScrollList:ge},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`wallet-task`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Lr={key:0,class:`tasks`},Rr={class:`left w-[70px] p-[10px] flex items-center`},zr={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},Br={key:2,class:`w-full flex-1 flex items-center justify-center`},Vr={class:`h-20`};function Hr(t,n,r,s,d,m){let v=l(`el-skeleton-item`),y=l(`el-skeleton`),b=l(`task-preview`),x=l(`scroll-list`),S=l(`no-tasks`),C=l(`player`);return g(),o(c,null,[t.tasks?.items===void 0?(g(),o(`div`,Lr,[(g(),o(c,null,h(3,t=>e(`div`,{key:t,class:`flex`},[e(`div`,Rr,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),e(`div`,zr,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`p`,class:`w-[200px] h-[15px] mb-[5px] mt-[10px]`}),i(v,{variant:`text`})]),_:1})])])),64))])):t.tasks?.items?.length&&t.tasks?.items?.length>0?(g(),f(x,{key:1,ref:`scrollList`,class:`flex-1 w-full overflow-y-auto tasks p-2`,loading:t.loading,onReachTop:n[1]||=e=>t.$emit(`reach-top`)},{default:p(()=>[(g(!0),o(c,null,h(t.tasks?.items,(e,r)=>(g(),f(b,{key:r,"model-value":e,class:`preview`,onWalletTask:n[0]||=e=>t.$emit(`wallet-task`,e)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),t.tasks?.items?.length===0?(g(),o(`div`,Br,[i(S)])):a(``,!0),u(e(`div`,Vr,[i(C,{namespace:`producer`})],512),[[_,!!t.$store?.state?.producer?.audio?.object]])],64)}var Ur=W(Ir,[[`render`,Hr]]),Wr=v({name:`TaskPreview`,components:{IconPicture:fe,ElImage:G,ElAvatar:k,ElIcon:y},computed:{audio(){return this.$store.state.producer?.audio}}}),Gr={key:0,class:`size-full overflow-hidden`},Kr={class:`relative h-[300px]`},qr={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},Jr={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`},Yr={class:`p-4`},Xr={class:`flex items-center font-bold mb-2`},Zr={class:`text-[var(--el-text-color-regular)] mb-2`},Qr={class:`text-xs text-[var(--el-text-color-regular)]`},$r={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},ei={key:1,class:`w-full h-full`};function ti(t,n,a,s,c,u){let d=l(`icon-picture`),f=l(`el-icon`),m=l(`el-image`),h=l(`el-avatar`);return t.audio?.object?(g(),o(`div`,Gr,[e(`div`,Kr,[i(m,{src:t.audio.image_url,fit:`cover`,class:`size-full`},{error:p(()=>[e(`div`,qr,[i(f,{class:`text-3xl`},{default:p(()=>[i(d,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})])]),_:1},8,[`src`]),e(`h2`,Jr,r(t.audio?.title),1)]),e(`div`,Yr,[e(`div`,Xr,[i(h,{size:30,src:t.audio?.image_url,class:`mr-2`},null,8,[`src`]),e(`span`,null,r(t.audio?.title),1)]),e(`p`,Zr,r(t.audio?.style),1),e(`p`,Qr,r(t.$dayjs.format(t.audio?.created_at)),1),e(`div`,$r,[e(`p`,null,r(t.audio?.lyric),1)])])])):(g(),o(`div`,ei))}var ni=v({name:`ProducerIndex`,components:{Layout:Ye,ConfigPanel:hr,RecentPanel:Ur,PreviewPanel:W(Wr,[[`render`,ti]])},mixins:[Ae,Be(`producer`),ze(`producer`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===D.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===D.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===D.Request},needApply(){return this.$store.state.producer.status.getApplications===D.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.applications},walletMode(){return K()&&q(`producer`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`producer/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ve({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`producer/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`producer/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){Te.create({application:this.application}).then(({data:e})=>{this.application=e,O.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&O.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`producer/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){let e=U(this.config),t=Ve(`producer`,e);if(t){O.error(this.$t(`common.message.${t}`));return}if(!Ee(this.uploadTracker,e=>this.$t(e),e=>O.warning(e)))return;let n=this.createPaymentOperation(t=>Y.audio(e,t));if(n){O.info(this.$t(`producer.message.startingTask`));try{let e=await ke(`producer`,n);this.recordWalletTask(e),O.success(this.$t(`producer.message.startTaskSuccess`))}catch(e){this.handlePaymentError(e)}finally{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}}},createPaymentOperation(e){if(!this.walletMode){if(!je())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){this.onWalletTask(e?.data?.task_id)},onWalletTask(e){this.walletMode&&!this.credential?.token&&e&&!this.walletTaskIds.includes(e)&&this.walletTaskIds.unshift(e)},handlePaymentError(e){e instanceof Q||(this.walletMode?O.error(this.$t(`common.x402Scenario.paymentFailed`)):O.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`)))},getWalletContext(){return X(this.$wallet)},async confirmWalletPayment(e){return $.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ri(e,t,n,r,a,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`preview-panel`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[i(s,{onGenerate:e.onGenerateAudio},null,8,[`onGenerate`])]),result:p(()=>[i(c,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop,onWalletTask:e.onWalletTask},null,8,[`loading`,`onReachTop`,`onWalletTask`])]),preview:p(()=>[i(u)]),_:1})}var ii=W(ni,[[`render`,ri],[`__scopeId`,`data-v-ae7b5900`]]);export{ii as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-DpCwbg2P.js";import{n as x,t as S}from"./tabs-DRQeG1Ya.js";import{t as C}from"./upload-DNSrVlZy.js";import{t as w}from"./tooltip-CBYmo1Dy.js";import{t as T}from"./alert-BprQRUmf.js";import{_ as E,v as D}from"./vuex.esm-bundler-LBWCZBn7.js";import{t as O}from"./drawer-DkbSBBLh.js";import{t as k}from"./switch-D3WZiAvp.js";import{t as A}from"./box-BELXS1Xk.js";import{t as j}from"./clock-D-MIHQUu.js";import{t as M}from"./hash-XGo8nwFc.js";import{t as N}from"./info-DiJCV4qJ.js";import{t as P}from"./languages-cyvc2npG.js";import{a as F,i as I,n as L,o as R,r as ee,t as z}from"./pagination-19y2LGQl.js";import{t as B}from"./trash-2-COs0p2Nt.js";import{t as V}from"./triangle-alert-Bepd3LHY.js";import{t as te}from"./upload-3n-8FFny.js";import{t as H}from"./wand-sparkles-DAxQpus4.js";import{t as ne}from"./zap-DOKxH-m_.js";import{Ei as re,Ti as ie,wi as ae}from"./constants-WMYSVfpe.js";import{Ar as oe,D as U,Mi as W,Mr as G,Na as K,Or as q,Pi as J,Qa as Y,T as se,Tn as ce,at as le,ct as ue,jr as de,kr as X,lt as fe,oi as pe,ot as me,qi as he,ri as ge,st as _e,ta as ve,tt as ye,za as Z}from"./index-DNgm0O4R.js";import{t as be}from"./CopyToClipboard-CnWeQakr.js";import{t as xe}from"./ReportButton-B7cDB8LW.js";import{t as Q}from"./ImagePreview-DzG8rluG.js";import{n as Se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ce}from"./ServicePricingSummary-BI_c3bg7.js";import{t as we}from"./VideoPlayer-B1ohzmMz.js";import{t as Te}from"./ScenarioPaymentMode-CxM3rfl_.js";import{t as Ee}from"./ApiCodeButton-D1lki4F_.js";import{t as De}from"./BotPlaceholder-9sRMAfGp.js";import{t as Oe}from"./taskPollingMixin-CcLxtz8z.js";import{t as ke}from"./ShowcaseResultTabs-CHdyEJpt.js";import{t as Ae}from"./showcaseRecreateMixin-CXfW6PxO.js";import{n as je,t as Me}from"./generationInput-DCC9j_iS.js";var Ne=v({name:`LayoutVeo`,components:{MagicIcon:H,ElDrawer:O,ElButton:Y},mixins:[Se]}),Pe={class:`main flex flex-row flex-1`},Fe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ie={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Le(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Pe,[e(`div`,Fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ie,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Re=U(Ne,[[`render`,Le],[`__scopeId`,`data-v-c990ae5b`]]),ze=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},computed:{isModelLocked(){return this.$store.state.veo?.config?.action===`ingredients2video`},options(){return this.isModelLocked?[{value:de,label:`Veo 3.1 Fast`}]:oe},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||=re}}),Be={class:`field`},Ve={class:`title font-bold`};function He(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Be,[e(`h2`,Ve,i(t.$t(`veo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),disabled:t.isModelLocked},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var Ue=U(ze,[[`render`,He],[`__scopeId`,`data-v-90ed8cff`]]),We=v({name:`ActionSelector`,components:{ElTabs:x,ElTabPane:S},data(){return{}},computed:{options(){return[{value:`text2video`,label:this.$t(`veo.button.action1`)},{value:`image2video`,label:this.$t(`veo.button.action2`)},{value:`ingredients2video`,label:this.$t(`veo.button.actionIngredients`)}]},value(){return this.$store.state.veo?.config?.action||`text2video`}},mounted(){this.$store.state.veo?.config?.action||this.onUpdate(ae)},methods:{onUpdate(e){this.$store.commit(`veo/setConfig`,G(this.$store.state.veo?.config,e))}}}),Ge={class:`tab-label`},Ke={class:`text`};function qe(t,n,r,a,o,u){let d=l(`el-tab-pane`),m=l(`el-tabs`);return g(),f(m,{"model-value":t.value,class:`action-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(d,{key:t.value,name:t.value},{label:p(()=>[e(`span`,Ge,[e(`span`,Ke,i(t.label),1)])]),_:2},1032,[`name`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Je=U(We,[[`render`,qe],[`__scopeId`,`data-v-c72fb85c`]]),Ye=v({name:`TranslationSelector`,components:{ElSwitch:k,InfoIcon:F},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug(`set translation`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Xe={class:`relative`},Ze={class:`flex justify-between`},Qe={class:`flex justify-start items-center`},$e={class:`text-sm font-bold`},et={class:`flex justify-end items-center`};function tt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`span`,$e,i(t.$t(`veo.name.translation`)),1),a(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,et,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var nt=U(Ye,[[`render`,tt]]),rt=v({name:`AspectRatioSelector`,data(){return{options:[{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||=ie}}),it={class:`text-sm font-bold mb-2 block`},at={class:`items`},ot=[`onClick`],st={class:`name`};function ct(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,it,i(t.$t(`veo.name.ratio`)),1),e(`div`,at,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,st,i(r.label),1)],10,ot))),128))])])}var lt=U(rt,[[`render`,ct],[`__scopeId`,`data-v-28c472c4`]]),ut=v({name:`StartEndImage`,components:{UploadIcon:te,ElUpload:C,ElButton:Y,InfoIcon:F,ImagePreview:Q},mixins:[fe,ue,me,ye],props:{limit:{type:Number,default:2},ingredients:{type:Boolean,default:!1}},emits:[`change`],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},title(){return this.ingredients?this.$t(`veo.button.actionIngredients`):this.$t(`veo.name.startEndImage`)},description(){return this.ingredients?this.$t(`veo.description.imageUrl`):this.$t(`veo.description.uploadStartEndImage`)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(e=>!!e)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},watch:{limit(){this.fileList.length>this.limit&&(this.fileList=this.fileList.slice(0,this.limit),this.onSetStartEndImageUrl())}},mounted(){this.fileList=(this.value||[]).map((e,t)=>({name:`reference-${t+1}`,percentage:100,response:{file_url:e},status:`success`,uid:Date.now()+t,url:e}))},methods:{onExceed(){D.warning(this.$t(`veo.message.uploadReferencesLimit`,{limit:this.limit}))},onError(){D.error(this.$t(`veo.message.uploadReferencesError`))},onSetStartEndImageUrl(){let e=this.urls;this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()},onRemove(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onSetStartEndImageUrl()}}}),dt={class:`relative`},ft={class:`flex justify-between`},pt={class:`flex justify-start items-center`},mt={class:`text-sm font-bold`};function ht(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,dt,[e(`div`,ft,[e(`div`,pt,[e(`span`,mt,i(t.title),1),a(h,{content:t.description},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.limit,class:`upload-wrapper`,multiple:!0,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var gt=U(ut,[[`render`,ht],[`__scopeId`,`data-v-a4391199`]]),_t=v({name:`PromptInput`,components:{PromptTextarea:I},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function vt(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`veo.name.prompt`),info:e.$t(`veo.description.prompt`),placeholder:e.$t(`veo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var yt=v({name:`ConfigPanel`,components:{MagicIcon:H,ElButton:Y,ServicePricingSummary:Ce,PromptInput:U(_t,[[`render`,vt]]),ModelSelector:Ue,StartEndImage:gt,ActionSelector:Je,TranslationSelector:nt,AspectRatioSelector:lt,ScenarioPaymentMode:Te},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return Me(`veo`,q(this.config))},config(){return this.$store.state.veo?.config},showsImages(){return this.config?.action===`image2video`||this.config?.action===`ingredients2video`},imageLimit(){return this.config?.action===`ingredients2video`?3:2},consumption(){return ce(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},walletMode(){return W()&&J(`veo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=J(`veo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=J(`veo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quote(q(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),bt={class:`flex flex-col h-full`},xt={class:`flex-1 overflow-y-auto p-5`},St={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ct(t,n,c,u,d,m){let h=l(`action-selector`),_=l(`model-selector`),v=l(`start-end-image`),y=l(`prompt-input`),b=l(`aspect-ratio-selector`),x=l(`translation-selector`),S=l(`scenario-payment-mode`),C=l(`service-pricing-summary`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,bt,[e(`div`,xt,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),t.showsImages?(g(),f(v,{key:t.config?.action,class:`mb-4`,limit:t.imageLimit,ingredients:t.config?.action===`ingredients2video`},null,8,[`limit`,`ingredients`])):o(``,!0),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`})]),e(`div`,St,[a(S,{scenario:`veo`}),t.walletMode?o(``,!0):(g(),f(C,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(T,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`veo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var wt=U(yt,[[`render`,Ct]]),Tt=v({name:`TaskPreview`,components:{DeleteIcon:B,ApplicationIcon:A,ChannelIcon:M,ExpandIcon:R,InfoIcon:N,LanguageIcon:P,LightningIcon:ne,MagicIcon:H,TimeIcon:j,WarningIcon:V,CopyToClipboard:be,ElAlert:T,VideoPlayer:we,ImagePreview:Q,ElTooltip:w,ElButton:Y,ApiCodeButton:Ee,ReportButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{referenceImages(){let e=this.modelValue?.request?.image_urls;return Array.isArray(e)?e.filter(e=>typeof e==`string`&&!!e):[]},actionLabel(){let e=this.modelValue?.request,t=e?.model===`veo31-fast-ingredients`||this.referenceImages.length>2?`ingredients2video`:this.referenceImages.length>0?`image2video`:`text2video`,n=e?.action||t;return this.$t({text2video:`veo.button.action1`,image2video:`veo.button.action2`,ingredients2video:`veo.button.actionIngredients`}[n]||`veo.name.action`)},traceId(){return this.modelValue?.response?.trace_id||this.modelValue?.trace_id},taskInfoClass(){return this.modelValue?.response?.success===!0?`success`:this.modelValue?.response?.success===!1?`failure`:`info`}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Z.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`veo/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Et={class:`preview`},Dt={class:`left`},Ot={class:`main`},kt={class:`bot`},At={class:`datetime`},jt=[`aria-label`],Mt={class:`info`},Nt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Pt={key:1,class:`prompt mt-2`},Ft={key:0},It={key:1},Lt={key:0,class:n({content:!0,failed:!0})},Rt={key:0,class:`mb-4`},zt={key:1,class:n({operations:!0,"mt-2":!0})},Bt={key:1,class:n({content:!0})},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={class:n({content:!0})},Ht={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Yt(u,d,m,_,v,y){let b=l(`capability-presentation`),x=l(`delete-icon`),S=l(`el-tooltip`),C=l(`image-preview`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`warning-icon`),k=l(`info-icon`),A=l(`copy-to-clipboard`),j=l(`el-alert`),M=l(`application-icon`),N=l(`lightning-icon`),P=l(`expand-icon`),F=l(`language-icon`),I=l(`magic-icon`),L=l(`time-icon`),R=l(`channel-icon`);return g(),s(`div`,Et,[e(`div`,Dt,[a(b,{capability:`veo`,part:`avatar`,class:`avatar`})]),e(`div`,Ot,[e(`div`,kt,[a(b,{capability:`veo`,part:`name`}),e(`span`,At,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:u.$t(`common.button.delete`),placement:`top`},{default:p(()=>[u.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":u.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>u.onDelete&&u.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,jt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Mt,[u.referenceImages.length>0?(g(),s(`div`,Nt,[(g(!0),s(c,null,h(u.referenceImages,(e,t)=>(g(),f(C,{key:`${t}-${e}`,url:e,name:`reference-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(g(),s(`p`,Pt,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(g(),s(`span`,Ft,` - (`+i(u.$t(`veo.status.pending`))+`) `,1)),Array.isArray(u.modelValue?.response?.data)&&u.modelValue?.response?.data[0]?.state===`running`?(g(),s(`span`,It,` - (`+i(u.$t(`veo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),u.modelValue?.response?.success===!0&&u.modelValue?.response?.data?(g(),s(`div`,Lt,[u.modelValue?.response?.data[0]?.video_url?(g(),s(`div`,Rt,[a(w,{src:u.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):o(``,!0),u.modelValue?.response.success?(g(),s(`div`,zt,[a(S,{class:`box-item`,effect:`dark`,content:u.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[u.modelValue?.response?.data[0]?.video_url?(g(),f(T,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:d[1]||=e=>u.onDownload(e,u.modelValue?.response?.data[0]?.video_url)},{default:p(()=>[r(i(u.$t(`veo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(E,{path:`/veo/videos`,body:u.modelValue?.request},null,8,[`body`]),a(D,{service:`veo`,"target-id":u.modelValue?.id,snapshot:{prompt:u.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0)])):o(``,!0),u.modelValue?.response?.success===!1?(g(),s(`div`,Bt,[a(j,{closable:!1,class:`failure`},{template:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.failure`)),1)]),default:p(()=>[e(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(A,{content:u.modelValue?.response?.error?.message},null,8,[`content`])])]),_:1})])):o(``,!0),e(`div`,Vt,[a(j,{closable:!1,class:n([`mt-2`,`task-metadata`,u.taskInfoClass])},{default:p(()=>[u.modelValue?.request?.model?(g(),s(`p`,Ht,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.model`))+`: `+i(u.modelValue?.request?.model),1)])):o(``,!0),e(`p`,Ut,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.action`))+`: `+i(u.actionLabel),1)]),u.modelValue?.request?.aspect_ratio?(g(),s(`p`,Wt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.ratio`))+`: `+i(u.modelValue?.request?.aspect_ratio),1)])):o(``,!0),u.modelValue?.request?.translation===void 0?o(``,!0):(g(),s(`p`,Gt,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.translation`))+`: `+i(u.$t(u.modelValue?.request?.translation?`seedance.button.on`:`seedance.button.off`)),1)])),e(`p`,Kt,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(A,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(g(),s(`p`,qt,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.traceId?(g(),s(`p`,Jt,[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.traceId`))+`: `+i(u.traceId)+` `,1),a(A,{content:u.traceId,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1},8,[`class`])])])])}var Xt=v({name:`RecentPanel`,components:{TaskPreview:U(Tt,[[`render`,Yt],[`__scopeId`,`data-v-eb0880c2`]]),NoTasks:ee,BotPlaceholder:De,ScrollList:L},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Zt={key:0},Qt={key:2,class:`w-full h-full flex items-center justify-center`};function $t(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Zt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,(e,t)=>(g(),f(m,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Qt,[a(v)])):o(``,!0)],64)}var en=v({name:`VeoIndex`,components:{ConfigPanel:wt,Layout:Re,RecentPanel:U(Xt,[[`render`,$t]]),ShowcaseResultTabs:ke},mixins:[_e,Ae(`veo`),Oe(`veo`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks},walletMode(){return W()&&J(`veo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`veo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await z({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`veo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`veo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`veo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=q(this.config),t=je(`veo`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!le(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;if((e.action===`image2video`||e.action===`ingredients2video`)&&!(e.image_urls&&e.image_urls.length>0)){D.warning(this.$t(`veo.message.imageRequired`));return}let n;if(this.walletMode){let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=X.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ve())return;let t=this.credential?.token;if(!t)return;n=X.generate(e,{token:t})}D.info(this.$t(`veo.message.startingTask`)),he(`veo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),D.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{e instanceof ge||se(e,`veo`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`veo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return pe(this.$wallet)},async confirmWalletPayment(e){return Z.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function tn(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`veo`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var nn=U(en,[[`render`,tn]]);export{nn as default};
|