@acedatacloud/nexior 3.207.0 → 3.208.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/{Auth-Dce920-R.js → Auth-CeQz-WEH.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-BZTrMT1c.js → BotPlaceholder-HRgLuF4Q.js} +1 -1
  3. package/dist/assets/{Callback-BMjqPSwT.js → Callback-ClPNWM1q.js} +1 -1
  4. package/dist/assets/Console-E-NabBzY.js +1 -0
  5. package/dist/assets/{Consumption-tJVE5oXO.js → Consumption-Dsn_n1Kk.js} +1 -1
  6. package/dist/assets/{Conversation-CqsIS4eA.js → Conversation-DFr3O7aQ.js} +1 -1
  7. package/dist/assets/{CopyToClipboard-BthEHufq.js → CopyToClipboard-0ZGF0U2F.js} +1 -1
  8. package/dist/assets/{Detail-WTNxNgmJ.js → Detail-DffspBQk.js} +2 -2
  9. package/dist/assets/{Extra-C-xZRZXJ.js → Extra-CyoIK9HF.js} +1 -1
  10. package/dist/assets/{FilePreview-19tiWMqq.js → FilePreview-BFg3psGh.js} +1 -1
  11. package/dist/assets/Hailuo-B-kZjyRq.css +1 -0
  12. package/dist/assets/Hailuo-DvZIMzqU.js +1 -0
  13. package/dist/assets/{History-Q0DrqZIg.js → History-BmgHbCpv.js} +1 -1
  14. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-CpAUocHI.js → IconPark.vue_vue_type_script_setup_true_lang-DzAa3SEK.js} +1 -1
  15. package/dist/assets/{ImagePreview-CJP-yB4D.js → ImagePreview-DVwsT7Lz.js} +1 -1
  16. package/dist/assets/{ImageWrapper-BBWjyl4X.js → ImageWrapper-kpuoczuB.js} +1 -1
  17. package/dist/assets/{Index-CzfrNUJN.js → Index-5Wzz4DsH.js} +1 -1
  18. package/dist/assets/{Index-CmsydDPC.js → Index-7yvnYj8q.js} +1 -1
  19. package/dist/assets/{Index-DD0EHZ6s.js → Index-9URadx05.js} +1 -1
  20. package/dist/assets/{Index-BHQ2-n3q.js → Index-B4k8Fb9C.js} +1 -1
  21. package/dist/assets/Index-B92AdUwb.js +1 -0
  22. package/dist/assets/{Index-B_oLeXIS.js → Index-BGUvMRBn.js} +1 -1
  23. package/dist/assets/{Index-CfbJEwPf.js → Index-BJnbpX1F.js} +1 -1
  24. package/dist/assets/{Index-B4MkRRvd.js → Index-BLoeVy88.js} +1 -1
  25. package/dist/assets/{Index-stgmagiE.js → Index-BOB3Y3EQ.js} +1 -1
  26. package/dist/assets/Index-BPLbBC0V.js +1 -0
  27. package/dist/assets/{Index-DIlbji30.js → Index-BtTNaauo.js} +1 -1
  28. package/dist/assets/{Index-DYu-UVrx.js → Index-C1CmXHc-.js} +1 -1
  29. package/dist/assets/{Index-BV1OjZBh.js → Index-C3hSALx3.js} +1 -1
  30. package/dist/assets/{Index-C3jOzeR8.js → Index-CRh15R0m.js} +1 -1
  31. package/dist/assets/{Index-Fpq3jlhy.js → Index-D9Q7Yjdh.js} +1 -1
  32. package/dist/assets/{Index-D7Skgxbm.js → Index-DLcdwnMG.js} +1 -1
  33. package/dist/assets/{Index-sEfNwE6k.js → Index-Do6vZxMX.js} +1 -1
  34. package/dist/assets/{Index-9VLv8Mii.js → Index-Ds-sxPn2.js} +1 -1
  35. package/dist/assets/{Index-Df_3f5g9.js → Index-Dx_viTiF.js} +1 -1
  36. package/dist/assets/{Index-Bxun8G4k.js → Index-I2t6qZdi.js} +1 -1
  37. package/dist/assets/{Index-3Fm2prBE.js → Index-MArb1Cz2.js} +1 -1
  38. package/dist/assets/Index-Mc8I2zmp.css +1 -0
  39. package/dist/assets/{Index-DNSZVt8d.js → Index-U5pOD5zR.js} +1 -1
  40. package/dist/assets/{Index-wlbCPr9q.js → Index-z7MVQz7q.js} +1 -1
  41. package/dist/assets/{Index-pI_3O6FW.js → Index-z8vDRZmT.js} +1 -1
  42. package/dist/assets/{Invitees-CQ7RiHMG.js → Invitees-CUzhhoBO.js} +1 -1
  43. package/dist/assets/{List-C5xUnQHw.js → List-BWPWMAIU.js} +1 -1
  44. package/dist/assets/{List-EZ2xSsBF.js → List-DgGNUacJ.js} +1 -1
  45. package/dist/assets/{List-Cf1eN4n0.js → List-iQeuQ7rv.js} +1 -1
  46. package/dist/assets/Main-BISDiCU_.js +1 -0
  47. package/dist/assets/{Navigator-DPxvQ9my.js → Navigator-BMGPpEri.js} +3 -3
  48. package/dist/assets/{Navigator-IL1jxOeb.css → Navigator-DJh7htCl.css} +1 -1
  49. package/dist/assets/{NoTasks-gaaOL_m7.js → NoTasks-CGjq4fYU.js} +1 -1
  50. package/dist/assets/{NotFound-DZNa0j-I.js → NotFound-C53JukDS.js} +1 -1
  51. package/dist/assets/Pagination-DbD1Ftrw.js +1 -0
  52. package/dist/assets/{Status-DzvbugyE.js → Status-Dz7PIZQi.js} +1 -1
  53. package/dist/assets/{Subscribe-BGO77YBo.js → Subscribe-DrBoBCgp.js} +1 -1
  54. package/dist/assets/Tts-CehALafE.css +1 -0
  55. package/dist/assets/Tts-aDhhyZya.js +1 -0
  56. package/dist/assets/{VideoPlayer-Dn-EFbop.js → VideoPlayer-BU0R8j6Z.js} +1 -1
  57. package/dist/assets/{_Uint8Array-BnVWNeHp.js → _Uint8Array-DtjvDkU6.js} +1 -1
  58. package/dist/assets/{_baseClone-Q0okPItx.js → _baseClone-Ci28Kv2t.js} +1 -1
  59. package/dist/assets/_baseIteratee-DC5oli-s.js +1 -0
  60. package/dist/assets/_initCloneObject-BIgCXgf6.js +1 -0
  61. package/dist/assets/{add-BHJc9-Xi.js → add-BdjkC9G2.js} +1 -1
  62. package/dist/assets/{all-wallets-BfC1-iuR.js → all-wallets-6_7guzTo.js} +1 -1
  63. package/dist/assets/{app-store-Bn7LbjBW.js → app-store-Do-5zQM7.js} +1 -1
  64. package/dist/assets/{apple-BzgZCTUI.js → apple-CF89aYEr.js} +1 -1
  65. package/dist/assets/{arrow-bottom-B4m8T3u_.js → arrow-bottom-BNHhn3-E.js} +1 -1
  66. package/dist/assets/{arrow-bottom-circle-BUTrvpis.js → arrow-bottom-circle-Bdl9F3S6.js} +1 -1
  67. package/dist/assets/{arrow-left-BubUEC4-.js → arrow-left-CFcuHBtN.js} +1 -1
  68. package/dist/assets/{arrow-right-B1FF85iL.js → arrow-right-L_kfQxdg.js} +1 -1
  69. package/dist/assets/{arrow-top-lPzDOg2G.js → arrow-top-D5lQll5F.js} +1 -1
  70. package/dist/assets/{avatar-DojN-v8h.js → avatar-DaUID27_.js} +1 -1
  71. package/dist/assets/{bank-D-ejARzl.js → bank-BOfATaiY.js} +1 -1
  72. package/dist/assets/{basic-DT6LkBVZ.js → basic-DXB_3qm7.js} +1 -1
  73. package/dist/assets/{browser-Cww9lHqu.js → browser-DwmCyIE5.js} +1 -1
  74. package/dist/assets/{byokCredential-DVQ4GuRL.js → byokCredential-DQo0jQWz.js} +1 -1
  75. package/dist/assets/{card-BHHkstVg.js → card-BlgEXBkK.js} +1 -1
  76. package/dist/assets/{castArray-CB5VORGs.js → castArray-CkmeLXWc.js} +1 -1
  77. package/dist/assets/{chat-Cq5B3uAW.js → chat-CIRRG9K3.js} +1 -1
  78. package/dist/assets/{checkmark-BOJIqbkU.js → checkmark-DqqKLAvb.js} +1 -1
  79. package/dist/assets/{checkmark-bold-AM2r6J2s.js → checkmark-bold-BN5zBzwb.js} +1 -1
  80. package/dist/assets/{chevron-bottom-B3LHjJJ3.js → chevron-bottom-BXZTcdy5.js} +1 -1
  81. package/dist/assets/{chevron-left-o1oDm0g0.js → chevron-left-BWX5q_mT.js} +1 -1
  82. package/dist/assets/{chevron-right-BujYbnWr.js → chevron-right-CWjXL0Iq.js} +1 -1
  83. package/dist/assets/{chevron-top-DPGdnhlq.js → chevron-top-CZ3u2bxD.js} +1 -1
  84. package/dist/assets/{chrome-store-B0C7Dvg3.js → chrome-store-68Mxwy2E.js} +1 -1
  85. package/dist/assets/{clock-Dq90QgyH.js → clock-BtYFka2x.js} +1 -1
  86. package/dist/assets/{close-Ddw43auG.js → close-6btpNU0L.js} +1 -1
  87. package/dist/assets/{coinPlaceholder-BClGALbt.js → coinPlaceholder-D6W90QTS.js} +1 -1
  88. package/dist/assets/{common-DzWgE-Ef.js → common-BD5nHEtx.js} +1 -1
  89. package/dist/assets/{common-5Vvny5Q9.js → common-BDUwA8vb.js} +1 -1
  90. package/dist/assets/{common-C4ZplCpJ.js → common-BGCy92q1.js} +1 -1
  91. package/dist/assets/{common-BASio1hn.js → common-BX8iT61Z.js} +1 -1
  92. package/dist/assets/{common-D5T5aAeb.js → common-BdAkiQnW.js} +1 -1
  93. package/dist/assets/{common-Iktf5Yim.js → common-BkbMUp9R.js} +1 -1
  94. package/dist/assets/{common-D2GmGfDS.js → common-BrExGwpG.js} +1 -1
  95. package/dist/assets/{common-B6N78uMb.js → common-BvrtAEOq.js} +1 -1
  96. package/dist/assets/{common-DaCJJuUY.js → common-BwhdTDou.js} +1 -1
  97. package/dist/assets/{common-IFJFbMJD.js → common-C0Apd574.js} +1 -1
  98. package/dist/assets/{common-g2mu16cw.js → common-Ct4jsUC7.js} +1 -1
  99. package/dist/assets/{common-DaNw2SIa.js → common-Cv9X2XGj.js} +1 -1
  100. package/dist/assets/{common-S6OXcE3j.js → common-Cvw4Sk2V.js} +1 -1
  101. package/dist/assets/{common-1GFGkE8l.js → common-D26aQ9nA.js} +1 -1
  102. package/dist/assets/{common-C6n229DA.js → common-D3iKAuYl.js} +1 -1
  103. package/dist/assets/{common-Bh7WuKq9.js → common-DB6uO0GC.js} +1 -1
  104. package/dist/assets/{common-B18clqRn.js → common-DXw4_NaT.js} +1 -1
  105. package/dist/assets/{common-D2_5yuDq.js → common-IjjmWf9m.js} +1 -1
  106. package/dist/assets/{compass-j3x_JuF7.js → compass-G-zNaI9i.js} +1 -1
  107. package/dist/assets/{copy-CoDaeoDy.js → copy-DYG4Vd8r.js} +1 -1
  108. package/dist/assets/{createTaskActions-Mbk9YPjO.js → createTaskActions-sh1jE87A.js} +1 -1
  109. package/dist/assets/{cursor-BUcjAEEw.js → cursor-CnL-FAj_.js} +1 -1
  110. package/dist/assets/{cursor-transparent-C75fbcep.js → cursor-transparent-Dtkuthny.js} +1 -1
  111. package/dist/assets/debounce-Cyq2y_q-.js +1 -0
  112. package/dist/assets/{desktop-B5niTzqq.js → desktop-DtNy4D8S.js} +1 -1
  113. package/dist/assets/{disconnect-CLvOZFae.js → disconnect-B30yABTJ.js} +1 -1
  114. package/dist/assets/{discord-DG2H5efs.js → discord-Dkta5Tmw.js} +1 -1
  115. package/dist/assets/{distribution-DJ7DtFet.js → distribution-DRmPxIZO.js} +1 -1
  116. package/dist/assets/{dropdown-DFq4J8nF.js → dropdown-BiY9TOUN.js} +1 -1
  117. package/dist/assets/{etherscan-XsFEw09l.js → etherscan-CGtjtBpq.js} +1 -1
  118. package/dist/assets/{exclamation-triangle-Dvyl-cKA.js → exclamation-triangle-BjqCfXAI.js} +1 -1
  119. package/dist/assets/{extension-DbFHjx1L.js → extension-BxqWBXZ5.js} +1 -1
  120. package/dist/assets/{external-link-ChP60Cu4.js → external-link-D2qpY3_0.js} +1 -1
  121. package/dist/assets/{facebook-xJCj9izo.js → facebook-CbHMFRGQ.js} +1 -1
  122. package/dist/assets/{farcaster-DZq_Zkvf.js → farcaster-CWDzlrBe.js} +1 -1
  123. package/dist/assets/{filters-B5n92rN7.js → filters-C1bwhfIq.js} +1 -1
  124. package/dist/assets/fish-B1Euqnn0.js +1 -0
  125. package/dist/assets/fish-B2JG6AjH.js +1 -0
  126. package/dist/assets/fish-BDFrkbY5.js +1 -0
  127. package/dist/assets/fish-BN9ZdFXE.js +1 -0
  128. package/dist/assets/fish-BO84g2Zw.js +1 -0
  129. package/dist/assets/fish-BhiEgwBC.js +1 -0
  130. package/dist/assets/fish-BiWTdoU0.js +1 -0
  131. package/dist/assets/fish-C0P9Wtlh.js +1 -0
  132. package/dist/assets/fish-C3X3u_Um.js +1 -0
  133. package/dist/assets/fish-CHNmYvTx.js +1 -0
  134. package/dist/assets/fish-CINwIcGL.js +1 -0
  135. package/dist/assets/fish-CKCwP5Sz.js +1 -0
  136. package/dist/assets/fish-Ced4dgvq.js +1 -0
  137. package/dist/assets/fish-D6OOSln8.js +1 -0
  138. package/dist/assets/fish-DJwLiYgq.js +1 -0
  139. package/dist/assets/fish-DwBQG4yH.js +1 -0
  140. package/dist/assets/fish-LQUQmYvC.js +1 -0
  141. package/dist/assets/fish-kBOqb4Ha.js +1 -0
  142. package/dist/assets/fish-wgI7CssZ.js +1 -0
  143. package/dist/assets/{github-gJJFFYif.js → github-BDR2kCkU.js} +1 -1
  144. package/dist/assets/{google-Cw8hP4bz.js → google-CwDDh-vk.js} +1 -1
  145. package/dist/assets/{help-circle-Dfvo07Ng.js → help-circle-DotBmGEZ.js} +1 -1
  146. package/dist/assets/{id-D-i1S0fL.js → id-DcNcmMh5.js} +1 -1
  147. package/dist/assets/{image-DM3GT_fn.js → image-6KZiAj5m.js} +1 -1
  148. package/dist/assets/{index-CbbUfyeR.js → index-0QeYLqF6.js} +1 -1
  149. package/dist/assets/{index-DZ_0eneF.js → index-53spE6PH.js} +1 -1
  150. package/dist/assets/{index-DmYzMmpZ.js → index-7Wq6eok9.js} +1 -1
  151. package/dist/assets/{index-uim_HWNA.js → index-7vwu7-h2.js} +1 -1
  152. package/dist/assets/{index-hAESLnAe.js → index-ANbBvS2u.js} +1 -1
  153. package/dist/assets/{index-qUrXiTT8.js → index-B9lgV2Px.js} +1 -1
  154. package/dist/assets/{index-B3oq9DXF.js → index-BB62A9YO.js} +1 -1
  155. package/dist/assets/{index-CHmkar7W.js → index-BBE4EsAo.js} +1 -1
  156. package/dist/assets/{index-NWO7ox7u.js → index-BDm37B8L.js} +2 -2
  157. package/dist/assets/{index-CMCbURvj.js → index-BFpFF5b4.js} +1 -1
  158. package/dist/assets/{index-D7IaIK0w.js → index-BIa8vpKQ.js} +1 -1
  159. package/dist/assets/{index-BLB6heXB.js → index-BQb9eFr3.js} +1 -1
  160. package/dist/assets/{index-eG-nVdDk.js → index-BS0S7blg.js} +1 -1
  161. package/dist/assets/{index-BEOL0Xrj.js → index-BWRe-k1F.js} +1 -1
  162. package/dist/assets/{index-CwPjkJs4.js → index-BXfiJl-5.js} +1 -1
  163. package/dist/assets/{index-CBIxq1Mn.js → index-Bd9tfUia.js} +1 -1
  164. package/dist/assets/{index-BQg-qW1C.js → index-Be3obEig.js} +1 -1
  165. package/dist/assets/{index-CrH79zK9.js → index-BhzWIUOm.js} +1 -1
  166. package/dist/assets/{index-BB9Q0vES.js → index-BlTc_2ir.js} +1 -1
  167. package/dist/assets/{index-CEsBfy8P.js → index-BneARKEN.js} +1 -1
  168. package/dist/assets/{index-DXEiBbAN.js → index-BoQerul7.js} +1 -1
  169. package/dist/assets/index-BonzJyME.js +569 -0
  170. package/dist/assets/{index-D1rl1ShF.js → index-BqX0aCBp.js} +1 -1
  171. package/dist/assets/index-Bz_LD8yy.js +1 -0
  172. package/dist/assets/{index-ClwpIr_P.js → index-C1zzFvc3.js} +1 -1
  173. package/dist/assets/{index-Dj0O4JQ-.js → index-C4h5vW0n.js} +1 -1
  174. package/dist/assets/{index-D7LXRPby.js → index-CAXC7Scp.js} +1 -1
  175. package/dist/assets/{index-Cm0SnhY0.js → index-CC6sTfUP.js} +1 -1
  176. package/dist/assets/{index-BzVS_KLU.js → index-CHvhlcId.js} +1 -1
  177. package/dist/assets/{index-zgQkx08I.js → index-CPhn2Dwp.js} +1 -1
  178. package/dist/assets/{index-CfWyJXht.js → index-CSwyYt7-.js} +1 -1
  179. package/dist/assets/{index-DM2bAVRX.js → index-CU0ffLAq.js} +1 -1
  180. package/dist/assets/{index-D4eloMlC.js → index-CVFI4vvI.js} +1 -1
  181. package/dist/assets/{index-DjJwI7Q0.js → index-C_Hf-AgI.js} +1 -1
  182. package/dist/assets/{index-DpPoOWtb.js → index-CcRiqfkR.js} +1 -1
  183. package/dist/assets/{index-BZRCFjq5.js → index-CppSrYer.js} +1 -1
  184. package/dist/assets/{index-BY-fNnkK.js → index-D-pmzsVG.js} +1 -1
  185. package/dist/assets/{index-DcsXEqCx.js → index-D1isen3t.js} +5 -5
  186. package/dist/assets/{index-Kc0m7PO-.js → index-D2acuK2c.js} +1 -1
  187. package/dist/assets/{index-CXsMugBf.js → index-D485Hs15.js} +1 -1
  188. package/dist/assets/index-D6GfL0lA.js +1 -0
  189. package/dist/assets/{index-5b5QT5kF.js → index-DB4TJzBm.js} +1 -1
  190. package/dist/assets/{index-Cd5Ej_f3.js → index-DQX3fRwh.js} +1 -1
  191. package/dist/assets/index-DWKLqN0D.js +1 -0
  192. package/dist/assets/{index-C9eoKJfs.js → index-DZ_TI8d3.js} +1 -1
  193. package/dist/assets/{index-CLR-flkd.js → index-DjXv-wUS.js} +1 -1
  194. package/dist/assets/{index-CX13bdIk.js → index-DmrvMDhU.js} +3 -3
  195. package/dist/assets/{index-CfvQR26y.js → index-DoAk_-kV.js} +1 -1
  196. package/dist/assets/{index-B6W1wPG_.js → index-Dskq5XtI.js} +1 -1
  197. package/dist/assets/{index-ws34Ea3I.js → index-Dy-jF9b7.js} +1 -1
  198. package/dist/assets/{index-BHiGwdGq.js → index-J4Vx91eQ.js} +1 -1
  199. package/dist/assets/{index-CvVK6L7k.js → index-UTJbR3xK.js} +1 -1
  200. package/dist/assets/{index-CiLcyhjJ.js → index-VXZGIk3J.js} +1 -1
  201. package/dist/assets/{index-DFzC0rQH.js → index-_40-2-hT.js} +1 -1
  202. package/dist/assets/{index-DUqJAZYu.js → index-_5ORhCOw.js} +1 -1
  203. package/dist/assets/{index-B9EcsscT.js → index-f_kqtYML.js} +1 -1
  204. package/dist/assets/{index-BqF_vHYf.js → index-s2t7y2Qy.js} +1 -1
  205. package/dist/assets/{index-BHl7APJC.js → index-sUq1pWxn.js} +1 -1
  206. package/dist/assets/{index-CLxhDB-t.js → index-tEGmRC9u.js} +1 -1
  207. package/dist/assets/{index-D3aOatfx.js → index-wrDCHu0d.js} +1 -1
  208. package/dist/assets/{index-Co5T7YKQ.js → index-yWbQt1kK.js} +1 -1
  209. package/dist/assets/{index.browser.esm-ByUOgEo_.js → index.browser.esm-DOKKzozM.js} +1 -1
  210. package/dist/assets/{index.es-DN8G0P37.js → index.es-D1d4x--K.js} +1 -1
  211. package/dist/assets/{info-CXP9N7Ey.js → info-C6M3vnW-.js} +1 -1
  212. package/dist/assets/{info-circle-7IJbskr1.js → info-circle-D7gsOQKY.js} +1 -1
  213. package/dist/assets/{isEqual-DGVdfmbU.js → isEqual-fyvDTHdS.js} +1 -1
  214. package/dist/assets/{isPlainObject-C8-9-V_9.js → isPlainObject-COkUOP0o.js} +1 -1
  215. package/dist/assets/{lightbulb-1OQ0mdcY.js → lightbulb-P81hMYlu.js} +1 -1
  216. package/dist/assets/{mail-DMAMEqQh.js → mail-k8YZQ6Tu.js} +1 -1
  217. package/dist/assets/{midjourney-BwxG0zA1.js → midjourney-CzgYF8_9.js} +1 -1
  218. package/dist/assets/{mobile-WNoGZhDV.js → mobile-BuPguSbs.js} +1 -1
  219. package/dist/assets/{more-CdeUEKOp.js → more-C7U86tIs.js} +1 -1
  220. package/dist/assets/{network-placeholder-DJBWa-A2.js → network-placeholder-BDPcASoY.js} +1 -1
  221. package/dist/assets/{nftPlaceholder-Bo37HhYE.js → nftPlaceholder-DzIa8XKW.js} +1 -1
  222. package/dist/assets/{off-CmfzTxhN.js → off-KkjC1L2f.js} +1 -1
  223. package/dist/assets/{order-BJTgbKYU.js → order-BueoBZAD.js} +1 -1
  224. package/dist/assets/{pagination-BCTFE7Z3.js → pagination-CiIo9YRa.js} +1 -1
  225. package/dist/assets/{play-store-BwwY4IKx.js → play-store-z1UBtvL3.js} +1 -1
  226. package/dist/assets/{plus-BMB1cqqT.js → plus-DWjeHYY3.js} +1 -1
  227. package/dist/assets/{price-7DAsoJmR.js → price-DbDdwH7z.js} +1 -1
  228. package/dist/assets/{producer-Cb73jID1.js → producer-viSiw1-H.js} +1 -1
  229. package/dist/assets/{qr-code-BFxEy5_a.js → qr-code-CO6bv4eI.js} +1 -1
  230. package/dist/assets/{recycle-horizontal-C_bgJwUY.js → recycle-horizontal-BLnrszLK.js} +1 -1
  231. package/dist/assets/{refresh-BCE09s8e.js → refresh-DK5C2Fsg.js} +1 -1
  232. package/dist/assets/{reown-logo-DQp_r0An.js → reown-logo-DD2bQVXl.js} +1 -1
  233. package/dist/assets/{search-BUoFuygq.js → search-NTiLpgOe.js} +1 -1
  234. package/dist/assets/{secp256k1-XjfkD12g.js → secp256k1-BHT2ASkx.js} +1 -1
  235. package/dist/assets/{secp256k1-QHTbOsJo.js → secp256k1-DLJTKwjX.js} +1 -1
  236. package/dist/assets/{seedream-CN1BaFH-.js → seedream-CvzPM3Yy.js} +1 -1
  237. package/dist/assets/{send-BZ_FRT-x.js → send-7LBxvdA8.js} +1 -1
  238. package/dist/assets/{service-D9QPLvru.js → service-B8Qb31KF.js} +1 -1
  239. package/dist/assets/site-B-8e6I5W.js +1 -0
  240. package/dist/assets/site-BMUK2PL2.js +1 -0
  241. package/dist/assets/site-BPeP2kM-.js +1 -0
  242. package/dist/assets/site-BRlb3pjg.js +1 -0
  243. package/dist/assets/site-BTD-mvJx.js +1 -0
  244. package/dist/assets/site-BWedp3OP.js +1 -0
  245. package/dist/assets/site-Bd2sojzk.js +1 -0
  246. package/dist/assets/site-Bf3KomW-.js +1 -0
  247. package/dist/assets/site-Cb1HCVnB.js +1 -0
  248. package/dist/assets/site-Cge8In6n.js +1 -0
  249. package/dist/assets/site-D2yZ_tXS.js +1 -0
  250. package/dist/assets/site-DFdrTIiw.js +1 -0
  251. package/dist/assets/site-DYwfh1Q4.js +1 -0
  252. package/dist/assets/site-Dd3DH1QM.js +1 -0
  253. package/dist/assets/site-DtoVVRPg.js +1 -0
  254. package/dist/assets/site-Vv2_sikp.js +1 -0
  255. package/dist/assets/site-gmn4WLwi.js +1 -0
  256. package/dist/assets/site-mcJQRpY3.js +1 -0
  257. package/dist/assets/{solana-wallets-C0MIh7dX.js → solana-wallets-DR78dCmC.js} +2 -2
  258. package/dist/assets/{solana-wallets-vue-D5nyZmND.js → solana-wallets-vue-N5ACQ0MW.js} +1 -1
  259. package/dist/assets/{suno-dLVdLz6A.js → suno-PR4kjs17.js} +1 -1
  260. package/dist/assets/{swapHorizontal-DjVLKsq6.js → swapHorizontal-DD3y6jnd.js} +1 -1
  261. package/dist/assets/{swapHorizontalBold-CpmWZfom.js → swapHorizontalBold-BLpa4fyO.js} +1 -1
  262. package/dist/assets/{swapHorizontalMedium-DIHCVdP3.js → swapHorizontalMedium-oF_5PifC.js} +1 -1
  263. package/dist/assets/{swapHorizontalRoundedBold-Bn16xTyV.js → swapHorizontalRoundedBold-BmP3mHVl.js} +1 -1
  264. package/dist/assets/{swapVertical-D3FvZJb6.js → swapVertical-DvlN019V.js} +1 -1
  265. package/dist/assets/{telegram-C_PlgbOP.js → telegram-D0HV41lS.js} +1 -1
  266. package/dist/assets/{three-dots-lu6K3YVM.js → three-dots-B3P3hsa_.js} +1 -1
  267. package/dist/assets/{twitch-CZLL61zT.js → twitch-BVoxRTqH.js} +1 -1
  268. package/dist/assets/{twitterIcon-Due6Eiu4.js → twitterIcon-BsDUbk4n.js} +1 -1
  269. package/dist/assets/{typescript-COFNajQU.js → typescript-B67FgeWW.js} +1 -1
  270. package/dist/assets/{use-form-item-BKB_7n3g.js → use-form-item-DfSAVesz.js} +1 -1
  271. package/dist/assets/validator-S2WfxBBQ.js +1 -0
  272. package/dist/assets/{verify-CewIogRr.js → verify-Bv0pjmOz.js} +1 -1
  273. package/dist/assets/{verify-filled-DBIhvgaD.js → verify-filled-DiPNfR5J.js} +1 -1
  274. package/dist/assets/{w3m-modal-DAUMYSwf.js → w3m-modal-ByM79-fS.js} +1 -1
  275. package/dist/assets/{wallet-DFzSwL2i.js → wallet-Bg8v_INb.js} +1 -1
  276. package/dist/assets/{wallet-placeholder-BQA1DTjB.js → wallet-placeholder-D8DwheoQ.js} +1 -1
  277. package/dist/assets/{walletconnect-Cl4FGvYO.js → walletconnect-YTSTEkGO.js} +1 -1
  278. package/dist/assets/{warning-circle-BOMPFMKZ.js → warning-circle-CwVXhJTZ.js} +1 -1
  279. package/dist/assets/{web-B0QX44uP.js → web-_gMqmQBm.js} +1 -1
  280. package/dist/assets/{web-Dw69BXzS.js → web-yiaDDDuJ.js} +1 -1
  281. package/dist/assets/{x-C7_XWmru.js → x-PXfI_VRh.js} +1 -1
  282. package/dist/index.html +1 -1
  283. package/package.json +1 -1
  284. package/dist/assets/Console-C4D3R1ck.js +0 -1
  285. package/dist/assets/Index-BALZObRM.js +0 -1
  286. package/dist/assets/Index-CwiBhoSK.js +0 -1
  287. package/dist/assets/Index-DJYDOhcQ.css +0 -1
  288. package/dist/assets/Main-bqIl_fwV.js +0 -1
  289. package/dist/assets/Pagination-DRjlL_dM.js +0 -1
  290. package/dist/assets/_baseIteratee-Bw61Z4Wx.js +0 -1
  291. package/dist/assets/_initCloneObject-DuLU5kHr.js +0 -1
  292. package/dist/assets/debounce-Bt9MZ6bV.js +0 -1
  293. package/dist/assets/index-CnhjD_2F.js +0 -569
  294. package/dist/assets/index-DPq9Ww9N.js +0 -1
  295. package/dist/assets/index-Du2B_Wxi.js +0 -1
  296. package/dist/assets/site-32xqa8D1.js +0 -1
  297. package/dist/assets/site-B6K2wQw2.js +0 -1
  298. package/dist/assets/site-BNAGeLSA.js +0 -1
  299. package/dist/assets/site-Bc5FP2g4.js +0 -1
  300. package/dist/assets/site-BksYe8zG.js +0 -1
  301. package/dist/assets/site-BoIRoW0R.js +0 -1
  302. package/dist/assets/site-BomDhdA3.js +0 -1
  303. package/dist/assets/site-CGAQ8fyu.js +0 -1
  304. package/dist/assets/site-CGMsKH_s.js +0 -1
  305. package/dist/assets/site-CQ28HgTP.js +0 -1
  306. package/dist/assets/site-CdJ6hra8.js +0 -1
  307. package/dist/assets/site-D7iSTGkd.js +0 -1
  308. package/dist/assets/site-DAcOAgTN.js +0 -1
  309. package/dist/assets/site-DNO6KJ_b.js +0 -1
  310. package/dist/assets/site-Dx1Lohv0.js +0 -1
  311. package/dist/assets/site-bDFEfUro.js +0 -1
  312. package/dist/assets/site-dr1K_Xa9.js +0 -1
  313. package/dist/assets/site-jLy6owC7.js +0 -1
  314. package/dist/assets/validator-QEfhhC-Q.js +0 -1
@@ -1 +1 @@
1
- import{F as E}from"./index.es-DN8G0P37.js";import{E as L}from"./index-CwPjkJs4.js";import{E as re}from"./index-B6W1wPG_.js";import{d as b,H as m,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as C,O as V,N as T,Q as U,J as v,R as ve,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bj as G,ag as ye,H as we,co as ee,aF as te,S as oe,cp as Ce}from"./index-CnhjD_2F.js";import{b as Se,c as ne,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-DFzC0rQH.js";import{E as q}from"./index-D7IaIK0w.js";import{E as S}from"./index-D1rl1ShF.js";import{I,S as Ee,l as Le}from"./pagination-BCTFE7Z3.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-CJP-yB4D.js";import{E as W}from"./index-ClwpIr_P.js";import{E as O}from"./index-Kc0m7PO-.js";import{C as ce}from"./Consumption-tJVE5oXO.js";import{E as de}from"./index-ws34Ea3I.js";import{E as me}from"./index-BHiGwdGq.js";import{E as ue}from"./index-CLxhDB-t.js";import{P as Me,N as Re}from"./NoTasks-gaaOL_m7.js";import{E as pe}from"./index-D7LXRPby.js";import{a as ge}from"./price-7DAsoJmR.js";import{F as Ue}from"./FilePreview-19tiWMqq.js";import{E as De,a as Ae}from"./index-CiLcyhjJ.js";import{E as Pe,a as Ge}from"./index-BqF_vHYf.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-BthEHufq.js";import{V as Oe}from"./VideoPlayer-Dn-EFbop.js";import{E as je}from"./index-CbbUfyeR.js";import{E as Ne}from"./index-CrH79zK9.js";import{B as Be}from"./BotPlaceholder-BZTrMT1c.js";import"./use-form-item-BKB_7n3g.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-DmYzMmpZ.js";import"./typescript-COFNajQU.js";import"./index-DPq9Ww9N.js";import"./strings-beZM2Y-f.js";import"./isEqual-DGVdfmbU.js";import"./_Uint8Array-BnVWNeHp.js";import"./castArray-CB5VORGs.js";import"./debounce-Bt9MZ6bV.js";import"./_baseIteratee-Bw61Z4Wx.js";import"./index-D4eloMlC.js";import"./validator-QEfhhC-Q.js";import"./index-CLR-flkd.js";import"./_baseClone-Q0okPItx.js";import"./_initCloneObject-DuLU5kHr.js";import"./index-Cu41y2Fl.js";import"./index-qUrXiTT8.js";import"./isPlainObject-C8-9-V_9.js";import"./vue-plyr-BO2nlN4c.js";import"./index-uim_HWNA.js";const ze=b({name:"LayoutKling",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={class:"main flex flex-row flex-1 min-h-0"},qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[N(e.$slots,"config",{},void 0,!0)]),i("div",He,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-be4bb0df"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function J(e,t,s){const a=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Q(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=J(s,a,u),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function Y(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{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-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,model:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),C(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,f=>(l(),C(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},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 F.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(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,mode:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),m("span",it,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),rt=[3,5,8,10,12,15],ct=[5,10],dt=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?rt:ct},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,duration:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),mt={class:"field"},ut={class:"control"},pt={class:"label"},gt={class:"title font-bold"};function ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",mt,[i("div",ut,[i("div",pt,[i("h2",gt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.allowedDurations,c=>(l(),C(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ht=y(dt,[["render",ft],["__scopeId","data-v-5ae55e28"]]),_t=b({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||(this.value=Ve)}}),$t={class:"text-sm font-bold mb-2 block"},kt={class:"items"},vt=["onClick"],bt={class:"name"};function yt(e,t,s,a,u,$){return l(),m("div",null,[i("span",$t,r(e.$t("kling.name.ratio")),1),i("div",kt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",bt,r(d.label),1)],10,vt))),128))])])}const wt=y(_t,[["render",yt],["__scopeId","data-v-cdb14b2f"]]),Ct=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/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(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),St={class:"relative"},Vt={class:"flex justify-between"},It={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Et(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",St,[i("div",Vt,[i("div",It,[i("span",Tt,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const Lt=y(Ct,[["render",Et],["__scopeId","data-v-68cf38f5"]]),Mt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:I,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/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 J(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||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(S.warning(this.$t("kling.message.endImageRequiresStart")),!1):(S.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Rt={class:"relative"},Ut={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},At={class:"text-sm font-bold"};function Pt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",Rt,[i("div",Ut,[i("div",Dt,[i("span",At,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$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"])])}const Gt=y(Mt,[["render",Pt],["__scopeId","data-v-593c3bde"]]),Kt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:I,ElInputNumber:de},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||(this.value=Ie)}}),Ot={class:"flex justify-between"},jt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},Bt={class:"flex justify-end items-center"},zt={class:"w-full"};function Ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Ot,[i("div",jt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Bt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",zt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const qt=y(Kt,[["render",Ft]]),Ht=b({name:"GenerateAudioSelector",components:{ElSwitch:ue,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Te:!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})}}}),Wt={class:"relative"},Jt={class:"flex justify-between items-center"},Qt={class:"flex justify-start items-center"},Yt={class:"text-sm font-bold"};function Xt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Wt,[i("div",Jt,[i("div",Qt,[i("span",Yt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Zt=y(Ht,[["render",Xt]]),xt=["horizontal","vertical","pan","tilt","roll","zoom"],eo=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:de,InfoIcon:I},data(){return{configKeys:xt}},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 J(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){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="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){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),to={class:"field"},oo={class:"header"},no={class:"text-sm font-bold"},so={key:0,class:"config-grid"},io={class:"cfg-row-head"},lo={class:"cfg-name"};function ao(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",to,[i("div",oo,[i("span",no,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(V,null,T(e.typeOptions,g=>(l(),C(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",so,[(l(!0),m(V,null,T(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",io,[i("span",lo,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const ro=y(eo,[["render",ao],["__scopeId","data-v-cd896060"]]),fe=[{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"]}],B=", ";function co(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const mo=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),uo={key:0,class:"pills",role:"list"},po={class:"pill-text"},go=["aria-label","onClick"];function fo(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",uo,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",po,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,go)]))),128))])):v("",!0)}const ho=y(mo,[["render",fo],["__scopeId","data-v-5fc4fa65"]]),_o="",$o=b({name:"PromptInput",components:{ElButton:L,FontAwesomeIcon:E,PromptTextarea:Me,InspirationPills:ho},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||(this.prompt=_o)}});function ko(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("inspiration-pills"),c=o("prompt-textarea");return l(),C(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:h(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:h(()=>[n(f)]),_:1},8,["modelValue","title","info","placeholder"])}const vo=y($o,[["render",ko],["__scopeId","data-v-c01fc1a6"]]),bo="",yo=b({name:"NegativePromptInput",components:{ElInput:pe,InfoIcon:I},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||(this.prompt=bo)}}),wo={class:"field"},Co={class:"box"},So={class:"title font-bold"};function Vo(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",wo,[i("div",Co,[i("h2",So,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Io=y(yo,[["render",Vo],["__scopeId","data-v-de98cf01"]]),To=b({name:"InspirationDrawer",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(t=>this.$t(`kling.inspiration.chip.${t}`)))},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(z(this.prompt,e)):this.setPrompt(co(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Eo={class:"drawer-content"},Lo={class:"drawer-header"},Mo={class:"title-row"},Ro={class:"title"},Uo={class:"hint"},Do={key:0,class:"selected-bar"},Ao={class:"selected-text"},Po={class:"groups"},Go={class:"group-title"},Ko={class:"chip-grid"},Oo=["onClick"];function jo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),C(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Eo,[i("div",Lo,[i("div",Mo,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ro,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Uo,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Ao,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",Po,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Go,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Ko,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:g=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,Oo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(To,[["render",jo],["__scopeId","data-v-7d457a69"]]),Bo={"kling-v3":"v3","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-video-o1":"Video-o1"},zo={std:"720p",pro:"1080p","4k":"4K"},Fo=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Bo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return zo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),qo={class:"summary-chip"},Ho=["title"],Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"];function Xo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Ho),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Wo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Jo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Qo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Yo)):v("",!0)])}const Zo=y(Fo,[["render",Xo],["__scopeId","data-v-418a6733"]]),xo=b({name:"ConfigPanel",components:{ElButton:L,Consumption:ce,FontAwesomeIcon:E,PromptInput:vo,NegativePromptInput:Io,ModelSelector:et,ModeSelector:at,DurationSelector:ht,RatioSelector:wt,StartImage:Lt,CfgScaleSelector:qt,GenerateAudioSelector:Zt,CameraControlSelector:ro,InspirationDrawer:No,SummaryChip:Zo,EndImage:Gt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),en={class:"flex flex-col h-full"},tn={class:"flex-1 overflow-y-auto p-5"},on={class:"flex flex-col items-center justify-center px-5 pb-5"};function nn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),k=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),X=o("font-awesome-icon"),Z=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",en,[i("div",tn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=x=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",on,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),C(Z,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(Z,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ke,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=x=>e.inspirationOpen=x)},null,8,["modelValue"])])}const sn=y(xo,[["render",nn]]),ln=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/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(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),an={class:"relative"},rn={class:"flex justify-between"},cn={class:"flex justify-start items-center"},dn={class:"text-sm font-bold"};function mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",an,[i("div",rn,[i("div",cn,[i("span",dn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),C(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const un=y(ln,[["render",mn],["__scopeId","data-v-37d42da7"]]),pn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:I,FilePreview:Ue,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/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(){S.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){S.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){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(S.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(S.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),gn={class:"relative"},fn={class:"flex justify-between"},hn={class:"flex justify-start items-center"},_n={class:"text-sm font-bold"};function $n(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",gn,[i("div",fn,[i("div",hn,[i("span",_n,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),C(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const kn=y(pn,[["render",$n],["__scopeId","data-v-5cf93212"]]),vn=b({name:"MotionPromptInput",components:{ElInput:pe,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),bn={class:"field"},yn={class:"box"},wn={class:"title font-bold"};function Cn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",bn,[i("div",yn,[i("h2",wn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Sn=y(vn,[["render",Cn],["__scopeId","data-v-ca9fdbe5"]]),ie="video",Vn=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:De,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||ie},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=ie)}}),In={class:"field"},Tn={class:"header"},En={class:"text-sm font-bold"};function Ln(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",In,[i("div",Tn,[i("span",En,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Mn=y(Vn,[["render",Ln],["__scopeId","data-v-7a91195b"]]),le="std",Rn=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},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||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=le)}}),Un={class:"field"},Dn={class:"header"},An={class:"title font-bold"};function Pn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Un,[i("div",Dn,[i("h2",An,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Gn=y(Rn,[["render",Pn],["__scopeId","data-v-1295688c"]]),Kn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ue,InfoIcon:I},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"})}}}}),On={class:"relative"},jn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},Bn={class:"text-sm font-bold"};function zn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",On,[i("div",jn,[i("div",Nn,[i("span",Bn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Fn=y(Kn,[["render",zn]]),qn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:ce,MotionImage:un,MotionVideo:kn,MotionPromptInput:Sn,CharacterOrientationSelector:Mn,MotionModeSelector:Gn,KeepOriginalSoundSelector:Fn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Hn={class:"flex flex-col h-full"},Wn={class:"flex-1 overflow-y-auto p-5"},Jn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Qn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),m("div",Hn,[i("div",Wn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Jn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Yn=y(qn,[["render",Qn]]),Xn=b({name:"KlingTabSwitcher",components:{ElTabs:Ge,ElTabPane:Pe,ElTag:we},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")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),Zn=["title"],xn={class:"text"};function es(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),C(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",xn,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,Zn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ts=y(Xn,[["render",es],["__scopeId","data-v-bf00c27e"]]),os=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:E,ElAlert:je,VideoPlayer:Oe,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ns={class:"preview"},ss={class:"left"},is={class:"main"},ls={class:"bot"},as={class:"datetime"},rs={class:"info"},cs={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ds={key:1,class:"prompt mt-2"},ms={key:0},us={key:1},ps={key:0,class:U({content:!0,failed:!0})},gs={key:0,class:"mb-4"},fs={key:1,class:U({operations:!0,"mt-2":!0})},hs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ks={key:1,class:U({content:!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Cs={key:2,class:U({content:!0})},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Is(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),k=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",ns,[i("div",ss,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",is,[i("div",ls,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",as,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",rs,[e.referenceImages.length>0?(l(),m("div",cs,[(l(!0),m(V,null,T(e.referenceImages,(R,j)=>(l(),C(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ds,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",ms," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",us," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",ps,[e.modelValue?.response.video_url?(l(),m("div",gs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",fs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),C(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"])])):v("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",hs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",_s,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",$s,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(l(),m("div",ks,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",bs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ys,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(l(),m("p",ws,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Cs,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ss,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Ts=y(os,[["render",Is],["__scopeId","data-v-e8e87659"]]),Es=b({name:"RecentPanel",components:{TaskPreview:Ts,NoTasks:Re,BotPlaceholder:Be,ScrollList:Ee},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?.()}}}),Ls={key:0},Ms={key:2,class:"w-full h-full flex items-center justify-center"};function Rs(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ls,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(V,null,T(e.tasks?.items,k=>(l(),C(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(l(),m("div",Ms,[n(c)])):v("",!0)],64)}const Us=y(Es,[["render",Rs]]),ae=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:sn,MotionPanel:Yn,TabSwitcher:ts,Layout:Je,RecentPanel:Us},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Le({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();const 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);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:ae};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){S.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},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(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){S.warning(this.$t("kling.message.motionMissingInputs"));return}const 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.prompt?{prompt:e.prompt}:{},callback_url:ae},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),As={class:"flex flex-col h-full"},Ps={class:"flex-1 min-h-0"};function Gs(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:h(()=>[i("div",As,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ps,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ki=y(Ds,[["render",Gs]]);export{Ki as default};
1
+ import{F as E}from"./index.es-D1d4x--K.js";import{E as L}from"./index-BXfiJl-5.js";import{E as re}from"./index-Dskq5XtI.js";import{d as b,H as m,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as C,O as V,N as T,Q as U,J as v,R as ve,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bl as G,ag as ye,H as we,cm as ee,aF as te,S as oe,cn as Ce}from"./index-BonzJyME.js";import{b as Se,c as ne,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-_40-2-hT.js";import{E as q}from"./index-BIa8vpKQ.js";import{E as S}from"./index-BqX0aCBp.js";import{I,S as Ee,l as Le}from"./pagination-CiIo9YRa.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-DVwsT7Lz.js";import{E as W}from"./index-C1zzFvc3.js";import{E as O}from"./index-D2acuK2c.js";import{C as ce}from"./Consumption-Dsn_n1Kk.js";import{E as de}from"./index-Dy-jF9b7.js";import{E as me}from"./index-J4Vx91eQ.js";import{E as ue}from"./index-tEGmRC9u.js";import{P as Me,N as Re}from"./NoTasks-CGjq4fYU.js";import{E as pe}from"./index-CAXC7Scp.js";import{a as ge}from"./price-DbDdwH7z.js";import{F as Ue}from"./FilePreview-BFg3psGh.js";import{E as De,a as Ae}from"./index-VXZGIk3J.js";import{E as Pe,a as Ge}from"./index-s2t7y2Qy.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-0ZGF0U2F.js";import{V as Oe}from"./VideoPlayer-BU0R8j6Z.js";import{E as je}from"./index-0QeYLqF6.js";import{E as Ne}from"./index-BhzWIUOm.js";import{B as Be}from"./BotPlaceholder-HRgLuF4Q.js";import"./use-form-item-DfSAVesz.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-7Wq6eok9.js";import"./typescript-B67FgeWW.js";import"./index-D6GfL0lA.js";import"./strings-beZM2Y-f.js";import"./isEqual-fyvDTHdS.js";import"./_Uint8Array-DtjvDkU6.js";import"./castArray-CkmeLXWc.js";import"./debounce-Cyq2y_q-.js";import"./_baseIteratee-DC5oli-s.js";import"./index-CVFI4vvI.js";import"./validator-S2WfxBBQ.js";import"./index-DjXv-wUS.js";import"./_baseClone-Ci28Kv2t.js";import"./_initCloneObject-BIgCXgf6.js";import"./index-Cu41y2Fl.js";import"./index-B9lgV2Px.js";import"./isPlainObject-COkUOP0o.js";import"./vue-plyr-BO2nlN4c.js";import"./index-7vwu7-h2.js";const ze=b({name:"LayoutKling",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={class:"main flex flex-row flex-1 min-h-0"},qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[N(e.$slots,"config",{},void 0,!0)]),i("div",He,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-be4bb0df"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function J(e,t,s){const a=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Q(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=J(s,a,u),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function Y(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{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-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,model:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),C(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,f=>(l(),C(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},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 F.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(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,mode:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),m("span",it,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),rt=[3,5,8,10,12,15],ct=[5,10],dt=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?rt:ct},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,duration:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),mt={class:"field"},ut={class:"control"},pt={class:"label"},gt={class:"title font-bold"};function ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",mt,[i("div",ut,[i("div",pt,[i("h2",gt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.allowedDurations,c=>(l(),C(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ht=y(dt,[["render",ft],["__scopeId","data-v-5ae55e28"]]),_t=b({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||(this.value=Ve)}}),$t={class:"text-sm font-bold mb-2 block"},kt={class:"items"},vt=["onClick"],bt={class:"name"};function yt(e,t,s,a,u,$){return l(),m("div",null,[i("span",$t,r(e.$t("kling.name.ratio")),1),i("div",kt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",bt,r(d.label),1)],10,vt))),128))])])}const wt=y(_t,[["render",yt],["__scopeId","data-v-cdb14b2f"]]),Ct=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/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(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),St={class:"relative"},Vt={class:"flex justify-between"},It={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Et(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",St,[i("div",Vt,[i("div",It,[i("span",Tt,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const Lt=y(Ct,[["render",Et],["__scopeId","data-v-68cf38f5"]]),Mt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:I,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/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 J(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||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(S.warning(this.$t("kling.message.endImageRequiresStart")),!1):(S.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Rt={class:"relative"},Ut={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},At={class:"text-sm font-bold"};function Pt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",Rt,[i("div",Ut,[i("div",Dt,[i("span",At,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$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"])])}const Gt=y(Mt,[["render",Pt],["__scopeId","data-v-593c3bde"]]),Kt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:I,ElInputNumber:de},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||(this.value=Ie)}}),Ot={class:"flex justify-between"},jt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},Bt={class:"flex justify-end items-center"},zt={class:"w-full"};function Ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Ot,[i("div",jt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Bt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",zt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const qt=y(Kt,[["render",Ft]]),Ht=b({name:"GenerateAudioSelector",components:{ElSwitch:ue,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Te:!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})}}}),Wt={class:"relative"},Jt={class:"flex justify-between items-center"},Qt={class:"flex justify-start items-center"},Yt={class:"text-sm font-bold"};function Xt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Wt,[i("div",Jt,[i("div",Qt,[i("span",Yt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Zt=y(Ht,[["render",Xt]]),xt=["horizontal","vertical","pan","tilt","roll","zoom"],eo=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:de,InfoIcon:I},data(){return{configKeys:xt}},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 J(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){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="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){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),to={class:"field"},oo={class:"header"},no={class:"text-sm font-bold"},so={key:0,class:"config-grid"},io={class:"cfg-row-head"},lo={class:"cfg-name"};function ao(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",to,[i("div",oo,[i("span",no,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(V,null,T(e.typeOptions,g=>(l(),C(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",so,[(l(!0),m(V,null,T(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",io,[i("span",lo,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const ro=y(eo,[["render",ao],["__scopeId","data-v-cd896060"]]),fe=[{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"]}],B=", ";function co(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const mo=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),uo={key:0,class:"pills",role:"list"},po={class:"pill-text"},go=["aria-label","onClick"];function fo(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",uo,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",po,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,go)]))),128))])):v("",!0)}const ho=y(mo,[["render",fo],["__scopeId","data-v-5fc4fa65"]]),_o="",$o=b({name:"PromptInput",components:{ElButton:L,FontAwesomeIcon:E,PromptTextarea:Me,InspirationPills:ho},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||(this.prompt=_o)}});function ko(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("inspiration-pills"),c=o("prompt-textarea");return l(),C(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:h(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:h(()=>[n(f)]),_:1},8,["modelValue","title","info","placeholder"])}const vo=y($o,[["render",ko],["__scopeId","data-v-c01fc1a6"]]),bo="",yo=b({name:"NegativePromptInput",components:{ElInput:pe,InfoIcon:I},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||(this.prompt=bo)}}),wo={class:"field"},Co={class:"box"},So={class:"title font-bold"};function Vo(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",wo,[i("div",Co,[i("h2",So,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Io=y(yo,[["render",Vo],["__scopeId","data-v-de98cf01"]]),To=b({name:"InspirationDrawer",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(t=>this.$t(`kling.inspiration.chip.${t}`)))},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(z(this.prompt,e)):this.setPrompt(co(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Eo={class:"drawer-content"},Lo={class:"drawer-header"},Mo={class:"title-row"},Ro={class:"title"},Uo={class:"hint"},Do={key:0,class:"selected-bar"},Ao={class:"selected-text"},Po={class:"groups"},Go={class:"group-title"},Ko={class:"chip-grid"},Oo=["onClick"];function jo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),C(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Eo,[i("div",Lo,[i("div",Mo,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ro,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Uo,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Ao,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",Po,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Go,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Ko,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:g=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,Oo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(To,[["render",jo],["__scopeId","data-v-7d457a69"]]),Bo={"kling-v3":"v3","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-video-o1":"Video-o1"},zo={std:"720p",pro:"1080p","4k":"4K"},Fo=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Bo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return zo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),qo={class:"summary-chip"},Ho=["title"],Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"];function Xo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Ho),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Wo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Jo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Qo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Yo)):v("",!0)])}const Zo=y(Fo,[["render",Xo],["__scopeId","data-v-418a6733"]]),xo=b({name:"ConfigPanel",components:{ElButton:L,Consumption:ce,FontAwesomeIcon:E,PromptInput:vo,NegativePromptInput:Io,ModelSelector:et,ModeSelector:at,DurationSelector:ht,RatioSelector:wt,StartImage:Lt,CfgScaleSelector:qt,GenerateAudioSelector:Zt,CameraControlSelector:ro,InspirationDrawer:No,SummaryChip:Zo,EndImage:Gt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),en={class:"flex flex-col h-full"},tn={class:"flex-1 overflow-y-auto p-5"},on={class:"flex flex-col items-center justify-center px-5 pb-5"};function nn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),k=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),X=o("font-awesome-icon"),Z=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",en,[i("div",tn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=x=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",on,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),C(Z,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(Z,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ke,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=x=>e.inspirationOpen=x)},null,8,["modelValue"])])}const sn=y(xo,[["render",nn]]),ln=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/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(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),an={class:"relative"},rn={class:"flex justify-between"},cn={class:"flex justify-start items-center"},dn={class:"text-sm font-bold"};function mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",an,[i("div",rn,[i("div",cn,[i("span",dn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),C(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const un=y(ln,[["render",mn],["__scopeId","data-v-37d42da7"]]),pn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:I,FilePreview:Ue,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/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(){S.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){S.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){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(S.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(S.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),gn={class:"relative"},fn={class:"flex justify-between"},hn={class:"flex justify-start items-center"},_n={class:"text-sm font-bold"};function $n(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",gn,[i("div",fn,[i("div",hn,[i("span",_n,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),C(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const kn=y(pn,[["render",$n],["__scopeId","data-v-5cf93212"]]),vn=b({name:"MotionPromptInput",components:{ElInput:pe,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),bn={class:"field"},yn={class:"box"},wn={class:"title font-bold"};function Cn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",bn,[i("div",yn,[i("h2",wn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Sn=y(vn,[["render",Cn],["__scopeId","data-v-ca9fdbe5"]]),ie="video",Vn=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:De,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||ie},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=ie)}}),In={class:"field"},Tn={class:"header"},En={class:"text-sm font-bold"};function Ln(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",In,[i("div",Tn,[i("span",En,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Mn=y(Vn,[["render",Ln],["__scopeId","data-v-7a91195b"]]),le="std",Rn=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},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||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=le)}}),Un={class:"field"},Dn={class:"header"},An={class:"title font-bold"};function Pn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Un,[i("div",Dn,[i("h2",An,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Gn=y(Rn,[["render",Pn],["__scopeId","data-v-1295688c"]]),Kn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ue,InfoIcon:I},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"})}}}}),On={class:"relative"},jn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},Bn={class:"text-sm font-bold"};function zn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",On,[i("div",jn,[i("div",Nn,[i("span",Bn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Fn=y(Kn,[["render",zn]]),qn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:ce,MotionImage:un,MotionVideo:kn,MotionPromptInput:Sn,CharacterOrientationSelector:Mn,MotionModeSelector:Gn,KeepOriginalSoundSelector:Fn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Hn={class:"flex flex-col h-full"},Wn={class:"flex-1 overflow-y-auto p-5"},Jn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Qn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),m("div",Hn,[i("div",Wn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Jn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Yn=y(qn,[["render",Qn]]),Xn=b({name:"KlingTabSwitcher",components:{ElTabs:Ge,ElTabPane:Pe,ElTag:we},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")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),Zn=["title"],xn={class:"text"};function es(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),C(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",xn,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,Zn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ts=y(Xn,[["render",es],["__scopeId","data-v-bf00c27e"]]),os=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:E,ElAlert:je,VideoPlayer:Oe,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ns={class:"preview"},ss={class:"left"},is={class:"main"},ls={class:"bot"},as={class:"datetime"},rs={class:"info"},cs={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ds={key:1,class:"prompt mt-2"},ms={key:0},us={key:1},ps={key:0,class:U({content:!0,failed:!0})},gs={key:0,class:"mb-4"},fs={key:1,class:U({operations:!0,"mt-2":!0})},hs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ks={key:1,class:U({content:!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Cs={key:2,class:U({content:!0})},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Is(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),k=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",ns,[i("div",ss,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",is,[i("div",ls,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",as,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",rs,[e.referenceImages.length>0?(l(),m("div",cs,[(l(!0),m(V,null,T(e.referenceImages,(R,j)=>(l(),C(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ds,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",ms," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",us," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",ps,[e.modelValue?.response.video_url?(l(),m("div",gs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",fs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),C(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"])])):v("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",hs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",_s,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",$s,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(l(),m("div",ks,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",bs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ys,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(l(),m("p",ws,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Cs,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ss,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Ts=y(os,[["render",Is],["__scopeId","data-v-e8e87659"]]),Es=b({name:"RecentPanel",components:{TaskPreview:Ts,NoTasks:Re,BotPlaceholder:Be,ScrollList:Ee},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?.()}}}),Ls={key:0},Ms={key:2,class:"w-full h-full flex items-center justify-center"};function Rs(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ls,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(V,null,T(e.tasks?.items,k=>(l(),C(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(l(),m("div",Ms,[n(c)])):v("",!0)],64)}const Us=y(Es,[["render",Rs]]),ae=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:sn,MotionPanel:Yn,TabSwitcher:ts,Layout:Je,RecentPanel:Us},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Le({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();const 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);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:ae};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){S.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},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(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){S.warning(this.$t("kling.message.motionMissingInputs"));return}const 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.prompt?{prompt:e.prompt}:{},callback_url:ae},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),As={class:"flex flex-col h-full"},Ps={class:"flex-1 min-h-0"};function Gs(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:h(()=>[i("div",As,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ps,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ki=y(Ds,[["render",Gs]]);export{Ki as default};