@acedatacloud/nexior 3.374.0 → 3.375.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/assets/{ApiCodeButton-DBIIyPcm.js → ApiCodeButton-CpRdry19.js} +1 -1
  2. package/dist/assets/{ApiCodeDialog-SgTrP35-.js → ApiCodeDialog-DQHdLFaR.js} +1 -1
  3. package/dist/assets/{Artifacts-Bv8c6c23.js → Artifacts-fyaNSRoG.js} +1 -1
  4. package/dist/assets/{AskUserQuestionCard-5upmtI3F.js → AskUserQuestionCard-zjS9mzsZ.js} +1 -1
  5. package/dist/assets/{AudioPreview-CO5m-MPN.js → AudioPreview-Ca5mIJa5.js} +1 -1
  6. package/dist/assets/{Auth-C_3Q01T9.js → Auth-DPiRRvu4.js} +1 -1
  7. package/dist/assets/{Bare-Bgcy9ZBE.js → Bare-Vrvyud2o.js} +1 -1
  8. package/dist/assets/{BotPlaceholder-D9exsWtJ.js → BotPlaceholder-IDq9_Pl7.js} +1 -1
  9. package/dist/assets/{BottomFooter-Cpt55XyN.js → BottomFooter-B5jPrf43.js} +1 -1
  10. package/dist/assets/{BrowseConnectors-DDaCrhbs.js → BrowseConnectors-BbaZ-3Gl.js} +1 -1
  11. package/dist/assets/{BrowserPairingDialog-BrWPFDvv.js → BrowserPairingDialog-DGJRNlEF.js} +1 -1
  12. package/dist/assets/{Callback-Dxh5oYOa.js → Callback-CAXJEbR2.js} +1 -1
  13. package/dist/assets/{CodeSnippet-BsfF8y-K.js → CodeSnippet-C6tRl74T.js} +1 -1
  14. package/dist/assets/{Console-DX8ah6RZ.js → Console-Bxt_sQHu.js} +1 -1
  15. package/dist/assets/{Conversation-jOky6QFU.js → Conversation-NzkF1Blx.js} +1 -1
  16. package/dist/assets/{Conversation-CGF5Pv35.js → Conversation-Uf07xeEj.js} +1 -1
  17. package/dist/assets/{CopyToClipboard-CaPuzTeQ.js → CopyToClipboard-Db0qgR8j.js} +1 -1
  18. package/dist/assets/{Detail-Do_URYhR.js → Detail-BBG1XhXL.js} +1 -1
  19. package/dist/assets/{Extra-BALtwRjN.js → Extra-C_ZcHH2P.js} +1 -1
  20. package/dist/assets/{FilePreview-D9sljXpn.js → FilePreview-D99je5SC.js} +1 -1
  21. package/dist/assets/{Hailuo-Dqi6oENw.js → Hailuo-DL88nkFd.js} +1 -1
  22. package/dist/assets/{History-BnMHhtb9.js → History-dm4QC9PX.js} +1 -1
  23. package/dist/assets/{ImagePreview-DBaF-RWM.js → ImagePreview-BlNKx02Q.js} +1 -1
  24. package/dist/assets/{ImageWrapper-B7c3P7Rp.js → ImageWrapper-DnHe8CWn.js} +1 -1
  25. package/dist/assets/{Index-h8LHd7to.js → Index-6xPeGiTS.js} +1 -1
  26. package/dist/assets/{Index-D6RtTR0S.js → Index-B-tQAqdN.js} +1 -1
  27. package/dist/assets/{Index-o2Kv6S1v.js → Index-BCPqRkqx.js} +1 -1
  28. package/dist/assets/{Index-D2u3DAyP.js → Index-BDKr6UVg.js} +1 -1
  29. package/dist/assets/{Index-DHNhF-7Z.js → Index-BQcKkBQV.js} +1 -1
  30. package/dist/assets/{Index-B_e8X3lR.js → Index-BUFuoJpW.js} +1 -1
  31. package/dist/assets/{Index-D2uwTXnV.js → Index-B_lskLcP.js} +1 -1
  32. package/dist/assets/{Index-CBWvzpUv.js → Index-B_uNsFCN.js} +1 -1
  33. package/dist/assets/{Index-CgZQ_vHY.js → Index-C2Hutsln.js} +1 -1
  34. package/dist/assets/{Index-DuK9WzML.js → Index-CAG_Matm.js} +1 -1
  35. package/dist/assets/{Index-C3Xg5_rD.js → Index-CMkmQzkv.js} +1 -1
  36. package/dist/assets/{Index-D0VEtNow.js → Index-CPfJIKxq.js} +1 -1
  37. package/dist/assets/{Index-C5n7st14.js → Index-CUnqIKna.js} +1 -1
  38. package/dist/assets/{Index-C-MhLOpV.js → Index-CUvYnUrv.js} +1 -1
  39. package/dist/assets/{Index-BRcf8_aI.js → Index-CcIAplCO.js} +1 -1
  40. package/dist/assets/{Index-DEg9qoqB.js → Index-CfWu7MOz.js} +1 -1
  41. package/dist/assets/{Index-6EQp8Djd.js → Index-Cfu97lFN.js} +1 -1
  42. package/dist/assets/{Index-DZeE-ePv.js → Index-CjTjUpNt.js} +1 -1
  43. package/dist/assets/{Index-rnPbAWjw.js → Index-Cmn9yVV_.js} +1 -1
  44. package/dist/assets/{Index-lqpxMyXe.js → Index-Cns2moIZ.js} +1 -1
  45. package/dist/assets/{Index-LRgJ_nsN.js → Index-CrJEhROj.js} +1 -1
  46. package/dist/assets/{Index-DNEKHbbD2.js → Index-CysG2Ayn2.js} +1 -1
  47. package/dist/assets/{Index-N-brMCrR.js → Index-D2Tx3TCq.js} +1 -1
  48. package/dist/assets/{Index-BfvWsCCs.js → Index-DAlEnN66.js} +1 -1
  49. package/dist/assets/{Index-Dibj94eG.js → Index-DBDW2JkF.js} +1 -1
  50. package/dist/assets/{Index-DgOG6dMN.js → Index-DJDMoG-n.js} +1 -1
  51. package/dist/assets/{Index-DN1YZ-qD.js → Index-DROvjae_.js} +1 -1
  52. package/dist/assets/{Index-Bn8GR3Dp.js → Index-DT7VoneT.js} +1 -1
  53. package/dist/assets/{Index-D0dMY9JE.js → Index-DgwZrNrV.js} +1 -1
  54. package/dist/assets/{Index-DyHHY0TK.js → Index-DjsmPBRY.js} +1 -1
  55. package/dist/assets/{Index-Cxnk8D6L.js → Index-DpH023Wn.js} +1 -1
  56. package/dist/assets/{Index-BfEjGMYY.js → Index-DqI9S1Qv.js} +1 -1
  57. package/dist/assets/{Index-Cioeau9t.js → Index-DtzDibDm.js} +1 -1
  58. package/dist/assets/{Index-h7_JkwcG.js → Index-Jg0_Ku-L.js} +1 -1
  59. package/dist/assets/{Index-CH0Qtl-U.js → Index-WsRj_MOo.js} +1 -1
  60. package/dist/assets/{Index-Dq-UvUyY.js → Index-yNIuTCiR.js} +1 -1
  61. package/dist/assets/{Invitees-C7Z_tbfl.js → Invitees-DPqPcVpZ.js} +1 -1
  62. package/dist/assets/{List-neAXCyf2.js → List-BkjalFU4.js} +1 -1
  63. package/dist/assets/{List-D3pfOeks.js → List-C2WOJkui.js} +1 -1
  64. package/dist/assets/{List-sKWhZB_b.js → List-sGWA28Vp.js} +1 -1
  65. package/dist/assets/{LocalTools-Co4IuNQp.js → LocalTools-BsUYypvZ.js} +1 -1
  66. package/dist/assets/{LocalTools-CURjPTl3.js → LocalTools-DMPBDPUy.js} +1 -1
  67. package/dist/assets/{Logo-CcnyAHG2.js → Logo-a_IUpjyi.js} +1 -1
  68. package/dist/assets/{Main-Bh0TsiI3.js → Main-CXPtVUVE.js} +1 -1
  69. package/dist/assets/{Message-CkA6luHF.js → Message-DiVAOITE.js} +1 -1
  70. package/dist/assets/{Model-BY0CeF_w.js → Model-DtIwYhY2.js} +1 -1
  71. package/dist/assets/{Navigator-vxqlT7Zw.js → Navigator-CdBpZH4M.js} +3 -3
  72. package/dist/assets/{NotFound-DeOf4Lmk.js → NotFound-CXiMJNHM.js} +1 -1
  73. package/dist/assets/{PageHeader-CoIHTlzp.js → PageHeader-I_IWLi_J.js} +1 -1
  74. package/dist/assets/{Pay-D1qVtYXO.js → Pay-BWM8ZekE.js} +1 -1
  75. package/dist/assets/{Player-WwC32zK4.js → Player-BUZdaSKw.js} +1 -1
  76. package/dist/assets/{Poivelle-w3LUq8sQ.js → Poivelle-CMxBTbVF.js} +1 -1
  77. package/dist/assets/{RealtimeCall-DEptKr-y.js → RealtimeCall-KU7v4FMN.js} +1 -1
  78. package/dist/assets/{ReportButton-DqBK7S8_.js → ReportButton-DBohgBX5.js} +1 -1
  79. package/dist/assets/{ReportDialog-BcyM6Mys.js → ReportDialog-C8y-vb_7.js} +1 -1
  80. package/dist/assets/{ScenarioPaymentMode-D9JSjV3-.js → ScenarioPaymentMode-Dr25voqT.js} +1 -1
  81. package/dist/assets/{ScheduledTasks-DlpEvJc3.js → ScheduledTasks-Db4Cgk3f.js} +1 -1
  82. package/dist/assets/{ServicePricingSummary-C1I-y6dH.js → ServicePricingSummary-CN_kQ9E8.js} +1 -1
  83. package/dist/assets/{ShowcaseGrid-6Ma1uGZt.js → ShowcaseGrid-D8Kp-zms.js} +1 -1
  84. package/dist/assets/{ShowcaseResultTabs-rMhxrzq3.js → ShowcaseResultTabs-B_aFfiMi.js} +1 -1
  85. package/dist/assets/{SolanaWalletPickerDialog-DmzZ-uJQ.js → SolanaWalletPickerDialog-Csxb3VVL.js} +1 -1
  86. package/dist/assets/{Status-CkzKt4ib.js → Status-rvZfPjPj.js} +1 -1
  87. package/dist/assets/{Subscribe-BwmBt3UL.js → Subscribe-BvWQReSy.js} +1 -1
  88. package/dist/assets/{TabSwitcher-Jf2B0-vC.js → TabSwitcher-DSv6B8Qg.js} +1 -1
  89. package/dist/assets/{Tts-BC01zHR_.js → Tts-CzUoWexU.js} +1 -1
  90. package/dist/assets/{VideoPlayer-CC3Fzeqq.js → VideoPlayer-ByFIN8Pz.js} +1 -1
  91. package/dist/assets/{VideoPreview-gtqNXvtJ.js → VideoPreview-DI5UZhOF.js} +1 -1
  92. package/dist/assets/{WriteSkillDialog-DxKxdZbp.js → WriteSkillDialog-njtydyP6.js} +1 -1
  93. package/dist/assets/{airwallexCheckout-CdX6OLbg.js → airwallexCheckout-BHNIy2Tw.js} +1 -1
  94. package/dist/assets/arrow-down-3ZwcPIyd.js +1 -0
  95. package/dist/assets/{arrow-down-wide-narrow-Bm2Z5o2d.js → arrow-down-wide-narrow-D-uOJGHw.js} +1 -1
  96. package/dist/assets/arrow-left-BUfU72AI.js +1 -0
  97. package/dist/assets/arrow-right-DU9hmChJ.js +1 -0
  98. package/dist/assets/arrow-up-CO5DClih.js +1 -0
  99. package/dist/assets/{authorizeFlow-IFKM_0Z8.js → authorizeFlow-dn4MchJ4.js} +1 -1
  100. package/dist/assets/{avatar-B1N5e5xG.js → avatar-D_IhQdl8.js} +1 -1
  101. package/dist/assets/{basic-7j1i_FPI.js → basic-DfXHoRBw.js} +1 -1
  102. package/dist/assets/{book-open-CnBkGve5.js → book-open-D4JeSvu4.js} +1 -1
  103. package/dist/assets/{box-C0GiZ7-u.js → box-BwvfBbaH.js} +1 -1
  104. package/dist/assets/{boxes-2cg2oc78.js → boxes-AV1PM_5l.js} +1 -1
  105. package/dist/assets/{brain-De0zKChZ.js → brain-D6NjGmAq.js} +1 -1
  106. package/dist/assets/{chart-no-axes-combined-DXPCYBnP.js → chart-no-axes-combined-CchjemK1.js} +1 -1
  107. package/dist/assets/{chat-D6FZdAFD.js → chat-1JKPdNAq.js} +1 -1
  108. package/dist/assets/{chat-D_cVYex_.js → chat-B7El78KB.js} +1 -1
  109. package/dist/assets/{chat-CsiZHLys.js → chat-BcTLs_NM.js} +1 -1
  110. package/dist/assets/{chat-lBYpL1ru.js → chat-Bxi3u7ju.js} +1 -1
  111. package/dist/assets/{chat-C2uqNw3P.js → chat-C-1vIYv4.js} +1 -1
  112. package/dist/assets/{chat-B3V3PQNf.js → chat-C0Su2-1J.js} +2 -2
  113. package/dist/assets/{chat-8q4HYSBH.js → chat-Cd1V35RN.js} +1 -1
  114. package/dist/assets/{chat-B_H4N5wh.js → chat-ChRpjtn3.js} +1 -1
  115. package/dist/assets/{chat-woD5EAiM.js → chat-DIPpKhoC.js} +1 -1
  116. package/dist/assets/{chat-4B5e6M7H.js → chat-DqhoZFnm.js} +1 -1
  117. package/dist/assets/{chat-Bk_GtTmW.js → chat-ZEPRHnOI.js} +1 -1
  118. package/dist/assets/{chat-Bi4-iPLs.js → chat-tVSSthP6.js} +1 -1
  119. package/dist/assets/{chat-CJbcUBPg.js → chat-v0-8emSy.js} +1 -1
  120. package/dist/assets/check-8okPvRJR.js +1 -0
  121. package/dist/assets/chevron-down-CE-v7C1Z.js +1 -0
  122. package/dist/assets/chevron-right-DRnWPhch.js +1 -0
  123. package/dist/assets/{circle-alert-FynFeKnI.js → circle-alert-CPUqplyh.js} +1 -1
  124. package/dist/assets/circle-check-PAy9V8Na.js +1 -0
  125. package/dist/assets/{circle-question-mark-C8xvGTGb.js → circle-question-mark-BdMy3-zg.js} +1 -1
  126. package/dist/assets/{clipboard-list-841pTGDa.js → clipboard-list-BlrQhAiR.js} +1 -1
  127. package/dist/assets/clock-BksO_Z0W.js +1 -0
  128. package/dist/assets/code-D-ejRMRt.js +1 -0
  129. package/dist/assets/{codingBridge-CyaSQuc1.js → codingBridge-DJQaspTz.js} +1 -1
  130. package/dist/assets/{codingBridgeNotify-CfKf4JbW.js → codingBridgeNotify-DYB7QEzg.js} +1 -1
  131. package/dist/assets/{coins-DA-dIOC6.js → coins-zEgi9zer.js} +1 -1
  132. package/dist/assets/{collapse-B_bQM9KN.js → collapse-ErXMQ5WV.js} +1 -1
  133. package/dist/assets/constants-C4mNoJOb.js +1 -0
  134. package/dist/assets/{copy-BNJ4Vvq_.js → copy-7FG4ee2f.js} +1 -1
  135. package/dist/assets/{createTaskActions-DtPQuKJS.js → createTaskActions-CrzF1_nG.js} +1 -1
  136. package/dist/assets/{date-picker-DRc3s80w.js → date-picker-ZMpEcBpW.js} +1 -1
  137. package/dist/assets/{digitalhuman-DsHsrai7.js → digitalhuman-DgMTY8rl.js} +1 -1
  138. package/dist/assets/{dollar-sign-B7sFSE65.js → dollar-sign-MqotZ43I.js} +1 -1
  139. package/dist/assets/{download-CAwranau.js → download-hDh-L00F.js} +1 -1
  140. package/dist/assets/{drawer-CkM_NHcO.js → drawer-fIKO5R-t.js} +1 -1
  141. package/dist/assets/{dropdown-Dq3sNHZD.js → dropdown-BpdvxDue.js} +1 -1
  142. package/dist/assets/{dropdown-BpefDnJp.js → dropdown-Br1nVdp7.js} +1 -1
  143. package/dist/assets/{ellipsis-POyVAzgA.js → ellipsis-DwHZbxHC.js} +1 -1
  144. package/dist/assets/{esm-Bf4QHayu.js → esm-DclO1JPL.js} +2 -2
  145. package/dist/assets/{external-link-eI3g6xpp.js → external-link-C29Uuu4h.js} +1 -1
  146. package/dist/assets/{eye-Ces_jYmy.js → eye-CgU_4WhV.js} +1 -1
  147. package/dist/assets/{file-COdWS7Yw.js → file-VWYkzRuc.js} +1 -1
  148. package/dist/assets/{file-output-Rckcbv_F.js → file-output-D92hF3YQ.js} +1 -1
  149. package/dist/assets/{file-text-DhO9-O7o.js → file-text-BHxDInDT.js} +1 -1
  150. package/dist/assets/{fish-DDjd2Wg6.js → fish-B9PEbkB-.js} +1 -1
  151. package/dist/assets/{flux-DepHkctW.js → flux-D8usFLyj.js} +1 -1
  152. package/dist/assets/{folder-B4Jjo77l.js → folder-C0Vt7TDW.js} +1 -1
  153. package/dist/assets/gauge-38IC0I72.js +1 -0
  154. package/dist/assets/{generationInput-Df1upTx9.js → generationInput-ChFil-22.js} +1 -1
  155. package/dist/assets/{globe-CEk5a0cn.js → globe-DsTAId5U.js} +1 -1
  156. package/dist/assets/{grokvideo-Co5-RZJD.js → grokvideo-CImTv2UN.js} +1 -1
  157. package/dist/assets/{hailuo-DMoPPvUl.js → hailuo-CbRlh5hS.js} +1 -1
  158. package/dist/assets/{headphones-DxEzVzix.js → headphones-DWwur3q7.js} +1 -1
  159. package/dist/assets/{history-P1COJCLH.js → history-DAREAhUe.js} +1 -1
  160. package/dist/assets/{house-qa6WrFu9.js → house-C63Sbnaj.js} +1 -1
  161. package/dist/assets/{i18n-3aZQnVTW.js → i18n-BEtZpGSv.js} +1 -1
  162. package/dist/assets/{image-DfZ-yD3f.js → image-YNq1hsaX.js} +1 -1
  163. package/dist/assets/{imageRequests-DIYH9CLr.js → imageRequests-CNbusBG4.js} +1 -1
  164. package/dist/assets/{index-BHXtbt9o.js → index-Dn-8sNW2.js} +4 -4
  165. package/dist/assets/{index.es-C_Gq4vgy.js → index.es-O4UnpgB0.js} +1 -1
  166. package/dist/assets/{info-xIzYgAiV.js → info-CX46K-2a.js} +1 -1
  167. package/dist/assets/{input-number-VyPGUhHP.js → input-number-DQQ_jclw.js} +1 -1
  168. package/dist/assets/{key-round-CL1Zurw8.js → key-round-Dx21hPfT.js} +1 -1
  169. package/dist/assets/{kling-C1-5IiSC.js → kling-CWzyPsGB.js} +1 -1
  170. package/dist/assets/{languages-CDk9EAaf.js → languages-ry74yECk.js} +1 -1
  171. package/dist/assets/{laptop-BlMF8fEG.js → laptop-CmGkKcLs.js} +1 -1
  172. package/dist/assets/{lightbulb-d6wy4poq.js → lightbulb-DEnEsxma.js} +1 -1
  173. package/dist/assets/{link-6giGq_cF.js → link-S80Vo5YT.js} +1 -1
  174. package/dist/assets/loader-circle-CMan_y4T.js +1 -0
  175. package/dist/assets/{lock-cFepzwhs.js → lock-BACuEQud.js} +1 -1
  176. package/dist/assets/{luma-Eq1wRQnR.js → luma-CsqOTNTl.js} +1 -1
  177. package/dist/assets/{maestro-0ulY9gMw.js → maestro-Dr6BVUlA.js} +1 -1
  178. package/dist/assets/{maestroLanguages-CczPeCVu.js → maestroLanguages-BvTWQBEt.js} +1 -1
  179. package/dist/assets/{mail-NnEBpr3-.js → mail-BjsX70Ra.js} +1 -1
  180. package/dist/assets/{message-circle-DBJKZmSe.js → message-circle-BnmUAMcf.js} +1 -1
  181. package/dist/assets/{mic-DPRovWzT.js → mic-Cy088pRc.js} +1 -1
  182. package/dist/assets/{midjourney-K2rr_-Oi.js → midjourney-C73M_okC.js} +1 -1
  183. package/dist/assets/{minimax-CauLdfeU.js → minimax-B_1MYCHz.js} +1 -1
  184. package/dist/assets/{mobileLocalExec-mQzutnPF.js → mobileLocalExec-DBwASoYt.js} +1 -1
  185. package/dist/assets/{models-CSuuDqRA.js → models-BWtS-s13.js} +1 -1
  186. package/dist/assets/{monitor-Cf_suH9d.js → monitor-B2Fsh0_H.js} +1 -1
  187. package/dist/assets/{mouse-pointer-2-CgCiODhx.js → mouse-pointer-2-CdL9cbWa.js} +1 -1
  188. package/dist/assets/music-2-DaPeZgoi.js +1 -0
  189. package/dist/assets/{nanobanana-yHjhfh57.js → nanobanana-DiMJfARU.js} +1 -1
  190. package/dist/assets/{omni-CauuzHoU.js → omni-CoYnCYnO.js} +1 -1
  191. package/dist/assets/{openaiimage-BR52tx59.js → openaiimage-CTa5az1H.js} +1 -1
  192. package/dist/assets/{pagination-DuM0KuRQ.js → pagination-BG96U0D_.js} +1 -1
  193. package/dist/assets/{pagination-SWvC0yg5.js → pagination-CoBnk3Ai.js} +1 -1
  194. package/dist/assets/{pagination-BeJR0FnO.js → pagination-D8iNbVKJ.js} +1 -1
  195. package/dist/assets/{palette-DldUt8tv.js → palette-COM7QAlM.js} +1 -1
  196. package/dist/assets/{paperclip-CWFcTsCu.js → paperclip-CiFF6idQ.js} +1 -1
  197. package/dist/assets/{pause-CCpGY3qg.js → pause-BOLN-wzc.js} +1 -1
  198. package/dist/assets/{pencil-CviRmSpy.js → pencil-2LG-UuFD.js} +1 -1
  199. package/dist/assets/{pika-CGSOn140.js → pika-CAtsFh44.js} +1 -1
  200. package/dist/assets/{pixverse-hqijNgdF.js → pixverse-DKsGFE5o.js} +1 -1
  201. package/dist/assets/play-tG5O8bbR.js +1 -0
  202. package/dist/assets/{plug-CCpoxaDM.js → plug-BRLAjEWN.js} +1 -1
  203. package/dist/assets/plus-oRS-6XRp.js +1 -0
  204. package/dist/assets/{poivelle-BetUJVZU.js → poivelle-G50BPl4d.js} +1 -1
  205. package/dist/assets/{popover-14jHG21y.js → popover-IhXMoX-P.js} +1 -1
  206. package/dist/assets/{producer-FVRoLWlQ.js → producer-DVOljhLQ.js} +1 -1
  207. package/dist/assets/{qrart-DyTDi4GZ.js → qrart-Dpl4PdcX.js} +1 -1
  208. package/dist/assets/{qwenimage-nE6zZ0LS.js → qwenimage-DwUPocYl.js} +1 -1
  209. package/dist/assets/{realtime-CWG_Ti28.js → realtime-FlQvxNn2.js} +1 -1
  210. package/dist/assets/{refresh-cw-LcYscKQ-.js → refresh-cw-7WsjAEts.js} +1 -1
  211. package/dist/assets/rotate-ccw-M5uJlVv8.js +1 -0
  212. package/dist/assets/rotate-cw-BclxKwik.js +1 -0
  213. package/dist/assets/{row-D_DEh6Xl.js → row-C3d900Dh.js} +1 -1
  214. package/dist/assets/search-MoJY2mLN.js +1 -0
  215. package/dist/assets/{seedance-6PiEj-B2.js → seedance-MsEPFoYf.js} +1 -1
  216. package/dist/assets/{seedream-yHV_q-Ae.js → seedream-_xRcvVI9.js} +1 -1
  217. package/dist/assets/{select-CD3MG9sV.js → select-BhxIomVL.js} +1 -1
  218. package/dist/assets/{serp-Cq0cLf_x.js → serp-C0xhKx9W.js} +1 -1
  219. package/dist/assets/{shield-Cm7slfR-.js → shield-2D4IamW1.js} +1 -1
  220. package/dist/assets/{showcase-DYvH5oMm.js → showcase-_a8WgiCY.js} +1 -1
  221. package/dist/assets/{showcaseRecreateMixin-CT2Cvorb.js → showcaseRecreateMixin-DnJxBt5l.js} +1 -1
  222. package/dist/assets/{shuffle-B1KYbijI.js → shuffle-CO64087x.js} +1 -1
  223. package/dist/assets/{siteHome-DDAyaghg.js → siteHome-2MMd6PGi.js} +1 -1
  224. package/dist/assets/{slider-BIlpcCpb.js → slider-BQmgjRhY.js} +1 -1
  225. package/dist/assets/{solana-wallets-DR-tBP0Q.js → solana-wallets-DM2n_fl5.js} +2 -2
  226. package/dist/assets/{sora-D3Oa75Xq.js → sora-E5QXxv5E.js} +1 -1
  227. package/dist/assets/{sparkles-DP6P2HKD.js → sparkles-BbBPUybn.js} +1 -1
  228. package/dist/assets/square-N1_hTOAE.js +1 -0
  229. package/dist/assets/{store-LrvK8rpV.js → store-BRVYdymv.js} +1 -1
  230. package/dist/assets/{suno-CLaEQFqS.js → suno-8BfJH1ZD.js} +1 -1
  231. package/dist/assets/{switch-CPDNjdtX.js → switch-CYqcNNsc.js} +1 -1
  232. package/dist/assets/{table-CTGYIkVp.js → table-C3DgtnsI.js} +1 -1
  233. package/dist/assets/{tabs-O76shONs.js → tabs-BRZesBUp.js} +1 -1
  234. package/dist/assets/{tag-CrzKKwWK.js → tag-CGAMSdmM.js} +1 -1
  235. package/dist/assets/{taskPolling-Cpolqm-4.js → taskPolling-BZB1PW-e.js} +1 -1
  236. package/dist/assets/terminal-DohjAQkV.js +1 -0
  237. package/dist/assets/{time-picker-CB3JdUZX.js → time-picker-DFBRIpMK.js} +1 -1
  238. package/dist/assets/{tooltip-BKeGCQnC.js → tooltip-DnBNFRyX.js} +1 -1
  239. package/dist/assets/{trash-2-1--IdOz8.js → trash-2-UoD61laP.js} +1 -1
  240. package/dist/assets/{triangle-alert-CsggA_lm.js → triangle-alert-hKICrvdJ.js} +1 -1
  241. package/dist/assets/{upload-QoHt30kH.js → upload-BHlKa9Ox.js} +1 -1
  242. package/dist/assets/{upload-C1ZLDC6M.js → upload-BK5O5g9h.js} +1 -1
  243. package/dist/assets/user-DsJxBb48.js +1 -0
  244. package/dist/assets/{veo-DgIXEVsh.js → veo-CiVi874k.js} +1 -1
  245. package/dist/assets/{video-ByywsO-8.js → video-Bktq2Sxg.js} +1 -1
  246. package/dist/assets/{volume-2-qWcpmyoS.js → volume-2-BGmJGVXb.js} +1 -1
  247. package/dist/assets/{wallet-BnFgg2rL.js → wallet-s-F28wTh.js} +1 -1
  248. package/dist/assets/{wan-CAJwbpzm.js → wan-QsfHInEx.js} +1 -1
  249. package/dist/assets/{wand-sparkles-D1YhC4me.js → wand-sparkles-C34nh3wP.js} +1 -1
  250. package/dist/assets/{web-BqjUMapP.js → web-DDV8fE0w.js} +1 -1
  251. package/dist/assets/{webextrator-D2P5CJFc.js → webextrator-DZfVHymI.js} +1 -1
  252. package/dist/assets/{zap-B41N3VAA.js → zap-CvvvDO7R.js} +1 -1
  253. package/dist/index.html +4 -4
  254. package/package.json +1 -1
  255. package/dist/assets/arrow-down-CSGt9t2E.js +0 -1
  256. package/dist/assets/arrow-left-l3XZii7G.js +0 -1
  257. package/dist/assets/arrow-right-DldGU1an.js +0 -1
  258. package/dist/assets/arrow-up-4Sf4V16e.js +0 -1
  259. package/dist/assets/check-Cmnz4Bu0.js +0 -1
  260. package/dist/assets/chevron-down-DHjWJMvN.js +0 -1
  261. package/dist/assets/chevron-right-hDs_4ftT.js +0 -1
  262. package/dist/assets/circle-check-CrhnV2f6.js +0 -1
  263. package/dist/assets/clock-B7yL_XXj.js +0 -1
  264. package/dist/assets/code-CDH4NELE.js +0 -1
  265. package/dist/assets/constants-BmcMHgPT.js +0 -1
  266. package/dist/assets/gauge-CCcCam0v.js +0 -1
  267. package/dist/assets/loader-circle-B3QYalEy.js +0 -1
  268. package/dist/assets/music-2-BgZoB-sB.js +0 -1
  269. package/dist/assets/play-gSzuLJWl.js +0 -1
  270. package/dist/assets/plus-CwKarPA6.js +0 -1
  271. package/dist/assets/rotate-ccw-Bo7KtpMu.js +0 -1
  272. package/dist/assets/rotate-cw-CD8xES6w.js +0 -1
  273. package/dist/assets/search-b_c_47BV.js +0 -1
  274. package/dist/assets/square-DuewWOOD.js +0 -1
  275. package/dist/assets/terminal-TymL8Q-5.js +0 -1
  276. package/dist/assets/user-avGCO_1o.js +0 -1
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-CD3MG9sV.js";import{t as b}from"./upload-QoHt30kH.js";import{t as x}from"./tooltip-BKeGCQnC.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-CSuuDqRA.js";import{t as T}from"./checkbox-DXMDpaxv.js";import{t as E}from"./drawer-CkM_NHcO.js";import{t as D}from"./input-number-VyPGUhHP.js";import{t as O}from"./box-C0GiZ7-u.js";import{t as k}from"./clock-B7yL_XXj.js";import{a as A,i as j,n as M,r as N,s as P,t as F}from"./pagination-BeJR0FnO.js";import{t as I}from"./image-DfZ-yD3f.js";import{t as ee}from"./info-xIzYgAiV.js";import{t as L}from"./trash-2-1--IdOz8.js";import{t as te}from"./triangle-alert-CsggA_lm.js";import{t as ne}from"./upload-C1ZLDC6M.js";import{t as R}from"./wand-sparkles-D1YhC4me.js";import{t as re}from"./zap-B41N3VAA.js";import{On as ie}from"./constants-BmcMHgPT.js";import{A as z,Ba as B,Cn as V,O as H,Wa as U,at as W,ca as G,ct as K,ea as q,et as J,fo as Y,io as X,it as ae,nr as oe,ot as se,st as ce}from"./index-BHXtbt9o.js";import{t as le}from"./CopyToClipboard-CaPuzTeQ.js";import{t as ue}from"./ReportButton-DqBK7S8_.js";import{t as Z}from"./ImagePreview-DBaF-RWM.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as fe}from"./ServicePricingSummary-C1I-y6dH.js";import{t as pe}from"./ApiCodeButton-DBIIyPcm.js";import{t as me}from"./BotPlaceholder-D9exsWtJ.js";import{t as he}from"./taskPollingMixin-CcLxtz8z.js";import{t as ge}from"./ShowcaseResultTabs-rMhxrzq3.js";import{t as _e}from"./showcaseRecreateMixin-CT2Cvorb.js";import{n as ve,t as ye}from"./generationInput-Df1upTx9.js";import{t as be}from"./ImageWrapper-B7c3P7Rp.js";var xe=_({name:`LayoutQwenImage`,components:{MagicIcon:R,ElDrawer:E,ElButton:X},mixins:[de]}),Se={class:`main flex flex-row flex-1`},Ce={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)]`},we={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Te(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Se,[e(`div`,Ce,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,we,[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 Ee=z(xe,[[`render`,Te],[`__scopeId`,`data-v-55d4f45e`]]),De=_({name:`QwenImagePromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.qwenimage?.config?.prompt},set(e){this.$store.commit(`qwenimage/setConfig`,{...this.$store.state.qwenimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Oe(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(`qwenimage.name.prompt`),info:e.$t(`qwenimage.description.prompt`),placeholder:e.$t(`qwenimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ke=z(De,[[`render`,Oe]]),Ae=e=>({image:!0}),je=_({name:`QwenImageImageInput`,components:{UploadIcon:ne,ElUpload:b,ElButton:X,InfoIcon:A,ImagePreview:Z},mixins:[K,ce,W,J],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.qwenimage?.config?.image},model(){return this.$store.state.qwenimage?.config?.model},supported(){return Ae(this.model).image}},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(){w.warning(this.$t(`qwenimage.message.uploadImageExceed`))},onError(){w.error(this.$t(`qwenimage.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`qwenimage/setConfig`,{...this.$store.state.qwenimage?.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()}}}),Me={key:0},Ne={class:`field`},Pe={class:`label`},Fe={class:`box`},Ie={class:`title font-bold`},Le={class:`value`},Re={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function ze(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`,Me,[e(`div`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`h2`,Ie,i(t.$t(`qwenimage.name.imageUrls`)),1),a(v,{content:t.$t(`qwenimage.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Le,[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:14,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default: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(`qwenimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Re,[(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 Be=z(je,[[`render`,ze],[`__scopeId`,`data-v-1c07f3a8`]]),Q=e=>{let t={...e||{}};typeof t.prompt==`string`&&(t.prompt=t.prompt.trim());let n=t.image?.length?t.image:void 0;return delete t.image,{...t,image_urls:n,watermark:!1,async:!0}},Ve=_({name:`QwenImageConfigPanel`,components:{ElButton:X,ElSelect:v,ElOption:y,ElInput:Y,ElInputNumber:D,ElCheckbox:T,PromptInput:ke,ImageInput:Be,ServicePricingSummary:fe},emits:[`generate`],computed:{canGenerate(){return ye(`qwenimage`,Q(this.config))},config(){return this.$store.state.qwenimage?.config},service(){return this.$store.state.qwenimage?.service},consumption(){return V(Q(this.config),this.service?.cost)},model:{get(){return this.config?.model||`qwen-image-3.0`},set(e){this.set({model:e})}},size:{get(){return this.config?.size||`1024*1024`},set(e){this.set({size:e})}},n:{get(){return this.config?.n||1},set(e){this.set({n:e})}},thinking:{get(){return this.config?.enable_thinking!==!1},set(e){this.set({enable_thinking:e})}}},methods:{set(e){this.$store.commit(`qwenimage/setConfig`,{...this.config,...e})}}}),He={class:`flex flex-col h-full`},Ue={class:`flex-1 overflow-y-auto p-5 space-y-4`},We={class:`px-5 pb-5`};function Ge(t,n,o,c,u,d){let f=l(`el-option`),m=l(`el-select`),g=l(`prompt-input`),_=l(`image-input`),v=l(`el-input`),y=l(`el-input-number`),b=l(`el-checkbox`),x=l(`service-pricing-summary`),S=l(`el-button`);return h(),s(`div`,He,[e(`div`,Ue,[e(`div`,null,[e(`b`,null,i(t.$t(`qwenimage.name.model`)),1),a(m,{modelValue:t.model,"onUpdate:modelValue":n[0]||=e=>t.model=e,class:`w-full`},{default:p(()=>[a(f,{value:`qwen-image-3.0`,label:`qwen-image-3.0`}),a(f,{value:`qwen-image-3.0-pro`,label:`qwen-image-3.0-pro`})]),_:1},8,[`modelValue`])]),a(g),a(_),e(`div`,null,[e(`b`,null,i(t.$t(`qwenimage.name.size`)),1),a(v,{modelValue:t.size,"onUpdate:modelValue":n[1]||=e=>t.size=e,placeholder:`1024*1024`},null,8,[`modelValue`])]),e(`div`,null,[e(`b`,null,i(t.$t(`qwenimage.name.count`)),1),a(y,{modelValue:t.n,"onUpdate:modelValue":n[2]||=e=>t.n=e,min:1,max:6},null,8,[`modelValue`])]),a(b,{modelValue:t.thinking,"onUpdate:modelValue":n[3]||=e=>t.thinking=e},{default:p(()=>[r(i(t.$t(`qwenimage.name.thinking`)),1)]),_:1},8,[`modelValue`])]),e(`div`,We,[a(x,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(S,{type:`primary`,class:`w-full`,round:``,disabled:!t.canGenerate,onClick:n[4]||=e=>t.$emit(`generate`)},{default:p(()=>[r(i(t.$t(`qwenimage.button.generate`)),1)]),_:1},8,[`disabled`])])])}var Ke=z(Ve,[[`render`,Ge]]),qe=_({name:`QwenImageTaskPreview`,components:{DeleteIcon:L,ApplicationIcon:O,ChannelIcon:P,ImageIcon:I,InfoIcon:ee,LightningIcon:re,MagicIcon:R,TimeIcon:k,WarningIcon:te,CopyToClipboard:le,ElAlert:S,ImageWrapper:be,ElButton:X,ElTooltip:x,ImagePreview:Z,ApiCodeButton:pe,ReportButton:ue},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return Q(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image_urls)&&(this.modelValue?.request?.image_urls?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`qwenimage/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},shortModel(e){return ie(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.qwenimage?.config||{}};t.image=[e],this.$store.commit(`qwenimage/setConfig`,t)}}}),Je={class:`preview`},Ye={class:`left`},Xe={class:`main`},Ze={class:`bot`},Qe={class:`datetime`},$e=[`aria-label`],et={class:`info`},tt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},nt={key:1,class:`prompt mt-2`},rt={key:0},it={key:0,class:n({content:!0})},at={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ot={key:1,class:n({content:!0,failed:!0})},st={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},ct={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},lt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ut={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ht={key:2,class:`content`},gt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},St={key:3,class:n({content:!0})},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Tt(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`,Je,[e(`div`,Ye,[a(y,{capability:`qwenimage`,part:`avatar`,class:`avatar`})]),e(`div`,Xe,[e(`div`,Ze,[a(y,{capability:`qwenimage`,part:`name`}),e(`span`,Qe,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,$e)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,et,[Array.isArray(n.modelValue?.request?.image_urls)&&n.modelValue?.request?.image_urls.length>0?(h(),s(`div`,tt,[(h(!0),s(c,null,m(n.modelValue?.request?.image_urls,(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`,nt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,rt,` - (`+i(n.$t(`qwenimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,ot,[e(`div`,st,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(D,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,ct,[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:`/qwenimage/images`,body:n.apiRequest},null,8,[`body`]),a(A,{service:`qwenimage`,"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`,lt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,ut,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,dt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.task`))+`: `+i(n.isEdit?n.$t(`qwenimage.name.edits`):n.$t(`qwenimage.name.generate`)),1)]),e(`p`,ft,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,mt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,ht,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,gt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,_t,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,vt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.task`))+`: `+i(n.isEdit?n.$t(`qwenimage.name.edits`):n.$t(`qwenimage.name.generate`)),1)]),e(`p`,yt,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,$,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,bt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,xt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,St,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.status`)),1)]),default:p(()=>[e(`p`,Ct,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,wt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,it,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.status.pending`)),1)]),default:p(()=>[e(`p`,at,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Et=_({name:`QwenImageRecentPanel`,components:{TaskPreview:z(qe,[[`render`,Tt],[`__scopeId`,`data-v-0aeb264f`]]),BotPlaceholder:me,NoTasks:N,ScrollList:M},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.qwenimage?.tasks,items:this.$store.state.qwenimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Dt={key:0},Ot={key:2,class:`w-full h-full flex items-center justify-center`};function kt(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`,Dt,[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`,Ot,[a(v)])):o(``,!0)],64)}var At=_({name:`QwenImageIndex`,components:{ConfigPanel:Ke,Layout:Ee,RecentPanel:z(Et,[[`render`,kt]]),ShowcaseResultTabs:ge},mixins:[se,_e(`qwenimage`),he(`qwenimage`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.qwenimage?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.qwenimage?.status?.getTasks===C.Request},credential(){return this.$store.state.qwenimage?.credential},config(){return this.$store.state.qwenimage?.config},application(){return this.$store.state.qwenimage?.application},tasks(){return this.$store.state.qwenimage?.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 F({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(`qwenimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`qwenimage/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(`qwenimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){let e=Q(this.config),t=ve(`qwenimage`,e);if(t){w.error(this.$t(`common.message.${t}`));return}if(!ae(this.uploadTracker,e=>this.$t(e),e=>w.warning(e))||!G())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}w.info(this.$t(`qwenimage.message.startingTask`)),q(`qwenimage`,oe.generate(e,{token:n})).then(()=>{w.success(this.$t(`qwenimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;H(e,`qwenimage`)||w.error(this.$t(`qwenimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function jt(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:`qwenimage`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Mt=z(At,[[`render`,jt]]);export{Mt 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{r as v,t as y}from"./select-BhxIomVL.js";import{t as b}from"./upload-BHlKa9Ox.js";import{t as x}from"./tooltip-DnBNFRyX.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-BWtS-s13.js";import{t as T}from"./checkbox-DXMDpaxv.js";import{t as E}from"./drawer-fIKO5R-t.js";import{t as D}from"./input-number-DQQ_jclw.js";import{t as O}from"./box-BwvfBbaH.js";import{t as k}from"./clock-BksO_Z0W.js";import{a as A,i as j,n as M,r as N,s as P,t as F}from"./pagination-D8iNbVKJ.js";import{t as I}from"./image-YNq1hsaX.js";import{t as ee}from"./info-CX46K-2a.js";import{t as L}from"./trash-2-UoD61laP.js";import{t as te}from"./triangle-alert-hKICrvdJ.js";import{t as ne}from"./upload-BK5O5g9h.js";import{t as R}from"./wand-sparkles-C34nh3wP.js";import{t as re}from"./zap-CvvvDO7R.js";import{On as ie}from"./constants-C4mNoJOb.js";import{A as z,Ba as B,Cn as V,O as H,Wa as U,at as W,ca as G,ct as K,ea as q,et as J,fo as Y,io as X,it as ae,nr as oe,ot as se,st as ce}from"./index-Dn-8sNW2.js";import{t as le}from"./CopyToClipboard-Db0qgR8j.js";import{t as ue}from"./ReportButton-DBohgBX5.js";import{t as Z}from"./ImagePreview-BlNKx02Q.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as fe}from"./ServicePricingSummary-CN_kQ9E8.js";import{t as pe}from"./ApiCodeButton-CpRdry19.js";import{t as me}from"./BotPlaceholder-IDq9_Pl7.js";import{t as he}from"./taskPollingMixin-CcLxtz8z.js";import{t as ge}from"./ShowcaseResultTabs-B_aFfiMi.js";import{t as _e}from"./showcaseRecreateMixin-DnJxBt5l.js";import{n as ve,t as ye}from"./generationInput-ChFil-22.js";import{t as be}from"./ImageWrapper-DnHe8CWn.js";var xe=_({name:`LayoutQwenImage`,components:{MagicIcon:R,ElDrawer:E,ElButton:X},mixins:[de]}),Se={class:`main flex flex-row flex-1`},Ce={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)]`},we={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Te(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Se,[e(`div`,Ce,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,we,[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 Ee=z(xe,[[`render`,Te],[`__scopeId`,`data-v-55d4f45e`]]),De=_({name:`QwenImagePromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.qwenimage?.config?.prompt},set(e){this.$store.commit(`qwenimage/setConfig`,{...this.$store.state.qwenimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Oe(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(`qwenimage.name.prompt`),info:e.$t(`qwenimage.description.prompt`),placeholder:e.$t(`qwenimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ke=z(De,[[`render`,Oe]]),Ae=e=>({image:!0}),je=_({name:`QwenImageImageInput`,components:{UploadIcon:ne,ElUpload:b,ElButton:X,InfoIcon:A,ImagePreview:Z},mixins:[K,ce,W,J],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.qwenimage?.config?.image},model(){return this.$store.state.qwenimage?.config?.model},supported(){return Ae(this.model).image}},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(){w.warning(this.$t(`qwenimage.message.uploadImageExceed`))},onError(){w.error(this.$t(`qwenimage.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`qwenimage/setConfig`,{...this.$store.state.qwenimage?.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()}}}),Me={key:0},Ne={class:`field`},Pe={class:`label`},Fe={class:`box`},Ie={class:`title font-bold`},Le={class:`value`},Re={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function ze(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`,Me,[e(`div`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`h2`,Ie,i(t.$t(`qwenimage.name.imageUrls`)),1),a(v,{content:t.$t(`qwenimage.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Le,[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:14,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default: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(`qwenimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Re,[(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 Be=z(je,[[`render`,ze],[`__scopeId`,`data-v-1c07f3a8`]]),Q=e=>{let t={...e||{}};typeof t.prompt==`string`&&(t.prompt=t.prompt.trim());let n=t.image?.length?t.image:void 0;return delete t.image,{...t,image_urls:n,watermark:!1,async:!0}},Ve=_({name:`QwenImageConfigPanel`,components:{ElButton:X,ElSelect:v,ElOption:y,ElInput:Y,ElInputNumber:D,ElCheckbox:T,PromptInput:ke,ImageInput:Be,ServicePricingSummary:fe},emits:[`generate`],computed:{canGenerate(){return ye(`qwenimage`,Q(this.config))},config(){return this.$store.state.qwenimage?.config},service(){return this.$store.state.qwenimage?.service},consumption(){return V(Q(this.config),this.service?.cost)},model:{get(){return this.config?.model||`qwen-image-3.0`},set(e){this.set({model:e})}},size:{get(){return this.config?.size||`1024*1024`},set(e){this.set({size:e})}},n:{get(){return this.config?.n||1},set(e){this.set({n:e})}},thinking:{get(){return this.config?.enable_thinking!==!1},set(e){this.set({enable_thinking:e})}}},methods:{set(e){this.$store.commit(`qwenimage/setConfig`,{...this.config,...e})}}}),He={class:`flex flex-col h-full`},Ue={class:`flex-1 overflow-y-auto p-5 space-y-4`},We={class:`px-5 pb-5`};function Ge(t,n,o,c,u,d){let f=l(`el-option`),m=l(`el-select`),g=l(`prompt-input`),_=l(`image-input`),v=l(`el-input`),y=l(`el-input-number`),b=l(`el-checkbox`),x=l(`service-pricing-summary`),S=l(`el-button`);return h(),s(`div`,He,[e(`div`,Ue,[e(`div`,null,[e(`b`,null,i(t.$t(`qwenimage.name.model`)),1),a(m,{modelValue:t.model,"onUpdate:modelValue":n[0]||=e=>t.model=e,class:`w-full`},{default:p(()=>[a(f,{value:`qwen-image-3.0`,label:`qwen-image-3.0`}),a(f,{value:`qwen-image-3.0-pro`,label:`qwen-image-3.0-pro`})]),_:1},8,[`modelValue`])]),a(g),a(_),e(`div`,null,[e(`b`,null,i(t.$t(`qwenimage.name.size`)),1),a(v,{modelValue:t.size,"onUpdate:modelValue":n[1]||=e=>t.size=e,placeholder:`1024*1024`},null,8,[`modelValue`])]),e(`div`,null,[e(`b`,null,i(t.$t(`qwenimage.name.count`)),1),a(y,{modelValue:t.n,"onUpdate:modelValue":n[2]||=e=>t.n=e,min:1,max:6},null,8,[`modelValue`])]),a(b,{modelValue:t.thinking,"onUpdate:modelValue":n[3]||=e=>t.thinking=e},{default:p(()=>[r(i(t.$t(`qwenimage.name.thinking`)),1)]),_:1},8,[`modelValue`])]),e(`div`,We,[a(x,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(S,{type:`primary`,class:`w-full`,round:``,disabled:!t.canGenerate,onClick:n[4]||=e=>t.$emit(`generate`)},{default:p(()=>[r(i(t.$t(`qwenimage.button.generate`)),1)]),_:1},8,[`disabled`])])])}var Ke=z(Ve,[[`render`,Ge]]),qe=_({name:`QwenImageTaskPreview`,components:{DeleteIcon:L,ApplicationIcon:O,ChannelIcon:P,ImageIcon:I,InfoIcon:ee,LightningIcon:re,MagicIcon:R,TimeIcon:k,WarningIcon:te,CopyToClipboard:le,ElAlert:S,ImageWrapper:be,ElButton:X,ElTooltip:x,ImagePreview:Z,ApiCodeButton:pe,ReportButton:ue},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return Q(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image_urls)&&(this.modelValue?.request?.image_urls?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`qwenimage/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},shortModel(e){return ie(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.qwenimage?.config||{}};t.image=[e],this.$store.commit(`qwenimage/setConfig`,t)}}}),Je={class:`preview`},Ye={class:`left`},Xe={class:`main`},Ze={class:`bot`},Qe={class:`datetime`},$e=[`aria-label`],et={class:`info`},tt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},nt={key:1,class:`prompt mt-2`},rt={key:0},it={key:0,class:n({content:!0})},at={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ot={key:1,class:n({content:!0,failed:!0})},st={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},ct={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},lt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ut={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ht={key:2,class:`content`},gt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},St={key:3,class:n({content:!0})},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Tt(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`,Je,[e(`div`,Ye,[a(y,{capability:`qwenimage`,part:`avatar`,class:`avatar`})]),e(`div`,Xe,[e(`div`,Ze,[a(y,{capability:`qwenimage`,part:`name`}),e(`span`,Qe,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,$e)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,et,[Array.isArray(n.modelValue?.request?.image_urls)&&n.modelValue?.request?.image_urls.length>0?(h(),s(`div`,tt,[(h(!0),s(c,null,m(n.modelValue?.request?.image_urls,(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`,nt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,rt,` - (`+i(n.$t(`qwenimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,ot,[e(`div`,st,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(D,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,ct,[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:`/qwenimage/images`,body:n.apiRequest},null,8,[`body`]),a(A,{service:`qwenimage`,"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`,lt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,ut,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,dt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.task`))+`: `+i(n.isEdit?n.$t(`qwenimage.name.edits`):n.$t(`qwenimage.name.generate`)),1)]),e(`p`,ft,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,mt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,ht,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,gt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,_t,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,vt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.task`))+`: `+i(n.isEdit?n.$t(`qwenimage.name.edits`):n.$t(`qwenimage.name.generate`)),1)]),e(`p`,yt,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,$,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,bt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,xt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,St,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.status`)),1)]),default:p(()=>[e(`p`,Ct,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,wt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.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`,it,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.status.pending`)),1)]),default:p(()=>[e(`p`,at,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qwenimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Et=_({name:`QwenImageRecentPanel`,components:{TaskPreview:z(qe,[[`render`,Tt],[`__scopeId`,`data-v-0aeb264f`]]),BotPlaceholder:me,NoTasks:N,ScrollList:M},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.qwenimage?.tasks,items:this.$store.state.qwenimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Dt={key:0},Ot={key:2,class:`w-full h-full flex items-center justify-center`};function kt(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`,Dt,[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`,Ot,[a(v)])):o(``,!0)],64)}var At=_({name:`QwenImageIndex`,components:{ConfigPanel:Ke,Layout:Ee,RecentPanel:z(Et,[[`render`,kt]]),ShowcaseResultTabs:ge},mixins:[se,_e(`qwenimage`),he(`qwenimage`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.qwenimage?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.qwenimage?.status?.getTasks===C.Request},credential(){return this.$store.state.qwenimage?.credential},config(){return this.$store.state.qwenimage?.config},application(){return this.$store.state.qwenimage?.application},tasks(){return this.$store.state.qwenimage?.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 F({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(`qwenimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`qwenimage/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(`qwenimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){let e=Q(this.config),t=ve(`qwenimage`,e);if(t){w.error(this.$t(`common.message.${t}`));return}if(!ae(this.uploadTracker,e=>this.$t(e),e=>w.warning(e))||!G())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}w.info(this.$t(`qwenimage.message.startingTask`)),q(`qwenimage`,oe.generate(e,{token:n})).then(()=>{w.success(this.$t(`qwenimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;H(e,`qwenimage`)||w.error(this.$t(`qwenimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function jt(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:`qwenimage`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Mt=z(At,[[`render`,jt]]);export{Mt 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{r as v,t as y}from"./select-CD3MG9sV.js";import{t as b}from"./upload-QoHt30kH.js";import{t as x}from"./tooltip-BKeGCQnC.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-CSuuDqRA.js";import{t as T}from"./drawer-CkM_NHcO.js";import{t as E}from"./input-number-VyPGUhHP.js";import{t as D}from"./slider-BIlpcCpb.js";import{t as O}from"./clock-B7yL_XXj.js";import{a as k,i as A,n as j,r as ee,s as M,t as N}from"./pagination-BeJR0FnO.js";import{t as P}from"./info-xIzYgAiV.js";import{t as F}from"./trash-2-1--IdOz8.js";import{t as te}from"./triangle-alert-CsggA_lm.js";import{t as ne}from"./upload-C1ZLDC6M.js";import{t as I}from"./wand-sparkles-D1YhC4me.js";import{Mr as re,Nr as ie,jr as L}from"./constants-BmcMHgPT.js";import{A as R,Ba as z,Cn as B,O as V,Sr as H,Vi as U,Wa as W,at as G,ca as K,ct as q,ea as J,et as Y,io as X,it as ae,ot as oe,pi as se,st as ce,ui as le,xr as Z,zi as Q}from"./index-BHXtbt9o.js";import{t as ue}from"./CopyToClipboard-CaPuzTeQ.js";import{t as de}from"./ReportButton-DqBK7S8_.js";import{t as fe}from"./ImagePreview-DBaF-RWM.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./ServicePricingSummary-C1I-y6dH.js";import{t as he}from"./ScenarioPaymentMode-D9JSjV3-.js";import{t as ge}from"./ApiCodeButton-DBIIyPcm.js";import{t as _e}from"./BotPlaceholder-D9exsWtJ.js";import{t as ve}from"./taskPollingMixin-CcLxtz8z.js";import{n as ye,t as be}from"./generationInput-Df1upTx9.js";import{t as xe}from"./ImageWrapper-B7c3P7Rp.js";var Se=_({name:`LayoutFlux`,components:{MagicIcon:I,ElDrawer:T,ElButton:X},mixins:[pe]}),Ce={class:`main flex flex-row flex-1`},we={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)]`},Te={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ee(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Ce,[e(`div`,we,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Te,[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 De=R(Se,[[`render`,Ee],[`__scopeId`,`data-v-4cd4d561`]]),Oe=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`flux-dev`,label:`flux-dev`},{value:`flux-pro`,label:`flux-pro`},{value:`flux-kontext-pro`,label:`flux-kontext-pro`},{value:`flux-kontext-max`,label:`flux-kontext-max`},{value:`flux-2-flex`,label:`flux-2-flex`},{value:`flux-2-pro`,label:`flux-2-pro`},{value:`flux-2-max`,label:`flux-2-max`}]}},computed:{value:{get(){return this.$store.state.flux?.config?.model},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,model:e})}}},mounted(){this.value||=ie}}),ke={class:`field`},Ae={class:`title font-bold`};function je(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,ke,[e(`h2`,Ae,i(t.$t(`flux.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Me=R(Oe,[[`render`,je],[`__scopeId`,`data-v-e9b17945`]]),Ne=_({name:`CountSelector`,components:{ElSlider:D,InfoIcon:k,ElInputNumber:E},computed:{value:{get(){return this.$store.state.flux?.config?.count},set(e){console.debug(`set count`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,count:e})}}},mounted(){this.value||=1}}),Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`},Le={class:`flex justify-end items-center`},Re={class:`w-full`};function ze(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return h(),s(`div`,null,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,i(t.$t(`flux.name.numbers`)),1),a(d,{content:t.$t(`flux.description.numbers`)},null,8,[`content`])]),e(`div`,Le,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Re,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:1,max:4,step:1},null,8,[`modelValue`])])])}var Be=R(Ne,[[`render`,ze]]),Ve=_({name:`ActionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`generate`,label:this.$t(`flux.name.generate`)},{value:`edits`,label:this.$t(`flux.name.edits`)}]}},computed:{value:{get(){return this.$store.state.flux?.config?.action},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,action:e})}}},mounted(){this.value||=re}}),He={class:`field`},Ue={class:`title font-bold`};function We(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,He,[e(`h2`,Ue,i(t.$t(`flux.name.task`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ge=R(Ve,[[`render`,We],[`__scopeId`,`data-v-81fd05e5`]]),Ke=_({name:`ImageUrlInput`,components:{UploadIcon:ne,ElUpload:b,ElButton:X,InfoIcon:k,ImagePreview:fe},mixins:[q,ce,G,Y],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{urls:{handler(e){console.debug(`URLs changed:`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,image_url:e[0]})}}},methods:{onExceed(){w.warning(this.$t(`flux.message.uploadStartImageExceed`))},onError(){w.error(this.$t(`flux.message.uploadStartImageError`))}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`image-preview`),g=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(t.$t(`flux.name.imageUrl`)),1),a(f,{content:t.$t(`flux.description.imageUrl`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,limit:5,class:`upload-wrapper`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,multiple:!0,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,headers:t.headers},{file:p(({file:e})=>[a(m,{url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])]),default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(g,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`headers`])])}var Qe=R(Ke,[[`render`,Ze],[`__scopeId`,`data-v-9830e0c3`]]),$e=_({name:`PromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.flux?.config?.prompt},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,prompt:e})}}},mounted(){this.prompt||=``}});function et(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(`flux.name.prompt`),info:e.$t(`flux.description.prompt`),placeholder:e.$t(`flux.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var tt=R($e,[[`render`,et]]),nt=_({name:`SizeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:L}},computed:{value:{get(){return this.$store.state.flux?.config?.size},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,size:e})}}},mounted(){this.value||=`1:1`}}),rt={class:`field`},it={class:`title font-bold`};function at(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,rt,[e(`h2`,it,i(t.$t(`flux.name.ratio`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ot=R(nt,[[`render`,at],[`__scopeId`,`data-v-8c58dc91`]]),st=350,ct=_({name:`PresetPanel`,components:{MagicIcon:I,ElButton:X,PromptInput:tt,ModelSelector:Me,CountSelector:Be,ServicePricingSummary:me,ActionSelector:Ge,ImageUrlInput:Qe,SizeSelector:ot,ScenarioPaymentMode:he},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return be(`flux`,Z(this.config))},config(){return this.$store.state.flux?.config},consumption(){return B(this.config,this.service?.cost)},service(){return this.$store.state.flux?.service},walletMode(){return Q()&&U(`flux`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=U(`flux`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,st))},async refreshQuote(){if(!this.canGenerate)return;let e=U(`flux`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quote(Z(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),lt={class:`flex flex-col h-full`},ut={class:`flex-1 overflow-y-auto p-5`},dt={class:`flex flex-col items-center justify-center px-5 pb-5`};function ft(t,n,c,u,d,m){let g=l(`action-selector`),_=l(`prompt-input`),v=l(`image-url-input`),y=l(`model-selector`),b=l(`size-selector`),x=l(`count-selector`),S=l(`scenario-payment-mode`),C=l(`service-pricing-summary`),w=l(`magic-icon`),T=l(`el-button`);return h(),s(`div`,lt,[e(`div`,ut,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.action===`edits`?(h(),f(v,{key:0,class:`mb-4`})):o(``,!0),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`})]),e(`div`,dt,[a(S,{scenario:`flux`}),t.walletMode?o(``,!0):(h(),f(C,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(T,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var pt=R(ct,[[`render`,ft]]),mt=_({name:`TaskPreview`,components:{DeleteIcon:F,ElTooltip:x,ChannelIcon:M,InfoIcon:P,MagicIcon:I,TimeIcon:O,WarningIcon:te,CopyToClipboard:ue,ElAlert:S,ImageWrapper:xe,ApiCodeButton:ge,ReportButton:de},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.flux?.application},config(){return this.$store.state.flux?.config},images(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await W.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(`flux/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenImage(e){window.open(e,`_blank`)}}}),ht={class:`preview`},gt={class:`left`},_t={class:`main`},vt={class:`bot`},yt={class:`datetime`},bt=[`aria-label`],xt={class:`info`},St={key:0,class:`prompt mt-2`},Ct={key:0},wt={key:0,class:n({content:!0,failed:!0})},Tt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},Et={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},At={key:1,class:n({content:!0})},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function It(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-wrapper`),C=l(`api-code-button`),w=l(`report-button`),T=l(`channel-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`time-icon`),k=l(`el-alert`),A=l(`warning-icon`),j=l(`info-icon`);return h(),s(`div`,ht,[e(`div`,gt,[a(y,{capability:`flux`,part:`avatar`,class:`avatar`})]),e(`div`,_t,[e(`div`,vt,[a(y,{capability:`flux`,part:`name`}),e(`span`,yt,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,bt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,xt,[n.modelValue?.request?.prompt?(h(),s(`p`,St,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ct,` - (`+i(n.$t(`flux.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,wt,[e(`div`,Tt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(S,{key:t,src:e?.image_url,"raw-src":e?.image_url,"model-value":e},null,8,[`src`,`raw-src`,`model-value`]))),128))]),e(`div`,Et,[a(C,{path:`/flux/images`,body:n.modelValue?.request},null,8,[`body`]),a(w,{service:`flux`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(k,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Dt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,Ot,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.success===!1?(h(),s(`div`,At,[a(k,{closable:!1,class:`failure`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failure`)),1)]),default:p(()=>[e(`p`,jt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Mt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,$,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.modelValue?.response?o(``,!0):(h(),s(`div`,Pt,[a(k,{closable:!1,class:`info`},{template:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.status.pending`)),1)]),default:p(()=>[e(`p`,Ft,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Lt=_({name:`RecentPanel`,components:{TaskPreview:R(mt,[[`render`,It],[`__scopeId`,`data-v-7bae4285`]]),BotPlaceholder:_e,NoTasks:ee,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.flux?.tasks,items:this.$store.state.flux?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Rt={key:0},zt={key:2,class:`w-full h-full flex items-center justify-center`};function Bt(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`,Rt,[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`,zt,[a(v)])):o(``,!0)],64)}var Vt=_({name:`FluxIndex`,components:{ConfigPanel:pt,Layout:De,RecentPanel:R(Lt,[[`render`,Bt]])},mixins:[oe,ve(`flux`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.flux?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.flux?.status?.getTasks===C.Request||this.fetchingTasks},credential(){return this.$store.state.flux?.credential},config(){return this.$store.state.flux?.config},application(){return this.$store.state.flux?.application},tasks(){return this.$store.state.flux?.tasks},walletMode(){return Q()&&U(`flux`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){t===void 0||e===t||(this.$store.commit(`flux/setTasks`,void 0),await this.onGetTasks(),await this.onScrollDown())}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`flux/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`flux/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`flux/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=Z(this.config),t=ye(`flux`,e);if(t){w.error(this.$t(`common.message.${t}`));return}if(!ae(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){w.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=H.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!K())return;let t=this.credential?.token;if(!t)return;n=H.generate(e,{token:t})}w.info(this.$t(`flux.message.startingTask`)),J(`flux`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),w.success(this.$t(`flux.message.startTaskSuccess`))}).catch(e=>{if(e instanceof le)return;let t=e?.response?.data;V(e,`flux`)||(this.walletMode?w.error(this.$t(`common.x402Scenario.paymentFailed`)):w.error(this.$t(`flux.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return se(this.$wallet)},async confirmWalletPayment(e){return W.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 Ht(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Ut=R(Vt,[[`render`,Ht]]);export{Ut 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{r as v,t as y}from"./select-BhxIomVL.js";import{t as b}from"./upload-BHlKa9Ox.js";import{t as x}from"./tooltip-DnBNFRyX.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-BWtS-s13.js";import{t as T}from"./drawer-fIKO5R-t.js";import{t as E}from"./input-number-DQQ_jclw.js";import{t as D}from"./slider-BQmgjRhY.js";import{t as O}from"./clock-BksO_Z0W.js";import{a as k,i as A,n as j,r as ee,s as M,t as N}from"./pagination-D8iNbVKJ.js";import{t as P}from"./info-CX46K-2a.js";import{t as F}from"./trash-2-UoD61laP.js";import{t as te}from"./triangle-alert-hKICrvdJ.js";import{t as ne}from"./upload-BK5O5g9h.js";import{t as I}from"./wand-sparkles-C34nh3wP.js";import{Mr as re,Nr as ie,jr as L}from"./constants-C4mNoJOb.js";import{A as R,Ba as z,Cn as B,O as V,Sr as H,Vi as U,Wa as W,at as G,ca as K,ct as q,ea as J,et as Y,io as X,it as ae,ot as oe,pi as se,st as ce,ui as le,xr as Z,zi as Q}from"./index-Dn-8sNW2.js";import{t as ue}from"./CopyToClipboard-Db0qgR8j.js";import{t as de}from"./ReportButton-DBohgBX5.js";import{t as fe}from"./ImagePreview-BlNKx02Q.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./ServicePricingSummary-CN_kQ9E8.js";import{t as he}from"./ScenarioPaymentMode-Dr25voqT.js";import{t as ge}from"./ApiCodeButton-CpRdry19.js";import{t as _e}from"./BotPlaceholder-IDq9_Pl7.js";import{t as ve}from"./taskPollingMixin-CcLxtz8z.js";import{n as ye,t as be}from"./generationInput-ChFil-22.js";import{t as xe}from"./ImageWrapper-DnHe8CWn.js";var Se=_({name:`LayoutFlux`,components:{MagicIcon:I,ElDrawer:T,ElButton:X},mixins:[pe]}),Ce={class:`main flex flex-row flex-1`},we={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)]`},Te={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ee(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Ce,[e(`div`,we,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Te,[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 De=R(Se,[[`render`,Ee],[`__scopeId`,`data-v-4cd4d561`]]),Oe=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`flux-dev`,label:`flux-dev`},{value:`flux-pro`,label:`flux-pro`},{value:`flux-kontext-pro`,label:`flux-kontext-pro`},{value:`flux-kontext-max`,label:`flux-kontext-max`},{value:`flux-2-flex`,label:`flux-2-flex`},{value:`flux-2-pro`,label:`flux-2-pro`},{value:`flux-2-max`,label:`flux-2-max`}]}},computed:{value:{get(){return this.$store.state.flux?.config?.model},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,model:e})}}},mounted(){this.value||=ie}}),ke={class:`field`},Ae={class:`title font-bold`};function je(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,ke,[e(`h2`,Ae,i(t.$t(`flux.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Me=R(Oe,[[`render`,je],[`__scopeId`,`data-v-e9b17945`]]),Ne=_({name:`CountSelector`,components:{ElSlider:D,InfoIcon:k,ElInputNumber:E},computed:{value:{get(){return this.$store.state.flux?.config?.count},set(e){console.debug(`set count`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,count:e})}}},mounted(){this.value||=1}}),Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`},Le={class:`flex justify-end items-center`},Re={class:`w-full`};function ze(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return h(),s(`div`,null,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,i(t.$t(`flux.name.numbers`)),1),a(d,{content:t.$t(`flux.description.numbers`)},null,8,[`content`])]),e(`div`,Le,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Re,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:1,max:4,step:1},null,8,[`modelValue`])])])}var Be=R(Ne,[[`render`,ze]]),Ve=_({name:`ActionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`generate`,label:this.$t(`flux.name.generate`)},{value:`edits`,label:this.$t(`flux.name.edits`)}]}},computed:{value:{get(){return this.$store.state.flux?.config?.action},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,action:e})}}},mounted(){this.value||=re}}),He={class:`field`},Ue={class:`title font-bold`};function We(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,He,[e(`h2`,Ue,i(t.$t(`flux.name.task`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ge=R(Ve,[[`render`,We],[`__scopeId`,`data-v-81fd05e5`]]),Ke=_({name:`ImageUrlInput`,components:{UploadIcon:ne,ElUpload:b,ElButton:X,InfoIcon:k,ImagePreview:fe},mixins:[q,ce,G,Y],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{urls:{handler(e){console.debug(`URLs changed:`,e),this.$store.commit(`flux/setConfig`,{...this.$store.state.flux.config,image_url:e[0]})}}},methods:{onExceed(){w.warning(this.$t(`flux.message.uploadStartImageExceed`))},onError(){w.error(this.$t(`flux.message.uploadStartImageError`))}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`image-preview`),g=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(t.$t(`flux.name.imageUrl`)),1),a(f,{content:t.$t(`flux.description.imageUrl`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,limit:5,class:`upload-wrapper`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,multiple:!0,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,headers:t.headers},{file:p(({file:e})=>[a(m,{url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])]),default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(g,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`headers`])])}var Qe=R(Ke,[[`render`,Ze],[`__scopeId`,`data-v-9830e0c3`]]),$e=_({name:`PromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.flux?.config?.prompt},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,prompt:e})}}},mounted(){this.prompt||=``}});function et(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(`flux.name.prompt`),info:e.$t(`flux.description.prompt`),placeholder:e.$t(`flux.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var tt=R($e,[[`render`,et]]),nt=_({name:`SizeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:L}},computed:{value:{get(){return this.$store.state.flux?.config?.size},set(e){this.$store.commit(`flux/setConfig`,{...this.$store.state.flux?.config,size:e})}}},mounted(){this.value||=`1:1`}}),rt={class:`field`},it={class:`title font-bold`};function at(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,rt,[e(`h2`,it,i(t.$t(`flux.name.ratio`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`flux.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(g,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ot=R(nt,[[`render`,at],[`__scopeId`,`data-v-8c58dc91`]]),st=350,ct=_({name:`PresetPanel`,components:{MagicIcon:I,ElButton:X,PromptInput:tt,ModelSelector:Me,CountSelector:Be,ServicePricingSummary:me,ActionSelector:Ge,ImageUrlInput:Qe,SizeSelector:ot,ScenarioPaymentMode:he},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return be(`flux`,Z(this.config))},config(){return this.$store.state.flux?.config},consumption(){return B(this.config,this.service?.cost)},service(){return this.$store.state.flux?.service},walletMode(){return Q()&&U(`flux`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=U(`flux`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,st))},async refreshQuote(){if(!this.canGenerate)return;let e=U(`flux`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quote(Z(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),lt={class:`flex flex-col h-full`},ut={class:`flex-1 overflow-y-auto p-5`},dt={class:`flex flex-col items-center justify-center px-5 pb-5`};function ft(t,n,c,u,d,m){let g=l(`action-selector`),_=l(`prompt-input`),v=l(`image-url-input`),y=l(`model-selector`),b=l(`size-selector`),x=l(`count-selector`),S=l(`scenario-payment-mode`),C=l(`service-pricing-summary`),w=l(`magic-icon`),T=l(`el-button`);return h(),s(`div`,lt,[e(`div`,ut,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.action===`edits`?(h(),f(v,{key:0,class:`mb-4`})):o(``,!0),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`})]),e(`div`,dt,[a(S,{scenario:`flux`}),t.walletMode?o(``,!0):(h(),f(C,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(T,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var pt=R(ct,[[`render`,ft]]),mt=_({name:`TaskPreview`,components:{DeleteIcon:F,ElTooltip:x,ChannelIcon:M,InfoIcon:P,MagicIcon:I,TimeIcon:O,WarningIcon:te,CopyToClipboard:ue,ElAlert:S,ImageWrapper:xe,ApiCodeButton:ge,ReportButton:de},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.flux?.application},config(){return this.$store.state.flux?.config},images(){let e=[],t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(n=>{let r=n;t&&(r.action=t),e.push(r)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await W.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(`flux/deleteTask`,{id:e}),w.success(this.$t(`common.message.deleteTaskSuccess`))}catch{w.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenImage(e){window.open(e,`_blank`)}}}),ht={class:`preview`},gt={class:`left`},_t={class:`main`},vt={class:`bot`},yt={class:`datetime`},bt=[`aria-label`],xt={class:`info`},St={key:0,class:`prompt mt-2`},Ct={key:0},wt={key:0,class:n({content:!0,failed:!0})},Tt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},Et={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},At={key:1,class:n({content:!0})},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function It(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-wrapper`),C=l(`api-code-button`),w=l(`report-button`),T=l(`channel-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`time-icon`),k=l(`el-alert`),A=l(`warning-icon`),j=l(`info-icon`);return h(),s(`div`,ht,[e(`div`,gt,[a(y,{capability:`flux`,part:`avatar`,class:`avatar`})]),e(`div`,_t,[e(`div`,vt,[a(y,{capability:`flux`,part:`name`}),e(`span`,yt,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,bt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,xt,[n.modelValue?.request?.prompt?(h(),s(`p`,St,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ct,` - (`+i(n.$t(`flux.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,wt,[e(`div`,Tt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(S,{key:t,src:e?.image_url,"raw-src":e?.image_url,"model-value":e},null,8,[`src`,`raw-src`,`model-value`]))),128))]),e(`div`,Et,[a(C,{path:`/flux/images`,body:n.modelValue?.request},null,8,[`body`]),a(w,{service:`flux`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(k,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Dt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,Ot,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.success===!1?(h(),s(`div`,At,[a(k,{closable:!1,class:`failure`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failure`)),1)]),default:p(()=>[e(`p`,jt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Mt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,$,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.modelValue?.response?o(``,!0):(h(),s(`div`,Pt,[a(k,{closable:!1,class:`info`},{template:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.status.pending`)),1)]),default:p(()=>[e(`p`,Ft,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`flux.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Lt=_({name:`RecentPanel`,components:{TaskPreview:R(mt,[[`render`,It],[`__scopeId`,`data-v-7bae4285`]]),BotPlaceholder:_e,NoTasks:ee,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.flux?.tasks,items:this.$store.state.flux?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Rt={key:0},zt={key:2,class:`w-full h-full flex items-center justify-center`};function Bt(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`,Rt,[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`,zt,[a(v)])):o(``,!0)],64)}var Vt=_({name:`FluxIndex`,components:{ConfigPanel:pt,Layout:De,RecentPanel:R(Lt,[[`render`,Bt]])},mixins:[oe,ve(`flux`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.flux?.status?.getApplications===C.Request},tasksLoading(){return this.$store.state.flux?.status?.getTasks===C.Request||this.fetchingTasks},credential(){return this.$store.state.flux?.credential},config(){return this.$store.state.flux?.config},application(){return this.$store.state.flux?.application},tasks(){return this.$store.state.flux?.tasks},walletMode(){return Q()&&U(`flux`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){t===void 0||e===t||(this.$store.commit(`flux/setTasks`,void 0),await this.onGetTasks(),await this.onScrollDown())}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`flux/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`flux/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`flux/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=Z(this.config),t=ye(`flux`,e);if(t){w.error(this.$t(`common.message.${t}`));return}if(!ae(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){w.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=H.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!K())return;let t=this.credential?.token;if(!t)return;n=H.generate(e,{token:t})}w.info(this.$t(`flux.message.startingTask`)),J(`flux`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),w.success(this.$t(`flux.message.startTaskSuccess`))}).catch(e=>{if(e instanceof le)return;let t=e?.response?.data;V(e,`flux`)||(this.walletMode?w.error(this.$t(`common.x402Scenario.paymentFailed`)):w.error(this.$t(`flux.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return se(this.$wallet)},async confirmWalletPayment(e){return W.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 Ht(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Ut=R(Vt,[[`render`,Ht]]);export{Ut as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-DldGU1an.js";import{t as h}from"./check-Cmnz4Bu0.js";import{t as g}from"./external-link-eI3g6xpp.js";import{t as ee}from"./globe-CEk5a0cn.js";import{t as _}from"./wand-sparkles-D1YhC4me.js";import{g as v}from"./i18n-3aZQnVTW.js";import{A as y,Fn as b,N as x,i as S,io as C,r as te}from"./index-BHXtbt9o.js";var w=(e,t)=>({zh:e,en:t}),T=`https://platform.acedata.cloud/documents/studio-overview`,E=new Set([`qrart`,`pika`]),D={auth:w(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:w(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:w(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:w(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:w(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:w(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:w(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:w(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:w(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:w(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:w(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:w(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},O=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:T,desktop:D.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:T,desktop:D.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:T,desktop:D.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:T,desktop:D.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],k=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:D.nanoDesktop,mobile:D.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:D.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:D.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:D.digitalHumanDesktop}],A=p({name:`Business`,components:{ElButton:C,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:_,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},heroHeadline(){return this.site?.description?.trim()||this.$t(`index.subtitle.banner`)},referralEntryVisible(){return v(this.site,this.$store.getters?.user)},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||b()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:S.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(D.klingDesktop)},heroMobile(){return this.localizedImage(D.klingMobile)},businessShowcases(){return O.filter(e=>(e.key!==`subsites`||this.isMainSite)&&(e.key!==`distribution`||this.referralEntryVisible)).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?k:k.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?S:S.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!E.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:te[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(x())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),j={class:`landing`},M={class:`hero`},N={class:`container hero__content`},P={class:`hero__copy`},F={class:`eyebrow`},I={class:`hero__headline`},L={class:`hero__summary`},R={class:`hero__actions`},z={class:`hero__stats`},B={key:0},V={class:`hero__screens`},H={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},U={class:`macbook-frame__lid`},W={class:`macbook-frame__viewport`},G=[`src`],K={class:`phone-device hero__mobile`,"aria-hidden":`true`},q={class:`phone-device__screen`},J=[`src`],Y={id:`platform`,class:`section platform-section`},X={class:`container`},Z={class:`section-heading section-heading--wide`},Q={class:`eyebrow eyebrow--light`},ne=[`id`],re={class:`platform-story__copy`},ie={class:`story-number`},ae={class:`story-kicker`},oe={class:`feature-points`},se={class:`screen-pair screen-pair--large`},ce={class:`macbook-frame screen-pair__desktop`},le={class:`macbook-frame__lid`},ue={class:`macbook-frame__viewport`},de=[`src`,`alt`],fe={id:`creation`,class:`section creation-section`},pe={class:`container`},me={class:`section-heading`},he={class:`eyebrow eyebrow--light`},ge={class:`creation-grid`},_e={class:`macbook-frame screen-pair__desktop`},ve={class:`macbook-frame__lid`},ye={class:`macbook-frame__viewport`},be=[`src`,`alt`],xe={key:0,class:`phone-device screen-pair__mobile`},Se={class:`phone-device__screen`},Ce=[`src`],we={class:`creation-item__copy`},Te={class:`story-kicker`},Ee=[`onClick`],De={class:`section capability-section`},$={class:`container`},Oe={class:`section-heading section-heading--wide`},ke={class:`eyebrow eyebrow--light`},Ae={class:`capability-directory`},je=[`src`],Me={class:`final-cta`},Ne={class:`container final-cta__content`},Pe={class:`story-kicker`},Fe={class:`final-cta__actions`};function Ie(p,m,h,g,ee,_){let v=c(`el-button`),y=c(`magic-icon`),b=c(`globe-icon`),x=c(`confirm-icon`),S=c(`next-icon`),C=c(`external-link-icon`);return f(),o(`div`,j,[e(`section`,M,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,N,[e(`div`,P,[e(`span`,F,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,I,r(p.heroHeadline),1),e(`p`,L,r(p.$t(`index.subtitle.hero`)),1),e(`div`,R,[i(v,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(v,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,z,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),p.referralEntryVisible?(f(),o(`div`,B,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])):a(``,!0)])]),e(`div`,V,[e(`div`,H,[e(`div`,U,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,W,[e(`img`,{src:p.heroDesktop,alt:``},null,8,G)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,K,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,q,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,J)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,Y,[e(`div`,X,[e(`div`,Z,[e(`span`,Q,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,re,[e(`span`,ie,`0`+r(c+1),1),e(`p`,ae,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,oe,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(v,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(v,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,se,[e(`div`,ce,[e(`div`,le,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ue,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,de)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,ne))),128))])]),e(`section`,fe,[e(`div`,pe,[e(`div`,me,[e(`span`,he,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,ge,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,_e,[e(`div`,ve,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ye,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,be)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,xe,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,Se,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,Ce)])])):a(``,!0)],2),e(`div`,we,[e(`div`,null,[e(`p`,Te,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,Ee)])]))),128))])])]),e(`section`,De,[e(`div`,$,[e(`div`,Oe,[e(`span`,ke,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Ae,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,je),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Me,[e(`div`,Ne,[e(`div`,null,[e(`p`,Pe,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Fe,[i(v,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(v,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Le=y(A,[[`render`,Ie],[`__scopeId`,`data-v-6028c277`]]);export{Le as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-DU9hmChJ.js";import{t as h}from"./check-8okPvRJR.js";import{t as g}from"./external-link-C29Uuu4h.js";import{t as ee}from"./globe-DsTAId5U.js";import{t as _}from"./wand-sparkles-C34nh3wP.js";import{g as v}from"./i18n-BEtZpGSv.js";import{A as y,Fn as b,N as x,i as S,io as C,r as te}from"./index-Dn-8sNW2.js";var w=(e,t)=>({zh:e,en:t}),T=`https://platform.acedata.cloud/documents/studio-overview`,E=new Set([`qrart`,`pika`]),D={auth:w(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:w(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:w(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:w(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:w(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:w(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:w(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:w(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:w(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:w(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:w(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:w(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},O=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:T,desktop:D.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:T,desktop:D.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:T,desktop:D.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:T,desktop:D.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],k=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:D.nanoDesktop,mobile:D.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:D.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:D.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:D.digitalHumanDesktop}],A=p({name:`Business`,components:{ElButton:C,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:_,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},heroHeadline(){return this.site?.description?.trim()||this.$t(`index.subtitle.banner`)},referralEntryVisible(){return v(this.site,this.$store.getters?.user)},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||b()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:S.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(D.klingDesktop)},heroMobile(){return this.localizedImage(D.klingMobile)},businessShowcases(){return O.filter(e=>(e.key!==`subsites`||this.isMainSite)&&(e.key!==`distribution`||this.referralEntryVisible)).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?k:k.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?S:S.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!E.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:te[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(x())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),j={class:`landing`},M={class:`hero`},N={class:`container hero__content`},P={class:`hero__copy`},F={class:`eyebrow`},I={class:`hero__headline`},L={class:`hero__summary`},R={class:`hero__actions`},z={class:`hero__stats`},B={key:0},V={class:`hero__screens`},H={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},U={class:`macbook-frame__lid`},W={class:`macbook-frame__viewport`},G=[`src`],K={class:`phone-device hero__mobile`,"aria-hidden":`true`},q={class:`phone-device__screen`},J=[`src`],Y={id:`platform`,class:`section platform-section`},X={class:`container`},Z={class:`section-heading section-heading--wide`},Q={class:`eyebrow eyebrow--light`},ne=[`id`],re={class:`platform-story__copy`},ie={class:`story-number`},ae={class:`story-kicker`},oe={class:`feature-points`},se={class:`screen-pair screen-pair--large`},ce={class:`macbook-frame screen-pair__desktop`},le={class:`macbook-frame__lid`},ue={class:`macbook-frame__viewport`},de=[`src`,`alt`],fe={id:`creation`,class:`section creation-section`},pe={class:`container`},me={class:`section-heading`},he={class:`eyebrow eyebrow--light`},ge={class:`creation-grid`},_e={class:`macbook-frame screen-pair__desktop`},ve={class:`macbook-frame__lid`},ye={class:`macbook-frame__viewport`},be=[`src`,`alt`],xe={key:0,class:`phone-device screen-pair__mobile`},Se={class:`phone-device__screen`},Ce=[`src`],we={class:`creation-item__copy`},Te={class:`story-kicker`},Ee=[`onClick`],De={class:`section capability-section`},$={class:`container`},Oe={class:`section-heading section-heading--wide`},ke={class:`eyebrow eyebrow--light`},Ae={class:`capability-directory`},je=[`src`],Me={class:`final-cta`},Ne={class:`container final-cta__content`},Pe={class:`story-kicker`},Fe={class:`final-cta__actions`};function Ie(p,m,h,g,ee,_){let v=c(`el-button`),y=c(`magic-icon`),b=c(`globe-icon`),x=c(`confirm-icon`),S=c(`next-icon`),C=c(`external-link-icon`);return f(),o(`div`,j,[e(`section`,M,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,N,[e(`div`,P,[e(`span`,F,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,I,r(p.heroHeadline),1),e(`p`,L,r(p.$t(`index.subtitle.hero`)),1),e(`div`,R,[i(v,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(v,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,z,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),p.referralEntryVisible?(f(),o(`div`,B,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])):a(``,!0)])]),e(`div`,V,[e(`div`,H,[e(`div`,U,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,W,[e(`img`,{src:p.heroDesktop,alt:``},null,8,G)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,K,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,q,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,J)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,Y,[e(`div`,X,[e(`div`,Z,[e(`span`,Q,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,re,[e(`span`,ie,`0`+r(c+1),1),e(`p`,ae,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,oe,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(v,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(v,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,se,[e(`div`,ce,[e(`div`,le,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ue,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,de)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,ne))),128))])]),e(`section`,fe,[e(`div`,pe,[e(`div`,me,[e(`span`,he,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,ge,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,_e,[e(`div`,ve,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ye,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,be)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,xe,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,Se,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,Ce)])])):a(``,!0)],2),e(`div`,we,[e(`div`,null,[e(`p`,Te,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,Ee)])]))),128))])])]),e(`section`,De,[e(`div`,$,[e(`div`,Oe,[e(`span`,ke,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Ae,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,je),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Me,[e(`div`,Ne,[e(`div`,null,[e(`p`,Pe,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Fe,[i(v,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(v,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Le=y(A,[[`render`,Ie],[`__scopeId`,`data-v-6028c277`]]);export{Le 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-CD3MG9sV.js";import{t as x}from"./upload-QoHt30kH.js";import{t as S}from"./tooltip-BKeGCQnC.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-CSuuDqRA.js";import{t as E}from"./drawer-CkM_NHcO.js";import{t as D}from"./input-number-VyPGUhHP.js";import{t as O}from"./switch-CPDNjdtX.js";import{t as k}from"./box-C0GiZ7-u.js";import{t as A}from"./clock-B7yL_XXj.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-BeJR0FnO.js";import{t as ee}from"./image-DfZ-yD3f.js";import{t as te}from"./info-xIzYgAiV.js";import{t as ne}from"./trash-2-1--IdOz8.js";import{t as re}from"./triangle-alert-CsggA_lm.js";import{t as ie}from"./upload-C1ZLDC6M.js";import{t as L}from"./wand-sparkles-D1YhC4me.js";import{t as ae}from"./zap-B41N3VAA.js";import{Bn as R,Fn as z,In as oe,Ln as se,Mn as B,Nn as ce,Pn as V,jn as H,kn as U,zn as W}from"./constants-BmcMHgPT.js";import{A as G,Ba as le,Cn as ue,O as de,Wa as K,at as fe,ca as pe,ct as me,ea as he,et as ge,io as q,it as _e,ot as ve,rr as ye,st as be}from"./index-BHXtbt9o.js";import{t as xe}from"./CopyToClipboard-CaPuzTeQ.js";import{t as Se}from"./ReportButton-DqBK7S8_.js";import{t as J}from"./ImagePreview-DBaF-RWM.js";import{n as Ce}from"./taskDrawerMixin-DyAUhFEq.js";import{t as we}from"./ServicePricingSummary-C1I-y6dH.js";import{t as Te}from"./ApiCodeButton-DBIIyPcm.js";import{t as Ee}from"./BotPlaceholder-D9exsWtJ.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-rMhxrzq3.js";import{t as ke}from"./showcaseRecreateMixin-CT2Cvorb.js";import{n as Ae,t as je}from"./generationInput-Df1upTx9.js";import{t as Me}from"./ImageWrapper-B7c3P7Rp.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 z:return{image:!0,imageRequired:!1,maxInputImages:10,sizeTiers:[`1K`,W,`2K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!0,transparentBackground:!0};case V:case ce:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`3K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!0,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case B:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case H:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`1K`,`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!1,transparentBackground:!1};default:return He}}function Ue(e,t){return t?.length?`edit`:`generate`}var We=[`1K`,W,`2K`,`3K`,`4K`];function X(e,t){if(!e)return[];let n=Y(t.model??e.model),r=[],i=typeof e.size==`string`?e.size:void 0;Array.isArray(e.image)&&e.image.length>n.maxInputImages&&r.push({field:`image`,i18nLabel:`seedream.name.imageUrls`}),i&&(i===`adaptive`||We.includes(i)&&!n.sizeTiers.includes(i))&&r.push({field:`size`,i18nLabel:`seedream.name.size`}),e.sequential_image_generation===`auto`&&!n.groupGeneration&&r.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&r.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&r.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!n.outputFormat&&r.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),e.tools?.length&&!n.webSearch&&r.push({field:`tools`,i18nLabel:`seedream.name.webSearch`});let a=e.optimize_prompt_options?.mode;return a&&!n.promptOptimization.includes(a)&&r.push({field:`optimize_prompt_options`,i18nLabel:`seedream.name.promptOptimization`}),e.layer_decomposition&&!n.layerDecomposition&&r.push({field:`layer_decomposition`,i18nLabel:`seedream.name.layerDecomposition`}),e.background&&!n.transparentBackground&&r.push({field:`background`,i18nLabel:`seedream.name.background`}),r}function Z(e,t,n){let r={...e};for(let e of t)switch(e.field){case`image`:r.image=(r.image||[]).slice(0,Y(r.model).maxInputImages);break;case`size`:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:case`guidance_scale`:case`output_format`:case`tools`:case`optimize_prompt_options`:case`layer_decomposition`:case`background`:delete r[e.field];break}return r}var Ge=_({name:`SeedreamImageInput`,components:{UploadIcon:ie,ElUpload:x,ElButton:q,InfoIcon:j,ImagePreview:J},mixins:[me,be,fe,ge],data(){return{fileList:[],uploadUrl:le()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){let e=this.$store.state.seedream?.config?.image;return typeof e==`string`?[e]:Array.isArray(e)?e:void 0},model(){return this.$store.state.seedream?.config?.model},supported(){return Y(this.model).image},limit(){return(this.$store.state.seedream?.config||{}).layer_decomposition?1:Y(this.model).maxInputImages}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){T.warning(this.$t(`seedream.message.uploadImageExceed`,{count:this.limit}))},onError(){T.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ke={key:0},qe={class:`field`},Je={class:`label`},Ye={class:`box`},Xe={class:`title font-bold`},Ze={class:`value`},Qe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function $e(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ze,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:t.limit,multiple:t.limit>1,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Qe,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var et=G(Ge,[[`render`,$e],[`__scopeId`,`data-v-500d9564`]]),tt=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{revertKey:0,options:[{value:z,label:this.$t(`seedream.model.seedream50pro`)},{value:V,label:this.$t(`seedream.model.seedream50`)},{value:B,label:this.$t(`seedream.model.seedream45`)},{value:H,label:this.$t(`seedream.model.seedream40`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){let e=this.value===`doubao-seedream-5-0-260128`?V:this.value;if(e&&this.options.some(t=>t.value===e)){e!==this.value&&this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e});return}let t={...this.$store.state.seedream?.config||{},model:U},n=X(t,{model:U});this.$store.commit(`seedream/setConfig`,Z(t,n,{model:U}))},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await K.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),T.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),nt={class:`field`},rt={class:`label`},it={class:`box`},at={class:`title font-bold`};function ot(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,nt,[e(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=G(tt,[[`render`,ot],[`__scopeId`,`data-v-dd2c4aee`]]),ct=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon: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 ue({...e,action:this.action,model:R(e.model),input_image_count:Array.isArray(e.image)?e.image.length:+!!e.image,count:t,layer_decomposition:e.layer_decomposition===!0,layer_low_count:+!!e.layer_decomposition,regular_low_count:r&&!e.layer_decomposition&&n<=261e4?1:0,regular_high_count:r&&!e.layer_decomposition&&n>261e4?1:0},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),un={class:`flex flex-col h-full`},dn={class:`flex-1 overflow-y-auto p-5`},fn={class:`flex flex-col items-center justify-center px-5 pb-5`};function pn(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`advanced-options`),x=l(`seed-input`),S=l(`guidance-scale-input`),C=l(`prompt-input`),w=l(`image-input`),T=l(`service-pricing-summary`),E=l(`magic-icon`),D=l(`el-button`);return h(),s(`div`,un,[e(`div`,dn,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),t.capabilities.image?(h(),f(w,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,fn,[a(T,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(D,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var mn=G(ln,[[`render`,pn]]),hn=_({name:`SeedreamTaskPreview`,components:{DeleteIcon:ne,ApplicationIcon:k,ChannelIcon: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 R(e)||e},layerTitle(e,t){return e.error?this.$t(`seedream.name.failedLayer`,{index:t+1}):e.z_index===0?this.$t(`seedream.name.baseLayer`):e.name||this.$t(`seedream.name.layer`,{index:e.z_index??t+1})},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),gn={class:`preview`},_n={class:`left`},vn={class:`main`},yn={class:`bot`},bn={class:`datetime`},xn=[`aria-label`],Sn={class:`info`},Cn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},wn={key:1,class:`prompt mt-2`},Tn={key:0},En={key:0,class:n({content:!0})},Dn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},On={key:1,class:n({content:!0,failed:!0})},kn={class:`layer-grid`},An={key:1,class:`layer-meta`},jn={key:0},Mn={key:1},Nn={key:2},Pn={key:3,class:`layer-error`},Fn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},In={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ln={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vn={key:2,class:`content`},Hn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Un={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Yn={key:3,class:n({content:!0})},Xn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Qn(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`time-icon`),w=l(`magic-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`api-code-button`),A=l(`report-button`),j=l(`application-icon`),M=l(`image-icon`),N=l(`lightning-icon`),P=l(`channel-icon`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,gn,[e(`div`,_n,[a(y,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,vn,[e(`div`,yn,[a(y,{capability:`seedream`,part:`name`}),e(`span`,bn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,xn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Sn,[n.requestImages.length>0?(h(),s(`div`,Cn,[(h(!0),s(c,null,m(n.requestImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,wn,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Tn,` - (`+i(n.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,On,[e(`div`,kn,[(h(!0),s(c,null,m(n.images,(t,r)=>(h(),s(`article`,{key:r,class:`layer-card`},[t?.image_url?(h(),f(D,{key:0,src:t.image_url,"raw-src":t.image_url},null,8,[`src`,`raw-src`])):o(``,!0),n.isLayerResult||t.error?(h(),s(`div`,An,[e(`strong`,null,i(n.layerTitle(t,r)),1),t.size?(h(),s(`span`,jn,i(t.size)+` · `+i(t.output_format?.toUpperCase()),1)):o(``,!0),t.description?(h(),s(`span`,Mn,i(t.description),1)):o(``,!0),t.bounding_box?.absolute?(h(),s(`code`,Nn,i(t.bounding_box.absolute.join(`, `)),1)):o(``,!0),t.error?(h(),s(`span`,Pn,i(t.error.message||t.error.code),1)):o(``,!0)])):o(``,!0)]))),128))]),e(`div`,Fn,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:n.apiRequest},null,8,[`body`]),a(A,{service:`seedream`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,In,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Ln,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,zn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Bn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,$,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Vn,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Hn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Un,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Wn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,Gn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(h(),s(`p`,Kn,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(h(),s(`p`,qn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Jn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Yn,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,Xn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(h(),s(`p`,Zn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,En,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,Dn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var $n=_({name:`SeedreamRecentPanel`,components:{TaskPreview:G(hn,[[`render`,Qn],[`__scopeId`,`data-v-3411e2b0`]]),BotPlaceholder:Ee,NoTasks: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:[ve,ke(`seedream`),De(`seedream`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===w.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await 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`)),he(`seedream`,ye.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-BhxIomVL.js";import{t as x}from"./upload-BHlKa9Ox.js";import{t as S}from"./tooltip-DnBNFRyX.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-BWtS-s13.js";import{t as E}from"./drawer-fIKO5R-t.js";import{t as D}from"./input-number-DQQ_jclw.js";import{t as O}from"./switch-CYqcNNsc.js";import{t as k}from"./box-BwvfBbaH.js";import{t as A}from"./clock-BksO_Z0W.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-D8iNbVKJ.js";import{t as ee}from"./image-YNq1hsaX.js";import{t as te}from"./info-CX46K-2a.js";import{t as ne}from"./trash-2-UoD61laP.js";import{t as re}from"./triangle-alert-hKICrvdJ.js";import{t as ie}from"./upload-BK5O5g9h.js";import{t as L}from"./wand-sparkles-C34nh3wP.js";import{t as ae}from"./zap-CvvvDO7R.js";import{Bn as R,Fn as z,In as oe,Ln as se,Mn as B,Nn as ce,Pn as V,jn as H,kn as U,zn as W}from"./constants-C4mNoJOb.js";import{A as G,Ba as le,Cn as ue,O as de,Wa as K,at as fe,ca as pe,ct as me,ea as he,et as ge,io as q,it as _e,ot as ve,rr as ye,st as be}from"./index-Dn-8sNW2.js";import{t as xe}from"./CopyToClipboard-Db0qgR8j.js";import{t as Se}from"./ReportButton-DBohgBX5.js";import{t as J}from"./ImagePreview-BlNKx02Q.js";import{n as Ce}from"./taskDrawerMixin-DyAUhFEq.js";import{t as we}from"./ServicePricingSummary-CN_kQ9E8.js";import{t as Te}from"./ApiCodeButton-CpRdry19.js";import{t as Ee}from"./BotPlaceholder-IDq9_Pl7.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-B_aFfiMi.js";import{t as ke}from"./showcaseRecreateMixin-DnJxBt5l.js";import{n as Ae,t as je}from"./generationInput-ChFil-22.js";import{t as Me}from"./ImageWrapper-DnHe8CWn.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 z:return{image:!0,imageRequired:!1,maxInputImages:10,sizeTiers:[`1K`,W,`2K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!0,transparentBackground:!0};case V:case ce:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`3K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,webSearch:!0,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case B:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`],layerDecomposition:!1,transparentBackground:!1};case H:return{image:!0,imageRequired:!1,maxInputImages:14,sizeTiers:[`1K`,`2K`,`4K`],sizePixel:!0,sizeAdaptive:!1,sizePixelDefault:void 0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,webSearch:!1,promptOptimization:[`standard`,`fast`],layerDecomposition:!1,transparentBackground:!1};default:return He}}function Ue(e,t){return t?.length?`edit`:`generate`}var We=[`1K`,W,`2K`,`3K`,`4K`];function X(e,t){if(!e)return[];let n=Y(t.model??e.model),r=[],i=typeof e.size==`string`?e.size:void 0;Array.isArray(e.image)&&e.image.length>n.maxInputImages&&r.push({field:`image`,i18nLabel:`seedream.name.imageUrls`}),i&&(i===`adaptive`||We.includes(i)&&!n.sizeTiers.includes(i))&&r.push({field:`size`,i18nLabel:`seedream.name.size`}),e.sequential_image_generation===`auto`&&!n.groupGeneration&&r.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&r.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&r.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!n.outputFormat&&r.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),e.tools?.length&&!n.webSearch&&r.push({field:`tools`,i18nLabel:`seedream.name.webSearch`});let a=e.optimize_prompt_options?.mode;return a&&!n.promptOptimization.includes(a)&&r.push({field:`optimize_prompt_options`,i18nLabel:`seedream.name.promptOptimization`}),e.layer_decomposition&&!n.layerDecomposition&&r.push({field:`layer_decomposition`,i18nLabel:`seedream.name.layerDecomposition`}),e.background&&!n.transparentBackground&&r.push({field:`background`,i18nLabel:`seedream.name.background`}),r}function Z(e,t,n){let r={...e};for(let e of t)switch(e.field){case`image`:r.image=(r.image||[]).slice(0,Y(r.model).maxInputImages);break;case`size`:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:case`guidance_scale`:case`output_format`:case`tools`:case`optimize_prompt_options`:case`layer_decomposition`:case`background`:delete r[e.field];break}return r}var Ge=_({name:`SeedreamImageInput`,components:{UploadIcon:ie,ElUpload:x,ElButton:q,InfoIcon:j,ImagePreview:J},mixins:[me,be,fe,ge],data(){return{fileList:[],uploadUrl:le()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){let e=this.$store.state.seedream?.config?.image;return typeof e==`string`?[e]:Array.isArray(e)?e:void 0},model(){return this.$store.state.seedream?.config?.model},supported(){return Y(this.model).image},limit(){return(this.$store.state.seedream?.config||{}).layer_decomposition?1:Y(this.model).maxInputImages}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){T.warning(this.$t(`seedream.message.uploadImageExceed`,{count:this.limit}))},onError(){T.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ke={key:0},qe={class:`field`},Je={class:`label`},Ye={class:`box`},Xe={class:`title font-bold`},Ze={class:`value`},Qe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function $e(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ze,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:t.limit,multiple:t.limit>1,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Qe,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var et=G(Ge,[[`render`,$e],[`__scopeId`,`data-v-500d9564`]]),tt=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{revertKey:0,options:[{value:z,label:this.$t(`seedream.model.seedream50pro`)},{value:V,label:this.$t(`seedream.model.seedream50`)},{value:B,label:this.$t(`seedream.model.seedream45`)},{value:H,label:this.$t(`seedream.model.seedream40`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){let e=this.value===`doubao-seedream-5-0-260128`?V:this.value;if(e&&this.options.some(t=>t.value===e)){e!==this.value&&this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e});return}let t={...this.$store.state.seedream?.config||{},model:U},n=X(t,{model:U});this.$store.commit(`seedream/setConfig`,Z(t,n,{model:U}))},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await K.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),T.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),nt={class:`field`},rt={class:`label`},it={class:`box`},at={class:`title font-bold`};function ot(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,nt,[e(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=G(tt,[[`render`,ot],[`__scopeId`,`data-v-dd2c4aee`]]),ct=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon: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 ue({...e,action:this.action,model:R(e.model),input_image_count:Array.isArray(e.image)?e.image.length:+!!e.image,count:t,layer_decomposition:e.layer_decomposition===!0,layer_low_count:+!!e.layer_decomposition,regular_low_count:r&&!e.layer_decomposition&&n<=261e4?1:0,regular_high_count:r&&!e.layer_decomposition&&n>261e4?1:0},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),un={class:`flex flex-col h-full`},dn={class:`flex-1 overflow-y-auto p-5`},fn={class:`flex flex-col items-center justify-center px-5 pb-5`};function pn(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`advanced-options`),x=l(`seed-input`),S=l(`guidance-scale-input`),C=l(`prompt-input`),w=l(`image-input`),T=l(`service-pricing-summary`),E=l(`magic-icon`),D=l(`el-button`);return h(),s(`div`,un,[e(`div`,dn,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),t.capabilities.image?(h(),f(w,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,fn,[a(T,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(D,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var mn=G(ln,[[`render`,pn]]),hn=_({name:`SeedreamTaskPreview`,components:{DeleteIcon:ne,ApplicationIcon:k,ChannelIcon: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 R(e)||e},layerTitle(e,t){return e.error?this.$t(`seedream.name.failedLayer`,{index:t+1}):e.z_index===0?this.$t(`seedream.name.baseLayer`):e.name||this.$t(`seedream.name.layer`,{index:e.z_index??t+1})},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),gn={class:`preview`},_n={class:`left`},vn={class:`main`},yn={class:`bot`},bn={class:`datetime`},xn=[`aria-label`],Sn={class:`info`},Cn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},wn={key:1,class:`prompt mt-2`},Tn={key:0},En={key:0,class:n({content:!0})},Dn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},On={key:1,class:n({content:!0,failed:!0})},kn={class:`layer-grid`},An={key:1,class:`layer-meta`},jn={key:0},Mn={key:1},Nn={key:2},Pn={key:3,class:`layer-error`},Fn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},In={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ln={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vn={key:2,class:`content`},Hn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Un={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Yn={key:3,class:n({content:!0})},Xn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Qn(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`time-icon`),w=l(`magic-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`api-code-button`),A=l(`report-button`),j=l(`application-icon`),M=l(`image-icon`),N=l(`lightning-icon`),P=l(`channel-icon`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,gn,[e(`div`,_n,[a(y,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,vn,[e(`div`,yn,[a(y,{capability:`seedream`,part:`name`}),e(`span`,bn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,xn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Sn,[n.requestImages.length>0?(h(),s(`div`,Cn,[(h(!0),s(c,null,m(n.requestImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,wn,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Tn,` - (`+i(n.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,On,[e(`div`,kn,[(h(!0),s(c,null,m(n.images,(t,r)=>(h(),s(`article`,{key:r,class:`layer-card`},[t?.image_url?(h(),f(D,{key:0,src:t.image_url,"raw-src":t.image_url},null,8,[`src`,`raw-src`])):o(``,!0),n.isLayerResult||t.error?(h(),s(`div`,An,[e(`strong`,null,i(n.layerTitle(t,r)),1),t.size?(h(),s(`span`,jn,i(t.size)+` · `+i(t.output_format?.toUpperCase()),1)):o(``,!0),t.description?(h(),s(`span`,Mn,i(t.description),1)):o(``,!0),t.bounding_box?.absolute?(h(),s(`code`,Nn,i(t.bounding_box.absolute.join(`, `)),1)):o(``,!0),t.error?(h(),s(`span`,Pn,i(t.error.message||t.error.code),1)):o(``,!0)])):o(``,!0)]))),128))]),e(`div`,Fn,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:n.apiRequest},null,8,[`body`]),a(A,{service:`seedream`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,In,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Ln,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,zn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Bn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,$,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Vn,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Hn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Un,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,Wn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,Gn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(h(),s(`p`,Kn,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(h(),s(`p`,qn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Jn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Yn,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,Xn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(h(),s(`p`,Zn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,En,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,Dn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var $n=_({name:`SeedreamRecentPanel`,components:{TaskPreview:G(hn,[[`render`,Qn],[`__scopeId`,`data-v-3411e2b0`]]),BotPlaceholder:Ee,NoTasks: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:[ve,ke(`seedream`),De(`seedream`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===w.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await 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`)),he(`seedream`,ye.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};