@acedatacloud/nexior 3.166.0 → 3.167.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 (231) hide show
  1. package/dist/assets/{Auth-DFRTIldg.js → Auth-BYDwGwaF.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-BLqNsw9k.js → BotPlaceholder-BqeR06y3.js} +1 -1
  3. package/dist/assets/{Callback-CHgC-5ER.js → Callback--SyBMjm7.js} +1 -1
  4. package/dist/assets/{Console-BUhuv8r2.js → Console-WixW6BSu.js} +1 -1
  5. package/dist/assets/{Consumption-D9Hn2ImE.js → Consumption-CL3WRYVN.js} +1 -1
  6. package/dist/assets/{Conversation-CT5b219A.js → Conversation-Brvaxxml.js} +1 -1
  7. package/dist/assets/{CopyToClipboard-YKue_6LC.js → CopyToClipboard-TC6O9s7V.js} +1 -1
  8. package/dist/assets/{Detail-DJ3K4Lui.js → Detail-oRAPiSXy.js} +2 -2
  9. package/dist/assets/{EditArray-D9X7ilzT.js → EditArray-Cr1IK11e.js} +1 -1
  10. package/dist/assets/{Extra-tNEhYDVR.js → Extra-9TZNXkOm.js} +1 -1
  11. package/dist/assets/{FilePreview-BLBZCIvI.js → FilePreview-BHbzMFA3.js} +1 -1
  12. package/dist/assets/{History-BsiIeeU2.js → History-DArAVdnl.js} +1 -1
  13. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-rN4yfqRq.js → IconPark.vue_vue_type_script_setup_true_lang-VGkf-8vn.js} +1 -1
  14. package/dist/assets/{ImagePreview-CUOTVDKq.js → ImagePreview-CATcaSwT.js} +1 -1
  15. package/dist/assets/{ImageWrapper-BTYsRpEP.js → ImageWrapper-C-2wIJYB.js} +1 -1
  16. package/dist/assets/{Index-B-AW-gIW.js → Index-6O25pgqo.js} +1 -1
  17. package/dist/assets/{Index-cV8Yyo9p.js → Index-BGjqeGFj.js} +1 -1
  18. package/dist/assets/{Index-DvgaohNO.js → Index-BKgJVlqc.js} +1 -1
  19. package/dist/assets/{Index-Dcwar_I_.js → Index-BQL51iA5.js} +1 -1
  20. package/dist/assets/{Index-D4OExIA4.js → Index-BQQpmfdB.js} +1 -1
  21. package/dist/assets/{Index-SD4zKg1q.js → Index-BUxrI5H9.js} +1 -1
  22. package/dist/assets/{Index-HvXcS5Be.js → Index-BZkdecyf.js} +1 -1
  23. package/dist/assets/{Index-BAEdyQeV.js → Index-Ba9ChGUK.js} +1 -1
  24. package/dist/assets/{Index-CBA8zIuN.js → Index-BmLW9xeN.js} +1 -1
  25. package/dist/assets/{Index-DWjSghj6.js → Index-Bvrq7JLb.js} +1 -1
  26. package/dist/assets/{Index-C6BwOZ3w.js → Index-C01475yx.js} +1 -1
  27. package/dist/assets/{Index-1m4ePc99.js → Index-C3f-qhzZ.js} +1 -1
  28. package/dist/assets/{Index-DmiBBxMR.js → Index-C5HV03FO.js} +1 -1
  29. package/dist/assets/{Index-C138EMq8.js → Index-Cl3Lz1dF.js} +1 -1
  30. package/dist/assets/{Index-CBgaEKEn.js → Index-CofV8BK0.js} +1 -1
  31. package/dist/assets/{Index-DjsTZzCq.js → Index-CwVq3Ycf.js} +1 -1
  32. package/dist/assets/{Index-CJWvx5ND.js → Index-DBlvbTmY.js} +1 -1
  33. package/dist/assets/{Index-0fxXA4_J.js → Index-DIF8W8Uc.js} +1 -1
  34. package/dist/assets/{Index-DTWbz-mb.js → Index-DZl1YUel.js} +1 -1
  35. package/dist/assets/{Index-Aud0OTuP.js → Index-DbBMgNaM.js} +1 -1
  36. package/dist/assets/{Index-CAKUcveC.js → Index-Dh9rUBhI.js} +1 -1
  37. package/dist/assets/{Index-DeVbMbCS.js → Index-eTNf6k_N.js} +1 -1
  38. package/dist/assets/Index-hZRJDvDU.css +1 -0
  39. package/dist/assets/{Index-DTbuJEY1.js → Index-ip063XOA.js} +1 -1
  40. package/dist/assets/Index-ogoTClu0.js +1 -0
  41. package/dist/assets/{Invitees-Dx5MX_iJ.js → Invitees-Cc3NpC2g.js} +1 -1
  42. package/dist/assets/{List-BIYl6bzU.js → List-B4p4ZhQE.js} +1 -1
  43. package/dist/assets/{List-CQxikLB8.js → List-D7DfvKQy.js} +1 -1
  44. package/dist/assets/{List-Cxywj_LE.js → List-DvSsX3Z0.js} +1 -1
  45. package/dist/assets/{Main-Ctqdhys8.js → Main-BVKGaNZg.js} +1 -1
  46. package/dist/assets/{Navigator-CcH_hYdW.js → Navigator-9ddEoj7J.js} +1 -1
  47. package/dist/assets/{NoTasks-B7fpKwEM.js → NoTasks-C3t8bmtA.js} +1 -1
  48. package/dist/assets/{NotFound-CTcD9OJN.js → NotFound-Hnpwk4F4.js} +1 -1
  49. package/dist/assets/{OAuthCallback-DilJbVAG.js → OAuthCallback-COGnrcdn.js} +1 -1
  50. package/dist/assets/{Pagination-D2l4tVs_.js → Pagination-wNLMuHeO.js} +1 -1
  51. package/dist/assets/{Status-DEM2PLOr.js → Status-CIYhFNcJ.js} +1 -1
  52. package/dist/assets/{Subscribe-CJOh4174.js → Subscribe-lEko0pof.js} +1 -1
  53. package/dist/assets/{VideoPlayer-DPmqjyk_.js → VideoPlayer-c9dt-3yZ.js} +1 -1
  54. package/dist/assets/{_Uint8Array-DdojeWiA.js → _Uint8Array-BP4C5DZm.js} +1 -1
  55. package/dist/assets/{_baseClone-CkHqwwjY.js → _baseClone-Bmu_sg3j.js} +1 -1
  56. package/dist/assets/{_baseIteratee-BJlOKELK.js → _baseIteratee-lG75D4iw.js} +1 -1
  57. package/dist/assets/{_initCloneObject-DJHkV8_e.js → _initCloneObject-C-Q8oqTt.js} +1 -1
  58. package/dist/assets/{add-DgiDgPk2.js → add-6LL9G5Z5.js} +1 -1
  59. package/dist/assets/{all-wallets-Ir8fVnIE.js → all-wallets-aEppbPWX.js} +1 -1
  60. package/dist/assets/{app-store-BSr6K8vJ.js → app-store-DID464Wp.js} +1 -1
  61. package/dist/assets/{apple-Yw5vBM9e.js → apple-DORiIW02.js} +1 -1
  62. package/dist/assets/{arrow-bottom-vVfNYwgN.js → arrow-bottom-CmCVBSrV.js} +1 -1
  63. package/dist/assets/{arrow-bottom-circle-C03-yd0p.js → arrow-bottom-circle-dyY9qLpT.js} +1 -1
  64. package/dist/assets/{arrow-left-Houf2S9n.js → arrow-left-BaoMx2wj.js} +1 -1
  65. package/dist/assets/{arrow-right-C0p7Cfns.js → arrow-right-6ZIR8uWG.js} +1 -1
  66. package/dist/assets/{arrow-top-BFZ3-_4h.js → arrow-top-DV5TBwIJ.js} +1 -1
  67. package/dist/assets/{avatar-CDKyOWa1.js → avatar-CZpCU7-m.js} +1 -1
  68. package/dist/assets/{bank-DlDeeg-M.js → bank-DYz2uXPn.js} +1 -1
  69. package/dist/assets/{basic-DdHY_6kS.js → basic-CH4UgvMg.js} +1 -1
  70. package/dist/assets/{browser-BvJkxROA.js → browser-CKmIG2h_.js} +1 -1
  71. package/dist/assets/{byokCredential-BSHUJThg.js → byokCredential-BdY2oFpq.js} +1 -1
  72. package/dist/assets/{card-bjHpyjBK.js → card-3UfZE5zt.js} +1 -1
  73. package/dist/assets/{castArray-PDXtni_G.js → castArray-YvIMFTc9.js} +1 -1
  74. package/dist/assets/{chat-D_3mtJGM.js → chat-CpxTF3jE.js} +1 -1
  75. package/dist/assets/{checkmark-CvNDvyd2.js → checkmark-BWZoFv2_.js} +1 -1
  76. package/dist/assets/{checkmark-bold-BaD95hk7.js → checkmark-bold-CEX8QndR.js} +1 -1
  77. package/dist/assets/{chevron-bottom-BZTrBoQZ.js → chevron-bottom-BI142s1X.js} +1 -1
  78. package/dist/assets/{chevron-left-gkGHznHL.js → chevron-left-tLzTrSXr.js} +1 -1
  79. package/dist/assets/{chevron-right-B2ps_1x1.js → chevron-right-Dyf_ffQQ.js} +1 -1
  80. package/dist/assets/{chevron-top-BcHLsjsv.js → chevron-top-DPDBxfl4.js} +1 -1
  81. package/dist/assets/{chrome-store-B_e6TuIp.js → chrome-store-D5SW-iy-.js} +1 -1
  82. package/dist/assets/{clock-Crtz1b91.js → clock-CKF6goQf.js} +1 -1
  83. package/dist/assets/{close-CVk0Y4TQ.js → close-De8y1RWE.js} +1 -1
  84. package/dist/assets/{coinPlaceholder-CToK3nFp.js → coinPlaceholder-Dkkrmbg7.js} +1 -1
  85. package/dist/assets/{compass-D9KY3PBb.js → compass-cqEFwAme.js} +1 -1
  86. package/dist/assets/{copy-_SHmr2qS.js → copy-Es56qz4c.js} +1 -1
  87. package/dist/assets/{createTaskActions-pg5m9M7p.js → createTaskActions-BXbGVAyn.js} +1 -1
  88. package/dist/assets/{cursor-BXSppnwr.js → cursor-Cq5X5f50.js} +1 -1
  89. package/dist/assets/{cursor-transparent-ITFaqM-M.js → cursor-transparent-xlWXmwGt.js} +1 -1
  90. package/dist/assets/{debounce-DLWpM2kv.js → debounce-BpWk7nuI.js} +1 -1
  91. package/dist/assets/{desktop-Ctxvg_Mc.js → desktop-D1J2Uie2.js} +1 -1
  92. package/dist/assets/{disconnect-362IL6KW.js → disconnect-Cks823Of.js} +1 -1
  93. package/dist/assets/{discord-D6KbitWr.js → discord-zkmftcBQ.js} +1 -1
  94. package/dist/assets/{distribution-opJjNwQy.js → distribution-o7xqSpRT.js} +1 -1
  95. package/dist/assets/{dropdown-CRfezuvq.js → dropdown-Bvb4dRSD.js} +1 -1
  96. package/dist/assets/{etherscan-TTFJLDpm.js → etherscan-I41foa4d.js} +1 -1
  97. package/dist/assets/{exclamation-triangle-DeRUzLlM.js → exclamation-triangle-DoIkNHiW.js} +1 -1
  98. package/dist/assets/{extension-D_fSzTou.js → extension-C2DGwOS2.js} +1 -1
  99. package/dist/assets/{external-link-CIqLSeAr.js → external-link-B2ZBFNNw.js} +1 -1
  100. package/dist/assets/{facebook-CxdM6ryJ.js → facebook-CO7UwlKf.js} +1 -1
  101. package/dist/assets/{farcaster-YTjCYlDM.js → farcaster-DFerNXVJ.js} +1 -1
  102. package/dist/assets/{filters-98lL8dRx.js → filters-Cq5-UFL3.js} +1 -1
  103. package/dist/assets/{github-DTyEwyGJ.js → github-BOpdRs3D.js} +1 -1
  104. package/dist/assets/{google-BSZydxsM.js → google-B1iBXSb_.js} +1 -1
  105. package/dist/assets/{help-circle-CcNn1rLc.js → help-circle-FMe2_GKk.js} +1 -1
  106. package/dist/assets/{id-Cun2ausq.js → id-B8JtAbxm.js} +1 -1
  107. package/dist/assets/{image-Dub-7Nlr.js → image-B7X95LW6.js} +1 -1
  108. package/dist/assets/{index-BshjP0UT.js → index--FfOeMhK.js} +1 -1
  109. package/dist/assets/{index-BiORZ5ee.js → index--MBG5Bxw.js} +1 -1
  110. package/dist/assets/{index-B8517Kq_.js → index--UH2lqMs.js} +1 -1
  111. package/dist/assets/{index-CYFuwdxJ.js → index-0u_G2kSj.js} +1 -1
  112. package/dist/assets/{index-Khp7dQxO.js → index-5PCSoafl.js} +2 -2
  113. package/dist/assets/{index-C8DvX3qL.js → index-8jmQ7jsv.js} +1 -1
  114. package/dist/assets/{index-cJCFIiQJ.js → index-B05MCcWV.js} +1 -1
  115. package/dist/assets/{index-DDjfpPMW.js → index-BD55w4j0.js} +1 -1
  116. package/dist/assets/{index-D0ozHIX4.js → index-BMe4XQdI.js} +1 -1
  117. package/dist/assets/{index-CuKao8C3.js → index-BPRTWZ0b.js} +1 -1
  118. package/dist/assets/{index-Bua3buBf.js → index-BVZShYNY.js} +1 -1
  119. package/dist/assets/{index-DfpNVEjT.js → index-BXuYZoDz.js} +1 -1
  120. package/dist/assets/{index-CAROfd4i.js → index-BbcE4PaG.js} +1 -1
  121. package/dist/assets/{index-Da2aFJLl.js → index-BiXpC_cY.js} +1 -1
  122. package/dist/assets/{index-CcjaGWkK.js → index-BkvfyPBC.js} +1 -1
  123. package/dist/assets/{index-B72vsB6D.js → index-BzRVav2J.js} +4 -4
  124. package/dist/assets/{index-BdXdvXDF.js → index-C3GoyrG4.js} +1 -1
  125. package/dist/assets/{index-DJqHVsEt.js → index-C8WbvFlX.js} +1 -1
  126. package/dist/assets/{index-DD1qoXbO.js → index-CD8qf4tY.js} +1 -1
  127. package/dist/assets/{index-Cou85JSj.js → index-CIdZDW4_.js} +3 -3
  128. package/dist/assets/{index-0tg1OcXL.js → index-CMTPLs4z.js} +1 -1
  129. package/dist/assets/{index-Qqh2mgIx.js → index-CMexzqoP.js} +1 -1
  130. package/dist/assets/{index-ypJPwIOS.js → index-COPlSq-K.js} +1 -1
  131. package/dist/assets/{index-GPTup2zg.js → index-CP6lS__f.js} +1 -1
  132. package/dist/assets/{index-B5PvIfC4.js → index-CTspmpeX.js} +1 -1
  133. package/dist/assets/{index-D4lbSr-T.js → index-CVzcynKu.js} +1 -1
  134. package/dist/assets/{index--Bss94FI.js → index-CbnoagxV.js} +1 -1
  135. package/dist/assets/{index-B2wj3UbJ.js → index-Cjg_OuWc.js} +1 -1
  136. package/dist/assets/{index-DCc5mWT3.js → index-CmMnj3Xx.js} +1 -1
  137. package/dist/assets/{index-CxdFHeqj.js → index-CniEO1Oz.js} +1 -1
  138. package/dist/assets/{index-CkEMCLbE.js → index-D5ReSuuO.js} +1 -1
  139. package/dist/assets/{index-BTe0Vafw.js → index-D7b8OrcI.js} +1 -1
  140. package/dist/assets/{index-4t94d9Yq.js → index-DC9KLk-Y.js} +1 -1
  141. package/dist/assets/{index-DS__MBdR.js → index-DEcBa7gX.js} +1 -1
  142. package/dist/assets/{index-Dh2kPrs0.js → index-DLlZmkfC.js} +1 -1
  143. package/dist/assets/{index-8Tl1cChK.js → index-DSRawDTE.js} +1 -1
  144. package/dist/assets/{index-CGJx6pfn.js → index-DTbz6TSn.js} +1 -1
  145. package/dist/assets/{index-YpXkt_KJ.js → index-DTq8xdm6.js} +1 -1
  146. package/dist/assets/{index-B3mTxs9Y.js → index-DWkcw7l1.js} +1 -1
  147. package/dist/assets/{index-BeuqTSkS.js → index-DYXoPIXH.js} +1 -1
  148. package/dist/assets/{index-Bb3nI4T1.js → index-DZXPcke9.js} +1 -1
  149. package/dist/assets/{index-BQYPVVtj.js → index-De-wy4Tc.js} +1 -1
  150. package/dist/assets/{index-Cr_uqtp_.js → index-Df86EZ4H.js} +1 -1
  151. package/dist/assets/{index-kT3FXf87.js → index-DqHEB8wJ.js} +1 -1
  152. package/dist/assets/{index-D-R1uHlt.js → index-Dt0xHpag.js} +1 -1
  153. package/dist/assets/{index-acpn-dGD.js → index-DtaZfQsb.js} +1 -1
  154. package/dist/assets/{index-B1THd-aO.js → index-DvJO3nj9.js} +1 -1
  155. package/dist/assets/{index-Ub7ss3ID.js → index-DzqsLvLw.js} +1 -1
  156. package/dist/assets/{index-BYv3KnKa.js → index-F7u9olkI.js} +1 -1
  157. package/dist/assets/{index-ClVcQZ50.js → index-HTtxGNNR.js} +1 -1
  158. package/dist/assets/{index-CEGyzWWI.js → index-SAsUj7Pk.js} +1 -1
  159. package/dist/assets/{index-CeH6helO.js → index-XpcsQaS3.js} +1 -1
  160. package/dist/assets/{index-CEW9DsqN.js → index-ZhVk9kkG.js} +5 -5
  161. package/dist/assets/{index-PWZeMLxN.js → index-bUBBPa9N.js} +1 -1
  162. package/dist/assets/{index-DoBI-9N1.js → index-cnvaHQUI.js} +1 -1
  163. package/dist/assets/{index-IHF4ze7_.js → index-gQH-ITVc.js} +1 -1
  164. package/dist/assets/{index-ZISytNMe.js → index-karJESpY.js} +1 -1
  165. package/dist/assets/{index-DyRgASC4.js → index-qJmkBTaB.js} +1 -1
  166. package/dist/assets/{index-BCnzh3Xr.js → index-ruJel4IC.js} +1 -1
  167. package/dist/assets/{index-wJ0GDIQS.js → index-yXdj_vJc.js} +1 -1
  168. package/dist/assets/{index.browser.esm-BqXPSHSK.js → index.browser.esm-DkzdYcbc.js} +1 -1
  169. package/dist/assets/{index.es-B9yw59kn.js → index.es-C_WLtS18.js} +1 -1
  170. package/dist/assets/{info-MRa9rCfe.js → info-CWQKBayg.js} +1 -1
  171. package/dist/assets/{info-circle-DHJUnSLt.js → info-circle-xZWu29E_.js} +1 -1
  172. package/dist/assets/{isEqual-9RWKK6ZC.js → isEqual-yYS0dh2f.js} +1 -1
  173. package/dist/assets/{isPlainObject-D782C786.js → isPlainObject-CRl4nmqU.js} +1 -1
  174. package/dist/assets/{lightbulb-DSK7zynz.js → lightbulb-DDxET3cE.js} +1 -1
  175. package/dist/assets/{mail-M2oaM6Nj.js → mail-CFH0lanX.js} +1 -1
  176. package/dist/assets/{midjourney-B13yDVpe.js → midjourney-DRsfJ6XL.js} +1 -1
  177. package/dist/assets/{mobile-DeRXzMkq.js → mobile-ikIUiDOY.js} +1 -1
  178. package/dist/assets/{more-CDR2PEkZ.js → more-BOWsr6fH.js} +1 -1
  179. package/dist/assets/{network-placeholder-Ch_TWeDL.js → network-placeholder-WAP_pG5W.js} +1 -1
  180. package/dist/assets/{nftPlaceholder-C7M0Ea0A.js → nftPlaceholder-mS2qsTTR.js} +1 -1
  181. package/dist/assets/{off-BVu_zU6U.js → off-DgdEkHnP.js} +1 -1
  182. package/dist/assets/{order-qF6Pm2MY.js → order-Cb2RT6uu.js} +1 -1
  183. package/dist/assets/{pagination-CBYfRJVG.js → pagination-mZXKDVMd.js} +1 -1
  184. package/dist/assets/{play-store-sgj5_sA_.js → play-store-8C4ifU8u.js} +1 -1
  185. package/dist/assets/{plus-D7oK-AaE.js → plus-FPrDhto7.js} +1 -1
  186. package/dist/assets/{price-BTNYcVQ5.js → price-Cr67gCty.js} +1 -1
  187. package/dist/assets/producer-Br_uIp1_.js +7 -0
  188. package/dist/assets/producer-Dz_QexIx.js +7 -0
  189. package/dist/assets/{producer-CRQQOFfj.js → producer-Q-cOb_Ne.js} +1 -1
  190. package/dist/assets/{qr-code-BcT7Ar6m.js → qr-code-DRShCRVn.js} +1 -1
  191. package/dist/assets/{recycle-horizontal-CjtP_6AI.js → recycle-horizontal-C8dBoRZt.js} +1 -1
  192. package/dist/assets/{refresh-J0icmcmr.js → refresh-CImlMCgq.js} +1 -1
  193. package/dist/assets/{reown-logo-Gm4M3etA.js → reown-logo-4ZKneMrf.js} +1 -1
  194. package/dist/assets/{search-CYAtmvQh.js → search-CGNtTO4W.js} +1 -1
  195. package/dist/assets/{secp256k1-D54YM-Dv.js → secp256k1-BWP6UeVl.js} +1 -1
  196. package/dist/assets/{secp256k1-CygyzlO4.js → secp256k1-C2CXj9YW.js} +1 -1
  197. package/dist/assets/{seedream-BnGwXTN0.js → seedream-DpE59ZMf.js} +1 -1
  198. package/dist/assets/{send-D484iT01.js → send-DCL9Yk32.js} +1 -1
  199. package/dist/assets/{service-UlOlaUCA.js → service-BJ-ypgj8.js} +1 -1
  200. package/dist/assets/{solana-wallets-vue-DG2aQxVX.js → solana-wallets-vue-C8Fkxc_p.js} +1 -1
  201. package/dist/assets/{solana-wallets-BlkwJPMF.js → solana-wallets-yxjVsaPt.js} +2 -2
  202. package/dist/assets/{suno-C5xsII9n.js → suno-BZWrSxwO.js} +1 -1
  203. package/dist/assets/{swapHorizontal-C3MXca9V.js → swapHorizontal-Bfn7eZ90.js} +1 -1
  204. package/dist/assets/{swapHorizontalBold-B55hvlhg.js → swapHorizontalBold-DGPhnPkP.js} +1 -1
  205. package/dist/assets/{swapHorizontalMedium-DD_DKTRw.js → swapHorizontalMedium-DqzPWlW6.js} +1 -1
  206. package/dist/assets/{swapHorizontalRoundedBold-CZx7flz3.js → swapHorizontalRoundedBold-DPpuDpww.js} +1 -1
  207. package/dist/assets/{swapVertical-Dr4LtnFY.js → swapVertical--7_aleOl.js} +1 -1
  208. package/dist/assets/{telegram-BXetNu8t.js → telegram-DkMIuO8p.js} +1 -1
  209. package/dist/assets/{three-dots-BINazGcv.js → three-dots-DIIrfSEt.js} +1 -1
  210. package/dist/assets/{twitch-MRXoqcJp.js → twitch-CiiHF84Y.js} +1 -1
  211. package/dist/assets/{twitterIcon-Cg3VC0i4.js → twitterIcon-ocXCXtXI.js} +1 -1
  212. package/dist/assets/{typescript-DqAqST2T.js → typescript-D6sat8h_.js} +1 -1
  213. package/dist/assets/{use-form-item-Yq9rpjQi.js → use-form-item-B5rZE33a.js} +1 -1
  214. package/dist/assets/validator-DGv8iqeP.js +1 -0
  215. package/dist/assets/{verify-BHNcEXgF.js → verify-BNbMn2WA.js} +1 -1
  216. package/dist/assets/{verify-filled-du2-p6M5.js → verify-filled-BYrl9ds5.js} +1 -1
  217. package/dist/assets/{w3m-modal-CzZbiHZk.js → w3m-modal-1D4qbzJa.js} +1 -1
  218. package/dist/assets/{wallet-DuYmXFm1.js → wallet-FOzEXpqB.js} +1 -1
  219. package/dist/assets/{wallet-placeholder-ydE7j-YM.js → wallet-placeholder-B68god-e.js} +1 -1
  220. package/dist/assets/{walletconnect-BjDk5PHK.js → walletconnect-BgAZqbXg.js} +1 -1
  221. package/dist/assets/{warning-circle-CQTu56y4.js → warning-circle-OFLJWcAI.js} +1 -1
  222. package/dist/assets/{web-Byc8UprP.js → web-DWdZiDY7.js} +1 -1
  223. package/dist/assets/{web-af7ZvQZT.js → web-MzbMqkc3.js} +1 -1
  224. package/dist/assets/{x-1Jl_JTA4.js → x-CIb6zO-n.js} +1 -1
  225. package/dist/index.html +1 -1
  226. package/package.json +1 -1
  227. package/dist/assets/Index-DMHyDsV2.css +0 -1
  228. package/dist/assets/Index-DwjUaatK.js +0 -1
  229. package/dist/assets/producer-BpQVWNsN.js +0 -7
  230. package/dist/assets/producer-CmjvX-Jw.js +0 -7
  231. package/dist/assets/validator-BOFed1cS.js +0 -1
@@ -1 +1 @@
1
- import{F as E}from"./index.es-B9yw59kn.js";import{E as L}from"./index-CGJx6pfn.js";import{E as ce}from"./index-CEGyzWWI.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bl as G,a3 as ye,H as we,cr as te,aH as oe,S as ne,cs as Ce}from"./index-B72vsB6D.js";import{b as Se,c as se,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-DCc5mWT3.js";import{E as q}from"./index-Cr_uqtp_.js";import{E as C}from"./index-0tg1OcXL.js";import{I as V,S as Ee,l as Le}from"./pagination-CBYfRJVG.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-CUOTVDKq.js";import{E as W}from"./index-BiORZ5ee.js";import{E as O}from"./index-D-R1uHlt.js";import{C as de}from"./Consumption-D9Hn2ImE.js";import{E as ue}from"./index-BshjP0UT.js";import{E as me}from"./index-GPTup2zg.js";import{E as pe}from"./index-CeH6helO.js";import{E as J}from"./index-CkEMCLbE.js";import{a as ge}from"./price-BTNYcVQ5.js";import{F as Me}from"./FilePreview-BLBZCIvI.js";import{E as Re,a as Ue}from"./index-wJ0GDIQS.js";import{E as De,a as Ae}from"./index-BeuqTSkS.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Pe}from"./CopyToClipboard-YKue_6LC.js";import{V as Ge}from"./VideoPlayer-DPmqjyk_.js";import{E as Ke}from"./index-BQYPVVtj.js";import{E as Oe}from"./index-BdXdvXDF.js";import{B as je}from"./BotPlaceholder-BLqNsw9k.js";import{N as Ne}from"./NoTasks-B7fpKwEM.js";import"./use-form-item-Yq9rpjQi.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-DD1qoXbO.js";import"./typescript-DqAqST2T.js";import"./index-B2wj3UbJ.js";import"./strings-beZM2Y-f.js";import"./isEqual-9RWKK6ZC.js";import"./_Uint8Array-DdojeWiA.js";import"./castArray-PDXtni_G.js";import"./debounce-DLWpM2kv.js";import"./_baseIteratee-BJlOKELK.js";import"./index-Dh2kPrs0.js";import"./validator-BOFed1cS.js";import"./index-DDjfpPMW.js";import"./_baseClone-CkHqwwjY.js";import"./_initCloneObject-DJHkV8_e.js";import"./index-Cu41y2Fl.js";import"./index-CYFuwdxJ.js";import"./isPlainObject-D782C786.js";import"./vue-plyr-BO2nlN4c.js";import"./index-B5PvIfC4.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[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 We=y(Be,[["render",He],["__scopeId","data-v-8fa7523c"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),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 X(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 Qe=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=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),C.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})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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(se)}},mounted(){this.value||this.applyMode(se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),C.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})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(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),u(I,null,T(e.options,c=>(l(),S(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(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},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=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.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})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=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"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("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:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,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(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{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 Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,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 Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,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(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{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 Pt=y(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Gt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,ElInputNumber:ue},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)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[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 Ft=y(Gt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,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 Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){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"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,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),u(I,null,T(e.typeOptions,g=>(l(),S(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(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,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(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const ao=y(xt,[["render",lo],["__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 ro(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 m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=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"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,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,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>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}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(c),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,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 Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,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(ro(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)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Go={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(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",Ro,[i("div",Uo,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,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",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Go,[i("span",Ko,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"])])):k("",!0),i("div",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=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 qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),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,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Pt},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")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=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"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{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",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),S(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{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(),S(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!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 fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.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()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"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(),S(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"])):k("",!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 yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,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 Tn=y(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,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 Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Pn={class:"field"},Gn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Pn,[i("div",Gn,[i("h2",Kn,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),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,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 Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},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")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[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 xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,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)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(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",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Pe,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,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")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+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(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("div",$s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),S(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})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",vs,[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",ks,[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(),u("p",bs,[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)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),u("div",ys,[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",ws,[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",Cs,[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(),u("p",Ss,[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)])):k("",!0),e.modelValue?.response?.trace_id?(l(),u("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"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),u("div",Is,[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",Ts,[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(),u("p",Es,[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"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,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?.()}}}),Us={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Ps=y(Rs,[["render",As]]),re=Ce("kling"),Gs=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.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:re};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.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(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.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){C.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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Gs,[["render",js]]);export{Ni as default};
1
+ import{F as E}from"./index.es-C_WLtS18.js";import{E as L}from"./index-DTbz6TSn.js";import{E as ce}from"./index-SAsUj7Pk.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bl as G,a3 as ye,H as we,cr as te,aH as oe,S as ne,cs as Ce}from"./index-BzRVav2J.js";import{b as Se,c as se,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-CmMnj3Xx.js";import{E as q}from"./index-Df86EZ4H.js";import{E as C}from"./index-CMTPLs4z.js";import{I as V,S as Ee,l as Le}from"./pagination-mZXKDVMd.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-CATcaSwT.js";import{E as W}from"./index--MBG5Bxw.js";import{E as O}from"./index-Dt0xHpag.js";import{C as de}from"./Consumption-CL3WRYVN.js";import{E as ue}from"./index--FfOeMhK.js";import{E as me}from"./index-CP6lS__f.js";import{E as pe}from"./index-XpcsQaS3.js";import{E as J}from"./index-D5ReSuuO.js";import{a as ge}from"./price-Cr67gCty.js";import{F as Me}from"./FilePreview-BHbzMFA3.js";import{E as Re,a as Ue}from"./index-yXdj_vJc.js";import{E as De,a as Ae}from"./index-DYXoPIXH.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Pe}from"./CopyToClipboard-TC6O9s7V.js";import{V as Ge}from"./VideoPlayer-c9dt-3yZ.js";import{E as Ke}from"./index-De-wy4Tc.js";import{E as Oe}from"./index-C3GoyrG4.js";import{B as je}from"./BotPlaceholder-BqeR06y3.js";import{N as Ne}from"./NoTasks-C3t8bmtA.js";import"./use-form-item-B5rZE33a.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-CD8qf4tY.js";import"./typescript-D6sat8h_.js";import"./index-Cjg_OuWc.js";import"./strings-beZM2Y-f.js";import"./isEqual-yYS0dh2f.js";import"./_Uint8Array-BP4C5DZm.js";import"./castArray-YvIMFTc9.js";import"./debounce-BpWk7nuI.js";import"./_baseIteratee-lG75D4iw.js";import"./index-DLlZmkfC.js";import"./validator-DGv8iqeP.js";import"./index-BD55w4j0.js";import"./_baseClone-Bmu_sg3j.js";import"./_initCloneObject-C-Q8oqTt.js";import"./index-Cu41y2Fl.js";import"./index-0u_G2kSj.js";import"./isPlainObject-CRl4nmqU.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CTspmpeX.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[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 We=y(Be,[["render",He],["__scopeId","data-v-8fa7523c"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),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 X(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 Qe=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=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),C.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})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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(se)}},mounted(){this.value||this.applyMode(se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),C.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})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(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),u(I,null,T(e.options,c=>(l(),S(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(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},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=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.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})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=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"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("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:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,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(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{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 Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,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 Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,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(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{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 Pt=y(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Gt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,ElInputNumber:ue},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)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[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 Ft=y(Gt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,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 Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){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"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,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),u(I,null,T(e.typeOptions,g=>(l(),S(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(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,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(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const ao=y(xt,[["render",lo],["__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 ro(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 m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=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"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,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,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>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}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(c),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,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 Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,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(ro(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)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Go={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(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",Ro,[i("div",Uo,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,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",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Go,[i("span",Ko,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"])])):k("",!0),i("div",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=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 qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),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,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Pt},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")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=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"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{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",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),S(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{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(),S(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!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 fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.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()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"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(),S(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"])):k("",!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 yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,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 Tn=y(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,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 Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Pn={class:"field"},Gn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Pn,[i("div",Gn,[i("h2",Kn,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),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,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 Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},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")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[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 xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,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)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(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",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Pe,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,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")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+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(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("div",$s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),S(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})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",vs,[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",ks,[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(),u("p",bs,[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)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),u("div",ys,[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",ws,[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",Cs,[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(),u("p",Ss,[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)])):k("",!0),e.modelValue?.response?.trace_id?(l(),u("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"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),u("div",Is,[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",Ts,[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(),u("p",Es,[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"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,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?.()}}}),Us={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Ps=y(Rs,[["render",As]]),re=Ce("kling"),Gs=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.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:re};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.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(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.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){C.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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Gs,[["render",js]]);export{Ni as default};
@@ -1 +1 @@
1
- import{F as C}from"./index.es-B9yw59kn.js";import{E as q}from"./index-CGJx6pfn.js";import{E as N}from"./index-CEGyzWWI.js";import{d as E,H as i,E as l,z as D,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as Z,Q as A}from"./vendor-vue-NSDaktjZ.js";import{G as k,bl as K,cW as X,cX as H,cY as J,cZ as Q,c_ as Y,c$ as ee,d0 as te,d1 as U,d2 as z,d3 as G,d4 as P,d5 as se,d6 as O,d7 as oe,d8 as B,cr as ae,S as j,cs as ne}from"./index-B72vsB6D.js";import{I as L,S as re,l as le}from"./pagination-CBYfRJVG.js";import{E as ie}from"./index-CkEMCLbE.js";import{p as ce}from"./pasteUploadMixin-BurWbGNQ.js";import{I as F}from"./ImagePreview-CUOTVDKq.js";import{E as me}from"./index-D-R1uHlt.js";import{E as I}from"./index-0tg1OcXL.js";import{C as de}from"./Consumption-D9Hn2ImE.js";import{a as ue}from"./price-BTNYcVQ5.js";import{E as x,a as W}from"./index-DCc5mWT3.js";import{E as pe}from"./index-BshjP0UT.js";import{b as fe}from"./errorCode-Cqj9Td_Z.js";import{s as _e}from"./seedream-BnGwXTN0.js";import{C as ge}from"./CopyToClipboard-YKue_6LC.js";import{I as he}from"./ImageWrapper-BTYsRpEP.js";import{E as $e}from"./index-BiORZ5ee.js";import{E as ve}from"./index-BQYPVVtj.js";import{E as be}from"./index-BdXdvXDF.js";import{B as Ee}from"./BotPlaceholder-BLqNsw9k.js";import{N as ke}from"./NoTasks-B7fpKwEM.js";import"./use-form-item-Yq9rpjQi.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-DqAqST2T.js";import"./index-B2wj3UbJ.js";import"./index-CYFuwdxJ.js";import"./index-DDjfpPMW.js";import"./_baseClone-CkHqwwjY.js";import"./_Uint8Array-DdojeWiA.js";import"./_initCloneObject-DJHkV8_e.js";import"./isEqual-9RWKK6ZC.js";import"./index-DD1qoXbO.js";import"./strings-beZM2Y-f.js";import"./castArray-PDXtni_G.js";import"./debounce-DLWpM2kv.js";import"./_baseIteratee-BJlOKELK.js";import"./index-Dh2kPrs0.js";import"./index-Cu41y2Fl.js";import"./index-B5PvIfC4.js";const ye=E({name:"LayoutSeedream",components:{ElDrawer:N,ElButton:q,FontAwesomeIcon:C},data(){return{drawer:!1}}}),we={class:"main flex flex-row flex-1"},Se={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ie={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Ve(e,t,d,c,h,p){const f=n("font-awesome-icon"),_=n("el-button"),r=n("el-drawer");return a(),i("div",we,[l("div",Se,[D(e.$slots,"config",{},void 0,!0)]),l("div",Ie,[D(e.$slots,"result",{},void 0,!0)]),s(_,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(f,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[D(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Me=k(ye,[["render",Ve],["__scopeId","data-v-5ff0c320"]]),Ae="",Le=E({name:"SeedreamPromptInput",components:{ElInput:ie,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ae)}}),Re={class:"field"},Te={class:"box"},Ce={class:"title font-bold"};function qe(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input");return a(),i("div",Re,[l("div",Te,[l("h2",Ce,o(e.$t("seedream.name.prompt")),1),s(f,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(_,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const De=k(Le,[["render",qe],["__scopeId","data-v-5559520a"]]),Ue=E({name:"SeedreamImageInput",components:{ElUpload:me,ElButton:q,InfoIcon:L,ImagePreview:F,FontAwesomeIcon:C},mixins:[ce],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(h=>!h?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const h=this.fileList.find(p=>p?.response?.file_url===c||p?.url===c);h?t.push(h):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(p=>p===c||p?.url===c?.url||p?.response?.file_url===c?.response?.file_url)||t.push(c)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),ze={class:"field"},Ge={class:"label"},Pe={class:"box"},Oe={class:"title font-bold"},je={class:"value"},Be={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function Fe(e,t,d,c,h,p){const f=n("info-icon"),_=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",ze,[l("div",Ge,[l("div",Pe,[l("h2",Oe,o(e.$t("seedream.name.imageUrls")),1),s(f,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",je,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(_,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",Be,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const xe=k(Ue,[["render",Fe],["__scopeId","data-v-dc18c674"]]),We=E({name:"SeedreamModelSelector",components:{ElSelect:W,ElOption:x,InfoIcon:L},data(){return{options:[{value:H,label:this.$t("seedream.model.seedream50")},{value:J,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=X)}}),Ne={class:"field"},Ze={class:"label"},Ke={class:"box"},Xe={class:"title font-bold"};function He(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ne,[l("div",Ze,[l("div",Ke,[l("h2",Xe,o(e.$t("seedream.name.model")),1),s(f,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Je=k(We,[["render",He],["__scopeId","data-v-609ade55"]]),Qe=E({name:"SeedreamSizeSelector",components:{ElSelect:W,ElOption:x,InfoIcon:L},data(){return{options:[{value:U,label:U},{value:z,label:z},{value:G,label:G},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Ye={class:"field"},et={class:"label"},tt={class:"box"},st={class:"title font-bold"};function ot(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ye,[l("div",et,[l("div",tt,[l("h2",st,o(e.$t("seedream.name.size")),1),s(f,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const at=k(Qe,[["render",ot],["__scopeId","data-v-44d5c9d9"]]),nt=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:pe,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),rt={key:0,class:"field"},lt={class:"label"},it={class:"box"},ct={class:"title font-bold"},mt={class:"value"};function dt(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input-number");return e.supported?(a(),i("div",rt,[l("div",lt,[l("div",it,[l("h2",ct,o(e.$t("seedream.name.maxImages")),1),s(f,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",mt,[s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const ut=k(nt,[["render",dt],["__scopeId","data-v-17ef8d1a"]]),pt=E({name:"SeedreamConfigPanel",components:{ElButton:q,FontAwesomeIcon:C,PromptInput:De,Consumption:de,ImageInput:xe,ModelSelector:Je,SizeSelector:at,MaxImagesSelector:ut},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return ue({...e,action:t?"edit":"generate",model:B(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),ft={class:"flex flex-col h-full"},_t={class:"flex-1 overflow-y-auto p-5"},gt={class:"flex flex-col items-center justify-center px-5 pb-5"};function ht(e,t,d,c,h,p){const f=n("model-selector"),_=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",ft,[l("div",_t,[s(f,{class:"mb-4"}),s(_,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",gt,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const $t=k(pt,[["render",ht]]),vt=E({name:"SeedreamTaskPreview",components:{ElImage:be,CopyToClipboard:ge,FontAwesomeIcon:C,ElAlert:ve,ImageWrapper:he,ElButton:q,ElTooltip:$e,ImagePreview:F},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return B(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),bt={class:"preview"},Et={class:"left"},kt={class:"main"},yt={class:"bot"},wt={class:"datetime"},St={class:"info"},It={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},Vt={key:1,class:"prompt mt-2"},Mt={key:0},At={key:0,class:A({content:!0})},Lt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Rt={key:1,class:A({content:!0,failed:!0})},Tt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Ct={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},qt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ut={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Pt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ot={key:2,class:A({content:!0})},jt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Wt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Zt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Kt={key:3,class:A({content:!0})},Xt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ht={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Jt(e,t,d,c,h,p){const f=n("el-image"),_=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",bt,[l("div",Et,[s(f,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",kt,[l("div",yt,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",wt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",St,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",It,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(_,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",Vt,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",Mt," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",Rt,[l("div",Tt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Ct,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=Z(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",qt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Dt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Ut,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",zt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Pt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Ot,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",jt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Bt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Ft,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",xt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",Wt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Zt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Kt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Xt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Ht,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",At,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",Lt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Qt=k(vt,[["render",Jt],["__scopeId","data-v-0dfc6a09"]]),Yt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Qt,BotPlaceholder:Ee,NoTasks:ke,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),es={key:0},ts={key:2,class:"w-full h-full flex items-center justify-center"};function ss(e,t,d,c,h,p){const f=n("bot-placeholder"),_=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",es,[s(f)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(_,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",ts,[s(m)])):$("",!0)],64)}const os=k(Yt,[["render",ss]]),as=ne("seedream"),ns=E({name:"SeedreamIndex",components:{ConfigPanel:$t,Layout:Me,RecentPanel:os},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await le({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:as},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",_e.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(h=>{const p=h?.response?.data;p?.error?.code===fe?I.error(this.$t("seedream.message.usedUp")):I.error(this.$t("seedream.message.startTaskFailed")+(p?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function rs(e,t,d,c,h,p){const f=n("config-panel"),_=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(f,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(_,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Qs=k(ns,[["render",rs]]);export{Qs as default};
1
+ import{F as C}from"./index.es-C_WLtS18.js";import{E as q}from"./index-DTbz6TSn.js";import{E as N}from"./index-SAsUj7Pk.js";import{d as E,H as i,E as l,z as D,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as Z,Q as A}from"./vendor-vue-NSDaktjZ.js";import{G as k,bl as K,cW as X,cX as H,cY as J,cZ as Q,c_ as Y,c$ as ee,d0 as te,d1 as U,d2 as z,d3 as G,d4 as P,d5 as se,d6 as O,d7 as oe,d8 as B,cr as ae,S as j,cs as ne}from"./index-BzRVav2J.js";import{I as L,S as re,l as le}from"./pagination-mZXKDVMd.js";import{E as ie}from"./index-D5ReSuuO.js";import{p as ce}from"./pasteUploadMixin-BurWbGNQ.js";import{I as F}from"./ImagePreview-CATcaSwT.js";import{E as me}from"./index-Dt0xHpag.js";import{E as I}from"./index-CMTPLs4z.js";import{C as de}from"./Consumption-CL3WRYVN.js";import{a as ue}from"./price-Cr67gCty.js";import{E as x,a as W}from"./index-CmMnj3Xx.js";import{E as pe}from"./index--FfOeMhK.js";import{b as fe}from"./errorCode-Cqj9Td_Z.js";import{s as _e}from"./seedream-DpE59ZMf.js";import{C as ge}from"./CopyToClipboard-TC6O9s7V.js";import{I as he}from"./ImageWrapper-C-2wIJYB.js";import{E as $e}from"./index--MBG5Bxw.js";import{E as ve}from"./index-De-wy4Tc.js";import{E as be}from"./index-C3GoyrG4.js";import{B as Ee}from"./BotPlaceholder-BqeR06y3.js";import{N as ke}from"./NoTasks-C3t8bmtA.js";import"./use-form-item-B5rZE33a.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-D6sat8h_.js";import"./index-Cjg_OuWc.js";import"./index-0u_G2kSj.js";import"./index-BD55w4j0.js";import"./_baseClone-Bmu_sg3j.js";import"./_Uint8Array-BP4C5DZm.js";import"./_initCloneObject-C-Q8oqTt.js";import"./isEqual-yYS0dh2f.js";import"./index-CD8qf4tY.js";import"./strings-beZM2Y-f.js";import"./castArray-YvIMFTc9.js";import"./debounce-BpWk7nuI.js";import"./_baseIteratee-lG75D4iw.js";import"./index-DLlZmkfC.js";import"./index-Cu41y2Fl.js";import"./index-CTspmpeX.js";const ye=E({name:"LayoutSeedream",components:{ElDrawer:N,ElButton:q,FontAwesomeIcon:C},data(){return{drawer:!1}}}),we={class:"main flex flex-row flex-1"},Se={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ie={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Ve(e,t,d,c,h,p){const f=n("font-awesome-icon"),_=n("el-button"),r=n("el-drawer");return a(),i("div",we,[l("div",Se,[D(e.$slots,"config",{},void 0,!0)]),l("div",Ie,[D(e.$slots,"result",{},void 0,!0)]),s(_,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(f,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[D(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Me=k(ye,[["render",Ve],["__scopeId","data-v-5ff0c320"]]),Ae="",Le=E({name:"SeedreamPromptInput",components:{ElInput:ie,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ae)}}),Re={class:"field"},Te={class:"box"},Ce={class:"title font-bold"};function qe(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input");return a(),i("div",Re,[l("div",Te,[l("h2",Ce,o(e.$t("seedream.name.prompt")),1),s(f,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(_,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const De=k(Le,[["render",qe],["__scopeId","data-v-5559520a"]]),Ue=E({name:"SeedreamImageInput",components:{ElUpload:me,ElButton:q,InfoIcon:L,ImagePreview:F,FontAwesomeIcon:C},mixins:[ce],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(h=>!h?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const h=this.fileList.find(p=>p?.response?.file_url===c||p?.url===c);h?t.push(h):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(p=>p===c||p?.url===c?.url||p?.response?.file_url===c?.response?.file_url)||t.push(c)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),ze={class:"field"},Ge={class:"label"},Pe={class:"box"},Oe={class:"title font-bold"},je={class:"value"},Be={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function Fe(e,t,d,c,h,p){const f=n("info-icon"),_=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",ze,[l("div",Ge,[l("div",Pe,[l("h2",Oe,o(e.$t("seedream.name.imageUrls")),1),s(f,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",je,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(_,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",Be,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const xe=k(Ue,[["render",Fe],["__scopeId","data-v-dc18c674"]]),We=E({name:"SeedreamModelSelector",components:{ElSelect:W,ElOption:x,InfoIcon:L},data(){return{options:[{value:H,label:this.$t("seedream.model.seedream50")},{value:J,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=X)}}),Ne={class:"field"},Ze={class:"label"},Ke={class:"box"},Xe={class:"title font-bold"};function He(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ne,[l("div",Ze,[l("div",Ke,[l("h2",Xe,o(e.$t("seedream.name.model")),1),s(f,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Je=k(We,[["render",He],["__scopeId","data-v-609ade55"]]),Qe=E({name:"SeedreamSizeSelector",components:{ElSelect:W,ElOption:x,InfoIcon:L},data(){return{options:[{value:U,label:U},{value:z,label:z},{value:G,label:G},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Ye={class:"field"},et={class:"label"},tt={class:"box"},st={class:"title font-bold"};function ot(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ye,[l("div",et,[l("div",tt,[l("h2",st,o(e.$t("seedream.name.size")),1),s(f,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const at=k(Qe,[["render",ot],["__scopeId","data-v-44d5c9d9"]]),nt=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:pe,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),rt={key:0,class:"field"},lt={class:"label"},it={class:"box"},ct={class:"title font-bold"},mt={class:"value"};function dt(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input-number");return e.supported?(a(),i("div",rt,[l("div",lt,[l("div",it,[l("h2",ct,o(e.$t("seedream.name.maxImages")),1),s(f,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",mt,[s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const ut=k(nt,[["render",dt],["__scopeId","data-v-17ef8d1a"]]),pt=E({name:"SeedreamConfigPanel",components:{ElButton:q,FontAwesomeIcon:C,PromptInput:De,Consumption:de,ImageInput:xe,ModelSelector:Je,SizeSelector:at,MaxImagesSelector:ut},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return ue({...e,action:t?"edit":"generate",model:B(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),ft={class:"flex flex-col h-full"},_t={class:"flex-1 overflow-y-auto p-5"},gt={class:"flex flex-col items-center justify-center px-5 pb-5"};function ht(e,t,d,c,h,p){const f=n("model-selector"),_=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",ft,[l("div",_t,[s(f,{class:"mb-4"}),s(_,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",gt,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const $t=k(pt,[["render",ht]]),vt=E({name:"SeedreamTaskPreview",components:{ElImage:be,CopyToClipboard:ge,FontAwesomeIcon:C,ElAlert:ve,ImageWrapper:he,ElButton:q,ElTooltip:$e,ImagePreview:F},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return B(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),bt={class:"preview"},Et={class:"left"},kt={class:"main"},yt={class:"bot"},wt={class:"datetime"},St={class:"info"},It={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},Vt={key:1,class:"prompt mt-2"},Mt={key:0},At={key:0,class:A({content:!0})},Lt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Rt={key:1,class:A({content:!0,failed:!0})},Tt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Ct={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},qt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ut={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Pt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ot={key:2,class:A({content:!0})},jt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Wt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Zt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Kt={key:3,class:A({content:!0})},Xt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ht={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Jt(e,t,d,c,h,p){const f=n("el-image"),_=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",bt,[l("div",Et,[s(f,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",kt,[l("div",yt,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",wt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",St,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",It,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(_,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",Vt,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",Mt," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",Rt,[l("div",Tt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Ct,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=Z(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",qt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Dt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Ut,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",zt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Pt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Ot,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",jt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Bt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Ft,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",xt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",Wt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Zt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Kt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Xt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Ht,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",At,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",Lt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Qt=k(vt,[["render",Jt],["__scopeId","data-v-0dfc6a09"]]),Yt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Qt,BotPlaceholder:Ee,NoTasks:ke,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),es={key:0},ts={key:2,class:"w-full h-full flex items-center justify-center"};function ss(e,t,d,c,h,p){const f=n("bot-placeholder"),_=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",es,[s(f)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(_,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",ts,[s(m)])):$("",!0)],64)}const os=k(Yt,[["render",ss]]),as=ne("seedream"),ns=E({name:"SeedreamIndex",components:{ConfigPanel:$t,Layout:Me,RecentPanel:os},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await le({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:as},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",_e.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(h=>{const p=h?.response?.data;p?.error?.code===fe?I.error(this.$t("seedream.message.usedUp")):I.error(this.$t("seedream.message.startTaskFailed")+(p?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function rs(e,t,d,c,h,p){const f=n("config-panel"),_=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(f,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(_,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Qs=k(ns,[["render",rs]]);export{Qs as default};