@acedatacloud/nexior 3.371.3 → 3.371.5

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.
Files changed (260) hide show
  1. package/dist/assets/{ApiCodeButton-CGRTnBjA.js → ApiCodeButton-DyCQcWPT.js} +1 -1
  2. package/dist/assets/{ApiCodeDialog-Gay4bCfr.js → ApiCodeDialog-DfF1paQe.js} +1 -1
  3. package/dist/assets/{Artifacts-4mJocbBS.js → Artifacts-DeeXmcXM.js} +1 -1
  4. package/dist/assets/{AskUserQuestionCard-BiIL49gU.js → AskUserQuestionCard-BphOGSFL.js} +1 -1
  5. package/dist/assets/{AudioPreview-Caes5-Xb.js → AudioPreview-Db4Jiu9s.js} +1 -1
  6. package/dist/assets/{Auth-zKowLjrP.js → Auth-Ba1GFqiJ.js} +1 -1
  7. package/dist/assets/{Bare-BZw1XJRd.js → Bare-DG90GwH5.js} +1 -1
  8. package/dist/assets/{BotPlaceholder-B285f5nu.js → BotPlaceholder-BrT2BqT3.js} +1 -1
  9. package/dist/assets/{BottomFooter-Dw2YKFpW.js → BottomFooter-WFR6_QhV.js} +1 -1
  10. package/dist/assets/{BrowseConnectors-ei-2yWAD.js → BrowseConnectors-CG2nxaOa.js} +1 -1
  11. package/dist/assets/{BrowserPairingDialog-D8kW-ViR.js → BrowserPairingDialog-EHBoKgmq.js} +1 -1
  12. package/dist/assets/{Callback-Bhm_-6C_.js → Callback-Fg8ea2Bk.js} +1 -1
  13. package/dist/assets/{CodeSnippet-Cwg8dFMK.js → CodeSnippet-Dcdiu1in.js} +1 -1
  14. package/dist/assets/{Console-BtxrMcc2.js → Console-D1_KVXR2.js} +1 -1
  15. package/dist/assets/{Conversation-DFANMvAM.js → Conversation-1XBRBUIF.js} +1 -1
  16. package/dist/assets/{Conversation-YJDeI6aL.js → Conversation-D6eSyt3H.js} +1 -1
  17. package/dist/assets/{CopyToClipboard-CCt1tvH4.js → CopyToClipboard-BGKJYLUb.js} +1 -1
  18. package/dist/assets/{Detail-moWw-w4J.css → Detail--OCveBDe.css} +1 -1
  19. package/dist/assets/Detail-DppGnkTU.js +2 -0
  20. package/dist/assets/{Extra-7JWcruAG.js → Extra-DDNae5p8.js} +1 -1
  21. package/dist/assets/{FilePreview-BBYVVKx_.js → FilePreview-Cm-nsN19.js} +1 -1
  22. package/dist/assets/{Hailuo-CuoSeE43.js → Hailuo-gN1Qi8PV.js} +1 -1
  23. package/dist/assets/{History-Na45kCwi.js → History-CnG8fKJ5.js} +1 -1
  24. package/dist/assets/{ImagePreview-HVDfPxCI.js → ImagePreview-BI2WtJD9.js} +1 -1
  25. package/dist/assets/{ImageWrapper-DJusX6F3.js → ImageWrapper-UDtY3eN8.js} +1 -1
  26. package/dist/assets/{Index-DNPIlc812.js → Index-0hyZ0H3o2.js} +1 -1
  27. package/dist/assets/{Index-D9P6EhVK.js → Index-616Xzkz6.js} +1 -1
  28. package/dist/assets/{Index-B29NnMVJ.js → Index-7idA_Bxd.js} +1 -1
  29. package/dist/assets/{Index-CUK2OyT3.js → Index-8gZOW0sJ.js} +1 -1
  30. package/dist/assets/{Index-BKLMDlNb.js → Index-B2hMcr6a.js} +1 -1
  31. package/dist/assets/{Index-Dtq3xaak.js → Index-BaQal-3S.js} +1 -1
  32. package/dist/assets/{Index-BOlcEgT9.js → Index-BfEz17xd.js} +1 -1
  33. package/dist/assets/{Index-DAjb6kdK.js → Index-Br5oujDd.js} +1 -1
  34. package/dist/assets/{Index-DYJg-Cpt.js → Index-By_NWSaz.js} +1 -1
  35. package/dist/assets/{Index-BWfjPdUt.js → Index-C2hvXGDm.js} +1 -1
  36. package/dist/assets/{Index-CG_31FGm.js → Index-CSAAyyr-.js} +1 -1
  37. package/dist/assets/{Index-CNApKteq.js → Index-CSptC6Yn.js} +1 -1
  38. package/dist/assets/{Index-Ca_3yOj7.js → Index-CYezLMCm.js} +1 -1
  39. package/dist/assets/{Index-_wrjPICD.js → Index-CZYaNvqE.js} +1 -1
  40. package/dist/assets/{Index-SDOA4s6G.js → Index-ChPo_nS6.js} +1 -1
  41. package/dist/assets/{Index-CJoHx7IL.js → Index-ClY6C9CW.js} +1 -1
  42. package/dist/assets/{Index-DLgDiG8Y.js → Index-CwlCChgd.js} +1 -1
  43. package/dist/assets/{Index-39VcsoCv.js → Index-D-1CB5F8.js} +1 -1
  44. package/dist/assets/{Index-B_TUv6kj.js → Index-DNOr1iW3.js} +1 -1
  45. package/dist/assets/{Index--YMh9P1_.js → Index-DReQQDJT.js} +1 -1
  46. package/dist/assets/{Index-DgzaRU_u.js → Index-DSU8KxZF.js} +1 -1
  47. package/dist/assets/{Index-D5DYnpW9.js → Index-DUre6b6Q.js} +1 -1
  48. package/dist/assets/{Index-CITMIscJ.js → Index-DWPoYB-J.js} +1 -1
  49. package/dist/assets/{Index-BWL0b3ox.js → Index-DXyn9qUk.js} +1 -1
  50. package/dist/assets/{Index-Cw3tQFed.js → Index-Dboqekd6.js} +1 -1
  51. package/dist/assets/{Index-kvn1jofi.js → Index-DeXq3ZUD.js} +1 -1
  52. package/dist/assets/{Index-rhe9ZgjA.js → Index-Dhmz_Euw.js} +1 -1
  53. package/dist/assets/{Index-B0CHcsji.js → Index-DrFo-lR5.js} +1 -1
  54. package/dist/assets/{Index-BBv5I4X5.js → Index-GcFGwYr7.js} +1 -1
  55. package/dist/assets/{Index-kEioIUv1.js → Index-L-4H0bjK.js} +1 -1
  56. package/dist/assets/{Index-B2ki1RtE.js → Index-NKnqyIui.js} +1 -1
  57. package/dist/assets/{Index-CQt2DE-h.js → Index-R-nHNTqY.js} +1 -1
  58. package/dist/assets/{Index-DDTIPVMv.js → Index-UlxbSfsT.js} +1 -1
  59. package/dist/assets/{Index-iXuXMV4M.js → Index-qoQulRnv.js} +1 -1
  60. package/dist/assets/{Index-DKHHbMFI.js → Index-vDjYpKVM.js} +1 -1
  61. package/dist/assets/{Index-Dmzkglvs.js → Index-xKUkuyyT.js} +1 -1
  62. package/dist/assets/{Invitees-moiTFnSF.js → Invitees-Dhs-Vbz1.js} +1 -1
  63. package/dist/assets/List-AN5SRm3y.js +1 -0
  64. package/dist/assets/{List-FfbJ9ZZp.js → List-BOHzpOWY.js} +1 -1
  65. package/dist/assets/List-CsPeZOyf.css +1 -0
  66. package/dist/assets/{List-TfhtIQaB.js → List-EFijGIpJ.js} +1 -1
  67. package/dist/assets/{LocalTools-D5Gcci-U.js → LocalTools-DsOEoy5E.js} +1 -1
  68. package/dist/assets/{LocalTools-CKsGzj47.js → LocalTools-d9bq1DKk.js} +1 -1
  69. package/dist/assets/{Logo-BjrkUaTO.js → Logo-Bk-FMbTK.js} +1 -1
  70. package/dist/assets/{Main-CkTd100u.js → Main-o0Oe-Xzd.js} +1 -1
  71. package/dist/assets/{Message-DAXFqRgv.js → Message-BkQFvQNA.js} +1 -1
  72. package/dist/assets/{Model-C89H_Vps.js → Model-CzcN45mJ.js} +1 -1
  73. package/dist/assets/{Navigator-Cp5jJMRX.js → Navigator-C8Zu1I7k.js} +3 -3
  74. package/dist/assets/{NotFound-c2IbZOdP.js → NotFound-B_RZjNiy.js} +1 -1
  75. package/dist/assets/{PageHeader-BmPV4nuL.js → PageHeader-Ce-bDWDK.js} +1 -1
  76. package/dist/assets/Pay-B9KTqsCM.css +1 -0
  77. package/dist/assets/Pay-z0qsNo1_.js +1 -0
  78. package/dist/assets/{Player-BnwMeYKj.js → Player-BroqHdEp.js} +1 -1
  79. package/dist/assets/{Poivelle-B3qLX-0g.js → Poivelle-B3i4BIJi.js} +1 -1
  80. package/dist/assets/{RealtimeCall-0lHBPV7C.js → RealtimeCall-DVrrlQgb.js} +1 -1
  81. package/dist/assets/{ReportButton-57emj3Ag.js → ReportButton-CNzy8ytz.js} +1 -1
  82. package/dist/assets/{ReportDialog-BZsBwGJJ.js → ReportDialog-iVvYSkR2.js} +1 -1
  83. package/dist/assets/{ScenarioPaymentMode-B2nWCVIR.js → ScenarioPaymentMode-DjfcTokL.js} +1 -1
  84. package/dist/assets/{ScheduledTasks-BefYu5UX.js → ScheduledTasks-ihSalV__.js} +1 -1
  85. package/dist/assets/{ServicePricingSummary-C5wco0tz.js → ServicePricingSummary-DDotAm8d.js} +1 -1
  86. package/dist/assets/{ShowcaseGrid-D6wCcr43.js → ShowcaseGrid-B9WuVAMp.js} +1 -1
  87. package/dist/assets/{ShowcaseResultTabs-CQ3vtIJe.js → ShowcaseResultTabs-D6syzWr0.js} +1 -1
  88. package/dist/assets/{SolanaWalletPickerDialog-CtmABq2j.js → SolanaWalletPickerDialog-DA5z7JvO.js} +1 -1
  89. package/dist/assets/{Status-BujsSuxP.js → Status-BtpwPL21.js} +1 -1
  90. package/dist/assets/{Subscribe-BioCvU_l.js → Subscribe-D_nukBwe.js} +1 -1
  91. package/dist/assets/{TabSwitcher-Dvbx0qXf.js → TabSwitcher-DFTCRy9R.js} +1 -1
  92. package/dist/assets/{Tts-dB9wsA-E.js → Tts-CmfUhbHO.js} +1 -1
  93. package/dist/assets/{VideoPlayer-i3VcnbHP.js → VideoPlayer-spbjDbBj.js} +1 -1
  94. package/dist/assets/{VideoPreview-CycVY7vI.js → VideoPreview-_hD289E2.js} +1 -1
  95. package/dist/assets/airwallexCheckout-BtejPoL2.js +1 -0
  96. package/dist/assets/arrow-down-D057mODD.js +1 -0
  97. package/dist/assets/{arrow-down-wide-narrow-De4Gt2z-.js → arrow-down-wide-narrow-OghJzty4.js} +1 -1
  98. package/dist/assets/arrow-left-YoHcMhBE.js +1 -0
  99. package/dist/assets/arrow-right-B9ho0-hr.js +1 -0
  100. package/dist/assets/arrow-up-803cjwMX.js +1 -0
  101. package/dist/assets/{authorizeFlow-CMFNwjAy.js → authorizeFlow-CKMe8_Mi.js} +1 -1
  102. package/dist/assets/{avatar-B40VLBOo.js → avatar-BvqKVB1C.js} +1 -1
  103. package/dist/assets/{basic-B8RTc2o2.js → basic-BLiOd5uO.js} +1 -1
  104. package/dist/assets/{book-open-DgI_5ukf.js → book-open-CciDm_Vd.js} +1 -1
  105. package/dist/assets/{box-BcHSnpH-.js → box-BCNuHUlh.js} +1 -1
  106. package/dist/assets/{boxes-DY1x746v.js → boxes-i3mXsEpj.js} +1 -1
  107. package/dist/assets/{brain-CRWdx7Pw.js → brain-BxOScqtA.js} +1 -1
  108. package/dist/assets/{chart-no-axes-combined-DYbfFjq9.js → chart-no-axes-combined-BgdzySL2.js} +1 -1
  109. package/dist/assets/{chat-zzRfVzx2.js → chat-Dkcmvp3V.js} +1 -1
  110. package/dist/assets/check-BQ2kURhQ.js +1 -0
  111. package/dist/assets/chevron-down-B3REnXgR.js +1 -0
  112. package/dist/assets/chevron-right-w2PXBeor.js +1 -0
  113. package/dist/assets/{circle-alert-quyhohc-.js → circle-alert-B_P37SXR.js} +1 -1
  114. package/dist/assets/circle-check-BQthOLHp.js +1 -0
  115. package/dist/assets/{circle-question-mark-CPbnmTcR.js → circle-question-mark-BZwtMJy4.js} +1 -1
  116. package/dist/assets/{clipboard-list-BQKLA0v1.js → clipboard-list-D5h3FLI6.js} +1 -1
  117. package/dist/assets/clock-B-p2Z5fl.js +1 -0
  118. package/dist/assets/code-D6hLj3tB.js +1 -0
  119. package/dist/assets/{codingBridge-ukbnxa2i.js → codingBridge-9fRKkXYx.js} +1 -1
  120. package/dist/assets/{coins-VScLyfIR.js → coins-CCFGM5M3.js} +1 -1
  121. package/dist/assets/{copy-BZ-nQMG2.js → copy-fKMS0PiE.js} +1 -1
  122. package/dist/assets/{createTaskActions-BfAz4tbb.js → createTaskActions-DQtYTRiq.js} +1 -1
  123. package/dist/assets/{date-picker-546ouPku.js → date-picker-tuto8KOx.js} +1 -1
  124. package/dist/assets/{digitalhuman-DT6tPIDY.js → digitalhuman-BA-kq4Bb.js} +1 -1
  125. package/dist/assets/{dollar-sign-BIKVJENN.js → dollar-sign-Df-0dDx9.js} +1 -1
  126. package/dist/assets/{download-BHzlU_bJ.js → download-x4LIyCFT.js} +1 -1
  127. package/dist/assets/{drawer-yTqzLaen.js → drawer-D-nvOajb.js} +1 -1
  128. package/dist/assets/{dropdown-Bw011FVB.js → dropdown-C-txjYRt.js} +1 -1
  129. package/dist/assets/{dropdown-DxHZhHbe.js → dropdown-ZW2KkxX8.js} +1 -1
  130. package/dist/assets/{ellipsis-CJqSKBCr.js → ellipsis-BHYVvatw.js} +1 -1
  131. package/dist/assets/{esm-YlpVonMH.js → esm-DZEpexXY.js} +2 -2
  132. package/dist/assets/{external-link-DXffEL3Y.js → external-link-BlEDNV7V.js} +1 -1
  133. package/dist/assets/{eye-FxhnNuOz.js → eye-C0mUD2kS.js} +1 -1
  134. package/dist/assets/{file-DtMwLDy5.js → file-B_edwII7.js} +1 -1
  135. package/dist/assets/{file-output-CgPlARBN.js → file-output-DUwHsaTR.js} +1 -1
  136. package/dist/assets/{file-text-YhDtvMQ4.js → file-text-DSjOXw5_.js} +1 -1
  137. package/dist/assets/{fish-6YK_gMzf.js → fish-xeeiP7E9.js} +1 -1
  138. package/dist/assets/{flux-DVtrOmjb.js → flux-CZWDSsaT.js} +1 -1
  139. package/dist/assets/{folder-BOq3rzmG.js → folder-BX4TmtAd.js} +1 -1
  140. package/dist/assets/gauge-BSdnz2_X.js +1 -0
  141. package/dist/assets/{generationInput-3_W3r_nF.js → generationInput-CuX9cjvY.js} +1 -1
  142. package/dist/assets/{globe-DWsAWE_I.js → globe-HRE9WPel.js} +1 -1
  143. package/dist/assets/{grokvideo-BV4Snx8H.js → grokvideo-SCXVcV3o.js} +1 -1
  144. package/dist/assets/{hailuo-C6AjT7BG.js → hailuo-CjcT1syR.js} +1 -1
  145. package/dist/assets/{headphones-CDk8qDYh.js → headphones-Bbkug9k5.js} +1 -1
  146. package/dist/assets/{history-B25VEzje.js → history-CH3z3rd0.js} +1 -1
  147. package/dist/assets/{house-CWbvhhdE.js → house-CxlhGUbg.js} +1 -1
  148. package/dist/assets/{image-mOJ1ByjJ.js → image-B-M2bJ6h.js} +1 -1
  149. package/dist/assets/{index-DM6hrjyQ.js → index-DqV-SJ5V.js} +4 -4
  150. package/dist/assets/{index.es-B7BnZqPt.js → index.es-xLHNFjv4.js} +1 -1
  151. package/dist/assets/{info-AmBm9Cbx.js → info-BQSzmvEK.js} +1 -1
  152. package/dist/assets/{input-number-BCjyae0g.js → input-number-BirnWaVC.js} +1 -1
  153. package/dist/assets/{key-round-qVD6kc-r.js → key-round-ChCuz1jv.js} +1 -1
  154. package/dist/assets/{kling-DsaOmBOS.js → kling-DTdHs3_5.js} +1 -1
  155. package/dist/assets/{languages-DS2I-fXP.js → languages-Bl73JZYq.js} +1 -1
  156. package/dist/assets/{laptop-CzgKynug.js → laptop-BOh762DU.js} +1 -1
  157. package/dist/assets/{lightbulb-ClD2GCjs.js → lightbulb-D5pLYn1Y.js} +1 -1
  158. package/dist/assets/{link-DkSgA3dd.js → link-COtKkd88.js} +1 -1
  159. package/dist/assets/loader-circle-DKKtAnTB.js +1 -0
  160. package/dist/assets/{lock-YVHBp4zq.js → lock-ChRu85GF.js} +1 -1
  161. package/dist/assets/{luma-BPUDITN-.js → luma-BW0j0Pb8.js} +1 -1
  162. package/dist/assets/{maestro-Dza-xdK1.js → maestro-BjzFgF7e.js} +1 -1
  163. package/dist/assets/{mail-BcrDtzjl.js → mail-CQdi9ZzD.js} +1 -1
  164. package/dist/assets/{message-circle-IeKu5nx9.js → message-circle-DxV12Lc6.js} +1 -1
  165. package/dist/assets/{mic-DThA7f_u.js → mic-BpSNYK33.js} +1 -1
  166. package/dist/assets/{midjourney-BnT_R0Ip.js → midjourney-CPZijRWY.js} +1 -1
  167. package/dist/assets/{minimax-CR2mnCyQ.js → minimax-BkYTmKXk.js} +1 -1
  168. package/dist/assets/{monitor-C7pDvjST.js → monitor-CE9GQaE1.js} +1 -1
  169. package/dist/assets/{mouse-pointer-2-BGP2gVgn.js → mouse-pointer-2-DUGOXw5q.js} +1 -1
  170. package/dist/assets/music-2-B89JBAVE.js +1 -0
  171. package/dist/assets/{nanobanana-CK-KHD71.js → nanobanana-hHXFtUYP.js} +1 -1
  172. package/dist/assets/{omni-CrWWTQMD.js → omni-DpQnaEWk.js} +1 -1
  173. package/dist/assets/{openaiimage-C56Iwluv.js → openaiimage-CVZfwpa8.js} +1 -1
  174. package/dist/assets/{pagination-D-Ckizkk.js → pagination-BNM_M1GC.js} +1 -1
  175. package/dist/assets/{pagination-50HEMFzY.js → pagination-CdEqT6nu.js} +1 -1
  176. package/dist/assets/{pagination-BH4MphOL.js → pagination-SAEpTY0E.js} +1 -1
  177. package/dist/assets/{palette-CIMGKHKc.js → palette-VPPhzXTH.js} +1 -1
  178. package/dist/assets/{paperclip-DHtaHoBJ.js → paperclip-DtJRgA-W.js} +1 -1
  179. package/dist/assets/{pause-Dh4Nf3e4.js → pause-COMcncHS.js} +1 -1
  180. package/dist/assets/{pencil-Dxw_6QaO.js → pencil-BTHCbcBX.js} +1 -1
  181. package/dist/assets/{pika-5A4aNWRC.js → pika-C7XCLds7.js} +1 -1
  182. package/dist/assets/{pixverse-C6SKj6kT.js → pixverse-CGaGZF00.js} +1 -1
  183. package/dist/assets/play-Cj4Rc7zR.js +1 -0
  184. package/dist/assets/{plug-CVrABqVX.js → plug-C0_t43IR.js} +1 -1
  185. package/dist/assets/plus-D5KrvAv-.js +1 -0
  186. package/dist/assets/{poivelle-BqyypMcW.js → poivelle-Cz93rInj.js} +1 -1
  187. package/dist/assets/{popover-CCAggJhc.js → popover-BCDyyoJf.js} +1 -1
  188. package/dist/assets/{producer-D6Jl2NpZ.js → producer-Dce1_I-e.js} +1 -1
  189. package/dist/assets/{qrart-BD8R3F1p.js → qrart-Czda0FqW.js} +1 -1
  190. package/dist/assets/{qwenimage-CSMZKkyT.js → qwenimage-CspF--PW.js} +1 -1
  191. package/dist/assets/{realtime-BzbMi6Db.js → realtime-BSiECcor.js} +1 -1
  192. package/dist/assets/{refresh-cw-CVSSWpQM.js → refresh-cw-D7ZZA5dZ.js} +1 -1
  193. package/dist/assets/rotate-ccw-CdzApwyj.js +1 -0
  194. package/dist/assets/rotate-cw-5loEUj__.js +1 -0
  195. package/dist/assets/search-Dm-cjK6g.js +1 -0
  196. package/dist/assets/{seedance-Bb_b_89I.js → seedance-Bdy5PN34.js} +1 -1
  197. package/dist/assets/{seedream-CpEq4B8M.js → seedream-DY3kkM79.js} +1 -1
  198. package/dist/assets/{select-BrdGcmQV.js → select-vXURdu1n.js} +1 -1
  199. package/dist/assets/{serp-KvxmJhd4.js → serp-D0jI8jgI.js} +1 -1
  200. package/dist/assets/{shield-D8Epv2bc.js → shield-BP9Syrng.js} +1 -1
  201. package/dist/assets/{showcase-DLvb5FT2.js → showcase-D2MQ88YU.js} +1 -1
  202. package/dist/assets/{showcaseRecreateMixin-TEhFBc7v.js → showcaseRecreateMixin-BTTx6P4V.js} +1 -1
  203. package/dist/assets/{shuffle-qSlPWPcQ.js → shuffle-7eMQRCTi.js} +1 -1
  204. package/dist/assets/{siteHome-BPe9s0lU.js → siteHome-C_LuwTQb.js} +1 -1
  205. package/dist/assets/{slider-Dmaw2uOQ.js → slider-ILog1xgF.js} +1 -1
  206. package/dist/assets/{solana-wallets-Bqt8suXe.js → solana-wallets-DFhbGuWs.js} +2 -2
  207. package/dist/assets/{sora-qoRgh7iI.js → sora-3A2qd3Rj.js} +1 -1
  208. package/dist/assets/{sparkles-BW1PBCix.js → sparkles-DvrnpaZU.js} +1 -1
  209. package/dist/assets/square-CJdx7-_g.js +1 -0
  210. package/dist/assets/{store-BM4V4uhC.js → store-Cg1vR3oj.js} +1 -1
  211. package/dist/assets/{suno-3tNeDQrn.js → suno-pr3WzvOs.js} +1 -1
  212. package/dist/assets/{switch-B1g5dw5D.js → switch-DsvSpAPL.js} +1 -1
  213. package/dist/assets/{table-CmXt553N.js → table-C_Fimrfp.js} +1 -1
  214. package/dist/assets/{tag-BaQlfV2_.js → tag-yyEb6fTF.js} +1 -1
  215. package/dist/assets/{taskPolling-BSXKWFXo.js → taskPolling-CNkyfqFX.js} +1 -1
  216. package/dist/assets/terminal-Cee_oZYd.js +1 -0
  217. package/dist/assets/{time-picker-u02IM5RL.js → time-picker-BY_8GGxp.js} +1 -1
  218. package/dist/assets/{tooltip-Drsa0R-y.js → tooltip-DhzXpaev.js} +1 -1
  219. package/dist/assets/{trash-2-qsTysEar.js → trash-2-CuwbroP3.js} +1 -1
  220. package/dist/assets/{triangle-alert-wPWJieth.js → triangle-alert-CXwoT9L1.js} +1 -1
  221. package/dist/assets/{upload-CYNoIKvu.js → upload-_ak4mf2P.js} +1 -1
  222. package/dist/assets/user-Q-EjoZno.js +1 -0
  223. package/dist/assets/{veo-DM_UYXdG.js → veo-Z326mp90.js} +1 -1
  224. package/dist/assets/{video-C-HdR_Qs.js → video-DeT9cCCj.js} +1 -1
  225. package/dist/assets/{volume-2-DioCaOkE.js → volume-2-Cd3hiwwO.js} +1 -1
  226. package/dist/assets/{wallet-DUpARZWA.js → wallet-BIHkm5lY.js} +1 -1
  227. package/dist/assets/{wan-CfhH95bK.js → wan-DMD3wwVk.js} +1 -1
  228. package/dist/assets/{wand-sparkles-B76KgpVz.js → wand-sparkles-DKunfvfr.js} +1 -1
  229. package/dist/assets/{web-BHFFE-8r.js → web-CkSTYnBp.js} +1 -1
  230. package/dist/assets/{webextrator-CbGXAcFj.js → webextrator-BRrqmOXi.js} +1 -1
  231. package/dist/assets/{zap-BDXCQHvY.js → zap-Bs0LoGjL.js} +1 -1
  232. package/dist/index.html +1 -1
  233. package/package.json +3 -2
  234. package/dist/assets/Detail-idqj7qB_.js +0 -2
  235. package/dist/assets/List-CO2tMWVB.js +0 -1
  236. package/dist/assets/List-DtG_-rJ9.css +0 -1
  237. package/dist/assets/Pay-C-lXWCpI.js +0 -1
  238. package/dist/assets/Pay-D0EjPnrv.css +0 -1
  239. package/dist/assets/arrow-down-uzLp0EzK.js +0 -1
  240. package/dist/assets/arrow-left-Dh8RRepJ.js +0 -1
  241. package/dist/assets/arrow-right-Mc9TL9dE.js +0 -1
  242. package/dist/assets/arrow-up-Ok1QXX4J.js +0 -1
  243. package/dist/assets/check-Dkywcw9M.js +0 -1
  244. package/dist/assets/chevron-down-DofdIa77.js +0 -1
  245. package/dist/assets/chevron-right-BMqfbr8H.js +0 -1
  246. package/dist/assets/circle-check-DFAR5I11.js +0 -1
  247. package/dist/assets/clock-D_pf_5A-.js +0 -1
  248. package/dist/assets/code-B1khxmUM.js +0 -1
  249. package/dist/assets/gauge-D1GQHZS1.js +0 -1
  250. package/dist/assets/loader-circle-D26fSmns.js +0 -1
  251. package/dist/assets/music-2-BRWsn50W.js +0 -1
  252. package/dist/assets/play-CM6vdgoM.js +0 -1
  253. package/dist/assets/plus-CByC99a5.js +0 -1
  254. package/dist/assets/rotate-ccw-CqDtZEsB.js +0 -1
  255. package/dist/assets/rotate-cw-CKwX841o.js +0 -1
  256. package/dist/assets/search-BgeCUkYM.js +0 -1
  257. package/dist/assets/square-B_xQGZFm.js +0 -1
  258. package/dist/assets/terminal-DlnoUhS_.js +0 -1
  259. package/dist/assets/user-B6aZBiwl.js +0 -1
  260. package/dist/assets/wechat-B_xvylqk.js +0 -1
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BrdGcmQV.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-Drsa0R-y.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{t as E}from"./drawer-yTqzLaen.js";import{t as D}from"./input-number-BCjyae0g.js";import{t as O}from"./switch-B1g5dw5D.js";import{t as k}from"./box-BcHSnpH-.js";import{t as A}from"./clock-D_pf_5A-.js";import{a as j,i as M,n as N,o as ee,r as P,s as te,t as F}from"./pagination-50HEMFzY.js";import{t as ne}from"./info-AmBm9Cbx.js";import{t as I}from"./trash-2-qsTysEar.js";import{t as re}from"./triangle-alert-wPWJieth.js";import{t as L}from"./upload-CYNoIKvu.js";import{t as ie}from"./volume-2-DioCaOkE.js";import{t as R}from"./wand-sparkles-B76KgpVz.js";import{Sn as z,_n as ae,an as oe,bn as se,cn as ce,dn as le,en as ue,fn as de,gn as fe,hn as pe,in as me,ln as he,mn as ge,on as _e,pn as ve,sn as ye,tn as be,un as xe,vn as Se,yn as Ce}from"./constants-CmC-0Hwp.js";import{A as B,Cn as we,La as V,Li as Te,Mn as H,O as Ee,Qi as De,Va as Oe,aa as ke,at as U,ct as W,di as Ae,er as G,et as K,it as je,li as Me,ot as Ne,st as q,to as J,zi as Y}from"./index-DM6hrjyQ.js";import{t as Pe}from"./CopyToClipboard-CCt1tvH4.js";import{t as Fe}from"./ReportButton-57emj3Ag.js";import{t as X}from"./ImagePreview-HVDfPxCI.js";import{n as Ie}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Le}from"./ServicePricingSummary-C5wco0tz.js";import{t as Re}from"./AudioPreview-Caes5-Xb.js";import{t as ze}from"./VideoPlayer-i3VcnbHP.js";import{t as Be}from"./VideoPreview-CycVY7vI.js";import{t as Ve}from"./ScenarioPaymentMode-B2nWCVIR.js";import{t as He}from"./ApiCodeButton-CGRTnBjA.js";import{t as Ue}from"./BotPlaceholder-B285f5nu.js";import{t as We}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ge}from"./ShowcaseResultTabs-CQ3vtIJe.js";import{t as Ke}from"./showcaseRecreateMixin-TEhFBc7v.js";import{t as qe}from"./generationInput-3_W3r_nF.js";import{t as Je}from"./ImageWrapper-DJusX6F3.js";var Ye=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:E,ElButton:J},mixins:[Ie]}),Xe={class:`main flex flex-row flex-1`},Ze={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)]`},Qe={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function $e(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Xe,[e(`div`,Ze,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Qe,[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 et=B(Ye,[[`render`,$e],[`__scopeId`,`data-v-86340af4`]]),tt=v({name:`SeedancePromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function nt(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(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var rt=B(tt,[[`render`,nt]]),it=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{options:[{value:de,label:this.$t(`seedance.model.seedance25`)},{value:he,label:this.$t(`seedance.model.seedance20`)},{value:xe,label:this.$t(`seedance.model.seedance20Fast`)},{value:le,label:this.$t(`seedance.model.seedance20Mini`)},{value:ce,label:this.$t(`seedance.model.seedance15pro`)},{value:_e,label:this.$t(`seedance.model.seedance10pro`)},{value:ye,label:this.$t(`seedance.model.seedance10proFast`)},{value:oe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:me,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=ue}}),at={class:`field`},ot={class:`label`},st={class:`box`},ct={class:`title font-bold`};function lt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,at,[e(`div`,ot,[e(`div`,st,[e(`h2`,ct,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ut=B(it,[[`render`,lt],[`__scopeId`,`data-v-0092c9dc`]]),dt=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),ft={class:`field`},pt={class:`label`},mt={class:`box`},ht={class:`title font-bold`};function gt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ft,[e(`div`,pt,[e(`div`,mt,[e(`h2`,ht,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var _t=B(dt,[[`render`,gt],[`__scopeId`,`data-v-d61cc21b`]]),Z={[Ce]:0,[se]:1,[Se]:2,"4k":3},vt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:j,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[{value:Ce,label:`480p`},{value:se,label:`720p`},{value:Se,label:`1080p`},{value:`4k`,label:`4k`}],t=Z[this.capability.maxResolution]??Z[`1080p`];return e.map(e=>({...e,disabled:Z[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),yt={class:`resolution`},bt={class:`header`},xt={class:`title font-bold`},St={class:`items`},Ct=[`onClick`];function wt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,yt,[e(`div`,bt,[e(`h2`,xt,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,St,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,Ct)]),_:2},1032,[`content`,`disabled`]))),128))])])}var Tt=B(vt,[[`render`,wt],[`__scopeId`,`data-v-db7e8aff`]]),Et=v({name:`SeedanceRatioSelector`,components:{InfoIcon:j},computed:{options(){return[{value:ge,label:`16:9`,w:32,h:18},{value:fe,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:pe,label:`21:9`,w:34,h:14},{value:ae,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=be}}),Dt={class:`ratio`},Ot={class:`header`},kt={class:`title font-bold`},At={class:`items`},jt=[`onClick`],Mt={class:`preview`},Nt={key:1,class:`rect rect-auto`},Pt={class:`name`};function Ft(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`h2`,kt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,At,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Mt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,Nt,`A`))]),e(`div`,Pt,i(r.label),1)],10,jt))),128))])])}var It=B(Et,[[`render`,Ft],[`__scopeId`,`data-v-8ddec2dd`]]),Lt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:j},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return z(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),Rt={key:0,class:`field`},zt={class:`label`},Bt={class:`box`},Vt={class:`title font-bold`},Ht={class:`value`};function Ut(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`h2`,Vt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ht,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Wt=B(Lt,[[`render`,Ut],[`__scopeId`,`data-v-df51dfbd`]]),Gt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:j},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Kt={class:`field`},qt={class:`label`},Jt={class:`box`},Yt={class:`title font-bold`},Xt={class:`value`};function Zt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`h2`,Yt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Qt=B(Gt,[[`render`,Zt],[`__scopeId`,`data-v-ae777d61`]]),$t=new Set(Object.keys(ve)),en=e=>Array.isArray(e)?e.filter(e=>H(e?.url)):[];function Q(e){let t=en(e?.images),n=t.some(e=>!e.role||e.role===`first_frame`||e.role===`last_frame`),r=t.some(e=>e.role===`reference_image`)||e?.audios?.some(e=>H(e?.url))===!0||e?.videos?.some(e=>H(e?.url))===!0;return{frame:n,reference:r,mixed:n&&r}}function $(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!$t.has(t.model))return{reject:`modelUnsupported`};let n=z(t.model);t.images=en(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>H(e?.url))),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>H(e?.url))),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,Q(t).mixed)return{reject:`frameReferenceConflict`};if(n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0,s=(t.images||[]).filter(e=>e.role===`reference_image`).length,c=t.model===`doubao-seedance-2-5-260628`?t.images?.length||0:s,l=t.videos?.length||0,u=t.audios?.length||0;return s>n.maxReferenceImages||l>n.maxReferenceVideos||u>n.maxReferenceAudios||c+l+u>n.maxReferenceMedia?{reject:`referenceMediaExceeded`}:Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o&&!n.supportsAudioOnly?{reject:`audioRequiresReference`}:(n.taskTypes.includes(t.omni_reference_task_type)||delete t.omni_reference_task_type,t.omni_reference_task_type===`reference`&&!Q(t).reference?{reject:`taskRequiresReferenceMedia`}:(n.outputFormats.includes(t.output_format)||delete t.output_format,t.model===`doubao-seedance-2-5-260628`&&t.web_search===!0?t.tools=[{type:`web_search`}]:delete t.tools,delete t.web_search,t.model===`doubao-seedance-2-5-260628`&&t.images?.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&(t.ratio=`adaptive`),(t.omni_reference_task_type===`edit`||t.omni_reference_task_type===`extend`)&&!o?{reject:`taskRequiresVideo`}:!t.prompt&&!a&&!o&&!Array.isArray(t.audios)?{reject:`generationInputRequired`}:(t.omni_reference_task_type===`edit`?(t.ratio=`adaptive`,t.duration=-1):t.omni_reference_task_type===`extend`&&(t.ratio=`adaptive`),{request:{...t,async:!0}})))}var tn=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetFirstFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),nn={key:0,class:`relative`},rn={class:`flex min-h-8 items-center pr-20`},an={class:`flex justify-start items-center`},on={class:`text-sm font-bold`},sn={key:0,class:`required-badge`};function cn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,nn,[e(`div`,rn,[e(`div`,an,[e(`span`,on,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,sn,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var ln=B(tn,[[`render`,cn],[`__scopeId`,`data-v-e41ac7c3`]]),un=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,ImagePreview:X,InfoIcon:j},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetLastFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),dn={key:0,class:`relative`},fn={class:`flex min-h-8 items-center pr-20`},pn={class:`flex justify-start items-center`},mn={class:`text-sm font-bold`};function hn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,dn,[e(`div`,fn,[e(`div`,pn,[e(`span`,mn,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var gn=B(un,[[`render`,hn],[`__scopeId`,`data-v-198d2769`]]),_n=v({name:`SeedanceReferenceImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetReferenceImageUrls()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),vn={key:0,class:`relative`},yn={class:`flex min-h-8 items-center pr-20`},bn={class:`flex justify-start items-center`},xn={class:`text-sm font-bold`};function Sn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,vn,[e(`div`,yn,[e(`div`,bn,[e(`span`,xn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.capability.maxReferenceImages,class:`upload-wrapper`,multiple:t.capability.maxReferenceImages>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Cn=B(_n,[[`render`,Sn],[`__scopeId`,`data-v-591ef66f`]]),wn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),Tn={key:0,class:`relative`},En={class:`flex min-h-8 items-center pr-20`},Dn={class:`flex justify-start items-center`},On={class:`text-sm font-bold`};function kn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Tn,[e(`div`,En,[e(`div`,Dn,[e(`span`,On,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:t.capability.maxReferenceAudios,class:`upload-wrapper`,multiple:t.capability.maxReferenceAudios>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var An=B(wn,[[`render`,kn],[`__scopeId`,`data-v-cb408b11`]]),jn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),Mn={key:0,class:`relative`},Nn={class:`flex min-h-8 items-center pr-20`},Pn={class:`flex justify-start items-center`},Fn={class:`text-sm font-bold`};function In(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,Mn,[e(`div`,Nn,[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:t.capability.maxReferenceVideos,class:`upload-wrapper`,multiple:t.capability.maxReferenceVideos>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ln=B(jn,[[`render`,In],[`__scopeId`,`data-v-c0492201`]]),Rn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:j},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return z(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),zn={key:0,class:`field`},Bn={class:`label`},Vn={class:`box`},Hn={class:`title font-bold`},Un={class:`value`};function Wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,zn,[e(`div`,Bn,[e(`div`,Vn,[e(`h2`,Hn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Un,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Gn=B(Rn,[[`render`,Wn],[`__scopeId`,`data-v-edea5451`]]),Kn=v({name:`SeedanceAdvanced25Settings`,components:{ElOption:b,ElSelect:y,ElSwitch:O,InfoIcon:j},computed:{visible(){return this.$store.state.seedance?.config?.model===de},taskType:{get(){return this.$store.state.seedance?.config?.omni_reference_task_type||`auto`},set(e){this.updateConfig({omni_reference_task_type:e})}},outputFormat:{get(){return this.$store.state.seedance?.config?.output_format||`mp4`},set(e){this.updateConfig({output_format:e})}},webSearch:{get(){return this.$store.state.seedance?.config?.web_search===!0},set(e){this.updateConfig({web_search:e})}}},methods:{updateConfig(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,...e})}}}),qn={key:0,class:`space-y-4`},Jn={class:`field`},Yn={class:`label`},Xn={class:`title font-bold`},Zn={class:`field`},Qn={class:`label`},$n={class:`title font-bold`},er={class:`field`},tr={class:`label`},nr={class:`title font-bold`};function rr(t,n,r,c,u,d){let f=l(`info-icon`),m=l(`el-option`),h=l(`el-select`),_=l(`el-switch`);return t.visible?(g(),s(`div`,qn,[e(`div`,Jn,[e(`div`,Yn,[e(`h2`,Xn,i(t.$t(`seedance.name.taskType`)),1),a(f,{content:t.$t(`seedance.description.taskType`),class:`info`},null,8,[`content`])]),a(h,{modelValue:t.taskType,"onUpdate:modelValue":n[0]||=e=>t.taskType=e,class:`value`},{default:p(()=>[a(m,{value:`auto`,label:t.$t(`seedance.taskType.auto`)},null,8,[`label`]),a(m,{value:`reference`,label:t.$t(`seedance.taskType.reference`)},null,8,[`label`]),a(m,{value:`edit`,label:t.$t(`seedance.taskType.edit`)},null,8,[`label`]),a(m,{value:`extend`,label:t.$t(`seedance.taskType.extend`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`seedance.name.outputFormat`)),1)]),a(h,{modelValue:t.outputFormat,"onUpdate:modelValue":n[1]||=e=>t.outputFormat=e,class:`value`},{default:p(()=>[a(m,{value:`mp4`,label:`MP4`}),a(m,{value:`mov`,label:`MOV`})]),_:1},8,[`modelValue`])]),e(`div`,er,[e(`div`,tr,[e(`h2`,nr,i(t.$t(`seedance.name.webSearch`)),1),a(f,{content:t.$t(`seedance.description.webSearch`),class:`info`},null,8,[`content`])]),a(_,{modelValue:t.webSearch,"onUpdate:modelValue":n[2]||=e=>t.webSearch=e},null,8,[`modelValue`])])])):o(``,!0)}var ir=B(Kn,[[`render`,rr],[`__scopeId`,`data-v-b4dd64f6`]]),ar=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:j},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),or={class:`field`},sr={class:`label`},cr={class:`box`},lr={class:`title font-bold`},ur={class:`value`};function dr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,or,[e(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,ur,[a(f,{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`])])])}var fr=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElAlert:C,ElButton:J,PromptInput:rt,ModelSelector:ut,DurationSelector:_t,ResolutionSelector:Tt,RatioSelector:It,GenerateAudioSwitch:Wt,CameraFixedSwitch:Qt,ReturnLastFrameSwitch:Gn,Advanced25Settings:ir,SeedInput:B(ar,[[`render`,dr],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:ln,LastFrameImage:gn,ReferenceImage:Cn,ReferenceAudio:An,ReferenceVideo:Ln,ServicePricingSummary:Le,ScenarioPaymentMode:Ve},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){let{request:e,reject:t}=$(this.config);return!t&&qe(`seedance`,e)},config(){return this.$store.state.seedance?.config},capability(){return z(this.config?.model)},inputModes(){return Q(this.config)},consumption(){return we(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service},walletMode(){return Te()&&Y(`seedance`).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=Y(`seedance`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=Y(`seedance`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;let{request:n}=$(this.config);try{if(!n)return;let r=await G.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`,this.walletMode?void 0:this.consumption)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={key:0,class:`input-mode-guide mb-4`},gr={class:`flex flex-col items-center justify-center px-5 pb-5`};function _r(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`generate-audio-switch`),S=l(`camera-fixed-switch`),C=l(`return-last-frame-switch`),w=l(`advanced25-settings`),T=l(`seed-input`),E=l(`el-alert`),D=l(`first-frame-image`),O=l(`last-frame-image`),k=l(`reference-image`),A=l(`reference-audio`),j=l(`reference-video`),M=l(`scenario-payment-mode`),N=l(`service-pricing-summary`),ee=l(`magic-icon`),P=l(`el-button`);return g(),s(`div`,pr,[e(`div`,mr,[a(h,{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`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.capability.acceptsReferenceImage?(g(),s(`div`,hr,[e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.frames`)),1),r(` `+i(t.$t(`seedance.description.frameMode`)),1)]),e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.reference`)),1),r(` `+i(t.$t(`seedance.description.referenceMode`)),1)])])):o(``,!0),t.inputModes.mixed?(g(),f(E,{key:1,class:`mb-4`,type:`warning`,closable:!1,title:t.$t(`seedance.message.frameReferenceConflict`),"show-icon":``},null,8,[`title`])):o(``,!0),a(D,{class:`mb-4`}),a(O,{class:`mb-4`}),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),a(j,{class:`mb-4`})]),e(`div`,gr,[a(M,{scenario:`seedance`}),t.walletMode?o(``,!0):(g(),f(N,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(P,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(ee,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vr=B(fr,[[`render`,_r],[`__scopeId`,`data-v-0b17b09f`]]),yr=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:I,ApplicationIcon:k,ChannelIcon:te,FullscreenIcon:ee,InfoIcon:ne,MagicIcon:R,TimeIcon:A,VolumeIcon:ie,WarningIcon:re,CopyToClipboard:Pe,ElAlert:C,VideoPlayer:ze,ElTooltip:S,ElButton:J,ImageWrapper:Je,ImagePreview:X,AudioPreview:Re,VideoPreview:Be,ApiCodeButton:He,ReportButton:Fe},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Oe.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(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),br={class:`preview`},xr={class:`left`},Sr={class:`main`},Cr={class:`bot`},wr={class:`datetime`},Tr=[`aria-label`],Er={class:`info`},Dr={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Or={key:1,class:`prompt mt-2`},kr={key:0},Ar={key:1},jr={key:0,class:n({content:!0})},Mr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Nr={key:1,class:n({content:!0})},Pr={key:0,class:`mb-4`},Fr={key:1,class:`mb-4`},Ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Br={key:0},Vr={key:1},Hr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kr={key:2,class:n({content:!0})},qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Zr={key:3,class:n({content:!0})},Qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ei(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`report-button`),ee=l(`application-icon`),P=l(`fullscreen-icon`),te=l(`volume-icon`),F=l(`channel-icon`),ne=l(`warning-icon`),I=l(`info-icon`);return g(),s(`div`,br,[e(`div`,xr,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Sr,[e(`div`,Cr,[a(y,{capability:`seedance`,part:`name`}),e(`span`,wr,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Tr)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Er,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Dr,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Or,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Ar,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kr,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Nr,[n.video?.video_url?(g(),s(`div`,Pr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Fr,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ir,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`]),a(N,{service:`seedance`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lr,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Rr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,zr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,Br,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,Vr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,Hr,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,Ur,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Wr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Gr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Kr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Jr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,Yr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Xr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Zr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,$r,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,jr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Mr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var ti=v({name:`SeedanceRecentPanel`,components:{TaskPreview:B(yr,[[`render`,ei],[`__scopeId`,`data-v-a9336aee`]]),BotPlaceholder:Ue,NoTasks:P,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ni={key:0},ri={key:2,class:`w-full h-full flex items-center justify-center`};function ii(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`,ni,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-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=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ri,[a(v)])):o(``,!0)],64)}var ai=v({name:`SeedanceIndex`,components:{ConfigPanel:vr,Layout:et,RecentPanel:B(ti,[[`render`,ii]]),ShowcaseResultTabs:Ge},mixins:[Ne,Ke(`seedance`),We(`seedance`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks},walletMode(){return Te()&&Y(`seedance`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`seedance/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await F({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){let{request:t,reject:n}=$(this.config);if(n){let e=n===`generationInputRequired`?`common.message.generationInputRequired`:`seedance.message.${n}`;T.warning(this.$t(e));return}if(!je(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!t)return;let r;if(this.walletMode){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}r=G.generate(t,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ke())return;let e=this.credential?.token;if(!e)return;r=G.generate(t,{token:e})}let i=T.info(this.$t(`seedance.message.startingTask`));De(`seedance`,r).then(e=>{i.close();let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(t=>{i.close();let n=t?.response?.data;t instanceof Me||Ee(t,`seedance`,e)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(n?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Ae(this.$wallet)},async confirmWalletPayment(e){return Oe.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 oi(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:`seedance`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var si=B(ai,[[`render`,oi]]);export{si as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-vXURdu1n.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-DhzXpaev.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{t as E}from"./drawer-D-nvOajb.js";import{t as D}from"./input-number-BirnWaVC.js";import{t as O}from"./switch-DsvSpAPL.js";import{t as k}from"./box-BCNuHUlh.js";import{t as A}from"./clock-B-p2Z5fl.js";import{a as j,i as M,n as N,o as ee,r as P,s as te,t as F}from"./pagination-CdEqT6nu.js";import{t as ne}from"./info-BQSzmvEK.js";import{t as I}from"./trash-2-CuwbroP3.js";import{t as re}from"./triangle-alert-CXwoT9L1.js";import{t as L}from"./upload-_ak4mf2P.js";import{t as ie}from"./volume-2-Cd3hiwwO.js";import{t as R}from"./wand-sparkles-DKunfvfr.js";import{Sn as z,_n as ae,an as oe,bn as se,cn as ce,dn as le,en as ue,fn as de,gn as fe,hn as pe,in as me,ln as he,mn as ge,on as _e,pn as ve,sn as ye,tn as be,un as xe,vn as Se,yn as Ce}from"./constants-CmC-0Hwp.js";import{A as B,Cn as we,La as V,Li as Te,Mn as H,O as Ee,Qi as De,Va as Oe,aa as ke,at as U,ct as W,di as Ae,er as G,et as K,it as je,li as Me,ot as Ne,st as q,to as J,zi as Y}from"./index-DqV-SJ5V.js";import{t as Pe}from"./CopyToClipboard-BGKJYLUb.js";import{t as Fe}from"./ReportButton-CNzy8ytz.js";import{t as X}from"./ImagePreview-BI2WtJD9.js";import{n as Ie}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Le}from"./ServicePricingSummary-DDotAm8d.js";import{t as Re}from"./AudioPreview-Db4Jiu9s.js";import{t as ze}from"./VideoPlayer-spbjDbBj.js";import{t as Be}from"./VideoPreview-_hD289E2.js";import{t as Ve}from"./ScenarioPaymentMode-DjfcTokL.js";import{t as He}from"./ApiCodeButton-DyCQcWPT.js";import{t as Ue}from"./BotPlaceholder-BrT2BqT3.js";import{t as We}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ge}from"./ShowcaseResultTabs-D6syzWr0.js";import{t as Ke}from"./showcaseRecreateMixin-BTTx6P4V.js";import{t as qe}from"./generationInput-CuX9cjvY.js";import{t as Je}from"./ImageWrapper-UDtY3eN8.js";var Ye=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:E,ElButton:J},mixins:[Ie]}),Xe={class:`main flex flex-row flex-1`},Ze={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)]`},Qe={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function $e(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Xe,[e(`div`,Ze,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Qe,[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 et=B(Ye,[[`render`,$e],[`__scopeId`,`data-v-86340af4`]]),tt=v({name:`SeedancePromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function nt(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(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var rt=B(tt,[[`render`,nt]]),it=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{options:[{value:de,label:this.$t(`seedance.model.seedance25`)},{value:he,label:this.$t(`seedance.model.seedance20`)},{value:xe,label:this.$t(`seedance.model.seedance20Fast`)},{value:le,label:this.$t(`seedance.model.seedance20Mini`)},{value:ce,label:this.$t(`seedance.model.seedance15pro`)},{value:_e,label:this.$t(`seedance.model.seedance10pro`)},{value:ye,label:this.$t(`seedance.model.seedance10proFast`)},{value:oe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:me,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=ue}}),at={class:`field`},ot={class:`label`},st={class:`box`},ct={class:`title font-bold`};function lt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,at,[e(`div`,ot,[e(`div`,st,[e(`h2`,ct,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ut=B(it,[[`render`,lt],[`__scopeId`,`data-v-0092c9dc`]]),dt=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),ft={class:`field`},pt={class:`label`},mt={class:`box`},ht={class:`title font-bold`};function gt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ft,[e(`div`,pt,[e(`div`,mt,[e(`h2`,ht,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var _t=B(dt,[[`render`,gt],[`__scopeId`,`data-v-d61cc21b`]]),Z={[Ce]:0,[se]:1,[Se]:2,"4k":3},vt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:j,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[{value:Ce,label:`480p`},{value:se,label:`720p`},{value:Se,label:`1080p`},{value:`4k`,label:`4k`}],t=Z[this.capability.maxResolution]??Z[`1080p`];return e.map(e=>({...e,disabled:Z[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),yt={class:`resolution`},bt={class:`header`},xt={class:`title font-bold`},St={class:`items`},Ct=[`onClick`];function wt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,yt,[e(`div`,bt,[e(`h2`,xt,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,St,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,Ct)]),_:2},1032,[`content`,`disabled`]))),128))])])}var Tt=B(vt,[[`render`,wt],[`__scopeId`,`data-v-db7e8aff`]]),Et=v({name:`SeedanceRatioSelector`,components:{InfoIcon:j},computed:{options(){return[{value:ge,label:`16:9`,w:32,h:18},{value:fe,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:pe,label:`21:9`,w:34,h:14},{value:ae,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=be}}),Dt={class:`ratio`},Ot={class:`header`},kt={class:`title font-bold`},At={class:`items`},jt=[`onClick`],Mt={class:`preview`},Nt={key:1,class:`rect rect-auto`},Pt={class:`name`};function Ft(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`h2`,kt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,At,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Mt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,Nt,`A`))]),e(`div`,Pt,i(r.label),1)],10,jt))),128))])])}var It=B(Et,[[`render`,Ft],[`__scopeId`,`data-v-8ddec2dd`]]),Lt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:j},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return z(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),Rt={key:0,class:`field`},zt={class:`label`},Bt={class:`box`},Vt={class:`title font-bold`},Ht={class:`value`};function Ut(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`h2`,Vt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ht,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Wt=B(Lt,[[`render`,Ut],[`__scopeId`,`data-v-df51dfbd`]]),Gt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:j},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Kt={class:`field`},qt={class:`label`},Jt={class:`box`},Yt={class:`title font-bold`},Xt={class:`value`};function Zt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`h2`,Yt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Qt=B(Gt,[[`render`,Zt],[`__scopeId`,`data-v-ae777d61`]]),$t=new Set(Object.keys(ve)),en=e=>Array.isArray(e)?e.filter(e=>H(e?.url)):[];function Q(e){let t=en(e?.images),n=t.some(e=>!e.role||e.role===`first_frame`||e.role===`last_frame`),r=t.some(e=>e.role===`reference_image`)||e?.audios?.some(e=>H(e?.url))===!0||e?.videos?.some(e=>H(e?.url))===!0;return{frame:n,reference:r,mixed:n&&r}}function $(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!$t.has(t.model))return{reject:`modelUnsupported`};let n=z(t.model);t.images=en(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>H(e?.url))),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>H(e?.url))),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,Q(t).mixed)return{reject:`frameReferenceConflict`};if(n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0,s=(t.images||[]).filter(e=>e.role===`reference_image`).length,c=t.model===`doubao-seedance-2-5-260628`?t.images?.length||0:s,l=t.videos?.length||0,u=t.audios?.length||0;return s>n.maxReferenceImages||l>n.maxReferenceVideos||u>n.maxReferenceAudios||c+l+u>n.maxReferenceMedia?{reject:`referenceMediaExceeded`}:Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o&&!n.supportsAudioOnly?{reject:`audioRequiresReference`}:(n.taskTypes.includes(t.omni_reference_task_type)||delete t.omni_reference_task_type,t.omni_reference_task_type===`reference`&&!Q(t).reference?{reject:`taskRequiresReferenceMedia`}:(n.outputFormats.includes(t.output_format)||delete t.output_format,t.model===`doubao-seedance-2-5-260628`&&t.web_search===!0?t.tools=[{type:`web_search`}]:delete t.tools,delete t.web_search,t.model===`doubao-seedance-2-5-260628`&&t.images?.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&(t.ratio=`adaptive`),(t.omni_reference_task_type===`edit`||t.omni_reference_task_type===`extend`)&&!o?{reject:`taskRequiresVideo`}:!t.prompt&&!a&&!o&&!Array.isArray(t.audios)?{reject:`generationInputRequired`}:(t.omni_reference_task_type===`edit`?(t.ratio=`adaptive`,t.duration=-1):t.omni_reference_task_type===`extend`&&(t.ratio=`adaptive`),{request:{...t,async:!0}})))}var tn=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetFirstFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),nn={key:0,class:`relative`},rn={class:`flex min-h-8 items-center pr-20`},an={class:`flex justify-start items-center`},on={class:`text-sm font-bold`},sn={key:0,class:`required-badge`};function cn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,nn,[e(`div`,rn,[e(`div`,an,[e(`span`,on,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,sn,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var ln=B(tn,[[`render`,cn],[`__scopeId`,`data-v-e41ac7c3`]]),un=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,ImagePreview:X,InfoIcon:j},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetLastFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),dn={key:0,class:`relative`},fn={class:`flex min-h-8 items-center pr-20`},pn={class:`flex justify-start items-center`},mn={class:`text-sm font-bold`};function hn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,dn,[e(`div`,fn,[e(`div`,pn,[e(`span`,mn,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var gn=B(un,[[`render`,hn],[`__scopeId`,`data-v-198d2769`]]),_n=v({name:`SeedanceReferenceImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetReferenceImageUrls()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),vn={key:0,class:`relative`},yn={class:`flex min-h-8 items-center pr-20`},bn={class:`flex justify-start items-center`},xn={class:`text-sm font-bold`};function Sn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,vn,[e(`div`,yn,[e(`div`,bn,[e(`span`,xn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.capability.maxReferenceImages,class:`upload-wrapper`,multiple:t.capability.maxReferenceImages>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Cn=B(_n,[[`render`,Sn],[`__scopeId`,`data-v-591ef66f`]]),wn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),Tn={key:0,class:`relative`},En={class:`flex min-h-8 items-center pr-20`},Dn={class:`flex justify-start items-center`},On={class:`text-sm font-bold`};function kn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Tn,[e(`div`,En,[e(`div`,Dn,[e(`span`,On,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:t.capability.maxReferenceAudios,class:`upload-wrapper`,multiple:t.capability.maxReferenceAudios>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var An=B(wn,[[`render`,kn],[`__scopeId`,`data-v-cb408b11`]]),jn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),Mn={key:0,class:`relative`},Nn={class:`flex min-h-8 items-center pr-20`},Pn={class:`flex justify-start items-center`},Fn={class:`text-sm font-bold`};function In(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,Mn,[e(`div`,Nn,[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:t.capability.maxReferenceVideos,class:`upload-wrapper`,multiple:t.capability.maxReferenceVideos>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ln=B(jn,[[`render`,In],[`__scopeId`,`data-v-c0492201`]]),Rn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:j},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return z(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),zn={key:0,class:`field`},Bn={class:`label`},Vn={class:`box`},Hn={class:`title font-bold`},Un={class:`value`};function Wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,zn,[e(`div`,Bn,[e(`div`,Vn,[e(`h2`,Hn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Un,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Gn=B(Rn,[[`render`,Wn],[`__scopeId`,`data-v-edea5451`]]),Kn=v({name:`SeedanceAdvanced25Settings`,components:{ElOption:b,ElSelect:y,ElSwitch:O,InfoIcon:j},computed:{visible(){return this.$store.state.seedance?.config?.model===de},taskType:{get(){return this.$store.state.seedance?.config?.omni_reference_task_type||`auto`},set(e){this.updateConfig({omni_reference_task_type:e})}},outputFormat:{get(){return this.$store.state.seedance?.config?.output_format||`mp4`},set(e){this.updateConfig({output_format:e})}},webSearch:{get(){return this.$store.state.seedance?.config?.web_search===!0},set(e){this.updateConfig({web_search:e})}}},methods:{updateConfig(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,...e})}}}),qn={key:0,class:`space-y-4`},Jn={class:`field`},Yn={class:`label`},Xn={class:`title font-bold`},Zn={class:`field`},Qn={class:`label`},$n={class:`title font-bold`},er={class:`field`},tr={class:`label`},nr={class:`title font-bold`};function rr(t,n,r,c,u,d){let f=l(`info-icon`),m=l(`el-option`),h=l(`el-select`),_=l(`el-switch`);return t.visible?(g(),s(`div`,qn,[e(`div`,Jn,[e(`div`,Yn,[e(`h2`,Xn,i(t.$t(`seedance.name.taskType`)),1),a(f,{content:t.$t(`seedance.description.taskType`),class:`info`},null,8,[`content`])]),a(h,{modelValue:t.taskType,"onUpdate:modelValue":n[0]||=e=>t.taskType=e,class:`value`},{default:p(()=>[a(m,{value:`auto`,label:t.$t(`seedance.taskType.auto`)},null,8,[`label`]),a(m,{value:`reference`,label:t.$t(`seedance.taskType.reference`)},null,8,[`label`]),a(m,{value:`edit`,label:t.$t(`seedance.taskType.edit`)},null,8,[`label`]),a(m,{value:`extend`,label:t.$t(`seedance.taskType.extend`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`seedance.name.outputFormat`)),1)]),a(h,{modelValue:t.outputFormat,"onUpdate:modelValue":n[1]||=e=>t.outputFormat=e,class:`value`},{default:p(()=>[a(m,{value:`mp4`,label:`MP4`}),a(m,{value:`mov`,label:`MOV`})]),_:1},8,[`modelValue`])]),e(`div`,er,[e(`div`,tr,[e(`h2`,nr,i(t.$t(`seedance.name.webSearch`)),1),a(f,{content:t.$t(`seedance.description.webSearch`),class:`info`},null,8,[`content`])]),a(_,{modelValue:t.webSearch,"onUpdate:modelValue":n[2]||=e=>t.webSearch=e},null,8,[`modelValue`])])])):o(``,!0)}var ir=B(Kn,[[`render`,rr],[`__scopeId`,`data-v-b4dd64f6`]]),ar=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:j},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),or={class:`field`},sr={class:`label`},cr={class:`box`},lr={class:`title font-bold`},ur={class:`value`};function dr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,or,[e(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,ur,[a(f,{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`])])])}var fr=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElAlert:C,ElButton:J,PromptInput:rt,ModelSelector:ut,DurationSelector:_t,ResolutionSelector:Tt,RatioSelector:It,GenerateAudioSwitch:Wt,CameraFixedSwitch:Qt,ReturnLastFrameSwitch:Gn,Advanced25Settings:ir,SeedInput:B(ar,[[`render`,dr],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:ln,LastFrameImage:gn,ReferenceImage:Cn,ReferenceAudio:An,ReferenceVideo:Ln,ServicePricingSummary:Le,ScenarioPaymentMode:Ve},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){let{request:e,reject:t}=$(this.config);return!t&&qe(`seedance`,e)},config(){return this.$store.state.seedance?.config},capability(){return z(this.config?.model)},inputModes(){return Q(this.config)},consumption(){return we(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service},walletMode(){return Te()&&Y(`seedance`).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=Y(`seedance`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=Y(`seedance`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;let{request:n}=$(this.config);try{if(!n)return;let r=await G.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`,this.walletMode?void 0:this.consumption)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={key:0,class:`input-mode-guide mb-4`},gr={class:`flex flex-col items-center justify-center px-5 pb-5`};function _r(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`generate-audio-switch`),S=l(`camera-fixed-switch`),C=l(`return-last-frame-switch`),w=l(`advanced25-settings`),T=l(`seed-input`),E=l(`el-alert`),D=l(`first-frame-image`),O=l(`last-frame-image`),k=l(`reference-image`),A=l(`reference-audio`),j=l(`reference-video`),M=l(`scenario-payment-mode`),N=l(`service-pricing-summary`),ee=l(`magic-icon`),P=l(`el-button`);return g(),s(`div`,pr,[e(`div`,mr,[a(h,{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`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.capability.acceptsReferenceImage?(g(),s(`div`,hr,[e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.frames`)),1),r(` `+i(t.$t(`seedance.description.frameMode`)),1)]),e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.reference`)),1),r(` `+i(t.$t(`seedance.description.referenceMode`)),1)])])):o(``,!0),t.inputModes.mixed?(g(),f(E,{key:1,class:`mb-4`,type:`warning`,closable:!1,title:t.$t(`seedance.message.frameReferenceConflict`),"show-icon":``},null,8,[`title`])):o(``,!0),a(D,{class:`mb-4`}),a(O,{class:`mb-4`}),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),a(j,{class:`mb-4`})]),e(`div`,gr,[a(M,{scenario:`seedance`}),t.walletMode?o(``,!0):(g(),f(N,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(P,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(ee,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vr=B(fr,[[`render`,_r],[`__scopeId`,`data-v-0b17b09f`]]),yr=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:I,ApplicationIcon:k,ChannelIcon:te,FullscreenIcon:ee,InfoIcon:ne,MagicIcon:R,TimeIcon:A,VolumeIcon:ie,WarningIcon:re,CopyToClipboard:Pe,ElAlert:C,VideoPlayer:ze,ElTooltip:S,ElButton:J,ImageWrapper:Je,ImagePreview:X,AudioPreview:Re,VideoPreview:Be,ApiCodeButton:He,ReportButton:Fe},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Oe.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(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),br={class:`preview`},xr={class:`left`},Sr={class:`main`},Cr={class:`bot`},wr={class:`datetime`},Tr=[`aria-label`],Er={class:`info`},Dr={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Or={key:1,class:`prompt mt-2`},kr={key:0},Ar={key:1},jr={key:0,class:n({content:!0})},Mr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Nr={key:1,class:n({content:!0})},Pr={key:0,class:`mb-4`},Fr={key:1,class:`mb-4`},Ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Br={key:0},Vr={key:1},Hr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kr={key:2,class:n({content:!0})},qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Zr={key:3,class:n({content:!0})},Qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ei(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`report-button`),ee=l(`application-icon`),P=l(`fullscreen-icon`),te=l(`volume-icon`),F=l(`channel-icon`),ne=l(`warning-icon`),I=l(`info-icon`);return g(),s(`div`,br,[e(`div`,xr,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Sr,[e(`div`,Cr,[a(y,{capability:`seedance`,part:`name`}),e(`span`,wr,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Tr)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Er,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Dr,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Or,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Ar,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kr,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Nr,[n.video?.video_url?(g(),s(`div`,Pr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Fr,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ir,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`]),a(N,{service:`seedance`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lr,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Rr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,zr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,Br,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,Vr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,Hr,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,Ur,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Wr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Gr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Kr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Jr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,Yr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Xr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Zr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,$r,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,jr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Mr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var ti=v({name:`SeedanceRecentPanel`,components:{TaskPreview:B(yr,[[`render`,ei],[`__scopeId`,`data-v-a9336aee`]]),BotPlaceholder:Ue,NoTasks:P,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ni={key:0},ri={key:2,class:`w-full h-full flex items-center justify-center`};function ii(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`,ni,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-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=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ri,[a(v)])):o(``,!0)],64)}var ai=v({name:`SeedanceIndex`,components:{ConfigPanel:vr,Layout:et,RecentPanel:B(ti,[[`render`,ii]]),ShowcaseResultTabs:Ge},mixins:[Ne,Ke(`seedance`),We(`seedance`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks},walletMode(){return Te()&&Y(`seedance`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`seedance/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await F({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){let{request:t,reject:n}=$(this.config);if(n){let e=n===`generationInputRequired`?`common.message.generationInputRequired`:`seedance.message.${n}`;T.warning(this.$t(e));return}if(!je(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!t)return;let r;if(this.walletMode){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}r=G.generate(t,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ke())return;let e=this.credential?.token;if(!e)return;r=G.generate(t,{token:e})}let i=T.info(this.$t(`seedance.message.startingTask`));De(`seedance`,r).then(e=>{i.close();let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(t=>{i.close();let n=t?.response?.data;t instanceof Me||Ee(t,`seedance`,e)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(n?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Ae(this.$wallet)},async confirmWalletPayment(e){return Oe.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 oi(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:`seedance`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var si=B(ai,[[`render`,oi]]);export{si as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-BrdGcmQV.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-Drsa0R-y.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{t as E}from"./drawer-yTqzLaen.js";import{t as D}from"./input-number-BCjyae0g.js";import{t as O}from"./switch-B1g5dw5D.js";import{t as k}from"./box-BcHSnpH-.js";import{t as A}from"./clock-D_pf_5A-.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-50HEMFzY.js";import{t as ee}from"./image-mOJ1ByjJ.js";import{t as te}from"./info-AmBm9Cbx.js";import{t as ne}from"./trash-2-qsTysEar.js";import{t as re}from"./triangle-alert-wPWJieth.js";import{t as ie}from"./upload-CYNoIKvu.js";import{t as L}from"./wand-sparkles-B76KgpVz.js";import{t as ae}from"./zap-BDXCQHvY.js";import{An as R,Fn as oe,In as se,Mn as ce,Nn as z,On as B,Pn as V,Rn as H,jn as U,zn as W}from"./constants-CmC-0Hwp.js";import{A as G,Cn as le,La as ue,O as de,Qi as fe,Va as K,aa as pe,at as me,ct as he,et as ge,it as _e,nr as ve,ot as ye,st as be,to as q}from"./index-DM6hrjyQ.js";import{t as xe}from"./CopyToClipboard-CCt1tvH4.js";import{t as Se}from"./ReportButton-57emj3Ag.js";import{t as J}from"./ImagePreview-HVDfPxCI.js";import{n as Ce}from"./taskDrawerMixin-DyAUhFEq.js";import{t as we}from"./ServicePricingSummary-C5wco0tz.js";import{t as Te}from"./ApiCodeButton-CGRTnBjA.js";import{t as Ee}from"./BotPlaceholder-B285f5nu.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-CQ3vtIJe.js";import{t as ke}from"./showcaseRecreateMixin-TEhFBc7v.js";import{n as Ae,t as je}from"./generationInput-3_W3r_nF.js";import{t as Me}from"./ImageWrapper-DJusX6F3.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:M},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 V:return{image:!0,imageRequired:!1,maxInputImages:10,sizeTiers:[`1K`,H,`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 z: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 U: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 R: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`,H,`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:j,ImagePreview:J},mixins:[he,be,me,ge],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:j},data(){return{revertKey:0,options:[{value:V,label:this.$t(`seedream.model.seedream50pro`)},{value:z,label:this.$t(`seedream.model.seedream50`)},{value:U,label:this.$t(`seedream.model.seedream45`)},{value:R,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`?z: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:B},n=X(t,{model:B});this.$store.commit(`seedream/setConfig`,Z(t,n,{model:B}))},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:j},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:j},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:j},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:j},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:j},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 le({...e,action:this.action,model:W(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:F,ImageIcon:ee,InfoIcon:te,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 W(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:P,ScrollList:N},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:[ye,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 I({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`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(!_e(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(!pe())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}T.info(this.$t(`seedream.message.startingTask`)),fe(`seedream`,ve.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-vXURdu1n.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-DhzXpaev.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{t as E}from"./drawer-D-nvOajb.js";import{t as D}from"./input-number-BirnWaVC.js";import{t as O}from"./switch-DsvSpAPL.js";import{t as k}from"./box-BCNuHUlh.js";import{t as A}from"./clock-B-p2Z5fl.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-CdEqT6nu.js";import{t as ee}from"./image-B-M2bJ6h.js";import{t as te}from"./info-BQSzmvEK.js";import{t as ne}from"./trash-2-CuwbroP3.js";import{t as re}from"./triangle-alert-CXwoT9L1.js";import{t as ie}from"./upload-_ak4mf2P.js";import{t as L}from"./wand-sparkles-DKunfvfr.js";import{t as ae}from"./zap-Bs0LoGjL.js";import{An as R,Fn as oe,In as se,Mn as ce,Nn as z,On as B,Pn as V,Rn as H,jn as U,zn as W}from"./constants-CmC-0Hwp.js";import{A as G,Cn as le,La as ue,O as de,Qi as fe,Va as K,aa as pe,at as me,ct as he,et as ge,it as _e,nr as ve,ot as ye,st as be,to as q}from"./index-DqV-SJ5V.js";import{t as xe}from"./CopyToClipboard-BGKJYLUb.js";import{t as Se}from"./ReportButton-CNzy8ytz.js";import{t as J}from"./ImagePreview-BI2WtJD9.js";import{n as Ce}from"./taskDrawerMixin-DyAUhFEq.js";import{t as we}from"./ServicePricingSummary-DDotAm8d.js";import{t as Te}from"./ApiCodeButton-DyCQcWPT.js";import{t as Ee}from"./BotPlaceholder-BrT2BqT3.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-D6syzWr0.js";import{t as ke}from"./showcaseRecreateMixin-BTTx6P4V.js";import{n as Ae,t as je}from"./generationInput-CuX9cjvY.js";import{t as Me}from"./ImageWrapper-UDtY3eN8.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:M},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 V:return{image:!0,imageRequired:!1,maxInputImages:10,sizeTiers:[`1K`,H,`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 z: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 U: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 R: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`,H,`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:j,ImagePreview:J},mixins:[he,be,me,ge],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:j},data(){return{revertKey:0,options:[{value:V,label:this.$t(`seedream.model.seedream50pro`)},{value:z,label:this.$t(`seedream.model.seedream50`)},{value:U,label:this.$t(`seedream.model.seedream45`)},{value:R,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`?z: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:B},n=X(t,{model:B});this.$store.commit(`seedream/setConfig`,Z(t,n,{model:B}))},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:j},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:j},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:j},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:j},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:j},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 le({...e,action:this.action,model:W(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:F,ImageIcon:ee,InfoIcon:te,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 W(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:P,ScrollList:N},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:[ye,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 I({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`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(!_e(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(!pe())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}T.info(this.$t(`seedream.message.startingTask`)),fe(`seedream`,ve.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};