@acedatacloud/nexior 3.380.7 → 3.381.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/assets/{ApiCodeButton-Bl0IKoEK.js → ApiCodeButton-C7SPMZJ4.js} +1 -1
  2. package/dist/assets/{ApiCodeDialog-BpFuqSZb.js → ApiCodeDialog-B0m5_btu.js} +2 -2
  3. package/dist/assets/{Artifacts-DxOnuERW.js → Artifacts-C935GA3p.js} +1 -1
  4. package/dist/assets/{AskUserQuestionCard-CPPRd9KL.js → AskUserQuestionCard-Qi57dVV7.js} +1 -1
  5. package/dist/assets/{AudioPreview-06tVQ8qx.js → AudioPreview-h4P2x5TL.js} +1 -1
  6. package/dist/assets/{Auth-DZAoj-Vn.js → Auth-DW29k_jE.js} +1 -1
  7. package/dist/assets/{Bare-DRrpHReU.js → Bare-DvCKQeEu.js} +1 -1
  8. package/dist/assets/{BotPlaceholder-Di7Uk8RE.js → BotPlaceholder-BBI_oSgE.js} +1 -1
  9. package/dist/assets/{BottomFooter-CHaxvSBp.js → BottomFooter-afn-jz6v.js} +1 -1
  10. package/dist/assets/{BrowseConnectors-DsHA3HeT.js → BrowseConnectors-G0r_jByZ.js} +1 -1
  11. package/dist/assets/{BrowserPairingDialog-BISZnXPq.js → BrowserPairingDialog-BJgs6qLU.js} +1 -1
  12. package/dist/assets/{Callback-D45Fi_lJ.js → Callback-DveJm8vT.js} +1 -1
  13. package/dist/assets/{CodeSnippet-gd7fobwb.js → CodeSnippet-BFdyqpEG.js} +1 -1
  14. package/dist/assets/{Console-L6pP6se4.js → Console-C21WF1jP.js} +1 -1
  15. package/dist/assets/{Conversation-CeRC-TVk.js → Conversation-D0W5uzHA.js} +1 -1
  16. package/dist/assets/Conversation-E2vMcQr8.js +2 -0
  17. package/dist/assets/{CopyToClipboard-CPy6HppP.js → CopyToClipboard-CdXnxkau.js} +1 -1
  18. package/dist/assets/Detail-DDl6m0vE.js +2 -0
  19. package/dist/assets/{Detail-CgTGSka5.css → Detail-DixHmQzJ.css} +1 -1
  20. package/dist/assets/Extra-C6que9Av.js +1 -0
  21. package/dist/assets/{FilePreview-XFzuQ-TE.js → FilePreview-BpPQ5OAR.js} +1 -1
  22. package/dist/assets/{Hailuo-wE99sN73.js → Hailuo-BeRIbNr2.js} +1 -1
  23. package/dist/assets/{History-6Gmii4RH.js → History-BsN3wekq.js} +1 -1
  24. package/dist/assets/{ImagePreview-IlwjPknL.js → ImagePreview-BOxOkmuq.js} +1 -1
  25. package/dist/assets/{ImageWrapper-DwZLyHlu.js → ImageWrapper-vYpJPO89.js} +1 -1
  26. package/dist/assets/{Index-DVH9jvhX.js → Index-0oHw41Oc.js} +1 -1
  27. package/dist/assets/{Index-Bc5tHnvd.js → Index-1U2bTpbF.js} +1 -1
  28. package/dist/assets/{Index-Bzw76kRp.js → Index-7IkF_rpP.js} +1 -1
  29. package/dist/assets/{Index-FPPRahdy.js → Index-B-Mkt2ur.js} +1 -1
  30. package/dist/assets/Index-BPh5XDKu.js +1 -0
  31. package/dist/assets/{Index-DLzstYPk.js → Index-BWgi01SX.js} +1 -1
  32. package/dist/assets/{Index-DUAKBAKC.js → Index-Ba4WWol0.js} +2 -2
  33. package/dist/assets/{Index-BCc6R-3p.js → Index-BdjKyfS1.js} +1 -1
  34. package/dist/assets/Index-BiHjCG2i.js +1 -0
  35. package/dist/assets/{Index-DuhBu_dV.js → Index-CB-KJcln.js} +1 -1
  36. package/dist/assets/{Index-RJ0tXVSn.js → Index-CI-2_oM6.js} +2 -2
  37. package/dist/assets/Index-CI8i6hTW.js +1 -0
  38. package/dist/assets/{Index-x6HNp31e.js → Index-CJ7hChmF.js} +1 -1
  39. package/dist/assets/{Index-B_zeMtQ92.js → Index-CJtxYaZ02.js} +1 -1
  40. package/dist/assets/{Index-D_5kP3GH.js → Index-CPrqWc5U.js} +1 -1
  41. package/dist/assets/{Index-CbOx4kXF2.js → Index-CUsRTBAy2.js} +1 -1
  42. package/dist/assets/{Index-DKwPiDoa.js → Index-CVwMDW-A.js} +2 -2
  43. package/dist/assets/{Index-CUNVBf2_.js → Index-CZS8iQGD.js} +1 -1
  44. package/dist/assets/{Index-Coc9GN7P.js → Index-CetGJnpB.js} +1 -1
  45. package/dist/assets/{Index-DENfri2t.js → Index-CnYc0oJ8.js} +1 -1
  46. package/dist/assets/Index-D4x9T8au.js +1 -0
  47. package/dist/assets/Index-D5Ul2doi.js +1 -0
  48. package/dist/assets/{Index-DikhcXUe.js → Index-DRVWr0MK.js} +1 -1
  49. package/dist/assets/{Index-CRaGpiG2.js → Index-D_y7v_Gn.js} +1 -1
  50. package/dist/assets/Index-DcVducNv.js +1 -0
  51. package/dist/assets/{Index-DNBn5SRx.js → Index-DeZs_u7x.js} +1 -1
  52. package/dist/assets/{Index-D91qOM5l.js → Index-Dfg2U97G.js} +1 -1
  53. package/dist/assets/Index-O_CrvytF.js +1 -0
  54. package/dist/assets/Index-U68d2uZj.js +1 -0
  55. package/dist/assets/{Index-C0hhbatS.js → Index-_De5KqLp.js} +2 -2
  56. package/dist/assets/{Index-DJuIQolu.js → Index-hhTRG2BF.js} +1 -1
  57. package/dist/assets/{Index-C5Jx7Yi1.js → Index-iVjZH5W4.js} +1 -1
  58. package/dist/assets/Index-j-bMmKiW.js +1 -0
  59. package/dist/assets/Index-jMFiTGzQ2.js +1 -0
  60. package/dist/assets/Index-pButqdV7.js +1 -0
  61. package/dist/assets/{Index-CZb3lVKU.js → Index-wIXSyIsm.js} +1 -1
  62. package/dist/assets/{Invitees-DMTIt1f8.js → Invitees-NIBmPbQA.js} +1 -1
  63. package/dist/assets/List-BRxaXLPy.js +1 -0
  64. package/dist/assets/List-D-zLjR6q.js +1 -0
  65. package/dist/assets/List-wiwQQloc.js +1 -0
  66. package/dist/assets/LocalTools-BC90IHHk.js +5 -0
  67. package/dist/assets/{LocalTools-CRZWSNYJ.js → LocalTools-CEjkt2l2.js} +1 -1
  68. package/dist/assets/{Logo-DBYKKsqe.js → Logo-C6NJezpt.js} +1 -1
  69. package/dist/assets/{Main-CKmKHwvW.js → Main-B0EVjP0H.js} +1 -1
  70. package/dist/assets/{Message-B0YuUoNF.js → Message-BAL7WOXJ.js} +2 -2
  71. package/dist/assets/{Model-CCJ4QTLN.css → Model-CoIdK_fw.css} +1 -1
  72. package/dist/assets/Model-j4_EX-gG.js +14 -0
  73. package/dist/assets/{Navigator-BEWdP8-d.js → Navigator-CERVgrJV.js} +5 -5
  74. package/dist/assets/{NotFound-35P720pk.js → NotFound-l7IoxBXr.js} +1 -1
  75. package/dist/assets/{PageHeader-CrMUGzE3.js → PageHeader-Cer1mYPv.js} +1 -1
  76. package/dist/assets/Pay-o3xo2mqm.js +1 -0
  77. package/dist/assets/{Player-BiE9S0-t.js → Player-UOjqiG5R.js} +1 -1
  78. package/dist/assets/{Poivelle-cm5y2eQW.js → Poivelle-BKRPVdM1.js} +1 -1
  79. package/dist/assets/{RealtimeCall-DKT-DWP_.js → RealtimeCall-Cs8cbkOK.js} +2 -2
  80. package/dist/assets/{ReportButton-HJXikYhw.js → ReportButton-CpSn2HJv.js} +1 -1
  81. package/dist/assets/{ReportDialog-Cv0l0u0O.js → ReportDialog-BoKKjM7J.js} +1 -1
  82. package/dist/assets/{ScenarioPaymentMode-CLmOm0A2.js → ScenarioPaymentMode-Bfxf8Ufv.js} +1 -1
  83. package/dist/assets/{ScheduledTasks-vZ3715pt.js → ScheduledTasks-iixEy1Ye.js} +2 -2
  84. package/dist/assets/{ServicePricingSummary-WDKPB3K5.js → ServicePricingSummary-D4J-WJ1t.js} +1 -1
  85. package/dist/assets/{SharedMarkdown-Bx8pHtWj.js → SharedMarkdown-BDyd2eGz.js} +1 -1
  86. package/dist/assets/{ShowcaseGrid-D361j0tq.js → ShowcaseGrid-DPrNdkyb.js} +1 -1
  87. package/dist/assets/{ShowcaseResultTabs-BjqfQ-y8.js → ShowcaseResultTabs-Di_5PzXP.js} +1 -1
  88. package/dist/assets/{SolanaWalletPickerDialog-xXMsyABV.js → SolanaWalletPickerDialog-JUe0BzI8.js} +1 -1
  89. package/dist/assets/Status-C8r33_t6.js +1 -0
  90. package/dist/assets/{Status-CJdLn3iI.css → Status-Ck9ha4jD.css} +1 -1
  91. package/dist/assets/{Subscribe-ChQM0B3X.js → Subscribe-z4lsK-Pw.js} +1 -1
  92. package/dist/assets/{TabSwitcher-kBSHg_RT.js → TabSwitcher-DJsQU_kt.js} +1 -1
  93. package/dist/assets/{Tts-m-QIPjVW.js → Tts-CvIT5Y3Q.js} +1 -1
  94. package/dist/assets/{VideoPlayer-Bicexa5t.js → VideoPlayer-B43pPHVA.js} +1 -1
  95. package/dist/assets/{VideoPreview-sF3vbUe_.js → VideoPreview-DxrhYEOD.js} +1 -1
  96. package/dist/assets/{VueMarkdown-B43d9bQU.js → VueMarkdown-Cm2HOlvG.js} +2 -2
  97. package/dist/assets/WriteSkillDialog-_mcGlQJv.js +1 -0
  98. package/dist/assets/{airwallexCheckout-COCsILnN.js → airwallexCheckout-DfA_t-KL.js} +1 -1
  99. package/dist/assets/arrow-down-D2NapJz3.js +1 -0
  100. package/dist/assets/arrow-left-DylqoAP7.js +1 -0
  101. package/dist/assets/arrow-right-J1XoxSVH.js +1 -0
  102. package/dist/assets/arrow-up-DO1r6z0s.js +1 -0
  103. package/dist/assets/{authorizeFlow-79yBxAUr.js → authorizeFlow-De8qROX8.js} +1 -1
  104. package/dist/assets/{avatar-BfVAMo2Z.js → avatar-CFr7Npbl.js} +1 -1
  105. package/dist/assets/{back-navigation-Bf8as-FA.js → back-navigation-CBmABnbg.js} +1 -1
  106. package/dist/assets/{basic-DqjasYm3.js → basic-BFxUUMy1.js} +1 -1
  107. package/dist/assets/{book-open-Czrb7MGi.js → book-open-pud407AJ.js} +1 -1
  108. package/dist/assets/{box-SwZkcPwV.js → box-BzqbI4wX.js} +1 -1
  109. package/dist/assets/{boxes-BX01tbYr.js → boxes-x-qEQ-LI.js} +1 -1
  110. package/dist/assets/{brain-B2dt2mtC.js → brain-DJFZK1UE.js} +1 -1
  111. package/dist/assets/{chart-no-axes-combined-BWJUWQ6_.js → chart-no-axes-combined-D35CqiRR.js} +1 -1
  112. package/dist/assets/{chat-D9dyklxP.js → chat-Cbq_zDLN.js} +1 -1
  113. package/dist/assets/check-CHq--2kK.js +1 -0
  114. package/dist/assets/chevron-down-BI4tJ27m.js +1 -0
  115. package/dist/assets/chevron-right-CHuS6TXO.js +1 -0
  116. package/dist/assets/{circle-alert-DqJ9TVTA.js → circle-alert-CHxD-85L.js} +1 -1
  117. package/dist/assets/circle-check-D_FoW3dP.js +1 -0
  118. package/dist/assets/{circle-question-mark-fAtYMrnm.js → circle-question-mark-BGXCIlnz.js} +1 -1
  119. package/dist/assets/{clipboard-list-DSRFxnIJ.js → clipboard-list-BxI8Nmie.js} +1 -1
  120. package/dist/assets/clock-CvHl_Vd7.js +1 -0
  121. package/dist/assets/code-NL9LxNiy.js +1 -0
  122. package/dist/assets/codingBridge-DW94cI81.js +2 -0
  123. package/dist/assets/{codingBridgeNotify-Ysjl9KMz.js → codingBridgeNotify-CokX8Ia4.js} +2 -2
  124. package/dist/assets/{coins-BKHjrOuK.js → coins-PK6Ps1X2.js} +1 -1
  125. package/dist/assets/{collapse-B87qL7a1.js → collapse-Dm00aNe0.js} +1 -1
  126. package/dist/assets/{connection-lRLepK-k.js → connection-D1Ih6dQd.js} +1 -1
  127. package/dist/assets/{constants-4TRM3yeb.js → constants-CspFM8fh.js} +1 -1
  128. package/dist/assets/{copy-BQhLObZQ.js → copy-D7lHzTGA.js} +1 -1
  129. package/dist/assets/{createTaskActions-BJzACS7D.js → createTaskActions-BZPCtPLs.js} +1 -1
  130. package/dist/assets/{date-picker-SPNad7vN.js → date-picker-B72Rk5Dt.js} +1 -1
  131. package/dist/assets/{digitalhuman-B8FhZR44.js → digitalhuman-BvEYnRvw.js} +1 -1
  132. package/dist/assets/{dollar-sign-DBmpsQy1.js → dollar-sign-CKl6b5bP.js} +1 -1
  133. package/dist/assets/{download-BL2XIF0d.js → download-pMsno2DA.js} +1 -1
  134. package/dist/assets/{drawer-NlOtUlBy.js → drawer-BaqojTRQ.js} +1 -1
  135. package/dist/assets/{dropdown-BxamzZWb.js → dropdown-CuUYnMXP.js} +1 -1
  136. package/dist/assets/{dropdown-F0wtZRCE.js → dropdown-j3EEj4Tp.js} +1 -1
  137. package/dist/assets/{ellipsis-B2I7WLsv.js → ellipsis-BlYmih11.js} +1 -1
  138. package/dist/assets/{esm-BJBLTKdR.js → esm-BmncEOyb.js} +2 -2
  139. package/dist/assets/{esm-idF2qGYh.js → esm-CXE577Fh.js} +2 -2
  140. package/dist/assets/esm-qenNKkbC.js +1 -0
  141. package/dist/assets/{external-link-Dz73hFs_.js → external-link-BIUuevwA.js} +1 -1
  142. package/dist/assets/{eye-DAvfHS0R.js → eye-BFgFlWNS.js} +1 -1
  143. package/dist/assets/{file-BV5-MQMU.js → file-DmSI4aV7.js} +1 -1
  144. package/dist/assets/{file-output-Q5_Dd4rm.js → file-output-DncNlmtQ.js} +1 -1
  145. package/dist/assets/{file-text-C3onrgVx.js → file-text-DcI2reu5.js} +1 -1
  146. package/dist/assets/{fish-BOAMwF1y.js → fish-3sl5sjjo.js} +1 -1
  147. package/dist/assets/{fish-BWVwHYHy.js → fish-7nSZHdyl.js} +1 -1
  148. package/dist/assets/{fish-QqSH2Ybr.js → fish-BRcyN82l.js} +1 -1
  149. package/dist/assets/{fish-BTIoKy0Z.js → fish-BqSSV68s.js} +1 -1
  150. package/dist/assets/fish-C-hdRW-5.js +1 -0
  151. package/dist/assets/{fish-BjXKlaHz.js → fish-C3d7zHOM.js} +1 -1
  152. package/dist/assets/{fish-CnIfjdFj.js → fish-CRBnMEsf.js} +1 -1
  153. package/dist/assets/{fish-BUijZnTb.js → fish-Clm3uj6k.js} +1 -1
  154. package/dist/assets/{fish-Dps6SChX.js → fish-D50ny6-y.js} +1 -1
  155. package/dist/assets/{fish-CbNRZRfM.js → fish-DGdFCanw.js} +1 -1
  156. package/dist/assets/fish-DjLQRbe6.js +1 -0
  157. package/dist/assets/{fish-DBZnAziG.js → fish-ccw5gk5G.js} +1 -1
  158. package/dist/assets/{fish-CYl3-GX7.js → fish-pcD_DjO2.js} +1 -1
  159. package/dist/assets/{flux-Cz8tTCG7.js → flux-CzW311tV.js} +1 -1
  160. package/dist/assets/{folder-B0j8ZXUr.js → folder-uXRfk1mZ.js} +1 -1
  161. package/dist/assets/gauge-BTPC0rXL.js +1 -0
  162. package/dist/assets/{generationInput-DnJFevpe.js → generationInput-VbA_cpqx.js} +1 -1
  163. package/dist/assets/{globe-DaPEXf3D.js → globe-BPuLsDjR.js} +1 -1
  164. package/dist/assets/{nanobanana-hXxLtX9z.js → grokvideo-CSAs2I4j.js} +1 -1
  165. package/dist/assets/{hailuo-BQXnfi42.js → hailuo-D87_m-0U.js} +1 -1
  166. package/dist/assets/{hash-Cj1kzh4e.js → hash-yia5yLmV.js} +1 -1
  167. package/dist/assets/{headphones-Dd3X9vkF.js → headphones-B8rBVQdH.js} +1 -1
  168. package/dist/assets/{history-BpiCbuvU.js → history-BNTxRkBy.js} +1 -1
  169. package/dist/assets/{house-CzT-mwyS.js → house-CbbGN4zL.js} +1 -1
  170. package/dist/assets/{image-DpY9p92X.js → image-CS6hThMg.js} +1 -1
  171. package/dist/assets/{imageRequests-GNQtekZ9.js → imageRequests-D1kPE8U_.js} +1 -1
  172. package/dist/assets/{index-BKiJMLEa.js → index-C8uXmX2U.js} +17 -17
  173. package/dist/assets/{index.es-DFYaskof.js → index.es-5Phodjqa.js} +1 -1
  174. package/dist/assets/{info-CvT6Qu3B.js → info-DVNsJvAI.js} +1 -1
  175. package/dist/assets/{input-number-BAYBeYyC.js → input-number-BmFOlu3s.js} +1 -1
  176. package/dist/assets/{kling-CvdF4sMz.js → kling-BDMU0ncE.js} +1 -1
  177. package/dist/assets/{languages-BiznuS3A.js → languages-DX-qFZ5y.js} +1 -1
  178. package/dist/assets/{laptop-BL51CFzo.js → laptop-DxflGBrU.js} +1 -1
  179. package/dist/assets/{lightbulb-BcrhXseN.js → lightbulb-CvqLaOvJ.js} +1 -1
  180. package/dist/assets/{link-SbHNTvQh.js → link-BmCk0KSR.js} +1 -1
  181. package/dist/assets/loader-circle-VDhzM6Nn.js +1 -0
  182. package/dist/assets/{luma-DagjUk4t.js → luma-Cc-i1JLx.js} +1 -1
  183. package/dist/assets/{maestro-BjJMLjEj.js → maestro-BSM6rSzW.js} +1 -1
  184. package/dist/assets/{mail-DuPozrZ9.js → mail-BCkjos6i.js} +1 -1
  185. package/dist/assets/{message-circle-BHAAjfgl.js → message-circle-BmBmlsGF.js} +1 -1
  186. package/dist/assets/{mic-hoiBobBz.js → mic-UcSG54_q.js} +1 -1
  187. package/dist/assets/{midjourney-D6UJXDEb.js → midjourney-CuMTiD4G.js} +1 -1
  188. package/dist/assets/minimax-kQU1Q46c.js +1 -0
  189. package/dist/assets/{mobileLocalExec-C-7qkE-A.js → mobileLocalExec-CwMOa_zQ.js} +2 -2
  190. package/dist/assets/{monitor-B8sYke_Z.js → monitor-VOFjSWYN.js} +1 -1
  191. package/dist/assets/{mouse-pointer-2-DE7o83M5.js → mouse-pointer-2-DAKfL4eZ.js} +1 -1
  192. package/dist/assets/music-2-CKgTqNZ9.js +1 -0
  193. package/dist/assets/{grokvideo-CMjqwWMs.js → nanobanana-BARcP081.js} +1 -1
  194. package/dist/assets/{omni-BfE1jn3E.js → omni-BdZjSEzD.js} +1 -1
  195. package/dist/assets/openaiimage-sQHUP0bq.js +1 -0
  196. package/dist/assets/{pagination-30x3I8le.js → pagination-C4oGiE57.js} +1 -1
  197. package/dist/assets/{pagination-DOpEFcRz.js → pagination-CoQKuK4D.js} +1 -1
  198. package/dist/assets/{pagination-BPJdobR0.js → pagination-uSk2V2K7.js} +1 -1
  199. package/dist/assets/{palette-CODnbXUA.js → palette-Cw-HJS5z.js} +1 -1
  200. package/dist/assets/{paperclip-BqZb2ebO.js → paperclip-CSMkIW0R.js} +1 -1
  201. package/dist/assets/{pause-BLbkGoHw.js → pause-BYsZ80n3.js} +1 -1
  202. package/dist/assets/{pencil-DjnUUKV4.js → pencil-D6KQdtCj.js} +1 -1
  203. package/dist/assets/{pixverse-Ddq8Oh7B.js → pika-a8YZxfOY.js} +1 -1
  204. package/dist/assets/pixverse-B7na9cqk.js +1 -0
  205. package/dist/assets/play-PlISts4C.js +1 -0
  206. package/dist/assets/{plug-CNwFr71M.js → plug-BlxHQPiR.js} +1 -1
  207. package/dist/assets/plus-8qHkLr4t.js +1 -0
  208. package/dist/assets/{poivelle-L7ro3Gkj.js → poivelle-C_aJhNN6.js} +1 -1
  209. package/dist/assets/{popover-H49TbaK1.js → popover-BqK-ErPr.js} +1 -1
  210. package/dist/assets/{producer-CDz0k5We.js → producer-a3I8ulbm.js} +1 -1
  211. package/dist/assets/{qrart-CLUgyDPS.js → qrart-B0UCUS7O.js} +1 -1
  212. package/dist/assets/{qwenimage-D4YCMO3Z.js → qwenimage-BKtsaJIJ.js} +1 -1
  213. package/dist/assets/{realtime-D-QPHXzv.js → realtime-D-W5frEc.js} +1 -1
  214. package/dist/assets/{refresh-cw-Bc03rr36.js → refresh-cw-B-RuE_6C.js} +1 -1
  215. package/dist/assets/rotate-ccw-DafhIXvS.js +1 -0
  216. package/dist/assets/rotate-cw-DIM3zleO.js +1 -0
  217. package/dist/assets/{row-BgeFnNqr.js → row-BxSRQSNe.js} +1 -1
  218. package/dist/assets/{scheduledTasks-BBhCq1Z4.js → scheduledTasks-B7bwGGDF.js} +1 -1
  219. package/dist/assets/{scroll-text-R1U8uMWl.js → scroll-text-o74NoTP2.js} +1 -1
  220. package/dist/assets/search-Bh1-kl2_.js +1 -0
  221. package/dist/assets/{seedance-Cf4OfUjF.js → seedance-CWwgV8jO.js} +1 -1
  222. package/dist/assets/{seedream-NIMro-y5.js → seedream-fbaMKMDO.js} +1 -1
  223. package/dist/assets/{select-BInIHo7G.js → select-Ctt4vMla.js} +1 -1
  224. package/dist/assets/{serp-DhfTVS3G.js → serp-CxyE8Wg6.js} +1 -1
  225. package/dist/assets/{shield-BFZdo9VP.js → shield-CNEip5QK.js} +1 -1
  226. package/dist/assets/{showcase-BwmzUSLv.js → showcase-B3x-XIzn.js} +1 -1
  227. package/dist/assets/{showcaseRecreateMixin-DZhEbJHb.js → showcaseRecreateMixin-1te_SCEr.js} +1 -1
  228. package/dist/assets/{shuffle-DyjF4nuU.js → shuffle-XCkaDWwW.js} +1 -1
  229. package/dist/assets/{siteHome-C46V57EN.js → siteHome-DAuiSeoD.js} +1 -1
  230. package/dist/assets/{slider-CjK3h6Ns.js → slider-DgU-R1_f.js} +1 -1
  231. package/dist/assets/{solana-wallets-t-MoSBDB.js → solana-wallets-v9HM0phx.js} +2 -2
  232. package/dist/assets/{sora-C_tsa4Jq.js → sora-EYl03Tg1.js} +1 -1
  233. package/dist/assets/{sparkles-BtDqpjOi.js → sparkles-BWT6yPWj.js} +1 -1
  234. package/dist/assets/square-VQwp91bM.js +1 -0
  235. package/dist/assets/{suno-BoSq6jVW.js → suno-nHiDCtV6.js} +1 -1
  236. package/dist/assets/{switch-Bs3isJHk.js → switch-DfKiiyLD.js} +1 -1
  237. package/dist/assets/{table-CdxI9RXF.js → table-B3Y40ujp.js} +1 -1
  238. package/dist/assets/{tabs-sZ_AqSxe.js → tabs-BpSLc2Is.js} +1 -1
  239. package/dist/assets/{tag-Bqk4GDQ1.js → tag-DeoG4_K6.js} +1 -1
  240. package/dist/assets/{taskPolling-Ba924Cu6.js → taskPolling-ed3DvCWh.js} +1 -1
  241. package/dist/assets/terminal-CoZlBFes.js +1 -0
  242. package/dist/assets/{time-picker-Dg1D8tQc.js → time-picker-Dw67yBu1.js} +1 -1
  243. package/dist/assets/{tooltip-BynUkwzp.js → tooltip-Co_mOTlo.js} +1 -1
  244. package/dist/assets/{trash-2-Beln6mAv.js → trash-2-2Il_x-4b.js} +1 -1
  245. package/dist/assets/{triangle-alert-Bq3-_Fkc.js → triangle-alert-Dc39dkq0.js} +1 -1
  246. package/dist/assets/{upload-DvqAUM9o.js → upload-BG3x_JWJ.js} +1 -1
  247. package/dist/assets/{upload-C9ppn-9g.js → upload-RXQqkOuq.js} +1 -1
  248. package/dist/assets/user-CRuiuJ_x.js +1 -0
  249. package/dist/assets/{veo-BM_OsVzj.js → veo-CP7MEHUu.js} +1 -1
  250. package/dist/assets/{video-DFCJZTYe.js → video-6ckJHXgu.js} +1 -1
  251. package/dist/assets/{volume-2-D05kCyqN.js → volume-2-NeRUKB9t.js} +1 -1
  252. package/dist/assets/{vuex.esm-bundler-Dh61cDbO.js → vuex.esm-bundler-C-5WV-ta.js} +1 -1
  253. package/dist/assets/{wallet-D_E8xHdl.js → wallet-DqsH6oxz.js} +1 -1
  254. package/dist/assets/{wan-i1x1NPs2.js → wan-BD9moAq4.js} +1 -1
  255. package/dist/assets/{wand-sparkles-DmpeiEvn.js → wand-sparkles-CdzPtG8R.js} +1 -1
  256. package/dist/assets/{web-n7B5hrAP.js → web-B-lQxU2R.js} +1 -1
  257. package/dist/assets/{web-CnxrQ3-A.js → web-BV1Sidqw.js} +1 -1
  258. package/dist/assets/{web-CdqGs2aB.js → web-Bg9dBHiL.js} +1 -1
  259. package/dist/assets/{web-ClIZOhEu.js → web-CeF7asFe.js} +1 -1
  260. package/dist/assets/{web-BMIc4KWg.js → web-RYS5ytss.js} +1 -1
  261. package/dist/assets/{webextrator-B0VFkC6C.js → webextrator-DxlqCl-G.js} +1 -1
  262. package/dist/assets/{zap-B9ieVMPc.js → zap-BjEPcYjV.js} +1 -1
  263. package/dist/index.html +3 -3
  264. package/package.json +2 -1
  265. package/dist/assets/Conversation-Ic9Bz5jQ.js +0 -2
  266. package/dist/assets/Detail-gkbc8bib.js +0 -2
  267. package/dist/assets/Extra-VwsLS6YO.js +0 -1
  268. package/dist/assets/Index-1LI4qM1U.js +0 -1
  269. package/dist/assets/Index-5qkpk56T.js +0 -1
  270. package/dist/assets/Index-B8iqvMBN.js +0 -1
  271. package/dist/assets/Index-C8mf8y3Z.js +0 -1
  272. package/dist/assets/Index-CRgeGm9t2.js +0 -1
  273. package/dist/assets/Index-Cg4zypDC.js +0 -1
  274. package/dist/assets/Index-ClfPrBNl.js +0 -1
  275. package/dist/assets/Index-CvLqmn1W.js +0 -1
  276. package/dist/assets/Index-DISZi4AX.js +0 -1
  277. package/dist/assets/Index-DiuTmQ18.js +0 -1
  278. package/dist/assets/Index-FvSnC5Gu.js +0 -1
  279. package/dist/assets/List-BJVhbGc2.js +0 -1
  280. package/dist/assets/List-Bg3zNJN6.js +0 -1
  281. package/dist/assets/List-v0cq20WS.js +0 -1
  282. package/dist/assets/LocalTools-BXr2LA7c.js +0 -5
  283. package/dist/assets/Model-CO-op85f.js +0 -1
  284. package/dist/assets/Pay-B2Xb91cJ.js +0 -1
  285. package/dist/assets/Status-DpWyDejb.js +0 -1
  286. package/dist/assets/WriteSkillDialog-K2LS3TLf.js +0 -1
  287. package/dist/assets/arrow-down-BbbkJBhc.js +0 -1
  288. package/dist/assets/arrow-left-DLmEl6Wt.js +0 -1
  289. package/dist/assets/arrow-right-Cn1HHkEN.js +0 -1
  290. package/dist/assets/arrow-up-CmBM1usJ.js +0 -1
  291. package/dist/assets/check-Bso95mxA.js +0 -1
  292. package/dist/assets/chevron-down-wwaIPuLp.js +0 -1
  293. package/dist/assets/chevron-right-BPElZZtK.js +0 -1
  294. package/dist/assets/circle-check-8Ag9jR7I.js +0 -1
  295. package/dist/assets/clock-DDlHnp3A.js +0 -1
  296. package/dist/assets/code-uWq_r4xP.js +0 -1
  297. package/dist/assets/codingBridge-BfiSHXN9.js +0 -2
  298. package/dist/assets/esm-CpCYiie4.js +0 -1
  299. package/dist/assets/fish-3zof-Oq9.js +0 -1
  300. package/dist/assets/fish-CZdHH_pA.js +0 -1
  301. package/dist/assets/gauge-BSNtDzVJ.js +0 -1
  302. package/dist/assets/loader-circle-Bg3m04-P.js +0 -1
  303. package/dist/assets/minimax-DfN_KBv_.js +0 -1
  304. package/dist/assets/music-2-Cah3m1kW.js +0 -1
  305. package/dist/assets/openaiimage-CEXH26jW.js +0 -1
  306. package/dist/assets/pika-BSBnEnJt.js +0 -1
  307. package/dist/assets/play-C6y7thrI.js +0 -1
  308. package/dist/assets/plus-Crsuo9O8.js +0 -1
  309. package/dist/assets/rotate-ccw-DsaR9Mql.js +0 -1
  310. package/dist/assets/rotate-cw-DG8oZGAk.js +0 -1
  311. package/dist/assets/search-wtwmDOjb.js +0 -1
  312. package/dist/assets/square-DxpmXZ0N.js +0 -1
  313. package/dist/assets/terminal-BmcXFwFy.js +0 -1
  314. package/dist/assets/user-CPjm4jru.js +0 -1
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BInIHo7G.js";import{n as x,t as S}from"./tabs-sZ_AqSxe.js";import{t as C}from"./upload-DvqAUM9o.js";import{t as w}from"./tooltip-BynUkwzp.js";import{t as T}from"./alert-BprQRUmf.js";import{_ as E,v as D}from"./vuex.esm-bundler-Dh61cDbO.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-NlOtUlBy.js";import{t as j}from"./input-number-BAYBeYyC.js";import{t as M}from"./slider-CjK3h6Ns.js";import{t as N}from"./switch-Bs3isJHk.js";import{t as ee}from"./clock-DDlHnp3A.js";import{t as te}from"./hash-Cj1kzh4e.js";import{t as ne}from"./headphones-Dd3X9vkF.js";import{t as re}from"./info-CvT6Qu3B.js";import{t as ie}from"./lightbulb-BcrhXseN.js";import{a as P,i as ae,n as oe,r as se,t as ce}from"./pagination-BPJdobR0.js";import{t as le}from"./trash-2-Beln6mAv.js";import{t as ue}from"./triangle-alert-Bq3-_Fkc.js";import{t as F}from"./upload-C9ppn-9g.js";import{t as I}from"./wand-sparkles-DmpeiEvn.js";import{Ai as de,Fi as L,Ni as fe,Pi as pe}from"./constants-4TRM3yeb.js";import{Ba as me,D as R,Fi as he,Ha as z,Ia as B,Ir as ge,Li as V,Lr as H,Ra as _e,Rr as U,T as ve,Tn as ye,Xi as W,at as G,ct as K,ia as be,it as xe,li as Se,lo as q,lt as J,nt as Ce,oi as we,ot as Y,rt as Te,st as Ee,to as X,tt as De,zi as Oe}from"./index-BKiJMLEa.js";import{t as ke}from"./CopyToClipboard-CPy6HppP.js";import{t as Ae}from"./ReportButton-HJXikYhw.js";import{t as je}from"./FilePreview-XFzuQ-TE.js";import{t as Z}from"./ImagePreview-IlwjPknL.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-WDKPB3K5.js";import{t as Pe}from"./AudioPreview-06tVQ8qx.js";import{t as Fe}from"./VideoPlayer-Bicexa5t.js";import{t as Ie}from"./VideoPreview-sF3vbUe_.js";import{t as Le}from"./ScenarioPaymentMode-CLmOm0A2.js";import{t as Re}from"./ApiCodeButton-Bl0IKoEK.js";import{t as ze}from"./BotPlaceholder-Di7Uk8RE.js";import{t as Be}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ve}from"./ShowcaseResultTabs-BjqfQ-y8.js";import{t as He}from"./showcaseRecreateMixin-DZhEbJHb.js";import{n as Ue,t as We}from"./generationInput-DnJFevpe.js";var Ge=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:X},mixins:[Me]}),Ke={class:`main flex flex-row flex-1 min-h-0`},qe={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)]`},Je={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ke,[e(`div`,qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Je,[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 Xe=R(Ge,[[`render`,Ye],[`__scopeId`,`data-v-f4b791b5`]]),Ze={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v3-turbo`:return{...Ze,audio:!0};case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Ze}}var $=`<<<video_1>>>`,Qe=/<<<image_\d+>>>/g;function $e(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function et(e){return e?e.replace(Qe,` `).replace(/\s{2,}/g,` `).trim():``}function tt(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Q(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(n)||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function nt(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=$e(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=et(n.prompt));return n}var rt=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3-turbo`,label:`v3-Turbo`},{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(de)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await z.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=R(rt,[[`render`,ot],[`__scopeId`,`data-v-d3faca05`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return L.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await z.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=R(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=Array.from({length:13},(e,t)=>t+3),gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return this.selectedModel===`kling-v3-turbo`||L.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await z.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var wt=R(vt,[[`render`,Ct],[`__scopeId`,`data-v-9051ec82`]]),Tt=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=R(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:X,ElTooltip:w,InfoIcon:P,ImagePreview:Z},mixins:[J,K,Y],emits:[`change`],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rt=R(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:X,ElTooltip:w,ImagePreview:Z,InfoIcon:P},mixins:[J,K,Y],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Bt={class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`};function Wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gt=R(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:X,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:je,UploadIcon:F},mixins:[K,Y],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=xe(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Te(Ce)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=$e(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,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===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},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(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Zt,[e(`div`,Qt,[e(`span`,$t,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,en,[e(`span`,tn,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var rn=R(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:X,ElUpload:C,UploadIcon:F,ImagePreview:Z,InfoIcon:P},mixins:[J,K,Y],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[et(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!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(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,un,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var fn=R(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=R(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},fixedAudio(){return this.selectedModel===`kling-v3-turbo`},supported(){return!!(this.fixedAudio||L.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.fixedAudio?this.$t(`kling.description.generateAudioIncluded`):this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.fixedAudio?!0:this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported||t.fixedAudio},null,8,[`modelValue`,`disabled`])])])}var Dn=R(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:On}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,An,[e(`div`,jn,[e(`span`,Mn,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Ln=R(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Hn=v({name:`InspirationPills`,components:{CloseIcon:me},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:ie,ElButton:X,PromptTextarea:ae,InspirationPills:R(Hn,[[`render`,Kn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Jn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Yn=R(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var tr=R(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:me,IdeaIcon:ie,ElDrawer:A,ElButton:X},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=R(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"kling-v3":`v3`,"kling-v3-turbo":`v3-Turbo`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:ne},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return this.config?.model===`kling-v3-turbo`||!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:X,ServicePricingSummary:Ne,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:R(vr,[[`render`,Tr],[`__scopeId`,`data-v-f59e4d1f`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return We(`kling`,H(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},restrictedControls(){return[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(this.config?.model||``)||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return ye(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return he()&&V(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=V(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=V(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await U.quote(H(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),t.config?.model===`kling-v3-turbo`?o(``,!0):(g(),f(S,{key:2,class:`mb-4`})),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.restrictedControls?o(``,!0):(g(),f(E,{key:3,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(D,{key:4,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(O,{key:5,class:`mb-4`}))]),e(`div`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=R(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:X,InfoIcon:P,ImagePreview:Z},mixins:[J,K,Y,De],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},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:1,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?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=R(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:X,InfoIcon:P,FilePreview:je},mixins:[K,Y],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,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===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},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(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gr=R(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zr=R(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,ei,[e(`div`,ti,[e(`span`,ni,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ii=R($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||ai},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var di=R(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var vi=R(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var Ti=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:X,ServicePricingSummary:Ne,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:R(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ye({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Oi,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ai=R(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{MetaTag:_e,ElTabs:x,ElTabPane:S},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Mi=[`title`],Ni={class:`text`};function Pi(t,n,a,u,d,m){let _=l(`meta-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Ni,i(t.label),1),t.badge?(g(),f(_,{key:0,tone:`warning`,class:`badge`,density:`compact`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=R(ji,[[`render`,Pi],[`__scopeId`,`data-v-24ca66ec`]]),Ii={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:pe.map(e=>({value:e,label:Ii[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=fe)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Vi=R(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:X,ElInput:q,ServicePricingSummary:Ne,InfoIcon:P,ImagePreview:Z,ModelSelector:Vi,ModeSelector:R(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[Y,De],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:B()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return ye({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return he()&&V(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=V(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await U.quoteTalkingPhoto(ge(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=R(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:te,InfoIcon:re,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:X,ImagePreview:Z,VideoPreview:Ie,AudioPreview:Pe,ApiCodeButton:Re,ReportButton:Ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await z.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),te=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:R(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:se,BotPlaceholder:ze,ScrollList:oe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Xe,RecentPanel:R(Fa,[[`render`,Ra]]),ShowcaseResultTabs:Ve},mixins:[Ee,He(`kling`),Be(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks},walletMode(){return this.taskType!==`motion`&&he()&&V(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){Oe(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({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(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/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(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=H(this.config),t=Ue(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>U.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),W(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!be())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof we||ve(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return Se(this.$wallet)},async confirmWalletPayment(e){return z.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!be())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),W(`kling`,U.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{ve(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=ge(e),n=this.createPaymentOperation(e=>U.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),W(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=R(za,[[`render`,Ha]]);export{Ua as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BInIHo7G.js";import{t as x}from"./upload-DvqAUM9o.js";import{t as S}from"./tooltip-BynUkwzp.js";import{t as C}from"./alert-BprQRUmf.js";import{_ as w,v as T}from"./vuex.esm-bundler-Dh61cDbO.js";import{t as E}from"./drawer-NlOtUlBy.js";import{t as D}from"./input-number-BAYBeYyC.js";import{t as O}from"./switch-Bs3isJHk.js";import{t as k}from"./box-SwZkcPwV.js";import{t as A}from"./clock-DDlHnp3A.js";import{t as j}from"./hash-Cj1kzh4e.js";import{t as M}from"./info-CvT6Qu3B.js";import{a as N,i as ee,n as P,o as te,r as F,t as ne}from"./pagination-BPJdobR0.js";import{t as I}from"./trash-2-Beln6mAv.js";import{t as re}from"./triangle-alert-Bq3-_Fkc.js";import{t as L}from"./upload-C9ppn-9g.js";import{t as ie}from"./volume-2-D05kCyqN.js";import{t as R}from"./wand-sparkles-DmpeiEvn.js";import{Cn as z,Ua as B,_n as ae,an as oe,bn as se,cn as ce,dn as le,fn as ue,gn as de,hn as fe,ln as pe,mn as me,nn as he,on as ge,pn as _e,sn as ve,tn as ye,un as be,vn as xe,xn as Se,yn as Ce}from"./constants-4TRM3yeb.js";import{D as V,Fi as we,Ha as Te,Ia as H,Jn as U,Li as W,Ra as Ee,T as De,Tn as Oe,Xi as ke,at as Ae,ct as G,ia as je,li as Me,lt as K,oi as Ne,ot as q,st as Pe,to as J,tt as Y}from"./index-BKiJMLEa.js";import{t as Fe}from"./CopyToClipboard-CPy6HppP.js";import{t as Ie}from"./ReportButton-HJXikYhw.js";import{t as X}from"./ImagePreview-IlwjPknL.js";import{n as Le}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Re}from"./ServicePricingSummary-WDKPB3K5.js";import{t as ze}from"./AudioPreview-06tVQ8qx.js";import{t as Be}from"./VideoPlayer-Bicexa5t.js";import{t as Ve}from"./VideoPreview-sF3vbUe_.js";import{t as He}from"./ScenarioPaymentMode-CLmOm0A2.js";import{t as Ue}from"./ApiCodeButton-Bl0IKoEK.js";import{t as We}from"./BotPlaceholder-Di7Uk8RE.js";import{t as Ge}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ke}from"./ShowcaseResultTabs-BjqfQ-y8.js";import{t as qe}from"./showcaseRecreateMixin-DZhEbJHb.js";import{t as Je}from"./generationInput-DnJFevpe.js";import{t as Ye}from"./ImageWrapper-DwZLyHlu.js";var Xe=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:E,ElButton:J},mixins:[Le]}),Ze={class:`main flex flex-row flex-1`},Qe={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)]`},$e={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function et(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ze,[e(`div`,Qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,$e,[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 tt=V(Xe,[[`render`,et],[`__scopeId`,`data-v-86340af4`]]),nt=v({name:`SeedancePromptInput`,components:{PromptTextarea:ee},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function rt(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var it=V(nt,[[`render`,rt]]),at=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:N},data(){return{options:[{value:_e,label:this.$t(`seedance.model.seedance25`)},{value:be,label:this.$t(`seedance.model.seedance20`)},{value:le,label:this.$t(`seedance.model.seedance20Fast`)},{value:ue,label:this.$t(`seedance.model.seedance20Mini`)},{value:pe,label:this.$t(`seedance.model.seedance15pro`)},{value:ve,label:this.$t(`seedance.model.seedance10pro`)},{value:ce,label:this.$t(`seedance.model.seedance10proFast`)},{value:ge,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:oe,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=ye}}),ot={class:`field`},st={class:`label`},ct={class:`box`},lt={class:`title font-bold`};function ut(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`h2`,lt,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var dt=V(at,[[`render`,ut],[`__scopeId`,`data-v-0092c9dc`]]),ft=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:N},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),pt={class:`field`},mt={class:`label`},ht={class:`box`},gt={class:`title font-bold`};function _t(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var vt=V(ft,[[`render`,_t],[`__scopeId`,`data-v-d61cc21b`]]),Z={[se]:0,[Se]:1,[Ce]:2,"4k":3},yt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:N,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[{value:se,label:`480p`},{value:Se,label:`720p`},{value:Ce,label:`1080p`},{value:`4k`,label:`4k`}],t=Z[this.capability.maxResolution]??Z[`1080p`];return e.map(e=>({...e,disabled:Z[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),bt={class:`resolution`},xt={class:`header`},St={class:`title font-bold`},Ct={class:`items`},wt=[`onClick`];function Tt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,bt,[e(`div`,xt,[e(`h2`,St,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ct,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,wt)]),_:2},1032,[`content`,`disabled`]))),128))])])}var Et=V(yt,[[`render`,Tt],[`__scopeId`,`data-v-db7e8aff`]]),Dt=v({name:`SeedanceRatioSelector`,components:{InfoIcon:N},computed:{options(){return[{value:fe,label:`16:9`,w:32,h:18},{value:ae,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:de,label:`21:9`,w:34,h:14},{value:xe,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=he}}),Ot={class:`ratio`},kt={class:`header`},At={class:`title font-bold`},jt={class:`items`},Mt=[`onClick`],Nt={class:`preview`},Pt={key:1,class:`rect rect-auto`},Ft={class:`name`};function It(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ot,[e(`div`,kt,[e(`h2`,At,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,jt,[(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`,Nt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,Pt,`A`))]),e(`div`,Ft,i(r.label),1)],10,Mt))),128))])])}var Lt=V(Dt,[[`render`,It],[`__scopeId`,`data-v-8ddec2dd`]]),Rt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:N},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return z(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),zt={key:0,class:`field`},Bt={class:`label`},Vt={class:`box`},Ht={class:`title font-bold`},Ut={class:`value`};function Wt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,zt,[e(`div`,Bt,[e(`div`,Vt,[e(`h2`,Ht,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ut,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Gt=V(Rt,[[`render`,Wt],[`__scopeId`,`data-v-df51dfbd`]]),Kt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:N},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),qt={class:`field`},Jt={class:`label`},Yt={class:`box`},Xt={class:`title font-bold`},Zt={class:`value`};function Qt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`h2`,Xt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Zt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var $t=V(Kt,[[`render`,Qt],[`__scopeId`,`data-v-ae777d61`]]),en=new Set(Object.keys(me)),tn=e=>Array.isArray(e)?e.filter(e=>B(e?.url)):[];function Q(e){let t=tn(e?.images),n=t.some(e=>!e.role||e.role===`first_frame`||e.role===`last_frame`),r=t.some(e=>e.role===`reference_image`)||e?.audios?.some(e=>B(e?.url))===!0||e?.videos?.some(e=>B(e?.url))===!0;return{frame:n,reference:r,mixed:n&&r}}function $(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!en.has(t.model))return{reject:`modelUnsupported`};let n=z(t.model);t.images=tn(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>B(e?.url))),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>B(e?.url))),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,Q(t).mixed)return{reject:`frameReferenceConflict`};if(n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0,s=(t.images||[]).filter(e=>e.role===`reference_image`).length,c=t.model===`doubao-seedance-2-5-260628`?t.images?.length||0:s,l=t.videos?.length||0,u=t.audios?.length||0;return s>n.maxReferenceImages||l>n.maxReferenceVideos||u>n.maxReferenceAudios||c+l+u>n.maxReferenceMedia?{reject:`referenceMediaExceeded`}:Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o&&!n.supportsAudioOnly?{reject:`audioRequiresReference`}:(n.taskTypes.includes(t.omni_reference_task_type)||delete t.omni_reference_task_type,t.omni_reference_task_type===`reference`&&!Q(t).reference?{reject:`taskRequiresReferenceMedia`}:(n.outputFormats.includes(t.output_format)||delete t.output_format,t.model===`doubao-seedance-2-5-260628`&&t.web_search===!0?t.tools=[{type:`web_search`}]:delete t.tools,delete t.web_search,t.model===`doubao-seedance-2-5-260628`&&t.images?.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&(t.ratio=`adaptive`),(t.omni_reference_task_type===`edit`||t.omni_reference_task_type===`extend`)&&!o?{reject:`taskRequiresVideo`}:!t.prompt&&!a&&!o&&!Array.isArray(t.audios)?{reject:`generationInputRequired`}:(t.omni_reference_task_type===`edit`?(t.ratio=`adaptive`,t.duration=-1):t.omni_reference_task_type===`extend`&&(t.ratio=`adaptive`),{request:{...t,async:!0}})))}var nn=v({name:`SeedanceFirstFrameImage`,components:{MetaTag:Ee,UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:N,ImagePreview:X},mixins:[K,G,q,Y],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetFirstFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),rn={key:0,class:`relative`},an={class:`flex min-h-8 items-center pr-20`},on={class:`flex justify-start items-center`},sn={class:`text-sm font-bold`};function cn(t,n,c,u,d,m){let h=l(`meta-tag`),_=l(`info-icon`),v=l(`image-preview`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-tooltip`),S=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,rn,[e(`div`,an,[e(`div`,on,[e(`span`,sn,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),f(h,{key:0,class:`required-badge`,density:`compact`,tone:`warning`},{default:p(()=>[r(i(t.$t(`seedance.name.required`)),1)]),_:1})):o(``,!0),a(_,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(S,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(v,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(b,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(y,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var ln=V(nn,[[`render`,cn],[`__scopeId`,`data-v-b6c34daf`]]),un=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,ImagePreview:X,InfoIcon:N},mixins:[K,G,q,Y],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetLastFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),dn={key:0,class:`relative`},fn={class:`flex min-h-8 items-center pr-20`},pn={class:`flex justify-start items-center`},mn={class:`text-sm font-bold`};function hn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,dn,[e(`div`,fn,[e(`div`,pn,[e(`span`,mn,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var gn=V(un,[[`render`,hn],[`__scopeId`,`data-v-198d2769`]]),_n=v({name:`SeedanceReferenceImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:N,ImagePreview:X},mixins:[K,G,q,Y],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetReferenceImageUrls()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),vn={key:0,class:`relative`},yn={class:`flex min-h-8 items-center pr-20`},bn={class:`flex justify-start items-center`},xn={class:`text-sm font-bold`};function Sn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,vn,[e(`div`,yn,[e(`div`,bn,[e(`span`,xn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.capability.maxReferenceImages,class:`upload-wrapper`,multiple:t.capability.maxReferenceImages>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Cn=V(_n,[[`render`,Sn],[`__scopeId`,`data-v-591ef66f`]]),wn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:N},mixins:[G,q,Y],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),Tn={key:0,class:`relative`},En={class:`flex min-h-8 items-center pr-20`},Dn={class:`flex justify-start items-center`},On={class:`text-sm font-bold`};function kn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Tn,[e(`div`,En,[e(`div`,Dn,[e(`span`,On,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:t.capability.maxReferenceAudios,class:`upload-wrapper`,multiple:t.capability.maxReferenceAudios>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var An=V(wn,[[`render`,kn],[`__scopeId`,`data-v-cb408b11`]]),jn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:N},mixins:[G,q,Y],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),Mn={key:0,class:`relative`},Nn={class:`flex min-h-8 items-center pr-20`},Pn={class:`flex justify-start items-center`},Fn={class:`text-sm font-bold`};function In(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,Mn,[e(`div`,Nn,[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:t.capability.maxReferenceVideos,class:`upload-wrapper`,multiple:t.capability.maxReferenceVideos>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ln=V(jn,[[`render`,In],[`__scopeId`,`data-v-c0492201`]]),Rn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:N},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return z(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),zn={key:0,class:`field`},Bn={class:`label`},Vn={class:`box`},Hn={class:`title font-bold`},Un={class:`value`};function Wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,zn,[e(`div`,Bn,[e(`div`,Vn,[e(`h2`,Hn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Un,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Gn=V(Rn,[[`render`,Wn],[`__scopeId`,`data-v-edea5451`]]),Kn=v({name:`SeedanceAdvanced25Settings`,components:{ElOption:b,ElSelect:y,ElSwitch:O,InfoIcon:N},computed:{visible(){return this.$store.state.seedance?.config?.model===_e},taskType:{get(){return this.$store.state.seedance?.config?.omni_reference_task_type||`auto`},set(e){this.updateConfig({omni_reference_task_type:e})}},outputFormat:{get(){return this.$store.state.seedance?.config?.output_format||`mp4`},set(e){this.updateConfig({output_format:e})}},webSearch:{get(){return this.$store.state.seedance?.config?.web_search===!0},set(e){this.updateConfig({web_search:e})}}},methods:{updateConfig(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,...e})}}}),qn={key:0,class:`space-y-4`},Jn={class:`field`},Yn={class:`label`},Xn={class:`title font-bold`},Zn={class:`field`},Qn={class:`label`},$n={class:`title font-bold`},er={class:`field`},tr={class:`label`},nr={class:`title font-bold`};function rr(t,n,r,c,u,d){let f=l(`info-icon`),m=l(`el-option`),h=l(`el-select`),_=l(`el-switch`);return t.visible?(g(),s(`div`,qn,[e(`div`,Jn,[e(`div`,Yn,[e(`h2`,Xn,i(t.$t(`seedance.name.taskType`)),1),a(f,{content:t.$t(`seedance.description.taskType`),class:`info`},null,8,[`content`])]),a(h,{modelValue:t.taskType,"onUpdate:modelValue":n[0]||=e=>t.taskType=e,class:`value`},{default:p(()=>[a(m,{value:`auto`,label:t.$t(`seedance.taskType.auto`)},null,8,[`label`]),a(m,{value:`reference`,label:t.$t(`seedance.taskType.reference`)},null,8,[`label`]),a(m,{value:`edit`,label:t.$t(`seedance.taskType.edit`)},null,8,[`label`]),a(m,{value:`extend`,label:t.$t(`seedance.taskType.extend`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`seedance.name.outputFormat`)),1)]),a(h,{modelValue:t.outputFormat,"onUpdate:modelValue":n[1]||=e=>t.outputFormat=e,class:`value`},{default:p(()=>[a(m,{value:`mp4`,label:`MP4`}),a(m,{value:`mov`,label:`MOV`})]),_:1},8,[`modelValue`])]),e(`div`,er,[e(`div`,tr,[e(`h2`,nr,i(t.$t(`seedance.name.webSearch`)),1),a(f,{content:t.$t(`seedance.description.webSearch`),class:`info`},null,8,[`content`])]),a(_,{modelValue:t.webSearch,"onUpdate:modelValue":n[2]||=e=>t.webSearch=e},null,8,[`modelValue`])])])):o(``,!0)}var ir=V(Kn,[[`render`,rr],[`__scopeId`,`data-v-b4dd64f6`]]),ar=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:N},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),or={class:`field`},sr={class:`label`},cr={class:`box`},lr={class:`title font-bold`},ur={class:`value`};function dr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,or,[e(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,ur,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var fr=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElAlert:C,ElButton:J,PromptInput:it,ModelSelector:dt,DurationSelector:vt,ResolutionSelector:Et,RatioSelector:Lt,GenerateAudioSwitch:Gt,CameraFixedSwitch:$t,ReturnLastFrameSwitch:Gn,Advanced25Settings:ir,SeedInput:V(ar,[[`render`,dr],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:ln,LastFrameImage:gn,ReferenceImage:Cn,ReferenceAudio:An,ReferenceVideo:Ln,ServicePricingSummary:Re,ScenarioPaymentMode:He},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){let{request:e,reject:t}=$(this.config);return!t&&Je(`seedance`,e)},config(){return this.$store.state.seedance?.config},capability(){return z(this.config?.model)},inputModes(){return Q(this.config)},consumption(){return Oe(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service},walletMode(){return we()&&W(`seedance`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=W(`seedance`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=W(`seedance`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;let{request:n}=$(this.config);try{if(!n)return;let r=await U.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`,this.walletMode?void 0:this.consumption)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={key:0,class:`input-mode-guide mb-4`},gr={class:`flex flex-col items-center justify-center px-5 pb-5`};function _r(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`generate-audio-switch`),S=l(`camera-fixed-switch`),C=l(`return-last-frame-switch`),w=l(`advanced25-settings`),T=l(`seed-input`),E=l(`el-alert`),D=l(`first-frame-image`),O=l(`last-frame-image`),k=l(`reference-image`),A=l(`reference-audio`),j=l(`reference-video`),M=l(`scenario-payment-mode`),N=l(`service-pricing-summary`),ee=l(`magic-icon`),P=l(`el-button`);return g(),s(`div`,pr,[e(`div`,mr,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.capability.acceptsReferenceImage?(g(),s(`div`,hr,[e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.frames`)),1),r(` `+i(t.$t(`seedance.description.frameMode`)),1)]),e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.reference`)),1),r(` `+i(t.$t(`seedance.description.referenceMode`)),1)])])):o(``,!0),t.inputModes.mixed?(g(),f(E,{key:1,class:`mb-4`,type:`warning`,closable:!1,title:t.$t(`seedance.message.frameReferenceConflict`),"show-icon":``},null,8,[`title`])):o(``,!0),a(D,{class:`mb-4`}),a(O,{class:`mb-4`}),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),a(j,{class:`mb-4`})]),e(`div`,gr,[a(M,{scenario:`seedance`}),t.walletMode?o(``,!0):(g(),f(N,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(P,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(ee,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vr=V(fr,[[`render`,_r],[`__scopeId`,`data-v-0b17b09f`]]),yr=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:I,ApplicationIcon:k,ChannelIcon:j,FullscreenIcon:te,InfoIcon:M,MagicIcon:R,TimeIcon:A,VolumeIcon:ie,WarningIcon:re,CopyToClipboard:Fe,ElAlert:C,VideoPlayer:Be,ElTooltip:S,ElButton:J,ImageWrapper:Ye,ImagePreview:X,AudioPreview:ze,VideoPreview:Ve,ApiCodeButton:Ue,ReportButton:Ie},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Te.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),br={class:`preview`},xr={class:`left`},Sr={class:`main`},Cr={class:`bot`},wr={class:`datetime`},Tr=[`aria-label`],Er={class:`info`},Dr={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Or={key:1,class:`prompt mt-2`},kr={key:0},Ar={key:1},jr={key:0,class:n({content:!0})},Mr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Nr={key:1,class:n({content:!0})},Pr={key:0,class:`mb-4`},Fr={key:1,class:`mb-4`},Ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Br={key:0},Vr={key:1},Hr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kr={key:2,class:n({content:!0})},qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Zr={key:3,class:n({content:!0})},Qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ei(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`report-button`),ee=l(`application-icon`),P=l(`fullscreen-icon`),te=l(`volume-icon`),F=l(`channel-icon`),ne=l(`warning-icon`),I=l(`info-icon`);return g(),s(`div`,br,[e(`div`,xr,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Sr,[e(`div`,Cr,[a(y,{capability:`seedance`,part:`name`}),e(`span`,wr,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Tr)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Er,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Dr,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Or,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Ar,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kr,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Nr,[n.video?.video_url?(g(),s(`div`,Pr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Fr,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ir,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`]),a(N,{service:`seedance`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lr,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Rr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,zr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,Br,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,Vr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,Hr,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,Ur,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Wr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Gr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Kr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Jr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,Yr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Xr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Zr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,$r,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,jr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Mr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var ti=v({name:`SeedanceRecentPanel`,components:{TaskPreview:V(yr,[[`render`,ei],[`__scopeId`,`data-v-a9336aee`]]),BotPlaceholder:We,NoTasks:F,ScrollList:P},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ni={key:0},ri={key:2,class:`w-full h-full flex items-center justify-center`};function ii(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,ni,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ri,[a(v)])):o(``,!0)],64)}var ai=v({name:`SeedanceIndex`,components:{ConfigPanel:vr,Layout:tt,RecentPanel:V(ti,[[`render`,ii]]),ShowcaseResultTabs:Ke},mixins:[Pe,qe(`seedance`),Ge(`seedance`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks},walletMode(){return we()&&W(`seedance`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`seedance/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ne({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){let{request:t,reject:n}=$(this.config);if(n){let e=n===`generationInputRequired`?`common.message.generationInputRequired`:`seedance.message.${n}`;T.warning(this.$t(e));return}if(!Ae(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!t)return;let r;if(this.walletMode){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}r=U.generate(t,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!je())return;let e=this.credential?.token;if(!e)return;r=U.generate(t,{token:e})}let i=T.info(this.$t(`seedance.message.startingTask`));ke(`seedance`,r).then(e=>{i.close();let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(t=>{i.close();let n=t?.response?.data;t instanceof Ne||De(t,`seedance`,e)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(n?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Me(this.$wallet)},async confirmWalletPayment(e){return Te.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function oi(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`seedance`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var si=V(ai,[[`render`,oi]]);export{si as default};
@@ -1 +0,0 @@
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,R 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-BInIHo7G.js";import{t as x}from"./upload-DvqAUM9o.js";import{t as S}from"./tooltip-BynUkwzp.js";import{t as C}from"./alert-BprQRUmf.js";import{_ as w,v as T}from"./vuex.esm-bundler-Dh61cDbO.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{t as O}from"./drawer-NlOtUlBy.js";import{t as k}from"./switch-Bs3isJHk.js";import{t as A}from"./clock-DDlHnp3A.js";import{t as j}from"./hash-Cj1kzh4e.js";import{t as M}from"./info-CvT6Qu3B.js";import{a as N,i as ee,n as P,r as F,t as I}from"./pagination-BPJdobR0.js";import{t as L}from"./trash-2-Beln6mAv.js";import{t as R}from"./triangle-alert-Bq3-_Fkc.js";import{t as te}from"./upload-C9ppn-9g.js";import{t as z}from"./wand-sparkles-DmpeiEvn.js";import{Ii as ne}from"./constants-4TRM3yeb.js";import{t as re}from"./preload-helper-zJ_50EbN.js";import{Br as B,D as V,Fi as H,Ha as U,Ia as W,Ki as G,Li as K,T as q,Tn as J,Xi as Y,at as X,ct as ie,ia as ae,li as oe,lt as se,oi as ce,ot as le,st as ue,to as Z,tt as de,zr as Q}from"./index-BKiJMLEa.js";import{t as fe}from"./CopyToClipboard-CPy6HppP.js";import{t as pe}from"./ReportButton-HJXikYhw.js";import{t as me}from"./ImagePreview-IlwjPknL.js";import{n as he}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ge}from"./ServicePricingSummary-WDKPB3K5.js";/* empty css */import{t as _e}from"./ScenarioPaymentMode-CLmOm0A2.js";import{t as ve}from"./ApiCodeButton-Bl0IKoEK.js";import{t as ye}from"./BotPlaceholder-Di7Uk8RE.js";import{t as be}from"./taskPollingMixin-CcLxtz8z.js";import{n as xe,t as Se}from"./generationInput-DnJFevpe.js";var Ce=v({name:`LayoutPika`,components:{MagicIcon:z,ElDrawer:O,ElButton:Z},mixins:[he]}),we={class:`main flex flex-row flex-1`},Te={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)]`},Ee={class:`result h-full p-4 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 l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return g(),s(`div`,we,[e(`div`,Te,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ee,[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 Oe=V(Ce,[[`render`,De],[`__scopeId`,`data-v-85e060ce`]]),ke=v({name:`IngredientsSelector`,components:{ElSwitch:k,InfoIcon:N},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients},set(e){if(!e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,ingredients_mode:void 0,image_url:void 0});return}this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients:e,model:`2.0`})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`field`},je={class:`label`},Me={class:`title font-bold`};function Ne(t,n,r,o,c,l){let d=u(`info-icon`),f=u(`el-switch`);return g(),s(`div`,Ae,[e(`div`,je,[e(`h2`,Me,i(t.$t(`pika.name.ingredients`)),1),a(d,{content:t.$t(`pika.description.ingredients`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Pe=V(ke,[[`render`,Ne],[`__scopeId`,`data-v-606e1d1a`]]),Fe=v({name:`EffectSelector`,components:{ElSelect:y,ElOption:b},data(){return{}},computed:{options(){return[{value:`Levitate`,label:this.$t(`pika.style.effect1`)},{value:`Decapitate`,label:this.$t(`pika.style.effect2`)},{value:`Eye-pop`,label:this.$t(`pika.style.effect3`)},{value:`Ta-da`,label:this.$t(`pika.style.effect4`)},{value:`Deflate`,label:this.$t(`pika.style.effect5`)},{value:`Crumble`,label:this.$t(`pika.style.effect6`)},{value:`Dissolve`,label:this.$t(`pika.style.effect7`)},{value:`Squish`,label:this.$t(`pika.style.effect8`)},{value:`Inflate`,label:this.$t(`pika.style.effect9`)},{value:`Melt`,label:this.$t(`pika.style.effect10`)},{value:`Cake-ify`,label:this.$t(`pika.style.effect11`)},{value:`Crush`,label:this.$t(`pika.style.effect12`)},{value:`Explode`,label:this.$t(`pika.style.effect13`)}]},value:{get(){return this.$store.state.pika?.config?.effect},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,effect:e})}}}}),Ie={class:`field`},Le={class:`title font-bold`},Re={class:`float-left`};function ze(t,n,r,o,c,d){let f=u(`el-option`),_=u(`el-select`);return g(),s(`div`,Ie,[e(`h2`,Le,i(t.$t(`pika.name.effect`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`),clearable:``},{default:m(()=>[(g(!0),s(l,null,h(t.options,t=>(g(),p(f,{key:t.value,label:t.label,value:t.value},{default:m(()=>[e(`span`,Re,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Be=V(Fe,[[`render`,ze],[`__scopeId`,`data-v-d1c54475`]]),Ve=v({name:`IngredientsModelSelector`,components:{ElRadioButton:E,ElRadioGroup:D},data(){return{options:[{label:this.$t(`pika.button.precise`),value:`precise`},{label:this.$t(`pika.button.creative`),value:`creative`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.ingredients_mode},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,ingredients_mode:e})}}},mounted(){this.value||=ne}}),He={class:`field`},Ue={class:`title font-bold`};function We(t,n,o,c,d,f){let _=u(`el-radio-button`),v=u(`el-radio-group`);return g(),s(`div`,He,[e(`h2`,Ue,i(t.$t(`pika.name.ingredientsModel`)),1),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`quality`},{default:m(()=>[(g(!0),s(l,null,h(t.options,e=>(g(),p(_,{key:e.value,label:e.value},{default:m(()=>[r(i(e.label),1)]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])])}var Ge=V(Ve,[[`render`,We],[`__scopeId`,`data-v-b72865fa`]]),Ke=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`2.0`,label:`2.0`},{value:`1.5`,label:`1.5`}]}},computed:{value:{get(){return this.$store.state.pika?.config?.model},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||=`2.0`}}),qe={class:`field`},Je={class:`title font-bold`};function Ye(t,n,r,o,c,d){let f=u(`el-option`),_=u(`el-select`);return g(),s(`div`,qe,[e(`h2`,Je,i(t.$t(`pika.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pika.placeholder.select`)},{default:m(()=>[(g(!0),s(l,null,h(t.options,e=>(g(),p(f,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=V(Ke,[[`render`,Ye],[`__scopeId`,`data-v-7b2e870a`]]),Ze=v({name:`ImageUrlInput`,components:{UploadIcon:te,ElUpload:x,ElButton:Z,InfoIcon:N,ImagePreview:me},mixins:[se,ie,le,de],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.pika?.config?.image_url}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;let t=this.fileList.filter(e=>!e.response?.file_url),n=(e||[]).map(e=>this.fileList.find(t=>t.response?.file_url===e||t.url===e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}});this.fileList=[...n,...t.filter(e=>!n.includes(e))]}}},methods:{onChange(e){!e.url&&e.raw&&(e.url=URL.createObjectURL(e.raw))},onExceed(){T.warning(this.$t(`pika.message.uploadStartImageExceed`))},onError(){T.error(this.$t(`pika.message.uploadStartImageError`))},onRemove(){this.onSetStartImageUrl()},onSetStartImageUrl(){this.suppressWatch=!0,this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,image_url:this.urls}),this.$nextTick(()=>{this.suppressWatch=!1})},onSuccess(){this.onSetStartImageUrl()},onRemovePreview(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),e.url?.startsWith(`blob:`)&&URL.revokeObjectURL(e.url),this.onSetStartImageUrl()}}}),Qe={class:`field`},$e={class:`label`},et={class:`title font-bold`},tt={key:0,class:`file-list mt-2 flex flex-wrap gap-[10px]`};function nt(t,n,c,d,f,_){let v=u(`info-icon`),y=u(`upload-icon`),b=u(`el-button`),x=u(`el-upload`),S=u(`image-preview`);return g(),s(`div`,null,[e(`div`,Qe,[e(`div`,$e,[e(`h2`,et,i(t.$t(`pika.name.imageUrl`)),1),a(v,{content:t.$t(`pika.description.imageUrl`),class:`info`},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:3,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-change":t.onChange,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{default:m(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`pika.button.uploadImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-change`,`on-remove`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,tt,[(g(!0),s(l,null,h(t.fileList,(e,n)=>(g(),p(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemovePreview(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var rt=V(Ze,[[`render`,nt],[`__scopeId`,`data-v-637337bb`]]),it=v({name:`PromptInput`,components:{PromptTextarea:ee},computed:{prompt:{get(){return this.$store.state.pika?.config?.prompt},set(e){this.$store.commit(`pika/setConfig`,{...this.$store.state.pika?.config,prompt:e})}}},mounted(){this.prompt||=``}});function at(e,t,n,r,i,a){let o=u(`prompt-textarea`);return g(),p(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`pika.name.prompt`),info:e.$t(`pika.description.prompt`),placeholder:e.$t(`pika.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ot=v({name:`PresetPanel`,components:{MagicIcon:z,ImageUrlInput:rt,ElButton:Z,ServicePricingSummary:ge,PromptInput:V(it,[[`render`,at]]),IngredientsSelector:Pe,IngredientsModelSelector:Ge,ModelSelector:Xe,EffectSelector:Be,ScenarioPaymentMode:_e},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return Se(`pika`,Q(this.config))},config(){return this.$store.state.pika?.config},consumption(){return J(this.config,this.service?.cost)},service(){return this.$store.state.pika?.service},walletMode(){return H()&&K(`pika`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=K(`pika`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=K(`pika`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await B.quote(Q(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),st={class:`flex flex-col h-full`},ct={class:`flex-1 overflow-y-auto p-5`},lt={class:`flex flex-col items-center justify-center px-5 pb-5`};function ut(t,n,c,l,d,f){let h=u(`prompt-input`),_=u(`model-selector`),v=u(`ingredients-selector`),y=u(`effect-selector`),b=u(`image-url-input`),x=u(`ingredients-model-selector`),S=u(`scenario-payment-mode`),C=u(`service-pricing-summary`),w=u(`magic-icon`),T=u(`el-button`);return g(),s(`div`,st,[e(`div`,ct,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),t.config?.ingredients?(g(),p(b,{key:0,class:`mb-4`})):o(``,!0),t.config?.ingredients?(g(),p(x,{key:1,class:`mb-4`})):o(``,!0)]),e(`div`,lt,[a(S,{scenario:`pika`}),t.walletMode?o(``,!0):(g(),p(C,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(T,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:m(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`pika.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var dt=V(ot,[[`render`,ut]]),ft=v({name:`VideoPlayer`,components:{VuePlyr:c(()=>re(()=>import(`./index.esm-B6OqqThm.js`),[]))},props:{modelValue:{type:Object,required:!0}},data(){return{clientReady:!1,options:{quality:{default:1080,options:[1080]}}}},mounted(){this.clientReady=!0}}),pt=[`data-poster`],mt=[`src`];function ht(t,n,r,i,a,c){let l=u(`vue-plyr`);return g(),s(`div`,null,[t.clientReady?(g(),p(l,{key:0,options:t.options,class:`video`},{default:m(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,"data-poster":t.modelValue?.image_url},[e(`source`,{size:`1080`,src:t.modelValue?.video_url,type:`video/mp4`},null,8,mt)],8,pt)]),_:1},8,[`options`])):o(``,!0)])}var gt=v({name:`TaskPreview`,components:{DeleteIcon:L,ChannelIcon:j,InfoIcon:M,MagicIcon:z,TimeIcon:A,WarningIcon:R,CopyToClipboard:fe,ElAlert:C,VideoPlayer:V(ft,[[`render`,ht],[`__scopeId`,`data-v-3a68a4bd`]]),ElTooltip:S,ElButton:Z,ApiCodeButton:ve,ReportButton:pe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pika?.application},config(){return this.$store.state.pika?.config},videos(){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.length===0&&e.push({}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`pika/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},isFailure(e){let t=this.modelValue?.response;return t?.success===!1||!!t?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(e){return this.modelValue?.response?this.isFailure(e)||e?.video_url?!1:!e?.state||[`queued`,`pending`,`processing`,`running`].includes(e.state):!0},onDownload(e){console.log(`on download`),window.open(e,`_blank`)},onReload(e){let t=e.target,n=new URL(t.src),r=n.searchParams.get(`retry`);if(!r)n.searchParams.set(`retry`,`1`);else if(parseInt(r)<2)n.searchParams.set(`retry`,(parseInt(r)+1).toString());else return;t.src=n.toString()},onOpenVideo(e){window.open(e,`_blank`)}}}),_t={class:`left`},vt={class:`main`},yt={class:`bot`},bt={class:`datetime`},xt=[`aria-label`],St={class:`info`},Ct={key:0,class:`prompt mt-2`},wt={key:0},Tt={key:1},Et={key:0,class:n({content:!0,failed:!0})},Dt={class:`image-wrapper`},Ot={key:0,class:n({operations:!0,"mt-2":!0})},kt={key:0,class:`description`},At={class:`description`},jt={key:1,class:`description`},Mt={key:1,class:n({content:!0})},Nt={class:`description`},$={class:`description`},Pt={key:0,class:`description`},Ft={class:`description`},It={key:2,class:n({content:!0})},Lt={class:`description`};function Rt(n,c,d,f,_,v){let y=u(`capability-presentation`),b=u(`delete-icon`),x=u(`el-tooltip`),S=u(`VideoPlayer`),C=u(`el-button`),w=u(`api-code-button`),T=u(`report-button`),E=u(`channel-icon`),D=u(`magic-icon`),O=u(`copy-to-clipboard`),k=u(`time-icon`),A=u(`el-alert`),j=u(`warning-icon`),M=u(`info-icon`);return g(!0),s(l,null,h(n.videos,(l,u)=>(g(),s(`div`,{key:u,class:`preview`},[e(`div`,_t,[a(y,{capability:`pika`,part:`avatar`,class:`avatar`})]),e(`div`,vt,[e(`div`,yt,[a(y,{capability:`pika`,part:`name`}),e(`span`,bt,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: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(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,xt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,St,[n.modelValue?.request?.prompt?(g(),s(`p`,Ct,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(g(),s(`span`,wt,` - (`+i(n.$t(`pika.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting(l)?(g(),s(`span`,Tt,` - (`+i(n.$t(`pika.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&l?.video_url?(g(),s(`div`,Et,[e(`div`,Dt,[a(S,{"model-value":l},null,8,[`model-value`])]),l?(g(),s(`div`,Ot,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`pika.message.downloadVideo`),placement:`top-start`},{default:m(()=>[l?.video_url?(g(),p(C,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:e=>n.onDownload(l?.video_url)},{default:m(()=>[r(i(n.$t(`pika.button.download`)),1)]),_:1},8,[`onClick`])):o(``,!0)]),_:2},1032,[`content`]),a(w,{path:`/pika/videos`,body:n.modelValue?.request},null,8,[`body`]),a(T,{service:`pika`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.request?.model?(g(),s(`p`,kt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),e(`p`,At,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,jt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure(l)?(g(),s(`div`,Mt,[a(A,{closable:!1,class:`failure`},{template:m(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.failure`)),1)]),default:m(()=>[e(`p`,Nt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,$,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(O,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Pt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Ft,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(O,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting(l)?(g(),s(`div`,It,[a(A,{closable:!1,class:`info`},{template:m(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`pika.status.processing`:`pika.status.pending`)),1)]),default:m(()=>[e(`p`,Lt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`pika.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(O,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0)])]))),128)}var zt=v({name:`RecentPanel`,components:{TaskPreview:V(gt,[[`render`,Rt],[`__scopeId`,`data-v-4c95d941`]]),BotPlaceholder:ye,NoTasks:F,ScrollList:P},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pika?.tasks,items:this.$store.state.pika?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bt={key:0},Vt={key:2,class:`w-full h-full flex items-center justify-center`};function Ht(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`,Bt,[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`,Vt,[a(v)])):o(``,!0)],64)}var Ut=v({name:`PikaIndex`,components:{ConfigPanel:dt,Layout:Oe,RecentPanel:V(zt,[[`render`,Ht]])},mixins:[ue,be(`pika`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.pika?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.pika?.status?.getTasks===w.Request||this.fetchingTasks},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===w.Request},needApply(){return this.$store.state.pika.status.getApplications===w.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.tasks},walletMode(){return H()&&K(`pika`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`pika/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await I({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(`pika/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pika/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},onApply(){G.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&T.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`pika/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=Q(this.config),t=xe(`pika`,e);if(t){T.error(this.$t(`common.message.${t}`));return}if(!X(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=B.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ae())return;let t=this.credential?.token;if(!t)return;n=B.generate(e,{token:t})}T.info(this.$t(`pika.message.startingTask`)),Y(`pika`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`pika.message.startTaskSuccess`)),this.$store.commit(`pika/setConfig`,{config:void 0})}).catch(e=>{e instanceof ce||q(e,`pika`)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`pika.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return oe(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Wt(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`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Gt=V(Ut,[[`render`,Wt],[`__scopeId`,`data-v-50569acf`]]);export{Gt as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BInIHo7G.js";import{t as x}from"./upload-DvqAUM9o.js";import{t as S}from"./tooltip-BynUkwzp.js";import{t as C}from"./alert-BprQRUmf.js";import{_ as w,v as T}from"./vuex.esm-bundler-Dh61cDbO.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{t as O}from"./drawer-NlOtUlBy.js";import{t as k}from"./slider-CjK3h6Ns.js";import{t as A}from"./switch-Bs3isJHk.js";import{t as j}from"./clock-DDlHnp3A.js";import{t as M}from"./external-link-Dz73hFs_.js";import{t as N}from"./hash-Cj1kzh4e.js";import{t as P}from"./info-CvT6Qu3B.js";import{a as F,i as I,n as ee,r as te,t as L}from"./pagination-BPJdobR0.js";import{t as R}from"./message-circle-BHAAjfgl.js";import{t as z}from"./sparkles-BtDqpjOi.js";import{t as ne}from"./trash-2-Beln6mAv.js";import{t as re}from"./triangle-alert-Bq3-_Fkc.js";import{t as ie}from"./upload-C9ppn-9g.js";import{t as B}from"./wand-sparkles-DmpeiEvn.js";import{Gi as V,Hi as ae,Ui as oe,Vi as H,Wi as U}from"./constants-4TRM3yeb.js";import{D as W,Fi as G,Ga as K,Ha as q,Ia as se,Ki as ce,Li as J,T as le,Tn as ue,Ur as Y,Va as de,Wr as X,Xi as fe,at as pe,ct as me,ia as he,li as ge,lo as Z,lt as _e,oi as ve,ot as ye,st as be,to as Q,tt as xe}from"./index-BKiJMLEa.js";import{t as Se}from"./CopyToClipboard-CPy6HppP.js";import{t as Ce}from"./Status-DpWyDejb.js";import{t as we}from"./ReportButton-HJXikYhw.js";import{t as Te}from"./ImagePreview-IlwjPknL.js";import{n as Ee}from"./taskDrawerMixin-DyAUhFEq.js";import{t as De}from"./ServicePricingSummary-WDKPB3K5.js";import{t as Oe}from"./ScenarioPaymentMode-CLmOm0A2.js";import{t as ke}from"./ApiCodeButton-Bl0IKoEK.js";import{t as Ae}from"./BotPlaceholder-Di7Uk8RE.js";import{t as je}from"./taskPollingMixin-CcLxtz8z.js";import{n as Me,t as Ne}from"./generationInput-DnJFevpe.js";import{t as Pe}from"./ImageWrapper-DwZLyHlu.js";var Fe=de(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Ie=v({name:`LayoutQrart`,components:{MagicIcon:B,ElDrawer:O,ElButton:Q},mixins:[Ee]}),Le={class:`main flex flex-row flex-1`},Re={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)]`},ze={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Be(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Le,[e(`div`,Re,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ze,[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 Ve=W(Ie,[[`render`,Be],[`__scopeId`,`data-v-493f4e03`]]),He=v({name:`VersionSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{label:this.$t(`qrart.type.text`),value:`text`},{label:this.$t(`qrart.type.link`),value:`link`},{label:this.$t(`qrart.type.email`),value:`email`},{label:this.$t(`qrart.type.phone`),value:`phone`},{label:this.$t(`qrart.type.sms`),value:`sms`}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.type},set(e){console.debug(`set type`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,type:e})}}},mounted(){this.value||=(console.debug(`set default type`,V),V)}}),Ue={class:`field`},We={class:`text-sm font-bold title`};function Ge(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ue,[e(`span`,We,i(t.$t(`qrart.name.type`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`qrart.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ke=W(He,[[`render`,Ge],[`__scopeId`,`data-v-b4bd8f04`]]),qe=v({name:`AspectRatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:30,height:30},{value:`4:3`,label:`4:3`,width:32,height:24},{value:`3:4`,label:`3:4`,width:24,height:32},{value:`16:9`,label:`16:9`,width:32,height:18},{value:`9:16`,label:`9:16`,width:18,height:32}]}},computed:{active(){return this.options.findIndex(e=>e.value===String(this.value))||0},value:{get(){return this.$store.state.qrart?.config?.aspect_ratio},set(e){console.debug(`set aspect ratio`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Je={class:`text-sm font-bold block mb-2`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Je,i(t.$t(`qrart.name.aspectRatio`)),1),e(`div`,Ye,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,Ze,i(r.label),1)],10,Xe))),128))])])}var $e=W(qe,[[`render`,Qe],[`__scopeId`,`data-v-b7590ecc`]]),et=v({name:`QrwSelector`,components:{ElSlider:k,InfoIcon:F},computed:{value:{get(){return this.$store.state.qrart?.config?.qrw||2},set(e){console.debug(`set qrw`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,qrw:e})}}},mounted(){this.value||=(console.debug(`set default qrw`),2)}}),tt={class:`field`},nt={class:`text-sm font-bold title mb-2`};function rt(t,n,r,o,c,u){let d=l(`el-slider`),f=l(`info-icon`);return g(),s(`div`,tt,[e(`span`,nt,i(t.$t(`qrart.name.qrw`)),1),a(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1.5,max:3,step:.1,class:`value`},null,8,[`modelValue`]),a(f,{content:t.$t(`qrart.description.qrw`),class:`info`},null,8,[`content`])])}var it=W(et,[[`render`,rt],[`__scopeId`,`data-v-8410479c`]]),at=v({name:`StepsSelector`,components:{ElSlider:k,InfoIcon:F},computed:{value:{get(){return this.$store.state.qrart?.config?.steps||20},set(e){console.debug(`set steps`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,steps:e})}}},mounted(){this.value||=(console.debug(`set default steps`,20),20)}}),ot={class:`field`},st={class:`text-sm font-bold block mb-2`};function ct(t,n,r,o,c,u){let d=l(`el-slider`),f=l(`info-icon`);return g(),s(`div`,ot,[e(`span`,st,i(t.$t(`qrart.name.steps`)),1),a(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:10,max:20,step:1,class:`value`},null,8,[`modelValue`]),a(f,{content:t.$t(`qrart.description.steps`),class:`info`},null,8,[`content`])])}var lt=W(at,[[`render`,ct],[`__scopeId`,`data-v-0c88983e`]]),ut=v({name:`AdvancedSelector`,components:{ElSwitch:A},computed:{value:{get(){return this.$store.state.qrart?.config?.advanced},set(e){console.debug(`set advanced`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,advanced:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),dt={class:`field`},ft={class:`title font-bold`};function pt(t,n,r,o,c,u){let d=l(`el-switch`);return g(),s(`div`,dt,[e(`span`,ft,i(t.$t(`qrart.name.advanced`)),1),a(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var mt=W(ut,[[`render`,pt],[`__scopeId`,`data-v-f8ddf849`]]),ht=v({name:`MarkerShapeSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:`square`,label:this.$t(`qrart.markerShape.square`)},{value:`circle`,label:this.$t(`qrart.markerShape.circle`)},{value:`plus`,label:this.$t(`qrart.markerShape.plus`)},{value:`box`,label:this.$t(`qrart.markerShape.box`)},{value:`octagon`,label:this.$t(`qrart.markerShape.octagon`)},{value:`tiny-plus`,label:this.$t(`qrart.markerShape.tinyPlus`)},{value:`random`,label:this.$t(`qrart.markerShape.random`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.marker_shape},set(e){console.debug(`set marker_shape`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,marker_shape:e})}}},mounted(){this.value||=H}}),gt={class:`field`},_t={class:`text-sm font-bold block mb-2`};function vt(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,gt,[e(`span`,_t,i(t.$t(`qrart.name.markerShape`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.markerShape`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var yt=W(ht,[[`render`,vt],[`__scopeId`,`data-v-de71e0b0`]]),bt=v({name:`SubMarkerSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:`square`,label:this.$t(`qrart.subMarker.square`)},{value:`circle`,label:this.$t(`qrart.subMarker.circle`)},{value:`plus`,label:this.$t(`qrart.subMarker.plus`)},{value:`box`,label:this.$t(`qrart.subMarker.box`)},{value:`random`,label:this.$t(`qrart.subMarker.random`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.sub_marker},set(e){console.debug(`set sub_marker`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,sub_marker:e})}}},mounted(){this.value||=U}}),xt={class:`field`},St={class:`text-sm font-bold block mb-2`};function Ct(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,xt,[e(`span`,St,i(t.$t(`qrart.name.subMarker`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.subMarker`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var wt=W(bt,[[`render`,Ct],[`__scopeId`,`data-v-51a39efa`]]),Tt=v({name:`RotateSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:0,label:0},{value:90,label:90},{value:180,label:180},{value:270,label:270}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.rotate},set(e){console.debug(`set rotate`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,rotate:e})}}},mounted(){this.value||=0}}),Et={class:`field`},Dt={class:`text-sm font-bold block mb-2`};function Ot(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Et,[e(`span`,Dt,i(t.$t(`qrart.name.rotate`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.rotate`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var kt=W(Tt,[[`render`,Ot],[`__scopeId`,`data-v-72e35835`]]),At=v({name:`EclSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:`L`,label:`L`},{value:`M`,label:`M`},{value:`Q`,label:`Q`},{value:`H`,label:`H`}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.ecl},set(e){console.debug(`set ecl`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,ecl:e})}}},mounted(){this.value||=`H`}}),jt={class:`field`},Mt={class:`text-sm font-bold block mb-2`};function Nt(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,jt,[e(`span`,Mt,i(t.$t(`qrart.name.ecl`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.ecl`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Pt=W(At,[[`render`,Nt],[`__scopeId`,`data-v-b3a5e331`]]),Ft=v({name:`MarkerShapeSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:`center`,label:this.$t(`qrart.position.center`)},{value:`top`,label:this.$t(`qrart.position.top`)},{value:`right`,label:this.$t(`qrart.position.right`)},{value:`bottom`,label:this.$t(`qrart.position.bottom`)},{value:`left`,label:this.$t(`qrart.position.left`)},{value:`top-left`,label:this.$t(`qrart.position.topLeft`)},{value:`top-right`,label:this.$t(`qrart.position.topRight`)},{value:`bottom-left`,label:this.$t(`qrart.position.bottomLeft`)},{value:`bottom-right`,label:this.$t(`qrart.position.bottomRight`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.position},set(e){console.debug(`set position`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,position:e})}}},mounted(){this.value||=oe}}),It={class:`field`},Lt={class:`title font-bold`};function Rt(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,It,[e(`span`,Lt,i(t.$t(`qrart.name.position`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.position`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var zt=W(Ft,[[`render`,Rt],[`__scopeId`,`data-v-54186505`]]),Bt=v({name:`PaddingLevelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:0,label:0},{value:5,label:5},{value:10,label:10},{value:10,label:10},{value:15,label:15},{value:20,label:20}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.padding_level},set(e){console.debug(`set padding_level`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,padding_level:e})}}},mounted(){this.value||=5}}),Vt={class:`field`},Ht={class:`text-sm font-bold block mb-2`};function Ut(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Vt,[e(`span`,Ht,i(t.$t(`qrart.name.paddingLevel`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.paddingLevel`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Wt=W(Bt,[[`render`,Ut],[`__scopeId`,`data-v-49d801fd`]]),Gt=v({name:`PaddingNoiseSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:0,label:0},{value:.25,label:.25},{value:.5,label:.5},{value:.75,label:.75},{value:1,label:1}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.padding_noise},set(e){console.debug(`set padding_noise`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,padding_noise:e})}}},mounted(){this.value||=0}}),Kt={class:`field`},qt={class:`text-sm font-bold block mb-2`};function Jt(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Kt,[e(`span`,qt,i(t.$t(`qrart.name.paddingNoise`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.paddingNoise`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Yt=W(Gt,[[`render`,Jt],[`__scopeId`,`data-v-a20833bb`]]),Xt=v({name:`PixelStyleSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:[{value:`square`,label:this.$t(`qrart.pixelStyle.square`)},{value:`rounded`,label:this.$t(`qrart.pixelStyle.rounded`)},{value:`dot`,label:this.$t(`qrart.pixelStyle.dot`)},{value:`squircle`,label:this.$t(`qrart.pixelStyle.squircle`)},{value:`row`,label:this.$t(`qrart.pixelStyle.row`)},{value:`column`,label:this.$t(`qrart.pixelStyle.column`)}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.pixel_style},set(e){console.debug(`set pixel_style`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,pixel_style:e})}}},mounted(){this.value||=ae}}),Zt={class:`field`},Qt={class:`text-sm font-bold block mb-2`};function $t(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Zt,[e(`span`,Qt,i(t.$t(`qrart.name.pixelStyle`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,clearable:``,class:`value`,placeholder:t.$t(`qrart.placeholder.pixelStyle`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var en=W(Xt,[[`render`,$t],[`__scopeId`,`data-v-aca7f79f`]]),tn=v({name:`SeedInput`,components:{ElInput:Z},data(){return{}},computed:{value:{get(){return this.$store.state.qrart?.config?.seed},set(e){console.debug(`set seed`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,seed:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0}}),nn={class:`field`},rn={class:`text-sm font-bold block mb-2`};function an(t,n,r,o,c,u){let d=l(`el-input`);return g(),s(`div`,nn,[e(`span`,rn,i(t.$t(`qrart.name.seed`)),1),a(d,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`qrart.placeholder.seed`)},null,8,[`modelValue`,`placeholder`])])}var on=W(tn,[[`render`,an],[`__scopeId`,`data-v-d939305d`]]),sn=v({name:`PresetSelector`,components:{ElImage:K},data(){return{options:[{value:`sunset`,label:this.$t(`qrart.preset.sunset`),url:`https://cdn.acedata.cloud/rp1h1s.png`},{value:`floral`,label:this.$t(`qrart.preset.floral`),url:`https://cdn.acedata.cloud/upyikx.png`},{value:`snowflakes`,label:this.$t(`qrart.preset.snowflakes`),url:`https://cdn.acedata.cloud/j447da.png`},{value:`feathers`,label:this.$t(`qrart.preset.feathers`),url:`https://cdn.acedata.cloud/d2ctz9.png`},{value:`raindrops`,label:this.$t(`qrart.preset.raindrops`),url:`https://cdn.acedata.cloud/xv2t3s.png`},{value:`ultra-realism`,label:this.$t(`qrart.preset.ultraRealism`),url:`https://cdn.acedata.cloud/nlor4y.png`},{value:`epic-realms`,label:this.$t(`qrart.preset.epicRealms`),url:`https://cdn.acedata.cloud/wwzkvy.png`},{value:`intricate-studio`,label:this.$t(`qrart.preset.intricateStudio`),url:`https://cdn.acedata.cloud/4kzf5y.png`},{value:`symmetric-masterpiece`,label:this.$t(`qrart.preset.symmetricMasterpiece`),url:`https://cdn.acedata.cloud/ff4ii2.png`},{value:`luminous-highway`,label:this.$t(`qrart.preset.luminousHighway`),url:`https://cdn.acedata.cloud/cliodt.png`},{value:`celestial-journey`,label:this.$t(`qrart.preset.celestialJourney`),url:`https://cdn.acedata.cloud/ejellf.png`},{value:`neon-mech`,label:this.$t(`qrart.preset.neonMech`),url:`https://cdn.acedata.cloud/3z0y6z.png`},{value:`ethereal-low-poly`,label:this.$t(`qrart.preset.etherealLowPoly`),url:`https://cdn.acedata.cloud/36o0mm.png`},{value:`golden-vista`,label:this.$t(`qrart.preset.goldenVista`),url:`https://cdn.acedata.cloud/xa0267.png`},{value:`cinematic-expanse`,label:this.$t(`qrart.preset.cinematicExpanse`),url:`https://cdn.acedata.cloud/krl5qp.png`},{value:`cinematic-warm`,label:this.$t(`qrart.preset.cinematicWarm`),url:`https://cdn.acedata.cloud/e1aahg.png`},{value:`desolate-wilderness`,label:this.$t(`qrart.preset.desolateWilderness`),url:`https://cdn.acedata.cloud/9evqqu.png`},{value:`vibrant-palette`,label:this.$t(`qrart.preset.vibrantPalette`),url:`https://cdn.acedata.cloud/3fvsmz.png`},{value:`enigmatic-journey`,label:this.$t(`qrart.preset.enigmaticJourney`),url:`https://cdn.acedata.cloud/l6kku0.png`},{value:`timeless-cinematic`,label:this.$t(`qrart.preset.timelessCinematic`),url:`https://cdn.acedata.cloud/h5mzyn.png`},{value:`regal-galaxy`,label:this.$t(`qrart.preset.regalGalaxy`),url:`https://cdn.acedata.cloud/czkegd.png`},{value:`illustrious-canvas`,label:this.$t(`qrart.preset.illustriousCanvas`),url:`https://cdn.acedata.cloud/m8hwzh.png`},{value:`expressive-mural`,label:this.$t(`qrart.preset.expressiveMural`),url:`https://cdn.acedata.cloud/g4v1rb.png`},{value:`serene-haze`,label:this.$t(`qrart.preset.sereneHaze`),url:`https://cdn.acedata.cloud/3w3ixr.png`}]}},computed:{value:{get(){return this.$store.state.qrart?.config?.preset},set(e){console.debug(`set qrw`,e),this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,preset:e})}}},mounted(){this.value||=``}}),cn={class:`field`},ln={class:`text-sm font-bold block mb-2`},un={class:`pane`},dn=[`onClick`],fn={class:`name`};function pn(t,r,o,u,d,f){let p=l(`el-image`);return g(),s(`div`,cn,[e(`span`,ln,i(t.$t(`qrart.name.preset`)),1),e(`div`,un,[(g(!0),s(c,null,h(t.options,(r,o)=>(g(),s(`div`,{key:o,class:n({item:!0,active:t.value===r.value}),onClick:e=>t.value===r.value?t.value=void 0:t.value=r.value},[a(p,{src:r.url,fit:`fill`,class:`preview`},null,8,[`src`]),e(`span`,fn,i(r.label),1)],10,dn))),128))])])}var mn=W(sn,[[`render`,pn],[`__scopeId`,`data-v-65c34adf`]]),hn=v({name:`ContentInput`,components:{UploadIcon:ie,ElInput:Z,ElUpload:x,ElRadioGroup:D,ElButton:Q,ElRadioButton:E,ImagePreview:Te},mixins:[_e,me,ye,xe],data(){return{inputWay:`input`,fileList:[],uploadUrl:se()+`/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.qrart?.config?.content},set(e){this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,content:e,content_image_url:void 0})}}},mounted(){this.value||=``,this.onSetContentImageUrl()},methods:{onExceed(){T.warning(this.$t(`qrart.message.uploadDocumentsExceed`))},onError(){T.error(this.$t(`qrart.message.uploadDocumentsError`))},onSetContentImageUrl(){let e=this.urls?.[0];this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,content:void 0,content_image_url:e})},async onSuccess(){this.onSetContentImageUrl()}}}),gn={class:`field`},_n={class:`flex justify-between items-center mb-4`},vn={class:`text-sm font-bold title`},yn={class:`flex items-center`},bn={key:2,class:`description`};function xn(t,n,c,u,d,m){let h=l(`el-radio-button`),_=l(`el-radio-group`),v=l(`el-input`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`);return g(),s(`div`,gn,[e(`div`,_n,[e(`span`,vn,i(t.$t(`qrart.name.content`)),1),e(`div`,yn,[a(_,{modelValue:t.inputWay,"onUpdate:modelValue":n[0]||=e=>t.inputWay=e},{default:p(()=>[a(h,{label:`input`},{default:p(()=>[r(i(t.$t(`qrart.inputWay.input`)),1)]),_:1}),a(h,{label:`upload`},{default:p(()=>[r(i(t.$t(`qrart.inputWay.upload`)),1)]),_:1})]),_:1},8,[`modelValue`])])]),t.inputWay==`input`?(g(),f(v,{key:0,modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,class:`content`,placeholder:t.$t(`qrart.placeholder.content`)},null,8,[`modelValue`,`placeholder`])):o(``,!0),t.inputWay==`upload`?(g(),f(S,{key:1,ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[2]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`upload upload-wrapper`,limit:1,multiple:!1,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[a(y,{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(x,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`qrart.button.uploadQr`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])):o(``,!0),t.inputWay==`upload`?(g(),s(`p`,bn,i(t.$t(`qrart.message.uploadQr`)),1)):o(``,!0)])}var Sn=W(hn,[[`render`,xn],[`__scopeId`,`data-v-0269b0bd`]]),Cn=v({name:`PromptInput`,components:{PromptTextarea:I},computed:{value:{get(){return this.$store.state.qrart?.config?.prompt},set(e){this.$store.commit(`qrart/setConfig`,{...this.$store.state.qrart?.config,prompt:e})}}},mounted(){this.value||=``}});function wn(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,title:e.$t(`qrart.name.prompt`),placeholder:e.$t(`qrart.placeholder.prompt`)},null,8,[`modelValue`,`title`,`placeholder`])}var Tn=W(Cn,[[`render`,wn]]),En=350,Dn=v({name:`ConfigPanel`,components:{MagicIcon:B,ElButton:Q,ServicePricingSummary:De,TypeSelector:Ke,PositionSelector:zt,PixelStyleSelector:en,PaddingLevelSelector:Wt,SeedInput:on,AspectRatioSelector:$e,QrwSelector:it,EclSelector:Pt,StepsSelector:lt,PaddingNoiseSelector:Yt,AdvancedSelector:mt,MarkerShapeSelector:yt,SubMarkerSelector:wt,RotateSelector:kt,PresetSelector:mn,ContentInput:Sn,PromptInput:Tn,ScenarioPaymentMode:Oe},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return Ne(`qrart`,Y(this.config))},config(){return this.$store.state.qrart?.config},consumption(){return ue(this.config,this.service?.cost)},service(){return this.$store.state.qrart?.service},walletMode(){return G()&&J(`qrart`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=J(`qrart`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,En))},async refreshQuote(){if(!this.canGenerate)return;let e=J(`qrart`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quote(Y(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}}}}),On={class:`flex flex-col h-full`},kn={class:`flex-1 overflow-y-auto p-5`},An={class:`flex flex-col items-center justify-center px-5 pb-5`};function jn(t,n,c,u,d,m){let h=l(`type-selector`),_=l(`content-input`),v=l(`prompt-input`),y=l(`aspect-ratio-selector`),b=l(`qrw-selector`),x=l(`preset-selector`),S=l(`position-selector`),C=l(`advanced-selector`),w=l(`steps-selector`),T=l(`seed-input`),E=l(`pixel-style-selector`),D=l(`marker-shape-selector`),O=l(`sub-marker-selector`),k=l(`rotate-selector`),A=l(`ecl-selector`),j=l(`padding-level-selector`),M=l(`padding-noise-selector`),N=l(`scenario-payment-mode`),P=l(`service-pricing-summary`),F=l(`magic-icon`),I=l(`el-button`);return g(),s(`div`,On,[e(`div`,kn,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),t.config?.advanced?(g(),f(w,{key:0,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(T,{key:1,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(E,{key:2,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(D,{key:3,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(O,{key:4,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(k,{key:5,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(A,{key:6,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(j,{key:7,class:`mb-4`})):o(``,!0),t.config?.advanced?(g(),f(M,{key:8,class:`mb-4`})):o(``,!0)]),e(`div`,An,[a(N,{scenario:`qrart`}),t.walletMode?o(``,!0):(g(),f(P,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(I,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:n[0]||=e=>t.$emit(`generate`)},{default:p(()=>[a(F,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`qrart.button.generate`)),1)]),_:1},8,[`disabled`])])])}var Mn=W(Dn,[[`render`,jn]]),Nn=v({name:`TaskPreview`,components:{ChannelIcon:N,DeleteIcon:ne,ExternalLinkIcon:M,GrowthIcon:Fe,InfoIcon:P,MagicIcon:B,MessageIcon:R,RewardIcon:z,TimeIcon:j,WarningIcon:re,CopyToClipboard:Se,ElAlert:C,ElTooltip:S,ImageWrapper:Pe,ApiCodeButton:ke,ReportButton:we},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.qrart?.application}},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(`qrart/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},onOpenLink(e){window.open(e,`_blank`)},onReload(e){let t=e.target,n=new URL(t.src),r=n.searchParams.get(`retry`);if(!r)n.searchParams.set(`retry`,`1`);else if(parseInt(r)<2)n.searchParams.set(`retry`,(parseInt(r)+1).toString());else return;t.src=n.toString()},onOpenUrl(e){window.open(e,`_blank`)},onDownload(e){let t=document.createElement(`a`);t.href=e,t.download=e.split(`/`).pop(),t.click()}}}),Pn={class:`preview w-full h-fit text-left flex flex-row mb-[15px]`},Fn={class:`left`},In={class:`main flex-1 w-[calc(100%-70px)] min-w-0 pt-[10px] pr-[10px] pb-0 pl-[10px]`},Ln={class:`bot flex items-center text-[16px] font-bold text-[var(--el-color-primary)] overflow-hidden whitespace-nowrap`},Rn={class:`datetime text-[12px] font-normal text-[var(--el-text-color-secondary)] ml-[10px] overflow-hidden text-ellipsis`},zn=[`aria-label`],Bn={class:`info`},Vn={key:0,class:`prompt mt-2 text-[14px] font-bold text-[var(--el-text-color-regular)] mb-[10px] overflow-hidden text-ellipsis whitespace-nowrap`},Hn={key:0},Un={key:0,class:n({content:!0,failed:!0})},Wn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Gn={class:`description`},Kn={class:`description`},qn={key:0,class:`description`},$={key:1,class:`description`},Jn=[`aria-label`,`title`],Yn={key:2,class:`description`},Xn={key:3,class:`description`},Zn={key:1,class:n({content:!0})},Qn={class:`description`},$n={class:`description`},er={key:0,class:`description`},tr={class:`description`},nr={key:2,class:n({content:!0})},rr={class:`description`};function ir(n,c,u,d,m,h){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`image-wrapper`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`reward-icon`),E=l(`message-icon`),D=l(`external-link-icon`),O=l(`growth-icon`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`),N=l(`channel-icon`);return g(),s(`div`,Pn,[e(`div`,Fn,[a(_,{capability:`qrart`,part:`avatar`,class:`avatar bg-[var(--el-bg-color)] p-[2px] w-[50px] h-[50px] m-[10px] rounded-full`})]),e(`div`,In,[e(`div`,Ln,[a(_,{capability:`qrart`,part:`name`}),e(`span`,Rn,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:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete ml-auto shrink-0 cursor-pointer border-none bg-transparent p-[4px_6px] leading-none`,"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,zn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Bn,[n.modelValue?.request?.prompt?(g(),s(`p`,Vn,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(g(),s(`span`,Hn,` - (`+i(n.$t(`qrart.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(g(),s(`div`,Un,[n.modelValue?.response?.image_url?(g(),f(b,{key:0,src:n.modelValue?.response?.image_url,"raw-src":n.modelValue?.response?.image_url},null,8,[`src`,`raw-src`])):o(``,!0),e(`div`,Wn,[a(x,{path:`/qrart/generate`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`qrart`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Gn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Kn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.type`))+`: `+i(n.$t(`qrart.type.`+n.modelValue?.request?.type))+` `,1),a(w,{content:n.modelValue?.request?.type,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.request?.content?(g(),s(`p`,qn,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.content`))+`: `+i(n.modelValue?.request?.content)+` `,1),a(w,{content:n.modelValue?.request?.content,class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.request?.content_image_url?(g(),s(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.contentImageUrl`))+`: `,1),e(`button`,{type:`button`,class:`icon-button mr-1 cursor-pointer`,"aria-label":n.$t(`common.button.view`),title:n.$t(`common.button.view`),onClick:c[1]||=e=>n.onOpenLink(n.modelValue?.request?.content_image_url)},[a(D,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Jn)])):o(``,!0),n.modelValue?.request?.seed||n.modelValue?.response?.seed?(g(),s(`p`,Yn,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.seed`))+`: `+i(n.modelValue?.request?.seed||n.modelValue?.response?.seed)+` `,1),a(w,{content:(n.modelValue?.request?.seed||n.modelValue?.response?.seed).toString(),class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,Xn,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.success===!1?(g(),s(`div`,Zn,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.failure`)),1)]),default:p(()=>[e(`p`,Qn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,$n,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,er,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,tr,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])]),_:1})])):o(``,!0),n.modelValue?.response?o(``,!0):(g(),s(`div`,nr,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.failure`)),1)]),default:p(()=>[e(`p`,rr,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`qrart.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var ar=v({name:`RecentPanel`,components:{TaskPreview:W(Nn,[[`render`,ir],[`__scopeId`,`data-v-2fec3c35`]]),BotPlaceholder:Ae,NoTasks:te,ScrollList:ee},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.qrart?.tasks,items:this.$store.state.qrart?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),or={key:0},sr={key:2,class:`w-full h-full flex items-center justify-center`};function cr(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`,or,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,(e,t)=>(g(),f(m,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,sr,[a(v)])):o(``,!0)],64)}var lr=v({name:`QrartIndex`,components:{ConfigPanel:Mn,Layout:Ve,ApplicationStatus:Ce,RecentPanel:W(ar,[[`render`,cr]])},mixins:[be,je(`qrart`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.qrart?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.qrart?.status?.getTasks===w.Request||this.fetchingTasks},service(){return this.$store.state.qrart.service},credential(){return this.$store.state.qrart.credential},config(){return this.$store.state.qrart.config},initializing(){return this.$store.state.qrart.status.getApplications===w.Request},needApply(){return this.$store.state.qrart.status.getApplications===w.Success&&!this.application},application(){return this.$store.state.qrart.application},tasks(){return this.$store.state.qrart.tasks},applications(){return this.$store.state.qrart.applications},walletMode(){return G()&&J(`qrart`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){t===void 0||e===t||(this.$store.commit(`qrart/setTasks`,void 0),await this.onGetTasks(),await this.onScrollDown())}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await L({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(`qrart/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`qrart/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){ce.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&T.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`qrart/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=Y(this.config),t=Me(`qrart`,e);if(t){T.error(this.$t(`common.message.${t}`));return}if(!pe(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=X.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!he())return;let t=this.credential?.token;if(!t)return;n=X.generate(e,{token:t})}T.info(this.$t(`qrart.message.startingTask`)),fe(`qrart`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`qrart.message.startTaskSuccess`))}).catch(e=>{e instanceof ve||le(e,`qrart`)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`qrart.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return ge(this.$wallet)},async confirmWalletPayment(e){return q.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ur(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`application-status`),u=l(`recent-panel`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:`mb-4`,onRefresh:e.onGetApplication,onSelect:t[0]||=t=>e.$store.dispatch(`qrart/setApplication`,t)},null,8,[`initializing`,`application`,`applications`,`service`,`need-apply`,`onRefresh`]),a(u,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var dr=W(lr,[[`render`,ur],[`__scopeId`,`data-v-9b8a329a`]]);export{dr as default};
@@ -1 +0,0 @@
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,j as u,mt as d,qt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{r as g,t as _}from"./select-BInIHo7G.js";import{t as v}from"./upload-DvqAUM9o.js";import{t as y}from"./tooltip-BynUkwzp.js";import{t as b}from"./alert-BprQRUmf.js";import{_ as x,v as S}from"./vuex.esm-bundler-Dh61cDbO.js";import{t as C}from"./progress-BuyYfFZn.js";import{t as w}from"./clock-DDlHnp3A.js";import{t as T}from"./hash-Cj1kzh4e.js";import{t as E}from"./info-CvT6Qu3B.js";import{a as D,i as O,n as k,r as A,t as ee}from"./pagination-BPJdobR0.js";import{t as te}from"./trash-2-Beln6mAv.js";import{t as ne}from"./triangle-alert-Bq3-_Fkc.js";import{t as j}from"./upload-C9ppn-9g.js";import{t as M}from"./wand-sparkles-DmpeiEvn.js";import{Ba as re,D as N,Fi as P,Ha as F,Ia as I,Li as L,T as R,Tn as z,Xi as B,at as V,ct as H,dr as U,ia as W,li as G,lo as K,lt as q,oi as J,ot as Y,st as X,to as Z,tt as ie,ur as Q}from"./index-BKiJMLEa.js";import{t as ae}from"./CopyToClipboard-CPy6HppP.js";import{t as oe}from"./ReportButton-HJXikYhw.js";import{t as se}from"./ImagePreview-IlwjPknL.js";import{t as ce}from"./ServicePricingSummary-WDKPB3K5.js";import{t as le}from"./AudioPreview-06tVQ8qx.js";import{t as ue}from"./VideoPlayer-Bicexa5t.js";import{t as de}from"./ScenarioPaymentMode-CLmOm0A2.js";import{t as fe}from"./BotPlaceholder-Di7Uk8RE.js";import{t as pe}from"./taskPollingMixin-CcLxtz8z.js";import{t as me}from"./Hailuo-wE99sN73.js";var he=h({name:`MinimaxFieldTitle`,components:{InfoIcon:D},props:{title:{type:String,required:!0},description:{type:String,required:!0},inline:{type:Boolean,default:!1}}}),ge={class:`m-0 text-[14px] font-bold`};function _e(t,r,o,c,u,d){let f=l(`info-icon`);return m(),s(`div`,{class:n([`flex min-h-8 items-center`,{"mb-[10px]":!t.inline}])},[e(`h2`,ge,i(t.title),1),a(f,{content:t.description},null,8,[`content`])],2)}var ve=N(he,[[`render`,_e]]),ye=h({name:`MinimaxReferenceMediaInput`,components:{AudioPreview:le,CloseIcon:re,ElButton:Z,ElProgress:C,ElUpload:v,ImagePreview:se,InfoIcon:D,UploadIcon:j},mixins:[q,H,Y,ie],props:{modelValue:{type:Array,default:()=>[]},kind:{type:String,required:!0},title:{type:String,required:!0},description:{type:String,required:!0},limit:{type:Number,required:!0}},emits:[`update:modelValue`],data(){return{fileList:[],uploadUrl:I()+`/api/v1/files/`}},computed:{accept(){return this.kind===`image`?`.png,.jpg,.jpeg,.gif,.bmp,.webp,image/*`:`.mp3,.wav,.m4a,.aac,.ogg,.flac,audio/*`},pasteAccept(){return this.accept},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}}},watch:{modelValue:{immediate:!0,handler(e){let t=this.fileList.filter(e=>!this.uploadedUrl(e)),n=e.map(e=>this.fileList.find(t=>this.uploadedUrl(t)===e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}});this.fileList=[...n,...t]}}},methods:{uploadedUrl(e){return e.response?.file_url},onChange(e){!e.url&&e.raw&&(e.url=URL.createObjectURL(e.raw))},onError(){S.error(this.$t(`minimax.message.uploadError`))},onExceed(){S.warning(this.$t(`minimax.message.${this.kind}Limit`))},onSuccess(e,t){e?.file_url&&(t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),t.url=e.file_url,t.response=e),this.emitUrls()},removeFile(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.emitUrls()},emitUrls(){this.$emit(`update:modelValue`,this.fileList.map(e=>this.uploadedUrl(e)).filter(e=>!!e))}}}),be={class:`mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},xe={class:`flex min-w-0 items-center`},Se={class:`m-0 text-[14px] font-bold`},Ce={key:0,class:`flex flex-wrap gap-[10px]`},we=[`aria-label`,`onClick`];function Te(t,n,f,h,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`el-progress`),T=l(`close-icon`);return m(),s(`div`,null,[e(`div`,be,[e(`div`,xe,[e(`h2`,Se,i(t.title),1),a(v,{content:t.description},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,class:`shrink-0`,accept:t.accept,limit:t.limit,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,headers:t.headers,"on-change":t.onChange,"on-error":t.onError,"on-exceed":t.onExceed,"on-success":t.onSuccess},{default:d(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:d(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`minimax.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`accept`,`limit`,`before-upload`,`action`,`headers`,`on-change`,`on-error`,`on-exceed`,`on-success`])]),t.fileList.length?(m(),s(`div`,Ce,[(m(!0),s(c,null,p(t.fileList,(n,r)=>(m(),s(`div`,{key:n.uid||t.uploadedUrl(n)||r,class:`relative`},[t.kind===`image`?(m(),u(S,{key:0,url:n.url||t.uploadedUrl(n),name:n.name,percentage:n.percentage,onRemove:e=>t.removeFile(r,n)},null,8,[`url`,`name`,`percentage`,`onRemove`])):(m(),s(c,{key:1},[t.uploadedUrl(n)?(m(),u(C,{key:0,url:t.uploadedUrl(n),name:n.name},null,8,[`url`,`name`])):(m(),u(w,{key:1,type:`circle`,percentage:n.percentage||0,width:50,"stroke-width":3},null,8,[`percentage`])),e(`button`,{type:`button`,class:`remove-button`,"aria-label":t.$t(`common.button.delete`),onClick:e=>t.removeFile(r,n)},[a(T,{size:`0.75em`,"aria-hidden":`true`,focusable:`false`})],8,we)],64))]))),128))])):o(``,!0)])}var Ee=N(ye,[[`render`,Te],[`__scopeId`,`data-v-155379bf`]]),De=e=>{if(!e.content.some(e=>e.type===`text`&&e.text.trim()))return`promptRequired`;if(e.content.filter(e=>e.type===`image_url`).length>9)return`imageLimit`;if(e.content.filter(e=>e.type===`audio_url`).length>3)return`audioLimit`;if(!e.content.some(e=>e.type!==`text`)&&e.ratio===`adaptive`)return`textRatioRequired`},Oe=h({name:`MinimaxConfigPanel`,components:{MagicIcon:M,ServicePricingSummary:ce,ElButton:Z,ElInput:K,ElOption:_,ElSelect:g,FieldTitle:ve,PromptTextarea:O,ReferenceMediaInput:Ee,ScenarioPaymentMode:de},emits:[`generate`],data(){return{form:{prompt:``,imageUrls:[],audioUrls:[],resolution:`2K`,ratio:`16:9`,duration:4},resolutions:[`768P`,`2K`],ratios:[{value:`adaptive`,width:`21px`,height:`21px`},{value:`21:9`,width:`28px`,height:`12px`},{value:`16:9`,width:`25px`,height:`13px`},{value:`4:3`,width:`22px`,height:`17px`},{value:`1:1`,width:`19px`,height:`19px`},{value:`3:4`,width:`17px`,height:`22px`},{value:`9:16`,width:`13px`,height:`25px`}],durations:Array.from({length:12},(e,t)=>t+4),quoteTimer:0,quoteRunId:0}},computed:{config(){let e=[],t=this.form.prompt.trim();t&&e.push({type:`text`,text:t});let n=this.form.imageUrls.length>1||this.form.audioUrls.length>0;return this.form.imageUrls.forEach(t=>{e.push({type:`image_url`,image_url:{url:t},role:n?`reference_image`:`first_frame`})}),this.form.audioUrls.forEach(t=>{e.push({type:`audio_url`,audio_url:{url:t},role:`reference_audio`})}),{model:`MiniMax-H3`,content:e,resolution:this.form.resolution,ratio:this.form.imageUrls.length===1&&!this.form.audioUrls.length?`adaptive`:this.form.ratio,duration:this.form.duration}},consumption(){return z(this.config,this.service?.cost)},service(){return this.$store.state.minimax?.service},walletMode(){return P()&&L(`minimax`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(e){this.$store.commit(`minimax/setConfig`,e),this.walletMode&&this.scheduleQuote()},deep:!0,immediate:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=L(`minimax`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await U.quote(Q(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){let e=De(this.config);if(e){S.warning(this.$t(`minimax.message.${e}`));return}this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`mb-4`},Me={class:`mb-4`},Ne={class:`option-grid`},Pe=[`aria-pressed`,`onClick`],Fe={class:`mb-4`},Ie={class:`ratio-options`},Le=[`aria-pressed`,`onClick`],Re={class:`ratio-preview`},ze={class:`setting-row mb-4`},Be={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ve(t,h,g,_,v,y){let b=l(`field-title`),x=l(`el-input`),S=l(`prompt-textarea`),C=l(`reference-media-input`),w=l(`el-option`),T=l(`el-select`),E=l(`scenario-payment-mode`),D=l(`service-pricing-summary`),O=l(`magic-icon`),k=l(`el-button`);return m(),s(`div`,ke,[e(`div`,Ae,[e(`div`,je,[a(b,{title:t.$t(`minimax.name.model`),description:t.$t(`minimax.description.model`)},null,8,[`title`,`description`]),a(x,{"model-value":`MiniMax-H3`,disabled:``})]),a(S,{modelValue:t.form.prompt,"onUpdate:modelValue":h[0]||=e=>t.form.prompt=e,class:`mb-4`,title:t.$t(`minimax.name.prompt`),info:t.$t(`minimax.description.prompt`),placeholder:t.$t(`minimax.placeholder.prompt`),"min-rows":4},null,8,[`modelValue`,`title`,`info`,`placeholder`]),a(C,{modelValue:t.form.imageUrls,"onUpdate:modelValue":h[1]||=e=>t.form.imageUrls=e,class:`mb-4`,kind:`image`,title:t.$t(`minimax.name.referenceImages`),description:t.$t(`minimax.description.referenceImages`),limit:9},null,8,[`modelValue`,`title`,`description`]),a(C,{modelValue:t.form.audioUrls,"onUpdate:modelValue":h[2]||=e=>t.form.audioUrls=e,class:`mb-4`,kind:`audio`,title:t.$t(`minimax.name.referenceAudios`),description:t.$t(`minimax.description.referenceAudios`),limit:3},null,8,[`modelValue`,`title`,`description`]),e(`div`,Me,[a(b,{title:t.$t(`minimax.name.resolution`),description:t.$t(`minimax.description.resolution`)},null,8,[`title`,`description`]),e(`div`,Ne,[(m(!0),s(c,null,p(t.resolutions,e=>(m(),s(`button`,{key:e,type:`button`,class:n([`option-button`,{active:t.form.resolution===e}]),"aria-pressed":t.form.resolution===e,onClick:n=>t.form.resolution=e},i(e),11,Pe))),128))])]),e(`div`,Fe,[a(b,{title:t.$t(`minimax.name.ratio`),description:t.$t(`minimax.description.ratio`)},null,8,[`title`,`description`]),e(`div`,Ie,[(m(!0),s(c,null,p(t.ratios,r=>(m(),s(`button`,{key:r.value,type:`button`,class:n([`ratio-button`,{active:t.form.ratio===r.value}]),"aria-pressed":t.form.ratio===r.value,onClick:e=>t.form.ratio=r.value},[e(`span`,Re,[e(`span`,{style:f({width:r.width,height:r.height}),"aria-hidden":`true`},null,4)]),e(`span`,null,i(r.value),1)],10,Le))),128))])]),e(`div`,ze,[a(b,{inline:``,title:t.$t(`minimax.name.duration`),description:t.$t(`minimax.description.duration`)},null,8,[`title`,`description`]),a(T,{modelValue:t.form.duration,"onUpdate:modelValue":h[3]||=e=>t.form.duration=e,class:`setting-value`},{default:d(()=>[(m(!0),s(c,null,p(t.durations,e=>(m(),u(w,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`])])]),e(`div`,Be,[a(E,{scenario:`minimax`}),t.walletMode?o(``,!0):(m(),u(D,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(k,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:d(()=>[a(O,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`minimax.button.generate`)),1)]),_:1},8,[`onClick`])])])}var He=N(Oe,[[`render`,Ve],[`__scopeId`,`data-v-c5d213da`]]),Ue=h({name:`TaskPreview`,components:{DeleteIcon:te,ChannelIcon:T,InfoIcon:E,MagicIcon:M,TimeIcon:w,WarningIcon:ne,CopyToClipboard:ae,ElAlert:b,VideoPlayer:ue,ElTooltip:y,ElButton:Z,ReportButton:oe},props:{modelValue:{type:Object,required:!0}},computed:{isFailure(){return this.modelValue?.status===`failed`||this.modelValue?.status===`cancelled`},isWaiting(){return this.modelValue?.status===`queued`||this.modelValue?.status===`running`},application(){return this.$store.state.minimax?.application},config(){return this.$store.state.minimax?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await F.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(`minimax/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){console.debug(`on download minimax video`,e),window.open(e,`_blank`)}}}),We={class:`preview`},Ge={class:`left`},Ke={class:`main`},qe={class:`bot`},Je={class:`datetime`},Ye=[`aria-label`],Xe={key:0,class:n({content:!0,failed:!0})},Ze={key:0,class:`mb-4`},Qe={key:1,class:n({operations:!0,"mt-2":!0})},$e={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tt={key:1,class:n({content:!0})},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rt={key:2,class:n({content:!0})},it={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function at(n,c,f,p,h,g){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`video-player`),x=l(`el-button`),S=l(`report-button`),C=l(`channel-icon`),w=l(`copy-to-clipboard`),T=l(`magic-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`time-icon`);return m(),s(`div`,We,[e(`div`,Ge,[a(_,{capability:`minimax`,part:`avatar`,class:`avatar`})]),e(`div`,Ke,[e(`div`,qe,[a(_,{capability:`minimax`,part:`name`}),e(`span`,Je,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:d(()=>[n.modelValue?.id?(m(),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,Ye)):o(``,!0)]),_:1},8,[`content`])]),c[2]||=e(`div`,{class:`info`},null,-1),n.modelValue?.status===`succeeded`?(m(),s(`div`,Xe,[n.modelValue?.content?.url?(m(),s(`div`,Ze,[a(b,{src:n.modelValue.content.url},null,8,[`src`])])):o(``,!0),n.modelValue?.content?.url?(m(),s(`div`,Qe,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`minimax.message.downloadVideo`),placement:`top-start`},{default:d(()=>[n.modelValue?.content?.url?(m(),u(x,{key:0,type:`info`,size:`small`,class:`mb-2`,onClick:c[1]||=t(e=>n.onDownload(n.modelValue.content.url),[`stop`])},{default:d(()=>[r(i(n.$t(`minimax.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(S,{service:`minimax`,"target-id":n.modelValue?.id,snapshot:{model:n.modelValue?.model,task_id:n.modelValue?.id}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.model?(m(),s(`p`,$e,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`minimax.name.model`))+`: `+i(n.modelValue?.model)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])):o(``,!0),e(`p`,et,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`minimax.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0),n.isFailure?(m(),s(`div`,tt,[a(E,{closable:!1,class:`failure`},{template:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`minimax.name.failure`)),1)]),default:d(()=>[e(`p`,$,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`minimax.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,nt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`minimax.name.failureReason`))+`: `+i(n.modelValue?.error?.message)+` `,1),a(w,{content:n.modelValue?.error?.message},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting?(m(),s(`div`,rt,[a(E,{closable:!1,class:`info`},{template:d(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.status===`queued`?`minimax.status.pending`:`minimax.status.processing`)),1)]),default:d(()=>[e(`p`,it,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`minimax.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var ot=h({name:`RecentPanel`,components:{TaskPreview:N(Ue,[[`render`,at],[`__scopeId`,`data-v-2f8bed02`]]),BotPlaceholder:fe,NoTasks:A,ScrollList:k},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.minimax?.tasks,items:this.$store.state.minimax?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),st={key:0},ct={key:2,class:`w-full h-full flex items-center justify-center`};function lt(e,t,n,r,i,f){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return m(),s(c,null,[e.tasks?.items===void 0?(m(),s(`div`,st,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(m(),u(_,{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:d(()=>[(m(!0),s(c,null,p(e.tasks?.items,e=>(m(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(m(),s(`div`,ct,[a(v)])):o(``,!0)],64)}var ut=h({name:`MinimaxIndex`,components:{ConfigPanel:He,Layout:me,RecentPanel:N(ot,[[`render`,lt]])},mixins:[X,pe(`minimax`)],inject:[`initialized`],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.minimax?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.minimax?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.minimax.credential},config(){return this.$store.state.minimax.config},application(){return this.$store.state.minimax.application},tasks(){return this.$store.state.minimax.tasks},walletMode(){return P()&&L(`minimax`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`minimax/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ee({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(`minimax/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`minimax/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(`minimax/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!V(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e=Q(this.config),t;if(this.walletMode){let n=this.getWalletContext();if(!n){S.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=U.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!W())return;let n=this.credential?.token;if(!n)return;t=U.generate(e,{token:n})}S.info(this.$t(`minimax.message.startingTask`)),B(`minimax`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),S.success(this.$t(`minimax.message.startTaskSuccess`))}).catch(e=>{e instanceof J||R(e,`minimax`)||(this.walletMode?S.error(this.$t(`common.x402Scenario.paymentFailed`)):S.error(this.$t(`minimax.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return G(this.$wallet)},async confirmWalletPayment(e){return F.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function dt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),f=l(`layout`);return m(),u(f,null,{config:d(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:d(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ft=N(ut,[[`render`,dt]]);export{ft as default};