@acedatacloud/nexior 3.351.3 → 3.351.4

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 (247) hide show
  1. package/dist/assets/{ApiCodeButton-B9c7TGii.js → ApiCodeButton-DCLoOHa7.js} +1 -1
  2. package/dist/assets/{Artifacts-Csdb2VwM.js → Artifacts-BGU6YS-q.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-CscnxTBm.js → AskUserQuestionCard-BnrXf6Bb.js} +1 -1
  4. package/dist/assets/{Auth-B0XS7Rsl.js → Auth-D2AXQTih.js} +1 -1
  5. package/dist/assets/{Bare-RpzxXqnN.js → Bare-C3yLSelb.js} +1 -1
  6. package/dist/assets/{BotPlaceholder-B213F4Dv.js → BotPlaceholder-_QxGzCkh.js} +1 -1
  7. package/dist/assets/{BottomFooter-D0mIEqam.js → BottomFooter-BKXNUFu0.js} +1 -1
  8. package/dist/assets/{BrowserPairingDialog-DXdBO5T1.js → BrowserPairingDialog-DS6OfiLz.js} +1 -1
  9. package/dist/assets/{Callback-CM5sLhlj.js → Callback-BpamxSQd.js} +1 -1
  10. package/dist/assets/{CodeSnippet-XENtfY5z.js → CodeSnippet-4fOCT0H3.js} +1 -1
  11. package/dist/assets/{Console-cvXGzVLV.js → Console-B55H7Dqh.js} +1 -1
  12. package/dist/assets/{Consumption-XSMnRD9l.js → Consumption-DZVrxh1r.js} +1 -1
  13. package/dist/assets/{Conversation-DSZq24M6.js → Conversation-8En8UjR6.js} +1 -1
  14. package/dist/assets/{Conversation-C8XH3coZ.js → Conversation-B6tA-Als.js} +1 -1
  15. package/dist/assets/{CopyToClipboard-ARV7wWpq.js → CopyToClipboard-BwVdHYYm.js} +1 -1
  16. package/dist/assets/{Detail-uIowdVXH.js → Detail-BrJJlxj0.js} +2 -2
  17. package/dist/assets/{Extra-DhQtYQTo.js → Extra-Do0UEYb_.js} +1 -1
  18. package/dist/assets/{FilePreview-C5OXfeqk.js → FilePreview-j7Q9LeP4.js} +1 -1
  19. package/dist/assets/{Hailuo-QExr0Nfp.js → Hailuo-DQLyD_bF.js} +1 -1
  20. package/dist/assets/{History-BeqVgN7T.js → History-CTDtC0ip.js} +1 -1
  21. package/dist/assets/{ImagePreview-HMkCzfq6.js → ImagePreview-Dkx4nOhz.js} +1 -1
  22. package/dist/assets/{ImageWrapper-LGdiJD4o.js → ImageWrapper-DzKNoUuD.js} +1 -1
  23. package/dist/assets/{Index-CoW4LjcP.js → Index--965M8K8.js} +1 -1
  24. package/dist/assets/{Index-UvFjfvLR.js → Index-1cKLnPC3.js} +1 -1
  25. package/dist/assets/{Index-AkcXNHzN.js → Index-9yN7BNbJ.js} +1 -1
  26. package/dist/assets/{Index-_44zxnYM.js → Index-BAjuF6iL.js} +1 -1
  27. package/dist/assets/{Index-BMhgLN4o.js → Index-BQXgAPJu.js} +1 -1
  28. package/dist/assets/{Index-BlI674I42.js → Index-BVB2MYOC2.js} +1 -1
  29. package/dist/assets/{Index-FgAsxpex.js → Index-C5U0uLSJ.js} +1 -1
  30. package/dist/assets/{Index-DSP6ePwR.js → Index-CBUKd72T.js} +1 -1
  31. package/dist/assets/{Index-JMKznMem.js → Index-CFhvhp2C.js} +1 -1
  32. package/dist/assets/{Index-CD1NRcVT.js → Index-CFwcoV8k.js} +1 -1
  33. package/dist/assets/{Index-B_qi7-gZ.js → Index-CHUyax9v.js} +1 -1
  34. package/dist/assets/{Index-DoM2vnNM.js → Index-CKUWg7nT.js} +1 -1
  35. package/dist/assets/{Index-BsNtXTd0.js → Index-CPtY5Hco.js} +1 -1
  36. package/dist/assets/{Index-B9AMLhQ-.js → Index-CRre2POV.js} +1 -1
  37. package/dist/assets/{Index-BG792CAh.js → Index-CUFBu9DL.js} +1 -1
  38. package/dist/assets/{Index-CHoQ7zmN.js → Index-CV5wFTbR.js} +1 -1
  39. package/dist/assets/{Index-yJbpYi4z.js → Index-CgCMZxoV.js} +1 -1
  40. package/dist/assets/{Index-W32r-iEl.js → Index-Cra9uKXi.js} +1 -1
  41. package/dist/assets/{Index-BqZ5zIfZ2.js → Index-CtI4ILxP2.js} +1 -1
  42. package/dist/assets/{Index-E7CcboiC2.js → Index-D2jff1gQ2.js} +1 -1
  43. package/dist/assets/{Index-C7XnH-jg.js → Index-D7k0vcAL.js} +1 -1
  44. package/dist/assets/{Index-CbkGmT122.js → Index-DDCO5Hu-2.js} +1 -1
  45. package/dist/assets/{Index-Chcfhrlh.js → Index-DFvuoKQS.js} +1 -1
  46. package/dist/assets/{Index-Cx7VZ0fN.js → Index-DRPr9Q59.js} +1 -1
  47. package/dist/assets/{Index-_0i5mszJ.js → Index-DSDWxLwi.js} +1 -1
  48. package/dist/assets/{Index-DyyII0Ur.js → Index-Ds-wuQBr.js} +1 -1
  49. package/dist/assets/{Index-CrPX0mDJ2.js → Index-H8nkvJ4H2.js} +1 -1
  50. package/dist/assets/{Index-CgqSxWM4.js → Index-LmSu5TWC.js} +1 -1
  51. package/dist/assets/{Index-7NE9pc0r.js → Index-TnUtdgpw.js} +1 -1
  52. package/dist/assets/{Index-BEIjbNrb.js → Index-V_tNypZ7.js} +1 -1
  53. package/dist/assets/{Index-Bk8wOvoj.js → Index-f2ZVLm9G.js} +1 -1
  54. package/dist/assets/{Index-D-AOrxlg.js → Index-n9pHJWeT.js} +1 -1
  55. package/dist/assets/{Index-D-yq-MOB.js → Index-wE-HDH8C.js} +1 -1
  56. package/dist/assets/{Invitees-u9-I6n87.js → Invitees-CHjUOzah.js} +1 -1
  57. package/dist/assets/{List-DtaN_PZ9.js → List-BaB6uPTE.js} +1 -1
  58. package/dist/assets/{List-BrIzmzBC.js → List-CNbC9ZjS.js} +1 -1
  59. package/dist/assets/{List-C32163ii.js → List-Q31zqOMn.js} +1 -1
  60. package/dist/assets/{LocalTools-BAKNA2CG.js → LocalTools-08oAoyJ9.js} +1 -1
  61. package/dist/assets/{LocalTools-3sD5ah4K.js → LocalTools-D_TI5mgE.js} +1 -1
  62. package/dist/assets/{Logo-Cr1nY_cs.js → Logo-Bcua1I6L.js} +1 -1
  63. package/dist/assets/{Main-DX7DtJgD.js → Main-BwjYXWnF.js} +1 -1
  64. package/dist/assets/{Message-gWrZDIn6.js → Message-CTdVkdVd.js} +1 -1
  65. package/dist/assets/{Model-RWW1DAnd.js → Model-DuY5M-cI.js} +1 -1
  66. package/dist/assets/{Navigator-C-TGis8c.css → Navigator-DCIHDbRt.css} +1 -1
  67. package/dist/assets/{Navigator-BslTvJmJ.js → Navigator-DXsPtho6.js} +4 -4
  68. package/dist/assets/{NotFound-Bm_cO_yU.js → NotFound-CcX420Vg.js} +1 -1
  69. package/dist/assets/{PageHeader-UegT_Ory.js → PageHeader-D_z9tvk6.js} +1 -1
  70. package/dist/assets/{Pay-DIQjbYLy.js → Pay-BJDGPdEG.js} +1 -1
  71. package/dist/assets/{Player-B3MoyRDL.js → Player-CijppEWi.js} +1 -1
  72. package/dist/assets/{Poivelle-qDI8DzUJ.js → Poivelle-B4rePU6F.js} +1 -1
  73. package/dist/assets/{RealtimeCall-CPGvZwDr.js → RealtimeCall-DSbtM2oh.js} +1 -1
  74. package/dist/assets/{ReportButton-Bhl9yVD2.js → ReportButton-D7wL8z6N.js} +1 -1
  75. package/dist/assets/{ReportDialog-J29H7OqX.js → ReportDialog-DmLZYKsg.js} +1 -1
  76. package/dist/assets/{ScheduledTasks-Bt5TekkB.js → ScheduledTasks-SHHuBJXY.js} +1 -1
  77. package/dist/assets/{Status-CkQkRUf0.js → Status-Byf1BGNz.js} +1 -1
  78. package/dist/assets/{Subscribe-B2-Yz3Pj.js → Subscribe-DMIUeh-M.js} +1 -1
  79. package/dist/assets/{TabSwitcher-tms3GHhu.js → TabSwitcher-CkVeMT9Q.js} +1 -1
  80. package/dist/assets/{Tts-CX-gv_Vc.js → Tts-BIR4bVcF.js} +1 -1
  81. package/dist/assets/{VideoPlayer-CDIy68jx.js → VideoPlayer-DNi7m8bA.js} +1 -1
  82. package/dist/assets/{VideoPreview-CQPmAFdg.js → VideoPreview-zwRKh4wS.js} +1 -1
  83. package/dist/assets/arrow-down-DdR-qktQ.js +1 -0
  84. package/dist/assets/{arrow-down-wide-narrow-DY2Wi4AR.js → arrow-down-wide-narrow-CTf9kjmq.js} +1 -1
  85. package/dist/assets/arrow-left-CaX06B3X.js +1 -0
  86. package/dist/assets/arrow-right-DXS23sL5.js +1 -0
  87. package/dist/assets/arrow-up-DQbwE7SZ.js +1 -0
  88. package/dist/assets/{authorizeFlow-HoDW7cye.js → authorizeFlow-HRRmbMZ_.js} +1 -1
  89. package/dist/assets/{avatar-PNQ1RJOD.js → avatar-BleL6GzX.js} +1 -1
  90. package/dist/assets/{basic-DmcI5FMe.js → basic-Doxjv01y.js} +1 -1
  91. package/dist/assets/{book-open-Cr7LURTL.js → book-open-DQz2Q2l9.js} +1 -1
  92. package/dist/assets/{box-C-PL8rWG.js → box-BvlGqOWM.js} +1 -1
  93. package/dist/assets/{boxes-CTgp00T_.js → boxes-DUY7PSM3.js} +1 -1
  94. package/dist/assets/{brain-CYM6-M8X.js → brain-BCjZJIDc.js} +1 -1
  95. package/dist/assets/{chart-no-axes-combined-CANCWzDt.js → chart-no-axes-combined-C1pmeUHK.js} +1 -1
  96. package/dist/assets/{chat-Cf77N6to.js → chat-CerS7yOd.js} +1 -1
  97. package/dist/assets/check-YpVnY9c1.js +1 -0
  98. package/dist/assets/chevron-down-Df1Wh7Rr.js +1 -0
  99. package/dist/assets/chevron-right-CI8JXKuk.js +1 -0
  100. package/dist/assets/circle-check-Ds2W-BZ1.js +1 -0
  101. package/dist/assets/{circle-question-mark-CCx2ouPu.js → circle-question-mark-sV-hbdKL.js} +1 -1
  102. package/dist/assets/{clipboard-list-C5RnNto9.js → clipboard-list-D9k9N7WV.js} +1 -1
  103. package/dist/assets/clock-B3fFaHCL.js +1 -0
  104. package/dist/assets/code-W66KfHwS.js +1 -0
  105. package/dist/assets/{codingBridge-C0_C0e7h.js → codingBridge-B0hxLvGQ.js} +1 -1
  106. package/dist/assets/{codingBridgeNotify-Bp2Uvy3X.js → codingBridgeNotify-DZmFpjsW.js} +2 -2
  107. package/dist/assets/{coins-woH4frcI.js → coins-BZ_wfGuU.js} +1 -1
  108. package/dist/assets/{copy-sDgRnR-0.js → copy-Czdnsq2s.js} +1 -1
  109. package/dist/assets/{createTaskActions-B3INqRvo.js → createTaskActions-CdwXVqnB.js} +1 -1
  110. package/dist/assets/{digitalhuman-aw74N5kF.js → digitalhuman-CWEze7ks.js} +1 -1
  111. package/dist/assets/{dollar-sign-Bk0yPtee.js → dollar-sign-DxOGv055.js} +1 -1
  112. package/dist/assets/{download-COWfLANw.js → download-p5s-7lQs.js} +1 -1
  113. package/dist/assets/{drawer-D5bShL7I.js → drawer-CrLrAuYO.js} +1 -1
  114. package/dist/assets/{dropdown-BVVjc6Oj.js → dropdown-BD0rUmhS.js} +1 -1
  115. package/dist/assets/{dropdown-B7SBYQIK.js → dropdown-DyoepdCT.js} +1 -1
  116. package/dist/assets/{ellipsis-De4stfUn.js → ellipsis-Ca0WK_wY.js} +1 -1
  117. package/dist/assets/esm-BC-wRwdz.js +1 -0
  118. package/dist/assets/{esm-DcOtNuu8.js → esm-BH5cQo4z.js} +1 -1
  119. package/dist/assets/{esm-qyEPsy9e.js → esm-Bwe9360M.js} +2 -2
  120. package/dist/assets/{esm-CKJ-P6XO.js → esm-D5Zso_6z.js} +1 -1
  121. package/dist/assets/{esm-Bb9eRbUR.js → esm-DWBcpseK.js} +3 -3
  122. package/dist/assets/{esm-amOwBZXY.js → esm-T5JwpYBQ.js} +1 -1
  123. package/dist/assets/{esm-ChoG535r.js → esm-eLTRmw18.js} +2 -2
  124. package/dist/assets/{external-link-Bc7gcMYe.js → external-link-rYo7EM25.js} +1 -1
  125. package/dist/assets/{eye-Bu3f0sYw.js → eye-Bu3r5iIo.js} +1 -1
  126. package/dist/assets/{file-BJQ7WeoH.js → file-DM-F2LrK.js} +1 -1
  127. package/dist/assets/{file-output-LMEATd24.js → file-output-BXLii2KQ.js} +1 -1
  128. package/dist/assets/{file-text-DG1QP7yS.js → file-text-DtTY8Ab2.js} +1 -1
  129. package/dist/assets/{fish-CUlc66ZM.js → fish-BPI58rQU.js} +1 -1
  130. package/dist/assets/{flux-BjavzKgE.js → flux-Cc45uz14.js} +1 -1
  131. package/dist/assets/{folder-CTSUftvX.js → folder-SyICqENP.js} +1 -1
  132. package/dist/assets/gauge-BY-ww5QY.js +1 -0
  133. package/dist/assets/{globe-ySJCwB79.js → globe-DWRnXAvB.js} +1 -1
  134. package/dist/assets/{grokvideo-Bg3Y3eQy.js → grokvideo-CP09bddr.js} +1 -1
  135. package/dist/assets/{hailuo-BzvVFCCo.js → hailuo-tW8FkBVT.js} +1 -1
  136. package/dist/assets/{headphones-Bk4KNOcj.js → headphones-BK6018mW.js} +1 -1
  137. package/dist/assets/{history-BtXWH90d.js → history-fXY0W9RL.js} +1 -1
  138. package/dist/assets/{house-B2qNl409.js → house-DdTij0jl.js} +1 -1
  139. package/dist/assets/{image-TpW_0YsE.js → image-DH6_XR7_.js} +1 -1
  140. package/dist/assets/{index-_02dQfqQ.js → index-La_21d58.js} +3 -3
  141. package/dist/assets/{index.browser.esm-BHaC5X-e.js → index.browser.esm-DzlqWLCL.js} +1 -1
  142. package/dist/assets/{index.es-CD2O9ZfG.js → index.es-B0uCFN0A.js} +1 -1
  143. package/dist/assets/{info-CRFT4_9x.js → info-jO8_tFCf.js} +1 -1
  144. package/dist/assets/{input-number-Ck5oXTrR.js → input-number-CUrnNTMQ.js} +1 -1
  145. package/dist/assets/{key-round-Bz__27bq.js → key-round-BXkeXtnZ.js} +1 -1
  146. package/dist/assets/{kling-CpJC3CIz.js → kling-IZq2C-bG.js} +1 -1
  147. package/dist/assets/{languages-U9pgdVRA.js → languages-Bwkdn4oI.js} +1 -1
  148. package/dist/assets/{laptop-CXKkmFFt.js → laptop-C-_vh-A_.js} +1 -1
  149. package/dist/assets/{lightbulb-B_2WzwFY.js → lightbulb-C9oNH906.js} +1 -1
  150. package/dist/assets/{link-cBBmPp85.js → link-CPXxEbEz.js} +1 -1
  151. package/dist/assets/loader-circle-Ke2n_987.js +1 -0
  152. package/dist/assets/{lock-Dsrpql6M.js → lock-BjokhHtF.js} +1 -1
  153. package/dist/assets/{luma-_xKllb55.js → luma-CF7RU-Wm.js} +1 -1
  154. package/dist/assets/{maestro-CadKGsKn.js → maestro-Cq8EHdaJ.js} +1 -1
  155. package/dist/assets/{mail-ClXcnV1x.js → mail-BGpjitir.js} +1 -1
  156. package/dist/assets/{message-circle-D6Ced7fu.js → message-circle-CbtAeLuX.js} +1 -1
  157. package/dist/assets/{mic-CrIR0Mdu.js → mic-sKvsM2cC.js} +1 -1
  158. package/dist/assets/{midjourney-D_NO4gDs.js → midjourney-BnGm99YC.js} +1 -1
  159. package/dist/assets/{mobileLocalExec-9xSUAlfK.js → mobileLocalExec-B91NceKM.js} +2 -2
  160. package/dist/assets/{monitor-zJkSdjgs.js → monitor-wQk0uytX.js} +1 -1
  161. package/dist/assets/{mouse-pointer-2-kRd-niBh.js → mouse-pointer-2-8qCCU6ip.js} +1 -1
  162. package/dist/assets/music-2-B2NVYpjb.js +1 -0
  163. package/dist/assets/{nanobanana-DBuoehz0.js → nanobanana-DxJAS5TP.js} +1 -1
  164. package/dist/assets/{omni-D0IeZPjf.js → omni-BLShh1HO.js} +1 -1
  165. package/dist/assets/{openaiimage-gRhK54U3.js → openaiimage-Cdb7dt1T.js} +1 -1
  166. package/dist/assets/{pagination-Cysw-UNr.js → pagination-BM9WMdjP.js} +1 -1
  167. package/dist/assets/{pagination-CbXPWoAc.js → pagination-Czi4oCtx.js} +1 -1
  168. package/dist/assets/{pagination-BgM8DQvI.js → pagination-Dt_gVul4.js} +1 -1
  169. package/dist/assets/{palette-BeZsH8-7.js → palette-CsAaSTAe.js} +1 -1
  170. package/dist/assets/{paperclip-D5juS5cA.js → paperclip-BlTI2s6T.js} +1 -1
  171. package/dist/assets/{pause-DjtBnAzE.js → pause-CHLpZfXy.js} +1 -1
  172. package/dist/assets/{pencil-Dd4bYU9N.js → pencil-DIZQXLg1.js} +1 -1
  173. package/dist/assets/{pika-D80mK_OY.js → pika-XsMUSJLb.js} +1 -1
  174. package/dist/assets/{pixverse-i_SY03w7.js → pixverse-DNvzHQlB.js} +1 -1
  175. package/dist/assets/play-CKAALMrr.js +1 -0
  176. package/dist/assets/{plug-wC_If8yh.js → plug-tJZnqV8-.js} +1 -1
  177. package/dist/assets/plus-CXRduJme.js +1 -0
  178. package/dist/assets/{poivelle-DIBzD_bJ.js → poivelle-TikNUfHv.js} +1 -1
  179. package/dist/assets/{popover-D0AOwXqQ.js → popover-Cza6Wizf.js} +1 -1
  180. package/dist/assets/{producer-GGohZy7z.js → producer-kIoOuj5t.js} +1 -1
  181. package/dist/assets/{qrart-CSXcbw8n.js → qrart-YF8dr22X.js} +1 -1
  182. package/dist/assets/{realtime-Cj3PEMAV.js → realtime-BxqIKGiq.js} +1 -1
  183. package/dist/assets/{refresh-cw-BZGl-ysb.js → refresh-cw-BnfrSaXN.js} +1 -1
  184. package/dist/assets/rotate-ccw-CaWc0VQQ.js +1 -0
  185. package/dist/assets/rotate-cw-DVJU4kTT.js +1 -0
  186. package/dist/assets/search-CFnTlN_S.js +1 -0
  187. package/dist/assets/{seedance-8A-iG4_f.js → seedance-vB2qylN9.js} +1 -1
  188. package/dist/assets/{seedream-CzcCNs0A.js → seedream-BURXd2G7.js} +1 -1
  189. package/dist/assets/{select-I5AzQP7J.js → select--hLaPd-X.js} +1 -1
  190. package/dist/assets/{serp-BTmQ00q8.js → serp-8Oh3j2wf.js} +1 -1
  191. package/dist/assets/{shield-DDOIuJI9.js → shield-C7MvkIOP.js} +1 -1
  192. package/dist/assets/{shuffle-CCkNLBvY.js → shuffle-SN5Wtmny.js} +1 -1
  193. package/dist/assets/{slider-1PMcyGQO.js → slider-EWdGsOow.js} +1 -1
  194. package/dist/assets/{solana-wallets-BYQM_NMQ.js → solana-wallets-DDkmI1Ma.js} +2 -2
  195. package/dist/assets/{solana-wallets-vue-Dig3YWct.js → solana-wallets-vue-D9U8nDT2.js} +1 -1
  196. package/dist/assets/{sora-BZ9YS4Kb.js → sora-CjIlRd31.js} +1 -1
  197. package/dist/assets/{sparkles-WC3rSzXV.js → sparkles-DyBQZW7g.js} +1 -1
  198. package/dist/assets/square-BZfUhceA.js +1 -0
  199. package/dist/assets/{store-7e9zMYaB.js → store-CH2delsy.js} +1 -1
  200. package/dist/assets/{suno-t6ZOdvj9.js → suno-COhADiph.js} +1 -1
  201. package/dist/assets/{switch-Dwvxe2Wr.js → switch-C-kdhFRG.js} +1 -1
  202. package/dist/assets/{table-Ce5LotRF.js → table-BUug70Yr.js} +1 -1
  203. package/dist/assets/{tag-CCe6GBlV.js → tag-bZ7tDonU.js} +1 -1
  204. package/dist/assets/terminal-DTCjo7w_.js +1 -0
  205. package/dist/assets/{time-picker-CXdn36S1.js → time-picker-B9jqCc2T.js} +1 -1
  206. package/dist/assets/{tooltip-DENV9LWI.js → tooltip-BWmio9dL.js} +1 -1
  207. package/dist/assets/{trash-2-CmzKrdh7.js → trash-2-DSacCdhQ.js} +1 -1
  208. package/dist/assets/{triangle-alert-Dioz1yf5.js → triangle-alert-CZT0mF2a.js} +1 -1
  209. package/dist/assets/{upload-BCbELvzx.js → upload-D3MEiFFV.js} +1 -1
  210. package/dist/assets/user-CphygOn_.js +1 -0
  211. package/dist/assets/{veo-ClVb2vSr.js → veo-DyPaJigc.js} +1 -1
  212. package/dist/assets/{video-iLYuBCpy.js → video-BEAXv7aW.js} +1 -1
  213. package/dist/assets/{volume-2-JhTiwLX5.js → volume-2-X4B74AS-.js} +1 -1
  214. package/dist/assets/{wallet-CkH-psKe.js → wallet-BlAJi5BB.js} +1 -1
  215. package/dist/assets/{wan-T8Gzia7Q.js → wan-DDNUnFpM.js} +1 -1
  216. package/dist/assets/{wand-sparkles-Bw147iU-.js → wand-sparkles-ZWpynNLr.js} +1 -1
  217. package/dist/assets/{web-D2OxdGEz.js → web-B3PuXcPR.js} +1 -1
  218. package/dist/assets/{web-CEu0qHIm.js → web-CGPMqt82.js} +1 -1
  219. package/dist/assets/{web-CztfEMJh.js → web-CNVVZA0M.js} +1 -1
  220. package/dist/assets/{web-pdnHqf9X.js → web-DUT3F6BN.js} +1 -1
  221. package/dist/assets/{web-BNf2gAvZ.js → web-Dauv6_FY.js} +1 -1
  222. package/dist/assets/{webextrator-9weq0Ank.js → webextrator-jDziCKyl.js} +1 -1
  223. package/dist/assets/{zap-DRLZyY1o.js → zap-C4BJjqMY.js} +1 -1
  224. package/dist/index.html +1 -1
  225. package/package.json +1 -1
  226. package/dist/assets/arrow-down-CXO0jsGj.js +0 -1
  227. package/dist/assets/arrow-left-BGnSTK_4.js +0 -1
  228. package/dist/assets/arrow-right-COte09RK.js +0 -1
  229. package/dist/assets/arrow-up-C3xRS4ba.js +0 -1
  230. package/dist/assets/check-CgSk-DpB.js +0 -1
  231. package/dist/assets/chevron-down-elFr5yF7.js +0 -1
  232. package/dist/assets/chevron-right-BCJ9LfAZ.js +0 -1
  233. package/dist/assets/circle-check-kjr90zs5.js +0 -1
  234. package/dist/assets/clock-ghPvxZ_l.js +0 -1
  235. package/dist/assets/code-uX1SA5ku.js +0 -1
  236. package/dist/assets/esm-CYTGG_Xr.js +0 -1
  237. package/dist/assets/gauge-BBStE-q2.js +0 -1
  238. package/dist/assets/loader-circle-C1kgoNKx.js +0 -1
  239. package/dist/assets/music-2-B7nZXmOR.js +0 -1
  240. package/dist/assets/play-DgrWqLU_.js +0 -1
  241. package/dist/assets/plus-qiDtmbUX.js +0 -1
  242. package/dist/assets/rotate-ccw-Co9l58HJ.js +0 -1
  243. package/dist/assets/rotate-cw-DFdEto5A.js +0 -1
  244. package/dist/assets/search-zKzImMGv.js +0 -1
  245. package/dist/assets/square-DWJU39J8.js +0 -1
  246. package/dist/assets/terminal-0zvCT5Pi.js +0 -1
  247. package/dist/assets/user-DoQzutYG.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{t as v}from"./upload-Ch10sTtH.js";import{t as y}from"./tooltip-DENV9LWI.js";import{t as b}from"./alert-BprQRUmf.js";import{h as x,v as S}from"./models-BgHU_JUY.js";import{t as C}from"./drawer-D5bShL7I.js";import{t as w}from"./switch-Dwvxe2Wr.js";import{t as T}from"./clock-ghPvxZ_l.js";import{a as E,c as D,n as O,o as k,r as ee,t as te}from"./pagination-Cysw-UNr.js";import{t as ne}from"./info-CRFT4_9x.js";import{t as A}from"./trash-2-CmzKrdh7.js";import{t as j}from"./triangle-alert-Dioz1yf5.js";import{t as M}from"./upload-BCbELvzx.js";import{t as N}from"./wand-sparkles-Bw147iU-.js";import"./constants-B8L8Pvf9.js";import{$t as P,Gt as F,Mi as I,O as L,Qt as R,Xt as z,Yt as B,Zt as V,ii as H,kr as U,rr as W,tn as G,un as K,vi as q}from"./index-_02dQfqQ.js";import{t as J}from"./CopyToClipboard-ARV7wWpq.js";import{t as Y}from"./ReportButton-Bhl9yVD2.js";import{t as X}from"./FilePreview-C5OXfeqk.js";import{t as Z}from"./ImagePreview-HMkCzfq6.js";import{n as re}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ie}from"./Consumption-XSMnRD9l.js";import{t as Q}from"./VideoPlayer-CDIy68jx.js";import{t as ae}from"./ApiCodeButton-B9c7TGii.js";import{t as oe}from"./BotPlaceholder-B213F4Dv.js";var se=_({name:`LayoutLuma`,components:{MagicIcon:N,ElDrawer:C,ElButton:I},mixins:[re]}),ce={class:`main flex flex-row flex-1`},le={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)]`},ue={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function de(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`,le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ue,[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 fe=L(se,[[`render`,de],[`__scopeId`,`data-v-d13d43a9`]]),pe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),me={class:`relative`},he={class:`flex justify-between`},ge={class:`flex justify-start items-center`},_e={class:`text-sm font-bold`},ve={class:`flex justify-end items-center`};function ye(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,me,[e(`div`,he,[e(`div`,ge,[e(`span`,_e,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,ve,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var be=L(pe,[[`render`,ye]]),xe=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=L(xe,[[`render`,De]]),ke=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=L(ke,[[`render`,Fe]]),Le=_({name:`EndImage`,components:{UploadIcon:M,ElUpload:v,ElButton:I,ImagePreview:Z,InfoIcon:k},mixins:[P,R,z,F],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`};function He(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ue=L(Le,[[`render`,He],[`__scopeId`,`data-v-04c461bb`]]),We=_({name:`StartImage`,components:{UploadIcon:M,ElUpload:v,ElButton:I,ImagePreview:Z,InfoIcon:k},mixins:[P,R,z,F],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ge={class:`relative`},Ke={class:`flex justify-between`},qe={class:`flex justify-start items-center`},Je={class:`text-sm font-bold`};function Ye(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`span`,Je,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,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(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Xe=L(We,[[`render`,Ye],[`__scopeId`,`data-v-31c07a19`]]),Ze=_({name:`UploadVideo`,components:{UploadIcon:M,ElUpload:v,ElButton:I,InfoIcon:k,FilePreview:X},mixins:[R,z],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),Qe={class:`relative`},$e={class:`flex justify-between`},et={class:`flex justify-start items-center`},tt={class:`text-sm font-bold`};function nt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,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(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var rt=L(Ze,[[`render`,nt],[`__scopeId`,`data-v-2189fc52`]]),it=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function at(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(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ot=L(it,[[`render`,at]]),st=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),ct={class:`relative`},lt={class:`flex mb-2`},ut={class:`text-sm font-bold`};function dt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,ct,[e(`div`,lt,[e(`span`,ut,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:N,LoopSelector:Ie,StartImageInput:Xe,EndImageInput:Ue,EnhancementSelector:be,ElButton:I,PromptInput:ot,ExtendFromInput:L(st,[[`render`,dt]]),CustomSelector:Oe,UploadVideo:rt,Consumption:ie},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return G(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ht,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var _t=L(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:D,InfoIcon:ne,MagicIcon:N,TimeIcon:T,WarningIcon:j,CopyToClipboard:J,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:I,ApiCodeButton:ae,ReportButton:Y},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`prompt mt-2`},Dt={key:0},Ot={key:1},kt={key:0,class:n({content:!0,failed:!0})},At={key:0,class:`mb-4`},jt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},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-0`},$={key:1,class:n({content:!0})},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(g,{capability:`luma`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{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:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.modelValue?.request?.prompt?(h(),s(`p`,Et,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Dt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,Ot,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[n.modelValue.response.video_url?(h(),s(`div`,At,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,jt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Mt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,$,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ft,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Lt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Rt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Vt=_({name:`RecentPanel`,components:{BotPlaceholder:oe,TaskPreview:L(vt,[[`render`,Bt],[`__scopeId`,`data-v-7ffd425e`]]),NoTasks:ee,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(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`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=_({name:`LumaIndex`,components:{ConfigPanel:_t,Layout:fe,RecentPanel:L(Vt,[[`render`,Wt]])},mixins:[V],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.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.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await te({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.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(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!B(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!K())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}S.info(this.$t(`luma.message.startingTask`)),U(`luma`,W.generate(e,{token:t})).then(()=>{S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?S.error(this.$t(`luma.message.usedUp`)):S.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Kt(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,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=L(Gt,[[`render`,Kt]]);export{qt 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{t as v}from"./upload-Ch10sTtH.js";import{t as y}from"./tooltip-BWmio9dL.js";import{t as b}from"./alert-BprQRUmf.js";import{h as x,v as S}from"./models-BgHU_JUY.js";import{t as C}from"./drawer-CrLrAuYO.js";import{t as w}from"./switch-C-kdhFRG.js";import{t as T}from"./clock-B3fFaHCL.js";import{a as E,c as D,n as O,o as k,r as ee,t as te}from"./pagination-BM9WMdjP.js";import{t as ne}from"./info-jO8_tFCf.js";import{t as A}from"./trash-2-DSacCdhQ.js";import{t as j}from"./triangle-alert-CZT0mF2a.js";import{t as M}from"./upload-D3MEiFFV.js";import{t as N}from"./wand-sparkles-ZWpynNLr.js";import"./constants-B8L8Pvf9.js";import{$t as P,Gt as F,Mi as I,O as L,Qt as R,Xt as z,Yt as B,Zt as V,ii as H,kr as U,rr as W,tn as G,un as K,vi as q}from"./index-La_21d58.js";import{t as J}from"./CopyToClipboard-BwVdHYYm.js";import{t as Y}from"./ReportButton-D7wL8z6N.js";import{t as X}from"./FilePreview-j7Q9LeP4.js";import{t as Z}from"./ImagePreview-Dkx4nOhz.js";import{n as re}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ie}from"./Consumption-DZVrxh1r.js";import{t as Q}from"./VideoPlayer-DNi7m8bA.js";import{t as ae}from"./ApiCodeButton-DCLoOHa7.js";import{t as oe}from"./BotPlaceholder-_QxGzCkh.js";var se=_({name:`LayoutLuma`,components:{MagicIcon:N,ElDrawer:C,ElButton:I},mixins:[re]}),ce={class:`main flex flex-row flex-1`},le={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)]`},ue={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function de(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`,le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ue,[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 fe=L(se,[[`render`,de],[`__scopeId`,`data-v-d13d43a9`]]),pe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),me={class:`relative`},he={class:`flex justify-between`},ge={class:`flex justify-start items-center`},_e={class:`text-sm font-bold`},ve={class:`flex justify-end items-center`};function ye(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,me,[e(`div`,he,[e(`div`,ge,[e(`span`,_e,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,ve,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var be=L(pe,[[`render`,ye]]),xe=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=L(xe,[[`render`,De]]),ke=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=L(ke,[[`render`,Fe]]),Le=_({name:`EndImage`,components:{UploadIcon:M,ElUpload:v,ElButton:I,ImagePreview:Z,InfoIcon:k},mixins:[P,R,z,F],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`};function He(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ue=L(Le,[[`render`,He],[`__scopeId`,`data-v-04c461bb`]]),We=_({name:`StartImage`,components:{UploadIcon:M,ElUpload:v,ElButton:I,ImagePreview:Z,InfoIcon:k},mixins:[P,R,z,F],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ge={class:`relative`},Ke={class:`flex justify-between`},qe={class:`flex justify-start items-center`},Je={class:`text-sm font-bold`};function Ye(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`span`,Je,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,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(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Xe=L(We,[[`render`,Ye],[`__scopeId`,`data-v-31c07a19`]]),Ze=_({name:`UploadVideo`,components:{UploadIcon:M,ElUpload:v,ElButton:I,InfoIcon:k,FilePreview:X},mixins:[R,z],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),Qe={class:`relative`},$e={class:`flex justify-between`},et={class:`flex justify-start items-center`},tt={class:`text-sm font-bold`};function nt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,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(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var rt=L(Ze,[[`render`,nt],[`__scopeId`,`data-v-2189fc52`]]),it=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function at(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(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ot=L(it,[[`render`,at]]),st=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),ct={class:`relative`},lt={class:`flex mb-2`},ut={class:`text-sm font-bold`};function dt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,ct,[e(`div`,lt,[e(`span`,ut,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:N,LoopSelector:Ie,StartImageInput:Xe,EndImageInput:Ue,EnhancementSelector:be,ElButton:I,PromptInput:ot,ExtendFromInput:L(st,[[`render`,dt]]),CustomSelector:Oe,UploadVideo:rt,Consumption:ie},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return G(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ht,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var _t=L(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:D,InfoIcon:ne,MagicIcon:N,TimeIcon:T,WarningIcon:j,CopyToClipboard:J,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:I,ApiCodeButton:ae,ReportButton:Y},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`prompt mt-2`},Dt={key:0},Ot={key:1},kt={key:0,class:n({content:!0,failed:!0})},At={key:0,class:`mb-4`},jt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},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-0`},$={key:1,class:n({content:!0})},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(g,{capability:`luma`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{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:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.modelValue?.request?.prompt?(h(),s(`p`,Et,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Dt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,Ot,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[n.modelValue.response.video_url?(h(),s(`div`,At,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,jt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Mt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,$,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ft,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Lt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Rt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Vt=_({name:`RecentPanel`,components:{BotPlaceholder:oe,TaskPreview:L(vt,[[`render`,Bt],[`__scopeId`,`data-v-7ffd425e`]]),NoTasks:ee,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(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`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=_({name:`LumaIndex`,components:{ConfigPanel:_t,Layout:fe,RecentPanel:L(Vt,[[`render`,Wt]])},mixins:[V],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.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.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await te({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.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(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!B(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!K())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}S.info(this.$t(`luma.message.startingTask`)),U(`luma`,W.generate(e,{token:t})).then(()=>{S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?S.error(this.$t(`luma.message.usedUp`)):S.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Kt(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,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=L(Gt,[[`render`,Kt]]);export{qt 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,P as c,T as l,at as u,ht as d,it as f,j as p,mt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-I5AzQP7J.js";import{t as x}from"./upload-Ch10sTtH.js";import{t as S}from"./tooltip-DENV9LWI.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-BgHU_JUY.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{n as O,t as k}from"./collapse-BvBcmWkW.js";import{t as A}from"./drawer-D5bShL7I.js";import{t as j}from"./input-number-Ck5oXTrR.js";import{t as M}from"./progress-BuyYfFZn.js";import{t as N}from"./clock-ghPvxZ_l.js";import{a as P,c as F,n as ee,o as te,r as ne,s as I,t as re}from"./pagination-Cysw-UNr.js";import{t as ie}from"./info-CRFT4_9x.js";import{t as ae}from"./music-2-B7nZXmOR.js";import{t as oe}from"./plus-qiDtmbUX.js";import{t as L}from"./trash-2-CmzKrdh7.js";import{t as R}from"./triangle-alert-Dioz1yf5.js";import{t as se}from"./upload-BCbELvzx.js";import{t as ce}from"./user-DoQzutYG.js";import{t as le}from"./video-iLYuBCpy.js";import{t as z}from"./wand-sparkles-Bw147iU-.js";import{Cr as ue,Dr as de,Or as fe,Sr as B,wr as V,xr as pe}from"./constants-B8L8Pvf9.js";import{$t as me,Bi as he,Ci as ge,Gt as _e,Mi as H,O as U,Qt as ve,Xn as W,Xt as ye,Yt as be,Zt as xe,gi as Se,ii as Ce,kr as we,tn as Te,un as Ee,vi as De}from"./index-_02dQfqQ.js";import{t as Oe}from"./CopyToClipboard-ARV7wWpq.js";import{t as ke}from"./ReportButton-Bhl9yVD2.js";import{t as G}from"./ImagePreview-HMkCzfq6.js";import{n as Ae}from"./taskDrawerMixin-DyAUhFEq.js";import{t as K}from"./Consumption-XSMnRD9l.js";import{n as q,t as J}from"./VideoPreview-CQPmAFdg.js";import{t as je}from"./VideoPlayer-CDIy68jx.js";import{t as Me}from"./ApiCodeButton-B9c7TGii.js";import{t as Ne}from"./BotPlaceholder-B213F4Dv.js";var Pe=v({name:`LayoutDigitalHuman`,components:{UserIcon:ce,ElDrawer:A,ElButton:H},mixins:[Ae]}),Fe={class:`main flex flex-row flex-1`},Ie={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)]`},Le={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Re(t,n,r,i,o,c){let l=u(`user-icon`),p=u(`el-button`),h=u(`el-drawer`);return g(),s(`div`,Fe,[e(`div`,Ie,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Le,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ze=U(Pe,[[`render`,Re],[`__scopeId`,`data-v-e912fd04`]]),Be=v({name:`DigitalHumanMediaInput`,components:{AudioPreview:q,CloseIcon:Se,ElButton:H,ElProgress:M,ElUpload:x,ImagePreview:G,MusicIcon:ae,UploadIcon:se,VideoIcon:le,VideoPreview:J},mixins:[me,ve,ye,_e],props:{kind:{type:String,required:!0},accept:{type:String,default:``},buttonText:{type:String,default:``},hint:{type:String,default:``}},emits:[`change`],data(){return{fileList:[],uploadUrl:Ce()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},hasFile(){return this.fileList.length>0}},methods:{uploadedUrl(e){return e?.response?.file_url},isPending(e){return e.status===`ready`||e.status===`uploading`},onExceed(e){let t=this.$refs.uploader;t?.clearFiles();let n=e[0];n&&(t?.handleStart?.(n),t?.submit?.())},onError(){T.error(this.$t(`digitalhuman.message.uploadError`))},onRemoveFile(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onChange()},onChange(){let e=this.fileList?.[0];this.$emit(`change`,e?this.uploadedUrl(e):void 0)}}}),Ve={class:`thumb`},He={key:2,class:`placeholder`},Ue=[`title`],We=[`aria-label`,`title`,`onClick`],Ge={key:0,class:`hint`};function Ke(c,d,f,h,_,v){let y=u(`image-preview`),b=u(`video-preview`),x=u(`audio-preview`),S=u(`el-progress`),C=u(`video-icon`),w=u(`music-icon`),T=u(`close-icon`),E=u(`upload-icon`),D=u(`el-button`),O=u(`el-upload`);return g(),p(O,{ref:`uploader`,"file-list":c.fileList,"onUpdate:fileList":d[0]||=e=>c.fileList=e,accept:c.accept,name:`file`,class:`media-input`,limit:1,multiple:!1,"before-upload":c.beforeUploadSizeGuard,action:c.uploadUrl,headers:c.headers,"on-exceed":c.onExceed,"on-error":c.onError,"on-success":c.onChange,"on-remove":c.onChange},{file:m(({file:r})=>[e(`div`,{class:n([`slot`,{pending:c.isPending(r)}])},[c.kind===`image`&&r.url?(g(),p(y,{key:0,url:r.url,name:r.name,percentage:r.percentage,onRemove:e=>c.onRemoveFile(r)},null,8,[`url`,`name`,`percentage`,`onRemove`])):(g(),s(l,{key:1},[e(`div`,Ve,[c.kind===`video`&&c.uploadedUrl(r)?(g(),p(b,{key:0,url:c.uploadedUrl(r)},null,8,[`url`])):c.kind===`audio`&&c.uploadedUrl(r)?(g(),p(x,{key:1,url:c.uploadedUrl(r)},null,8,[`url`])):(g(),s(`div`,He,[c.isPending(r)?(g(),p(S,{key:0,type:`circle`,"stroke-width":4,percentage:Math.round(r.percentage||0),width:34},null,8,[`percentage`])):c.kind===`video`?(g(),p(C,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),p(w,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]))]),e(`span`,{class:`filename`,title:r.name},i(r.name),9,Ue),e(`button`,{type:`button`,class:`remove`,"aria-label":c.$t(`common.button.close`),title:c.$t(`common.button.close`),onClick:t(e=>c.onRemoveFile(r),[`stop`])},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,We)],64))],2)]),default:m(()=>[a(D,{round:``,type:`primary`,size:`small`,class:`btn`},{default:m(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.hasFile?c.$t(`digitalhuman.button.replace`):c.buttonText),1)]),_:1}),c.hint?(g(),s(`p`,Ge,i(c.hint),1)):o(``,!0)]),_:1},8,[`file-list`,`accept`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])}var Y=U(Be,[[`render`,Ke],[`__scopeId`,`data-v-db0590a9`]]),qe=20,X=e=>{let t=e;return!!t&&typeof t.voice_id==`string`&&!!t.voice_id&&typeof t.name==`string`},Z=()=>{try{let e=JSON.parse(localStorage.getItem(`digitalhuman.voices`)||`[]`);return Array.isArray(e)?e.filter(X).map(e=>({voice_id:e.voice_id,name:e.name,lang:typeof e.lang==`string`?e.lang:`zh`,created_at:typeof e.created_at==`number`?e.created_at:0})):[]}catch{return[]}},Q=e=>{try{localStorage.setItem(fe,JSON.stringify(e))}catch{}return e},Je=e=>X(e)?Q([e,...Z().filter(t=>t.voice_id!==e.voice_id)].slice(0,qe)):Z(),Ye=e=>Q(Z().filter(t=>t.voice_id!==e)),Xe=e=>`${e} ${Z().length+1}`,Ze=3e3,Qe=60,$e=v({name:`DigitalHumanVoiceCloneDialog`,components:{Consumption:K,ElAlert:C,ElButton:H,ElDialog:ge,ElInput:he,ElRadioButton:E,ElRadioGroup:D,MediaInput:Y},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`,`cloned`],data(){return{sampleUrl:void 0,name:``,lang:`zh`,cloning:!1,destroyed:!1,runId:0,DIGITALHUMAN_AUDIO_ACCEPT:B,DIGITALHUMAN_VOICE_CLONE_CONSUMPTION:2}},computed:{service(){return this.$store.state.digitalhuman?.service},credentialToken(){return this.$store.state.digitalhuman?.credential?.token},langOptions(){return pe.map(e=>({value:e,label:this.$t(`digitalhuman.name.lang_${e}`)}))}},watch:{visible(e){e?(this.sampleUrl=void 0,this.name=Xe(this.$t(`digitalhuman.name.myVoice`)),this.lang=`zh`):(this.runId++,this.cloning=!1)}},beforeUnmount(){this.destroyed=!0,this.runId++},methods:{onVisible(e){this.cloning&&!e||this.$emit(`update:visible`,e)},onSampleChange(e){this.sampleUrl=e},isStale(e){return this.destroyed||e!==this.runId},sleep(e){return new Promise(t=>setTimeout(t,e))},async onClone(){let e=this.credentialToken;if(!this.sampleUrl||!e)return;let t=++this.runId;this.cloning=!0;try{let{data:n}=await W.cloneVoice({audio_url:this.sampleUrl,lang:this.lang,name:this.name||void 0},{token:e});if(this.isStale(t))return;if(n?.voice_id){this.onCloned(n.voice_id);return}if(n?.task_id)await this.pollVoice(n.task_id,e,t);else throw Error(`no task`)}catch{this.isStale(t)||T.error(this.$t(`digitalhuman.message.voiceCloneFailed`))}finally{this.isStale(t)||(this.cloning=!1)}},async pollVoice(e,t,n){for(let r=0;r<Qe;r++){if(this.isStale(n)||(await this.sleep(Ze),this.isStale(n)))return;let{data:r}=await W.pollTask(e,{token:t});if(this.isStale(n))return;if(r?.voice_id){this.onCloned(r.voice_id);return}if(r?.state===`failed`)throw Error(`clone failed`)}throw Error(`timeout`)},onCloned(e){Je({voice_id:e,name:this.name||this.$t(`digitalhuman.name.myVoice`),lang:this.lang,created_at:Date.now()/1e3}),T.success(this.$t(`digitalhuman.message.voiceCloneSuccess`)),this.cloning=!1,this.$emit(`cloned`,e),this.$emit(`update:visible`,!1)}}}),et={class:`text-xs text-[var(--el-text-color-secondary)] mb-3`},tt={class:`field mb-3`},nt={class:`label`},rt={class:`field`},it={class:`label`},at={class:`text-xs mb-0`},ot={key:1,class:`mt-4 text-xs text-[var(--el-text-color-secondary)]`},st={class:`footer`};function ct(t,n,o,c,d,f){let _=u(`media-input`),v=u(`el-input`),y=u(`el-radio-button`),b=u(`el-radio-group`),x=u(`el-alert`),S=u(`consumption`),C=u(`el-button`),w=u(`el-dialog`);return g(),p(w,{"model-value":t.visible,title:t.$t(`digitalhuman.name.cloneVoice`),width:`440`,"align-center":``,"append-to-body":``,"close-on-click-modal":!t.cloning,"close-on-press-escape":!t.cloning,"onUpdate:modelValue":t.onVisible},{footer:m(()=>[e(`div`,st,[a(S,{value:t.DIGITALHUMAN_VOICE_CLONE_CONSUMPTION,service:t.service,class:`cost`},null,8,[`value`,`service`]),e(`div`,null,[a(C,{disabled:t.cloning,onClick:n[2]||=e=>t.onVisible(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`]),a(C,{type:`primary`,loading:t.cloning,disabled:!t.sampleUrl||t.cloning,onClick:t.onClone},{default:m(()=>[r(i(t.$t(`digitalhuman.button.startClone`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])]),default:m(()=>[e(`p`,et,i(t.$t(`digitalhuman.message.voiceCloneHint`)),1),a(_,{kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSample`),hint:t.$t(`digitalhuman.message.audioHint`),class:`mb-4`,onChange:t.onSampleChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]),e(`div`,tt,[e(`span`,nt,i(t.$t(`digitalhuman.name.voiceName`)),1),a(v,{modelValue:t.name,"onUpdate:modelValue":n[0]||=e=>t.name=e,class:`control`,placeholder:t.$t(`digitalhuman.placeholder.voiceName`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,rt,[e(`span`,it,i(t.$t(`digitalhuman.name.voiceLang`)),1),a(b,{modelValue:t.lang,"onUpdate:modelValue":n[1]||=e=>t.lang=e,class:`control`},{default:m(()=>[(g(!0),s(l,null,h(t.langOptions,e=>(g(),p(y,{key:e.value,value:e.value},{default:m(()=>[r(i(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])]),t.cloning?(g(),p(x,{key:0,closable:!1,type:`info`,class:`mt-4`},{default:m(()=>[e(`p`,at,i(t.$t(`digitalhuman.message.voiceCloneRunning`)),1)]),_:1})):(g(),s(`p`,ot,i(t.$t(`digitalhuman.message.voiceStoredLocally`)),1))]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`onUpdate:modelValue`])}var lt=v({name:`DigitalHumanTimbreSelector`,components:{AddIcon:oe,DeleteIcon:L,ElButton:H,ElOption:b,ElSelect:y,VoiceCloneDialog:U($e,[[`render`,ct],[`__scopeId`,`data-v-ba35b653`]])},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{voices:Z(),dialogVisible:!1}},mounted(){this.modelValue&&!this.voices.some(e=>e.voice_id===this.modelValue)&&this.$emit(`update:modelValue`,void 0)},methods:{labelFor(e){let t=this.$t(`digitalhuman.name.lang_${e.lang}`);return t.startsWith(`digitalhuman.`)?e.name:`${e.name} · ${t}`},onCloned(e){this.voices=Z(),this.$emit(`update:modelValue`,e)},onRemove(e){this.voices=Ye(e),this.modelValue===e&&this.$emit(`update:modelValue`,void 0)}}}),ut={class:`row`},dt={class:`label`},ft={class:`option`},pt={class:`option-name`},mt=[`aria-label`,`title`,`onClick`],ht={class:`empty`};function gt(n,o,d,f,_,v){let y=u(`delete-icon`),b=u(`el-option`),x=u(`el-select`),S=u(`add-icon`),C=u(`el-button`),w=u(`voice-clone-dialog`);return g(),s(`div`,null,[e(`div`,ut,[e(`span`,dt,i(n.$t(`digitalhuman.name.timbre`)),1),a(x,{"model-value":n.modelValue,class:`control`,placeholder:n.$t(`digitalhuman.placeholder.pickTimbre`),"onUpdate:modelValue":o[0]||=e=>n.$emit(`update:modelValue`,e)},c({default:m(()=>[(g(!0),s(l,null,h(n.voices,r=>(g(),p(b,{key:r.voice_id,label:n.labelFor(r),value:r.voice_id},{default:m(()=>[e(`span`,ft,[e(`span`,pt,i(n.labelFor(r)),1),e(`button`,{type:`button`,class:`option-remove`,"aria-label":n.$t(`common.button.delete`),title:n.$t(`common.button.delete`),onClick:t(e=>n.onRemove(r.voice_id),[`stop`])},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,mt)])]),_:2},1032,[`label`,`value`]))),128))]),_:2},[n.voices.length===0?{name:`empty`,fn:m(()=>[e(`p`,ht,i(n.$t(`digitalhuman.message.noVoiceYet`)),1)]),key:`0`}:void 0]),1032,[`model-value`,`placeholder`])]),a(C,{size:`small`,text:``,type:`primary`,class:`clone`,onClick:o[1]||=e=>n.dialogVisible=!0},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.button.cloneNewVoice`)),1)]),_:1}),a(w,{visible:n.dialogVisible,"onUpdate:visible":o[2]||=e=>n.dialogVisible=e,onCloned:n.onCloned},null,8,[`visible`,`onCloned`])])}var _t=v({name:`ConfigPanel`,components:{Consumption:K,ElButton:H,ElCollapse:k,ElCollapseItem:O,ElInputNumber:j,ElRadioButton:E,ElRadioGroup:D,InfoIcon:te,MagicIcon:z,MediaInput:Y,PromptTextarea:P,TimbreSelector:U(lt,[[`render`,gt],[`__scopeId`,`data-v-e191cc56`]]),WarningIcon:R},emits:[`generate`],data(){return{faceMode:`video`,voiceMode:`text`,advancedOpen:[],DIGITALHUMAN_VIDEO_ACCEPT:de,DIGITALHUMAN_IMAGE_ACCEPT:V,DIGITALHUMAN_AUDIO_ACCEPT:B}},computed:{config(){return this.$store.state.digitalhuman?.config},service(){return this.$store.state.digitalhuman?.service},consumption(){return Te(this.config,this.service?.cost)},missing(){let e=[];return(this.faceMode===`video`?this.config?.video_url:this.config?.image_url)||e.push({key:`face`,message:this.$t(`digitalhuman.message.missingFace`)}),this.voiceMode===`text`?(this.config?.text?.trim()||e.push({key:`text`,message:this.$t(`digitalhuman.message.missingText`)}),this.config?.voice_id||e.push({key:`timbre`,message:this.$t(`digitalhuman.message.missingTimbre`)})):this.config?.audio_url||e.push({key:`audio`,message:this.$t(`digitalhuman.message.missingAudio`)}),e},text:{get(){return this.config?.text},set(e){this.update({text:e})}},voiceId:{get(){return this.config?.voice_id},set(e){this.update({voice_id:e})}},speed:{get(){return this.config?.speed??1},set(e){this.update({speed:e})}}},mounted(){this.config?.image_url&&!this.config?.video_url&&(this.faceMode=`photo`),this.config?.audio_url&&(this.voiceMode=`audio`)},methods:{isMissing(e){return this.missing.some(t=>t.key===e)},update(e){this.$store.commit(`digitalhuman/setConfig`,{...this.config,...e})},onFaceModeChange(e){this.update(e===`video`?{image_url:void 0}:{video_url:void 0})},onVoiceModeChange(e){this.update(e===`audio`?{text:void 0,voice_id:void 0}:{audio_url:void 0})},onFaceVideoChange(e){this.update({video_url:e})},onFacePhotoChange(e){this.update({image_url:e})},onAudioChange(e){this.update({audio_url:e})},onGenerate(){let e=this.missing[0];if(e){T.warning(e.message);let t=e.key===`face`?`face`:`voice`;this.$refs[t]?.scrollIntoView?.({behavior:`smooth`,block:`center`});return}let t=this.config||{},n={video_url:this.faceMode===`video`?t.video_url:t.image_url};this.voiceMode===`audio`?n.audio_url=t.audio_url:(n.text=t.text,n.voice_id=t.voice_id),t.speed&&t.speed!==1&&(n.speed=t.speed),this.$emit(`generate`,n)}}}),vt={class:`flex flex-col h-full`},yt={class:`flex-1 overflow-y-auto p-5`},bt={ref:`face`,class:`field-block mb-6`},xt={class:`field-head`},St={class:`field-title font-bold`},Ct={key:0,class:`required-badge`},wt={ref:`voice`,class:`field-block mb-6`},Tt={class:`field-head`},Et={class:`field-title font-bold`},Dt={key:0,class:`required-badge`},Ot={class:`field-row`},kt={class:`field-head`},At={class:`field-title font-bold`},jt={class:`flex flex-col items-center justify-center px-5 pb-5`},Mt={key:0,class:`hint-missing`},Nt={class:`hint-eta`};function Pt(t,n,c,d,f,h){let _=u(`info-icon`),v=u(`el-radio-button`),y=u(`el-radio-group`),b=u(`media-input`),x=u(`prompt-textarea`),S=u(`timbre-selector`),C=u(`el-input-number`),w=u(`el-collapse-item`),T=u(`el-collapse`),E=u(`warning-icon`),D=u(`consumption`),O=u(`magic-icon`),k=u(`el-button`);return g(),s(`div`,vt,[e(`div`,yt,[e(`section`,bt,[e(`div`,xt,[e(`h2`,St,i(t.$t(`digitalhuman.name.step1`)),1),t.isMissing(`face`)?(g(),s(`span`,Ct,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step1`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.faceMode,"onUpdate:modelValue":n[0]||=e=>t.faceMode=e,class:`mode-switch mb-3`,onChange:t.onFaceModeChange},{default:m(()=>[a(v,{value:`video`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModeVideo`)),1)]),_:1}),a(v,{value:`photo`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModePhoto`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.faceMode===`video`?(g(),p(b,{key:0,kind:`video`,accept:t.DIGITALHUMAN_VIDEO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFaceVideo`),hint:t.$t(`digitalhuman.message.faceVideoHint`),onChange:t.onFaceVideoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`])):(g(),p(b,{key:1,kind:`image`,accept:t.DIGITALHUMAN_IMAGE_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFacePhoto`),hint:t.$t(`digitalhuman.message.facePhotoHint`),onChange:t.onFacePhotoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),e(`section`,wt,[e(`div`,Tt,[e(`h2`,Et,i(t.$t(`digitalhuman.name.step2`)),1),t.isMissing(`text`)||t.isMissing(`timbre`)||t.isMissing(`audio`)?(g(),s(`span`,Dt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step2`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.voiceMode,"onUpdate:modelValue":n[1]||=e=>t.voiceMode=e,class:`mode-switch mb-3`,onChange:t.onVoiceModeChange},{default:m(()=>[a(v,{value:`text`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeText`)),1)]),_:1}),a(v,{value:`audio`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeAudio`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.voiceMode===`text`?(g(),s(l,{key:0},[a(x,{modelValue:t.text,"onUpdate:modelValue":n[2]||=e=>t.text=e,class:`mb-3`,title:t.$t(`digitalhuman.name.speech`),placeholder:t.$t(`digitalhuman.placeholder.speech`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`placeholder`]),a(S,{modelValue:t.voiceId,"onUpdate:modelValue":n[3]||=e=>t.voiceId=e},null,8,[`modelValue`])],64)):(g(),p(b,{key:1,kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSpeechAudio`),hint:t.$t(`digitalhuman.message.audioHint`),onChange:t.onAudioChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),a(T,{modelValue:t.advancedOpen,"onUpdate:modelValue":n[5]||=e=>t.advancedOpen=e,class:`advanced`},{default:m(()=>[a(w,{name:`advanced`,title:t.$t(`digitalhuman.name.advanced`)},{default:m(()=>[e(`div`,Ot,[e(`div`,kt,[e(`h2`,At,i(t.$t(`digitalhuman.name.speed`)),1),a(_,{content:t.$t(`digitalhuman.description.speed`),class:`ml-1`},null,8,[`content`])]),a(C,{modelValue:t.speed,"onUpdate:modelValue":n[4]||=e=>t.speed=e,class:`field-control`,min:.5,max:2,step:.1,precision:1,"controls-position":`right`},null,8,[`modelValue`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])]),e(`div`,jt,[t.missing.length>0?(g(),s(`p`,Mt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.missing[0].message),1)])):o(``,!0),a(D,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(k,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(O,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`digitalhuman.button.generateVideo`)),1)]),_:1},8,[`onClick`]),e(`p`,Nt,i(t.$t(`digitalhuman.message.eta`)),1)])])}var Ft=U(_t,[[`render`,Pt],[`__scopeId`,`data-v-7c935d33`]]),It=[`.jpg`,`.jpeg`,`.png`,`.webp`,`.bmp`,`.gif`],Lt=v({name:`TaskPreview`,components:{ApiCodeButton:Me,AudioPreview:q,ChannelIcon:F,CopyToClipboard:Oe,DeleteIcon:L,ElAlert:C,ElButton:H,ElProgress:M,ElTooltip:S,FullscreenIcon:I,ImagePreview:G,InfoIcon:ie,MagicIcon:z,ReportButton:ke,TimeIcon:N,VideoPlayer:je,VideoPreview:J,WarningIcon:R},props:{modelValue:{type:Object,required:!0}},computed:{status(){return this.modelValue?.status||this.modelValue?.response?.state||`pending`},isSuccess(){return[`succeed`,`succeeded`].includes(this.status)||!!this.modelValue?.response?.video_url},isFailure(){return[`failed`,`dead`].includes(this.status)||this.modelValue?.response?.success===!1},isTerminal(){return this.isSuccess||this.isFailure},videoUrl(){return this.modelValue?.response?.video_url},progressPct(){let e=this.modelValue?.response?.progress;return typeof e==`number`?e:0},voiceLabel(){return this.modelValue?.request?.audio_url?this.$t(`digitalhuman.name.audioDriven`):this.$t(`digitalhuman.name.textDriven`)},faceUrl(){return this.modelValue?.request?.video_url||this.modelValue?.request?.image_url},isPhotoFace(){if(this.modelValue?.request?.image_url)return!0;let e=(this.faceUrl||``).split(`?`)[0].toLowerCase();return It.some(t=>e.endsWith(t))},audioUrl(){return this.modelValue?.request?.audio_url},outputSize(){let{width:e,height:t}=this.modelValue?.response||{};return e&&t?`${e}×${t}`:void 0},etaText(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(!e)return;let t=ue-(Date.now()/1e3-e);return t<=60?this.$t(`digitalhuman.message.etaAlmostDone`):this.$t(`digitalhuman.message.etaRemaining`,{minutes:Math.ceil(t/60)})},statusLabel(){let e=`digitalhuman.status.${this.status}`,t=this.$t(e);return t===e?this.$t(`digitalhuman.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await De.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(`digitalhuman/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)}}}),Rt={class:`preview`},zt={class:`left`},Bt={class:`main`},Vt={class:`bot`},Ht={class:`datetime`},Ut=[`aria-label`],Wt={class:`info`},Gt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Kt={class:`prompt mt-2`},qt={key:0},Jt={key:0,class:`content`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Qt={key:1,class:`content`},$t={class:`operations mt-2`},en={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},an={key:2,class:`content`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function un(n,c,l,d,f,h){let _=u(`capability-presentation`),v=u(`delete-icon`),y=u(`el-tooltip`),b=u(`image-preview`),x=u(`video-preview`),S=u(`audio-preview`),C=u(`time-icon`),w=u(`el-progress`),T=u(`magic-icon`),E=u(`copy-to-clipboard`),D=u(`el-alert`),O=u(`video-player`),k=u(`el-button`),A=u(`api-code-button`),j=u(`report-button`),M=u(`fullscreen-icon`),N=u(`channel-icon`),P=u(`warning-icon`),F=u(`info-icon`);return g(),s(`div`,Rt,[e(`div`,zt,[a(_,{capability:`digitalhuman`,part:`avatar`,class:`avatar`})]),e(`div`,Bt,[e(`div`,Vt,[a(_,{capability:`digitalhuman`,part:`name`}),e(`span`,Ht,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Ut)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Wt,[n.faceUrl||n.audioUrl?(g(),s(`div`,Gt,[n.faceUrl&&n.isPhotoFace?(g(),p(b,{key:0,url:n.faceUrl,name:`face`,closable:!1},null,8,[`url`])):n.faceUrl?(g(),p(x,{key:1,url:n.faceUrl,name:`face`},null,8,[`url`])):o(``,!0),n.audioUrl?(g(),p(S,{key:2,url:n.audioUrl,name:`audio`},null,8,[`url`])):o(``,!0)])):o(``,!0),e(`p`,Kt,[r(i(n.modelValue?.request?.text||n.voiceLabel)+` `,1),n.isTerminal?o(``,!0):(g(),s(`span`,qt,` - (`+i(n.statusLabel)+`) `,1))])]),n.isTerminal?o(``,!0):(g(),s(`div`,Jt,[a(D,{closable:!1,class:`info-state`},{default:m(()=>[e(`p`,Yt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.statusLabel),1)]),a(w,{percentage:n.progressPct,"stroke-width":6,class:`mb-2`},null,8,[`percentage`]),n.etaText?(g(),s(`p`,Xt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.etaLabel`))+`: `+i(n.etaText),1)])):o(``,!0),e(`p`,Zt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])),n.isSuccess?(g(),s(`div`,Qt,[n.videoUrl?(g(),p(O,{key:0,src:n.videoUrl},null,8,[`src`])):o(``,!0),e(`div`,$t,[n.videoUrl?(g(),p(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=e=>n.onDownload(e,n.videoUrl)},{default:m(()=>[r(i(n.$t(`digitalhuman.button.download`)),1)]),_:1})):o(``,!0),a(A,{path:`/digital-human/videos`,body:n.modelValue?.request},null,8,[`body`]),a(j,{service:`digitalhuman`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.response?.duration?(g(),s(`p`,en,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.duration`))+`: `+i(n.modelValue?.response?.duration?.toFixed(1))+`s `,1)])):o(``,!0),n.outputSize?(g(),s(`p`,$,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.outputSize`))+`: `+i(n.outputSize),1)])):o(``,!0),e(`p`,tn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,nn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,an,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failure`)),1)]),default:m(()=>[e(`p`,on,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(g(),s(`p`,sn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(E,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,cn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var dn=v({name:`RecentPanel`,components:{TaskPreview:U(Lt,[[`render`,un],[`__scopeId`,`data-v-342f1d6d`]]),NoTasks:ne,BotPlaceholder:Ne,ScrollList:ee},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.digitalhuman?.tasks,items:this.$store.state.digitalhuman?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),fn={key:0},pn={key:2,class:`w-full h-full flex items-center justify-center`};function mn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),_=u(`scroll-list`),v=u(`no-tasks`);return g(),s(l,null,[e.tasks?.items===void 0?(g(),s(`div`,fn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),p(_,{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:m(()=>[(g(!0),s(l,null,h(e.tasks?.items,(e,t)=>(g(),p(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,pn,[a(v)])):o(``,!0)],64)}var hn=v({name:`DigitalHumanIndex`,components:{ConfigPanel:Ft,Layout:ze,RecentPanel:U(dn,[[`render`,mn]])},mixins:[xe],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.digitalhuman?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.digitalhuman?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.digitalhuman.credential},config(){return this.$store.state.digitalhuman.config},tasks(){return this.$store.state.digitalhuman.tasks}},watch:{initialized:{async handler(e){window.clearInterval(this.job),e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await re({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(){await this.$store.dispatch(`digitalhuman/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`digitalhuman/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(e){if(!be(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!Ee())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}T.info(this.$t(`digitalhuman.message.startingTask`)),we(`digitalhuman`,W.generate(e,{token:t})).then(()=>{T.success(this.$t(`digitalhuman.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?T.error(this.$t(`digitalhuman.message.usedUp`)):T.error(this.$t(`digitalhuman.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function gn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return g(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var _n=U(hn,[[`render`,gn]]);export{_n 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,P as c,T as l,at as u,ht as d,it as f,j as p,mt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select--hLaPd-X.js";import{t as x}from"./upload-Ch10sTtH.js";import{t as S}from"./tooltip-BWmio9dL.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-BgHU_JUY.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{n as O,t as k}from"./collapse-BvBcmWkW.js";import{t as A}from"./drawer-CrLrAuYO.js";import{t as j}from"./input-number-CUrnNTMQ.js";import{t as M}from"./progress-BuyYfFZn.js";import{t as N}from"./clock-B3fFaHCL.js";import{a as P,c as F,n as ee,o as te,r as ne,s as I,t as re}from"./pagination-BM9WMdjP.js";import{t as ie}from"./info-jO8_tFCf.js";import{t as ae}from"./music-2-B2NVYpjb.js";import{t as oe}from"./plus-CXRduJme.js";import{t as L}from"./trash-2-DSacCdhQ.js";import{t as R}from"./triangle-alert-CZT0mF2a.js";import{t as se}from"./upload-D3MEiFFV.js";import{t as ce}from"./user-CphygOn_.js";import{t as le}from"./video-BEAXv7aW.js";import{t as z}from"./wand-sparkles-ZWpynNLr.js";import{Cr as ue,Dr as de,Or as fe,Sr as B,wr as V,xr as pe}from"./constants-B8L8Pvf9.js";import{$t as me,Bi as he,Ci as ge,Gt as _e,Mi as H,O as U,Qt as ve,Xn as W,Xt as ye,Yt as be,Zt as xe,gi as Se,ii as Ce,kr as we,tn as Te,un as Ee,vi as De}from"./index-La_21d58.js";import{t as Oe}from"./CopyToClipboard-BwVdHYYm.js";import{t as ke}from"./ReportButton-D7wL8z6N.js";import{t as G}from"./ImagePreview-Dkx4nOhz.js";import{n as Ae}from"./taskDrawerMixin-DyAUhFEq.js";import{t as K}from"./Consumption-DZVrxh1r.js";import{n as q,t as J}from"./VideoPreview-zwRKh4wS.js";import{t as je}from"./VideoPlayer-DNi7m8bA.js";import{t as Me}from"./ApiCodeButton-DCLoOHa7.js";import{t as Ne}from"./BotPlaceholder-_QxGzCkh.js";var Pe=v({name:`LayoutDigitalHuman`,components:{UserIcon:ce,ElDrawer:A,ElButton:H},mixins:[Ae]}),Fe={class:`main flex flex-row flex-1`},Ie={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)]`},Le={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Re(t,n,r,i,o,c){let l=u(`user-icon`),p=u(`el-button`),h=u(`el-drawer`);return g(),s(`div`,Fe,[e(`div`,Ie,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Le,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ze=U(Pe,[[`render`,Re],[`__scopeId`,`data-v-e912fd04`]]),Be=v({name:`DigitalHumanMediaInput`,components:{AudioPreview:q,CloseIcon:Se,ElButton:H,ElProgress:M,ElUpload:x,ImagePreview:G,MusicIcon:ae,UploadIcon:se,VideoIcon:le,VideoPreview:J},mixins:[me,ve,ye,_e],props:{kind:{type:String,required:!0},accept:{type:String,default:``},buttonText:{type:String,default:``},hint:{type:String,default:``}},emits:[`change`],data(){return{fileList:[],uploadUrl:Ce()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},hasFile(){return this.fileList.length>0}},methods:{uploadedUrl(e){return e?.response?.file_url},isPending(e){return e.status===`ready`||e.status===`uploading`},onExceed(e){let t=this.$refs.uploader;t?.clearFiles();let n=e[0];n&&(t?.handleStart?.(n),t?.submit?.())},onError(){T.error(this.$t(`digitalhuman.message.uploadError`))},onRemoveFile(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onChange()},onChange(){let e=this.fileList?.[0];this.$emit(`change`,e?this.uploadedUrl(e):void 0)}}}),Ve={class:`thumb`},He={key:2,class:`placeholder`},Ue=[`title`],We=[`aria-label`,`title`,`onClick`],Ge={key:0,class:`hint`};function Ke(c,d,f,h,_,v){let y=u(`image-preview`),b=u(`video-preview`),x=u(`audio-preview`),S=u(`el-progress`),C=u(`video-icon`),w=u(`music-icon`),T=u(`close-icon`),E=u(`upload-icon`),D=u(`el-button`),O=u(`el-upload`);return g(),p(O,{ref:`uploader`,"file-list":c.fileList,"onUpdate:fileList":d[0]||=e=>c.fileList=e,accept:c.accept,name:`file`,class:`media-input`,limit:1,multiple:!1,"before-upload":c.beforeUploadSizeGuard,action:c.uploadUrl,headers:c.headers,"on-exceed":c.onExceed,"on-error":c.onError,"on-success":c.onChange,"on-remove":c.onChange},{file:m(({file:r})=>[e(`div`,{class:n([`slot`,{pending:c.isPending(r)}])},[c.kind===`image`&&r.url?(g(),p(y,{key:0,url:r.url,name:r.name,percentage:r.percentage,onRemove:e=>c.onRemoveFile(r)},null,8,[`url`,`name`,`percentage`,`onRemove`])):(g(),s(l,{key:1},[e(`div`,Ve,[c.kind===`video`&&c.uploadedUrl(r)?(g(),p(b,{key:0,url:c.uploadedUrl(r)},null,8,[`url`])):c.kind===`audio`&&c.uploadedUrl(r)?(g(),p(x,{key:1,url:c.uploadedUrl(r)},null,8,[`url`])):(g(),s(`div`,He,[c.isPending(r)?(g(),p(S,{key:0,type:`circle`,"stroke-width":4,percentage:Math.round(r.percentage||0),width:34},null,8,[`percentage`])):c.kind===`video`?(g(),p(C,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),p(w,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]))]),e(`span`,{class:`filename`,title:r.name},i(r.name),9,Ue),e(`button`,{type:`button`,class:`remove`,"aria-label":c.$t(`common.button.close`),title:c.$t(`common.button.close`),onClick:t(e=>c.onRemoveFile(r),[`stop`])},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,We)],64))],2)]),default:m(()=>[a(D,{round:``,type:`primary`,size:`small`,class:`btn`},{default:m(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.hasFile?c.$t(`digitalhuman.button.replace`):c.buttonText),1)]),_:1}),c.hint?(g(),s(`p`,Ge,i(c.hint),1)):o(``,!0)]),_:1},8,[`file-list`,`accept`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])}var Y=U(Be,[[`render`,Ke],[`__scopeId`,`data-v-db0590a9`]]),qe=20,X=e=>{let t=e;return!!t&&typeof t.voice_id==`string`&&!!t.voice_id&&typeof t.name==`string`},Z=()=>{try{let e=JSON.parse(localStorage.getItem(`digitalhuman.voices`)||`[]`);return Array.isArray(e)?e.filter(X).map(e=>({voice_id:e.voice_id,name:e.name,lang:typeof e.lang==`string`?e.lang:`zh`,created_at:typeof e.created_at==`number`?e.created_at:0})):[]}catch{return[]}},Q=e=>{try{localStorage.setItem(fe,JSON.stringify(e))}catch{}return e},Je=e=>X(e)?Q([e,...Z().filter(t=>t.voice_id!==e.voice_id)].slice(0,qe)):Z(),Ye=e=>Q(Z().filter(t=>t.voice_id!==e)),Xe=e=>`${e} ${Z().length+1}`,Ze=3e3,Qe=60,$e=v({name:`DigitalHumanVoiceCloneDialog`,components:{Consumption:K,ElAlert:C,ElButton:H,ElDialog:ge,ElInput:he,ElRadioButton:E,ElRadioGroup:D,MediaInput:Y},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`,`cloned`],data(){return{sampleUrl:void 0,name:``,lang:`zh`,cloning:!1,destroyed:!1,runId:0,DIGITALHUMAN_AUDIO_ACCEPT:B,DIGITALHUMAN_VOICE_CLONE_CONSUMPTION:2}},computed:{service(){return this.$store.state.digitalhuman?.service},credentialToken(){return this.$store.state.digitalhuman?.credential?.token},langOptions(){return pe.map(e=>({value:e,label:this.$t(`digitalhuman.name.lang_${e}`)}))}},watch:{visible(e){e?(this.sampleUrl=void 0,this.name=Xe(this.$t(`digitalhuman.name.myVoice`)),this.lang=`zh`):(this.runId++,this.cloning=!1)}},beforeUnmount(){this.destroyed=!0,this.runId++},methods:{onVisible(e){this.cloning&&!e||this.$emit(`update:visible`,e)},onSampleChange(e){this.sampleUrl=e},isStale(e){return this.destroyed||e!==this.runId},sleep(e){return new Promise(t=>setTimeout(t,e))},async onClone(){let e=this.credentialToken;if(!this.sampleUrl||!e)return;let t=++this.runId;this.cloning=!0;try{let{data:n}=await W.cloneVoice({audio_url:this.sampleUrl,lang:this.lang,name:this.name||void 0},{token:e});if(this.isStale(t))return;if(n?.voice_id){this.onCloned(n.voice_id);return}if(n?.task_id)await this.pollVoice(n.task_id,e,t);else throw Error(`no task`)}catch{this.isStale(t)||T.error(this.$t(`digitalhuman.message.voiceCloneFailed`))}finally{this.isStale(t)||(this.cloning=!1)}},async pollVoice(e,t,n){for(let r=0;r<Qe;r++){if(this.isStale(n)||(await this.sleep(Ze),this.isStale(n)))return;let{data:r}=await W.pollTask(e,{token:t});if(this.isStale(n))return;if(r?.voice_id){this.onCloned(r.voice_id);return}if(r?.state===`failed`)throw Error(`clone failed`)}throw Error(`timeout`)},onCloned(e){Je({voice_id:e,name:this.name||this.$t(`digitalhuman.name.myVoice`),lang:this.lang,created_at:Date.now()/1e3}),T.success(this.$t(`digitalhuman.message.voiceCloneSuccess`)),this.cloning=!1,this.$emit(`cloned`,e),this.$emit(`update:visible`,!1)}}}),et={class:`text-xs text-[var(--el-text-color-secondary)] mb-3`},tt={class:`field mb-3`},nt={class:`label`},rt={class:`field`},it={class:`label`},at={class:`text-xs mb-0`},ot={key:1,class:`mt-4 text-xs text-[var(--el-text-color-secondary)]`},st={class:`footer`};function ct(t,n,o,c,d,f){let _=u(`media-input`),v=u(`el-input`),y=u(`el-radio-button`),b=u(`el-radio-group`),x=u(`el-alert`),S=u(`consumption`),C=u(`el-button`),w=u(`el-dialog`);return g(),p(w,{"model-value":t.visible,title:t.$t(`digitalhuman.name.cloneVoice`),width:`440`,"align-center":``,"append-to-body":``,"close-on-click-modal":!t.cloning,"close-on-press-escape":!t.cloning,"onUpdate:modelValue":t.onVisible},{footer:m(()=>[e(`div`,st,[a(S,{value:t.DIGITALHUMAN_VOICE_CLONE_CONSUMPTION,service:t.service,class:`cost`},null,8,[`value`,`service`]),e(`div`,null,[a(C,{disabled:t.cloning,onClick:n[2]||=e=>t.onVisible(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`]),a(C,{type:`primary`,loading:t.cloning,disabled:!t.sampleUrl||t.cloning,onClick:t.onClone},{default:m(()=>[r(i(t.$t(`digitalhuman.button.startClone`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])]),default:m(()=>[e(`p`,et,i(t.$t(`digitalhuman.message.voiceCloneHint`)),1),a(_,{kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSample`),hint:t.$t(`digitalhuman.message.audioHint`),class:`mb-4`,onChange:t.onSampleChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]),e(`div`,tt,[e(`span`,nt,i(t.$t(`digitalhuman.name.voiceName`)),1),a(v,{modelValue:t.name,"onUpdate:modelValue":n[0]||=e=>t.name=e,class:`control`,placeholder:t.$t(`digitalhuman.placeholder.voiceName`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,rt,[e(`span`,it,i(t.$t(`digitalhuman.name.voiceLang`)),1),a(b,{modelValue:t.lang,"onUpdate:modelValue":n[1]||=e=>t.lang=e,class:`control`},{default:m(()=>[(g(!0),s(l,null,h(t.langOptions,e=>(g(),p(y,{key:e.value,value:e.value},{default:m(()=>[r(i(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])]),t.cloning?(g(),p(x,{key:0,closable:!1,type:`info`,class:`mt-4`},{default:m(()=>[e(`p`,at,i(t.$t(`digitalhuman.message.voiceCloneRunning`)),1)]),_:1})):(g(),s(`p`,ot,i(t.$t(`digitalhuman.message.voiceStoredLocally`)),1))]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`onUpdate:modelValue`])}var lt=v({name:`DigitalHumanTimbreSelector`,components:{AddIcon:oe,DeleteIcon:L,ElButton:H,ElOption:b,ElSelect:y,VoiceCloneDialog:U($e,[[`render`,ct],[`__scopeId`,`data-v-ba35b653`]])},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{voices:Z(),dialogVisible:!1}},mounted(){this.modelValue&&!this.voices.some(e=>e.voice_id===this.modelValue)&&this.$emit(`update:modelValue`,void 0)},methods:{labelFor(e){let t=this.$t(`digitalhuman.name.lang_${e.lang}`);return t.startsWith(`digitalhuman.`)?e.name:`${e.name} · ${t}`},onCloned(e){this.voices=Z(),this.$emit(`update:modelValue`,e)},onRemove(e){this.voices=Ye(e),this.modelValue===e&&this.$emit(`update:modelValue`,void 0)}}}),ut={class:`row`},dt={class:`label`},ft={class:`option`},pt={class:`option-name`},mt=[`aria-label`,`title`,`onClick`],ht={class:`empty`};function gt(n,o,d,f,_,v){let y=u(`delete-icon`),b=u(`el-option`),x=u(`el-select`),S=u(`add-icon`),C=u(`el-button`),w=u(`voice-clone-dialog`);return g(),s(`div`,null,[e(`div`,ut,[e(`span`,dt,i(n.$t(`digitalhuman.name.timbre`)),1),a(x,{"model-value":n.modelValue,class:`control`,placeholder:n.$t(`digitalhuman.placeholder.pickTimbre`),"onUpdate:modelValue":o[0]||=e=>n.$emit(`update:modelValue`,e)},c({default:m(()=>[(g(!0),s(l,null,h(n.voices,r=>(g(),p(b,{key:r.voice_id,label:n.labelFor(r),value:r.voice_id},{default:m(()=>[e(`span`,ft,[e(`span`,pt,i(n.labelFor(r)),1),e(`button`,{type:`button`,class:`option-remove`,"aria-label":n.$t(`common.button.delete`),title:n.$t(`common.button.delete`),onClick:t(e=>n.onRemove(r.voice_id),[`stop`])},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,mt)])]),_:2},1032,[`label`,`value`]))),128))]),_:2},[n.voices.length===0?{name:`empty`,fn:m(()=>[e(`p`,ht,i(n.$t(`digitalhuman.message.noVoiceYet`)),1)]),key:`0`}:void 0]),1032,[`model-value`,`placeholder`])]),a(C,{size:`small`,text:``,type:`primary`,class:`clone`,onClick:o[1]||=e=>n.dialogVisible=!0},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.button.cloneNewVoice`)),1)]),_:1}),a(w,{visible:n.dialogVisible,"onUpdate:visible":o[2]||=e=>n.dialogVisible=e,onCloned:n.onCloned},null,8,[`visible`,`onCloned`])])}var _t=v({name:`ConfigPanel`,components:{Consumption:K,ElButton:H,ElCollapse:k,ElCollapseItem:O,ElInputNumber:j,ElRadioButton:E,ElRadioGroup:D,InfoIcon:te,MagicIcon:z,MediaInput:Y,PromptTextarea:P,TimbreSelector:U(lt,[[`render`,gt],[`__scopeId`,`data-v-e191cc56`]]),WarningIcon:R},emits:[`generate`],data(){return{faceMode:`video`,voiceMode:`text`,advancedOpen:[],DIGITALHUMAN_VIDEO_ACCEPT:de,DIGITALHUMAN_IMAGE_ACCEPT:V,DIGITALHUMAN_AUDIO_ACCEPT:B}},computed:{config(){return this.$store.state.digitalhuman?.config},service(){return this.$store.state.digitalhuman?.service},consumption(){return Te(this.config,this.service?.cost)},missing(){let e=[];return(this.faceMode===`video`?this.config?.video_url:this.config?.image_url)||e.push({key:`face`,message:this.$t(`digitalhuman.message.missingFace`)}),this.voiceMode===`text`?(this.config?.text?.trim()||e.push({key:`text`,message:this.$t(`digitalhuman.message.missingText`)}),this.config?.voice_id||e.push({key:`timbre`,message:this.$t(`digitalhuman.message.missingTimbre`)})):this.config?.audio_url||e.push({key:`audio`,message:this.$t(`digitalhuman.message.missingAudio`)}),e},text:{get(){return this.config?.text},set(e){this.update({text:e})}},voiceId:{get(){return this.config?.voice_id},set(e){this.update({voice_id:e})}},speed:{get(){return this.config?.speed??1},set(e){this.update({speed:e})}}},mounted(){this.config?.image_url&&!this.config?.video_url&&(this.faceMode=`photo`),this.config?.audio_url&&(this.voiceMode=`audio`)},methods:{isMissing(e){return this.missing.some(t=>t.key===e)},update(e){this.$store.commit(`digitalhuman/setConfig`,{...this.config,...e})},onFaceModeChange(e){this.update(e===`video`?{image_url:void 0}:{video_url:void 0})},onVoiceModeChange(e){this.update(e===`audio`?{text:void 0,voice_id:void 0}:{audio_url:void 0})},onFaceVideoChange(e){this.update({video_url:e})},onFacePhotoChange(e){this.update({image_url:e})},onAudioChange(e){this.update({audio_url:e})},onGenerate(){let e=this.missing[0];if(e){T.warning(e.message);let t=e.key===`face`?`face`:`voice`;this.$refs[t]?.scrollIntoView?.({behavior:`smooth`,block:`center`});return}let t=this.config||{},n={video_url:this.faceMode===`video`?t.video_url:t.image_url};this.voiceMode===`audio`?n.audio_url=t.audio_url:(n.text=t.text,n.voice_id=t.voice_id),t.speed&&t.speed!==1&&(n.speed=t.speed),this.$emit(`generate`,n)}}}),vt={class:`flex flex-col h-full`},yt={class:`flex-1 overflow-y-auto p-5`},bt={ref:`face`,class:`field-block mb-6`},xt={class:`field-head`},St={class:`field-title font-bold`},Ct={key:0,class:`required-badge`},wt={ref:`voice`,class:`field-block mb-6`},Tt={class:`field-head`},Et={class:`field-title font-bold`},Dt={key:0,class:`required-badge`},Ot={class:`field-row`},kt={class:`field-head`},At={class:`field-title font-bold`},jt={class:`flex flex-col items-center justify-center px-5 pb-5`},Mt={key:0,class:`hint-missing`},Nt={class:`hint-eta`};function Pt(t,n,c,d,f,h){let _=u(`info-icon`),v=u(`el-radio-button`),y=u(`el-radio-group`),b=u(`media-input`),x=u(`prompt-textarea`),S=u(`timbre-selector`),C=u(`el-input-number`),w=u(`el-collapse-item`),T=u(`el-collapse`),E=u(`warning-icon`),D=u(`consumption`),O=u(`magic-icon`),k=u(`el-button`);return g(),s(`div`,vt,[e(`div`,yt,[e(`section`,bt,[e(`div`,xt,[e(`h2`,St,i(t.$t(`digitalhuman.name.step1`)),1),t.isMissing(`face`)?(g(),s(`span`,Ct,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step1`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.faceMode,"onUpdate:modelValue":n[0]||=e=>t.faceMode=e,class:`mode-switch mb-3`,onChange:t.onFaceModeChange},{default:m(()=>[a(v,{value:`video`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModeVideo`)),1)]),_:1}),a(v,{value:`photo`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModePhoto`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.faceMode===`video`?(g(),p(b,{key:0,kind:`video`,accept:t.DIGITALHUMAN_VIDEO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFaceVideo`),hint:t.$t(`digitalhuman.message.faceVideoHint`),onChange:t.onFaceVideoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`])):(g(),p(b,{key:1,kind:`image`,accept:t.DIGITALHUMAN_IMAGE_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFacePhoto`),hint:t.$t(`digitalhuman.message.facePhotoHint`),onChange:t.onFacePhotoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),e(`section`,wt,[e(`div`,Tt,[e(`h2`,Et,i(t.$t(`digitalhuman.name.step2`)),1),t.isMissing(`text`)||t.isMissing(`timbre`)||t.isMissing(`audio`)?(g(),s(`span`,Dt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step2`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.voiceMode,"onUpdate:modelValue":n[1]||=e=>t.voiceMode=e,class:`mode-switch mb-3`,onChange:t.onVoiceModeChange},{default:m(()=>[a(v,{value:`text`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeText`)),1)]),_:1}),a(v,{value:`audio`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeAudio`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.voiceMode===`text`?(g(),s(l,{key:0},[a(x,{modelValue:t.text,"onUpdate:modelValue":n[2]||=e=>t.text=e,class:`mb-3`,title:t.$t(`digitalhuman.name.speech`),placeholder:t.$t(`digitalhuman.placeholder.speech`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`placeholder`]),a(S,{modelValue:t.voiceId,"onUpdate:modelValue":n[3]||=e=>t.voiceId=e},null,8,[`modelValue`])],64)):(g(),p(b,{key:1,kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSpeechAudio`),hint:t.$t(`digitalhuman.message.audioHint`),onChange:t.onAudioChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),a(T,{modelValue:t.advancedOpen,"onUpdate:modelValue":n[5]||=e=>t.advancedOpen=e,class:`advanced`},{default:m(()=>[a(w,{name:`advanced`,title:t.$t(`digitalhuman.name.advanced`)},{default:m(()=>[e(`div`,Ot,[e(`div`,kt,[e(`h2`,At,i(t.$t(`digitalhuman.name.speed`)),1),a(_,{content:t.$t(`digitalhuman.description.speed`),class:`ml-1`},null,8,[`content`])]),a(C,{modelValue:t.speed,"onUpdate:modelValue":n[4]||=e=>t.speed=e,class:`field-control`,min:.5,max:2,step:.1,precision:1,"controls-position":`right`},null,8,[`modelValue`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])]),e(`div`,jt,[t.missing.length>0?(g(),s(`p`,Mt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.missing[0].message),1)])):o(``,!0),a(D,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(k,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(O,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`digitalhuman.button.generateVideo`)),1)]),_:1},8,[`onClick`]),e(`p`,Nt,i(t.$t(`digitalhuman.message.eta`)),1)])])}var Ft=U(_t,[[`render`,Pt],[`__scopeId`,`data-v-7c935d33`]]),It=[`.jpg`,`.jpeg`,`.png`,`.webp`,`.bmp`,`.gif`],Lt=v({name:`TaskPreview`,components:{ApiCodeButton:Me,AudioPreview:q,ChannelIcon:F,CopyToClipboard:Oe,DeleteIcon:L,ElAlert:C,ElButton:H,ElProgress:M,ElTooltip:S,FullscreenIcon:I,ImagePreview:G,InfoIcon:ie,MagicIcon:z,ReportButton:ke,TimeIcon:N,VideoPlayer:je,VideoPreview:J,WarningIcon:R},props:{modelValue:{type:Object,required:!0}},computed:{status(){return this.modelValue?.status||this.modelValue?.response?.state||`pending`},isSuccess(){return[`succeed`,`succeeded`].includes(this.status)||!!this.modelValue?.response?.video_url},isFailure(){return[`failed`,`dead`].includes(this.status)||this.modelValue?.response?.success===!1},isTerminal(){return this.isSuccess||this.isFailure},videoUrl(){return this.modelValue?.response?.video_url},progressPct(){let e=this.modelValue?.response?.progress;return typeof e==`number`?e:0},voiceLabel(){return this.modelValue?.request?.audio_url?this.$t(`digitalhuman.name.audioDriven`):this.$t(`digitalhuman.name.textDriven`)},faceUrl(){return this.modelValue?.request?.video_url||this.modelValue?.request?.image_url},isPhotoFace(){if(this.modelValue?.request?.image_url)return!0;let e=(this.faceUrl||``).split(`?`)[0].toLowerCase();return It.some(t=>e.endsWith(t))},audioUrl(){return this.modelValue?.request?.audio_url},outputSize(){let{width:e,height:t}=this.modelValue?.response||{};return e&&t?`${e}×${t}`:void 0},etaText(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(!e)return;let t=ue-(Date.now()/1e3-e);return t<=60?this.$t(`digitalhuman.message.etaAlmostDone`):this.$t(`digitalhuman.message.etaRemaining`,{minutes:Math.ceil(t/60)})},statusLabel(){let e=`digitalhuman.status.${this.status}`,t=this.$t(e);return t===e?this.$t(`digitalhuman.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await De.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(`digitalhuman/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)}}}),Rt={class:`preview`},zt={class:`left`},Bt={class:`main`},Vt={class:`bot`},Ht={class:`datetime`},Ut=[`aria-label`],Wt={class:`info`},Gt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Kt={class:`prompt mt-2`},qt={key:0},Jt={key:0,class:`content`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Qt={key:1,class:`content`},$t={class:`operations mt-2`},en={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},an={key:2,class:`content`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function un(n,c,l,d,f,h){let _=u(`capability-presentation`),v=u(`delete-icon`),y=u(`el-tooltip`),b=u(`image-preview`),x=u(`video-preview`),S=u(`audio-preview`),C=u(`time-icon`),w=u(`el-progress`),T=u(`magic-icon`),E=u(`copy-to-clipboard`),D=u(`el-alert`),O=u(`video-player`),k=u(`el-button`),A=u(`api-code-button`),j=u(`report-button`),M=u(`fullscreen-icon`),N=u(`channel-icon`),P=u(`warning-icon`),F=u(`info-icon`);return g(),s(`div`,Rt,[e(`div`,zt,[a(_,{capability:`digitalhuman`,part:`avatar`,class:`avatar`})]),e(`div`,Bt,[e(`div`,Vt,[a(_,{capability:`digitalhuman`,part:`name`}),e(`span`,Ht,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Ut)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Wt,[n.faceUrl||n.audioUrl?(g(),s(`div`,Gt,[n.faceUrl&&n.isPhotoFace?(g(),p(b,{key:0,url:n.faceUrl,name:`face`,closable:!1},null,8,[`url`])):n.faceUrl?(g(),p(x,{key:1,url:n.faceUrl,name:`face`},null,8,[`url`])):o(``,!0),n.audioUrl?(g(),p(S,{key:2,url:n.audioUrl,name:`audio`},null,8,[`url`])):o(``,!0)])):o(``,!0),e(`p`,Kt,[r(i(n.modelValue?.request?.text||n.voiceLabel)+` `,1),n.isTerminal?o(``,!0):(g(),s(`span`,qt,` - (`+i(n.statusLabel)+`) `,1))])]),n.isTerminal?o(``,!0):(g(),s(`div`,Jt,[a(D,{closable:!1,class:`info-state`},{default:m(()=>[e(`p`,Yt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.statusLabel),1)]),a(w,{percentage:n.progressPct,"stroke-width":6,class:`mb-2`},null,8,[`percentage`]),n.etaText?(g(),s(`p`,Xt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.etaLabel`))+`: `+i(n.etaText),1)])):o(``,!0),e(`p`,Zt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])),n.isSuccess?(g(),s(`div`,Qt,[n.videoUrl?(g(),p(O,{key:0,src:n.videoUrl},null,8,[`src`])):o(``,!0),e(`div`,$t,[n.videoUrl?(g(),p(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=e=>n.onDownload(e,n.videoUrl)},{default:m(()=>[r(i(n.$t(`digitalhuman.button.download`)),1)]),_:1})):o(``,!0),a(A,{path:`/digital-human/videos`,body:n.modelValue?.request},null,8,[`body`]),a(j,{service:`digitalhuman`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.response?.duration?(g(),s(`p`,en,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.duration`))+`: `+i(n.modelValue?.response?.duration?.toFixed(1))+`s `,1)])):o(``,!0),n.outputSize?(g(),s(`p`,$,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.outputSize`))+`: `+i(n.outputSize),1)])):o(``,!0),e(`p`,tn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,nn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,an,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failure`)),1)]),default:m(()=>[e(`p`,on,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(g(),s(`p`,sn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(E,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,cn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var dn=v({name:`RecentPanel`,components:{TaskPreview:U(Lt,[[`render`,un],[`__scopeId`,`data-v-342f1d6d`]]),NoTasks:ne,BotPlaceholder:Ne,ScrollList:ee},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.digitalhuman?.tasks,items:this.$store.state.digitalhuman?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),fn={key:0},pn={key:2,class:`w-full h-full flex items-center justify-center`};function mn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),_=u(`scroll-list`),v=u(`no-tasks`);return g(),s(l,null,[e.tasks?.items===void 0?(g(),s(`div`,fn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),p(_,{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:m(()=>[(g(!0),s(l,null,h(e.tasks?.items,(e,t)=>(g(),p(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,pn,[a(v)])):o(``,!0)],64)}var hn=v({name:`DigitalHumanIndex`,components:{ConfigPanel:Ft,Layout:ze,RecentPanel:U(dn,[[`render`,mn]])},mixins:[xe],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.digitalhuman?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.digitalhuman?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.digitalhuman.credential},config(){return this.$store.state.digitalhuman.config},tasks(){return this.$store.state.digitalhuman.tasks}},watch:{initialized:{async handler(e){window.clearInterval(this.job),e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await re({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(){await this.$store.dispatch(`digitalhuman/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`digitalhuman/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(e){if(!be(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!Ee())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}T.info(this.$t(`digitalhuman.message.startingTask`)),we(`digitalhuman`,W.generate(e,{token:t})).then(()=>{T.success(this.$t(`digitalhuman.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?T.error(this.$t(`digitalhuman.message.usedUp`)):T.error(this.$t(`digitalhuman.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function gn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return g(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var _n=U(hn,[[`render`,gn]]);export{_n 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-COte09RK.js";import{t as h}from"./check-CgSk-DpB.js";import{t as g}from"./external-link-Bc7gcMYe.js";import{t as ee}from"./globe-ySJCwB79.js";import{t as te}from"./wand-sparkles-Bw147iU-.js";import{M as _,Mi as v,O as y,i as b,mn as x,r as S}from"./index-_02dQfqQ.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{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:w,desktop:E.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:w,desktop:E.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:w,desktop:E.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:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.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:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},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`||x()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[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(_())},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}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[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)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{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(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,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`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,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`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{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(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,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`,me,[(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`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),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`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{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,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,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`,Oe,[(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,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,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`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe 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-DXS23sL5.js";import{t as h}from"./check-YpVnY9c1.js";import{t as g}from"./external-link-rYo7EM25.js";import{t as ee}from"./globe-DWRnXAvB.js";import{t as te}from"./wand-sparkles-ZWpynNLr.js";import{M as _,Mi as v,O as y,i as b,mn as x,r as S}from"./index-La_21d58.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{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:w,desktop:E.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:w,desktop:E.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:w,desktop:E.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:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.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:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},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`||x()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[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(_())},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}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[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)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{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(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,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`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,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`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{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(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,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`,me,[(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`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),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`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{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,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,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`,Oe,[(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,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,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`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-I5AzQP7J.js";import{t as b}from"./upload-Ch10sTtH.js";import{t as x}from"./tooltip-DENV9LWI.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-BgHU_JUY.js";import{t as T}from"./drawer-D5bShL7I.js";import{t as E}from"./input-number-Ck5oXTrR.js";import{t as D}from"./slider-1PMcyGQO.js";import{t as O}from"./clock-ghPvxZ_l.js";import{a as k,c as A,n as j,o as M,r as N,t as P}from"./pagination-Cysw-UNr.js";import{t as F}from"./info-CRFT4_9x.js";import{t as ee}from"./trash-2-CmzKrdh7.js";import{t as te}from"./triangle-alert-Dioz1yf5.js";import{t as I}from"./upload-BCbELvzx.js";import{t as L}from"./wand-sparkles-Bw147iU-.js";import{dr as R,fr as z,ur as B}from"./constants-B8L8Pvf9.js";import{$t as V,Gt as H,Jn as U,Mi as W,O as G,Qt as K,Xt as q,Yt as J,Zt as Y,ii as X,kr as Z,tn as Q,un as ne,vi as re}from"./index-_02dQfqQ.js";import{t as ie}from"./CopyToClipboard-ARV7wWpq.js";import{t as ae}from"./ReportButton-Bhl9yVD2.js";import{t as oe}from"./ImagePreview-HMkCzfq6.js";import{n as se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ce}from"./Consumption-XSMnRD9l.js";import{t as le}from"./ApiCodeButton-B9c7TGii.js";import{t as ue}from"./BotPlaceholder-B213F4Dv.js";import{t as de}from"./ImageWrapper-LGdiJD4o.js";var fe=_({name:`LayoutFlux`,components:{MagicIcon:L,ElDrawer:T,ElButton:W},mixins:[se]}),pe={class:`main flex flex-row flex-1`},me={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)]`},he={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ge(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`,me,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,he,[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 _e=G(fe,[[`render`,ge],[`__scopeId`,`data-v-72e82d52`]]),ve=_({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||=z}}),ye={class:`field`},be={class:`title font-bold`};function xe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,ye,[e(`h2`,be,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 Se=G(ve,[[`render`,xe],[`__scopeId`,`data-v-e9b17945`]]),Ce=_({name:`CountSelector`,components:{ElSlider:D,InfoIcon:M,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}}),we={class:`flex justify-between`},Te={class:`flex justify-start items-center`},Ee={class:`text-sm font-bold`},De={class:`flex justify-end items-center`},Oe={class:`w-full`};function ke(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`,we,[e(`div`,Te,[e(`span`,Ee,i(t.$t(`flux.name.numbers`)),1),a(d,{content:t.$t(`flux.description.numbers`)},null,8,[`content`])]),e(`div`,De,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Oe,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:1,max:4,step:1},null,8,[`modelValue`])])])}var Ae=G(Ce,[[`render`,ke]]),je=_({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||=R}}),Me={class:`field`},Ne={class:`title font-bold`};function Pe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Me,[e(`h2`,Ne,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 Fe=G(je,[[`render`,Pe],[`__scopeId`,`data-v-81fd05e5`]]),Ie=_({name:`ImageUrlInput`,components:{UploadIcon:I,ElUpload:b,ElButton:W,InfoIcon:M,ImagePreview:oe},mixins:[V,K,q,H],emits:[`change`],data(){return{fileList:[],uploadUrl:X()+`/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`))}}}),Le={class:`relative`},Re={class:`flex justify-between`},ze={class:`flex justify-start items-center`},Be={class:`text-sm font-bold`};function Ve(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`,Le,[e(`div`,Re,[e(`div`,ze,[e(`span`,Be,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 He=G(Ie,[[`render`,Ve],[`__scopeId`,`data-v-9830e0c3`]]),Ue=_({name:`PromptInput`,components:{PromptTextarea:k},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 We(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 Ge=G(Ue,[[`render`,We]]),Ke=_({name:`SizeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:B}},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`}}),qe={class:`field`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,qe,[e(`h2`,Je,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 Xe=_({name:`PresetPanel`,components:{MagicIcon:L,ElButton:W,PromptInput:Ge,ModelSelector:Se,CountSelector:Ae,Consumption:ce,ActionSelector:Fe,ImageUrlInput:He,SizeSelector:G(Ke,[[`render`,Ye],[`__scopeId`,`data-v-8c58dc91`]])},emits:[`generate`],computed:{config(){return this.$store.state.flux?.config},consumption(){return Q(this.config,this.service?.cost)},service(){return this.$store.state.flux?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ze={class:`flex flex-col h-full`},Qe={class:`flex-1 overflow-y-auto p-5`},$e={class:`flex flex-col items-center justify-center px-5 pb-5`};function et(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(`consumption`),C=l(`magic-icon`),w=l(`el-button`);return h(),s(`div`,Ze,[e(`div`,Qe,[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`,$e,[a(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.generate`)),1)]),_:1},8,[`onClick`])])])}var tt=G(Xe,[[`render`,et]]),nt=_({name:`TaskPreview`,components:{DeleteIcon:ee,ElTooltip:x,ChannelIcon:A,InfoIcon:F,MagicIcon:L,TimeIcon:O,WarningIcon:te,CopyToClipboard:ie,ElAlert:S,ImageWrapper:de,ApiCodeButton:le,ReportButton:ae},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 re.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`)}}}),rt={class:`preview`},it={class:`left`},at={class:`main`},ot={class:`bot`},st={class:`datetime`},ct=[`aria-label`],lt={class:`info`},ut={key:0,class:`prompt mt-2`},dt={key:0},ft={key:0,class:n({content:!0,failed:!0})},pt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},mt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},vt={key:1,class:n({content:!0})},yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},St={key:2,class:n({content:!0})},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function wt(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`,rt,[e(`div`,it,[a(y,{capability:`flux`,part:`avatar`,class:`avatar`})]),e(`div`,at,[e(`div`,ot,[a(y,{capability:`flux`,part:`name`}),e(`span`,st,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,ct)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,lt,[n.modelValue?.request?.prompt?(h(),s(`p`,ut,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,dt,` - (`+i(n.$t(`flux.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,ft,[e(`div`,pt,[(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`,mt,[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`,ht,[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`,gt,[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`,_t,[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`,vt,[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`,yt,[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`,$,[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`,bt,[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`,xt,[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`,St,[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`,Ct,[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 Tt=_({name:`RecentPanel`,components:{TaskPreview:G(nt,[[`render`,wt],[`__scopeId`,`data-v-cbf7ee77`]]),BotPlaceholder:ue,NoTasks:N,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?.()}}}),Et={key:0},Dt={key:2,class:`w-full h-full flex items-center justify-center`};function Ot(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`,Et,[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`,Dt,[a(v)])):o(``,!0)],64)}var kt=_({name:`FluxIndex`,components:{ConfigPanel:tt,Layout:_e,RecentPanel:G(Tt,[[`render`,Ot]])},mixins:[Y],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},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}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await P({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})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!J(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let e={...this.config,async:!0};if(!ne())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}w.info(this.$t(`flux.message.startingTask`)),Z(`flux`,U.generate(e,{token:t})).then(()=>{w.success(this.$t(`flux.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?w.error(this.$t(`flux.message.usedUp`)):w.error(this.$t(`flux.message.startTaskFailed`)+t?.error?.message)}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function At(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 jt=G(kt,[[`render`,At]]);export{jt 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--hLaPd-X.js";import{t as b}from"./upload-Ch10sTtH.js";import{t as x}from"./tooltip-BWmio9dL.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-BgHU_JUY.js";import{t as T}from"./drawer-CrLrAuYO.js";import{t as E}from"./input-number-CUrnNTMQ.js";import{t as D}from"./slider-EWdGsOow.js";import{t as O}from"./clock-B3fFaHCL.js";import{a as k,c as A,n as j,o as M,r as N,t as P}from"./pagination-BM9WMdjP.js";import{t as F}from"./info-jO8_tFCf.js";import{t as ee}from"./trash-2-DSacCdhQ.js";import{t as te}from"./triangle-alert-CZT0mF2a.js";import{t as I}from"./upload-D3MEiFFV.js";import{t as L}from"./wand-sparkles-ZWpynNLr.js";import{dr as R,fr as z,ur as B}from"./constants-B8L8Pvf9.js";import{$t as V,Gt as H,Jn as U,Mi as W,O as G,Qt as K,Xt as q,Yt as J,Zt as Y,ii as X,kr as Z,tn as Q,un as ne,vi as re}from"./index-La_21d58.js";import{t as ie}from"./CopyToClipboard-BwVdHYYm.js";import{t as ae}from"./ReportButton-D7wL8z6N.js";import{t as oe}from"./ImagePreview-Dkx4nOhz.js";import{n as se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ce}from"./Consumption-DZVrxh1r.js";import{t as le}from"./ApiCodeButton-DCLoOHa7.js";import{t as ue}from"./BotPlaceholder-_QxGzCkh.js";import{t as de}from"./ImageWrapper-DzKNoUuD.js";var fe=_({name:`LayoutFlux`,components:{MagicIcon:L,ElDrawer:T,ElButton:W},mixins:[se]}),pe={class:`main flex flex-row flex-1`},me={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)]`},he={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ge(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`,me,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,he,[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 _e=G(fe,[[`render`,ge],[`__scopeId`,`data-v-72e82d52`]]),ve=_({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||=z}}),ye={class:`field`},be={class:`title font-bold`};function xe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,ye,[e(`h2`,be,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 Se=G(ve,[[`render`,xe],[`__scopeId`,`data-v-e9b17945`]]),Ce=_({name:`CountSelector`,components:{ElSlider:D,InfoIcon:M,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}}),we={class:`flex justify-between`},Te={class:`flex justify-start items-center`},Ee={class:`text-sm font-bold`},De={class:`flex justify-end items-center`},Oe={class:`w-full`};function ke(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`,we,[e(`div`,Te,[e(`span`,Ee,i(t.$t(`flux.name.numbers`)),1),a(d,{content:t.$t(`flux.description.numbers`)},null,8,[`content`])]),e(`div`,De,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Oe,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:1,max:4,step:1},null,8,[`modelValue`])])])}var Ae=G(Ce,[[`render`,ke]]),je=_({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||=R}}),Me={class:`field`},Ne={class:`title font-bold`};function Pe(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,Me,[e(`h2`,Ne,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 Fe=G(je,[[`render`,Pe],[`__scopeId`,`data-v-81fd05e5`]]),Ie=_({name:`ImageUrlInput`,components:{UploadIcon:I,ElUpload:b,ElButton:W,InfoIcon:M,ImagePreview:oe},mixins:[V,K,q,H],emits:[`change`],data(){return{fileList:[],uploadUrl:X()+`/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`))}}}),Le={class:`relative`},Re={class:`flex justify-between`},ze={class:`flex justify-start items-center`},Be={class:`text-sm font-bold`};function Ve(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`,Le,[e(`div`,Re,[e(`div`,ze,[e(`span`,Be,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 He=G(Ie,[[`render`,Ve],[`__scopeId`,`data-v-9830e0c3`]]),Ue=_({name:`PromptInput`,components:{PromptTextarea:k},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 We(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 Ge=G(Ue,[[`render`,We]]),Ke=_({name:`SizeSelector`,components:{ElSelect:v,ElOption:y},data(){return{options:B}},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`}}),qe={class:`field`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let g=l(`el-option`),_=l(`el-select`);return h(),s(`div`,qe,[e(`h2`,Je,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 Xe=_({name:`PresetPanel`,components:{MagicIcon:L,ElButton:W,PromptInput:Ge,ModelSelector:Se,CountSelector:Ae,Consumption:ce,ActionSelector:Fe,ImageUrlInput:He,SizeSelector:G(Ke,[[`render`,Ye],[`__scopeId`,`data-v-8c58dc91`]])},emits:[`generate`],computed:{config(){return this.$store.state.flux?.config},consumption(){return Q(this.config,this.service?.cost)},service(){return this.$store.state.flux?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ze={class:`flex flex-col h-full`},Qe={class:`flex-1 overflow-y-auto p-5`},$e={class:`flex flex-col items-center justify-center px-5 pb-5`};function et(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(`consumption`),C=l(`magic-icon`),w=l(`el-button`);return h(),s(`div`,Ze,[e(`div`,Qe,[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`,$e,[a(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`flux.button.generate`)),1)]),_:1},8,[`onClick`])])])}var tt=G(Xe,[[`render`,et]]),nt=_({name:`TaskPreview`,components:{DeleteIcon:ee,ElTooltip:x,ChannelIcon:A,InfoIcon:F,MagicIcon:L,TimeIcon:O,WarningIcon:te,CopyToClipboard:ie,ElAlert:S,ImageWrapper:de,ApiCodeButton:le,ReportButton:ae},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 re.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`)}}}),rt={class:`preview`},it={class:`left`},at={class:`main`},ot={class:`bot`},st={class:`datetime`},ct=[`aria-label`],lt={class:`info`},ut={key:0,class:`prompt mt-2`},dt={key:0},ft={key:0,class:n({content:!0,failed:!0})},pt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},mt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},vt={key:1,class:n({content:!0})},yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},St={key:2,class:n({content:!0})},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function wt(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`,rt,[e(`div`,it,[a(y,{capability:`flux`,part:`avatar`,class:`avatar`})]),e(`div`,at,[e(`div`,ot,[a(y,{capability:`flux`,part:`name`}),e(`span`,st,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,ct)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,lt,[n.modelValue?.request?.prompt?(h(),s(`p`,ut,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,dt,` - (`+i(n.$t(`flux.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,ft,[e(`div`,pt,[(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`,mt,[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`,ht,[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`,gt,[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`,_t,[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`,vt,[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`,yt,[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`,$,[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`,bt,[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`,xt,[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`,St,[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`,Ct,[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 Tt=_({name:`RecentPanel`,components:{TaskPreview:G(nt,[[`render`,wt],[`__scopeId`,`data-v-cbf7ee77`]]),BotPlaceholder:ue,NoTasks:N,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?.()}}}),Et={key:0},Dt={key:2,class:`w-full h-full flex items-center justify-center`};function Ot(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`,Et,[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`,Dt,[a(v)])):o(``,!0)],64)}var kt=_({name:`FluxIndex`,components:{ConfigPanel:tt,Layout:_e,RecentPanel:G(Tt,[[`render`,Ot]])},mixins:[Y],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},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}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await P({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})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!J(this.uploadTracker,e=>this.$t(e),e=>w.warning(e)))return;let e={...this.config,async:!0};if(!ne())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}w.info(this.$t(`flux.message.startingTask`)),Z(`flux`,U.generate(e,{token:t})).then(()=>{w.success(this.$t(`flux.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?w.error(this.$t(`flux.message.usedUp`)):w.error(this.$t(`flux.message.startTaskFailed`)+t?.error?.message)}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function At(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 jt=G(kt,[[`render`,At]]);export{jt 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,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-Ch10sTtH.js";import{t as b}from"./tooltip-DENV9LWI.js";import{t as x}from"./alert-BprQRUmf.js";import{h as S,v as C}from"./models-BgHU_JUY.js";import{t as w}from"./drawer-D5bShL7I.js";import{t as T}from"./box-C-PL8rWG.js";import{t as E}from"./clock-ghPvxZ_l.js";import{a as D,c as O,n as k,o as A,r as j,s as M,t as N}from"./pagination-Cysw-UNr.js";import{t as P}from"./info-CRFT4_9x.js";import{t as F}from"./trash-2-CmzKrdh7.js";import{t as I}from"./triangle-alert-Dioz1yf5.js";import{t as L}from"./upload-BCbELvzx.js";import{t as R}from"./wand-sparkles-Bw147iU-.js";import{At as ee,Et as te,Ot as ne,Tt as re,jt as z,kt as B}from"./constants-B8L8Pvf9.js";import{$t as V,Gt as H,Jt as U,Kt as W,Mi as G,Nn as K,O as q,Qt as J,Xt as Y,Yt as X,Zt as ie,ii as Z,kr as ae,qt as oe,tn as se,un as ce,vi as le}from"./index-_02dQfqQ.js";import{t as ue}from"./CopyToClipboard-ARV7wWpq.js";import{t as de}from"./ReportButton-Bhl9yVD2.js";import{t as fe}from"./FilePreview-C5OXfeqk.js";import{t as Q}from"./ImagePreview-HMkCzfq6.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-XSMnRD9l.js";import{t as he}from"./VideoPlayer-CDIy68jx.js";import{t as ge}from"./ApiCodeButton-B9c7TGii.js";import{t as _e}from"./BotPlaceholder-B213F4Dv.js";var ve=v({name:`LayoutOmni`,components:{MagicIcon:R,ElDrawer:w,ElButton:G},mixins:[pe]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=q(ve,[[`render`,Se],[`__scopeId`,`data-v-b76ffabf`]]),we=v({name:`OmniPromptInput`,components:{PromptTextarea:D},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=q(we,[[`render`,Te]]),De=v({name:`OmniResolutionSelector`,components:{InfoIcon:A},data(){return{options:[{value:z,label:`720p`},{value:ee,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=te}}),Oe={class:`resolution`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`];function Ne(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,je,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Me))),128))])])}var Pe=q(De,[[`render`,Ne],[`__scopeId`,`data-v-1f9abe29`]]),Fe=v({name:`OmniRatioSelector`,components:{InfoIcon:A},computed:{options(){return[{value:ne,label:`16:9`,w:32,h:18},{value:B,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=re}}),Ie={class:`ratio`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`],Ve={class:`preview`},He={class:`name`};function Ue(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Ve,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,He,i(r.label),1)],10,Be))),128))])])}var We=q(Fe,[[`render`,Ue],[`__scopeId`,`data-v-1c0c1511`]]),Ge=4,Ke=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:G,InfoIcon:A,ImagePreview:Q,UploadIcon:L},mixins:[V,J,Y,H],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`,limit:Ge,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.omni?.config?.image_urls}},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.onSetReferenceImages()},onExceed(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},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.onSetReferenceImages()}}}),qe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Je={class:`flex min-w-0 items-center`},Ye={class:`title m-0 text-[14px] font-bold`},Xe={class:`file-list flex flex-wrap gap-[10px]`};function Ze(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.limit,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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Xe,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{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))])])}var Qe=q(Ke,[[`render`,Ze]]),$e=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:G,InfoIcon:A,FilePreview:fe,UploadIcon:L},mixins:[J,Y],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=U(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:oe(W)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),et={class:`field flex min-h-8 w-full items-center justify-between gap-3`},tt={class:`flex min-w-0 items-center`},nt={class:`title m-0 text-[14px] font-bold`},rt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function it(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,rt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var at=v({name:`OmniConfigPanel`,components:{ElButton:G,MagicIcon:R,PromptInput:Ee,ResolutionSelector:Pe,RatioSelector:We,ReferenceImagesInput:Qe,VideoInput:q($e,[[`render`,it],[`__scopeId`,`data-v-b87d1e4e`]]),Consumption:me},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ot={class:`flex flex-col h-full`},st={class:`flex-1 overflow-y-auto p-5`},ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function lt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,ot,[e(`div`,st,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ct,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ut=q(at,[[`render`,lt]]),dt=v({name:`OmniTaskPreview`,components:{DeleteIcon:F,ApplicationIcon:T,ChannelIcon:O,CopyToClipboard:ue,ExpandIcon:M,InfoIcon:P,MagicIcon:R,TimeIcon:E,WarningIcon:I,ElAlert:x,VideoPlayer:he,ElTooltip:b,ElButton:G,ImagePreview:Q,ApiCodeButton:ge,ReportButton:de},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_urls?.[0]},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await le.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(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),ft={class:`preview`},pt={class:`left`},mt={class:`main`},ht={class:`bot`},gt={class:`datetime`},_t=[`aria-label`],vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0})},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:n({content:!0})},Dt={key:0,class:`mb-4`},Ot={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:0},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={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`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:3,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,ft,[e(`div`,pt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,mt,[e(`div`,ht,[a(h,{capability:`omni`,part:`name`}),e(`span`,gt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,_t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,vt,[n.inputImage?(g(),s(`div`,yt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,St,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,xt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Et,[n.video?.video_url?(g(),s(`div`,Dt,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ot,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,At,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,jt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Pt,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ft,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Lt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Rt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,zt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Ct,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,wt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Tt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Vt=v({name:`OmniRecentPanel`,components:{TaskPreview:q(dt,[[`render`,Bt],[`__scopeId`,`data-v-08bc502f`]]),BotPlaceholder:_e,NoTasks:j,ScrollList:k},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=v({name:`OmniIndex`,components:{ConfigPanel:ut,Layout:Ce,RecentPanel:q(Vt,[[`render`,Wt]])},mixins:[ie],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`omni/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!X(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!ce())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}C.info(this.$t(`omni.message.startingTask`)),ae(`omni`,K.generate(t,{token:n})).then(()=>{C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?C.error(this.$t(`omni.message.usedUp`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),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 qt=q(Gt,[[`render`,Kt]]);export{qt as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-Ch10sTtH.js";import{t as b}from"./tooltip-BWmio9dL.js";import{t as x}from"./alert-BprQRUmf.js";import{h as S,v as C}from"./models-BgHU_JUY.js";import{t as w}from"./drawer-CrLrAuYO.js";import{t as T}from"./box-BvlGqOWM.js";import{t as E}from"./clock-B3fFaHCL.js";import{a as D,c as O,n as k,o as A,r as j,s as M,t as N}from"./pagination-BM9WMdjP.js";import{t as P}from"./info-jO8_tFCf.js";import{t as F}from"./trash-2-DSacCdhQ.js";import{t as I}from"./triangle-alert-CZT0mF2a.js";import{t as L}from"./upload-D3MEiFFV.js";import{t as R}from"./wand-sparkles-ZWpynNLr.js";import{At as ee,Et as te,Ot as ne,Tt as re,jt as z,kt as B}from"./constants-B8L8Pvf9.js";import{$t as V,Gt as H,Jt as U,Kt as W,Mi as G,Nn as K,O as q,Qt as J,Xt as Y,Yt as X,Zt as ie,ii as Z,kr as ae,qt as oe,tn as se,un as ce,vi as le}from"./index-La_21d58.js";import{t as ue}from"./CopyToClipboard-BwVdHYYm.js";import{t as de}from"./ReportButton-D7wL8z6N.js";import{t as fe}from"./FilePreview-j7Q9LeP4.js";import{t as Q}from"./ImagePreview-Dkx4nOhz.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-DZVrxh1r.js";import{t as he}from"./VideoPlayer-DNi7m8bA.js";import{t as ge}from"./ApiCodeButton-DCLoOHa7.js";import{t as _e}from"./BotPlaceholder-_QxGzCkh.js";var ve=v({name:`LayoutOmni`,components:{MagicIcon:R,ElDrawer:w,ElButton:G},mixins:[pe]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=q(ve,[[`render`,Se],[`__scopeId`,`data-v-b76ffabf`]]),we=v({name:`OmniPromptInput`,components:{PromptTextarea:D},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=q(we,[[`render`,Te]]),De=v({name:`OmniResolutionSelector`,components:{InfoIcon:A},data(){return{options:[{value:z,label:`720p`},{value:ee,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=te}}),Oe={class:`resolution`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`];function Ne(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,je,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Me))),128))])])}var Pe=q(De,[[`render`,Ne],[`__scopeId`,`data-v-1f9abe29`]]),Fe=v({name:`OmniRatioSelector`,components:{InfoIcon:A},computed:{options(){return[{value:ne,label:`16:9`,w:32,h:18},{value:B,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=re}}),Ie={class:`ratio`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`],Ve={class:`preview`},He={class:`name`};function Ue(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Ve,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,He,i(r.label),1)],10,Be))),128))])])}var We=q(Fe,[[`render`,Ue],[`__scopeId`,`data-v-1c0c1511`]]),Ge=4,Ke=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:G,InfoIcon:A,ImagePreview:Q,UploadIcon:L},mixins:[V,J,Y,H],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`,limit:Ge,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.omni?.config?.image_urls}},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.onSetReferenceImages()},onExceed(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},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.onSetReferenceImages()}}}),qe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Je={class:`flex min-w-0 items-center`},Ye={class:`title m-0 text-[14px] font-bold`},Xe={class:`file-list flex flex-wrap gap-[10px]`};function Ze(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.limit,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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Xe,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{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))])])}var Qe=q(Ke,[[`render`,Ze]]),$e=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:G,InfoIcon:A,FilePreview:fe,UploadIcon:L},mixins:[J,Y],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=U(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:oe(W)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),et={class:`field flex min-h-8 w-full items-center justify-between gap-3`},tt={class:`flex min-w-0 items-center`},nt={class:`title m-0 text-[14px] font-bold`},rt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function it(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,rt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var at=v({name:`OmniConfigPanel`,components:{ElButton:G,MagicIcon:R,PromptInput:Ee,ResolutionSelector:Pe,RatioSelector:We,ReferenceImagesInput:Qe,VideoInput:q($e,[[`render`,it],[`__scopeId`,`data-v-b87d1e4e`]]),Consumption:me},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ot={class:`flex flex-col h-full`},st={class:`flex-1 overflow-y-auto p-5`},ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function lt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,ot,[e(`div`,st,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ct,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ut=q(at,[[`render`,lt]]),dt=v({name:`OmniTaskPreview`,components:{DeleteIcon:F,ApplicationIcon:T,ChannelIcon:O,CopyToClipboard:ue,ExpandIcon:M,InfoIcon:P,MagicIcon:R,TimeIcon:E,WarningIcon:I,ElAlert:x,VideoPlayer:he,ElTooltip:b,ElButton:G,ImagePreview:Q,ApiCodeButton:ge,ReportButton:de},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_urls?.[0]},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await le.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(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),ft={class:`preview`},pt={class:`left`},mt={class:`main`},ht={class:`bot`},gt={class:`datetime`},_t=[`aria-label`],vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0})},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:n({content:!0})},Dt={key:0,class:`mb-4`},Ot={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:0},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={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`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:3,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,ft,[e(`div`,pt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,mt,[e(`div`,ht,[a(h,{capability:`omni`,part:`name`}),e(`span`,gt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,_t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,vt,[n.inputImage?(g(),s(`div`,yt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,St,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,xt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Et,[n.video?.video_url?(g(),s(`div`,Dt,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ot,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,At,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,jt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Pt,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ft,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Lt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Rt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,zt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Ct,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,wt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Tt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Vt=v({name:`OmniRecentPanel`,components:{TaskPreview:q(dt,[[`render`,Bt],[`__scopeId`,`data-v-08bc502f`]]),BotPlaceholder:_e,NoTasks:j,ScrollList:k},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=v({name:`OmniIndex`,components:{ConfigPanel:ut,Layout:Ce,RecentPanel:q(Vt,[[`render`,Wt]])},mixins:[ie],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`omni/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!X(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!ce())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}C.info(this.$t(`omni.message.startingTask`)),ae(`omni`,K.generate(t,{token:n})).then(()=>{C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?C.error(this.$t(`omni.message.usedUp`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),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 qt=q(Gt,[[`render`,Kt]]);export{qt as default};