@acedatacloud/nexior 3.373.1 → 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 (315) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/{ApiCodeButton-6CAkuLWs.js → ApiCodeButton-CpRdry19.js} +1 -1
  3. package/dist/assets/{ApiCodeDialog-BBL3r0Ad.js → ApiCodeDialog-DQHdLFaR.js} +1 -1
  4. package/dist/assets/{Artifacts-BBzKp95c.js → Artifacts-fyaNSRoG.js} +1 -1
  5. package/dist/assets/{AskUserQuestionCard-_HUmDFMG.js → AskUserQuestionCard-zjS9mzsZ.js} +1 -1
  6. package/dist/assets/{AudioPreview-c0cNd09Y.js → AudioPreview-Ca5mIJa5.js} +1 -1
  7. package/dist/assets/{Auth-D9Juhwc2.js → Auth-DPiRRvu4.js} +1 -1
  8. package/dist/assets/{Bare-BDD3PKuF.js → Bare-Vrvyud2o.js} +1 -1
  9. package/dist/assets/{BotPlaceholder-Ctu1jmvN.js → BotPlaceholder-IDq9_Pl7.js} +1 -1
  10. package/dist/assets/{BottomFooter-DjyjSVNa.js → BottomFooter-B5jPrf43.js} +1 -1
  11. package/dist/assets/{BrowseConnectors-D8RZgzhB.js → BrowseConnectors-BbaZ-3Gl.js} +1 -1
  12. package/dist/assets/{BrowserPairingDialog-B0V2Yk4Q.js → BrowserPairingDialog-DGJRNlEF.js} +1 -1
  13. package/dist/assets/{Callback-DkyawxUo.js → Callback-CAXJEbR2.js} +1 -1
  14. package/dist/assets/{CodeSnippet-BZQBj7wp.js → CodeSnippet-C6tRl74T.js} +1 -1
  15. package/dist/assets/{Console-KuCIvdPp.js → Console-Bxt_sQHu.js} +1 -1
  16. package/dist/assets/{Conversation-GudouywL.css → Conversation-Chcq_bCw.css} +1 -1
  17. package/dist/assets/Conversation-DYP2DA8I.css +1 -0
  18. package/dist/assets/Conversation-NzkF1Blx.js +1 -0
  19. package/dist/assets/Conversation-Uf07xeEj.js +2 -0
  20. package/dist/assets/{CopyToClipboard-42kl-Hqn.js → CopyToClipboard-Db0qgR8j.js} +1 -1
  21. package/dist/assets/{Detail-hWf7-jBg.js → Detail-BBG1XhXL.js} +1 -1
  22. package/dist/assets/{Detail-DsfPabsJ.css → Detail-_ZtOzPZR.css} +1 -1
  23. package/dist/assets/{Extra-Y_yMguUA.js → Extra-C_ZcHH2P.js} +1 -1
  24. package/dist/assets/{FilePreview-CbhJypON.js → FilePreview-D99je5SC.js} +1 -1
  25. package/dist/assets/{Hailuo-CzhTzWgO.js → Hailuo-DL88nkFd.js} +1 -1
  26. package/dist/assets/{History-CYEvAy2l.js → History-dm4QC9PX.js} +1 -1
  27. package/dist/assets/{ImagePreview-B6S0ASYG.js → ImagePreview-BlNKx02Q.js} +1 -1
  28. package/dist/assets/{ImageWrapper-B4zFub-J.js → ImageWrapper-DnHe8CWn.js} +1 -1
  29. package/dist/assets/{Index-CqQ02v9L.js → Index-6xPeGiTS.js} +1 -1
  30. package/dist/assets/{Index-CfJjLZ8z.js → Index-B-tQAqdN.js} +1 -1
  31. package/dist/assets/Index-BBn91pAG.css +1 -0
  32. package/dist/assets/{Index-DaADtvJI.js → Index-BCPqRkqx.js} +1 -1
  33. package/dist/assets/{Index-C5qErJd6.js → Index-BDKr6UVg.js} +1 -1
  34. package/dist/assets/{Index-DWV_YeN8.js → Index-BQcKkBQV.js} +1 -1
  35. package/dist/assets/{Index-Dbo4H6w5.js → Index-BUFuoJpW.js} +1 -1
  36. package/dist/assets/{Index-BVkewmRO.js → Index-B_lskLcP.js} +1 -1
  37. package/dist/assets/{Index-CmF2biql.js → Index-B_uNsFCN.js} +1 -1
  38. package/dist/assets/{Index-o0v293WC.js → Index-C2Hutsln.js} +1 -1
  39. package/dist/assets/{Index-D-GFYH-g.js → Index-CAG_Matm.js} +1 -1
  40. package/dist/assets/{Index-BI88Wacf.js → Index-CMkmQzkv.js} +1 -1
  41. package/dist/assets/{Index-DvdA6Nu0.js → Index-CPfJIKxq.js} +1 -1
  42. package/dist/assets/{Index-DvHze61J.js → Index-CUnqIKna.js} +1 -1
  43. package/dist/assets/{Index-DoZaeWIi.js → Index-CUvYnUrv.js} +1 -1
  44. package/dist/assets/Index-CcIAplCO.js +1 -0
  45. package/dist/assets/{Index-geRN98WC.js → Index-CfWu7MOz.js} +1 -1
  46. package/dist/assets/{Index-DiHLiOqk.js → Index-Cfu97lFN.js} +1 -1
  47. package/dist/assets/{Index-Bmr0-RQ5.js → Index-CjTjUpNt.js} +1 -1
  48. package/dist/assets/{Index-C1trk8Th.js → Index-Cmn9yVV_.js} +1 -1
  49. package/dist/assets/{Index-BAgR7gw3.js → Index-Cns2moIZ.js} +1 -1
  50. package/dist/assets/{Index-CDocvss4.js → Index-CrJEhROj.js} +1 -1
  51. package/dist/assets/{Index-AYgiT_XB2.js → Index-CysG2Ayn2.js} +1 -1
  52. package/dist/assets/{Index-DCywnW2_.js → Index-D2Tx3TCq.js} +1 -1
  53. package/dist/assets/Index-DAlEnN66.js +88 -0
  54. package/dist/assets/{Index-DDe3nR8K.js → Index-DBDW2JkF.js} +1 -1
  55. package/dist/assets/{Index-B7Ij1yi3.js → Index-DJDMoG-n.js} +1 -1
  56. package/dist/assets/{Index-D1mor9Ej.js → Index-DROvjae_.js} +1 -1
  57. package/dist/assets/{Index-VKT6sBDC.js → Index-DT7VoneT.js} +1 -1
  58. package/dist/assets/Index-Df07w6x-.css +1 -0
  59. package/dist/assets/{Index-w7hlMaP4.js → Index-DgwZrNrV.js} +1 -1
  60. package/dist/assets/{Index-DMsd_sVU.js → Index-DjsmPBRY.js} +1 -1
  61. package/dist/assets/{Index-4v6BW26v.js → Index-DpH023Wn.js} +1 -1
  62. package/dist/assets/{Index-DVns9O0z.js → Index-DqI9S1Qv.js} +1 -1
  63. package/dist/assets/{Index-CgCORA14.js → Index-DtzDibDm.js} +1 -1
  64. package/dist/assets/{Index-Q8wIt4qf.js → Index-Jg0_Ku-L.js} +1 -1
  65. package/dist/assets/{Index-UtPL4ByD.js → Index-WsRj_MOo.js} +1 -1
  66. package/dist/assets/{Index-D8-crPoz.js → Index-yNIuTCiR.js} +1 -1
  67. package/dist/assets/{Invitees-CI_dUxAr.js → Invitees-DPqPcVpZ.js} +1 -1
  68. package/dist/assets/{List-DQzikCYq.js → List-BkjalFU4.js} +1 -1
  69. package/dist/assets/{List-D1Y8JFie.js → List-C2WOJkui.js} +1 -1
  70. package/dist/assets/List-DskSS78c.css +1 -0
  71. package/dist/assets/List-sGWA28Vp.js +1 -0
  72. package/dist/assets/{LocalTools-BXG86E3M.js → LocalTools-BsUYypvZ.js} +1 -1
  73. package/dist/assets/{LocalTools-D-gm27JN.js → LocalTools-DMPBDPUy.js} +1 -1
  74. package/dist/assets/{Logo-BaD2szKx.js → Logo-a_IUpjyi.js} +1 -1
  75. package/dist/assets/{Main-Ht2ar0th.js → Main-CXPtVUVE.js} +1 -1
  76. package/dist/assets/Message-DiVAOITE.js +3 -0
  77. package/dist/assets/{Message-DpArQcCJ.css → Message-DziQP5Mk.css} +1 -1
  78. package/dist/assets/{Model-BYKe0QPe.js → Model-DtIwYhY2.js} +1 -1
  79. package/dist/assets/Navigator-CdBpZH4M.js +8 -0
  80. package/dist/assets/Navigator-CoyJaNGh.css +1 -0
  81. package/dist/assets/{NotFound-B3UuoSse.js → NotFound-CXiMJNHM.js} +1 -1
  82. package/dist/assets/{PageHeader-DCdukDGp.js → PageHeader-I_IWLi_J.js} +1 -1
  83. package/dist/assets/Pay-BWM8ZekE.js +1 -0
  84. package/dist/assets/Pay-Bk74bPkY.css +1 -0
  85. package/dist/assets/{Player-evs53Tna.js → Player-BUZdaSKw.js} +1 -1
  86. package/dist/assets/{Poivelle-CvtuHCAh.js → Poivelle-CMxBTbVF.js} +1 -1
  87. package/dist/assets/{RealtimeCall-DAMOaV73.js → RealtimeCall-KU7v4FMN.js} +1 -1
  88. package/dist/assets/{ReportButton-CpUpPvRI.js → ReportButton-DBohgBX5.js} +1 -1
  89. package/dist/assets/{ReportDialog-CR7jTKVQ.js → ReportDialog-C8y-vb_7.js} +1 -1
  90. package/dist/assets/{ScenarioPaymentMode-DBW7ha0H.js → ScenarioPaymentMode-Dr25voqT.js} +1 -1
  91. package/dist/assets/{ScheduledTasks-D2A6R_xR.js → ScheduledTasks-Db4Cgk3f.js} +1 -1
  92. package/dist/assets/{ServicePricingSummary-CLl8JOoX.js → ServicePricingSummary-CN_kQ9E8.js} +1 -1
  93. package/dist/assets/{ShowcaseGrid-CCJIHMUe.js → ShowcaseGrid-D8Kp-zms.js} +1 -1
  94. package/dist/assets/{ShowcaseResultTabs-Bk-qHuoo.js → ShowcaseResultTabs-B_aFfiMi.js} +1 -1
  95. package/dist/assets/{SolanaWalletPickerDialog-Dvjxm_kZ.js → SolanaWalletPickerDialog-Csxb3VVL.js} +1 -1
  96. package/dist/assets/{Status-DwncBcIj.js → Status-rvZfPjPj.js} +1 -1
  97. package/dist/assets/{Subscribe-CRipH6Wg.js → Subscribe-BvWQReSy.js} +1 -1
  98. package/dist/assets/{TabSwitcher-BNMmn14V.js → TabSwitcher-DSv6B8Qg.js} +1 -1
  99. package/dist/assets/{Tts-DWgw7f7s.js → Tts-CzUoWexU.js} +1 -1
  100. package/dist/assets/{VideoPlayer-CK-MW_iJ.js → VideoPlayer-ByFIN8Pz.js} +1 -1
  101. package/dist/assets/{VideoPreview-7TXejh5Z.js → VideoPreview-DI5UZhOF.js} +1 -1
  102. package/dist/assets/{WriteSkillDialog-DwFxHLQG.js → WriteSkillDialog-njtydyP6.js} +1 -1
  103. package/dist/assets/{airwallexCheckout-BJV9_LJW.js → airwallexCheckout-BHNIy2Tw.js} +1 -1
  104. package/dist/assets/arrow-down-3ZwcPIyd.js +1 -0
  105. package/dist/assets/{arrow-down-wide-narrow--5ofOioK.js → arrow-down-wide-narrow-D-uOJGHw.js} +1 -1
  106. package/dist/assets/arrow-left-BUfU72AI.js +1 -0
  107. package/dist/assets/arrow-right-DU9hmChJ.js +1 -0
  108. package/dist/assets/arrow-up-CO5DClih.js +1 -0
  109. package/dist/assets/{authorizeFlow-CaG4ng8r.js → authorizeFlow-dn4MchJ4.js} +1 -1
  110. package/dist/assets/{avatar-D6CXRpI7.js → avatar-D_IhQdl8.js} +1 -1
  111. package/dist/assets/{basic-DNtfaQBU.js → basic-DfXHoRBw.js} +1 -1
  112. package/dist/assets/{book-open-DYIByPT-.js → book-open-D4JeSvu4.js} +1 -1
  113. package/dist/assets/{box-CYxKRYYM.js → box-BwvfBbaH.js} +1 -1
  114. package/dist/assets/{boxes-Dw2bJkLJ.js → boxes-AV1PM_5l.js} +1 -1
  115. package/dist/assets/{brain-BmEQTM8k.js → brain-D6NjGmAq.js} +1 -1
  116. package/dist/assets/{chart-no-axes-combined-DuKodK5O.js → chart-no-axes-combined-CchjemK1.js} +1 -1
  117. package/dist/assets/{chat-D6FZdAFD.js → chat-1JKPdNAq.js} +1 -1
  118. package/dist/assets/{chat-D_cVYex_.js → chat-B7El78KB.js} +1 -1
  119. package/dist/assets/{chat-CsiZHLys.js → chat-BcTLs_NM.js} +1 -1
  120. package/dist/assets/{chat-lBYpL1ru.js → chat-Bxi3u7ju.js} +1 -1
  121. package/dist/assets/{chat-C2uqNw3P.js → chat-C-1vIYv4.js} +1 -1
  122. package/dist/assets/{chat-CX5gfKYF.js → chat-C0Su2-1J.js} +2 -2
  123. package/dist/assets/{chat-8q4HYSBH.js → chat-Cd1V35RN.js} +1 -1
  124. package/dist/assets/{chat-B_H4N5wh.js → chat-ChRpjtn3.js} +1 -1
  125. package/dist/assets/{chat-woD5EAiM.js → chat-DIPpKhoC.js} +1 -1
  126. package/dist/assets/{chat-4B5e6M7H.js → chat-DqhoZFnm.js} +1 -1
  127. package/dist/assets/{chat-Bk_GtTmW.js → chat-ZEPRHnOI.js} +1 -1
  128. package/dist/assets/{chat-Bi4-iPLs.js → chat-tVSSthP6.js} +1 -1
  129. package/dist/assets/{chat-CJbcUBPg.js → chat-v0-8emSy.js} +1 -1
  130. package/dist/assets/check-8okPvRJR.js +1 -0
  131. package/dist/assets/chevron-down-CE-v7C1Z.js +1 -0
  132. package/dist/assets/chevron-right-DRnWPhch.js +1 -0
  133. package/dist/assets/{circle-alert-BlIS0Jfm.js → circle-alert-CPUqplyh.js} +1 -1
  134. package/dist/assets/circle-check-PAy9V8Na.js +1 -0
  135. package/dist/assets/{circle-question-mark-DRoOVKGO.js → circle-question-mark-BdMy3-zg.js} +1 -1
  136. package/dist/assets/{clipboard-list-BUJpitkP.js → clipboard-list-BlrQhAiR.js} +1 -1
  137. package/dist/assets/clock-BksO_Z0W.js +1 -0
  138. package/dist/assets/code-D-ejRMRt.js +1 -0
  139. package/dist/assets/{codingBridge-9ih3Chzb.js → codingBridge-DJQaspTz.js} +1 -1
  140. package/dist/assets/{codingBridgeNotify-CFoOLcGh.js → codingBridgeNotify-DYB7QEzg.js} +1 -1
  141. package/dist/assets/{coins-CggzhAj_.js → coins-zEgi9zer.js} +1 -1
  142. package/dist/assets/{collapse-0WRpvPa2.js → collapse-ErXMQ5WV.js} +1 -1
  143. package/dist/assets/constants-C4mNoJOb.js +1 -0
  144. package/dist/assets/{copy-CJUYDe36.js → copy-7FG4ee2f.js} +1 -1
  145. package/dist/assets/{createTaskActions-eR4Cscmj.js → createTaskActions-CrzF1_nG.js} +1 -1
  146. package/dist/assets/{date-picker-ChZFqgah.js → date-picker-ZMpEcBpW.js} +1 -1
  147. package/dist/assets/{digitalhuman-C9yVqvXe.js → digitalhuman-DgMTY8rl.js} +1 -1
  148. package/dist/assets/{dollar-sign-CNe-36Uv.js → dollar-sign-MqotZ43I.js} +1 -1
  149. package/dist/assets/{download-C8zVAyrZ.js → download-hDh-L00F.js} +1 -1
  150. package/dist/assets/{drawer-J5GNVza3.js → drawer-fIKO5R-t.js} +1 -1
  151. package/dist/assets/{dropdown-BR6uNtt2.js → dropdown-BpdvxDue.js} +1 -1
  152. package/dist/assets/{dropdown-i0RGfo2y.js → dropdown-Br1nVdp7.js} +1 -1
  153. package/dist/assets/{ellipsis-CCh39LuA.js → ellipsis-DwHZbxHC.js} +1 -1
  154. package/dist/assets/{esm-CN3-kzHz.js → esm-DclO1JPL.js} +2 -2
  155. package/dist/assets/{external-link-Cet6qhwN.js → external-link-C29Uuu4h.js} +1 -1
  156. package/dist/assets/{eye-HhQFGHu_.js → eye-CgU_4WhV.js} +1 -1
  157. package/dist/assets/{file-97ImhQ6f.js → file-VWYkzRuc.js} +1 -1
  158. package/dist/assets/{file-output-vcUac5W4.js → file-output-D92hF3YQ.js} +1 -1
  159. package/dist/assets/{file-text-xm0RmaAN.js → file-text-BHxDInDT.js} +1 -1
  160. package/dist/assets/{fish-D-X68Vq-.js → fish-B9PEbkB-.js} +1 -1
  161. package/dist/assets/{flux-CUB8ceYr.js → flux-D8usFLyj.js} +1 -1
  162. package/dist/assets/{folder-CnTdyUhO.js → folder-C0Vt7TDW.js} +1 -1
  163. package/dist/assets/gauge-38IC0I72.js +1 -0
  164. package/dist/assets/{generationInput-Dg5BMVbU.js → generationInput-ChFil-22.js} +1 -1
  165. package/dist/assets/{globe-DE8EVD0V.js → globe-DsTAId5U.js} +1 -1
  166. package/dist/assets/{grokvideo-BBqbXeJR.js → grokvideo-CImTv2UN.js} +1 -1
  167. package/dist/assets/{hailuo-Cvp4WVkN.js → hailuo-CbRlh5hS.js} +1 -1
  168. package/dist/assets/{headphones-C8lY6KTx.js → headphones-DWwur3q7.js} +1 -1
  169. package/dist/assets/{history-D_WrDIVp.js → history-DAREAhUe.js} +1 -1
  170. package/dist/assets/{house-DzrROhH4.js → house-C63Sbnaj.js} +1 -1
  171. package/dist/assets/{i18n-DBtpbeq0.js → i18n-BEtZpGSv.js} +1 -1
  172. package/dist/assets/{image-GcUfRlBM.js → image-YNq1hsaX.js} +1 -1
  173. package/dist/assets/{imageRequests-JgZOB_cZ.js → imageRequests-CNbusBG4.js} +1 -1
  174. package/dist/assets/{index-BhuKiXPa.js → index-Dn-8sNW2.js} +17 -17
  175. package/dist/assets/{index.es-C7X0xHSX.js → index.es-O4UnpgB0.js} +1 -1
  176. package/dist/assets/{info-xfm1EWy9.js → info-CX46K-2a.js} +1 -1
  177. package/dist/assets/{input-number-BL-h5gxp.js → input-number-DQQ_jclw.js} +1 -1
  178. package/dist/assets/{key-round-Dk51vXgG.js → key-round-Dx21hPfT.js} +1 -1
  179. package/dist/assets/{kling-C1l5dGOt.js → kling-CWzyPsGB.js} +1 -1
  180. package/dist/assets/{languages-BQAnKBsP.js → languages-ry74yECk.js} +1 -1
  181. package/dist/assets/{laptop-DYu7gsen.js → laptop-CmGkKcLs.js} +1 -1
  182. package/dist/assets/{lightbulb-Dt12jwwA.js → lightbulb-DEnEsxma.js} +1 -1
  183. package/dist/assets/{link-CCG2W3lu.js → link-S80Vo5YT.js} +1 -1
  184. package/dist/assets/loader-circle-CMan_y4T.js +1 -0
  185. package/dist/assets/{lock-D3d-n5wP.js → lock-BACuEQud.js} +1 -1
  186. package/dist/assets/{luma-BsAvwyQA.js → luma-CsqOTNTl.js} +1 -1
  187. package/dist/assets/{maestro-CLwwA-d4.js → maestro-Dr6BVUlA.js} +1 -1
  188. package/dist/assets/{maestroLanguages-BDi0WKKu.js → maestroLanguages-BvTWQBEt.js} +1 -1
  189. package/dist/assets/{mail-Cu4RCOpK.js → mail-BjsX70Ra.js} +1 -1
  190. package/dist/assets/{message-circle-C9IQ0H_u.js → message-circle-BnmUAMcf.js} +1 -1
  191. package/dist/assets/{mic-CJBFDzvP.js → mic-Cy088pRc.js} +1 -1
  192. package/dist/assets/{midjourney-DYSxslML.js → midjourney-C73M_okC.js} +1 -1
  193. package/dist/assets/{minimax-O3mV0UwS.js → minimax-B_1MYCHz.js} +1 -1
  194. package/dist/assets/{mobileLocalExec-C1dCnnBV.js → mobileLocalExec-DBwASoYt.js} +1 -1
  195. package/dist/assets/modelPresentation-Dh0NlBYP.js +1 -0
  196. package/dist/assets/{models-DGI43qxx.js → models-BWtS-s13.js} +1 -1
  197. package/dist/assets/{monitor-BCUneMbK.js → monitor-B2Fsh0_H.js} +1 -1
  198. package/dist/assets/{mouse-pointer-2-BJnRqHoy.js → mouse-pointer-2-CdL9cbWa.js} +1 -1
  199. package/dist/assets/music-2-DaPeZgoi.js +1 -0
  200. package/dist/assets/{nanobanana-C1m-ntQ5.js → nanobanana-DiMJfARU.js} +1 -1
  201. package/dist/assets/{omni-Bs1EFVhV.js → omni-CoYnCYnO.js} +1 -1
  202. package/dist/assets/{openaiimage-PCQwKcFi.js → openaiimage-CTa5az1H.js} +1 -1
  203. package/dist/assets/{pagination-BLwt5f1y.js → pagination-BG96U0D_.js} +1 -1
  204. package/dist/assets/{pagination-DDQQplQX.js → pagination-CoBnk3Ai.js} +1 -1
  205. package/dist/assets/{pagination-DgncPTOk.js → pagination-D8iNbVKJ.js} +1 -1
  206. package/dist/assets/{palette-CssI--5q.js → palette-COM7QAlM.js} +1 -1
  207. package/dist/assets/{paperclip-DDXlPDyM.js → paperclip-CiFF6idQ.js} +1 -1
  208. package/dist/assets/{pause-BHUOotRm.js → pause-BOLN-wzc.js} +1 -1
  209. package/dist/assets/{pencil-BKyiUVnW.js → pencil-2LG-UuFD.js} +1 -1
  210. package/dist/assets/{pika-om1cCtKw.js → pika-CAtsFh44.js} +1 -1
  211. package/dist/assets/{pixverse-BaAC8YPm.js → pixverse-DKsGFE5o.js} +1 -1
  212. package/dist/assets/play-tG5O8bbR.js +1 -0
  213. package/dist/assets/{plug-CBXDX2jR.js → plug-BRLAjEWN.js} +1 -1
  214. package/dist/assets/plus-oRS-6XRp.js +1 -0
  215. package/dist/assets/{poivelle-DA47r64N.js → poivelle-G50BPl4d.js} +1 -1
  216. package/dist/assets/{popover-B5MTy1rs.js → popover-IhXMoX-P.js} +1 -1
  217. package/dist/assets/{producer-ROyK86hn.js → producer-DVOljhLQ.js} +1 -1
  218. package/dist/assets/{qrart-CHoDXnUG.js → qrart-Dpl4PdcX.js} +1 -1
  219. package/dist/assets/{qwenimage-BaAjEv2f.js → qwenimage-DwUPocYl.js} +1 -1
  220. package/dist/assets/{realtime-DZdbVOL9.js → realtime-FlQvxNn2.js} +1 -1
  221. package/dist/assets/{refresh-cw-sqVwVwPK.js → refresh-cw-7WsjAEts.js} +1 -1
  222. package/dist/assets/rotate-ccw-M5uJlVv8.js +1 -0
  223. package/dist/assets/rotate-cw-BclxKwik.js +1 -0
  224. package/dist/assets/{row-BUXbo_F4.js → row-C3d900Dh.js} +1 -1
  225. package/dist/assets/search-MoJY2mLN.js +1 -0
  226. package/dist/assets/{seedance-D8kLKRTq.js → seedance-MsEPFoYf.js} +1 -1
  227. package/dist/assets/{seedream-Cf2axOg0.js → seedream-_xRcvVI9.js} +1 -1
  228. package/dist/assets/{select-CcTiPJUg.js → select-BhxIomVL.js} +1 -1
  229. package/dist/assets/{serp-DFjXmbAr.js → serp-C0xhKx9W.js} +1 -1
  230. package/dist/assets/{shield-DOWHsriA.js → shield-2D4IamW1.js} +1 -1
  231. package/dist/assets/{showcase-IbVW17fO.js → showcase-_a8WgiCY.js} +1 -1
  232. package/dist/assets/{showcaseRecreateMixin-CH_5cLk1.js → showcaseRecreateMixin-DnJxBt5l.js} +1 -1
  233. package/dist/assets/{shuffle-BzzBe2lZ.js → shuffle-CO64087x.js} +1 -1
  234. package/dist/assets/{site-CEPHwLgd.js → site-BEX0ZLbD.js} +1 -1
  235. package/dist/assets/{site-1pjTNxh5.js → site-BYASZitz.js} +1 -1
  236. package/dist/assets/{site-Bvh-2S-J.js → site-BjLO0gUB.js} +1 -1
  237. package/dist/assets/{site-BOu2zV-d.js → site-Bt_JKZ8_.js} +1 -1
  238. package/dist/assets/{site-DDA2o_Id.js → site-C7-KBTVd.js} +1 -1
  239. package/dist/assets/{site-C6oN2RaM.js → site-CDPN4jzA.js} +1 -1
  240. package/dist/assets/{site-B596s5Hy.js → site-CK0w9rEp.js} +1 -1
  241. package/dist/assets/{site-CNEqbjRh.js → site-CTK1gxZP.js} +1 -1
  242. package/dist/assets/{site-Byfe5O5U.js → site-CrmLn8MR.js} +1 -1
  243. package/dist/assets/{site-BtiNTH-u.js → site-DPTs-HaR.js} +1 -1
  244. package/dist/assets/{site-C8eb5zY0.js → site-DX9RE0Cm.js} +1 -1
  245. package/dist/assets/{site-B0ySowjc.js → site-n5xenwh8.js} +1 -1
  246. package/dist/assets/siteHome-2MMd6PGi.js +1 -0
  247. package/dist/assets/{slider-C13isRLl.js → slider-BQmgjRhY.js} +1 -1
  248. package/dist/assets/{solana-wallets-d_lHXJq2.js → solana-wallets-DM2n_fl5.js} +2 -2
  249. package/dist/assets/{sora-nqaJfWU_.js → sora-E5QXxv5E.js} +1 -1
  250. package/dist/assets/{sparkles-CyOdWimh.js → sparkles-BbBPUybn.js} +1 -1
  251. package/dist/assets/square-N1_hTOAE.js +1 -0
  252. package/dist/assets/{store-C3emekR6.js → store-BRVYdymv.js} +1 -1
  253. package/dist/assets/{suno-D7WSaIq8.js → suno-8BfJH1ZD.js} +1 -1
  254. package/dist/assets/{switch-ChU8jScg.js → switch-CYqcNNsc.js} +1 -1
  255. package/dist/assets/{table-LOal1inT.js → table-C3DgtnsI.js} +1 -1
  256. package/dist/assets/{tabs-C48-bEy8.js → tabs-BRZesBUp.js} +1 -1
  257. package/dist/assets/{tag-922BT0TI.js → tag-CGAMSdmM.js} +1 -1
  258. package/dist/assets/{taskPolling-DHtgr2wI.js → taskPolling-BZB1PW-e.js} +1 -1
  259. package/dist/assets/terminal-DohjAQkV.js +1 -0
  260. package/dist/assets/{time-picker-ByEe4UNH.js → time-picker-DFBRIpMK.js} +1 -1
  261. package/dist/assets/{tooltip-DqGMJJ6f.js → tooltip-DnBNFRyX.js} +1 -1
  262. package/dist/assets/{trash-2-BhwPJFMz.js → trash-2-UoD61laP.js} +1 -1
  263. package/dist/assets/{triangle-alert-DBKQGKg_.js → triangle-alert-hKICrvdJ.js} +1 -1
  264. package/dist/assets/{upload-C_YrWWV5.js → upload-BHlKa9Ox.js} +1 -1
  265. package/dist/assets/{upload-DYQ-PwmP.js → upload-BK5O5g9h.js} +1 -1
  266. package/dist/assets/user-DsJxBb48.js +1 -0
  267. package/dist/assets/{veo-DjM0yWo5.js → veo-CiVi874k.js} +1 -1
  268. package/dist/assets/{video-BFTllrg6.js → video-Bktq2Sxg.js} +1 -1
  269. package/dist/assets/{volume-2-DDZ8f74r.js → volume-2-BGmJGVXb.js} +1 -1
  270. package/dist/assets/{wallet-D9ChTMGr.js → wallet-s-F28wTh.js} +1 -1
  271. package/dist/assets/{wan-Cf4ZrOug.js → wan-QsfHInEx.js} +1 -1
  272. package/dist/assets/{wand-sparkles-1fXELugW.js → wand-sparkles-C34nh3wP.js} +1 -1
  273. package/dist/assets/{web-B3zJ5vL_.js → web-DDV8fE0w.js} +1 -1
  274. package/dist/assets/{webextrator-BheSx6BK.js → webextrator-DZfVHymI.js} +1 -1
  275. package/dist/assets/{zap-CZz_Emt-.js → zap-CvvvDO7R.js} +1 -1
  276. package/dist/index.html +4 -4
  277. package/package.json +2 -2
  278. package/dist/assets/Conversation-1eQVGxUu.js +0 -2
  279. package/dist/assets/Conversation-BfZwK4nv.css +0 -1
  280. package/dist/assets/Conversation-DhlQh49g.js +0 -1
  281. package/dist/assets/Index--SEOUDW7.js +0 -1
  282. package/dist/assets/Index-BeblsjhL.js +0 -88
  283. package/dist/assets/Index-Bk4tRrlU.css +0 -1
  284. package/dist/assets/Index-gg_QycUv.css +0 -1
  285. package/dist/assets/List-CrN9SiBT.js +0 -1
  286. package/dist/assets/List-fEYoiJm9.css +0 -1
  287. package/dist/assets/Message-Bkc84sFE.js +0 -3
  288. package/dist/assets/Navigator-CWAnHPzI.css +0 -1
  289. package/dist/assets/Navigator-e7Bbrs9c.js +0 -8
  290. package/dist/assets/Pay-CVDZ8AV7.css +0 -1
  291. package/dist/assets/Pay-DiBk6FEg.js +0 -1
  292. package/dist/assets/arrow-down-C6PH3wUY.js +0 -1
  293. package/dist/assets/arrow-left-GGhlqnP6.js +0 -1
  294. package/dist/assets/arrow-right-BqdGi29k.js +0 -1
  295. package/dist/assets/arrow-up-Ciz6rN4y.js +0 -1
  296. package/dist/assets/check-C-ennB_F.js +0 -1
  297. package/dist/assets/chevron-down-Bzg883mb.js +0 -1
  298. package/dist/assets/chevron-right-BTjgiXlI.js +0 -1
  299. package/dist/assets/circle-check-BS90WmVD.js +0 -1
  300. package/dist/assets/clock-DYMdqYCO.js +0 -1
  301. package/dist/assets/code-CXOEul0z.js +0 -1
  302. package/dist/assets/constants-CiMGQy1r.js +0 -1
  303. package/dist/assets/gauge-BtDpPiyq.js +0 -1
  304. package/dist/assets/loader-circle-BtiAasZD.js +0 -1
  305. package/dist/assets/modelPresentation-C1qgMEpp.js +0 -1
  306. package/dist/assets/music-2-RMxzVfwi.js +0 -1
  307. package/dist/assets/play-Dptgh_Ds.js +0 -1
  308. package/dist/assets/plus-CoKyfiTV.js +0 -1
  309. package/dist/assets/rotate-ccw-DDp04MFQ.js +0 -1
  310. package/dist/assets/rotate-cw-Dmw3pXHH.js +0 -1
  311. package/dist/assets/search-CopKlsH8.js +0 -1
  312. package/dist/assets/siteHome-DVwKWe9w.js +0 -1
  313. package/dist/assets/square-CEkRrDA9.js +0 -1
  314. package/dist/assets/terminal-B1tT4mRf.js +0 -1
  315. package/dist/assets/user-CdP-qT7t.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-CcTiPJUg.js";import{t as b}from"./upload-C_YrWWV5.js";import{t as x}from"./tooltip-DqGMJJ6f.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-DGI43qxx.js";import{t as T}from"./checkbox-DXMDpaxv.js";import{t as E}from"./drawer-J5GNVza3.js";import{t as D}from"./input-number-BL-h5gxp.js";import{t as O}from"./box-CYxKRYYM.js";import{t as k}from"./clock-DYMdqYCO.js";import{a as A,i as j,n as M,r as N,s as P,t as F}from"./pagination-DgncPTOk.js";import{t as I}from"./image-GcUfRlBM.js";import{t as ee}from"./info-xfm1EWy9.js";import{t as L}from"./trash-2-BhwPJFMz.js";import{t as te}from"./triangle-alert-DBKQGKg_.js";import{t as ne}from"./upload-DYQ-PwmP.js";import{t as R}from"./wand-sparkles-1fXELugW.js";import{t as re}from"./zap-CZz_Emt-.js";import{On as ie}from"./constants-CiMGQy1r.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-BhuKiXPa.js";import{t as le}from"./CopyToClipboard-42kl-Hqn.js";import{t as ue}from"./ReportButton-CpUpPvRI.js";import{t as Z}from"./ImagePreview-B6S0ASYG.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as fe}from"./ServicePricingSummary-CLl8JOoX.js";import{t as pe}from"./ApiCodeButton-6CAkuLWs.js";import{t as me}from"./BotPlaceholder-Ctu1jmvN.js";import{t as he}from"./taskPollingMixin-CcLxtz8z.js";import{t as ge}from"./ShowcaseResultTabs-Bk-qHuoo.js";import{t as _e}from"./showcaseRecreateMixin-CH_5cLk1.js";import{n as ve,t as ye}from"./generationInput-Dg5BMVbU.js";import{t as be}from"./ImageWrapper-B4zFub-J.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};
@@ -0,0 +1 @@
1
+ .dashboard-section[data-v-3190f278]{padding-top:34px}.section-heading[data-v-3190f278]{justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:16px;display:flex}.section-heading>div>span[data-v-3190f278]{color:var(--el-color-primary);letter-spacing:.12em;text-transform:uppercase;font-size:11px;font-weight:800}.section-heading h2[data-v-3190f278]{letter-spacing:-.02em;margin:5px 0 0;font-size:25px}.section-heading p[data-v-3190f278]{max-width:470px;color:var(--el-text-color-secondary);margin:0;font-size:13px;line-height:1.55}.category-rows[data-v-3190f278]{gap:13px;display:grid}.category-grid[data-v-3190f278]{grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;display:grid}.category-card[data-v-3190f278]{color:#fff;cursor:pointer;text-align:left;background:#0d131d;border:1px solid #ffffff14;border-radius:15px;min-width:0;min-height:205px;padding:0;transition:transform .22s,border-color .22s,box-shadow .22s;position:relative;overflow:hidden;box-shadow:0 12px 34px #00000038}.category-card>img[data-v-3190f278],.category-card .shade[data-v-3190f278]{width:100%;height:100%;position:absolute;inset:0}.category-card>img[data-v-3190f278]{-o-object-fit:cover;object-fit:cover;transition:transform .4s}.category-card .shade[data-v-3190f278]{background:linear-gradient(#04080f05 15%,#04080feb 100%)}.category-card[data-v-3190f278]:hover,.category-card[aria-expanded=true][data-v-3190f278]{border-color:color-mix(in srgb, var(--el-color-primary) 44%, transparent);transform:translateY(-3px);box-shadow:0 18px 42px #0000004d}.category-card:hover>img[data-v-3190f278],.category-card[aria-expanded=true]>img[data-v-3190f278]{transform:scale(1.035)}.category-card[data-v-3190f278]:focus-visible{outline:3px solid var(--el-color-primary);outline-offset:2px}.category-copy[data-v-3190f278]{z-index:1;text-shadow:0 2px 15px #000000b8;flex-direction:column;align-items:flex-start;gap:5px;display:flex;position:absolute;bottom:17px;left:18px;right:18px}.category-copy strong[data-v-3190f278]{font-size:22px;line-height:1.15}.category-copy>span[data-v-3190f278]{color:#ffffffb3;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:1.45;display:-webkit-box;overflow:hidden}.category-copy b[data-v-3190f278]{margin-top:4px;font-size:12px}.capability-panel[data-v-3190f278]{-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);background:#0d131de6;border:1px solid #ffffff14;border-radius:16px;grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-top:13px;padding:15px;display:grid;box-shadow:0 16px 44px #0000003b}.capability-card[data-v-3190f278]{color:#fff;background:#ffffff09;border:1px solid #ffffff12;border-radius:13px;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:11px;min-width:0;padding:13px;transition:border-color .2s,background-color .2s,transform .2s;display:grid}.capability-card>img[data-v-3190f278]{-o-object-fit:cover;object-fit:cover;background:#ffffffeb;border-radius:12px;width:44px;height:44px}.capability-card>span[data-v-3190f278]{min-width:0}.capability-card strong[data-v-3190f278],.capability-card small[data-v-3190f278]{display:block}.capability-card strong[data-v-3190f278]{font-size:14px}.capability-card small[data-v-3190f278]{color:#ffffffb8;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:4px;font-size:11px;line-height:1.4;display:-webkit-box;overflow:hidden}.capability-card>b[data-v-3190f278]{color:color-mix(in srgb, var(--el-color-primary) 65%, #fff);grid-column:2;font-size:11px}.capability-card[data-v-3190f278]:hover{border-color:rgba(var(--app-brand-rgb), .35);background:rgba(var(--app-brand-rgb), .08);transform:translateY(-2px)}.capability-card[data-v-3190f278]:focus-visible{outline:3px solid var(--el-color-primary);outline-offset:2px}.panel-enter-active[data-v-3190f278],.panel-leave-active[data-v-3190f278]{transition:opacity .18s,transform .18s}.panel-enter-from[data-v-3190f278],.panel-leave-to[data-v-3190f278]{opacity:0;transform:translateY(-6px)}@media (width<=1120px){.category-grid[data-v-3190f278],.capability-panel[data-v-3190f278]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width<=600px){.dashboard-section[data-v-3190f278]{padding-top:25px}.section-heading[data-v-3190f278]{display:block}.section-heading p[data-v-3190f278]{margin-top:7px}.category-grid[data-v-3190f278],.capability-panel[data-v-3190f278]{gap:10px}.category-card[data-v-3190f278]{border-radius:13px;min-height:195px}.category-copy[data-v-3190f278]{bottom:13px;left:13px;right:13px}.category-copy strong[data-v-3190f278]{font-size:17px}.capability-panel[data-v-3190f278]{margin-top:0;padding:10px}}@media (width<=430px){.category-grid[data-v-3190f278],.capability-panel[data-v-3190f278]{grid-template-columns:1fr}}@media (prefers-reduced-motion:reduce){.category-card[data-v-3190f278],.category-card>img[data-v-3190f278],.capability-card[data-v-3190f278],.panel-enter-active[data-v-3190f278],.panel-leave-active[data-v-3190f278]{transition:none}.category-card[data-v-3190f278]:hover,.category-card:hover>img[data-v-3190f278],.capability-card[data-v-3190f278]:hover{transform:none}}.home-carousel[data-v-d69edc68]{background:#0b1019;border:1px solid #ffffff17;border-radius:18px;width:100%;height:clamp(340px,30vw,430px);position:relative;overflow:hidden;box-shadow:0 18px 60px #0000004d}.slides[data-v-d69edc68],.slide[data-v-d69edc68],.slide>img[data-v-d69edc68],.image-fallback[data-v-d69edc68],.shade[data-v-d69edc68]{width:100%;height:100%;position:absolute;inset:0}.slide[data-v-d69edc68]{opacity:0;color:#fff;pointer-events:none;transition:opacity .55s}.slide.active[data-v-d69edc68]{z-index:1;opacity:1;pointer-events:auto}.slide>img[data-v-d69edc68]{-o-object-fit:cover;object-fit:cover}.slide.static[data-v-d69edc68]{cursor:default}.slide[data-v-d69edc68]:focus-visible{outline:3px solid var(--el-color-primary);outline-offset:-4px}.image-fallback[data-v-d69edc68]{background:radial-gradient(circle, rgba(var(--app-brand-rgb), .22), transparent 45%), #0b1019;place-items:center;display:grid}.image-fallback img[data-v-d69edc68]{-o-object-fit:cover;object-fit:cover;border-radius:24px;width:100px;height:100px}.shade[data-v-d69edc68]{background:linear-gradient(90deg,#04080fe6 0%,#04080fa6 38%,#04080f14 72%),linear-gradient(#0000 55%,#04080f80)}.copy[data-v-d69edc68]{z-index:2;text-shadow:0 3px 22px #000000bf;flex-direction:column;align-items:flex-start;gap:11px;width:min(590px,48%);display:flex;position:absolute;top:50%;left:clamp(34px,5vw,78px);transform:translateY(-50%)}.copy strong[data-v-d69edc68]{letter-spacing:-.035em;font-size:clamp(30px,3.5vw,56px);line-height:1.06}.eyebrow[data-v-d69edc68]{-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#04080f57;border:1px solid #ffffff40;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:750}.description[data-v-d69edc68]{color:#ffffffc2;font-size:15px;line-height:1.6}.action[data-v-d69edc68]{margin-top:5px;font-size:14px;font-weight:750}.arrow[data-v-d69edc68]{z-index:3;color:#fff;cursor:pointer;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#0509116b;border:1px solid #ffffff2e;border-radius:50%;place-items:center;width:42px;height:42px;display:grid;position:absolute;top:50%;transform:translateY(-50%)}.arrow span[data-v-d69edc68]{margin-top:-2px;font-size:30px;line-height:1}.arrow[data-v-d69edc68]:focus-visible{outline:3px solid var(--el-color-primary);outline-offset:2px}.previous[data-v-d69edc68]{left:16px}.next[data-v-d69edc68]{right:16px}.dots[data-v-d69edc68]{z-index:3;justify-content:center;gap:8px;display:flex;position:absolute;bottom:16px;left:0;right:0}.dots button[data-v-d69edc68]{cursor:pointer;background:#ffffff57;border:0;border-radius:999px;width:26px;height:4px;padding:0;transition:width .2s,background-color .2s}.dots button.active[data-v-d69edc68]{background:#fff;width:44px}.dots button[data-v-d69edc68]:focus-visible{outline:2px solid var(--el-color-primary);outline-offset:4px}@media (width<=900px){.home-carousel[data-v-d69edc68]{height:clamp(300px,44vw,380px)}.copy[data-v-d69edc68]{width:62%}}@media (width<=600px){.home-carousel[data-v-d69edc68]{border-radius:14px;height:338px;min-height:0}.copy[data-v-d69edc68]{gap:7px;width:72%;left:22px}.copy strong[data-v-d69edc68]{font-size:27px}.description[data-v-d69edc68]{-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:13px;display:-webkit-box;overflow:hidden}.arrow[data-v-d69edc68]{width:36px;height:36px;top:auto;bottom:13px;transform:none}.previous[data-v-d69edc68]{left:14px}.next[data-v-d69edc68]{right:14px}.dots[data-v-d69edc68]{bottom:29px}}@media (prefers-reduced-motion:reduce){.slide[data-v-d69edc68],.dots button[data-v-d69edc68]{transition:none}}.tenant-home-iframe[data-v-ae8f8418]{border:0;width:100%;display:block}.tenant-home-website-frame[data-v-b3a0eb72]{background:var(--el-bg-color);border:0;border-radius:12px;width:100%;height:clamp(360px,65vh,760px);display:block}.tenant-home-website-link[data-v-b3a0eb72]{color:var(--el-color-primary);margin-top:12px;display:inline-flex}@media (width<=760px){.tenant-home-website-frame[data-v-b3a0eb72]{height:70vh}}.custom-sections{flex-direction:column;gap:22px;padding-top:34px;display:flex}.tenant-home-block{border:1px solid color-mix(in srgb, var(--el-border-color) 65%, transparent);background:color-mix(in srgb, var(--el-bg-color-overlay) 88%, transparent);border-radius:20px;max-width:100%;padding:clamp(24px,4vw,48px);overflow:hidden;box-shadow:0 18px 55px #0000001f}.tenant-home-block h2{margin:6px 0 18px;font-size:clamp(24px,3vw,38px);line-height:1.1}.tenant-home-content :is(pre,table){max-width:100%;overflow-x:auto}@media (prefers-reduced-motion:reduce){.tenant-home-block{scroll-behavior:auto;transition:none}}.studio-home[data-v-e32708a8]{height:100%;min-height:0;color:var(--el-text-color-primary);background:radial-gradient(circle at 82% 6%, rgba(var(--app-brand-rgb), .09), transparent 26%), #080c13;scrollbar-gutter:stable;overflow-y:auto}.dashboard[data-v-e32708a8]{width:min(1580px,100% - 36px);margin:0 auto;padding:18px 0 8px}.home-loading[data-v-e32708a8]{background:#080c13;place-items:center;height:100%;display:grid}.home-loading span[data-v-e32708a8]{border:3px solid #ffffff29;border-top-color:var(--el-color-primary);border-radius:50%;width:38px;height:38px;animation:.9s linear infinite home-spin-e32708a8}@keyframes home-spin-e32708a8{to{transform:rotate(360deg)}}@media (width<=767px){.dashboard[data-v-e32708a8]{width:calc(100% - 24px);padding-top:12px}}@media (prefers-reduced-motion:reduce){.home-loading span[data-v-e32708a8]{animation-duration:1.8s}}.showcase-load-more[data-v-e32708a8]{color:#fff;cursor:pointer;background:#ffffff14;border:1px solid #ffffff38;border-radius:999px;min-height:44px;margin:4px auto 28px;padding:0 24px;font-weight:750;display:block}.showcase-load-more[data-v-e32708a8]:focus-visible{outline:3px solid var(--el-color-primary);outline-offset:3px}
@@ -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-CcTiPJUg.js";import{t as b}from"./upload-C_YrWWV5.js";import{t as x}from"./tooltip-DqGMJJ6f.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-DGI43qxx.js";import{t as T}from"./drawer-J5GNVza3.js";import{t as E}from"./input-number-BL-h5gxp.js";import{t as D}from"./slider-C13isRLl.js";import{t as O}from"./clock-DYMdqYCO.js";import{a as k,i as A,n as j,r as ee,s as M,t as N}from"./pagination-DgncPTOk.js";import{t as P}from"./info-xfm1EWy9.js";import{t as F}from"./trash-2-BhwPJFMz.js";import{t as te}from"./triangle-alert-DBKQGKg_.js";import{t as ne}from"./upload-DYQ-PwmP.js";import{t as I}from"./wand-sparkles-1fXELugW.js";import{Mr as re,Nr as ie,jr as L}from"./constants-CiMGQy1r.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-BhuKiXPa.js";import{t as ue}from"./CopyToClipboard-42kl-Hqn.js";import{t as de}from"./ReportButton-CpUpPvRI.js";import{t as fe}from"./ImagePreview-B6S0ASYG.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./ServicePricingSummary-CLl8JOoX.js";import{t as he}from"./ScenarioPaymentMode-DBW7ha0H.js";import{t as ge}from"./ApiCodeButton-6CAkuLWs.js";import{t as _e}from"./BotPlaceholder-Ctu1jmvN.js";import{t as ve}from"./taskPollingMixin-CcLxtz8z.js";import{n as ye,t as be}from"./generationInput-Dg5BMVbU.js";import{t as xe}from"./ImageWrapper-B4zFub-J.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-BqdGi29k.js";import{t as h}from"./check-C-ennB_F.js";import{t as g}from"./external-link-Cet6qhwN.js";import{t as ee}from"./globe-DE8EVD0V.js";import{t as _}from"./wand-sparkles-1fXELugW.js";import{g as v}from"./i18n-DBtpbeq0.js";import{A as y,Fn as b,N as x,i as S,io as C,r as te}from"./index-BhuKiXPa.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-CcTiPJUg.js";import{t as x}from"./upload-C_YrWWV5.js";import{t as S}from"./tooltip-DqGMJJ6f.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-DGI43qxx.js";import{t as E}from"./drawer-J5GNVza3.js";import{t as D}from"./input-number-BL-h5gxp.js";import{t as O}from"./switch-ChU8jScg.js";import{t as k}from"./box-CYxKRYYM.js";import{t as A}from"./clock-DYMdqYCO.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-DgncPTOk.js";import{t as ee}from"./image-GcUfRlBM.js";import{t as te}from"./info-xfm1EWy9.js";import{t as ne}from"./trash-2-BhwPJFMz.js";import{t as re}from"./triangle-alert-DBKQGKg_.js";import{t as ie}from"./upload-DYQ-PwmP.js";import{t as L}from"./wand-sparkles-1fXELugW.js";import{t as ae}from"./zap-CZz_Emt-.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-CiMGQy1r.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-BhuKiXPa.js";import{t as xe}from"./CopyToClipboard-42kl-Hqn.js";import{t as Se}from"./ReportButton-CpUpPvRI.js";import{t as J}from"./ImagePreview-B6S0ASYG.js";import{n as Ce}from"./taskDrawerMixin-DyAUhFEq.js";import{t as we}from"./ServicePricingSummary-CLl8JOoX.js";import{t as Te}from"./ApiCodeButton-6CAkuLWs.js";import{t as Ee}from"./BotPlaceholder-Ctu1jmvN.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-Bk-qHuoo.js";import{t as ke}from"./showcaseRecreateMixin-CH_5cLk1.js";import{n as Ae,t as je}from"./generationInput-Dg5BMVbU.js";import{t as Me}from"./ImageWrapper-B4zFub-J.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};