@acedatacloud/nexior 3.368.0 → 3.368.1

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 (253) hide show
  1. package/dist/assets/{ApiCodeButton-Cwj2OJXA.js → ApiCodeButton-C_BQZfJW.js} +1 -1
  2. package/dist/assets/{ApiCodeDialog-BzvKB-Li.js → ApiCodeDialog-vmVHoLam.js} +1 -1
  3. package/dist/assets/{Artifacts-_maB_Aq0.js → Artifacts-ChpCJOKB.js} +1 -1
  4. package/dist/assets/{AskUserQuestionCard-hnCP6VsU.js → AskUserQuestionCard-mSiFkgdQ.js} +1 -1
  5. package/dist/assets/{AudioPreview-DYnBP6Fn.js → AudioPreview-CJIm_lvI.js} +1 -1
  6. package/dist/assets/{Auth-B3z778Ju.js → Auth-qB-HeMSE.js} +1 -1
  7. package/dist/assets/{Bare-DHpQwaZg.js → Bare-DD4rQjhI.js} +1 -1
  8. package/dist/assets/{BotPlaceholder-2mfJ2nw8.js → BotPlaceholder-C-06_hGv.js} +1 -1
  9. package/dist/assets/{BottomFooter-C87xW0Bc.js → BottomFooter-xKdFqMxE.js} +1 -1
  10. package/dist/assets/{BrowseConnectors-BiDD2hLh.js → BrowseConnectors-DlUoYbpH.js} +1 -1
  11. package/dist/assets/{BrowserPairingDialog-C91e1oFZ.js → BrowserPairingDialog-Cv6ik7Tt.js} +1 -1
  12. package/dist/assets/{Callback-BZ-RZ2Ov.js → Callback-DVDhRllz.js} +1 -1
  13. package/dist/assets/{CodeSnippet-DMhWnni9.js → CodeSnippet-COYwlrLG.js} +1 -1
  14. package/dist/assets/{Console-CIOnuUeO.js → Console-B9z5vugH.js} +1 -1
  15. package/dist/assets/{Conversation-BOYAS9Ur.js → Conversation-CyvKACP5.js} +1 -1
  16. package/dist/assets/{Conversation-BafplXUG.js → Conversation-D1Vxu8UZ.js} +1 -1
  17. package/dist/assets/{CopyToClipboard-Cg-N1Wgm.js → CopyToClipboard-MUNdxLCY.js} +1 -1
  18. package/dist/assets/{Detail-CFyuka0J.js → Detail-DPtgXyni.js} +1 -1
  19. package/dist/assets/{Extra-BIs_eamY.js → Extra-DuZHP-o1.js} +1 -1
  20. package/dist/assets/{FilePreview-DZQ04hHS.js → FilePreview-CRqxouRS.js} +1 -1
  21. package/dist/assets/{Hailuo-wHd3nf4U.js → Hailuo-CSlL2e-I.js} +1 -1
  22. package/dist/assets/{History-DzZflU_L.js → History-DJK8ZB6F.js} +1 -1
  23. package/dist/assets/{ImagePreview-D4iJcuKJ.js → ImagePreview-BxkzgXM2.js} +1 -1
  24. package/dist/assets/{ImageWrapper-B_Hcg97h.js → ImageWrapper-ClI1QYmC.js} +1 -1
  25. package/dist/assets/{Index-D0BsEkP3.js → Index-B5sBILdS.js} +1 -1
  26. package/dist/assets/{Index-dFrZZqgC.js → Index-B6IfRkYz.js} +1 -1
  27. package/dist/assets/{Index-BRt5P5qC.js → Index-B8Abwnk5.js} +1 -1
  28. package/dist/assets/{Index-7Ln65NQZ.js → Index-BEt_UQ4n.js} +1 -1
  29. package/dist/assets/{Index-CTIh7KK-.js → Index-BS_5YiAc.js} +1 -1
  30. package/dist/assets/{Index-BxyJed0F.js → Index-BTEpLzH4.js} +1 -1
  31. package/dist/assets/{Index-ef34gazq.js → Index-BZvlDh20.js} +1 -1
  32. package/dist/assets/{Index-D2A8gv_e.js → Index-BfLPYNxh.js} +1 -1
  33. package/dist/assets/{Index-DNGx6IGD.js → Index-BmMND5mq.js} +1 -1
  34. package/dist/assets/{Index-uQkJmkUP.js → Index-BmgLqjDQ.js} +1 -1
  35. package/dist/assets/{Index-Cp_qs3S5.js → Index-BrfMuRtE.js} +1 -1
  36. package/dist/assets/{Index-DKovY_e9.js → Index-BvhLXXnj.js} +1 -1
  37. package/dist/assets/{Index-CYniEm1f.js → Index-C1gDIyud.js} +1 -1
  38. package/dist/assets/{Index-AICahqHp.js → Index-CAh5vWzo.js} +1 -1
  39. package/dist/assets/{Index-B2lo3M9v.js → Index-CIiF0NKO.js} +1 -1
  40. package/dist/assets/{Index-CANo1KMP.js → Index-CJCh1DLD.js} +1 -1
  41. package/dist/assets/{Index-BU8YWcQ-.js → Index-CROCrzIR.js} +1 -1
  42. package/dist/assets/{Index-axkGSzYT.js → Index-CbSV2jf2.js} +1 -1
  43. package/dist/assets/{Index-xeSChVef.js → Index-CmdPF6GZ.js} +1 -1
  44. package/dist/assets/{Index-Cs31Q9-0.js → Index-CnTsBUcP.js} +1 -1
  45. package/dist/assets/{Index-b_4W3tR6.js → Index-CpSrezgR.js} +1 -1
  46. package/dist/assets/{Index-7g7n1bUf.js → Index-D8YF5wSz.js} +1 -1
  47. package/dist/assets/{Index-BpJbPSEZ.js → Index-DBrNxdZp.js} +1 -1
  48. package/dist/assets/{Index-CSRFT6IJ.js → Index-DFM729pE.js} +1 -1
  49. package/dist/assets/{Index-Rf3Fx1Gd.js → Index-DJUDLg60.js} +1 -1
  50. package/dist/assets/{Index-BPLgcGzp.js → Index-DMLv2e1H.js} +1 -1
  51. package/dist/assets/{Index-CFSiSOdI.js → Index-DNj5DrhQ.js} +1 -1
  52. package/dist/assets/{Index-BqcFANdQ.js → Index-DiKYYHLe.js} +1 -1
  53. package/dist/assets/{Index-CZjiqxwr.js → Index-DlX7uyR-.js} +1 -1
  54. package/dist/assets/{Index-BnTJ-alh.js → Index-Ds4bhHrQ.js} +1 -1
  55. package/dist/assets/{Index-B-vEAE1m.js → Index-DuhkeT2I.js} +1 -1
  56. package/dist/assets/{Index-DMJOh3T1.js → Index-Ejc2DqRn.js} +1 -1
  57. package/dist/assets/{Index-DNSjjFyj.js → Index-SAMUVYwW.js} +1 -1
  58. package/dist/assets/{Index-EWifqfpR2.js → Index-VzWOhLF12.js} +1 -1
  59. package/dist/assets/{Index-CfmcmVoq.js → Index-pY5LRQdk.js} +1 -1
  60. package/dist/assets/{Index-C0xVWluu.js → Index-vDRc7lOF.js} +1 -1
  61. package/dist/assets/{Index-CViE_xZN.js → Index-z8IPmr5b.js} +1 -1
  62. package/dist/assets/{Invitees-BzJL-AFN.js → Invitees-BLg-4sTm.js} +1 -1
  63. package/dist/assets/{List-CXMFQlZD.js → List-BZuzRKOI.js} +1 -1
  64. package/dist/assets/{List-BGJIDKvP.js → List-Bx4w04g9.js} +1 -1
  65. package/dist/assets/{List-BcljUobz.js → List-D-PDohP7.js} +1 -1
  66. package/dist/assets/{LocalTools-CdtM6KP3.js → LocalTools--QA-r1rI.js} +1 -1
  67. package/dist/assets/{LocalTools-DhvFOCpH.js → LocalTools-B0awdkTZ.js} +1 -1
  68. package/dist/assets/Logo-BUFvydvT.css +1 -0
  69. package/dist/assets/{Logo-DMvxSVOF.js → Logo-DOiGwK11.js} +1 -1
  70. package/dist/assets/{Main-5cjg44u1.js → Main-DMv5N10z.js} +1 -1
  71. package/dist/assets/{Message-C-D0Za_k.js → Message-CAadN58l.js} +1 -1
  72. package/dist/assets/{Model-1zD-yuSk.js → Model-CyfMipET.js} +1 -1
  73. package/dist/assets/{Navigator-Bip6TVs-.js → Navigator-Byv_yTMx.js} +3 -3
  74. package/dist/assets/{NotFound-KPZJSvkI.js → NotFound-BibwPKYv.js} +1 -1
  75. package/dist/assets/{PageHeader-BLiWTI3x.js → PageHeader-BFxLXrsR.js} +1 -1
  76. package/dist/assets/{Pay-DOu3k2aX.js → Pay-DfOb1ggy.js} +1 -1
  77. package/dist/assets/{Player-CnWGj_7L.js → Player-Ko9ry_Yy.js} +1 -1
  78. package/dist/assets/{Poivelle-RvIcVlm7.js → Poivelle-5woC8EjA.js} +1 -1
  79. package/dist/assets/{RealtimeCall-qJb_sr-G.js → RealtimeCall-fOEJnqae.js} +1 -1
  80. package/dist/assets/{ReportButton-Bq6qHKzB.js → ReportButton-Cf9hMzLL.js} +1 -1
  81. package/dist/assets/{ReportDialog-Cx0qbe_v.js → ReportDialog-Bfr8X28D.js} +1 -1
  82. package/dist/assets/{ScenarioPaymentMode-DI6J8wob.js → ScenarioPaymentMode-Ul5m6vCS.js} +1 -1
  83. package/dist/assets/{ScheduledTasks-Bpg13xrl.js → ScheduledTasks-BoE_nqHM.js} +1 -1
  84. package/dist/assets/{ServicePricingSummary-B3v2_Rs3.js → ServicePricingSummary-CN74WnAC.js} +1 -1
  85. package/dist/assets/{ShowcaseDetailDialog-RWDUYE_y.js → ShowcaseDetailDialog-BNK2FobS.js} +1 -1
  86. package/dist/assets/{ShowcaseGrid-DSPiK4Ip.js → ShowcaseGrid-CNkMjOgC.js} +1 -1
  87. package/dist/assets/{ShowcaseResultTabs-BadPJLvn.js → ShowcaseResultTabs-k0aVS8jN.js} +1 -1
  88. package/dist/assets/{SolanaWalletPickerDialog-CXYSdoHc.js → SolanaWalletPickerDialog-Bsg12Sgw.js} +1 -1
  89. package/dist/assets/{Status-BZ0FUqrR.js → Status-DfLmd2dt.js} +1 -1
  90. package/dist/assets/{Subscribe-Cf8ITd5e.js → Subscribe-Cck0EjDv.js} +1 -1
  91. package/dist/assets/{TabSwitcher-BqYyo7yR.js → TabSwitcher-DlxkMlBA.js} +1 -1
  92. package/dist/assets/{Tts-BqTucD8z.js → Tts-C3AmeN6f.js} +1 -1
  93. package/dist/assets/{VideoPlayer-Cubsh2G6.js → VideoPlayer-DMwakGOn.js} +1 -1
  94. package/dist/assets/{VideoPreview-CJednUBR.js → VideoPreview-BrfMXofe.js} +1 -1
  95. package/dist/assets/arrow-down-DqZv6Uuw.js +1 -0
  96. package/dist/assets/{arrow-down-wide-narrow-Dpuzcpcp.js → arrow-down-wide-narrow-DURWOx0l.js} +1 -1
  97. package/dist/assets/arrow-left-BfpsFRjB.js +1 -0
  98. package/dist/assets/arrow-right-5W-k8MV1.js +1 -0
  99. package/dist/assets/arrow-up-BpOjmXEc.js +1 -0
  100. package/dist/assets/{authorizeFlow-D8Emsnb3.js → authorizeFlow-BEU4hlO-.js} +1 -1
  101. package/dist/assets/{avatar-eYMGBHNl.js → avatar-r11OMW-k.js} +1 -1
  102. package/dist/assets/{basic-8Euu98k1.js → basic-Be3-_j53.js} +1 -1
  103. package/dist/assets/{book-open-CR-oN9ea.js → book-open-DvzCVU8s.js} +1 -1
  104. package/dist/assets/{box-Cg2_564N.js → box-BWbGQOmp.js} +1 -1
  105. package/dist/assets/{boxes-zQeHDe1z.js → boxes-By4b1sNC.js} +1 -1
  106. package/dist/assets/{brain-Dhw-H4uv.js → brain-H1q7bQXO.js} +1 -1
  107. package/dist/assets/{chart-no-axes-combined-Dq-4dqFO.js → chart-no-axes-combined-DTnmtpNi.js} +1 -1
  108. package/dist/assets/{chat-vtJhwzXE.js → chat-DtOVeObr.js} +1 -1
  109. package/dist/assets/check-D68gcWiu.js +1 -0
  110. package/dist/assets/chevron-down-OXhxjLss.js +1 -0
  111. package/dist/assets/chevron-right-BwB0OgQN.js +1 -0
  112. package/dist/assets/{circle-alert-Ce-nCHWh.js → circle-alert-t5ZndnWu.js} +1 -1
  113. package/dist/assets/circle-check-D2iK-YZa.js +1 -0
  114. package/dist/assets/{circle-question-mark-BQCkdm8w.js → circle-question-mark-dANQS7D_.js} +1 -1
  115. package/dist/assets/{clipboard-list-jJG7w-r0.js → clipboard-list-C5FM8iHX.js} +1 -1
  116. package/dist/assets/clock-DGhHlqhN.js +1 -0
  117. package/dist/assets/code-DYjYlT8B.js +1 -0
  118. package/dist/assets/{codingBridge-BQyT2_LO.js → codingBridge-BTMMVAYy.js} +1 -1
  119. package/dist/assets/{coins-DBfF7q-y.js → coins-CZ2cIyEB.js} +1 -1
  120. package/dist/assets/{copy-P7nxyxBn.js → copy-jk-hxAmN.js} +1 -1
  121. package/dist/assets/{createTaskActions-nxIBvdnl.js → createTaskActions-CVqBZBys.js} +1 -1
  122. package/dist/assets/{date-picker-Bve3ySaz.js → date-picker-B4ztjiR7.js} +1 -1
  123. package/dist/assets/{digitalhuman-CUPQshZ2.js → digitalhuman-vtiP5vKl.js} +1 -1
  124. package/dist/assets/{dollar-sign-Dyf0k9b_.js → dollar-sign-CQJ3dLLk.js} +1 -1
  125. package/dist/assets/{download-DawDQzv-.js → download-DXViXQKu.js} +1 -1
  126. package/dist/assets/{drawer-B-9mA-zp.js → drawer-DSMPU53I.js} +1 -1
  127. package/dist/assets/{dropdown-PHXYz87w.js → dropdown-DYeT5Rlu.js} +1 -1
  128. package/dist/assets/{dropdown-Cu0TVP8s.js → dropdown-DxAqiwTq.js} +1 -1
  129. package/dist/assets/{ellipsis-CRvtRbF8.js → ellipsis-DB8BDgOa.js} +1 -1
  130. package/dist/assets/{esm--pUmrLsV.js → esm-loepRbYm.js} +2 -2
  131. package/dist/assets/{external-link-Dgsymo2G.js → external-link-DxadXoXD.js} +1 -1
  132. package/dist/assets/{eye-Clihe194.js → eye-DgooaMMx.js} +1 -1
  133. package/dist/assets/{file-DCChBZbV.js → file-CxwSUX5E.js} +1 -1
  134. package/dist/assets/{file-output-Bp-89Uwz.js → file-output-BS1o9dhb.js} +1 -1
  135. package/dist/assets/{file-text-_Eqs1og_.js → file-text-B_A17J0M.js} +1 -1
  136. package/dist/assets/{fish-Bs5jxc8y.js → fish-gtaFi9IA.js} +1 -1
  137. package/dist/assets/{flux-BdysLM7X.js → flux-Bayi3cQ8.js} +1 -1
  138. package/dist/assets/{folder-nE5COYI2.js → folder-D15qEDjQ.js} +1 -1
  139. package/dist/assets/gauge-CvYMw7F5.js +1 -0
  140. package/dist/assets/{generationInput-CX12CphH.js → generationInput-Daa5Los3.js} +1 -1
  141. package/dist/assets/{globe-BDoEGXF3.js → globe-DgSAoZet.js} +1 -1
  142. package/dist/assets/{grokvideo-gpGZB4OF.js → grokvideo-Bs6GoD8B.js} +1 -1
  143. package/dist/assets/{hailuo-BWIwh492.js → hailuo-CuIka7WZ.js} +1 -1
  144. package/dist/assets/{headphones-BD07hM0I.js → headphones-0ejuxyR6.js} +1 -1
  145. package/dist/assets/{history-Bim9Wr8b.js → history-DjItPTnj.js} +1 -1
  146. package/dist/assets/{house-CfiINUB9.js → house-SqieR7DR.js} +1 -1
  147. package/dist/assets/{image-zicVK3av.js → image-tC21pCRC.js} +1 -1
  148. package/dist/assets/{index-DALhxVni.js → index-DvTGM53_.js} +3 -3
  149. package/dist/assets/{index.es-DaWwRA7b.js → index.es-49VJr74K.js} +1 -1
  150. package/dist/assets/{info-ObRZQD-H.js → info-C4cUVd29.js} +1 -1
  151. package/dist/assets/{input-number-CmIGl4Ll.js → input-number-vH4-o6sA.js} +1 -1
  152. package/dist/assets/{key-round-CigNe7lD.js → key-round-Cnp9EHfQ.js} +1 -1
  153. package/dist/assets/{kling-CoxW5JBF.js → kling-61PWqKRh.js} +1 -1
  154. package/dist/assets/{languages-Ci2yZDdS.js → languages-Bqc1a8vL.js} +1 -1
  155. package/dist/assets/{laptop-Cw5rpeNl.js → laptop-DeTU4sRt.js} +1 -1
  156. package/dist/assets/{lightbulb-BrPiD_ms.js → lightbulb-D7mjO9Jh.js} +1 -1
  157. package/dist/assets/{link-BMKYnFR2.js → link-ZZ6djOZr.js} +1 -1
  158. package/dist/assets/loader-circle-DMcwXcOu.js +1 -0
  159. package/dist/assets/{lock-ik1UHxZH.js → lock-CqqDi_32.js} +1 -1
  160. package/dist/assets/{luma-DSO4t_Pg.js → luma-CzZBy3_b.js} +1 -1
  161. package/dist/assets/{maestro-B4loaMPK.js → maestro-DFrKIxI8.js} +1 -1
  162. package/dist/assets/{mail-DoIkVm5A.js → mail-BagUGf-P.js} +1 -1
  163. package/dist/assets/{message-circle-DFRneINZ.js → message-circle-DSl3m_Pv.js} +1 -1
  164. package/dist/assets/{mic-CAsTX5-i.js → mic-DeSGS776.js} +1 -1
  165. package/dist/assets/{midjourney-AIsIlczc.js → midjourney-CkF7tszD.js} +1 -1
  166. package/dist/assets/{minimax-Dx_8Hfdp.js → minimax-6MVwFMJd.js} +1 -1
  167. package/dist/assets/{monitor-C1GcA12a.js → monitor-jUch1QDq.js} +1 -1
  168. package/dist/assets/{mouse-pointer-2-CW_97TcR.js → mouse-pointer-2-D2YoLwzP.js} +1 -1
  169. package/dist/assets/music-2-Z8LCQfXe.js +1 -0
  170. package/dist/assets/{nanobanana-c0VFWiPg.js → nanobanana-C1DfUHY4.js} +1 -1
  171. package/dist/assets/{omni-CNRhazXZ.js → omni-CGRAzsmE.js} +1 -1
  172. package/dist/assets/{openaiimage-DWFpACpF.js → openaiimage-dyuFuZRI.js} +1 -1
  173. package/dist/assets/{pagination-Cr2NuuPw.js → pagination-CFDRyd8v.js} +1 -1
  174. package/dist/assets/{pagination-BZ3bDkKO.js → pagination-NYLKdTqd.js} +1 -1
  175. package/dist/assets/{pagination-DuD8aoRJ.js → pagination-_QW7cebo.js} +1 -1
  176. package/dist/assets/{palette-INEKhq-c.js → palette-CioGo7Mr.js} +1 -1
  177. package/dist/assets/{paperclip-B7pQC1R-.js → paperclip-B4CQhkYN.js} +1 -1
  178. package/dist/assets/{pause-BvEV6Y0g.js → pause-NmVdw3Z2.js} +1 -1
  179. package/dist/assets/{pencil-BljhMR3X.js → pencil-BzDgaTSv.js} +1 -1
  180. package/dist/assets/{pika-Bxik4EwR.js → pika-CXz3DUce.js} +1 -1
  181. package/dist/assets/{pixverse-BzR4UQ6i.js → pixverse-DivFfFWx.js} +1 -1
  182. package/dist/assets/play-B2XuFOPp.js +1 -0
  183. package/dist/assets/{plug-CiuT4t6j.js → plug-kDzBXhRD.js} +1 -1
  184. package/dist/assets/plus-Bg0EWI0e.js +1 -0
  185. package/dist/assets/{poivelle-BUnaC_uJ.js → poivelle-Dj_5vZBU.js} +1 -1
  186. package/dist/assets/{popover-DdTHC_ib.js → popover-JJPFM_3s.js} +1 -1
  187. package/dist/assets/{producer-DAGY9lWf.js → producer-BylR9t4O.js} +1 -1
  188. package/dist/assets/{qrart-BJ2dWRtk.js → qrart-CBokQhDa.js} +1 -1
  189. package/dist/assets/{qwenimage-8t7HQ3jN.js → qwenimage-CGuCWP5W.js} +1 -1
  190. package/dist/assets/{realtime-CuNKT9oO.js → realtime-CX71aJl-.js} +1 -1
  191. package/dist/assets/{refresh-cw-GPNgC1eZ.js → refresh-cw-CaOY3caU.js} +1 -1
  192. package/dist/assets/rotate-ccw-D9dOMJ5i.js +1 -0
  193. package/dist/assets/rotate-cw-CPenk74r.js +1 -0
  194. package/dist/assets/search-COQvr-qE.js +1 -0
  195. package/dist/assets/{seedance-trkuO6fH.js → seedance-jjlJapdy.js} +1 -1
  196. package/dist/assets/{seedream-AYReATCg.js → seedream-DH0F0IQK.js} +1 -1
  197. package/dist/assets/{select-DaSvBgwC.js → select-CLubZdq7.js} +1 -1
  198. package/dist/assets/{serp-C3FCXRPV.js → serp-ClvyAerX.js} +1 -1
  199. package/dist/assets/{shield-CBgn3HiH.js → shield-DJLOquF2.js} +1 -1
  200. package/dist/assets/{showcase-C3Aox9pW.js → showcase-Cs_oOGpe.js} +1 -1
  201. package/dist/assets/{showcaseRecreateMixin-DNnGh8oV.js → showcaseRecreateMixin-kWXcDwMJ.js} +1 -1
  202. package/dist/assets/{shuffle-DmxAyvsC.js → shuffle-CLNwpXyW.js} +1 -1
  203. package/dist/assets/{siteBanner-CqmsCb4a.js → siteBanner-45h7cTjL.js} +1 -1
  204. package/dist/assets/{slider-CvNawFUc.js → slider-ClOCINsJ.js} +1 -1
  205. package/dist/assets/{solana-wallets-OUz1-uF2.js → solana-wallets-DdxPiYQ_.js} +2 -2
  206. package/dist/assets/{sora-9Llab-0F.js → sora-7wl5x99Y.js} +1 -1
  207. package/dist/assets/{sparkles-DXOL_fmR.js → sparkles-BbFcM570.js} +1 -1
  208. package/dist/assets/square-B05hEZud.js +1 -0
  209. package/dist/assets/{store-BhOdCZSN.js → store-BvM1giRK.js} +1 -1
  210. package/dist/assets/{suno-BAmHanx1.js → suno-B7CBUUB4.js} +1 -1
  211. package/dist/assets/{switch-r0dAzXiW.js → switch-l4T7Q7-e.js} +1 -1
  212. package/dist/assets/{table-C7lQKEPF.js → table-Qda4VvZD.js} +1 -1
  213. package/dist/assets/{tag-CR75mqfD.js → tag-C7g4Lmmp.js} +1 -1
  214. package/dist/assets/terminal-BP4wR5NV.js +1 -0
  215. package/dist/assets/{time-picker-Bd_ATt5B.js → time-picker-DrCj4h_h.js} +1 -1
  216. package/dist/assets/{tooltip-B-QFpBiv.js → tooltip-CbdHMzJA.js} +1 -1
  217. package/dist/assets/{trash-2-DpLgUtHx.js → trash-2-DHDZkxkx.js} +1 -1
  218. package/dist/assets/{triangle-alert-BjmSHcgx.js → triangle-alert-BJ4LPyYk.js} +1 -1
  219. package/dist/assets/{upload-Dk5ayTO4.js → upload-R9TAaxbr.js} +1 -1
  220. package/dist/assets/user-BvflVZDf.js +1 -0
  221. package/dist/assets/{veo-BSx8B9Bz.js → veo-J8yLP0It.js} +1 -1
  222. package/dist/assets/{video-DGEMtOJk.js → video-XpLjh-Fi.js} +1 -1
  223. package/dist/assets/{volume-2-BulYs9-F.js → volume-2-BiZ_tZsA.js} +1 -1
  224. package/dist/assets/{wallet-CKEqyATX.js → wallet-BuRhXmc8.js} +1 -1
  225. package/dist/assets/{wan-xjULtjko.js → wan-XhhE5jB8.js} +1 -1
  226. package/dist/assets/{wand-sparkles-CxuEJZZD.js → wand-sparkles-B6SKd5hA.js} +1 -1
  227. package/dist/assets/{web-kt-9pP43.js → web-Cstf0TzK.js} +1 -1
  228. package/dist/assets/{webextrator-CuqwmFrO.js → webextrator-DbYzPJkG.js} +1 -1
  229. package/dist/assets/{zap-CaoxbdYS.js → zap-2FZ2itxO.js} +1 -1
  230. package/dist/index.html +1 -1
  231. package/package.json +1 -1
  232. package/dist/assets/Logo-BZgZ6EYG.css +0 -1
  233. package/dist/assets/arrow-down-zZ6fx77i.js +0 -1
  234. package/dist/assets/arrow-left-DTU7GU1V.js +0 -1
  235. package/dist/assets/arrow-right-BPF6Ad9S.js +0 -1
  236. package/dist/assets/arrow-up-CACotbYp.js +0 -1
  237. package/dist/assets/check-BKFAHZfh.js +0 -1
  238. package/dist/assets/chevron-down-BRlC8DVB.js +0 -1
  239. package/dist/assets/chevron-right-C7lp_UXe.js +0 -1
  240. package/dist/assets/circle-check-BJsh8lIT.js +0 -1
  241. package/dist/assets/clock-B1arMOLX.js +0 -1
  242. package/dist/assets/code-D9c8fRY_.js +0 -1
  243. package/dist/assets/gauge-Frm950Y9.js +0 -1
  244. package/dist/assets/loader-circle-BniXZkLL.js +0 -1
  245. package/dist/assets/music-2-D5zccGQk.js +0 -1
  246. package/dist/assets/play-DEewUK6o.js +0 -1
  247. package/dist/assets/plus-Bt5BG-Qa.js +0 -1
  248. package/dist/assets/rotate-ccw-Dvw-G4Pg.js +0 -1
  249. package/dist/assets/rotate-cw-Cy_MnAdQ.js +0 -1
  250. package/dist/assets/search-C0t1q7l9.js +0 -1
  251. package/dist/assets/square-DgP1tzQL.js +0 -1
  252. package/dist/assets/terminal-gqvwJakX.js +0 -1
  253. package/dist/assets/user-DkbCmGsY.js +0 -1
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{r as h,t as g}from"./select-DaSvBgwC.js";import{t as _}from"./upload-CIplFhpf.js";import{t as v}from"./tooltip-B-QFpBiv.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-BpGydDYc.js";import{t as S}from"./clock-B1arMOLX.js";import{a as C,i as w,n as T,r as E,s as D,t as O}from"./pagination-BZ3bDkKO.js";import{t as k}from"./info-ObRZQD-H.js";import{t as A}from"./trash-2-DpLgUtHx.js";import{t as ee}from"./triangle-alert-BjmSHcgx.js";import{t as j}from"./wand-sparkles-CxuEJZZD.js";import{_r as M}from"./constants-BSFiYSou.js";import{$ as N,A as P,Fi as F,Li as I,O as L,Pa as te,Qa as R,Ra as z,Sn as B,Xi as V,Y as H,_r as U,et as W,gr as G,li as K,na as q,nt as J,rt as Y,si as X,tt as Z}from"./index-DALhxVni.js";import{t as Q}from"./CopyToClipboard-Cg-N1Wgm.js";import{t as ne}from"./ReportButton-Bq6qHKzB.js";import{t as re}from"./ImagePreview-D4iJcuKJ.js";import{t as ie}from"./ServicePricingSummary-B3v2_Rs3.js";import{t as ae}from"./VideoPlayer-Cubsh2G6.js";import{t as oe}from"./ScenarioPaymentMode-DI6J8wob.js";import{t as se}from"./ApiCodeButton-Cwj2OJXA.js";import{t as ce}from"./BotPlaceholder-2mfJ2nw8.js";import{t as le}from"./taskPollingMixin-CcLxtz8z.js";import{t as ue}from"./Hailuo-wHd3nf4U.js";import{n as de,t as fe}from"./generationInput-CX12CphH.js";var pe=m({name:`ModelSelector`,components:{ElSelect:h,ElOption:g},data(){return{}},computed:{options(){return[{value:`minimax-t2v`,label:this.$t(`hailuo.button.model1`)},{value:`minimax-i2v`,label:this.$t(`hailuo.button.model2`)},{value:`minimax-i2v-director`,label:this.$t(`hailuo.button.model3`)}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||=M}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,me,[e(`h2`,he,i(t.$t(`hailuo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`hailuo.placeholder.select`),clearable:``},{default:d(()=>[(p(!0),s(c,null,f(t.options,t=>(p(),u(g,{key:t.value,label:t.label,value:t.value},{default:d(()=>[e(`span`,ge,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=P(pe,[[`render`,_e],[`__scopeId`,`data-v-a768fbd9`]]),ye=m({name:`StartImageUrlInput`,components:{ElUpload:_,ElButton:R,InfoIcon:C,ImagePreview:re},mixins:[Y,J,W,H],data(){return{fileList:[],uploadUrl:te()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){x.warning(this.$t(`hailuo.message.uploadStartImageExceed`))},onError(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},async onRemove(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`};function we(t,n,c,f,m,h){let g=l(`info-icon`),_=l(`image-preview`),v=l(`el-button`),y=l(`el-upload`);return p(),s(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,i(t.$t(`hailuo.name.startImageUrl`)),1),a(g,{content:t.$t(`hailuo.description.startImageUrl`),class:`info`},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,"show-file-list":!0,limit:1,multiple:!1,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{file:d(({file:e})=>[e.url&&e.percentage!==void 0?(p(),u(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:d(()=>[a(v,{size:`small`,type:`primary`,class:`btn btn-upload`,round:``},{default:d(()=>[r(i(t.$t(`hailuo.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-remove`,`on-success`,`headers`])])}var Te=P(ye,[[`render`,we],[`__scopeId`,`data-v-322d7e4c`]]),Ee=m({name:`PromptInput`,components:{PromptTextarea:w},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`hailuo.name.prompt`),info:e.$t(`hailuo.description.prompt`),placeholder:e.$t(`hailuo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=m({name:`PresetPanel`,components:{MagicIcon:j,ElButton:R,PromptInput:P(Ee,[[`render`,De]]),StartImageUrlInput:Te,ModelSelector:ve,ServicePricingSummary:ie,ScenarioPaymentMode:oe},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return fe(`hailuo`,G(this.config))},config(){return this.$store.state.hailuo?.config},consumption(){return B(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service},walletMode(){return F()&&I(`hailuo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=I(`hailuo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=I(`hailuo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await U.quote(G(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`flex flex-col items-center justify-center px-5 pb-5`};function Me(t,n,c,f,m,h){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`start-image-url-input`),y=l(`scenario-payment-mode`),b=l(`service-pricing-summary`),x=l(`magic-icon`),S=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.model===`minimax-i2v`?(p(),u(v,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,je,[a(y,{scenario:`hailuo`}),t.walletMode?o(``,!0):(p(),u(b,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(p(),u(S,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(p(),u(S,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))])])}var Ne=P(Oe,[[`render`,Me]]),Pe=m({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:D,InfoIcon:k,MagicIcon:j,TimeIcon:S,WarningIcon:ee,CopyToClipboard:Q,ElAlert:y,VideoPlayer:ae,ElTooltip:v,ElButton:R,ApiCodeButton:se,ReportButton:ne},props:{modelValue:{type:Object,required:!0}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||this.video?.state===`failed`||this.video?.state===`cancelled`},isWaiting(){return!this.modelValue?.response||!this.isFailure&&[`queued`,`pending`,`processing`,`running`].includes(this.video?.state||``)},application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await z.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`hailuo/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){console.debug(`on download hailuo video`,e),window.open(e,`_blank`)}}}),Fe={class:`preview`},Ie={class:`left`},Le={class:`main`},Re={class:`bot`},ze={class:`datetime`},Be=[`aria-label`],Ve={class:`info`},He={key:0,class:`prompt mt-2`},Ue={key:0},We={key:1},Ge={key:0,class:n({content:!0,failed:!0})},Ke={key:0,class:`mb-4`},qe={key:1,class:n({operations:!0,"mt-2":!0})},Je={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ye={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xe={key:1,class:n({content:!0})},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tt={key:2,class:n({content:!0})},nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function rt(n,c,f,m,h,g){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`video-player`),x=l(`el-button`),S=l(`api-code-button`),C=l(`report-button`),w=l(`channel-icon`),T=l(`copy-to-clipboard`),E=l(`magic-icon`),D=l(`time-icon`),O=l(`el-alert`),k=l(`warning-icon`),A=l(`info-icon`);return p(),s(`div`,Fe,[e(`div`,Ie,[a(_,{capability:`hailuo`,part:`avatar`,class:`avatar`})]),e(`div`,Le,[e(`div`,Re,[a(_,{capability:`hailuo`,part:`name`}),e(`span`,ze,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Be)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ve,[n.modelValue?.request?.prompt?(p(),s(`p`,He,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ue,` - (`+i(n.$t(`hailuo.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting?(p(),s(`span`,We,` - (`+i(n.$t(`hailuo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&!n.isFailure&&!n.isWaiting?(p(),s(`div`,Ge,[n.video?.video_url?(p(),s(`div`,Ke,[a(b,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?(p(),s(`div`,qe,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`hailuo.message.downloadVideo`),placement:`top-start`},{default:d(()=>[n.video?.video_url?(p(),u(x,{key:0,type:`info`,size:`small`,class:`mb-2`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:d(()=>[r(i(n.$t(`hailuo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(S,{path:`/hailuo/videos`,body:n.modelValue?.request},null,8,[`body`]),a(C,{service:`hailuo`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Je,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.model`))+`: `+i(n.modelValue?.request?.model)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])):o(``,!0),e(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Ye,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(p(),s(`div`,Xe,[a(O,{closable:!1,class:`failure`},{template:d(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failure`)),1)]),default:d(()=>[e(`p`,Ze,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Qe,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting?(p(),s(`div`,tt,[a(O,{closable:!1,class:`info`},{template:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`hailuo.status.processing`:`hailuo.status.pending`)),1)]),default:d(()=>[e(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var it=m({name:`RecentPanel`,components:{TaskPreview:P(Pe,[[`render`,rt],[`__scopeId`,`data-v-f8835e7e`]]),BotPlaceholder:ce,NoTasks:E,ScrollList:T},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),at={key:0},ot={key:2,class:`w-full h-full flex items-center justify-center`};function st(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,at,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ot,[a(v)])):o(``,!0)],64)}var ct=m({name:`HailuoIndex`,components:{ConfigPanel:Ne,Layout:ue,RecentPanel:P(it,[[`render`,st]])},mixins:[Z,le(`hailuo`)],inject:[`initialized`],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks},walletMode(){return F()&&I(`hailuo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`hailuo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await O({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`hailuo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`hailuo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`hailuo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=G(this.config),t=de(`hailuo`,e);if(t){x.error(this.$t(`common.message.${t}`));return}if(!N(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){x.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=U.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!q())return;let t=this.credential?.token;if(!t)return;n=U.generate(e,{token:t})}x.info(this.$t(`hailuo.message.startingTask`)),V(`hailuo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),x.success(this.$t(`hailuo.message.startTaskSuccess`))}).catch(e=>{e instanceof X||L(e,`hailuo`)||(this.walletMode?x.error(this.$t(`common.x402Scenario.paymentFailed`)):x.error(this.$t(`hailuo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return K(this.$wallet)},async confirmWalletPayment(e){return z.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function lt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),f=l(`layout`);return p(),u(f,null,{config:d(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:d(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ut=P(ct,[[`render`,lt]]);export{ut as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{r as h,t as g}from"./select-CLubZdq7.js";import{t as _}from"./upload-CIplFhpf.js";import{t as v}from"./tooltip-CbdHMzJA.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-BpGydDYc.js";import{t as S}from"./clock-DGhHlqhN.js";import{a as C,i as w,n as T,r as E,s as D,t as O}from"./pagination-NYLKdTqd.js";import{t as k}from"./info-C4cUVd29.js";import{t as A}from"./trash-2-DHDZkxkx.js";import{t as ee}from"./triangle-alert-BJ4LPyYk.js";import{t as j}from"./wand-sparkles-B6SKd5hA.js";import{_r as M}from"./constants-BSFiYSou.js";import{$ as N,A as P,Fi as F,Li as I,O as L,Pa as te,Qa as R,Ra as z,Sn as B,Xi as V,Y as H,_r as U,et as W,gr as G,li as K,na as q,nt as J,rt as Y,si as X,tt as Z}from"./index-DvTGM53_.js";import{t as Q}from"./CopyToClipboard-MUNdxLCY.js";import{t as ne}from"./ReportButton-Cf9hMzLL.js";import{t as re}from"./ImagePreview-BxkzgXM2.js";import{t as ie}from"./ServicePricingSummary-CN74WnAC.js";import{t as ae}from"./VideoPlayer-DMwakGOn.js";import{t as oe}from"./ScenarioPaymentMode-Ul5m6vCS.js";import{t as se}from"./ApiCodeButton-C_BQZfJW.js";import{t as ce}from"./BotPlaceholder-C-06_hGv.js";import{t as le}from"./taskPollingMixin-CcLxtz8z.js";import{t as ue}from"./Hailuo-CSlL2e-I.js";import{n as de,t as fe}from"./generationInput-Daa5Los3.js";var pe=m({name:`ModelSelector`,components:{ElSelect:h,ElOption:g},data(){return{}},computed:{options(){return[{value:`minimax-t2v`,label:this.$t(`hailuo.button.model1`)},{value:`minimax-i2v`,label:this.$t(`hailuo.button.model2`)},{value:`minimax-i2v-director`,label:this.$t(`hailuo.button.model3`)}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||=M}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,me,[e(`h2`,he,i(t.$t(`hailuo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`hailuo.placeholder.select`),clearable:``},{default:d(()=>[(p(!0),s(c,null,f(t.options,t=>(p(),u(g,{key:t.value,label:t.label,value:t.value},{default:d(()=>[e(`span`,ge,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=P(pe,[[`render`,_e],[`__scopeId`,`data-v-a768fbd9`]]),ye=m({name:`StartImageUrlInput`,components:{ElUpload:_,ElButton:R,InfoIcon:C,ImagePreview:re},mixins:[Y,J,W,H],data(){return{fileList:[],uploadUrl:te()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){x.warning(this.$t(`hailuo.message.uploadStartImageExceed`))},onError(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},async onRemove(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`};function we(t,n,c,f,m,h){let g=l(`info-icon`),_=l(`image-preview`),v=l(`el-button`),y=l(`el-upload`);return p(),s(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,i(t.$t(`hailuo.name.startImageUrl`)),1),a(g,{content:t.$t(`hailuo.description.startImageUrl`),class:`info`},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,"show-file-list":!0,limit:1,multiple:!1,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{file:d(({file:e})=>[e.url&&e.percentage!==void 0?(p(),u(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:d(()=>[a(v,{size:`small`,type:`primary`,class:`btn btn-upload`,round:``},{default:d(()=>[r(i(t.$t(`hailuo.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-remove`,`on-success`,`headers`])])}var Te=P(ye,[[`render`,we],[`__scopeId`,`data-v-322d7e4c`]]),Ee=m({name:`PromptInput`,components:{PromptTextarea:w},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`hailuo.name.prompt`),info:e.$t(`hailuo.description.prompt`),placeholder:e.$t(`hailuo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=m({name:`PresetPanel`,components:{MagicIcon:j,ElButton:R,PromptInput:P(Ee,[[`render`,De]]),StartImageUrlInput:Te,ModelSelector:ve,ServicePricingSummary:ie,ScenarioPaymentMode:oe},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return fe(`hailuo`,G(this.config))},config(){return this.$store.state.hailuo?.config},consumption(){return B(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service},walletMode(){return F()&&I(`hailuo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=I(`hailuo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=I(`hailuo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await U.quote(G(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`flex flex-col items-center justify-center px-5 pb-5`};function Me(t,n,c,f,m,h){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`start-image-url-input`),y=l(`scenario-payment-mode`),b=l(`service-pricing-summary`),x=l(`magic-icon`),S=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.model===`minimax-i2v`?(p(),u(v,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,je,[a(y,{scenario:`hailuo`}),t.walletMode?o(``,!0):(p(),u(b,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(p(),u(S,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(p(),u(S,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))])])}var Ne=P(Oe,[[`render`,Me]]),Pe=m({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:D,InfoIcon:k,MagicIcon:j,TimeIcon:S,WarningIcon:ee,CopyToClipboard:Q,ElAlert:y,VideoPlayer:ae,ElTooltip:v,ElButton:R,ApiCodeButton:se,ReportButton:ne},props:{modelValue:{type:Object,required:!0}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||this.video?.state===`failed`||this.video?.state===`cancelled`},isWaiting(){return!this.modelValue?.response||!this.isFailure&&[`queued`,`pending`,`processing`,`running`].includes(this.video?.state||``)},application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await z.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`hailuo/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){console.debug(`on download hailuo video`,e),window.open(e,`_blank`)}}}),Fe={class:`preview`},Ie={class:`left`},Le={class:`main`},Re={class:`bot`},ze={class:`datetime`},Be=[`aria-label`],Ve={class:`info`},He={key:0,class:`prompt mt-2`},Ue={key:0},We={key:1},Ge={key:0,class:n({content:!0,failed:!0})},Ke={key:0,class:`mb-4`},qe={key:1,class:n({operations:!0,"mt-2":!0})},Je={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ye={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xe={key:1,class:n({content:!0})},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tt={key:2,class:n({content:!0})},nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function rt(n,c,f,m,h,g){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`video-player`),x=l(`el-button`),S=l(`api-code-button`),C=l(`report-button`),w=l(`channel-icon`),T=l(`copy-to-clipboard`),E=l(`magic-icon`),D=l(`time-icon`),O=l(`el-alert`),k=l(`warning-icon`),A=l(`info-icon`);return p(),s(`div`,Fe,[e(`div`,Ie,[a(_,{capability:`hailuo`,part:`avatar`,class:`avatar`})]),e(`div`,Le,[e(`div`,Re,[a(_,{capability:`hailuo`,part:`name`}),e(`span`,ze,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Be)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ve,[n.modelValue?.request?.prompt?(p(),s(`p`,He,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ue,` - (`+i(n.$t(`hailuo.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting?(p(),s(`span`,We,` - (`+i(n.$t(`hailuo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&!n.isFailure&&!n.isWaiting?(p(),s(`div`,Ge,[n.video?.video_url?(p(),s(`div`,Ke,[a(b,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?(p(),s(`div`,qe,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`hailuo.message.downloadVideo`),placement:`top-start`},{default:d(()=>[n.video?.video_url?(p(),u(x,{key:0,type:`info`,size:`small`,class:`mb-2`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:d(()=>[r(i(n.$t(`hailuo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(S,{path:`/hailuo/videos`,body:n.modelValue?.request},null,8,[`body`]),a(C,{service:`hailuo`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Je,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.model`))+`: `+i(n.modelValue?.request?.model)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])):o(``,!0),e(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Ye,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(p(),s(`div`,Xe,[a(O,{closable:!1,class:`failure`},{template:d(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failure`)),1)]),default:d(()=>[e(`p`,Ze,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Qe,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting?(p(),s(`div`,tt,[a(O,{closable:!1,class:`info`},{template:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`hailuo.status.processing`:`hailuo.status.pending`)),1)]),default:d(()=>[e(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var it=m({name:`RecentPanel`,components:{TaskPreview:P(Pe,[[`render`,rt],[`__scopeId`,`data-v-f8835e7e`]]),BotPlaceholder:ce,NoTasks:E,ScrollList:T},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),at={key:0},ot={key:2,class:`w-full h-full flex items-center justify-center`};function st(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,at,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ot,[a(v)])):o(``,!0)],64)}var ct=m({name:`HailuoIndex`,components:{ConfigPanel:Ne,Layout:ue,RecentPanel:P(it,[[`render`,st]])},mixins:[Z,le(`hailuo`)],inject:[`initialized`],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks},walletMode(){return F()&&I(`hailuo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`hailuo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await O({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`hailuo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`hailuo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`hailuo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=G(this.config),t=de(`hailuo`,e);if(t){x.error(this.$t(`common.message.${t}`));return}if(!N(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){x.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=U.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!q())return;let t=this.credential?.token;if(!t)return;n=U.generate(e,{token:t})}x.info(this.$t(`hailuo.message.startingTask`)),V(`hailuo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),x.success(this.$t(`hailuo.message.startTaskSuccess`))}).catch(e=>{e instanceof X||L(e,`hailuo`)||(this.walletMode?x.error(this.$t(`common.x402Scenario.paymentFailed`)):x.error(this.$t(`hailuo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return K(this.$wallet)},async confirmWalletPayment(e){return z.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function lt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),f=l(`layout`);return p(),u(f,null,{config:d(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:d(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ut=P(ct,[[`render`,lt]]);export{ut as default};
@@ -1,2 +1,2 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,F as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,it as d,j as f,mt as p,rt as m,tt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{r as _,t as v}from"./select-DaSvBgwC.js";import{n as y,t as b}from"./tabs-6hi2Rm4j.js";import{t as x}from"./tooltip-B-QFpBiv.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-BpGydDYc.js";import{n as T,r as E}from"./radio-BNhFzeBO.js";import{n as D,t as O}from"./collapse-mhzAC7FG.js";import{t as k}from"./drawer-B-9mA-zp.js";import{t as A}from"./input-number-CmIGl4Ll.js";import{t as j}from"./switch-r0dAzXiW.js";import{t as M}from"./clock-B1arMOLX.js";import{t as N}from"./external-link-Dgsymo2G.js";import{t as P}from"./globe-BDoEGXF3.js";import{t as ee}from"./info-ObRZQD-H.js";import{t as te}from"./loader-circle-BniXZkLL.js";import{t as F}from"./tag-CR75mqfD.js";import{t as I}from"./wand-sparkles-CxuEJZZD.js";import{t as L}from"./zap-CaoxbdYS.js";import{A as R,La as z,O as B,Qa as V,Sn as H,Va as U,na as W,oo as G}from"./index-DALhxVni.js";import{t as K}from"./CopyToClipboard-Cg-N1Wgm.js";import{t as q}from"./ServicePricingSummary-B3v2_Rs3.js";var J=z(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),Y=g({name:`LayoutWebextrator`,components:{ControlsIcon:z(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ElDrawer:k,ElButton:V},data(){return{drawer:!1}}}),X={class:`main flex flex-row flex-1`},Z={class:`config w-[340px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Q={class:`result h-full flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ne(t,n,r,i,o,c){let l=u(`controls-icon`),f=u(`el-button`),m=u(`el-drawer`);return h(),s(`div`,X,[e(`div`,Z,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Q,[d(t.$slots,`result`,{},void 0,!0)]),a(f,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var re=R(Y,[[`render`,ne],[`__scopeId`,`data-v-0ca47a5f`]]),ie=g({name:`ModeSelector`,components:{GlobeIcon:P,MagicIcon:I,ElRadioGroup:E,ElRadioButton:T},computed:{value:{get(){return this.$store.state.webextrator?.config?.mode},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,mode:e})}}}}),ae={class:`field`},oe={class:`title font-bold`};function se(t,n,o,c,l,d){let f=u(`magic-icon`),m=u(`el-radio-button`),g=u(`globe-icon`),_=u(`el-radio-group`);return h(),s(`div`,ae,[e(`h2`,oe,i(t.$t(`webextrator.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value w-full`},{default:p(()=>[a(m,{label:`extract`,value:`extract`},{default:p(()=>[a(f,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.extract`)),1)]),_:1}),a(m,{label:`render`,value:`render`},{default:p(()=>[a(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.render`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ce=R(ie,[[`render`,se],[`__scopeId`,`data-v-76c5bea5`]]),le=g({name:`UrlInput`,components:{ElInput:G},emits:[`submit`],computed:{url:{get(){return this.$store.state.webextrator?.config?.url||``},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,url:e})}}},methods:{onEnter(){this.$emit(`submit`)}}}),ue={class:`field`},de={class:`title font-bold`};function fe(n,r,o,l,d,f){let p=u(`el-input`);return h(),s(`div`,ue,[e(`h2`,de,i(n.$t(`webextrator.name.url`)),1),a(p,{modelValue:n.url,"onUpdate:modelValue":r[0]||=e=>n.url=e,type:`textarea`,rows:2,class:`prompt`,placeholder:n.$t(`webextrator.placeholder.url`),onKeydown:c(t(n.onEnter,[`exact`,`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])])}var pe=R(le,[[`render`,fe],[`__scopeId`,`data-v-18488009`]]),me=g({name:`ExpectedTypeSelector`,components:{ElSelect:_,ElOption:v},computed:{value:{get(){return this.$store.state.webextrator?.config?.expected_type},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,expected_type:e})}}},mounted(){this.value||=`general`}}),he={class:`field`},ge={class:`title font-bold`};function _e(t,n,r,o,c,l){let d=u(`el-option`),f=u(`el-select`);return h(),s(`div`,he,[e(`h2`,ge,i(t.$t(`webextrator.name.expectedType`)),1),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},{default:p(()=>[a(d,{value:`general`,label:t.$t(`webextrator.expectedType.general`)},null,8,[`label`]),a(d,{value:`article`,label:t.$t(`webextrator.expectedType.article`)},null,8,[`label`]),a(d,{value:`product`,label:t.$t(`webextrator.expectedType.product`)},null,8,[`label`])]),_:1},8,[`modelValue`])])}var ve=R(me,[[`render`,_e],[`__scopeId`,`data-v-3b572c49`]]),ye=g({name:`LlmToggle`,components:{InfoIcon:ee,ElSwitch:j,ElTooltip:x},computed:{value:{get(){return!!this.$store.state.webextrator?.config?.enable_llm},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,enable_llm:e})}}}}),be={class:`field`},xe={class:`title font-bold`};function Se(t,n,o,c,l,d){let f=u(`info-icon`),m=u(`el-tooltip`),g=u(`el-switch`);return h(),s(`div`,be,[e(`h2`,xe,[r(i(t.$t(`webextrator.name.enableLlm`))+` `,1),a(m,{effect:`dark`,content:t.$t(`webextrator.description.enableLlm`),placement:`top`},{default:p(()=>[a(f,{class:`ml-1 text-[var(--el-text-color-secondary)] text-xs`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])]),a(g,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Ce=R(ye,[[`render`,Se],[`__scopeId`,`data-v-a0c2f78c`]]),we=[`image`,`font`,`media`,`stylesheet`,`xhr`,`fetch`],Te=g({name:`AdvancedOptions`,components:{ElCollapse:O,ElCollapseItem:D,ElInput:G,ElInputNumber:A,ElSelect:_,ElOption:v},data(){return{active:[]}},computed:{resourceKinds(){return we},waitUntil:{get(){return this.$store.state.webextrator?.config?.wait_until||`networkidle`},set(e){this.commit({wait_until:e})}},waitForSelector:{get(){return this.$store.state.webextrator?.config?.wait_for_selector||``},set(e){this.commit({wait_for_selector:e})}},timeout:{get(){return this.$store.state.webextrator?.config?.timeout??30},set(e){this.commit({timeout:e})}},delay:{get(){return this.$store.state.webextrator?.config?.delay??0},set(e){this.commit({delay:e})}},blockResources:{get(){return this.$store.state.webextrator?.config?.block_resources||[]},set(e){this.commit({block_resources:e})}}},methods:{commit(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,...e})}}}),Ee={class:`field`},De={class:`sub-title`},Oe={class:`field`},ke={class:`sub-title`},Ae={class:`field`},je={class:`sub-title`},Me={class:`field`},Ne={class:`sub-title`},Pe={class:`field`},Fe={class:`sub-title`};function Ie(t,n,r,o,c,d){let g=u(`el-option`),_=u(`el-select`),v=u(`el-input`),y=u(`el-input-number`),b=u(`el-collapse-item`),x=u(`el-collapse`);return h(),f(x,{modelValue:t.active,"onUpdate:modelValue":n[5]||=e=>t.active=e,class:`advanced`},{default:p(()=>[a(b,{title:t.$t(`webextrator.name.advanced`),name:`advanced`},{default:p(()=>[e(`div`,Ee,[e(`h2`,De,i(t.$t(`webextrator.name.waitUntil`)),1),a(_,{modelValue:t.waitUntil,"onUpdate:modelValue":n[0]||=e=>t.waitUntil=e,class:`value`},{default:p(()=>[a(g,{value:`networkidle`,label:t.$t(`webextrator.waitUntil.networkidle`)},null,8,[`label`]),a(g,{value:`load`,label:t.$t(`webextrator.waitUntil.load`)},null,8,[`label`]),a(g,{value:`domcontentloaded`,label:t.$t(`webextrator.waitUntil.domcontentloaded`)},null,8,[`label`]),a(g,{value:`commit`,label:t.$t(`webextrator.waitUntil.commit`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Oe,[e(`h2`,ke,i(t.$t(`webextrator.name.waitForSelector`)),1),a(v,{modelValue:t.waitForSelector,"onUpdate:modelValue":n[1]||=e=>t.waitForSelector=e,placeholder:t.$t(`webextrator.placeholder.waitForSelector`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,Ae,[e(`h2`,je,i(t.$t(`webextrator.name.timeout`)),1),a(y,{modelValue:t.timeout,"onUpdate:modelValue":n[2]||=e=>t.timeout=e,min:1,max:120,step:5,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Me,[e(`h2`,Ne,i(t.$t(`webextrator.name.delay`)),1),a(y,{modelValue:t.delay,"onUpdate:modelValue":n[3]||=e=>t.delay=e,min:0,max:30,step:1,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Pe,[e(`h2`,Fe,i(t.$t(`webextrator.name.blockResources`)),1),a(_,{modelValue:t.blockResources,"onUpdate:modelValue":n[4]||=e=>t.blockResources=e,multiple:``,"collapse-tags":``,placeholder:t.$t(`webextrator.placeholder.blockResources`),class:`w-full`},{default:p(()=>[(h(!0),s(l,null,m(t.resourceKinds,e=>(h(),f(g,{key:e,label:t.$t(`webextrator.blockResource.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Le=g({name:`WebextratorConfigPanel`,components:{LightningIcon:L,ElButton:V,ModeSelector:ce,UrlInput:pe,ExpectedTypeSelector:ve,LlmToggle:Ce,AdvancedOptions:R(Te,[[`render`,Ie],[`__scopeId`,`data-v-8f36d2df`]]),ServicePricingSummary:q},emits:[`run`],computed:{config(){return this.$store.state.webextrator?.config},service(){return this.$store.state.webextrator?.service},consumption(){return H(this.config||{},this.service?.cost)},running(){return this.$store.state.webextrator?.status?.run===C.Request},isExtract(){return(this.config?.mode||`extract`)===`extract`},canRun(){let e=(this.config?.url||``).trim();return/^https?:\/\//i.test(e)}},methods:{onRun(){this.canRun&&this.$emit(`run`)}}}),Re={class:`flex flex-col h-full`},ze={class:`flex-1 overflow-y-auto p-5`},Be={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ve(t,n,c,d,f,m){let g=u(`mode-selector`),_=u(`url-input`),v=u(`expected-type-selector`),y=u(`llm-toggle`),b=u(`advanced-options`),x=u(`service-pricing-summary`),S=u(`lightning-icon`),C=u(`el-button`);return h(),s(`div`,Re,[e(`div`,ze,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`,onSubmit:t.onRun},null,8,[`onSubmit`]),t.isExtract?(h(),s(l,{key:0},[a(v,{class:`mb-4`}),a(y,{class:`mb-4`})],64)):o(``,!0),a(b,{class:`mb-4`})]),e(`div`,Be,[a(x,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(C,{type:`primary`,class:`w-full`,round:``,loading:t.running,disabled:!t.canRun,onClick:t.onRun},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.isExtract?`webextrator.button.extract`:`webextrator.button.render`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])}var He=R(Le,[[`render`,Ve]]),Ue=e=>!!e&&e.kind!==`render`,We=g({name:`WebextratorResultPanel`,components:{ExternalLinkIcon:N,GlobeIcon:P,LabelIcon:F,LoadingIcon:te,SignalIcon:J,TimeIcon:M,ElAlert:S,ElImage:U,ElTabs:y,ElTabPane:b,CopyToClipboard:K},data(){return{activeTab:`markdown`}},computed:{response(){return this.$store.state.webextrator?.response},running(){return this.$store.state.webextrator?.status?.run===C.Request},data(){return this.response?.data},renderData(){return this.data&&this.data.kind===`render`?this.data:void 0},extractData(){return Ue(this.data)?this.data:void 0},finalUrl(){let e=this.data;return e?.finalUrl||e?.final_url||e?.url},contentTypeLabel(){let e=this.data;return e?.contentType||e?.content_type||e?.expected_type},screenshotSrc(){let e=this.data?.screenshot;if(e)return e.startsWith(`data:`)||e.startsWith(`http`)?e:`data:image/png;base64,${e}`},markdown(){let e=this.data;return e?.markdown||e?.content||``},plainText(){return this.data?.text||``},html(){return this.data?.html||``},links(){return Array.isArray(this.data?.links)?this.data.links:[]},linksPlain(){return this.links.join(`
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,F as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,it as d,j as f,mt as p,rt as m,tt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{r as _,t as v}from"./select-CLubZdq7.js";import{n as y,t as b}from"./tabs-6hi2Rm4j.js";import{t as x}from"./tooltip-CbdHMzJA.js";import{t as S}from"./alert-BprQRUmf.js";import{h as C,v as w}from"./models-BpGydDYc.js";import{n as T,r as E}from"./radio-BNhFzeBO.js";import{n as D,t as O}from"./collapse-mhzAC7FG.js";import{t as k}from"./drawer-DSMPU53I.js";import{t as A}from"./input-number-vH4-o6sA.js";import{t as j}from"./switch-l4T7Q7-e.js";import{t as M}from"./clock-DGhHlqhN.js";import{t as N}from"./external-link-DxadXoXD.js";import{t as P}from"./globe-DgSAoZet.js";import{t as ee}from"./info-C4cUVd29.js";import{t as te}from"./loader-circle-DMcwXcOu.js";import{t as F}from"./tag-C7g4Lmmp.js";import{t as I}from"./wand-sparkles-B6SKd5hA.js";import{t as L}from"./zap-2FZ2itxO.js";import{A as R,La as z,O as B,Qa as V,Sn as H,Va as U,na as W,oo as G}from"./index-DvTGM53_.js";import{t as K}from"./CopyToClipboard-MUNdxLCY.js";import{t as q}from"./ServicePricingSummary-CN74WnAC.js";var J=z(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),Y=g({name:`LayoutWebextrator`,components:{ControlsIcon:z(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ElDrawer:k,ElButton:V},data(){return{drawer:!1}}}),X={class:`main flex flex-row flex-1`},Z={class:`config w-[340px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Q={class:`result h-full flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ne(t,n,r,i,o,c){let l=u(`controls-icon`),f=u(`el-button`),m=u(`el-drawer`);return h(),s(`div`,X,[e(`div`,Z,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Q,[d(t.$slots,`result`,{},void 0,!0)]),a(f,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var re=R(Y,[[`render`,ne],[`__scopeId`,`data-v-0ca47a5f`]]),ie=g({name:`ModeSelector`,components:{GlobeIcon:P,MagicIcon:I,ElRadioGroup:E,ElRadioButton:T},computed:{value:{get(){return this.$store.state.webextrator?.config?.mode},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,mode:e})}}}}),ae={class:`field`},oe={class:`title font-bold`};function se(t,n,o,c,l,d){let f=u(`magic-icon`),m=u(`el-radio-button`),g=u(`globe-icon`),_=u(`el-radio-group`);return h(),s(`div`,ae,[e(`h2`,oe,i(t.$t(`webextrator.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value w-full`},{default:p(()=>[a(m,{label:`extract`,value:`extract`},{default:p(()=>[a(f,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.extract`)),1)]),_:1}),a(m,{label:`render`,value:`render`},{default:p(()=>[a(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.render`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ce=R(ie,[[`render`,se],[`__scopeId`,`data-v-76c5bea5`]]),le=g({name:`UrlInput`,components:{ElInput:G},emits:[`submit`],computed:{url:{get(){return this.$store.state.webextrator?.config?.url||``},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,url:e})}}},methods:{onEnter(){this.$emit(`submit`)}}}),ue={class:`field`},de={class:`title font-bold`};function fe(n,r,o,l,d,f){let p=u(`el-input`);return h(),s(`div`,ue,[e(`h2`,de,i(n.$t(`webextrator.name.url`)),1),a(p,{modelValue:n.url,"onUpdate:modelValue":r[0]||=e=>n.url=e,type:`textarea`,rows:2,class:`prompt`,placeholder:n.$t(`webextrator.placeholder.url`),onKeydown:c(t(n.onEnter,[`exact`,`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])])}var pe=R(le,[[`render`,fe],[`__scopeId`,`data-v-18488009`]]),me=g({name:`ExpectedTypeSelector`,components:{ElSelect:_,ElOption:v},computed:{value:{get(){return this.$store.state.webextrator?.config?.expected_type},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,expected_type:e})}}},mounted(){this.value||=`general`}}),he={class:`field`},ge={class:`title font-bold`};function _e(t,n,r,o,c,l){let d=u(`el-option`),f=u(`el-select`);return h(),s(`div`,he,[e(`h2`,ge,i(t.$t(`webextrator.name.expectedType`)),1),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},{default:p(()=>[a(d,{value:`general`,label:t.$t(`webextrator.expectedType.general`)},null,8,[`label`]),a(d,{value:`article`,label:t.$t(`webextrator.expectedType.article`)},null,8,[`label`]),a(d,{value:`product`,label:t.$t(`webextrator.expectedType.product`)},null,8,[`label`])]),_:1},8,[`modelValue`])])}var ve=R(me,[[`render`,_e],[`__scopeId`,`data-v-3b572c49`]]),ye=g({name:`LlmToggle`,components:{InfoIcon:ee,ElSwitch:j,ElTooltip:x},computed:{value:{get(){return!!this.$store.state.webextrator?.config?.enable_llm},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,enable_llm:e})}}}}),be={class:`field`},xe={class:`title font-bold`};function Se(t,n,o,c,l,d){let f=u(`info-icon`),m=u(`el-tooltip`),g=u(`el-switch`);return h(),s(`div`,be,[e(`h2`,xe,[r(i(t.$t(`webextrator.name.enableLlm`))+` `,1),a(m,{effect:`dark`,content:t.$t(`webextrator.description.enableLlm`),placement:`top`},{default:p(()=>[a(f,{class:`ml-1 text-[var(--el-text-color-secondary)] text-xs`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])]),a(g,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Ce=R(ye,[[`render`,Se],[`__scopeId`,`data-v-a0c2f78c`]]),we=[`image`,`font`,`media`,`stylesheet`,`xhr`,`fetch`],Te=g({name:`AdvancedOptions`,components:{ElCollapse:O,ElCollapseItem:D,ElInput:G,ElInputNumber:A,ElSelect:_,ElOption:v},data(){return{active:[]}},computed:{resourceKinds(){return we},waitUntil:{get(){return this.$store.state.webextrator?.config?.wait_until||`networkidle`},set(e){this.commit({wait_until:e})}},waitForSelector:{get(){return this.$store.state.webextrator?.config?.wait_for_selector||``},set(e){this.commit({wait_for_selector:e})}},timeout:{get(){return this.$store.state.webextrator?.config?.timeout??30},set(e){this.commit({timeout:e})}},delay:{get(){return this.$store.state.webextrator?.config?.delay??0},set(e){this.commit({delay:e})}},blockResources:{get(){return this.$store.state.webextrator?.config?.block_resources||[]},set(e){this.commit({block_resources:e})}}},methods:{commit(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,...e})}}}),Ee={class:`field`},De={class:`sub-title`},Oe={class:`field`},ke={class:`sub-title`},Ae={class:`field`},je={class:`sub-title`},Me={class:`field`},Ne={class:`sub-title`},Pe={class:`field`},Fe={class:`sub-title`};function Ie(t,n,r,o,c,d){let g=u(`el-option`),_=u(`el-select`),v=u(`el-input`),y=u(`el-input-number`),b=u(`el-collapse-item`),x=u(`el-collapse`);return h(),f(x,{modelValue:t.active,"onUpdate:modelValue":n[5]||=e=>t.active=e,class:`advanced`},{default:p(()=>[a(b,{title:t.$t(`webextrator.name.advanced`),name:`advanced`},{default:p(()=>[e(`div`,Ee,[e(`h2`,De,i(t.$t(`webextrator.name.waitUntil`)),1),a(_,{modelValue:t.waitUntil,"onUpdate:modelValue":n[0]||=e=>t.waitUntil=e,class:`value`},{default:p(()=>[a(g,{value:`networkidle`,label:t.$t(`webextrator.waitUntil.networkidle`)},null,8,[`label`]),a(g,{value:`load`,label:t.$t(`webextrator.waitUntil.load`)},null,8,[`label`]),a(g,{value:`domcontentloaded`,label:t.$t(`webextrator.waitUntil.domcontentloaded`)},null,8,[`label`]),a(g,{value:`commit`,label:t.$t(`webextrator.waitUntil.commit`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Oe,[e(`h2`,ke,i(t.$t(`webextrator.name.waitForSelector`)),1),a(v,{modelValue:t.waitForSelector,"onUpdate:modelValue":n[1]||=e=>t.waitForSelector=e,placeholder:t.$t(`webextrator.placeholder.waitForSelector`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,Ae,[e(`h2`,je,i(t.$t(`webextrator.name.timeout`)),1),a(y,{modelValue:t.timeout,"onUpdate:modelValue":n[2]||=e=>t.timeout=e,min:1,max:120,step:5,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Me,[e(`h2`,Ne,i(t.$t(`webextrator.name.delay`)),1),a(y,{modelValue:t.delay,"onUpdate:modelValue":n[3]||=e=>t.delay=e,min:0,max:30,step:1,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Pe,[e(`h2`,Fe,i(t.$t(`webextrator.name.blockResources`)),1),a(_,{modelValue:t.blockResources,"onUpdate:modelValue":n[4]||=e=>t.blockResources=e,multiple:``,"collapse-tags":``,placeholder:t.$t(`webextrator.placeholder.blockResources`),class:`w-full`},{default:p(()=>[(h(!0),s(l,null,m(t.resourceKinds,e=>(h(),f(g,{key:e,label:t.$t(`webextrator.blockResource.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Le=g({name:`WebextratorConfigPanel`,components:{LightningIcon:L,ElButton:V,ModeSelector:ce,UrlInput:pe,ExpectedTypeSelector:ve,LlmToggle:Ce,AdvancedOptions:R(Te,[[`render`,Ie],[`__scopeId`,`data-v-8f36d2df`]]),ServicePricingSummary:q},emits:[`run`],computed:{config(){return this.$store.state.webextrator?.config},service(){return this.$store.state.webextrator?.service},consumption(){return H(this.config||{},this.service?.cost)},running(){return this.$store.state.webextrator?.status?.run===C.Request},isExtract(){return(this.config?.mode||`extract`)===`extract`},canRun(){let e=(this.config?.url||``).trim();return/^https?:\/\//i.test(e)}},methods:{onRun(){this.canRun&&this.$emit(`run`)}}}),Re={class:`flex flex-col h-full`},ze={class:`flex-1 overflow-y-auto p-5`},Be={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ve(t,n,c,d,f,m){let g=u(`mode-selector`),_=u(`url-input`),v=u(`expected-type-selector`),y=u(`llm-toggle`),b=u(`advanced-options`),x=u(`service-pricing-summary`),S=u(`lightning-icon`),C=u(`el-button`);return h(),s(`div`,Re,[e(`div`,ze,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`,onSubmit:t.onRun},null,8,[`onSubmit`]),t.isExtract?(h(),s(l,{key:0},[a(v,{class:`mb-4`}),a(y,{class:`mb-4`})],64)):o(``,!0),a(b,{class:`mb-4`})]),e(`div`,Be,[a(x,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(C,{type:`primary`,class:`w-full`,round:``,loading:t.running,disabled:!t.canRun,onClick:t.onRun},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.isExtract?`webextrator.button.extract`:`webextrator.button.render`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])}var He=R(Le,[[`render`,Ve]]),Ue=e=>!!e&&e.kind!==`render`,We=g({name:`WebextratorResultPanel`,components:{ExternalLinkIcon:N,GlobeIcon:P,LabelIcon:F,LoadingIcon:te,SignalIcon:J,TimeIcon:M,ElAlert:S,ElImage:U,ElTabs:y,ElTabPane:b,CopyToClipboard:K},data(){return{activeTab:`markdown`}},computed:{response(){return this.$store.state.webextrator?.response},running(){return this.$store.state.webextrator?.status?.run===C.Request},data(){return this.response?.data},renderData(){return this.data&&this.data.kind===`render`?this.data:void 0},extractData(){return Ue(this.data)?this.data:void 0},finalUrl(){let e=this.data;return e?.finalUrl||e?.final_url||e?.url},contentTypeLabel(){let e=this.data;return e?.contentType||e?.content_type||e?.expected_type},screenshotSrc(){let e=this.data?.screenshot;if(e)return e.startsWith(`data:`)||e.startsWith(`http`)?e:`data:image/png;base64,${e}`},markdown(){let e=this.data;return e?.markdown||e?.content||``},plainText(){return this.data?.text||``},html(){return this.data?.html||``},links(){return Array.isArray(this.data?.links)?this.data.links:[]},linksPlain(){return this.links.join(`
2
2
  `)},images(){return Array.isArray(this.data?.images)?this.data.images:[]},structuredPretty(){return this.extractData?.structured?JSON.stringify(this.extractData.structured,null,2):``},rawPretty(){return this.response?JSON.stringify(this.response,null,2):``},errorMessage(){if(this.response?.success===!1){let e=this.response?.error;return e?.message||e?.code||this.$t(`webextrator.message.failed`)}}},watch:{response:{handler(){this.resetTab()},immediate:!0}},methods:{resetTab(){this.markdown?this.activeTab=`markdown`:this.extractData?.structured?this.activeTab=`structured`:this.plainText?this.activeTab=`text`:this.html?this.activeTab=`html`:this.activeTab=`raw`}}}),Ge={class:`h-full overflow-y-auto p-6`},Ke={key:0,class:`max-w-4xl mx-auto py-4`},qe={class:`flex items-center gap-2 mb-3 text-[var(--el-color-primary)] text-sm`},Je={key:1,class:`flex flex-col items-center justify-center py-24 text-[var(--el-text-color-disabled)]`},Ye={class:`text-base mb-1`},Xe={class:`text-xs opacity-70`},Ze={key:2,class:`max-w-4xl mx-auto py-4`},Qe={class:`text-xs whitespace-pre-wrap break-words`},$e={key:3,class:`max-w-4xl mx-auto`},et={class:`mb-4`},tt={class:`text-xl font-semibold leading-snug mb-1 break-words text-[var(--el-text-color-primary)]`},nt={class:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-[var(--el-text-color-secondary)]`},rt=[`href`],it={key:1},at={key:2},ot={key:3},st={key:0,class:`mt-2 text-sm text-[var(--el-text-color-regular)] leading-relaxed line-clamp-3`},ct={key:0,class:`mb-5`},lt={class:`tab-toolbar`},ut={class:`content-block`},dt={class:`tab-toolbar`},ft={class:`content-block`},$={class:`tab-toolbar`},pt={class:`content-block code`},mt={class:`tab-toolbar`},ht={class:`links-list`},gt=[`href`],_t={class:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2`},vt={class:`tab-toolbar`},yt={class:`content-block code`},bt={class:`tab-toolbar`},xt={class:`content-block code`};function St(t,c,d,g,_,v){let y=u(`loading-icon`),b=u(`globe-icon`),x=u(`el-alert`),S=u(`external-link-icon`),C=u(`signal-icon`),w=u(`time-icon`),T=u(`label-icon`),E=u(`el-image`),D=u(`copy-to-clipboard`),O=u(`el-tab-pane`),k=u(`el-tabs`);return h(),s(`div`,Ge,[t.running?(h(),s(`div`,Ke,[e(`div`,qe,[a(y,{class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.$t(`webextrator.message.running`)),1)]),c[1]||=n(`<div class="mb-6 animate-pulse" data-v-4ec341a6><div class="h-5 w-3/5 rounded bg-[var(--el-fill-color-dark)] mb-2" data-v-4ec341a6></div><div class="h-3 w-2/5 rounded bg-[var(--el-fill-color)] mb-4" data-v-4ec341a6></div><div class="h-64 w-full rounded bg-[var(--el-fill-color)] mb-3" data-v-4ec341a6></div><div class="h-3 w-full rounded bg-[var(--el-fill-color)] mb-1" data-v-4ec341a6></div><div class="h-3 w-5/6 rounded bg-[var(--el-fill-color)] mb-1" data-v-4ec341a6></div><div class="h-3 w-4/6 rounded bg-[var(--el-fill-color)]" data-v-4ec341a6></div></div>`,1)])):!t.response&&!t.errorMessage?(h(),s(`div`,Je,[a(b,{class:`text-6xl mb-4 opacity-30`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,Ye,i(t.$t(`webextrator.description.intro`)),1),e(`p`,Xe,i(t.$t(`webextrator.description.introHint`)),1)])):t.errorMessage?(h(),s(`div`,Ze,[a(x,{type:`error`,closable:!1,"show-icon":``,title:t.$t(`webextrator.message.failed`)},{default:p(()=>[e(`pre`,Qe,i(t.errorMessage),1)]),_:1},8,[`title`])])):t.data?(h(),s(`div`,$e,[e(`header`,et,[e(`h1`,tt,i(t.data.title||t.$t(`webextrator.message.untitled`)),1),e(`div`,nt,[t.finalUrl?(h(),s(`a`,{key:0,href:t.finalUrl,target:`_blank`,rel:`noopener`,class:`hover:underline truncate max-w-[60%]`},[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.finalUrl),1)],8,rt)):o(``,!0),t.renderData?.status?(h(),s(`span`,it,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.renderData.status),1)])):o(``,!0),t.response?.elapsed?(h(),s(`span`,at,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.response.elapsed.toFixed(2))+`s `,1)])):o(``,!0),t.contentTypeLabel?(h(),s(`span`,ot,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.contentTypeLabel),1)])):o(``,!0)]),t.extractData?.description?(h(),s(`p`,st,i(t.extractData.description),1)):o(``,!0)]),t.screenshotSrc?(h(),s(`figure`,ct,[a(E,{src:t.screenshotSrc,fit:`contain`,"preview-src-list":[t.screenshotSrc],"preview-teleported":``,"hide-on-click-modal":``,class:`w-full max-h-[480px] rounded border border-[var(--app-border-subtle)] bg-[var(--el-fill-color-light)]`},null,8,[`src`,`preview-src-list`])])):o(``,!0),a(k,{modelValue:t.activeTab,"onUpdate:modelValue":c[0]||=e=>t.activeTab=e,class:`result-tabs`},{default:p(()=>[t.markdown?(h(),f(O,{key:0,label:t.$t(`webextrator.tab.markdown`),name:`markdown`},{default:p(()=>[e(`div`,lt,[a(D,{content:t.markdown},null,8,[`content`])]),e(`pre`,ut,i(t.markdown),1)]),_:1},8,[`label`])):o(``,!0),t.plainText?(h(),f(O,{key:1,label:t.$t(`webextrator.tab.text`),name:`text`},{default:p(()=>[e(`div`,dt,[a(D,{content:t.plainText},null,8,[`content`])]),e(`pre`,ft,i(t.plainText),1)]),_:1},8,[`label`])):o(``,!0),t.extractData?.structured?(h(),f(O,{key:2,label:t.$t(`webextrator.tab.structured`),name:`structured`},{default:p(()=>[e(`div`,$,[a(D,{content:t.structuredPretty},null,8,[`content`])]),e(`pre`,pt,i(t.structuredPretty),1)]),_:1},8,[`label`])):o(``,!0),t.links.length?(h(),f(O,{key:3,label:`${t.$t(`webextrator.tab.links`)} (${t.links.length})`,name:`links`},{default:p(()=>[e(`div`,mt,[a(D,{content:t.linksPlain},null,8,[`content`])]),e(`ul`,ht,[(h(!0),s(l,null,m(t.links,(t,n)=>(h(),s(`li`,{key:n,class:`truncate`},[e(`a`,{href:t,target:`_blank`,rel:`noopener`},i(t),9,gt)]))),128))])]),_:1},8,[`label`])):o(``,!0),t.images.length?(h(),f(O,{key:4,label:`${t.$t(`webextrator.tab.images`)} (${t.images.length})`,name:`images`},{default:p(()=>[e(`div`,_t,[(h(!0),s(l,null,m(t.images,(e,n)=>(h(),f(E,{key:n,src:e,fit:`cover`,loading:`lazy`,"preview-src-list":t.images,"initial-index":n,"preview-teleported":``,"hide-on-click-modal":``,class:`aspect-square w-full rounded bg-[var(--el-fill-color-light)]`},null,8,[`src`,`preview-src-list`,`initial-index`]))),128))])]),_:1},8,[`label`])):o(``,!0),t.html?(h(),f(O,{key:5,label:t.$t(`webextrator.tab.html`),name:`html`},{default:p(()=>[e(`div`,vt,[a(D,{content:t.html},null,8,[`content`])]),e(`pre`,yt,i(t.html),1)]),_:1},8,[`label`])):o(``,!0),a(O,{label:t.$t(`webextrator.tab.raw`),name:`raw`},{default:p(()=>[e(`div`,bt,[a(D,{content:t.rawPretty},null,8,[`content`])]),e(`pre`,xt,i(t.rawPretty),1)]),_:1},8,[`label`])]),_:1},8,[`modelValue`])])):o(``,!0)])}var Ct=g({name:`WebextratorIndex`,components:{Layout:re,ConfigPanel:He,ResultPanel:R(We,[[`render`,St],[`__scopeId`,`data-v-4ec341a6`]])},inject:[`initialized`],async mounted(){await this.$store.dispatch(`webextrator/getService`)},methods:{async onRun(){if(!W())return;let e=this.$store.state.webextrator?.config;if(!e?.url)return;let t=(e.mode||`extract`)===`extract`;w.info(this.$t(t?`webextrator.message.extracting`:`webextrator.message.rendering`));try{await this.$store.dispatch(`webextrator/run`),w.success(this.$t(`webextrator.message.success`))}catch(e){let t=e?.response?.data?.error?.code||e?.response?.data?.code;if(B(e,`webextrator`))return;t===`too_many_requests`?w.error(this.$t(`webextrator.message.busy`)):t===`timeout`?w.error(this.$t(`webextrator.message.timeout`)):t===`antibot_blocked`?w.error(this.$t(`webextrator.message.antibotBlocked`)):w.error(this.$t(`webextrator.message.failed`))}}}});function wt(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`result-panel`),l=u(`layout`);return h(),f(l,null,{config:p(()=>[a(s,{onRun:e.onRun},null,8,[`onRun`])]),result:p(()=>[a(c)]),_:1})}var Tt=R(Ct,[[`render`,wt]]);export{Tt as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-DaSvBgwC.js";import{n as x,t as S}from"./tabs-6hi2Rm4j.js";import{t as C}from"./upload-CIplFhpf.js";import{t as w}from"./tooltip-B-QFpBiv.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-BpGydDYc.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-B-9mA-zp.js";import{t as j}from"./input-number-CmIGl4Ll.js";import{t as M}from"./slider-CvNawFUc.js";import{t as N}from"./switch-r0dAzXiW.js";import{t as ee}from"./clock-B1arMOLX.js";import{a as P,i as te,n as ne,r as re,s as ie,t as ae}from"./pagination-BZ3bDkKO.js";import{t as oe}from"./headphones-BD07hM0I.js";import{t as se}from"./info-ObRZQD-H.js";import{t as ce}from"./lightbulb-BrPiD_ms.js";import{t as le}from"./trash-2-DpLgUtHx.js";import{t as ue}from"./triangle-alert-BjmSHcgx.js";import{t as F}from"./upload-Dk5ayTO4.js";import{t as I}from"./wand-sparkles-CxuEJZZD.js";import{Ci as L,Si as de,vi as fe,xi as pe}from"./constants-BSFiYSou.js";import{$ as me,A as R,Fi as z,Ia as he,Li as B,Lr as ge,O as _e,Pa as V,Q as ve,Qa as H,Ra as U,Rr as ye,Sn as W,X as be,Xa as xe,Xi as G,Y as Se,Z as Ce,et as K,li as we,na as Te,nt as q,oo as J,rt as Y,si as Ee,tt as De,zi as Oe,zr as X}from"./index-DALhxVni.js";import{t as ke}from"./CopyToClipboard-Cg-N1Wgm.js";import{t as Ae}from"./ReportButton-Bq6qHKzB.js";import{t as je}from"./FilePreview-DZQ04hHS.js";import{t as Z}from"./ImagePreview-D4iJcuKJ.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-B3v2_Rs3.js";import{t as Pe}from"./AudioPreview-DYnBP6Fn.js";import{t as Fe}from"./VideoPlayer-Cubsh2G6.js";import{t as Ie}from"./VideoPreview-CJednUBR.js";import{t as Le}from"./ScenarioPaymentMode-DI6J8wob.js";import{t as Re}from"./ApiCodeButton-Cwj2OJXA.js";import{t as ze}from"./BotPlaceholder-2mfJ2nw8.js";import{t as Be}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ve}from"./ShowcaseResultTabs-BadPJLvn.js";import{t as He}from"./showcaseRecreateMixin-DNnGh8oV.js";import{n as Ue,t as We}from"./generationInput-CX12CphH.js";var Ge=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:H},mixins:[Me]}),Ke={class:`main flex flex-row flex-1 min-h-0`},qe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Je={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ke,[e(`div`,qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Je,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Xe=R(Ge,[[`render`,Ye],[`__scopeId`,`data-v-f4b791b5`]]),Ze={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Ze}}var $=`<<<video_1>>>`,Qe=/<<<image_\d+>>>/g;function $e(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function et(e){return e?e.replace(Qe,` `).replace(/\s{2,}/g,` `).trim():``}function tt(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Q(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function nt(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=$e(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=et(n.prompt));return n}var rt=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(fe)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=R(rt,[[`render`,ot],[`__scopeId`,`data-v-a74e7f31`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return L.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=R(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=[3,5,8,10,12,15],gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return L.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var wt=R(vt,[[`render`,Ct],[`__scopeId`,`data-v-496bf31c`]]),Tt=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=R(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:H,ElTooltip:w,InfoIcon:P,ImagePreview:Z},mixins:[Y,q,K],emits:[`change`],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rt=R(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:H,ElTooltip:w,ImagePreview:Z,InfoIcon:P},mixins:[Y,q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Bt={class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`};function Wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gt=R(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:H,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:je,UploadIcon:F},mixins:[q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ve(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Ce(be)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=$e(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Zt,[e(`div`,Qt,[e(`span`,$t,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,en,[e(`span`,tn,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var rn=R(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:H,ElUpload:C,UploadIcon:F,ImagePreview:Z,InfoIcon:P},mixins:[Y,q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[et(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,un,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var fn=R(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=R(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(L.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??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var Dn=R(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:On}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,An,[e(`div`,jn,[e(`span`,Mn,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Ln=R(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Hn=v({name:`InspirationPills`,components:{CloseIcon:he},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:ce,ElButton:H,PromptTextarea:te,InspirationPills:R(Hn,[[`render`,Kn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Jn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Yn=R(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:J,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var tr=R(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:he,IdeaIcon:ce,ElDrawer:A,ElButton:H},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=R(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:oe},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:H,ServicePricingSummary:Ne,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:R(vr,[[`render`,Tr],[`__scopeId`,`data-v-c800852a`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return We(`kling`,ye(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return z()&&B(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=B(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=B(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quote(ye(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=R(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:H,InfoIcon:P,ImagePreview:Z},mixins:[Y,q,K,Se],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=R(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:H,InfoIcon:P,FilePreview:je},mixins:[q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gr=R(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:J,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zr=R(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,ei,[e(`div`,ti,[e(`span`,ni,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ii=R($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||ai},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var di=R(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var vi=R(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var Ti=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:H,ServicePricingSummary:Ne,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:R(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return W({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Oi,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ai=R(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:xe},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Mi=[`title`],Ni={class:`text`};function Pi(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Ni,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=R(ji,[[`render`,Pi],[`__scopeId`,`data-v-e6a2bb26`]]),Ii={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:de.map(e=>({value:e,label:Ii[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=pe)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Vi=R(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:H,ElInput:J,ServicePricingSummary:Ne,InfoIcon:P,ImagePreview:Z,ModelSelector:Vi,ModeSelector:R(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[K,Se],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:V()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return W({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return z()&&B(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=B(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quoteTalkingPhoto(ge(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=R(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:ie,InfoIcon:se,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:H,ImagePreview:Z,VideoPreview:Ie,AudioPreview:Pe,ApiCodeButton:Re,ReportButton:Ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),P=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:R(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:re,BotPlaceholder:ze,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Ia,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Xe,RecentPanel:R(Fa,[[`render`,Ra]]),ShowcaseResultTabs:Ve},mixins:[De,He(`kling`),Be(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks},walletMode(){return this.taskType!==`motion`&&z()&&B(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){Oe(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=ye(this.config),t=Ue(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!me(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>X.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),G(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!Te())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof Ee||_e(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return we(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!me(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!Te())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),G(`kling`,X.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{_e(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!me(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=ge(e),n=this.createPaymentOperation(e=>X.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),G(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=R(za,[[`render`,Ha]]);export{Ua as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-CLubZdq7.js";import{n as x,t as S}from"./tabs-6hi2Rm4j.js";import{t as C}from"./upload-CIplFhpf.js";import{t as w}from"./tooltip-CbdHMzJA.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-BpGydDYc.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-DSMPU53I.js";import{t as j}from"./input-number-vH4-o6sA.js";import{t as M}from"./slider-ClOCINsJ.js";import{t as N}from"./switch-l4T7Q7-e.js";import{t as ee}from"./clock-DGhHlqhN.js";import{a as P,i as te,n as ne,r as re,s as ie,t as ae}from"./pagination-NYLKdTqd.js";import{t as oe}from"./headphones-0ejuxyR6.js";import{t as se}from"./info-C4cUVd29.js";import{t as ce}from"./lightbulb-D7mjO9Jh.js";import{t as le}from"./trash-2-DHDZkxkx.js";import{t as ue}from"./triangle-alert-BJ4LPyYk.js";import{t as F}from"./upload-R9TAaxbr.js";import{t as I}from"./wand-sparkles-B6SKd5hA.js";import{Ci as L,Si as de,vi as fe,xi as pe}from"./constants-BSFiYSou.js";import{$ as me,A as R,Fi as z,Ia as he,Li as B,Lr as ge,O as _e,Pa as V,Q as ve,Qa as H,Ra as U,Rr as ye,Sn as W,X as be,Xa as xe,Xi as G,Y as Se,Z as Ce,et as K,li as we,na as Te,nt as q,oo as J,rt as Y,si as Ee,tt as De,zi as Oe,zr as X}from"./index-DvTGM53_.js";import{t as ke}from"./CopyToClipboard-MUNdxLCY.js";import{t as Ae}from"./ReportButton-Cf9hMzLL.js";import{t as je}from"./FilePreview-CRqxouRS.js";import{t as Z}from"./ImagePreview-BxkzgXM2.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-CN74WnAC.js";import{t as Pe}from"./AudioPreview-CJIm_lvI.js";import{t as Fe}from"./VideoPlayer-DMwakGOn.js";import{t as Ie}from"./VideoPreview-BrfMXofe.js";import{t as Le}from"./ScenarioPaymentMode-Ul5m6vCS.js";import{t as Re}from"./ApiCodeButton-C_BQZfJW.js";import{t as ze}from"./BotPlaceholder-C-06_hGv.js";import{t as Be}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ve}from"./ShowcaseResultTabs-k0aVS8jN.js";import{t as He}from"./showcaseRecreateMixin-kWXcDwMJ.js";import{n as Ue,t as We}from"./generationInput-Daa5Los3.js";var Ge=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:H},mixins:[Me]}),Ke={class:`main flex flex-row flex-1 min-h-0`},qe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Je={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ke,[e(`div`,qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Je,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Xe=R(Ge,[[`render`,Ye],[`__scopeId`,`data-v-f4b791b5`]]),Ze={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Ze}}var $=`<<<video_1>>>`,Qe=/<<<image_\d+>>>/g;function $e(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function et(e){return e?e.replace(Qe,` `).replace(/\s{2,}/g,` `).trim():``}function tt(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Q(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function nt(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=$e(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=et(n.prompt));return n}var rt=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(fe)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=R(rt,[[`render`,ot],[`__scopeId`,`data-v-a74e7f31`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return L.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=R(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=[3,5,8,10,12,15],gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return L.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=nt({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var wt=R(vt,[[`render`,Ct],[`__scopeId`,`data-v-496bf31c`]]),Tt=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=R(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:H,ElTooltip:w,InfoIcon:P,ImagePreview:Z},mixins:[Y,q,K],emits:[`change`],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rt=R(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:H,ElTooltip:w,ImagePreview:Z,InfoIcon:P},mixins:[Y,q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Bt={class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`};function Wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gt=R(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:H,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:je,UploadIcon:F},mixins:[q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ve(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Ce(be)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=$e(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Zt,[e(`div`,Qt,[e(`span`,$t,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,en,[e(`span`,tn,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var rn=R(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:H,ElUpload:C,UploadIcon:F,ImagePreview:Z,InfoIcon:P},mixins:[Y,q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[et(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,un,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var fn=R(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=R(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(L.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??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var Dn=R(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:On}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,An,[e(`div`,jn,[e(`span`,Mn,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Ln=R(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Hn=v({name:`InspirationPills`,components:{CloseIcon:he},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:ce,ElButton:H,PromptTextarea:te,InspirationPills:R(Hn,[[`render`,Kn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Jn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Yn=R(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:J,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var tr=R(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:he,IdeaIcon:ce,ElDrawer:A,ElButton:H},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=R(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:oe},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:H,ServicePricingSummary:Ne,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:R(vr,[[`render`,Tr],[`__scopeId`,`data-v-c800852a`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return We(`kling`,ye(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return z()&&B(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=B(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=B(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quote(ye(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=R(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:H,InfoIcon:P,ImagePreview:Z},mixins:[Y,q,K,Se],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=R(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:H,InfoIcon:P,FilePreview:je},mixins:[q,K],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gr=R(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:J,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zr=R(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,ei,[e(`div`,ti,[e(`span`,ni,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ii=R($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||ai},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var di=R(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var vi=R(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var Ti=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:H,ServicePricingSummary:Ne,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:R(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return W({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Oi,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ai=R(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:xe},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Mi=[`title`],Ni={class:`text`};function Pi(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Ni,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=R(ji,[[`render`,Pi],[`__scopeId`,`data-v-e6a2bb26`]]),Ii={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:de.map(e=>({value:e,label:Ii[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=pe)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Vi=R(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:H,ElInput:J,ServicePricingSummary:Ne,InfoIcon:P,ImagePreview:Z,ModelSelector:Vi,ModeSelector:R(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[K,Se],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:V()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return W({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return z()&&B(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=B(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quoteTalkingPhoto(ge(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=R(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:ie,InfoIcon:se,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:H,ImagePreview:Z,VideoPreview:Ie,AudioPreview:Pe,ApiCodeButton:Re,ReportButton:Ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),P=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:R(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:re,BotPlaceholder:ze,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Ia,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Xe,RecentPanel:R(Fa,[[`render`,Ra]]),ShowcaseResultTabs:Ve},mixins:[De,He(`kling`),Be(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks},walletMode(){return this.taskType!==`motion`&&z()&&B(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){Oe(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=ye(this.config),t=Ue(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!me(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>X.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),G(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!Te())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof Ee||_e(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return we(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!me(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!Te())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),G(`kling`,X.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{_e(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!me(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=ge(e),n=this.createPaymentOperation(e=>X.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),G(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=R(za,[[`render`,Ha]]);export{Ua as default};