@acedatacloud/nexior 3.356.2 → 3.356.3

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 (294) hide show
  1. package/dist/assets/{ApiCodeButton-CiYVI-BW.js → ApiCodeButton-DnW2mEEl.js} +1 -1
  2. package/dist/assets/{Artifacts-oV-cxX6-.js → Artifacts-BbXNE0MY.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-BJ5H7v3C.js → AskUserQuestionCard-Cbw3Hxlr.js} +1 -1
  4. package/dist/assets/{Auth-DmbX4IcG.js → Auth-Csf5NVN-.js} +1 -1
  5. package/dist/assets/{Bare-CKC6gxoC.js → Bare-CtV6pjUP.js} +1 -1
  6. package/dist/assets/{BotPlaceholder-CWVuEjbL.js → BotPlaceholder-hcIRfy3i.js} +1 -1
  7. package/dist/assets/{BottomFooter-C80gDUXR.js → BottomFooter-DzQdavFJ.js} +1 -1
  8. package/dist/assets/{BrowserPairingDialog-NGsMVfzJ.js → BrowserPairingDialog-Cl__jmX7.js} +1 -1
  9. package/dist/assets/{Callback-CEITpQWh.js → Callback-CaJlsIlI.js} +1 -1
  10. package/dist/assets/{CodeSnippet-BUumFIYE.js → CodeSnippet-PjDE_CEu.js} +1 -1
  11. package/dist/assets/{Console-DaKR60hu.js → Console-B2Ek4SCM.js} +1 -1
  12. package/dist/assets/{Consumption-64yHTpsG.js → Consumption-C1nuDweL.js} +1 -1
  13. package/dist/assets/{Conversation-fDmuX-NP.js → Conversation-BMSIKWqv.js} +1 -1
  14. package/dist/assets/{Conversation-Br3QCbxZ.js → Conversation-inS0U5qq.js} +1 -1
  15. package/dist/assets/{CopyToClipboard-BoetcLMP.js → CopyToClipboard-CLVp5I29.js} +1 -1
  16. package/dist/assets/{Detail-xLit1ZcQ.js → Detail-4_enJ6qH.js} +2 -2
  17. package/dist/assets/{Extra-C2v1moyP.js → Extra-Ce7_Kba0.js} +1 -1
  18. package/dist/assets/{FilePreview-CL9QnaXZ.js → FilePreview-BlCzWGSp.js} +1 -1
  19. package/dist/assets/{Hailuo-BgKkSb1Z.js → Hailuo-CRu4cYR4.js} +1 -1
  20. package/dist/assets/{History-Csx7tGHq.js → History-CyDH3_w6.js} +1 -1
  21. package/dist/assets/{ImagePreview-Bc9stSGF.js → ImagePreview-DIR230rQ.js} +1 -1
  22. package/dist/assets/{ImageWrapper-BU9rTzRE.js → ImageWrapper-DTMYPBbG.js} +1 -1
  23. package/dist/assets/{Index-CbYgQHvA.js → Index-7-jB-rrs.js} +1 -1
  24. package/dist/assets/{Index-CxtAOMuR2.js → Index-B5t18uMS2.js} +1 -1
  25. package/dist/assets/{Index-BLkVvuW1.js → Index-B8Wivqji.js} +1 -1
  26. package/dist/assets/Index-BU-Jt2iC.css +1 -0
  27. package/dist/assets/{Index-Dp4r7Gxt.js → Index-BXIajqur.js} +1 -1
  28. package/dist/assets/{Index-C7sDNFdr.js → Index-Bh0MSga2.js} +1 -1
  29. package/dist/assets/{Index-MJKawRgO.js → Index-Bhge0Ye3.js} +1 -1
  30. package/dist/assets/{Index-BZIytdwE.js → Index-BjUC4Qy2.js} +1 -1
  31. package/dist/assets/{Index-Dy27xVwA.js → Index-BlIY8K2y.js} +1 -1
  32. package/dist/assets/{Index-B1r3Gul3.js → Index-Bp4mYiWT.js} +1 -1
  33. package/dist/assets/{Index-CFxfsEB3.js → Index-Bpv_QguW.js} +1 -1
  34. package/dist/assets/{Index-ip9nThQe.js → Index-BrILi0-c.js} +1 -1
  35. package/dist/assets/{Index-D29WuERC.js → Index-C-wEZgIN.js} +1 -1
  36. package/dist/assets/Index-CBybAWmy.js +1 -0
  37. package/dist/assets/{Index-ByElOcMX.js → Index-CGHYkqjO.js} +1 -1
  38. package/dist/assets/{Index-fb0d5Ij8.js → Index-CMihZ-nT.js} +1 -1
  39. package/dist/assets/{Index-D1kTVn4v.js → Index-CNdFXrFF.js} +1 -1
  40. package/dist/assets/{Index-CUKoS2jG2.js → Index-CVhzkBCU2.js} +1 -1
  41. package/dist/assets/{Index-CzZIKZir.js → Index-CWPkVAGu.js} +1 -1
  42. package/dist/assets/{Index-fCMXDMdR.js → Index-CbuI24qA.js} +1 -1
  43. package/dist/assets/{Index-BSOYkVrY2.js → Index-CyI5B5Iw2.js} +1 -1
  44. package/dist/assets/{Index-cmED8Wf82.js → Index-D2n66vom2.js} +1 -1
  45. package/dist/assets/{Index-DVZYw8Ti.js → Index-D5cJIMqk.js} +1 -1
  46. package/dist/assets/{Index-D1mfppvZ.js → Index-D89ynFEG.js} +1 -1
  47. package/dist/assets/{Index-BWKAgE_L.js → Index-DExxCDca.js} +1 -1
  48. package/dist/assets/{Index-BMvzcOYA.js → Index-DYxSLsTm.js} +1 -1
  49. package/dist/assets/{Index-BbpkGoZb.js → Index-DZ8exWOg.js} +1 -1
  50. package/dist/assets/{Index-C79dNjpN.js → Index-DgR8EjvG.js} +1 -1
  51. package/dist/assets/{Index-BzEW9qOH.js → Index-F5FVH4XA.js} +1 -1
  52. package/dist/assets/{Index-B7ZIhLPz.js → Index-IWedAkVJ.js} +1 -1
  53. package/dist/assets/{Index-DVb4v3oF.js → Index-KWeUZuBG.js} +1 -1
  54. package/dist/assets/{Index-EXzPO3cH.js → Index-KigOtr6Q.js} +1 -1
  55. package/dist/assets/{Index-d0Ax26tm.js → Index-Q9SnXeG5.js} +1 -1
  56. package/dist/assets/{Index-CHjMy5ex2.js → Index-b_bVC-2v2.js} +1 -1
  57. package/dist/assets/{Index-DHDKggl22.js → Index-fAKzMOZY2.js} +1 -1
  58. package/dist/assets/{Invitees-Cjh_HkSH.js → Invitees-t8LjUtox.js} +1 -1
  59. package/dist/assets/{List-pfCsf92F.js → List-BcdTB0xZ.js} +1 -1
  60. package/dist/assets/{List-dw1Xv1Kt.js → List-CiRlLqQi.js} +1 -1
  61. package/dist/assets/{List-Dj0wsQZF.js → List-D0ppoVM_.js} +1 -1
  62. package/dist/assets/{LocalTools-Dz6pS18B.js → LocalTools-8f1nIu1i.js} +1 -1
  63. package/dist/assets/{LocalTools-L1Z9CYWz.js → LocalTools-TuBOV-fy.js} +1 -1
  64. package/dist/assets/{Logo-IS52iyq3.js → Logo-BIQjmFe8.js} +1 -1
  65. package/dist/assets/{Main-CKzyMm5n.js → Main-BM7WSyw6.js} +1 -1
  66. package/dist/assets/{Message-CYvcKMlp.js → Message-CrGhKWMq.js} +2 -2
  67. package/dist/assets/{Model-C2N_nPmj.js → Model-BDoRG1y3.js} +1 -1
  68. package/dist/assets/{Navigator-DbZtnb_p.js → Navigator-Uk0XBf21.js} +3 -3
  69. package/dist/assets/{NotFound-P7fqDiGG.js → NotFound-BxmMuusa.js} +1 -1
  70. package/dist/assets/{PageHeader-SdNvT1p3.js → PageHeader-B7aH63od.js} +1 -1
  71. package/dist/assets/{Pay-CkRLPLzC.js → Pay-a8uYoEfm.js} +1 -1
  72. package/dist/assets/{Player-cWxD5Tss.js → Player-tEjbz8km.js} +1 -1
  73. package/dist/assets/{Poivelle-BnqjulQy.js → Poivelle-D2Pg88fJ.js} +1 -1
  74. package/dist/assets/{RealtimeCall-Bp8EL62t.js → RealtimeCall-Dh_EECLN.js} +1 -1
  75. package/dist/assets/{ReportButton-D7JGzuC6.js → ReportButton-CYa13w8h.js} +1 -1
  76. package/dist/assets/{ReportDialog-DmMuOP3a.js → ReportDialog-BdPWn65b.js} +1 -1
  77. package/dist/assets/{ScheduledTasks-DTSyAEUZ.js → ScheduledTasks-d52JFkP6.js} +1 -1
  78. package/dist/assets/{Status-CSRYA8fU.js → Status-xxs4gXOB.js} +1 -1
  79. package/dist/assets/{Subscribe-Ci1vhdb7.js → Subscribe-DgrTtF4n.js} +1 -1
  80. package/dist/assets/{TabSwitcher-ClLXbedz.js → TabSwitcher-C_N_7W5M.js} +1 -1
  81. package/dist/assets/{Tts-BtFmYfFd.js → Tts-ZE4EzLsJ.js} +1 -1
  82. package/dist/assets/{VideoPlayer-DZajGyHg.js → VideoPlayer-C44SsSWU.js} +1 -1
  83. package/dist/assets/{VideoPreview-yy9EIf_l.js → VideoPreview-D2JHTDU8.js} +1 -1
  84. package/dist/assets/arrow-down-DfZZ6O9V.js +1 -0
  85. package/dist/assets/{arrow-down-wide-narrow-Bh9l3U0_.js → arrow-down-wide-narrow-CXsartjU.js} +1 -1
  86. package/dist/assets/arrow-left-uQ2QSI6E.js +1 -0
  87. package/dist/assets/arrow-right-DLK8H_c3.js +1 -0
  88. package/dist/assets/arrow-up-CySfbL5G.js +1 -0
  89. package/dist/assets/{authorizeFlow-B9aZMxfA.js → authorizeFlow-qoRgSMcK.js} +1 -1
  90. package/dist/assets/{avatar-D8dj7T0j.js → avatar-B9amXRqx.js} +1 -1
  91. package/dist/assets/{basic-BRAq7Qs_.js → basic-POh0fuWQ.js} +1 -1
  92. package/dist/assets/{book-open-Bgt2CzJP.js → book-open-DJntghzP.js} +1 -1
  93. package/dist/assets/{box-K1AOg2Dt.js → box-BgafcOxN.js} +1 -1
  94. package/dist/assets/{boxes-nkCCYn_H.js → boxes-BxwF-h52.js} +1 -1
  95. package/dist/assets/{brain-OfFe2iNh.js → brain-DRAL5UnC.js} +1 -1
  96. package/dist/assets/{chart-no-axes-combined-NmmizHnk.js → chart-no-axes-combined-C2XBdAJR.js} +1 -1
  97. package/dist/assets/{chat-fmefJyfA.js → chat-C-QhdNDG.js} +1 -1
  98. package/dist/assets/check-C1SSXE37.js +1 -0
  99. package/dist/assets/chevron-down-D54yUG_W.js +1 -0
  100. package/dist/assets/chevron-right-kcQrk7a4.js +1 -0
  101. package/dist/assets/circle-check-B7M0eLJf.js +1 -0
  102. package/dist/assets/{circle-question-mark-J5LrgC7z.js → circle-question-mark-CkrnC9TN.js} +1 -1
  103. package/dist/assets/{clipboard-list-D6rxrE8d.js → clipboard-list-BQu_m5lA.js} +1 -1
  104. package/dist/assets/clock-DcgPnVJa.js +1 -0
  105. package/dist/assets/code-Cx-HLyjl.js +1 -0
  106. package/dist/assets/{codingBridge-CWXTjgaq.js → codingBridge-5Younw34.js} +2 -2
  107. package/dist/assets/{codingBridgeNotify-CNQGGqEk.js → codingBridgeNotify-dNV0kJQ8.js} +2 -2
  108. package/dist/assets/{coins-CA8lophH.js → coins-gBDFWv_r.js} +1 -1
  109. package/dist/assets/{collapse-LIyzteME.js → collapse-B_99IkFQ.js} +1 -1
  110. package/dist/assets/{constants-CQR8cCBL.js → constants-C44cV5UH.js} +1 -1
  111. package/dist/assets/{copy-B489PY7H.js → copy-DpODTAxb.js} +1 -1
  112. package/dist/assets/{createTaskActions-hQu69zYP.js → createTaskActions-bHjJf96C.js} +1 -1
  113. package/dist/assets/{digitalhuman-C-m4TlWk.js → digitalhuman-DgSMt73W.js} +1 -1
  114. package/dist/assets/{dollar-sign-d8zK5thl.js → dollar-sign-BGeaa3gL.js} +1 -1
  115. package/dist/assets/{download-CoMPboZJ.js → download-CZLXh4-2.js} +1 -1
  116. package/dist/assets/{drawer-BMRGHI-3.js → drawer-CL63mgQu.js} +1 -1
  117. package/dist/assets/{dropdown-DzzmAJqH.js → dropdown-B8Z-l-iE.js} +1 -1
  118. package/dist/assets/{dropdown-fFM8TrPr.js → dropdown-kUTe8e-9.js} +1 -1
  119. package/dist/assets/{ellipsis-Cxuin38H.js → ellipsis-Du3lY52z.js} +1 -1
  120. package/dist/assets/esm-B1tUH8kr.js +1 -0
  121. package/dist/assets/{esm-DWKsBcY1.js → esm-BGOjVEnk.js} +3 -3
  122. package/dist/assets/{esm-DlTz8W4O.js → esm-DHZANs_t.js} +2 -2
  123. package/dist/assets/{esm-xG4UB0yZ.js → esm-DOo7uPDb.js} +2 -2
  124. package/dist/assets/{esm-DtlST3qG.js → esm-DTElW73d.js} +1 -1
  125. package/dist/assets/{esm-BDC0wUT8.js → esm-aYaknvQ1.js} +1 -1
  126. package/dist/assets/{esm-E98t4dD8.js → esm-j1DgBTjx.js} +1 -1
  127. package/dist/assets/{external-link-CgEa7yis.js → external-link-dZgWEqL4.js} +1 -1
  128. package/dist/assets/{eye-C4SyrpXf.js → eye-DFp2jfce.js} +1 -1
  129. package/dist/assets/{file-BNfEG5IF.js → file-DvOzOx_P.js} +1 -1
  130. package/dist/assets/{file-output-DNvvFeOx.js → file-output-19dlKJBf.js} +1 -1
  131. package/dist/assets/{file-text--Qjz57wL.js → file-text-mDCcsztI.js} +1 -1
  132. package/dist/assets/{fish-BhaYIY2P.js → fish-D60Al1yj.js} +1 -1
  133. package/dist/assets/{flux-SeBD2b5R.js → flux-d_SeQnk9.js} +1 -1
  134. package/dist/assets/{folder-DcItLXw1.js → folder-DbyunSbX.js} +1 -1
  135. package/dist/assets/gauge-CdYwce4s.js +1 -0
  136. package/dist/assets/{globe-DcRbETD-.js → globe-BhHHcHQD.js} +1 -1
  137. package/dist/assets/{grokvideo-CwVElxKX.js → grokvideo-S1pCi5Tr.js} +1 -1
  138. package/dist/assets/{hailuo-maOTnYd1.js → hailuo-M_qwVpNw.js} +1 -1
  139. package/dist/assets/{headphones-DCnnsYrD.js → headphones-Dr9_CJTJ.js} +1 -1
  140. package/dist/assets/{history-5dWDE2j4.js → history-CCILjiNN.js} +1 -1
  141. package/dist/assets/{house-BIolUNvl.js → house-BTwHBckD.js} +1 -1
  142. package/dist/assets/{i18n-D69rWLe_.js → i18n-Cqi3MO17.js} +1 -1
  143. package/dist/assets/{image-l7GEfh5m.js → image-ltLE0_B2.js} +1 -1
  144. package/dist/assets/{index-DIgS5Gvp.js → index-CREYJmGZ.js} +6 -6
  145. package/dist/assets/{index.browser.esm-BglHW4F-.js → index.browser.esm-NRFegStZ.js} +1 -1
  146. package/dist/assets/{index.es-Ci-Vjlrb.js → index.es-Dp5oaXS7.js} +1 -1
  147. package/dist/assets/{info-C40CnPeL.js → info-B6zz-sKo.js} +1 -1
  148. package/dist/assets/{input-number-ByXVBT4t.js → input-number-u0MGro2n.js} +1 -1
  149. package/dist/assets/intro-2CIeLa4V.js +1 -0
  150. package/dist/assets/intro-BQHGX5HW.js +1 -0
  151. package/dist/assets/intro-BTSbJEHO.js +1 -0
  152. package/dist/assets/intro-BuaD45ZB.js +1 -0
  153. package/dist/assets/intro-CVqOAs0d.js +1 -0
  154. package/dist/assets/intro-CX-tVM1n.js +1 -0
  155. package/dist/assets/intro-CumGy2RC.js +1 -0
  156. package/dist/assets/intro-D26BGrp9.js +1 -0
  157. package/dist/assets/intro-D7SWXPm3.js +1 -0
  158. package/dist/assets/intro-DFfBLUfo.js +1 -0
  159. package/dist/assets/intro-Dq8aF71M.js +1 -0
  160. package/dist/assets/intro-HirJwSQO.js +1 -0
  161. package/dist/assets/intro-JkrATbbK.js +1 -0
  162. package/dist/assets/intro-Y10dLinG.js +1 -0
  163. package/dist/assets/intro-Z5WuhH2a.js +1 -0
  164. package/dist/assets/intro-bo9fZbK4.js +1 -0
  165. package/dist/assets/intro-msK-p0lY.js +1 -0
  166. package/dist/assets/intro-zxCwJqFb.js +1 -0
  167. package/dist/assets/{key-round-D4yW8b4H.js → key-round-CgK5ul3S.js} +1 -1
  168. package/dist/assets/{kling-BBObHQ4y.js → kling-DdPnVX2L.js} +1 -1
  169. package/dist/assets/{languages-DPAWujhs.js → languages-CVKa6GSx.js} +1 -1
  170. package/dist/assets/{laptop-CkMMUQQ5.js → laptop-C1UtQchD.js} +1 -1
  171. package/dist/assets/{lightbulb-BYkyNQBq.js → lightbulb-DMMH-itQ.js} +1 -1
  172. package/dist/assets/{link-DKCPP9JK.js → link-Ck182LqI.js} +1 -1
  173. package/dist/assets/loader-circle-BJdKG6dp.js +1 -0
  174. package/dist/assets/{lock-D-SCAKKf.js → lock-DGLRMLsk.js} +1 -1
  175. package/dist/assets/{luma-CWo2eJhn.js → luma-D08kYXX2.js} +1 -1
  176. package/dist/assets/{maestro-D6pCMVdC.js → maestro-BSTyCJsV.js} +1 -1
  177. package/dist/assets/{maestro-Dk0xw1uy.js → maestro-wC6egBQw.js} +1 -1
  178. package/dist/assets/{mail-DsWU4MNx.js → mail-Dte9tFt2.js} +1 -1
  179. package/dist/assets/{message-circle-PQt0Q2mh.js → message-circle-DWzinnDO.js} +1 -1
  180. package/dist/assets/{mic-CrSotd0p.js → mic-Dow6VrJE.js} +1 -1
  181. package/dist/assets/{midjourney-w3B_dqpl.js → midjourney-BPtltduI.js} +1 -1
  182. package/dist/assets/{mobileLocalExec-CN1GlgN2.js → mobileLocalExec-DaDhbwJt.js} +2 -2
  183. package/dist/assets/{models-CwEjR6Nf.js → models-DcpkDkjF.js} +1 -1
  184. package/dist/assets/{monitor-BHx1oad3.js → monitor-DkCq84E2.js} +1 -1
  185. package/dist/assets/{mouse-pointer-2-BSu7sguX.js → mouse-pointer-2-9VJBV_22.js} +1 -1
  186. package/dist/assets/music-2-iJ0GWVrl.js +1 -0
  187. package/dist/assets/{nanobanana-CtkE9yDF.js → nanobanana-CYmgToNy.js} +1 -1
  188. package/dist/assets/{omni-DXnPbKHE.js → omni-CldP_ZwX.js} +1 -1
  189. package/dist/assets/{openaiimage-6vtOuJFv.js → openaiimage-d3GjQIMh.js} +1 -1
  190. package/dist/assets/{pagination-CebMKB63.js → pagination-BbFTEjBg.js} +1 -1
  191. package/dist/assets/{pagination-CP5QlGv2.js → pagination-IckkXpUO.js} +1 -1
  192. package/dist/assets/{pagination-BNPMPfyr.js → pagination-uq23xZEg.js} +1 -1
  193. package/dist/assets/{palette-DGHTNrTx.js → palette-D_hzvJDa.js} +1 -1
  194. package/dist/assets/{paperclip-D7VNr9Qq.js → paperclip-BYNr5XFL.js} +1 -1
  195. package/dist/assets/{pause-Ck2Rq3YJ.js → pause-BWpPJP_R.js} +1 -1
  196. package/dist/assets/{pencil-Djn9Hc9z.js → pencil-BhwkvOrn.js} +1 -1
  197. package/dist/assets/{pika-HczyW99B.js → pika-CLJeCDA-.js} +1 -1
  198. package/dist/assets/{pixverse-b652Co6y.js → pixverse-CmbNyRQT.js} +1 -1
  199. package/dist/assets/play-CJx7xQc1.js +1 -0
  200. package/dist/assets/{plug-B6e7XxKm.js → plug-Bm5lTQdF.js} +1 -1
  201. package/dist/assets/plus--lrUTaV9.js +1 -0
  202. package/dist/assets/{poivelle-BkvmnyzU.js → poivelle-BCa_2ckb.js} +1 -1
  203. package/dist/assets/{popover-Br-sCBHH.js → popover-s9P5QTaN.js} +1 -1
  204. package/dist/assets/{producer-D0wRhvwS.js → producer-CJpFQFtR.js} +1 -1
  205. package/dist/assets/{qrart-BrgI_rXw.js → qrart-j4X6G25p.js} +1 -1
  206. package/dist/assets/{realtime-mVqPss9r.js → realtime-DGslBgjF.js} +1 -1
  207. package/dist/assets/{refresh-cw-DqyQYIrN.js → refresh-cw-DsZHH-ne.js} +1 -1
  208. package/dist/assets/rotate-ccw-CwG8Tr4q.js +1 -0
  209. package/dist/assets/rotate-cw-is7J0f7E.js +1 -0
  210. package/dist/assets/{row-Cbv7FLTy.js → row-DQqpuvYH.js} +1 -1
  211. package/dist/assets/search-B-v-GhMv.js +1 -0
  212. package/dist/assets/{seedance-K37GcyFq.js → seedance-DyH2BqTs.js} +1 -1
  213. package/dist/assets/{seedream-DHdTsMrg.js → seedream-LGwBa99t.js} +1 -1
  214. package/dist/assets/{select-CUw_YhcY.js → select-jRFQ1Hzk.js} +1 -1
  215. package/dist/assets/{serp-b5iBdcvx.js → serp-BdAsrKwn.js} +1 -1
  216. package/dist/assets/{shield-CzPrLCPw.js → shield-41WYVrpG.js} +1 -1
  217. package/dist/assets/{shuffle-DI8PXiNu.js → shuffle-bmih4UqZ.js} +1 -1
  218. package/dist/assets/{slider-508i2Vb5.js → slider-B_xhGTdh.js} +1 -1
  219. package/dist/assets/{solana-wallets-DLq6-GrY.js → solana-wallets-DYmoNImk.js} +2 -2
  220. package/dist/assets/{solana-wallets-vue-Crh7p7UD.js → solana-wallets-vue-B5OBaahJ.js} +1 -1
  221. package/dist/assets/{sora-D5EIXmmO.js → sora-o-5xigw-.js} +1 -1
  222. package/dist/assets/{sparkles-BFNqXTZL.js → sparkles-BIuDjfQg.js} +1 -1
  223. package/dist/assets/square-OXtSEmlD.js +1 -0
  224. package/dist/assets/{store-BaH2jfBX.js → store-Co9jwnq8.js} +1 -1
  225. package/dist/assets/{suno-BuLDW1Vh.js → suno-FRCRn1YL.js} +1 -1
  226. package/dist/assets/{switch-BHE5VSJC.js → switch-CP09CWeK.js} +1 -1
  227. package/dist/assets/{table-C42opMok.js → table-Cg2N5b5E.js} +1 -1
  228. package/dist/assets/{tabs-BFs4t-aK.js → tabs-DsmI05G2.js} +1 -1
  229. package/dist/assets/{tag-CScqQXGX.js → tag-YwN0l1gW.js} +1 -1
  230. package/dist/assets/terminal-D9ZMN0k5.js +1 -0
  231. package/dist/assets/{time-picker-CEYuPPVi.js → time-picker-BqcqHMtN.js} +1 -1
  232. package/dist/assets/{tooltip-xGYGkgTR.js → tooltip-bfg-03mE.js} +1 -1
  233. package/dist/assets/{trash-2-xb-Jm4i0.js → trash-2-CDz5PwCk.js} +1 -1
  234. package/dist/assets/{triangle-alert-COLtfogn.js → triangle-alert-Z8DwGNFK.js} +1 -1
  235. package/dist/assets/{upload-Bu37nR-5.js → upload-CYgk_oSr.js} +1 -1
  236. package/dist/assets/{upload-CI1ZP51F.js → upload-DerPm8IS.js} +1 -1
  237. package/dist/assets/user-C8SZiVQC.js +1 -0
  238. package/dist/assets/{veo-Bl64NYd7.js → veo-DUuufx00.js} +1 -1
  239. package/dist/assets/{video-CYTJ80IP.js → video-Brn0_a8G.js} +1 -1
  240. package/dist/assets/{volume-2-Cd9jV3NX.js → volume-2-ovELC7ze.js} +1 -1
  241. package/dist/assets/{wallet-g88KrNyB.js → wallet-9ymkHmqV.js} +1 -1
  242. package/dist/assets/{wan-a4X7kt1x.js → wan-Bw9kZwn9.js} +1 -1
  243. package/dist/assets/{wand-sparkles-DDyMsIR4.js → wand-sparkles-yU_7R4u-.js} +1 -1
  244. package/dist/assets/{web-BK1giVaU.js → web-BHLJMImD.js} +1 -1
  245. package/dist/assets/{web-Bk36mANR.js → web-BoThAuaz.js} +1 -1
  246. package/dist/assets/{web-BrXDDpbD.js → web-BzrH1Vlj.js} +1 -1
  247. package/dist/assets/{web-BSXd6Enl.js → web-Dc_YylFI.js} +1 -1
  248. package/dist/assets/{web-CN5hmZ5J.js → web-Dgy8v0wC.js} +1 -1
  249. package/dist/assets/{webextrator-J-SZn-nF.js → webextrator-D-jr1MFk.js} +1 -1
  250. package/dist/assets/{zap-UpSN-PKO.js → zap-C0PdDJso.js} +1 -1
  251. package/dist/index.html +4 -4
  252. package/package.json +1 -1
  253. package/dist/assets/Index-DNp3_EIy.js +0 -1
  254. package/dist/assets/Index-Dt0MGZVR.css +0 -1
  255. package/dist/assets/arrow-down-D1ze7Zz7.js +0 -1
  256. package/dist/assets/arrow-left-i-SsgbVR.js +0 -1
  257. package/dist/assets/arrow-right-HPaEW4ct.js +0 -1
  258. package/dist/assets/arrow-up-DPsaJu0u.js +0 -1
  259. package/dist/assets/check-D7wYAXxh.js +0 -1
  260. package/dist/assets/chevron-down-7kJMC2ch.js +0 -1
  261. package/dist/assets/chevron-right-BaNlttpH.js +0 -1
  262. package/dist/assets/circle-check-BlfTJ16z.js +0 -1
  263. package/dist/assets/clock-CS3ZX4nf.js +0 -1
  264. package/dist/assets/code-C18Pb5Rt.js +0 -1
  265. package/dist/assets/esm-BL-lS1AO.js +0 -1
  266. package/dist/assets/gauge-DMrbDCVd.js +0 -1
  267. package/dist/assets/intro-7jC51zyA.js +0 -1
  268. package/dist/assets/intro-B4j8G6Wn.js +0 -1
  269. package/dist/assets/intro-B7ZR6MnR.js +0 -1
  270. package/dist/assets/intro-B_1eX0NN.js +0 -1
  271. package/dist/assets/intro-Bcw1QD06.js +0 -1
  272. package/dist/assets/intro-C9lKNVJp.js +0 -1
  273. package/dist/assets/intro-CIqtCCxn.js +0 -1
  274. package/dist/assets/intro-CSc4mVpE.js +0 -1
  275. package/dist/assets/intro-CuHGodEn.js +0 -1
  276. package/dist/assets/intro-CzRUcQTo.js +0 -1
  277. package/dist/assets/intro-D-bQZq5n.js +0 -1
  278. package/dist/assets/intro-D3xF3uFy.js +0 -1
  279. package/dist/assets/intro-DhjBVTet.js +0 -1
  280. package/dist/assets/intro-SJ6J3iZY.js +0 -1
  281. package/dist/assets/intro-eclZL9RF.js +0 -1
  282. package/dist/assets/intro-mc9fOYHH.js +0 -1
  283. package/dist/assets/intro-mnSZn8oq.js +0 -1
  284. package/dist/assets/intro-tDJyt_-M.js +0 -1
  285. package/dist/assets/loader-circle-DC7tP4px.js +0 -1
  286. package/dist/assets/music-2-C2YDBG9V.js +0 -1
  287. package/dist/assets/play-DFR_GqpJ.js +0 -1
  288. package/dist/assets/plus-lIyMOEZf.js +0 -1
  289. package/dist/assets/rotate-ccw-D9mZ9lfD.js +0 -1
  290. package/dist/assets/rotate-cw-CwiEEFRc.js +0 -1
  291. package/dist/assets/search-iterppMr.js +0 -1
  292. package/dist/assets/square-Bl9we4gC.js +0 -1
  293. package/dist/assets/terminal-BlBAbz4X.js +0 -1
  294. package/dist/assets/user-DV5LrGq4.js +0 -1
@@ -1 +1 @@
1
- import{A as e,Jt as t,L as n,M as r,N as i,at as a,tt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./arrow-left-i-SsgbVR.js";import{t as l}from"./house-BIolUNvl.js";import{O as u}from"./index-DIgS5Gvp.js";var d=s({name:`NotFound`,components:{BackIcon:c,HomeIcon:l},computed:{path(){return this.$route?.fullPath||``}},mounted(){let e=document.querySelector(`meta[name="robots"]`);e||(e=document.createElement(`meta`),e.setAttribute(`name`,`robots`),document.head.appendChild(e)),e.setAttribute(`content`,`noindex, nofollow`)},beforeUnmount(){let e=document.querySelector(`meta[name="robots"]`);e&&e.setAttribute(`content`,`index, follow`)},methods:{goHome(){this.$router.push(`/`)},goBack(){window.history.length>1?this.$router.back():this.$router.push(`/`)}}}),f={class:`not-found`},p={class:`content`},m={class:`eyebrow`},h={class:`title`},g={class:`subtitle`},_={class:`actions`},v={key:0,class:`path`},y={class:`path__label`},b={class:`path__value`};function x(s,c,l,u,d,x){let S=a(`home-icon`),C=a(`back-icon`);return o(),i(`div`,f,[c[3]||=e(`div`,{class:`glow`,"aria-hidden":`true`},null,-1),e(`main`,p,[e(`p`,m,t(s.$t(`common.message.notFoundEyebrow`)),1),c[2]||=e(`div`,{class:`code`,"aria-hidden":`true`},`404`,-1),e(`h1`,h,t(s.$t(`common.title.notFound`)),1),e(`p`,g,t(s.$t(`common.message.notFound`)),1),e(`div`,_,[e(`button`,{class:`btn btn--primary`,onClick:c[0]||=(...e)=>s.goHome&&s.goHome(...e)},[n(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.backToHome`)),1)]),e(`button`,{class:`btn btn--ghost`,onClick:c[1]||=(...e)=>s.goBack&&s.goBack(...e)},[n(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.goBack`)),1)])]),s.path?(o(),i(`div`,v,[e(`span`,y,t(s.$t(`common.message.notFoundPath`)),1),e(`code`,b,t(s.path),1)])):r(``,!0)])])}var S=u(d,[[`render`,x],[`__scopeId`,`data-v-40e4e98c`]]);export{S as default};
1
+ import{A as e,Jt as t,L as n,M as r,N as i,at as a,tt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./arrow-left-uQ2QSI6E.js";import{t as l}from"./house-BTwHBckD.js";import{O as u}from"./index-CREYJmGZ.js";var d=s({name:`NotFound`,components:{BackIcon:c,HomeIcon:l},computed:{path(){return this.$route?.fullPath||``}},mounted(){let e=document.querySelector(`meta[name="robots"]`);e||(e=document.createElement(`meta`),e.setAttribute(`name`,`robots`),document.head.appendChild(e)),e.setAttribute(`content`,`noindex, nofollow`)},beforeUnmount(){let e=document.querySelector(`meta[name="robots"]`);e&&e.setAttribute(`content`,`index, follow`)},methods:{goHome(){this.$router.push(`/`)},goBack(){window.history.length>1?this.$router.back():this.$router.push(`/`)}}}),f={class:`not-found`},p={class:`content`},m={class:`eyebrow`},h={class:`title`},g={class:`subtitle`},_={class:`actions`},v={key:0,class:`path`},y={class:`path__label`},b={class:`path__value`};function x(s,c,l,u,d,x){let S=a(`home-icon`),C=a(`back-icon`);return o(),i(`div`,f,[c[3]||=e(`div`,{class:`glow`,"aria-hidden":`true`},null,-1),e(`main`,p,[e(`p`,m,t(s.$t(`common.message.notFoundEyebrow`)),1),c[2]||=e(`div`,{class:`code`,"aria-hidden":`true`},`404`,-1),e(`h1`,h,t(s.$t(`common.title.notFound`)),1),e(`p`,g,t(s.$t(`common.message.notFound`)),1),e(`div`,_,[e(`button`,{class:`btn btn--primary`,onClick:c[0]||=(...e)=>s.goHome&&s.goHome(...e)},[n(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.backToHome`)),1)]),e(`button`,{class:`btn btn--ghost`,onClick:c[1]||=(...e)=>s.goBack&&s.goBack(...e)},[n(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.goBack`)),1)])]),s.path?(o(),i(`div`,v,[e(`span`,y,t(s.$t(`common.message.notFoundPath`)),1),e(`code`,b,t(s.path),1)])):r(``,!0)])])}var S=u(d,[[`render`,x],[`__scopeId`,`data-v-40e4e98c`]]);export{S as default};
@@ -1 +1 @@
1
- import{A as e,Jt as t,M as n,N as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{O as o}from"./index-DIgS5Gvp.js";var s=a({name:`ConsolePageHeader`,props:{title:{type:String,required:!0},subtitle:{type:String,default:``}}}),c={class:`page-heading`},l={class:`page-title`},u={key:0,class:`page-subtitle`};function d(a,o,s,d,f,p){return i(),r(`div`,c,[e(`h2`,l,t(a.title),1),a.subtitle?(i(),r(`p`,u,t(a.subtitle),1)):n(``,!0)])}var f=o(s,[[`render`,d],[`__scopeId`,`data-v-98d2d413`]]);export{f as t};
1
+ import{A as e,Jt as t,M as n,N as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{O as o}from"./index-CREYJmGZ.js";var s=a({name:`ConsolePageHeader`,props:{title:{type:String,required:!0},subtitle:{type:String,default:``}}}),c={class:`page-heading`},l={class:`page-title`},u={key:0,class:`page-subtitle`};function d(a,o,s,d,f,p){return i(),r(`div`,c,[e(`h2`,l,t(a.title),1),a.subtitle?(i(),r(`p`,u,t(a.subtitle),1)):n(``,!0)])}var f=o(s,[[`render`,d],[`__scopeId`,`data-v-98d2d413`]]);export{f as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{t as p}from"./alert-BprQRUmf.js";import{o as m,v as ee}from"./models-CwEjR6Nf.js";import{t as h}from"./card-IQwqnRJR.js";import{n as g,t as _}from"./row-Cbv7FLTy.js";import{i as v,n as y,r as b,t as x}from"./wechat-B_xvylqk.js";import{t as S}from"./divider-Du_3kymg.js";import{t as C}from"./skeleton-Dj_a_iIP.js";import{Ei as w,Fi as T,Ni as E,O as D,Wt as O,an as k,li as A,mr as j,pi as te,sn as M}from"./index-DIgS5Gvp.js";import{t as N}from"./CopyToClipboard-BoetcLMP.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:w,ElButton:T,QrCode:O,ElRow:_,ElCol:g},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return y()&&!x()},isMobileInsideWechat(){return y()&&x()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await M(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):ee.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),F={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},I={class:`text-[14px] mb-3 leading-relaxed`},L={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},R={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},z={class:`text-[14px] mb-4 leading-relaxed`},B={class:`paycode wechat`},V={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function H(t,s,f,p,m,ee){let h=c(`qr-code`),g=c(`el-button`),_=c(`el-col`),v=c(`el-row`),y=c(`el-dialog`);return d(),l(y,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:t.dialogWidth,center:``,onClose:s[0]||=e=>t.$emit(`hide`)},{default:u(()=>[t.isMobileOutsideWechat?(d(),o(`div`,F,[e(`p`,I,r(t.$t(`order.message.wechatPayMobileScanTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,L,r(t.$t(`order.message.wechatPayMobileHint`)),1),i(g,{size:`default`,round:``,class:`w-[220px]`,onClick:t.onCopyLink},{default:u(()=>[n(r(t.copied?t.$t(`common.message.copied`):t.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):t.isMobileInsideWechat?(d(),o(`div`,R,[e(`p`,z,r(t.$t(`order.message.wechatPayLongPressTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(d(),l(v,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:u(()=>[i(_,{span:12},{default:u(()=>[e(`div`,B,[t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,V,r(t.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(_,{span:12},{default:u(()=>[...s[1]||=[e(`div`,{class:`help-img`},[e(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var U=D(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),G={class:`text-center`};function K(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,G,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var q=D(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),J={class:`text-center`};function Y(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,J,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var X=D(ne,[[`render`,Y]]),Z=7e3,re=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e.Card=`Card`,e}(Q||{}),ie=f({name:`OrderPublicPay`,components:{ElButton:T,ElRow:_,ElCol:g,ElCard:h,ElSkeleton:C,ElDivider:S,ElAlert:p,ElDescriptions:b,ElDescriptionsItem:v,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:m,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``},config(){return this.$store.getters.config},enableCard(){return!!this.config?.features?.ENABLE_CARD},showPayment(){return!te()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:k,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`),Card:this.$t(`order.title.card`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,j.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await j.get(this.id);if(this.order=e,e?.state===m.PAID||e?.state===m.FINISHED||e?.state===m.FAILED||e?.state===m.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,Z))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=A()),j.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ae={class:`title`},oe={key:0,class:`pt-5`},se={key:1,class:`pt-10 text-center`},ce={key:2,class:`order`},le={key:0,class:`price current unfree`},ue={key:1,class:`price free`},de={key:0,class:`payways mb-6`},fe={class:`payname`},pe={class:`payname`},$={class:`payname`},me={class:`payname`},he={key:1},ge={key:2};function _e(f,p,m,ee,h,g){let _=c(`el-col`),v=c(`el-row`),y=c(`el-skeleton`),b=c(`el-alert`),x=c(`copy-to-clipboard`),S=c(`el-descriptions-item`),C=c(`el-tag`),w=c(`el-descriptions`),T=c(`el-divider`),E=c(`el-button`),D=c(`el-card`),O=c(`public-wechat-pay`),k=c(`public-stripe-pay`),A=c(`public-alipay-pay`);return d(),o(s,null,[i(v,{class:`wrapper`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{span:24},{default:u(()=>[e(`h2`,ae,r(f.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(v,{class:`panel`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(D,{shadow:`hover`},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[f.loading?(d(),o(`div`,oe,[i(y,{animated:``})])):f.order?(d(),o(`div`,ce,[i(w,{column:1},{default:u(()=>[i(S,{label:f.$t(`order.field.id`)},{default:u(()=>[e(`span`,null,r(f.order.id),1),f.order.id?(d(),l(x,{key:0,content:f.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.description`)},{default:u(()=>[n(r(f.order.description),1)]),_:1},8,[`label`]),f.order.pay_way?(d(),l(S,{key:0,label:f.$t(`order.field.payWay`)},{default:u(()=>[i(C,{type:`info`,effect:`dark`,round:``,size:`small`},{default:u(()=>[n(r(f.payWayLabel(f.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(S,{label:f.$t(`order.field.createdAt`)},{default:u(()=>[n(r(f.$dayjs.format(f.order.created_at||``)),1)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.price`)},{default:u(()=>[f.order.price&&f.order.price>0?(d(),o(`span`,le,r(f.getPriceString({value:f.order.price})),1)):(d(),o(`span`,ue,r(f.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(d(),o(`div`,se,[i(b,{title:f.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),f.order?.state===f.OrderState.PAID||f.order?.state===f.OrderState.FINISHED?(d(),l(v,{key:0,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.EXPIRED?(d(),l(v,{key:1,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.FAILED?(d(),l(v,{key:2,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.PENDING&&f.showPayment?(d(),l(v,{key:3},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),!f.order.pay_way&&f.order.price&&f.order.price>0?(d(),o(`div`,de,[e(`div`,{class:t({payway:!0,wechatpay:!0,active:f.payWay===f.PayWay.WechatPay}),onClick:p[0]||=e=>f.payWay=f.PayWay.WechatPay},[p[7]||=e(`span`,{class:`payicon wechatpay`},null,-1),e(`span`,fe,r(f.$t(`order.title.wechatPay`)),1)],2),e(`div`,{class:t({payway:!0,alipay:!0,active:f.payWay===f.PayWay.AliPay}),onClick:p[1]||=e=>f.payWay=f.PayWay.AliPay},[p[8]||=e(`span`,{class:`payicon alipay`},null,-1),e(`span`,pe,r(f.$t(`order.title.aliPay`)),1)],2),f.enableCard?a(``,!0):(d(),o(`div`,{key:0,class:t({payway:!0,stripe:!0,active:f.payWay===f.PayWay.Stripe}),onClick:p[2]||=e=>f.payWay=f.PayWay.Stripe},[p[9]||=e(`span`,{class:`payicon stripe`},null,-1),e(`span`,$,r(f.$t(`order.title.stripe`)),1)],2)),f.enableCard?(d(),o(`div`,{key:1,class:t({payway:!0,creditcard:!0,active:f.payWay===f.PayWay.Card}),onClick:p[3]||=e=>f.payWay=f.PayWay.Card},[p[10]||=e(`span`,{class:`payicon card`,"aria-hidden":`true`},null,-1),e(`span`,me,r(f.$t(`order.title.card`)),1)],2)):a(``,!0)])):a(``,!0),f.order.pay_way?(d(),o(`div`,ge,[i(E,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:f.onRepay},{default:u(()=>[n(r(f.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(d(),o(`div`,he,[i(E,{loading:f.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:f.onPay},{default:u(()=>[n(r(f.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.order&&f.payWay===f.PayWay.WechatPay?(d(),l(O,{key:0,order:f.order,visible:f.paying,onHide:p[4]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&(f.payWay===f.PayWay.Stripe||f.payWay===f.PayWay.Card)?(d(),l(k,{key:1,order:f.order,visible:f.paying,onHide:p[5]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&f.payWay===f.PayWay.AliPay?(d(),l(A,{key:2,order:f.order,visible:f.paying,onHide:p[6]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ve=D(ie,[[`render`,_e],[`__scopeId`,`data-v-8711039f`]]);export{ve as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{t as p}from"./alert-BprQRUmf.js";import{o as m,v as ee}from"./models-DcpkDkjF.js";import{t as h}from"./card-IQwqnRJR.js";import{n as g,t as _}from"./row-DQqpuvYH.js";import{i as v,n as y,r as b,t as x}from"./wechat-B_xvylqk.js";import{t as S}from"./divider-Du_3kymg.js";import{t as C}from"./skeleton-Dj_a_iIP.js";import{Ei as w,Fi as T,Ni as E,O as D,Wt as O,an as k,li as A,mr as j,pi as te,sn as M}from"./index-CREYJmGZ.js";import{t as N}from"./CopyToClipboard-CLVp5I29.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:w,ElButton:T,QrCode:O,ElRow:_,ElCol:g},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return y()&&!x()},isMobileInsideWechat(){return y()&&x()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await M(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):ee.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),F={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},I={class:`text-[14px] mb-3 leading-relaxed`},L={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},R={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},z={class:`text-[14px] mb-4 leading-relaxed`},B={class:`paycode wechat`},V={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function H(t,s,f,p,m,ee){let h=c(`qr-code`),g=c(`el-button`),_=c(`el-col`),v=c(`el-row`),y=c(`el-dialog`);return d(),l(y,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:t.dialogWidth,center:``,onClose:s[0]||=e=>t.$emit(`hide`)},{default:u(()=>[t.isMobileOutsideWechat?(d(),o(`div`,F,[e(`p`,I,r(t.$t(`order.message.wechatPayMobileScanTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,L,r(t.$t(`order.message.wechatPayMobileHint`)),1),i(g,{size:`default`,round:``,class:`w-[220px]`,onClick:t.onCopyLink},{default:u(()=>[n(r(t.copied?t.$t(`common.message.copied`):t.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):t.isMobileInsideWechat?(d(),o(`div`,R,[e(`p`,z,r(t.$t(`order.message.wechatPayLongPressTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(d(),l(v,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:u(()=>[i(_,{span:12},{default:u(()=>[e(`div`,B,[t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,V,r(t.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(_,{span:12},{default:u(()=>[...s[1]||=[e(`div`,{class:`help-img`},[e(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var U=D(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),G={class:`text-center`};function K(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,G,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var q=D(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),J={class:`text-center`};function Y(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,J,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var X=D(ne,[[`render`,Y]]),Z=7e3,re=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e.Card=`Card`,e}(Q||{}),ie=f({name:`OrderPublicPay`,components:{ElButton:T,ElRow:_,ElCol:g,ElCard:h,ElSkeleton:C,ElDivider:S,ElAlert:p,ElDescriptions:b,ElDescriptionsItem:v,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:m,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``},config(){return this.$store.getters.config},enableCard(){return!!this.config?.features?.ENABLE_CARD},showPayment(){return!te()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:k,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`),Card:this.$t(`order.title.card`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,j.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await j.get(this.id);if(this.order=e,e?.state===m.PAID||e?.state===m.FINISHED||e?.state===m.FAILED||e?.state===m.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,Z))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=A()),j.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ae={class:`title`},oe={key:0,class:`pt-5`},se={key:1,class:`pt-10 text-center`},ce={key:2,class:`order`},le={key:0,class:`price current unfree`},ue={key:1,class:`price free`},de={key:0,class:`payways mb-6`},fe={class:`payname`},pe={class:`payname`},$={class:`payname`},me={class:`payname`},he={key:1},ge={key:2};function _e(f,p,m,ee,h,g){let _=c(`el-col`),v=c(`el-row`),y=c(`el-skeleton`),b=c(`el-alert`),x=c(`copy-to-clipboard`),S=c(`el-descriptions-item`),C=c(`el-tag`),w=c(`el-descriptions`),T=c(`el-divider`),E=c(`el-button`),D=c(`el-card`),O=c(`public-wechat-pay`),k=c(`public-stripe-pay`),A=c(`public-alipay-pay`);return d(),o(s,null,[i(v,{class:`wrapper`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{span:24},{default:u(()=>[e(`h2`,ae,r(f.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(v,{class:`panel`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(D,{shadow:`hover`},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[f.loading?(d(),o(`div`,oe,[i(y,{animated:``})])):f.order?(d(),o(`div`,ce,[i(w,{column:1},{default:u(()=>[i(S,{label:f.$t(`order.field.id`)},{default:u(()=>[e(`span`,null,r(f.order.id),1),f.order.id?(d(),l(x,{key:0,content:f.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.description`)},{default:u(()=>[n(r(f.order.description),1)]),_:1},8,[`label`]),f.order.pay_way?(d(),l(S,{key:0,label:f.$t(`order.field.payWay`)},{default:u(()=>[i(C,{type:`info`,effect:`dark`,round:``,size:`small`},{default:u(()=>[n(r(f.payWayLabel(f.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(S,{label:f.$t(`order.field.createdAt`)},{default:u(()=>[n(r(f.$dayjs.format(f.order.created_at||``)),1)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.price`)},{default:u(()=>[f.order.price&&f.order.price>0?(d(),o(`span`,le,r(f.getPriceString({value:f.order.price})),1)):(d(),o(`span`,ue,r(f.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(d(),o(`div`,se,[i(b,{title:f.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),f.order?.state===f.OrderState.PAID||f.order?.state===f.OrderState.FINISHED?(d(),l(v,{key:0,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.EXPIRED?(d(),l(v,{key:1,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.FAILED?(d(),l(v,{key:2,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.PENDING&&f.showPayment?(d(),l(v,{key:3},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),!f.order.pay_way&&f.order.price&&f.order.price>0?(d(),o(`div`,de,[e(`div`,{class:t({payway:!0,wechatpay:!0,active:f.payWay===f.PayWay.WechatPay}),onClick:p[0]||=e=>f.payWay=f.PayWay.WechatPay},[p[7]||=e(`span`,{class:`payicon wechatpay`},null,-1),e(`span`,fe,r(f.$t(`order.title.wechatPay`)),1)],2),e(`div`,{class:t({payway:!0,alipay:!0,active:f.payWay===f.PayWay.AliPay}),onClick:p[1]||=e=>f.payWay=f.PayWay.AliPay},[p[8]||=e(`span`,{class:`payicon alipay`},null,-1),e(`span`,pe,r(f.$t(`order.title.aliPay`)),1)],2),f.enableCard?a(``,!0):(d(),o(`div`,{key:0,class:t({payway:!0,stripe:!0,active:f.payWay===f.PayWay.Stripe}),onClick:p[2]||=e=>f.payWay=f.PayWay.Stripe},[p[9]||=e(`span`,{class:`payicon stripe`},null,-1),e(`span`,$,r(f.$t(`order.title.stripe`)),1)],2)),f.enableCard?(d(),o(`div`,{key:1,class:t({payway:!0,creditcard:!0,active:f.payWay===f.PayWay.Card}),onClick:p[3]||=e=>f.payWay=f.PayWay.Card},[p[10]||=e(`span`,{class:`payicon card`,"aria-hidden":`true`},null,-1),e(`span`,me,r(f.$t(`order.title.card`)),1)],2)):a(``,!0)])):a(``,!0),f.order.pay_way?(d(),o(`div`,ge,[i(E,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:f.onRepay},{default:u(()=>[n(r(f.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(d(),o(`div`,he,[i(E,{loading:f.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:f.onPay},{default:u(()=>[n(r(f.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.order&&f.payWay===f.PayWay.WechatPay?(d(),l(O,{key:0,order:f.order,visible:f.paying,onHide:p[4]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&(f.payWay===f.PayWay.Stripe||f.payWay===f.PayWay.Card)?(d(),l(k,{key:1,order:f.order,visible:f.paying,onHide:p[5]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&f.payWay===f.PayWay.AliPay?(d(),l(A,{key:2,order:f.order,visible:f.paying,onHide:p[6]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ve=D(ie,[[`render`,_e],[`__scopeId`,`data-v-8711039f`]]);export{ve as default};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{A as t,Gt as n,Jt as r,L as i,M as a,Mt as o,N as s,U as c,Y as l,ft as u,k as d,mt as f,nt as p,tt as m,yt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{_}from"./models-CwEjR6Nf.js";import{t as v}from"./popover-Br-sCBHH.js";import{t as y}from"./slider-508i2Vb5.js";import{t as b}from"./arrow-left-i-SsgbVR.js";import{t as x}from"./arrow-right-HPaEW4ct.js";import{t as S}from"./pause-Ck2Rq3YJ.js";import{t as C}from"./play-DFR_GqpJ.js";import{t as w}from"./volume-2-Cd9jV3NX.js";import{O as T,bi as E}from"./index-DIgS5Gvp.js";var D=E(`brush-cleaning`,[[`path`,{d:`m16 22-1-4`,key:`1ow2iv`}],[`path`,{d:`M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1`,key:`11gii7`}],[`path`,{d:`M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z`,key:`bju7h4`}],[`path`,{d:`m8 22 1-4`,key:`s3unb`}]]);function O(e){let t=Math.floor(e)%60;e=Math.floor(e/60);let n=e%60,r=n<10?`0${n}`:n,i=t<10?`0${t}`:t;return r+`:`+i}var k=e(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})})),A=Symbol(`AudioNamespace`),j=Symbol(`AudioQueue`),M=()=>{let e=c(A);if(!e)throw Error(`[player] useAudioNamespace() must be called inside <Player namespace="suno|producer">`);return e},N=e=>{let t=e??M(),n=_(),r=d({get:()=>n.state[t].audio,set:e=>n.commit(`${t}/setAudio`,e)}),i=e=>{n.commit(`${t}/setAudio`,{...n.state[t].audio,...e})},a=e=>{n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...e})},o=e=>d({get:()=>n.state[t].audio?.[e],set:t=>i({[e]:t})}),s=c(j,void 0),l=d(()=>{let e=s?.value;if(e&&e.length)return e;let r=n.state[t]?.tasks?.items??[],i=[];for(let e of r)for(let t of e?.response?.data??[])t?.audio_url&&i.push(t);return i}),u=d(()=>{let e=n.state[t].audio?.id;return l.value.findIndex(t=>t.id===e)});return{namespace:t,store:n,audio:r,field:o,patchAudio:i,dispatchAudio:a,tracks:l,currentIndex:u,playAdjacent:e=>{let r=u.value;if(r===-1)return;let i=l.value[r+e];i&&n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...i,progress:0,state:`playing`})}}},P={class:`player-slider`},F=g({__name:`PlayerSlider`,setup(e){let{field:t,dispatchAudio:n}=N(),r=t(`progress`),a=t(`duration`),c=()=>{},l=e=>n({progress:Array.isArray(e)?e[0]:e});return(e,t)=>(m(),s(`div`,P,[i(o(y),{modelValue:o(r),"onUpdate:modelValue":t[0]||=e=>h(r)?r.value=e:null,"show-tooltip":!1,min:0,max:o(a),onChange:l,onInput:c},null,8,[`modelValue`,`max`])]))}}),I={class:`flex player-song`},L=[`src`],R={class:`ml-2 text-xs flex flex-col justify-between`},z={class:`w-52 2xl:w-96 cursor-pointer truncate`},ee={class:`flex`},B={class:`ml-2 text-dc`},V=g({__name:`PlayerSong`,setup(e){let{audio:n,patchAudio:i}=N(),a=null,c=null,d=()=>{if(a){try{a.pause()}catch{}a.src=``,a=null}c&&=(c.abort(),null)};return u(n,(e,t)=>{if(e?.audio_url!==t?.audio_url){if(d(),!e?.audio_url)return;let t=new Audio(e.audio_url);a=t,c=new AbortController;let{signal:n}=c;e.state===`playing`?t.play().catch(()=>{}):t.pause(),t.addEventListener(`loadedmetadata`,()=>{t.currentTime=0},{signal:n}),t.addEventListener(`timeupdate`,()=>{i({progress:t.currentTime})},{signal:n}),i({object:t})}else e?.progress!==t?.progress&&e?.object&&Math.abs(e.progress-e.object.currentTime)>2?e.object.currentTime=e.progress:e?.state!==t?.state&&e?.object&&(e.state===`playing`?e.object.play().catch(()=>{}):e.object.pause());e?.volume!==t?.volume&&e?.object&&(e.object.volume=e.volume/100)}),l(d),(e,i)=>(m(),s(`div`,I,[t(`img`,{alt:``,class:`w-11 h-11 rounded`,src:o(n)?.image_url||o(`/assets/disk-XFRmVAfp.png`)},null,8,L),t(`div`,R,[t(`div`,z,[t(`div`,ee,[t(`span`,null,r(o(n)?.title||`Music`),1),t(`span`,B,`- `+r(o(n)?.style||`SmallRuralDog`),1)])])])]))}}),H={class:`flex justify-end items-center gap-x-2.5`},U={class:`text-xs`},W=g({__name:`PlayerAction`,setup(e){let{field:n}=N(),i=n(`progress`),a=n(`duration`);return(e,n)=>(m(),s(`div`,H,[t(`span`,U,r(o(O)(o(i)))+` / `+r(o(O)(o(a))),1)]))}}),G={class:`player-volume flex flex-col items-center pt-2`},K={class:`text-sm mt-3`},q=g({__name:`PlayerVolumeSlider`,setup(e){let{namespace:n,store:a,field:c}=N(),l=c(`volume`),u=c(`muted`),d=e=>a.dispatch(`${n}/setVolume`,Array.isArray(e)?e[0]:e);return(e,n)=>(m(),s(`div`,G,[i(o(y),{modelValue:o(l),"onUpdate:modelValue":n[0]||=e=>h(l)?l.value=e:null,vertical:``,height:`100px`,"show-tooltip":!1,max:100,min:0,size:`small`,disabled:o(u),onInput:d},null,8,[`modelValue`,`disabled`]),t(`div`,K,r(o(l)),1)]))}}),J={class:`flex items-center justify-center gap-x-3`},Y=[`disabled`,`aria-label`,`title`],X=[`aria-label`,`title`],Z=[`aria-label`,`title`],Q=[`disabled`,`aria-label`,`title`],$=[`aria-label`,`title`],te=T(g({__name:`PlayerController`,setup(e){let{audio:r,dispatchAudio:c,tracks:l,currentIndex:u,playAdjacent:p}=N(),h=d(()=>l.value.length>1),g=d(()=>u.value>0),_=d(()=>u.value!==-1&&u.value<l.value.length-1),y=()=>c({state:r.value?.state===`playing`?`paused`:`playing`});return(e,c)=>(m(),s(`div`,J,[h.value?(m(),s(`button`,{key:0,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,g.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!g.value,"aria-label":e.$t(`common.player.previous`),title:e.$t(`common.player.previous`),onClick:c[0]||=e=>g.value&&o(p)(-1)},[i(o(b),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Y)):a(``,!0),o(r)?.state===`playing`?(m(),s(`button`,{key:1,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.pause`),title:e.$t(`common.player.pause`),onClick:y},[i(o(S),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,X)):(m(),s(`button`,{key:2,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.play`),title:e.$t(`common.player.play`),onClick:y},[i(o(C),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Z)),h.value?(m(),s(`button`,{key:3,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,_.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!_.value,"aria-label":e.$t(`common.player.next`),title:e.$t(`common.player.next`),onClick:c[1]||=e=>_.value&&o(p)(1)},[i(o(x),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Q)):a(``,!0),i(o(v),{placement:`top`,width:`50px`,trigger:`click`},{reference:f(()=>[t(`button`,{type:`button`,class:`player-control player-control--volume cursor-pointer`,"aria-label":e.$t(`common.player.volume`),title:e.$t(`common.player.volume`)},[i(o(w),{"stroke-width":2,size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$)]),default:f(()=>[i(q)]),_:1})]))}}),[[`__scopeId`,`data-v-f66c5f86`]]),ne={class:`flex flex-col items-stretch h-20`},re={class:`flex grow px-5 items-center`},ie={class:`flex-1`},ae={class:`flex-1`},oe={class:`flex-1`},se=g({__name:`Player`,props:{namespace:{},tracks:{}},setup(e){let n=e;return p(A,n.namespace),p(j,d(()=>n.tracks??[])),(e,n)=>(m(),s(`div`,ne,[i(F),t(`div`,re,[t(`div`,ie,[i(V)]),t(`div`,ae,[i(te)]),t(`div`,oe,[i(W)])])]))}});export{D as i,k as n,O as r,se as t};
1
+ import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{A as t,Gt as n,Jt as r,L as i,M as a,Mt as o,N as s,U as c,Y as l,ft as u,k as d,mt as f,nt as p,tt as m,yt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{_}from"./models-DcpkDkjF.js";import{t as v}from"./popover-s9P5QTaN.js";import{t as y}from"./slider-B_xhGTdh.js";import{t as b}from"./arrow-left-uQ2QSI6E.js";import{t as x}from"./arrow-right-DLK8H_c3.js";import{t as S}from"./pause-BWpPJP_R.js";import{t as C}from"./play-CJx7xQc1.js";import{t as w}from"./volume-2-ovELC7ze.js";import{O as T,bi as E}from"./index-CREYJmGZ.js";var D=E(`brush-cleaning`,[[`path`,{d:`m16 22-1-4`,key:`1ow2iv`}],[`path`,{d:`M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1`,key:`11gii7`}],[`path`,{d:`M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z`,key:`bju7h4`}],[`path`,{d:`m8 22 1-4`,key:`s3unb`}]]);function O(e){let t=Math.floor(e)%60;e=Math.floor(e/60);let n=e%60,r=n<10?`0${n}`:n,i=t<10?`0${t}`:t;return r+`:`+i}var k=e(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})})),A=Symbol(`AudioNamespace`),j=Symbol(`AudioQueue`),M=()=>{let e=c(A);if(!e)throw Error(`[player] useAudioNamespace() must be called inside <Player namespace="suno|producer">`);return e},N=e=>{let t=e??M(),n=_(),r=d({get:()=>n.state[t].audio,set:e=>n.commit(`${t}/setAudio`,e)}),i=e=>{n.commit(`${t}/setAudio`,{...n.state[t].audio,...e})},a=e=>{n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...e})},o=e=>d({get:()=>n.state[t].audio?.[e],set:t=>i({[e]:t})}),s=c(j,void 0),l=d(()=>{let e=s?.value;if(e&&e.length)return e;let r=n.state[t]?.tasks?.items??[],i=[];for(let e of r)for(let t of e?.response?.data??[])t?.audio_url&&i.push(t);return i}),u=d(()=>{let e=n.state[t].audio?.id;return l.value.findIndex(t=>t.id===e)});return{namespace:t,store:n,audio:r,field:o,patchAudio:i,dispatchAudio:a,tracks:l,currentIndex:u,playAdjacent:e=>{let r=u.value;if(r===-1)return;let i=l.value[r+e];i&&n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...i,progress:0,state:`playing`})}}},P={class:`player-slider`},F=g({__name:`PlayerSlider`,setup(e){let{field:t,dispatchAudio:n}=N(),r=t(`progress`),a=t(`duration`),c=()=>{},l=e=>n({progress:Array.isArray(e)?e[0]:e});return(e,t)=>(m(),s(`div`,P,[i(o(y),{modelValue:o(r),"onUpdate:modelValue":t[0]||=e=>h(r)?r.value=e:null,"show-tooltip":!1,min:0,max:o(a),onChange:l,onInput:c},null,8,[`modelValue`,`max`])]))}}),I={class:`flex player-song`},L=[`src`],R={class:`ml-2 text-xs flex flex-col justify-between`},z={class:`w-52 2xl:w-96 cursor-pointer truncate`},ee={class:`flex`},B={class:`ml-2 text-dc`},V=g({__name:`PlayerSong`,setup(e){let{audio:n,patchAudio:i}=N(),a=null,c=null,d=()=>{if(a){try{a.pause()}catch{}a.src=``,a=null}c&&=(c.abort(),null)};return u(n,(e,t)=>{if(e?.audio_url!==t?.audio_url){if(d(),!e?.audio_url)return;let t=new Audio(e.audio_url);a=t,c=new AbortController;let{signal:n}=c;e.state===`playing`?t.play().catch(()=>{}):t.pause(),t.addEventListener(`loadedmetadata`,()=>{t.currentTime=0},{signal:n}),t.addEventListener(`timeupdate`,()=>{i({progress:t.currentTime})},{signal:n}),i({object:t})}else e?.progress!==t?.progress&&e?.object&&Math.abs(e.progress-e.object.currentTime)>2?e.object.currentTime=e.progress:e?.state!==t?.state&&e?.object&&(e.state===`playing`?e.object.play().catch(()=>{}):e.object.pause());e?.volume!==t?.volume&&e?.object&&(e.object.volume=e.volume/100)}),l(d),(e,i)=>(m(),s(`div`,I,[t(`img`,{alt:``,class:`w-11 h-11 rounded`,src:o(n)?.image_url||o(`/assets/disk-XFRmVAfp.png`)},null,8,L),t(`div`,R,[t(`div`,z,[t(`div`,ee,[t(`span`,null,r(o(n)?.title||`Music`),1),t(`span`,B,`- `+r(o(n)?.style||`SmallRuralDog`),1)])])])]))}}),H={class:`flex justify-end items-center gap-x-2.5`},U={class:`text-xs`},W=g({__name:`PlayerAction`,setup(e){let{field:n}=N(),i=n(`progress`),a=n(`duration`);return(e,n)=>(m(),s(`div`,H,[t(`span`,U,r(o(O)(o(i)))+` / `+r(o(O)(o(a))),1)]))}}),G={class:`player-volume flex flex-col items-center pt-2`},K={class:`text-sm mt-3`},q=g({__name:`PlayerVolumeSlider`,setup(e){let{namespace:n,store:a,field:c}=N(),l=c(`volume`),u=c(`muted`),d=e=>a.dispatch(`${n}/setVolume`,Array.isArray(e)?e[0]:e);return(e,n)=>(m(),s(`div`,G,[i(o(y),{modelValue:o(l),"onUpdate:modelValue":n[0]||=e=>h(l)?l.value=e:null,vertical:``,height:`100px`,"show-tooltip":!1,max:100,min:0,size:`small`,disabled:o(u),onInput:d},null,8,[`modelValue`,`disabled`]),t(`div`,K,r(o(l)),1)]))}}),J={class:`flex items-center justify-center gap-x-3`},Y=[`disabled`,`aria-label`,`title`],X=[`aria-label`,`title`],Z=[`aria-label`,`title`],Q=[`disabled`,`aria-label`,`title`],$=[`aria-label`,`title`],te=T(g({__name:`PlayerController`,setup(e){let{audio:r,dispatchAudio:c,tracks:l,currentIndex:u,playAdjacent:p}=N(),h=d(()=>l.value.length>1),g=d(()=>u.value>0),_=d(()=>u.value!==-1&&u.value<l.value.length-1),y=()=>c({state:r.value?.state===`playing`?`paused`:`playing`});return(e,c)=>(m(),s(`div`,J,[h.value?(m(),s(`button`,{key:0,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,g.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!g.value,"aria-label":e.$t(`common.player.previous`),title:e.$t(`common.player.previous`),onClick:c[0]||=e=>g.value&&o(p)(-1)},[i(o(b),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Y)):a(``,!0),o(r)?.state===`playing`?(m(),s(`button`,{key:1,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.pause`),title:e.$t(`common.player.pause`),onClick:y},[i(o(S),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,X)):(m(),s(`button`,{key:2,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.play`),title:e.$t(`common.player.play`),onClick:y},[i(o(C),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Z)),h.value?(m(),s(`button`,{key:3,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,_.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!_.value,"aria-label":e.$t(`common.player.next`),title:e.$t(`common.player.next`),onClick:c[1]||=e=>_.value&&o(p)(1)},[i(o(x),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Q)):a(``,!0),i(o(v),{placement:`top`,width:`50px`,trigger:`click`},{reference:f(()=>[t(`button`,{type:`button`,class:`player-control player-control--volume cursor-pointer`,"aria-label":e.$t(`common.player.volume`),title:e.$t(`common.player.volume`)},[i(o(w),{"stroke-width":2,size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$)]),default:f(()=>[i(q)]),_:1})]))}}),[[`__scopeId`,`data-v-f66c5f86`]]),ne={class:`flex flex-col items-stretch h-20`},re={class:`flex grow px-5 items-center`},ie={class:`flex-1`},ae={class:`flex-1`},oe={class:`flex-1`},se=g({__name:`Player`,props:{namespace:{},tracks:{}},setup(e){let n=e;return p(A,n.namespace),p(j,d(()=>n.tracks??[])),(e,n)=>(m(),s(`div`,ne,[i(F),t(`div`,re,[t(`div`,ie,[i(V)]),t(`div`,ae,[i(te)]),t(`div`,oe,[i(W)])])]))}});export{D as i,k as n,O as r,se as t};
@@ -1 +1 @@
1
- import{L as e,N as t,Q as n,Y as r,at as i,tt as a,wt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./Navigator-DbZtnb_p.js";import{O as l}from"./index-DIgS5Gvp.js";var u={class:`poivelle-shell`},d=l(s({__name:`Poivelle`,setup(s){let l=o(typeof window<`u`&&window.innerWidth<768),d=()=>{l.value=window.innerWidth<768};return n(()=>window.addEventListener(`resize`,d)),r(()=>window.removeEventListener(`resize`,d)),(n,r)=>{let o=i(`router-view`);return a(),t(`div`,u,[e(o,{class:`poivelle-view`}),e(c,{class:`poivelle-navigator`,direction:l.value?`row`:`column`},null,8,[`direction`])])}}}),[[`__scopeId`,`data-v-e1f67605`]]);export{d as default};
1
+ import{L as e,N as t,Q as n,Y as r,at as i,tt as a,wt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./Navigator-Uk0XBf21.js";import{O as l}from"./index-CREYJmGZ.js";var u={class:`poivelle-shell`},d=l(s({__name:`Poivelle`,setup(s){let l=o(typeof window<`u`&&window.innerWidth<768),d=()=>{l.value=window.innerWidth<768};return n(()=>window.addEventListener(`resize`,d)),r(()=>window.removeEventListener(`resize`,d)),(n,r)=>{let o=i(`router-view`);return a(),t(`div`,u,[e(o,{class:`poivelle-view`}),e(c,{class:`poivelle-navigator`,direction:l.value?`row`:`column`},null,8,[`direction`])])}}}),[[`__scopeId`,`data-v-e1f67605`]]);export{d as default};
@@ -1 +1 @@
1
- import{A as e,C as t,Gt as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,p as d,qt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{t as g}from"./chevron-down-7kJMC2ch.js";import{t as _}from"./info-C40CnPeL.js";import{t as v}from"./mic-CrSotd0p.js";import{Fi as y,Ii as b,Li as x,pa as S,zi as C}from"./constants-CQR8cCBL.js";import{O as w,bi as T,yi as E,z as D}from"./index-DIgS5Gvp.js";var O=T(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),k=T(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),A=class{token;model;handlers;voice;ws;audioCtx;micStream;micNode;workletNode;analyser;levelRaf=0;running=!1;playHead=0;activeSources=[];disposed=!1;suppressAudio=!1;aiResponding=!1;constructor(e,t,n,r=b){this.token=e,this.model=t,this.handlers=n,this.voice=r}get isRunning(){return this.running}async start(){this.handlers.onStatus?.(`connecting`);let e=window.AudioContext||window.webkitAudioContext;if(this.audioCtx=new e({sampleRate:x}),await this.audioCtx.audioWorklet.addModule(`/recorder-worklet.js`),this.disposed||(this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.disposed))return this.teardownAudio();this.micNode=this.audioCtx.createMediaStreamSource(this.micStream),this.workletNode=new AudioWorkletNode(this.audioCtx,`recorder-processor`),this.micNode.connect(this.workletNode),this.analyser=this.audioCtx.createAnalyser(),this.analyser.fftSize=256,this.micNode.connect(this.analyser),this.startLevelLoop();let t=this.audioCtx.createGain();t.gain.value=0,this.workletNode.connect(t).connect(this.audioCtx.destination);let n=`${S}?model=${encodeURIComponent(this.model)}&voice=${encodeURIComponent(this.voice)}`;this.ws=new WebSocket(n,[`realtime`,`acedata-token.${this.token}`]),this.ws.onopen=()=>{if(this.disposed){this.ws?.close();return}this.running=!0,this.handlers.onStatus?.(`connected`)},this.ws.onclose=()=>{this.handlers.onStatus?.(`disconnected`),this.teardownAudio(),this.running=!1},this.ws.onerror=()=>this.handlers.onStatus?.(`error`),this.ws.onmessage=e=>this.onServerEvent(e),this.workletNode.port.onmessage=e=>{!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify({type:`input_audio_buffer.append`,audio:j(e.data)}))}}setMuted(e){this.micStream?.getAudioTracks().forEach(t=>t.enabled=!e)}startLevelLoop(){let e=new Uint8Array(this.analyser?this.analyser.fftSize:0),t=0,n=()=>{if(this.disposed||!this.analyser)return;this.analyser.getByteTimeDomainData(e);let r=0;for(let t=0;t<e.length;t++){let n=(e[t]-128)/128;r+=n*n}let i=Math.sqrt(r/e.length),a=Math.min(1,i*3.4);t=t*.82+a*.18,this.handlers.onAudioLevel?.(t),this.levelRaf=requestAnimationFrame(n)};this.levelRaf=requestAnimationFrame(n)}stop(){this.disposed=!0,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(),this.teardownAudio(),this.running=!1,this.handlers.onStatus?.(`disconnected`)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}onServerEvent(e){let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`session.created`:case`session.updated`:break;case`input_audio_buffer.speech_started`:this.stopPlayback(),this.aiResponding&&this.send({type:`response.cancel`}),this.suppressAudio=!0,this.handlers.onUserSpeechStarted?.();break;case`conversation.item.input_audio_transcription.completed`:this.handlers.onUserTranscript?.(t.transcript||``);break;case`response.created`:this.aiResponding=!0,this.suppressAudio=!1,this.handlers.onAiResponseStart?.();break;case`response.done`:this.aiResponding=!1;break;case`response.output_audio.delta`:case`response.audio.delta`:t.delta&&!this.suppressAudio&&this.enqueuePcm16(t.delta);break;case`response.output_audio_transcript.delta`:case`response.audio_transcript.delta`:t.delta&&this.handlers.onAiTranscriptDelta?.(t.delta);break;case`error`:{let e=t.error||{},n=String(e.code||``),r=String(e.message||``);if(n===`response_cancel_not_active`||/no active response/i.test(r))break;this.handlers.onError?.(r||`realtime error`);break}default:break}}enqueuePcm16(e){if(!this.audioCtx)return;let t=M(e),n=new Int16Array(t);if(n.length===0)return;let r=new Float32Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[e]/32768;let i=this.audioCtx.createBuffer(1,r.length,x);i.getChannelData(0).set(r);let a=this.audioCtx.createBufferSource();a.buffer=i,a.connect(this.audioCtx.destination),this.analyser&&a.connect(this.analyser);let o=this.audioCtx.currentTime;this.playHead<o&&(this.playHead=o+.02),a.start(this.playHead),this.playHead+=i.duration,this.activeSources.push(a),a.onended=()=>{this.activeSources=this.activeSources.filter(e=>e!==a)}}stopPlayback(){for(let e of this.activeSources)try{e.onended=null,e.stop()}catch{}this.activeSources=[],this.playHead=0}teardownAudio(){try{this.levelRaf&&cancelAnimationFrame(this.levelRaf),this.workletNode&&(this.workletNode.port.onmessage=null),this.micStream&&this.micStream.getTracks().forEach(e=>e.stop()),this.stopPlayback(),this.audioCtx&&this.audioCtx.close()}catch{}this.levelRaf=0,this.handlers.onAudioLevel?.(0),this.micStream=this.micNode=this.workletNode=this.audioCtx=this.analyser=void 0}};function j(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r)n+=String.fromCharCode.apply(null,Array.from(t.subarray(e,e+r)));return btoa(n)}function M(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var N=`nexior.realtime.voice`,P=h({name:`RealtimeCall`,components:{CaptionsIcon:O,CloseIcon:E,ExpandDownIcon:g,InfoIcon:_,MicrophoneIcon:v,MicrophoneOffIcon:k},data(){return{client:void 0,status:`disconnected`,connecting:!1,provisioning:!0,running:!1,aiSpeaking:!1,userText:``,aiText:``,errorMsg:``,level:0,muted:!1,captionsOn:!1,showInfo:!1,voice:b,voices:[...C],voiceMenuOpen:!1,callSeq:0}},computed:{token(){return this.$store.state.realtime?.credential?.token},canCall(){return!!this.token},modelName(){return y},orbScale(){return 1+this.level*.16},haloStyle(){let e=this.running?this.level:0;return{transform:`scale(${1+e*.7})`,opacity:`${.16+e*.5}`}},orbClass(){return{speaking:this.aiSpeaking,live:this.running,idle:!this.running}},captionText(){return this.aiText?this.aiText:this.running&&!this.userText?this.$t(`realtime.listening`):``},stageText(){return this.errorMsg?this.errorMsg:this.provisioning||this.connecting?this.$t(`realtime.status.connecting`):this.running?this.aiSpeaking?this.$t(`realtime.speaking`):this.$t(`realtime.listening`):this.$t(`realtime.start`)},voiceLabel(){return this.labelOf(this.voice)}},async mounted(){try{let e=localStorage.getItem(N);e&&this.voices.includes(e)&&(this.voice=e)}catch{}this.voices.includes(this.voice)||(this.voice=b),this.provisioning=!0;try{await this.$store.dispatch(`realtime/init`)}finally{this.provisioning=!1}this.canCall&&this.startCall()},beforeUnmount(){this.client?.stop()},methods:{async startCall(){if(!this.token||this.connecting||this.running)return;let e=++this.callSeq,t=()=>e===this.callSeq;this.errorMsg=``,this.userText=``,this.aiText=``,this.connecting=!0;let n=new A(this.token,y,{onStatus:e=>{t()&&(this.status=e,this.running=e===`connecting`||e===`connected`,(e===`connected`||e===`disconnected`||e===`error`)&&(this.connecting=!1),this.running||(this.level=0))},onUserSpeechStarted:()=>{t()&&(this.aiSpeaking=!1,this.errorMsg=``)},onUserTranscript:e=>{t()&&(this.userText=e)},onAiResponseStart:()=>{t()&&(this.aiText=``,this.aiSpeaking=!0,this.errorMsg=``)},onAiTranscriptDelta:e=>{t()&&(this.aiText+=e)},onAudioLevel:e=>{t()&&(this.level=e)},onError:e=>{t()&&(this.errorMsg=e)}},this.voice);this.client=n;try{if(await n.start(),!t()||this.client!==n)return;n.setMuted(this.muted)}catch(e){if(n.stop(),!t()||this.client!==n)return;this.connecting=!1,this.running=!1,this.errorMsg=e?.message||this.$t(`realtime.startFailed`)}},toggleMute(){this.muted=!this.muted,this.client?.setMuted(this.muted)},toggleCaptions(){this.captionsOn=!this.captionsOn},labelOf(e){let t=e||`alloy`;return t.charAt(0).toUpperCase()+t.slice(1)},selectVoice(e){if(this.voiceMenuOpen=!1,e!==this.voice){this.voice=e;try{localStorage.setItem(N,e)}catch{}(this.running||this.connecting)&&this.reconnect()}},reconnect(){let e=this.client;this.client=void 0,this.callSeq++,this.running=!1,this.connecting=!1,this.aiSpeaking=!1,this.level=0,this.userText=``,this.aiText=``,this.errorMsg=``,e?.stop(),this.$nextTick(()=>this.startCall())},onOrbTap(){!this.running&&!this.connecting&&this.startCall()},endCall(){this.client?.stop(),this.running=!1,this.aiSpeaking=!1,this.level=0,this.goBack()},goBack(){this.client?.stop(),this.$router.push({name:D})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],R={class:`voice-pick`},ee={class:`voice-name`},z={key:0,class:`voice-menu`},B=[`onClick`],V={class:`rtc-top-right`},H=[`title`,`aria-label`],U=[`title`,`aria-label`],W={class:`rtc-stage`},G={key:0,class:`rtc-info`},K={key:0,class:`rtc-captions`},q={key:0,class:`cap user`},J={class:`cap ai`},Y={class:`rtc-controls`},X=[`title`,`aria-label`],Z=[`title`,`aria-label`],Q=[`title`,`aria-label`];function $(h,g,_,v,y,b){let x=c(`expand-down-icon`),S=c(`info-icon`),C=c(`captions-icon`),w=c(`microphone-off-icon`),T=c(`microphone-icon`),E=c(`close-icon`);return m(),o(`div`,{class:n([`rtc`,{"is-captions":h.captionsOn,"is-live":h.running}])},[e(`header`,F,[e(`div`,I,[e(`button`,{class:`ic`,title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[0]||=(...e)=>h.goBack&&h.goBack(...e)},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,L),e(`div`,R,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,ee,r(h.voiceLabel),1),i(x,{class:`voice-caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],2),h.voiceMenuOpen?(m(),o(`ul`,z,[(m(!0),o(s,null,p(h.voices,e=>(m(),o(`li`,{key:e,class:n({sel:e===h.voice}),onClick:t=>h.selectVoice(e)},r(h.labelOf(e)),11,B))),128))])):a(``,!0)])]),e(`div`,V,[e(`button`,{class:n([`ic`,{on:h.showInfo}]),title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[2]||=e=>h.showInfo=!h.showInfo},[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,H),e(`button`,{class:n([`ic`,{on:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[3]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,U)])]),h.voiceMenuOpen?(m(),o(`div`,{key:0,class:`voice-backdrop`,onClick:g[4]||=e=>h.voiceMenuOpen=!1})):a(``,!0),e(`main`,W,[e(`div`,{class:`orb-stage`,onClick:g[5]||=(...e)=>h.onOrbTap&&h.onOrbTap(...e)},[e(`div`,{class:`orb-halo`,style:f(h.haloStyle)},null,4),e(`div`,{class:n([`orb-breathe`,{paused:!h.running}])},[e(`div`,{class:n([`orb`,h.orbClass]),style:f({transform:`scale(${h.orbScale})`})},[...g[9]||=[e(`span`,{class:`cloud c1`},null,-1),e(`span`,{class:`cloud c2`},null,-1),e(`span`,{class:`cloud c3`},null,-1),e(`span`,{class:`sheen`},null,-1)]],6)],2)]),i(d,{name:`fade`},{default:u(()=>[h.showInfo&&!h.captionsOn?(m(),o(`p`,G,r(h.modelName),1)):a(``,!0)]),_:1}),h.captionsOn?(m(),o(`div`,K,[h.userText?(m(),o(`p`,q,r(h.userText),1)):a(``,!0),e(`p`,J,r(h.captionText),1)])):(m(),o(`p`,{key:1,class:n([`rtc-status`,{err:!!h.errorMsg}])},r(h.stageText),3))]),e(`footer`,Y,[e(`button`,{class:n([`ctl`,{active:h.muted}]),title:h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),"aria-label":h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),onClick:g[6]||=(...e)=>h.toggleMute&&h.toggleMute(...e)},[h.muted?(m(),l(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),l(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,X),e(`button`,{class:n([`ctl`,{active:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[7]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Z),e(`button`,{class:`ctl end`,title:h.$t(`realtime.end`),"aria-label":h.$t(`realtime.end`),onClick:g[8]||=(...e)=>h.endCall&&h.endCall(...e)},[i(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Q)])],2)}var te=w(P,[[`render`,$],[`__scopeId`,`data-v-b55c144b`]]);export{te as default};
1
+ import{A as e,C as t,Gt as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,p as d,qt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{t as g}from"./chevron-down-D54yUG_W.js";import{t as _}from"./info-B6zz-sKo.js";import{t as v}from"./mic-Dow6VrJE.js";import{Fi as y,Ii as b,Li as x,ma as S,zi as C}from"./constants-C44cV5UH.js";import{O as w,bi as T,yi as E,z as D}from"./index-CREYJmGZ.js";var O=T(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),k=T(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),A=class{token;model;handlers;voice;ws;audioCtx;micStream;micNode;workletNode;analyser;levelRaf=0;running=!1;playHead=0;activeSources=[];disposed=!1;suppressAudio=!1;aiResponding=!1;constructor(e,t,n,r=b){this.token=e,this.model=t,this.handlers=n,this.voice=r}get isRunning(){return this.running}async start(){this.handlers.onStatus?.(`connecting`);let e=window.AudioContext||window.webkitAudioContext;if(this.audioCtx=new e({sampleRate:x}),await this.audioCtx.audioWorklet.addModule(`/recorder-worklet.js`),this.disposed||(this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.disposed))return this.teardownAudio();this.micNode=this.audioCtx.createMediaStreamSource(this.micStream),this.workletNode=new AudioWorkletNode(this.audioCtx,`recorder-processor`),this.micNode.connect(this.workletNode),this.analyser=this.audioCtx.createAnalyser(),this.analyser.fftSize=256,this.micNode.connect(this.analyser),this.startLevelLoop();let t=this.audioCtx.createGain();t.gain.value=0,this.workletNode.connect(t).connect(this.audioCtx.destination);let n=`${S}?model=${encodeURIComponent(this.model)}&voice=${encodeURIComponent(this.voice)}`;this.ws=new WebSocket(n,[`realtime`,`acedata-token.${this.token}`]),this.ws.onopen=()=>{if(this.disposed){this.ws?.close();return}this.running=!0,this.handlers.onStatus?.(`connected`)},this.ws.onclose=()=>{this.handlers.onStatus?.(`disconnected`),this.teardownAudio(),this.running=!1},this.ws.onerror=()=>this.handlers.onStatus?.(`error`),this.ws.onmessage=e=>this.onServerEvent(e),this.workletNode.port.onmessage=e=>{!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify({type:`input_audio_buffer.append`,audio:j(e.data)}))}}setMuted(e){this.micStream?.getAudioTracks().forEach(t=>t.enabled=!e)}startLevelLoop(){let e=new Uint8Array(this.analyser?this.analyser.fftSize:0),t=0,n=()=>{if(this.disposed||!this.analyser)return;this.analyser.getByteTimeDomainData(e);let r=0;for(let t=0;t<e.length;t++){let n=(e[t]-128)/128;r+=n*n}let i=Math.sqrt(r/e.length),a=Math.min(1,i*3.4);t=t*.82+a*.18,this.handlers.onAudioLevel?.(t),this.levelRaf=requestAnimationFrame(n)};this.levelRaf=requestAnimationFrame(n)}stop(){this.disposed=!0,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(),this.teardownAudio(),this.running=!1,this.handlers.onStatus?.(`disconnected`)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}onServerEvent(e){let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`session.created`:case`session.updated`:break;case`input_audio_buffer.speech_started`:this.stopPlayback(),this.aiResponding&&this.send({type:`response.cancel`}),this.suppressAudio=!0,this.handlers.onUserSpeechStarted?.();break;case`conversation.item.input_audio_transcription.completed`:this.handlers.onUserTranscript?.(t.transcript||``);break;case`response.created`:this.aiResponding=!0,this.suppressAudio=!1,this.handlers.onAiResponseStart?.();break;case`response.done`:this.aiResponding=!1;break;case`response.output_audio.delta`:case`response.audio.delta`:t.delta&&!this.suppressAudio&&this.enqueuePcm16(t.delta);break;case`response.output_audio_transcript.delta`:case`response.audio_transcript.delta`:t.delta&&this.handlers.onAiTranscriptDelta?.(t.delta);break;case`error`:{let e=t.error||{},n=String(e.code||``),r=String(e.message||``);if(n===`response_cancel_not_active`||/no active response/i.test(r))break;this.handlers.onError?.(r||`realtime error`);break}default:break}}enqueuePcm16(e){if(!this.audioCtx)return;let t=M(e),n=new Int16Array(t);if(n.length===0)return;let r=new Float32Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[e]/32768;let i=this.audioCtx.createBuffer(1,r.length,x);i.getChannelData(0).set(r);let a=this.audioCtx.createBufferSource();a.buffer=i,a.connect(this.audioCtx.destination),this.analyser&&a.connect(this.analyser);let o=this.audioCtx.currentTime;this.playHead<o&&(this.playHead=o+.02),a.start(this.playHead),this.playHead+=i.duration,this.activeSources.push(a),a.onended=()=>{this.activeSources=this.activeSources.filter(e=>e!==a)}}stopPlayback(){for(let e of this.activeSources)try{e.onended=null,e.stop()}catch{}this.activeSources=[],this.playHead=0}teardownAudio(){try{this.levelRaf&&cancelAnimationFrame(this.levelRaf),this.workletNode&&(this.workletNode.port.onmessage=null),this.micStream&&this.micStream.getTracks().forEach(e=>e.stop()),this.stopPlayback(),this.audioCtx&&this.audioCtx.close()}catch{}this.levelRaf=0,this.handlers.onAudioLevel?.(0),this.micStream=this.micNode=this.workletNode=this.audioCtx=this.analyser=void 0}};function j(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r)n+=String.fromCharCode.apply(null,Array.from(t.subarray(e,e+r)));return btoa(n)}function M(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var N=`nexior.realtime.voice`,P=h({name:`RealtimeCall`,components:{CaptionsIcon:O,CloseIcon:E,ExpandDownIcon:g,InfoIcon:_,MicrophoneIcon:v,MicrophoneOffIcon:k},data(){return{client:void 0,status:`disconnected`,connecting:!1,provisioning:!0,running:!1,aiSpeaking:!1,userText:``,aiText:``,errorMsg:``,level:0,muted:!1,captionsOn:!1,showInfo:!1,voice:b,voices:[...C],voiceMenuOpen:!1,callSeq:0}},computed:{token(){return this.$store.state.realtime?.credential?.token},canCall(){return!!this.token},modelName(){return y},orbScale(){return 1+this.level*.16},haloStyle(){let e=this.running?this.level:0;return{transform:`scale(${1+e*.7})`,opacity:`${.16+e*.5}`}},orbClass(){return{speaking:this.aiSpeaking,live:this.running,idle:!this.running}},captionText(){return this.aiText?this.aiText:this.running&&!this.userText?this.$t(`realtime.listening`):``},stageText(){return this.errorMsg?this.errorMsg:this.provisioning||this.connecting?this.$t(`realtime.status.connecting`):this.running?this.aiSpeaking?this.$t(`realtime.speaking`):this.$t(`realtime.listening`):this.$t(`realtime.start`)},voiceLabel(){return this.labelOf(this.voice)}},async mounted(){try{let e=localStorage.getItem(N);e&&this.voices.includes(e)&&(this.voice=e)}catch{}this.voices.includes(this.voice)||(this.voice=b),this.provisioning=!0;try{await this.$store.dispatch(`realtime/init`)}finally{this.provisioning=!1}this.canCall&&this.startCall()},beforeUnmount(){this.client?.stop()},methods:{async startCall(){if(!this.token||this.connecting||this.running)return;let e=++this.callSeq,t=()=>e===this.callSeq;this.errorMsg=``,this.userText=``,this.aiText=``,this.connecting=!0;let n=new A(this.token,y,{onStatus:e=>{t()&&(this.status=e,this.running=e===`connecting`||e===`connected`,(e===`connected`||e===`disconnected`||e===`error`)&&(this.connecting=!1),this.running||(this.level=0))},onUserSpeechStarted:()=>{t()&&(this.aiSpeaking=!1,this.errorMsg=``)},onUserTranscript:e=>{t()&&(this.userText=e)},onAiResponseStart:()=>{t()&&(this.aiText=``,this.aiSpeaking=!0,this.errorMsg=``)},onAiTranscriptDelta:e=>{t()&&(this.aiText+=e)},onAudioLevel:e=>{t()&&(this.level=e)},onError:e=>{t()&&(this.errorMsg=e)}},this.voice);this.client=n;try{if(await n.start(),!t()||this.client!==n)return;n.setMuted(this.muted)}catch(e){if(n.stop(),!t()||this.client!==n)return;this.connecting=!1,this.running=!1,this.errorMsg=e?.message||this.$t(`realtime.startFailed`)}},toggleMute(){this.muted=!this.muted,this.client?.setMuted(this.muted)},toggleCaptions(){this.captionsOn=!this.captionsOn},labelOf(e){let t=e||`alloy`;return t.charAt(0).toUpperCase()+t.slice(1)},selectVoice(e){if(this.voiceMenuOpen=!1,e!==this.voice){this.voice=e;try{localStorage.setItem(N,e)}catch{}(this.running||this.connecting)&&this.reconnect()}},reconnect(){let e=this.client;this.client=void 0,this.callSeq++,this.running=!1,this.connecting=!1,this.aiSpeaking=!1,this.level=0,this.userText=``,this.aiText=``,this.errorMsg=``,e?.stop(),this.$nextTick(()=>this.startCall())},onOrbTap(){!this.running&&!this.connecting&&this.startCall()},endCall(){this.client?.stop(),this.running=!1,this.aiSpeaking=!1,this.level=0,this.goBack()},goBack(){this.client?.stop(),this.$router.push({name:D})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],R={class:`voice-pick`},ee={class:`voice-name`},z={key:0,class:`voice-menu`},B=[`onClick`],V={class:`rtc-top-right`},H=[`title`,`aria-label`],U=[`title`,`aria-label`],W={class:`rtc-stage`},G={key:0,class:`rtc-info`},K={key:0,class:`rtc-captions`},q={key:0,class:`cap user`},J={class:`cap ai`},Y={class:`rtc-controls`},X=[`title`,`aria-label`],Z=[`title`,`aria-label`],Q=[`title`,`aria-label`];function $(h,g,_,v,y,b){let x=c(`expand-down-icon`),S=c(`info-icon`),C=c(`captions-icon`),w=c(`microphone-off-icon`),T=c(`microphone-icon`),E=c(`close-icon`);return m(),o(`div`,{class:n([`rtc`,{"is-captions":h.captionsOn,"is-live":h.running}])},[e(`header`,F,[e(`div`,I,[e(`button`,{class:`ic`,title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[0]||=(...e)=>h.goBack&&h.goBack(...e)},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,L),e(`div`,R,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,ee,r(h.voiceLabel),1),i(x,{class:`voice-caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],2),h.voiceMenuOpen?(m(),o(`ul`,z,[(m(!0),o(s,null,p(h.voices,e=>(m(),o(`li`,{key:e,class:n({sel:e===h.voice}),onClick:t=>h.selectVoice(e)},r(h.labelOf(e)),11,B))),128))])):a(``,!0)])]),e(`div`,V,[e(`button`,{class:n([`ic`,{on:h.showInfo}]),title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[2]||=e=>h.showInfo=!h.showInfo},[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,H),e(`button`,{class:n([`ic`,{on:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[3]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,U)])]),h.voiceMenuOpen?(m(),o(`div`,{key:0,class:`voice-backdrop`,onClick:g[4]||=e=>h.voiceMenuOpen=!1})):a(``,!0),e(`main`,W,[e(`div`,{class:`orb-stage`,onClick:g[5]||=(...e)=>h.onOrbTap&&h.onOrbTap(...e)},[e(`div`,{class:`orb-halo`,style:f(h.haloStyle)},null,4),e(`div`,{class:n([`orb-breathe`,{paused:!h.running}])},[e(`div`,{class:n([`orb`,h.orbClass]),style:f({transform:`scale(${h.orbScale})`})},[...g[9]||=[e(`span`,{class:`cloud c1`},null,-1),e(`span`,{class:`cloud c2`},null,-1),e(`span`,{class:`cloud c3`},null,-1),e(`span`,{class:`sheen`},null,-1)]],6)],2)]),i(d,{name:`fade`},{default:u(()=>[h.showInfo&&!h.captionsOn?(m(),o(`p`,G,r(h.modelName),1)):a(``,!0)]),_:1}),h.captionsOn?(m(),o(`div`,K,[h.userText?(m(),o(`p`,q,r(h.userText),1)):a(``,!0),e(`p`,J,r(h.captionText),1)])):(m(),o(`p`,{key:1,class:n([`rtc-status`,{err:!!h.errorMsg}])},r(h.stageText),3))]),e(`footer`,Y,[e(`button`,{class:n([`ctl`,{active:h.muted}]),title:h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),"aria-label":h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),onClick:g[6]||=(...e)=>h.toggleMute&&h.toggleMute(...e)},[h.muted?(m(),l(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),l(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,X),e(`button`,{class:n([`ctl`,{active:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[7]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Z),e(`button`,{class:`ctl end`,title:h.$t(`realtime.end`),"aria-label":h.$t(`realtime.end`),onClick:g[8]||=(...e)=>h.endCall&&h.endCall(...e)},[i(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Q)])],2)}var te=w(P,[[`render`,$],[`__scopeId`,`data-v-b55c144b`]]);export{te as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Jt as n,L as r,M as i,N as a,at as o,mt as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./tooltip-xGYGkgTR.js";import{t as d}from"./triangle-alert-COLtfogn.js";import{O as f}from"./index-DIgS5Gvp.js";import{t as p}from"./ReportDialog-DmMuOP3a.js";var m=l({name:`ReportButton`,components:{WarningIcon:d,ElTooltip:u,ReportDialog:p},props:{service:{type:String,required:!0},targetId:{type:String,required:!1,default:``},snapshot:{type:Object,required:!1,default:void 0},showLabel:{type:Boolean,default:!1}},data(){return{visible:!1}},methods:{onOpen(){if(!this.$store.getters.authenticated){this.$store.dispatch(`login`,{redirect:this.$route.fullPath});return}this.visible=!0}}}),h={class:`report-entry`},g=[`aria-label`,`title`],_={key:0,class:`label`};function v(l,u,d,f,p,m){let v=o(`warning-icon`),y=o(`el-tooltip`),b=o(`report-dialog`);return c(),a(`span`,h,[r(y,{effect:`dark`,content:l.$t(`common.button.report`),placement:`top`},{default:s(()=>[e(`button`,{type:`button`,class:`btn-report`,"aria-label":l.$t(`common.button.report`),title:l.$t(`common.button.report`),onClick:u[0]||=t((...e)=>l.onOpen&&l.onOpen(...e),[`stop`])},[r(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),l.showLabel?(c(),a(`span`,_,n(l.$t(`common.button.report`)),1)):i(``,!0)],8,g)]),_:1},8,[`content`]),r(b,{visible:l.visible,"onUpdate:visible":u[1]||=e=>l.visible=e,service:l.service,"target-id":l.targetId,snapshot:l.snapshot},null,8,[`visible`,`service`,`target-id`,`snapshot`])])}var y=f(m,[[`render`,v],[`__scopeId`,`data-v-085d10be`]]);export{y as t};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Jt as n,L as r,M as i,N as a,at as o,mt as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./tooltip-bfg-03mE.js";import{t as d}from"./triangle-alert-Z8DwGNFK.js";import{O as f}from"./index-CREYJmGZ.js";import{t as p}from"./ReportDialog-BdPWn65b.js";var m=l({name:`ReportButton`,components:{WarningIcon:d,ElTooltip:u,ReportDialog:p},props:{service:{type:String,required:!0},targetId:{type:String,required:!1,default:``},snapshot:{type:Object,required:!1,default:void 0},showLabel:{type:Boolean,default:!1}},data(){return{visible:!1}},methods:{onOpen(){if(!this.$store.getters.authenticated){this.$store.dispatch(`login`,{redirect:this.$route.fullPath});return}this.visible=!0}}}),h={class:`report-entry`},g=[`aria-label`,`title`],_={key:0,class:`label`};function v(l,u,d,f,p,m){let v=o(`warning-icon`),y=o(`el-tooltip`),b=o(`report-dialog`);return c(),a(`span`,h,[r(y,{effect:`dark`,content:l.$t(`common.button.report`),placement:`top`},{default:s(()=>[e(`button`,{type:`button`,class:`btn-report`,"aria-label":l.$t(`common.button.report`),title:l.$t(`common.button.report`),onClick:u[0]||=t((...e)=>l.onOpen&&l.onOpen(...e),[`stop`])},[r(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),l.showLabel?(c(),a(`span`,_,n(l.$t(`common.button.report`)),1)):i(``,!0)],8,g)]),_:1},8,[`content`]),r(b,{visible:l.visible,"onUpdate:visible":u[1]||=e=>l.visible=e,service:l.service,"target-id":l.targetId,snapshot:l.snapshot},null,8,[`visible`,`service`,`target-id`,`snapshot`])])}var y=f(m,[[`render`,v],[`__scopeId`,`data-v-085d10be`]]);export{y as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,I as n,Jt as r,L as i,N as a,T as o,at as s,j as c,mt as l,rt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{v as p}from"./models-CwEjR6Nf.js";import{r as m,t as h}from"./radio-BNhFzeBO.js";import{Ei as g,Fi as _,O as v,Ui as y,kn as b}from"./index-DIgS5Gvp.js";var x=[`sexual`,`violence`,`hate`,`child_safety`,`self_harm`,`deception`,`illegal`,`ip`,`other`],S=1e3,C=f({name:`ReportDialog`,components:{ElButton:_,ElDialog:g,ElInput:y,ElRadio:h,ElRadioGroup:m},props:{visible:{type:Boolean,default:!1},service:{type:String,required:!0},targetId:{type:String,required:!1,default:``},snapshot:{type:Object,required:!1,default:void 0}},emits:[`update:visible`],data(){return{submitting:!1,reason:``,detail:``,reasons:x}},watch:{visible(e){e&&(this.reason=``,this.detail=``)}},methods:{truncate(e){return typeof e==`string`&&e.length>S?`${e.slice(0,S)}…`:e},async onSubmit(){if(!this.reason){p.warning(this.$t(`common.message.reportReasonRequired`));return}this.submitting=!0;try{let e=this.snapshot?Object.fromEntries(Object.entries(this.snapshot).map(([e,t])=>[e,this.truncate(t)])):void 0;await b.create({service:this.service,target_id:this.targetId,reason:this.reason,detail:this.detail,snapshot:e}),this.$emit(`update:visible`,!1),p.success(this.$t(`common.message.reportSuccess`))}catch{p.error(this.$t(`common.message.reportFailed`))}finally{this.submitting=!1}}}}),w={class:`intro`};function T(f,p,m,h,g,_){let v=s(`el-radio`),y=s(`el-radio-group`),b=s(`el-input`),x=s(`el-button`),S=s(`el-dialog`);return d(),c(S,{"model-value":f.visible,title:f.$t(`common.title.reportContent`),width:`460`,"align-center":``,"append-to-body":``,class:`report-dialog`,"onUpdate:modelValue":p[3]||=e=>f.$emit(`update:visible`,e),onClick:p[4]||=t(()=>{},[`stop`])},{footer:l(()=>[i(x,{round:``,onClick:p[2]||=e=>f.$emit(`update:visible`,!1)},{default:l(()=>[n(r(f.$t(`common.button.cancel`)),1)]),_:1}),i(x,{type:`primary`,round:``,loading:f.submitting,onClick:f.onSubmit},{default:l(()=>[n(r(f.$t(`common.button.report`)),1)]),_:1},8,[`loading`,`onClick`])]),default:l(()=>[e(`p`,w,r(f.$t(`common.message.reportIntro`)),1),i(y,{modelValue:f.reason,"onUpdate:modelValue":p[0]||=e=>f.reason=e,class:`reasons`},{default:l(()=>[(d(!0),a(o,null,u(f.reasons,e=>(d(),c(v,{key:e,value:e,class:`reason`},{default:l(()=>[n(r(f.$t(`common.reportReason.${e}`)),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`]),i(b,{modelValue:f.detail,"onUpdate:modelValue":p[1]||=e=>f.detail=e,type:`textarea`,rows:3,maxlength:`2000`,"show-word-limit":``,class:`detail`,placeholder:f.$t(`common.message.reportDetailPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`])}var E=v(C,[[`render`,T],[`__scopeId`,`data-v-7c270936`]]);export{E as t};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,I as n,Jt as r,L as i,N as a,T as o,at as s,j as c,mt as l,rt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{v as p}from"./models-DcpkDkjF.js";import{r as m,t as h}from"./radio-BNhFzeBO.js";import{Ei as g,Fi as _,O as v,Ui as y,kn as b}from"./index-CREYJmGZ.js";var x=[`sexual`,`violence`,`hate`,`child_safety`,`self_harm`,`deception`,`illegal`,`ip`,`other`],S=1e3,C=f({name:`ReportDialog`,components:{ElButton:_,ElDialog:g,ElInput:y,ElRadio:h,ElRadioGroup:m},props:{visible:{type:Boolean,default:!1},service:{type:String,required:!0},targetId:{type:String,required:!1,default:``},snapshot:{type:Object,required:!1,default:void 0}},emits:[`update:visible`],data(){return{submitting:!1,reason:``,detail:``,reasons:x}},watch:{visible(e){e&&(this.reason=``,this.detail=``)}},methods:{truncate(e){return typeof e==`string`&&e.length>S?`${e.slice(0,S)}…`:e},async onSubmit(){if(!this.reason){p.warning(this.$t(`common.message.reportReasonRequired`));return}this.submitting=!0;try{let e=this.snapshot?Object.fromEntries(Object.entries(this.snapshot).map(([e,t])=>[e,this.truncate(t)])):void 0;await b.create({service:this.service,target_id:this.targetId,reason:this.reason,detail:this.detail,snapshot:e}),this.$emit(`update:visible`,!1),p.success(this.$t(`common.message.reportSuccess`))}catch{p.error(this.$t(`common.message.reportFailed`))}finally{this.submitting=!1}}}}),w={class:`intro`};function T(f,p,m,h,g,_){let v=s(`el-radio`),y=s(`el-radio-group`),b=s(`el-input`),x=s(`el-button`),S=s(`el-dialog`);return d(),c(S,{"model-value":f.visible,title:f.$t(`common.title.reportContent`),width:`460`,"align-center":``,"append-to-body":``,class:`report-dialog`,"onUpdate:modelValue":p[3]||=e=>f.$emit(`update:visible`,e),onClick:p[4]||=t(()=>{},[`stop`])},{footer:l(()=>[i(x,{round:``,onClick:p[2]||=e=>f.$emit(`update:visible`,!1)},{default:l(()=>[n(r(f.$t(`common.button.cancel`)),1)]),_:1}),i(x,{type:`primary`,round:``,loading:f.submitting,onClick:f.onSubmit},{default:l(()=>[n(r(f.$t(`common.button.report`)),1)]),_:1},8,[`loading`,`onClick`])]),default:l(()=>[e(`p`,w,r(f.$t(`common.message.reportIntro`)),1),i(y,{modelValue:f.reason,"onUpdate:modelValue":p[0]||=e=>f.reason=e,class:`reasons`},{default:l(()=>[(d(!0),a(o,null,u(f.reasons,e=>(d(),c(v,{key:e,value:e,class:`reason`},{default:l(()=>[n(r(f.$t(`common.reportReason.${e}`)),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`]),i(b,{modelValue:f.detail,"onUpdate:modelValue":p[1]||=e=>f.detail=e,type:`textarea`,rows:3,maxlength:`2000`,"show-word-limit":``,class:`detail`,placeholder:f.$t(`common.message.reportDetailPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`])}var E=v(C,[[`render`,T],[`__scopeId`,`data-v-7c270936`]]);export{E as t};
@@ -1,2 +1,2 @@
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,S as c,T as l,at as u,j as d,mt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{n as g,r as ee,t as te}from"./select-CUw_YhcY.js";import{t as ne}from"./time-picker-CEYuPPVi.js";import{n as re,t as _}from"./form-BdKMEyCR.js";import{t as v}from"./tooltip-xGYGkgTR.js";import{v as y}from"./models-CwEjR6Nf.js";import{t as b}from"./card-IQwqnRJR.js";import{r as x,t as S}from"./radio-BNhFzeBO.js";import{t as ie}from"./drawer-BMRGHI-3.js";import{t as C}from"./empty-C5KjRN0h.js";import{t as w}from"./input-number-ByXVBT4t.js";import{t as T}from"./skeleton-Dj_a_iIP.js";import{t as E}from"./switch-BHE5VSJC.js";import{t as D}from"./brain-OfFe2iNh.js";import{t as O}from"./chevron-right-BaNlttpH.js";import{t as k}from"./clock-CS3ZX4nf.js";import{t as A}from"./copy-B489PY7H.js";import{t as j}from"./pencil-Djn9Hc9z.js";import{t as M}from"./play-DFR_GqpJ.js";import{t as N}from"./plus-lIyMOEZf.js";import{t as ae}from"./refresh-cw-DqyQYIrN.js";import{t as P}from"./trash-2-xb-Jm4i0.js";import{t as F}from"./vendor-axios-Ck2ffRoh.js";import{Vi as I,ea as L,oa as R}from"./constants-CQR8cCBL.js";import{A as z,Ei as B,Fi as V,Ni as H,O as U,Ui as W,fi as G,k as K,mn as oe,ui as q,xi as J}from"./index-DIgS5Gvp.js";import{t as se}from"./CopyToClipboard-BoetcLMP.js";import{t as ce}from"./pagination-BNPMPfyr.js";function Y(e){let t=oe();return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,...t?{"x-site-origin":t}:{}}}var X=`${R}/aichat2/scheduled-tasks`,Z=2e4,le=3300;function ue(e,t){return e.status!==`queued`&&e.status!==`running`?!1:t/1e3-e.scheduled_at<le}function de(e){let t=e?.response?.data;return t?.error===`skill_not_active`?t.detail??{kind:`skill`,slug:``,reason:`not_active`}:null}var Q=new class{async listTasks(e){let{data:t}=await F.post(X,{action:`retrieve_batch`},{headers:Y(e)});return t?.items??[]}async createTask(e,t,n=!1){let{data:r}=await F.post(X,{action:`create`,...t,...n?{force:!0}:{}},{headers:Y(e)});return r}async updateTask(e,t,n,r=!1){let{data:i}=await F.post(X,{action:`update`,id:t,...n,...r?{force:!0}:{}},{headers:Y(e)});return i}async deleteTask(e,t){await F.post(X,{action:`delete`,id:t},{headers:Y(e)})}async triggerTask(e,t){let{data:n}=await F.post(X,{action:`trigger`,id:t},{headers:Y(e)});return n??{}}async listRuns(e,t){let{data:n}=await F.post(X,{action:`retrieve_runs`,id:t},{headers:Y(e),timeout:Z});return n?.items??[]}async listAllRuns(e,t={}){let{data:n}=await F.post(X,{action:`retrieve_runs_batch`,...t},{headers:Y(e),timeout:Z});return{items:n?.items??[],count:n?.count??0}}async listAuthorizableSkills(e){let{data:t}=await F.post(X,{action:`retrieve_authorizable_skills`},{headers:Y(e)});return t?.items??[]}async listAuthorizableCapabilities(e){let{data:t}=await F.post(X,{action:`retrieve_authorizable_skills`},{headers:Y(e)});return{skills:t?.skills??t?.items??[],mcp_servers:t?.mcp_servers??[]}}},$=Intl.DateTimeFormat().resolvedOptions().timeZone||`Asia/Shanghai`,fe=50,pe=12*1e3,me=3,he=h({name:`ScheduledTasks`,components:{AiIcon:D,ExpandRightIcon:O,PlayIcon:M,TimeIcon:k,AddIcon:N,CopyIcon:A,DeleteIcon:P,EditIcon:j,RefreshIcon:ae,ElButton:V,ElCard:b,ElSkeleton:T,ElEmpty:C,ElSwitch:E,ElTag:H,ElTooltip:v,ElDrawer:ie,ElDialog:B,ElForm:_,ElFormItem:re,ElInput:W,ElSelect:ee,ElOption:te,ElOptionGroup:g,ElRadioGroup:x,ElRadio:S,ElTimePicker:ne,ElInputNumber:w,Pagination:ce,CopyToClipboard:se},data(){return{tasks:[],runs:[],activeTab:`tasks`,tabs:[`tasks`,`runs`],statusFilters:[`all`,`success`,`failed`,`indeterminate`,`skipped`,`running`,`queued`],allRuns:[],allRunsCount:0,allRunsLoading:!1,allRunsStatus:`all`,allRunsPage:1,allRunsPageSize:20,allRunsRequestId:0,loading:!1,runsLoading:!1,skillsLoading:!1,skillsInflight:null,saving:!1,showCreateDialog:!1,showRunHistory:!1,selectedTask:null,editingTask:null,authorizableSkills:[],authorizableMcpServers:[],triggeringId:``,weekdays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],page:1,pageSize:6,runPage:1,runPageSize:8,runPollTimer:null,runPollInFlight:!1,runPollSeq:0,runPollFailures:0,runsRequestId:0,form:this.emptyForm(),deviceIdentity:null,localToolSpecs:[]}},computed:{canRunLocally(){return G()&&!!this.deviceIdentity},localUnavailableReason(){if(this.canRunLocally)return``;let e=q();return e===`ios`||e===`android`?this.$t(`chat.scheduledTasks.form.executionMobileUnsupported`):e===`web`?this.$t(`chat.scheduledTasks.form.executionWebUnsupported`):this.$t(`chat.scheduledTasks.form.executionDeviceUnavailable`)},token(){return this.$store.state.chat?.credential?.token},modelGroups(){let e=this.$store.state.site?.features??{};return I.filter(t=>e[t.name]?.enabled!==!1).map(e=>({...e,models:e.models.filter(e=>e.enabled!==!1)})).filter(e=>e.models.length>0)},pagedTasks(){let e=(this.page-1)*this.pageSize;return this.tasks.slice(e,e+this.pageSize)},pagedRuns(){let e=(this.runPage-1)*this.runPageSize;return this.runs.slice(e,e+this.runPageSize)},intervalMax(){return this.form.intervalUnit===`minute`?1440:this.form.intervalUnit===`hour`?720:365},schedulePreview(){try{return this.humanizeSchedule(this.buildSchedule())}catch{return``}},selectedBrowserConnections(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)).flatMap(e=>e.browser_connections??[])},selectedBrowserSkills(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)&&t.browser_connections!==void 0)},selectedBrowserConnection(){return this.selectedBrowserConnections.find(e=>e.connection_id===this.form.browserConnectionId)},accountChoices(){let e=new Set(this.form.authorizedSkills),t=new Map;for(let n of this.authorizableSkills)if(e.has(n.slug))for(let[e,r]of Object.entries(n.connection_accounts??{})){if((r?.length??0)<2)continue;let n=r[0].connector_identifier||e;t.has(n)||t.set(n,{label:e,accounts:r})}return[...t.entries()].map(([e,{label:t,accounts:n}])=>({identifier:e,label:t,accounts:n}))}},watch:{showRunHistory(e){e||(this.selectedTask=null,this.runsRequestId+=1,this.runsLoading=!1,this.runPollFailures=0,this.syncRunPolling())}},async mounted(){document.addEventListener(`visibilitychange`,this.onVisibilityChange),await this.loadTasks()},unmounted(){document.removeEventListener(`visibilitychange`,this.onVisibilityChange),this.stopRunPolling()},methods:{emptyForm(){return{name:``,question:``,model:L,scheduleType:`daily`,intervalValue:4,intervalUnit:`hour`,hourlyMinute:0,dailyTime:`09:00`,weekday:1,cronExpr:`0 9 * * *`,authorizedSkills:[],authorizedMcpServers:[],browserConnectionId:``,connectionAccounts:{},authorizationExpiresAt:Math.floor(Date.now()/1e3)+720*60*60,maxTurns:fe,execution:`cloud`,authorizedLocalTools:[]}},deriveName(e){let t=(e||``).trim().split(`
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,S as c,T as l,at as u,j as d,mt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{n as g,r as ee,t as te}from"./select-jRFQ1Hzk.js";import{t as ne}from"./time-picker-BqcqHMtN.js";import{n as re,t as _}from"./form-BdKMEyCR.js";import{t as v}from"./tooltip-bfg-03mE.js";import{v as y}from"./models-DcpkDkjF.js";import{t as b}from"./card-IQwqnRJR.js";import{r as x,t as S}from"./radio-BNhFzeBO.js";import{t as ie}from"./drawer-CL63mgQu.js";import{t as C}from"./empty-C5KjRN0h.js";import{t as w}from"./input-number-u0MGro2n.js";import{t as T}from"./skeleton-Dj_a_iIP.js";import{t as E}from"./switch-CP09CWeK.js";import{t as D}from"./brain-DRAL5UnC.js";import{t as O}from"./chevron-right-kcQrk7a4.js";import{t as k}from"./clock-DcgPnVJa.js";import{t as A}from"./copy-DpODTAxb.js";import{t as j}from"./pencil-BhwkvOrn.js";import{t as M}from"./play-CJx7xQc1.js";import{t as N}from"./plus--lrUTaV9.js";import{t as ae}from"./refresh-cw-DsZHH-ne.js";import{t as P}from"./trash-2-CDz5PwCk.js";import{t as F}from"./vendor-axios-Ck2ffRoh.js";import{Vi as I,sa as L,ta as R}from"./constants-C44cV5UH.js";import{A as z,Ei as B,Fi as V,Ni as H,O as U,Ui as W,fi as G,k as K,mn as oe,ui as q,xi as J}from"./index-CREYJmGZ.js";import{t as se}from"./CopyToClipboard-CLVp5I29.js";import{t as ce}from"./pagination-uq23xZEg.js";function Y(e){let t=oe();return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,...t?{"x-site-origin":t}:{}}}var X=`${L}/aichat2/scheduled-tasks`,Z=2e4,le=3300;function ue(e,t){return e.status!==`queued`&&e.status!==`running`?!1:t/1e3-e.scheduled_at<le}function de(e){let t=e?.response?.data;return t?.error===`skill_not_active`?t.detail??{kind:`skill`,slug:``,reason:`not_active`}:null}var Q=new class{async listTasks(e){let{data:t}=await F.post(X,{action:`retrieve_batch`},{headers:Y(e)});return t?.items??[]}async createTask(e,t,n=!1){let{data:r}=await F.post(X,{action:`create`,...t,...n?{force:!0}:{}},{headers:Y(e)});return r}async updateTask(e,t,n,r=!1){let{data:i}=await F.post(X,{action:`update`,id:t,...n,...r?{force:!0}:{}},{headers:Y(e)});return i}async deleteTask(e,t){await F.post(X,{action:`delete`,id:t},{headers:Y(e)})}async triggerTask(e,t){let{data:n}=await F.post(X,{action:`trigger`,id:t},{headers:Y(e)});return n??{}}async listRuns(e,t){let{data:n}=await F.post(X,{action:`retrieve_runs`,id:t},{headers:Y(e),timeout:Z});return n?.items??[]}async listAllRuns(e,t={}){let{data:n}=await F.post(X,{action:`retrieve_runs_batch`,...t},{headers:Y(e),timeout:Z});return{items:n?.items??[],count:n?.count??0}}async listAuthorizableSkills(e){let{data:t}=await F.post(X,{action:`retrieve_authorizable_skills`},{headers:Y(e)});return t?.items??[]}async listAuthorizableCapabilities(e){let{data:t}=await F.post(X,{action:`retrieve_authorizable_skills`},{headers:Y(e)});return{skills:t?.skills??t?.items??[],mcp_servers:t?.mcp_servers??[]}}},$=Intl.DateTimeFormat().resolvedOptions().timeZone||`Asia/Shanghai`,fe=50,pe=12*1e3,me=3,he=h({name:`ScheduledTasks`,components:{AiIcon:D,ExpandRightIcon:O,PlayIcon:M,TimeIcon:k,AddIcon:N,CopyIcon:A,DeleteIcon:P,EditIcon:j,RefreshIcon:ae,ElButton:V,ElCard:b,ElSkeleton:T,ElEmpty:C,ElSwitch:E,ElTag:H,ElTooltip:v,ElDrawer:ie,ElDialog:B,ElForm:_,ElFormItem:re,ElInput:W,ElSelect:ee,ElOption:te,ElOptionGroup:g,ElRadioGroup:x,ElRadio:S,ElTimePicker:ne,ElInputNumber:w,Pagination:ce,CopyToClipboard:se},data(){return{tasks:[],runs:[],activeTab:`tasks`,tabs:[`tasks`,`runs`],statusFilters:[`all`,`success`,`failed`,`indeterminate`,`skipped`,`running`,`queued`],allRuns:[],allRunsCount:0,allRunsLoading:!1,allRunsStatus:`all`,allRunsPage:1,allRunsPageSize:20,allRunsRequestId:0,loading:!1,runsLoading:!1,skillsLoading:!1,skillsInflight:null,saving:!1,showCreateDialog:!1,showRunHistory:!1,selectedTask:null,editingTask:null,authorizableSkills:[],authorizableMcpServers:[],triggeringId:``,weekdays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],page:1,pageSize:6,runPage:1,runPageSize:8,runPollTimer:null,runPollInFlight:!1,runPollSeq:0,runPollFailures:0,runsRequestId:0,form:this.emptyForm(),deviceIdentity:null,localToolSpecs:[]}},computed:{canRunLocally(){return G()&&!!this.deviceIdentity},localUnavailableReason(){if(this.canRunLocally)return``;let e=q();return e===`ios`||e===`android`?this.$t(`chat.scheduledTasks.form.executionMobileUnsupported`):e===`web`?this.$t(`chat.scheduledTasks.form.executionWebUnsupported`):this.$t(`chat.scheduledTasks.form.executionDeviceUnavailable`)},token(){return this.$store.state.chat?.credential?.token},modelGroups(){let e=this.$store.state.site?.features??{};return I.filter(t=>e[t.name]?.enabled!==!1).map(e=>({...e,models:e.models.filter(e=>e.enabled!==!1)})).filter(e=>e.models.length>0)},pagedTasks(){let e=(this.page-1)*this.pageSize;return this.tasks.slice(e,e+this.pageSize)},pagedRuns(){let e=(this.runPage-1)*this.runPageSize;return this.runs.slice(e,e+this.runPageSize)},intervalMax(){return this.form.intervalUnit===`minute`?1440:this.form.intervalUnit===`hour`?720:365},schedulePreview(){try{return this.humanizeSchedule(this.buildSchedule())}catch{return``}},selectedBrowserConnections(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)).flatMap(e=>e.browser_connections??[])},selectedBrowserSkills(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)&&t.browser_connections!==void 0)},selectedBrowserConnection(){return this.selectedBrowserConnections.find(e=>e.connection_id===this.form.browserConnectionId)},accountChoices(){let e=new Set(this.form.authorizedSkills),t=new Map;for(let n of this.authorizableSkills)if(e.has(n.slug))for(let[e,r]of Object.entries(n.connection_accounts??{})){if((r?.length??0)<2)continue;let n=r[0].connector_identifier||e;t.has(n)||t.set(n,{label:e,accounts:r})}return[...t.entries()].map(([e,{label:t,accounts:n}])=>({identifier:e,label:t,accounts:n}))}},watch:{showRunHistory(e){e||(this.selectedTask=null,this.runsRequestId+=1,this.runsLoading=!1,this.runPollFailures=0,this.syncRunPolling())}},async mounted(){document.addEventListener(`visibilitychange`,this.onVisibilityChange),await this.loadTasks()},unmounted(){document.removeEventListener(`visibilitychange`,this.onVisibilityChange),this.stopRunPolling()},methods:{emptyForm(){return{name:``,question:``,model:R,scheduleType:`daily`,intervalValue:4,intervalUnit:`hour`,hourlyMinute:0,dailyTime:`09:00`,weekday:1,cronExpr:`0 9 * * *`,authorizedSkills:[],authorizedMcpServers:[],browserConnectionId:``,connectionAccounts:{},authorizationExpiresAt:Math.floor(Date.now()/1e3)+720*60*60,maxTurns:fe,execution:`cloud`,authorizedLocalTools:[]}},deriveName(e){let t=(e||``).trim().split(`
2
2
  `)[0].trim();return t.length>40?`${t.slice(0,40)}…`:t||`Scheduled Task`},async loadTasks(){if(this.token){this.loading=!0;try{this.tasks=await Q.listTasks(this.token);let e=Math.max(1,Math.ceil(this.tasks.length/this.pageSize));this.page>e&&(this.page=e)}catch{y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.loading=!1}}},async selectTask(e){this.selectedTask=e,this.showRunHistory=!0,this.runPage=1,await this.loadTaskRuns(e.id)},async loadTaskRuns(e,t=!1){if(!this.token)return;let n=++this.runsRequestId;t||(this.runsLoading=!0,this.runPollFailures=0);try{let t=await Q.listRuns(this.token,e);if(n!==this.runsRequestId||!this.showRunHistory||this.selectedTask?.id!==e)return;this.runs=t,this.runPollFailures=0}catch{if(n!==this.runsRequestId)return;this.runPollFailures+=1,t||y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{n===this.runsRequestId&&(this.runsLoading=!1,this.syncRunPolling())}},onPageChange(e){this.page=e},switchTab(e){this.activeTab!==e&&(this.activeTab=e,e===`runs`?this.loadAllRuns():this.stopRunPolling())},onStatusFilter(e){this.allRunsStatus!==e&&(this.allRunsStatus=e,this.allRunsPage=1,this.loadAllRuns())},onAllRunsPageChange(e){this.allRunsPage=e,this.loadAllRuns()},async loadAllRuns(e=!1){if(!this.token)return;let t=++this.allRunsRequestId;e||(this.allRunsLoading=!0,this.runPollFailures=0);try{let{items:e,count:n}=await Q.listAllRuns(this.token,{status:this.allRunsStatus===`all`?void 0:this.allRunsStatus,offset:(this.allRunsPage-1)*this.allRunsPageSize,limit:this.allRunsPageSize});if(t!==this.allRunsRequestId)return;this.allRuns=e,this.allRunsCount=n,this.runPollFailures=0}catch{if(t!==this.allRunsRequestId)return;this.runPollFailures+=1,e||y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{t===this.allRunsRequestId&&(this.allRunsLoading=!1,this.syncRunPolling())}},onRunPageChange(e){this.runPage=e},visibleRuns(){return this.showRunHistory?this.runs:this.activeTab===`runs`?this.allRuns:[]},syncRunPolling(){let e=Date.now();if(!(this.token&&this.runPollFailures<me&&this.visibleRuns().some(t=>ue(t,e)))||document.hidden){this.stopRunPolling();return}this.runPollTimer||=setInterval(()=>void this.pollRuns(),pe)},stopRunPolling(){this.runPollTimer&&=(clearInterval(this.runPollTimer),null)},async pollRuns(){if(!this.token){this.stopRunPolling();return}if(this.runPollInFlight)return;let e=++this.runPollSeq;this.runPollInFlight=!0;try{this.showRunHistory&&this.selectedTask?await this.loadTaskRuns(this.selectedTask.id,!0):this.activeTab===`runs`?await this.loadAllRuns(!0):this.stopRunPolling()}finally{e===this.runPollSeq&&(this.runPollInFlight=!1)}},onVisibilityChange(){document.hidden?this.stopRunPolling():(this.runPollFailures=0,this.runPollInFlight=!1,this.pollRuns(),this.syncRunPolling())},openCreate(){this.saving||(this.editingTask=null,this.form=this.emptyForm(),this.showCreateDialog=!0,this.loadDesktopContext())},async loadDesktopContext(){if(!G())return;let e=K()?.scheduler;if(e)try{this.deviceIdentity=await e.identity()}catch{this.deviceIdentity=null}try{this.localToolSpecs=await z()?.listTools()??[]}catch{this.localToolSpecs=[]}},closeTaskDialog(){this.saving||(this.showCreateDialog=!1)},taskToForm(e){let t=e.schedule,n=`cron`,r=4,i=`hour`,a=0,o=`09:00`,s=`0 9 * * *`,c=1;if(t.type===`cron`){s=t.cron;let[e,r,i,l,u]=t.cron.split(/\s+/),d=e=>/^\d+$/.test(e);i===`*`&&l===`*`&&u===`*`&&r===`*`&&d(e)?(n=`hourly`,a=Number(e)):i===`*`&&l===`*`&&u===`*`&&d(r)&&d(e)?(n=`daily`,o=`${r.padStart(2,`0`)}:${e.padStart(2,`0`)}`):i===`*`&&l===`*`&&d(u)&&d(r)&&d(e)&&(n=`weekly`,c=Number(u),o=`${r.padStart(2,`0`)}:${e.padStart(2,`0`)}`)}else if(t.type===`interval`){n=`interval`;let e=t.interval_seconds;e%86400==0?(i=`day`,r=e/86400):e%3600==0?(i=`hour`,r=e/3600):(i=`minute`,r=Math.max(1,Math.round(e/60)))}return{name:e.name,question:e.template.question,model:e.template.model,scheduleType:n,intervalValue:r,intervalUnit:i,hourlyMinute:a,dailyTime:o,weekday:c,cronExpr:s,authorizedSkills:e.unattended_policy?.allowed_skills||[],authorizedMcpServers:e.unattended_policy?.allowed_mcp_servers||[],browserConnectionId:e.unattended_policy?.browser_connections?.[0]?.connection_id??``,connectionAccounts:Object.fromEntries((e.unattended_policy?.connection_bindings??[]).map(e=>[e.connector_identifier,e.connection_id])),authorizationExpiresAt:e.unattended_policy?.expires_at??Math.floor(Date.now()/1e3)+720*60*60,maxTurns:e.template.max_turns??fe,execution:e.execution===`local`?`local`:`cloud`,authorizedLocalTools:e.unattended_policy?.allowed_local_tools||[]}},openEdit(e){this.editingTask=e,this.form=this.taskToForm(e),this.showCreateDialog=!0,this.loadAuthorizableSkills(),this.loadDesktopContext()},openDuplicate(e){this.saving||(this.editingTask=null,this.form={...this.taskToForm(e),name:this.nextCopyName(e.name),authorizationExpiresAt:Math.floor(Date.now()/1e3)+720*60*60},this.showCreateDialog=!0,this.loadAuthorizableSkills(),this.loadDesktopContext())},nextCopyName(e){let t=(e||``).trim()||this.$t(`chat.scheduledTasks.title`),n=new Set(this.tasks.map(e=>e.name)),r=e=>{let n=` ${e}`,r=80-n.length;if(t.length<=r)return`${t}${n}`;let i=``;for(let e of t){if(i.length+e.length>r)break;i+=e}return`${i}${n}`},i=2;for(;n.has(r(i));)i+=1;return r(i)},buildSchedule(){let{scheduleType:e,intervalValue:t,intervalUnit:n,hourlyMinute:r,dailyTime:i,weekday:a,cronExpr:o}=this.form;if(e===`interval`)return{type:`interval`,interval_seconds:Math.max(60,Math.round(t)*(n===`day`?86400:n===`hour`?3600:60)),tz:$};if(e===`hourly`)return{type:`cron`,cron:`${Math.min(59,Math.max(0,Math.round(r)))} * * * *`,tz:$};if(e===`daily`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * *`,tz:$}}if(e===`weekly`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * ${a}`,tz:$}}return{type:`cron`,cron:o,tz:$}},async saveTask(){if(!this.form.question.trim()){y.warning(this.$t(`chat.scheduledTasks.form.required`));return}let e=this.editingTask;this.saving=!0;let t;try{t=await this.loadAuthorizableSkills()}finally{this.saving=!1}if(!t||!this.showCreateDialog||this.editingTask!==e)return;if(this.form.authorizedSkills.length>0||this.form.authorizedMcpServers.length>0)try{await J.confirm(this.authorizationConfirmText(),this.$t(`chat.scheduledTasks.form.skillsConfirmTitle`),{type:`warning`,confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`)})}catch{return}let n=[...this.form.authorizedSkills],r=[...this.form.authorizedMcpServers],i;if(this.selectedBrowserSkills.length){let e=this.selectedBrowserConnection;if(!e||!e.online||!e.compatible){y.error(this.$t(`chat.scheduledTasks.form.browserBindingInvalid`));return}i=[{connection_id:e.connection_id,connection_revision:e.connection_revision,device_id:e.device_id,wire_contract_digest:e.wire_contract_digest,policy_digest:e.policy_digest}]}let a=this.accountChoices.map(e=>({connector_identifier:e.identifier,connection_id:this.form.connectionAccounts[e.identifier]||``})).filter(e=>!!e.connection_id&&this.accountChoices.find(t=>t.identifier===e.connector_identifier)?.accounts.some(t=>t.connection_id===e.connection_id)),o=this.form.execution===`local`?[...this.form.authorizedLocalTools]:[],s={name:this.form.name.trim()||this.deriveName(this.form.question),schedule:this.buildSchedule(),template:{model:this.form.model,question:this.form.question,skills:n,mcp_servers:r,max_turns:this.form.maxTurns},created_surface:q(),...this.form.execution===`local`&&this.deviceIdentity?{execution:`local`,device_id:this.deviceIdentity.device_id,device_name:this.deviceIdentity.device_name}:{},unattended_policy:n.length||r.length||o.length?{allowed_skills:n,allowed_mcp_servers:r,...o.length?{allowed_local_tools:o}:{},browser_connections:i,connection_bindings:a.length?a:void 0,expires_at:this.form.authorizationExpiresAt}:{allowed_skills:[],allowed_mcp_servers:[]}};await this.submitTask(s,!1)},async submitTask(e,t){this.saving=!0;let n=null;try{if(this.editingTask){let n=this.editingTask.id,r=await Q.updateTask(this.token,n,e,t),i=this.tasks.findIndex(e=>e.id===n);i!==-1&&(this.tasks[i]=r)}else{let n=await Q.createTask(this.token,e,t);this.tasks=[n,...this.tasks],this.page=1}y.success(this.$t(`chat.scheduledTasks.create`)+` OK`),this.showCreateDialog=!1,this.editingTask=null,this.form=this.emptyForm()}catch(e){n=t?null:de(e),n||y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.saving=!1}if(n){if(this.selectedBrowserSkills.length)return;await this.confirmForceSkill(n)&&await this.submitTask(e,!0)}},async confirmForceSkill(e){let t=this.capabilityLabel(e.slug);try{return await J.confirm(this.$t(`chat.scheduledTasks.form.skillNotActiveMessage`,{name:t}),this.$t(`chat.scheduledTasks.form.skillNotActiveTitle`),{type:`warning`,confirmButtonText:this.$t(`chat.scheduledTasks.form.skillNotActiveForce`),cancelButtonText:this.$t(`common.button.cancel`)}),!0}catch{return!1}},capabilityLabel(e){let t=this.authorizableSkills.find(t=>t.slug===e);if(t)return t.name||t.slug;let n=this.authorizableMcpServers.find(t=>t.slug===e);return n?n.name||n.slug:e},async loadAuthorizableSkills(e=!1){return this.skillsInflight?this.skillsInflight:!this.token||!e&&(this.authorizableSkills.length||this.authorizableMcpServers.length)?!0:(this.skillsLoading=!0,this.skillsInflight=(async()=>{try{let e=await Q.listAuthorizableCapabilities(this.token);return this.authorizableSkills=e.skills,this.authorizableMcpServers=e.mcp_servers,!0}catch{return y.error(this.$t(`chat.scheduledTasks.loadError`)),!1}finally{this.skillsLoading=!1,this.skillsInflight=null}})(),this.skillsInflight)},onSkillSelectVisible(e){e&&this.loadAuthorizableSkills(!0)},skillLabel(e){return e.name||e.slug},mcpServerLabel(e){return e.name||e.slug},authorizationConfirmText(){let e=new Set(this.form.authorizedSkills),t=new Set(this.form.authorizedMcpServers),n=this.authorizableSkills.filter(t=>e.has(t.slug)).map(e=>this.skillLabel(e)),r=this.authorizableMcpServers.filter(e=>t.has(e.slug)).map(e=>this.mcpServerLabel(e));return this.$t(`chat.scheduledTasks.form.skillsConfirm`,{count:e.size+t.size,skills:[...n,...r].length?[...n,...r].join(`, `):[...Array.from(e),...Array.from(t)].join(`, `)})},async toggleState(e,t){let n=this.tasks.findIndex(t=>t.id===e.id),r=t?`enabled`:`disabled`;n!==-1&&(this.tasks[n]={...e,state:r});try{let t=await Q.updateTask(this.token,e.id,{state:r});n!==-1&&(this.tasks[n]=t)}catch{n!==-1&&(this.tasks[n]={...e,state:e.state}),y.error(this.$t(`chat.scheduledTasks.loadError`))}},async triggerNow(e){if(!this.triggeringId){this.triggeringId=e.id;try{if(e.execution===`local`){let t=K()?.scheduler?.runNow;if(!t){y.warning(this.$t(`chat.scheduledTasks.triggerLocalUnavailable`));return}let n=await t(e.id);if(!n?.ok){let e=n?.reason===`not_on_this_device`?`chat.scheduledTasks.triggerWrongDevice`:n?.reason===`signed_out`?`chat.scheduledTasks.triggerSignedOut`:n?.reason===`already_running`?`chat.scheduledTasks.triggerAlreadyRunning`:`chat.scheduledTasks.triggerError`;y.warning(this.$t(e));return}}else await Q.triggerTask(this.token,e.id);y.success(this.$t(`chat.scheduledTasks.triggerSuccess`)),this.showRunHistory&&this.selectedTask?.id===e.id?(this.runPage=1,await this.loadTaskRuns(e.id)):this.activeTab===`runs`&&await this.loadAllRuns(!0)}catch{y.error(this.$t(`chat.scheduledTasks.triggerError`))}finally{this.triggeringId=``}}},async confirmDelete(e){await J.confirm(this.$t(`chat.scheduledTasks.deleteConfirm`,{name:e.name}),{type:`warning`});try{await Q.deleteTask(this.token,e.id),this.tasks=this.tasks.filter(t=>t.id!==e.id);let t=Math.max(1,Math.ceil(this.tasks.length/this.pageSize));this.page>t&&(this.page=t)}catch{y.error(this.$t(`chat.scheduledTasks.loadError`))}},openRun(e){if(!e.conversation_id)return;let t=this.modelGroups.map(e=>e.name),n=e.conversation_model_group,r=this.$store.state.chat?.modelGroup?.name||`chatgpt`,i=n&&(t.length===0||t.includes(n))?n:r;this.$router.push(`/${i}/conversations/${e.conversation_id}`)},stateTagType(e){return e===`enabled`?`success`:e===`error`?`danger`:`info`},runTagType(e){return e===`success`?`success`:e===`failed`?`danger`:e===`indeterminate`||e===`skipped`?`info`:`warning`},accountTagText(e){let t=e.provider_alias||e.connector_identifier,n=e.label||e.account_name;return n?`${t} · ${n}`:t},runOutcomeText(e){return e.outcome_reason?e.outcome_reason:this.runErrorText(e)},runErrorText(e){let t=e.error_code;return t&&this.$te(`chat.scheduledTasks.run.reason.${t}`)?this.errorCodeText(t):e.error_message?e.error_message:t?this.errorCodeText(t):``},errorCodeText(e){let t=`chat.scheduledTasks.run.reason.${e}`;return this.$te(t)?this.$t(t):e.replace(/_/g,` `)},humanizeSchedule(e){let t=(e,t)=>this.$t(`chat.scheduledTasks.humanize.${e}`,t??{});if(e.type===`interval`){let n=e.interval_seconds;return n%86400==0?t(`everyNDays`,{n:n/86400}):n%3600==0?t(`everyNHours`,{n:n/3600}):t(`everyNMinutes`,{n:Math.round(n/60)})}if(e.type===`cron`){let[n,r,i,a,o]=e.cron.split(/\s+/),s=e=>/^\d+$/.test(e);if(i===`*`&&a===`*`&&o===`*`&&r===`*`&&s(n))return t(`hourlyAtMinute`,{n:Number(n)});let c=s(r)&&s(n)?`${r.padStart(2,`0`)}:${n.padStart(2,`0`)}`:``;return c&&i===`*`&&a===`*`&&o===`*`?t(`dailyAt`,{time:c}):c&&i===`*`&&a===`*`&&s(o)?t(`weeklyAt`,{weekday:this.weekdays[Number(o)]??o,time:c}):t(`cronRaw`,{cron:e.cron})}return t(`once`,{time:new Date(e.at*1e3).toLocaleString()})},scheduleLabel(e){return this.humanizeSchedule(e)},formatTime(e){return new Date(e*1e3).toLocaleString()}}}),ge={class:`scheduled-tasks`},_e={class:`inner`},ve={class:`header`},ye={class:`title`},be=[`aria-label`],xe=[`aria-selected`,`onClick`],Se={class:`task-list`},Ce={class:`task-top`},we={class:`task-heading`},Te={class:`task-name`},Ee={class:`task-id`},De={class:`task-id-text`},Oe={class:`task-meta`},ke={class:`meta-chip`},Ae={class:`meta-chip`},je={key:0,class:`meta-chip`},Me={class:`task-prompt`},Ne={key:0,class:`task-last-output`},Pe={class:`task-footer`},Fe={class:`run-count`},Ie={key:0,class:`error-hint`},Le={class:`open-hint`},Re={key:0,class:`pager`},ze=[`aria-label`],Be=[`aria-pressed`,`onClick`],Ve={class:`run-list`},He=[`tabindex`,`role`,`onClick`,`onKeydown`],Ue={class:`run-body`},We={class:`run-line`},Ge={class:`run-title`},Ke={key:0,class:`run-preview`},qe={class:`run-sub`},Je={class:`run-time`},Ye=[`title`],Xe={class:`run-action`},Ze={key:1,class:`run-noconv`},Qe={key:0,class:`pager`},$e={key:0,class:`run-context`},et={class:`task-id run-context-id`},tt={class:`task-id-text`},nt={class:`run-context-meta`},rt={class:`run-context-prompt`},it={key:3,class:`run-list`},at=[`tabindex`,`role`,`onClick`,`onKeydown`],ot={class:`run-body`},st={class:`run-line`},ct={class:`run-title`},lt={key:0,class:`run-preview`},ut={class:`run-sub`},dt={class:`run-time`},ft=[`title`],pt={class:`run-action`},mt={key:1,class:`run-noconv`},ht={key:4,class:`pager run-pager`},gt={class:`hint`},_t={class:`inline-block`},vt={class:`hint`},yt={class:`hint`},bt={key:0,class:`schedule-preview`},xt={class:`hint`},St={class:`hint`},Ct={class:`jitter-hint`},wt={class:`hint`},Tt={class:`skill-option`},Et={class:`skill-option-name`},Dt={key:0,class:`skill-option-missing`},Ot={class:`hint`},kt={key:0,class:`browser-binding-summary`},At={class:`hint`},jt={class:`hint`};function Mt(h,g,ee,te,ne,re){let _=u(`add-icon`),v=u(`el-button`),y=u(`el-skeleton`),b=u(`el-empty`),x=u(`copy-to-clipboard`),S=u(`el-switch`),ie=u(`play-icon`),C=u(`el-tooltip`),w=u(`edit-icon`),T=u(`copy-icon`),E=u(`delete-icon`),D=u(`el-tag`),O=u(`time-icon`),k=u(`ai-icon`),A=u(`refresh-icon`),j=u(`expand-right-icon`),M=u(`el-card`),N=u(`pagination`),ae=u(`el-drawer`),P=u(`el-input`),F=u(`el-form-item`),I=u(`el-option`),L=u(`el-option-group`),R=u(`el-select`),z=u(`el-radio`),B=u(`el-radio-group`),V=u(`el-input-number`),H=u(`el-time-picker`),U=u(`el-form`),W=u(`el-dialog`);return m(),s(`div`,ge,[e(`div`,_e,[e(`div`,ve,[e(`h2`,ye,i(h.$t(`chat.scheduledTasks.title`)),1),h.activeTab===`tasks`?(m(),d(v,{key:0,type:`primary`,round:``,disabled:h.saving,onClick:h.openCreate},{default:f(()=>[a(_,{size:16,class:`icon`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.create`)),1)]),_:1},8,[`disabled`,`onClick`])):o(``,!0)]),e(`div`,{class:`tabs`,role:`tablist`,"aria-label":h.$t(`chat.scheduledTasks.title`)},[(m(!0),s(l,null,p(h.tabs,e=>(m(),s(`button`,{key:e,type:`button`,role:`tab`,class:n([`tab`,{active:h.activeTab===e}]),"aria-selected":h.activeTab===e,onClick:t=>h.switchTab(e)},i(h.$t(`chat.scheduledTasks.tab.${e}`)),11,xe))),128))],8,be),h.activeTab===`tasks`?(m(),s(l,{key:0},[h.loading?(m(),d(y,{key:0,rows:4,animated:``,class:`loading-block`})):h.tasks.length?(m(),s(l,{key:2},[e(`div`,Se,[(m(!0),s(l,null,p(h.pagedTasks,n=>(m(),d(M,{key:n.id,class:`task-card`,shadow:`hover`,onClick:e=>h.selectTask(n)},{default:f(()=>[e(`div`,Ce,[e(`div`,we,[e(`div`,Te,i(n.name),1),e(`div`,Ee,[e(`span`,De,i(h.$t(`common.entity.id`))+`: `+i(n.id),1),a(x,{content:n.id,class:`inline-block shrink-0`},null,8,[`content`])])]),e(`div`,{class:`task-actions`,onClick:g[0]||=t(()=>{},[`stop`])},[a(S,{"model-value":n.state===`enabled`,onChange:e=>h.toggleState(n,e===!0)},null,8,[`model-value`,`onChange`]),a(C,{content:h.$t(`chat.scheduledTasks.triggerNow`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,loading:h.triggeringId===n.id,"aria-label":h.$t(`chat.scheduledTasks.triggerNow`),title:h.$t(`chat.scheduledTasks.triggerNow`),onClick:e=>h.triggerNow(n)},{default:f(()=>[h.triggeringId===n.id?o(``,!0):(m(),d(ie,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:2},1032,[`loading`,`aria-label`,`title`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`common.button.edit`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,"aria-label":h.$t(`common.button.edit`),onClick:e=>h.openEdit(n)},{default:f(()=>[a(w,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`chat.scheduledTasks.duplicate`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,"aria-label":h.$t(`chat.scheduledTasks.duplicate`),onClick:e=>h.openDuplicate(n)},{default:f(()=>[a(T,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`common.button.delete`),placement:`top`},{default:f(()=>[a(v,{text:``,type:`danger`,class:`icon-action`,"aria-label":h.$t(`common.button.delete`),onClick:e=>h.confirmDelete(n)},{default:f(()=>[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`])])]),e(`div`,Oe,[a(D,{size:`small`,type:h.stateTagType(n.state),effect:`dark`,round:``},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.state.${n.state}`)),1)]),_:2},1032,[`type`]),e(`span`,ke,[a(O,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.scheduleLabel(n.schedule)),1)]),e(`span`,Ae,[a(k,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.template.model),1)]),n.execution===`local`?(m(),s(`span`,je,i(n.device_name||h.$t(`chat.scheduledTasks.execution.local`)),1)):o(``,!0)]),e(`div`,Me,i(n.template.question),1),n.last_output_snippet?(m(),s(`div`,Ne,i(n.last_output_snippet),1)):o(``,!0),e(`div`,Pe,[e(`span`,Fe,[a(A,{size:16,class:`footer-icon`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.runCount`,{count:n.run_count})),1)]),n.last_error?(m(),s(`span`,Ie,i(h.errorCodeText(n.last_error)),1)):o(``,!0),e(`span`,Le,[r(i(h.$t(`chat.scheduledTasks.viewRuns`))+` `,1),a(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])])]),_:2},1032,[`onClick`]))),128))]),h.tasks.length>h.pageSize?(m(),s(`div`,Re,[a(N,{"current-page":h.page,"page-size":h.pageSize,total:h.tasks.length,onChange:h.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)],64)):(m(),d(b,{key:1,description:h.$t(`chat.scheduledTasks.empty`),class:`empty`},null,8,[`description`]))],64)):(m(),s(l,{key:1},[e(`div`,{class:`filters`,role:`group`,"aria-label":h.$t(`chat.scheduledTasks.tab.runs`)},[(m(!0),s(l,null,p(h.statusFilters,e=>(m(),s(`button`,{key:e,type:`button`,class:n([`filter-chip`,{active:h.allRunsStatus===e}]),"aria-pressed":h.allRunsStatus===e,onClick:t=>h.onStatusFilter(e)},i(e===`all`?h.$t(`chat.scheduledTasks.filterAll`):h.$t(`chat.scheduledTasks.run.${e}`)),11,Be))),128))],8,ze),h.allRunsLoading?(m(),d(y,{key:0,rows:4,animated:``,class:`loading-block`})):h.allRuns.length?(m(),s(l,{key:2},[e(`div`,Ve,[(m(!0),s(l,null,p(h.allRuns,u=>(m(),s(`div`,{key:u.id,class:n([`run-item`,{clickable:!!u.conversation_id}]),tabindex:u.conversation_id?0:-1,role:u.conversation_id?`button`:void 0,onClick:e=>h.openRun(u),onKeydown:[c(e=>h.openRun(u),[`enter`]),c(t(e=>h.openRun(u),[`prevent`]),[`space`])]},[e(`div`,Ue,[e(`div`,We,[e(`span`,Ge,i(u.conversation_title||h.formatTime(u.scheduled_at)),1),a(D,{size:`small`,type:h.runTagType(u.status),effect:`dark`,round:``,class:`run-tag`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.run.${u.status}`)),1)]),_:2},1032,[`type`])]),u.conversation_preview?(m(),s(`div`,Ke,i(u.conversation_preview),1)):o(``,!0),e(`div`,qe,[u.task_name?(m(),d(D,{key:0,size:`small`,type:`info`,round:``,class:`run-task-tag`},{default:f(()=>[r(i(u.task_name),1)]),_:2},1024)):o(``,!0),u.execution===`local`?(m(),d(D,{key:1,size:`small`,type:`info`,round:``,class:`run-task-tag`},{default:f(()=>[r(i(u.device_name||h.$t(`chat.scheduledTasks.execution.local`)),1)]),_:2},1024)):o(``,!0),(m(!0),s(l,null,p(u.run_accounts,(e,t)=>(m(),d(D,{key:`${e.connector_identifier}-${t}`,size:`small`,type:`info`,round:``,class:`run-account-tag`},{default:f(()=>[r(i(h.accountTagText(e)),1)]),_:2},1024))),128)),e(`span`,Je,i(h.formatTime(u.scheduled_at)),1),h.runOutcomeText(u)?(m(),s(`span`,{key:2,class:n(u.status===`failed`?`run-error`:`run-outcome`),title:h.runOutcomeText(u)},i(h.runOutcomeText(u)),11,Ye)):o(``,!0)])]),e(`div`,Xe,[u.conversation_id?(m(),d(j,{key:0,class:`run-arrow`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),s(`span`,Ze,i(h.$t(`chat.scheduledTasks.noConversation`)),1))])],42,He))),128))]),h.allRunsCount>h.allRunsPageSize?(m(),s(`div`,Qe,[a(N,{"current-page":h.allRunsPage,"page-size":h.allRunsPageSize,total:h.allRunsCount,onChange:h.onAllRunsPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)],64)):(m(),d(b,{key:1,description:h.$t(`chat.scheduledTasks.noRuns`),class:`empty`},null,8,[`description`]))],64))]),a(ae,{modelValue:h.showRunHistory,"onUpdate:modelValue":g[1]||=e=>h.showRunHistory=e,title:h.selectedTask?.name,direction:`rtl`,size:`min(560px, 92vw)`,class:`run-history-drawer`},{default:f(()=>[h.selectedTask?(m(),s(`div`,$e,[e(`div`,et,[e(`span`,tt,i(h.$t(`common.entity.id`))+`: `+i(h.selectedTask.id),1),a(x,{content:h.selectedTask.id,class:`inline-block shrink-0`},null,8,[`content`])]),e(`div`,nt,[e(`span`,null,i(h.scheduleLabel(h.selectedTask.schedule)),1),e(`span`,null,i(h.selectedTask.template.model),1),e(`span`,null,i(h.$t(`chat.scheduledTasks.runCount`,{count:h.selectedTask.run_count})),1)]),e(`div`,rt,i(h.selectedTask.template.question),1)])):o(``,!0),h.runsLoading?(m(),d(y,{key:1,rows:3,animated:``})):h.runs.length?(m(),s(`div`,it,[(m(!0),s(l,null,p(h.pagedRuns,u=>(m(),s(`div`,{key:u.id,class:n([`run-item`,{clickable:!!u.conversation_id}]),tabindex:u.conversation_id?0:-1,role:u.conversation_id?`button`:void 0,onClick:e=>h.openRun(u),onKeydown:[c(e=>h.openRun(u),[`enter`]),c(t(e=>h.openRun(u),[`prevent`]),[`space`])]},[e(`div`,ot,[e(`div`,st,[e(`span`,ct,i(u.conversation_title||h.formatTime(u.scheduled_at)),1),a(D,{size:`small`,type:h.runTagType(u.status),effect:`dark`,round:``,class:`run-tag`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.run.${u.status}`)),1)]),_:2},1032,[`type`])]),u.conversation_preview?(m(),s(`div`,lt,i(u.conversation_preview),1)):o(``,!0),e(`div`,ut,[(m(!0),s(l,null,p(u.run_accounts,(e,t)=>(m(),d(D,{key:`${e.connector_identifier}-${t}`,size:`small`,type:`info`,round:``,class:`run-account-tag`},{default:f(()=>[r(i(h.accountTagText(e)),1)]),_:2},1024))),128)),e(`span`,dt,i(h.formatTime(u.scheduled_at)),1),h.runOutcomeText(u)?(m(),s(`span`,{key:0,class:n(u.status===`failed`?`run-error`:`run-outcome`),title:h.runOutcomeText(u)},i(h.runOutcomeText(u)),11,ft)):o(``,!0)])]),e(`div`,pt,[u.conversation_id?(m(),d(j,{key:0,class:`run-arrow`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),s(`span`,mt,i(h.$t(`chat.scheduledTasks.noConversation`)),1))])],42,at))),128))])):(m(),d(b,{key:2,description:h.$t(`chat.scheduledTasks.noRuns`)},null,8,[`description`])),!h.runsLoading&&h.runs.length>h.runPageSize?(m(),s(`div`,ht,[a(N,{"current-page":h.runPage,"page-size":h.runPageSize,total:h.runs.length,onChange:h.onRunPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)]),_:1},8,[`modelValue`,`title`]),a(W,{modelValue:h.showCreateDialog,"onUpdate:modelValue":g[19]||=e=>h.showCreateDialog=e,title:h.editingTask?h.$t(`chat.scheduledTasks.edit`):h.$t(`chat.scheduledTasks.create`),width:`540px`,"close-on-click-modal":!1,"close-on-press-escape":!h.saving,"show-close":!h.saving,class:`scheduled-task-dialog`},{footer:f(()=>[a(v,{disabled:h.saving,onClick:h.closeTaskDialog},{default:f(()=>[r(i(h.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(v,{type:`primary`,loading:h.saving,onClick:h.saveTask},{default:f(()=>[r(i(h.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`,`onClick`])]),default:f(()=>[a(U,{model:h.form,"label-width":`92px`},{default:f(()=>[a(F,{label:h.$t(`chat.scheduledTasks.form.name`)},{default:f(()=>[a(P,{modelValue:h.form.name,"onUpdate:modelValue":g[2]||=e=>h.form.name=e,placeholder:h.$t(`chat.scheduledTasks.form.namePlaceholder`),maxlength:`80`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.prompt`),required:``},{default:f(()=>[a(P,{modelValue:h.form.question,"onUpdate:modelValue":g[3]||=e=>h.form.question=e,type:`textarea`,rows:6,placeholder:h.$t(`chat.scheduledTasks.form.promptPlaceholder`)},null,8,[`modelValue`,`placeholder`]),e(`div`,gt,i(h.$t(`chat.scheduledTasks.form.promptHint`)),1)]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.model`)},{default:f(()=>[a(R,{modelValue:h.form.model,"onUpdate:modelValue":g[4]||=e=>h.form.model=e,style:{width:`100%`},filterable:``},{default:f(()=>[(m(!0),s(l,null,p(h.modelGroups,e=>(m(),d(L,{key:e.name,label:e.getDisplayName()},{default:f(()=>[(m(!0),s(l,null,p(e.models,e=>(m(),d(I,{key:e.name,label:e.getDisplayName(),value:e.name},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.execution`)},{default:f(()=>[a(B,{modelValue:h.form.execution,"onUpdate:modelValue":g[5]||=e=>h.form.execution=e},{default:f(()=>[a(z,{value:`cloud`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.execution.cloud`)),1)]),_:1}),a(C,{content:h.localUnavailableReason,disabled:h.canRunLocally,placement:`top`},{default:f(()=>[e(`span`,_t,[a(z,{value:`local`,disabled:!h.canRunLocally},{default:f(()=>[r(i(h.deviceIdentity?h.$t(`chat.scheduledTasks.execution.localNamed`,{device:h.deviceIdentity.device_name}):h.$t(`chat.scheduledTasks.execution.local`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`modelValue`]),e(`div`,vt,i(h.form.execution===`local`?h.$t(`chat.scheduledTasks.form.executionLocalHint`):h.$t(`chat.scheduledTasks.form.executionCloudHint`)),1)]),_:1},8,[`label`]),h.form.execution===`local`?(m(),d(F,{key:0,label:h.$t(`chat.scheduledTasks.form.localTools`)},{default:f(()=>[a(R,{modelValue:h.form.authorizedLocalTools,"onUpdate:modelValue":g[6]||=e=>h.form.authorizedLocalTools=e,multiple:``,filterable:``,style:{width:`100%`},placeholder:h.$t(`chat.scheduledTasks.form.localToolsPlaceholder`)},{default:f(()=>[(m(!0),s(l,null,p(h.localToolSpecs,t=>(m(),d(I,{key:t.name,label:t.name,value:t.name},{default:f(()=>[e(`span`,null,i(t.name),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`]),e(`div`,yt,i(h.$t(`chat.scheduledTasks.form.localToolsHint`)),1)]),_:1},8,[`label`])):o(``,!0),a(F,{label:h.$t(`chat.scheduledTasks.form.schedule`)},{default:f(()=>[a(B,{modelValue:h.form.scheduleType,"onUpdate:modelValue":g[7]||=e=>h.form.scheduleType=e},{default:f(()=>[a(z,{value:`interval`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.interval`)),1)]),_:1}),a(z,{value:`hourly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.hourly`)),1)]),_:1}),a(z,{value:`daily`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.daily`)),1)]),_:1}),a(z,{value:`weekly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.weekly`)),1)]),_:1}),a(z,{value:`cron`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.cron`)),1)]),_:1})]),_:1},8,[`modelValue`]),h.schedulePreview?(m(),s(`div`,bt,[a(O,{class:`preview-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.form.schedulePreview`,{text:h.schedulePreview})),1)])):o(``,!0)]),_:1},8,[`label`]),h.form.scheduleType===`interval`?(m(),d(F,{key:1,label:h.$t(`chat.scheduledTasks.scheduleType.interval`)},{default:f(()=>[a(V,{modelValue:h.form.intervalValue,"onUpdate:modelValue":g[8]||=e=>h.form.intervalValue=e,min:1,max:h.intervalMax,step:1,"controls-position":`right`},null,8,[`modelValue`,`max`]),a(R,{modelValue:h.form.intervalUnit,"onUpdate:modelValue":g[9]||=e=>h.form.intervalUnit=e,style:{width:`110px`,"margin-left":`8px`}},{default:f(()=>[a(I,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.minute`),value:`minute`},null,8,[`label`]),a(I,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.hour`),value:`hour`},null,8,[`label`]),a(I,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.day`),value:`day`},null,8,[`label`])]),_:1},8,[`modelValue`]),e(`div`,xt,i(h.$t(`chat.scheduledTasks.form.intervalHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`hourly`?(m(),d(F,{key:2,label:h.$t(`chat.scheduledTasks.form.hourlyMinute`)},{default:f(()=>[a(V,{modelValue:h.form.hourlyMinute,"onUpdate:modelValue":g[10]||=e=>h.form.hourlyMinute=e,min:0,max:59,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,St,i(h.$t(`chat.scheduledTasks.form.hourlyMinuteHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`daily`?(m(),d(F,{key:3,label:h.$t(`chat.scheduledTasks.form.time`)},{default:f(()=>[a(H,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[11]||=e=>h.form.dailyTime=e,format:`HH:mm`,"value-format":`HH:mm`},null,8,[`modelValue`]),e(`span`,Ct,i(h.$t(`chat.scheduledTasks.jitterHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`weekly`?(m(),d(F,{key:4,label:h.$t(`chat.scheduledTasks.form.weekday`)},{default:f(()=>[a(R,{modelValue:h.form.weekday,"onUpdate:modelValue":g[12]||=e=>h.form.weekday=e,style:{width:`120px`}},{default:f(()=>[(m(!0),s(l,null,p(h.weekdays,(e,t)=>(m(),d(I,{key:t,label:e,value:t},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`]),a(H,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[13]||=e=>h.form.dailyTime=e,format:`HH:mm`,"value-format":`HH:mm`,style:{"margin-left":`8px`}},null,8,[`modelValue`])]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`cron`?(m(),d(F,{key:5,label:h.$t(`chat.scheduledTasks.form.cron`)},{default:f(()=>[a(P,{modelValue:h.form.cronExpr,"onUpdate:modelValue":g[14]||=e=>h.form.cronExpr=e,placeholder:`0 9 * * *`},null,8,[`modelValue`]),e(`div`,wt,i(h.$t(`chat.scheduledTasks.form.cronHint`)),1)]),_:1},8,[`label`])):o(``,!0),a(F,{label:h.$t(`chat.scheduledTasks.form.skills`)},{default:f(()=>[a(R,{modelValue:h.form.authorizedSkills,"onUpdate:modelValue":g[15]||=e=>h.form.authorizedSkills=e,style:{width:`100%`},multiple:``,filterable:``,"collapse-tags":``,"collapse-tags-tooltip":``,loading:h.skillsLoading,placeholder:h.$t(`chat.scheduledTasks.form.skillsPlaceholder`),onVisibleChange:h.onSkillSelectVisible},{default:f(()=>[(m(!0),s(l,null,p(h.authorizableSkills,t=>(m(),d(I,{key:t.slug,label:h.skillLabel(t),value:t.slug,disabled:!t.connected},{default:f(()=>[e(`div`,Tt,[e(`span`,Et,i(h.skillLabel(t)),1),t.connected?o(``,!0):(m(),s(`span`,Dt,i(h.$t(`chat.scheduledTasks.form.skillMissing`)),1))])]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`modelValue`,`loading`,`placeholder`,`onVisibleChange`]),e(`div`,Ot,i(h.$t(`chat.scheduledTasks.form.skillsHint`)),1)]),_:1},8,[`label`]),h.selectedBrowserSkills.length?(m(),d(F,{key:6,label:h.$t(`chat.scheduledTasks.form.browserConnection`),required:``},{default:f(()=>[a(R,{modelValue:h.form.browserConnectionId,"onUpdate:modelValue":g[16]||=e=>h.form.browserConnectionId=e,style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(h.selectedBrowserConnections,e=>(m(),d(I,{key:e.connection_id,label:`${e.name} · ${e.device_name}`,value:e.connection_id,disabled:!e.online||!e.compatible},null,8,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`modelValue`]),h.selectedBrowserConnection?(m(),s(`div`,kt,[e(`div`,null,i(h.selectedBrowserConnection.allowed_origins.join(`, `)),1),e(`div`,null,i(h.$t(`chat.scheduledTasks.form.browserEffects`,{effects:h.selectedBrowserConnection.side_effects.join(`, `)})),1),e(`div`,null,i(h.$t(`chat.scheduledTasks.form.authorizationExpires`,{time:h.formatTime(h.form.authorizationExpiresAt)})),1)])):o(``,!0)]),_:1},8,[`label`])):o(``,!0),(m(!0),s(l,null,p(h.accountChoices,e=>(m(),d(F,{key:e.identifier,label:h.$t(`chat.scheduledTasks.form.connectionAccount`,{connector:e.label})},{default:f(()=>[a(R,{modelValue:h.form.connectionAccounts[e.identifier],"onUpdate:modelValue":t=>h.form.connectionAccounts[e.identifier]=t,clearable:``,placeholder:h.$t(`chat.scheduledTasks.form.connectionAccountDefault`),style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(e.accounts,e=>(m(),d(I,{key:e.connection_id,label:e.is_default?`${e.label||e.account_name} · ${h.$t(`chat.scheduledTasks.form.accountIsDefault`)}`:e.label||e.account_name,value:e.connection_id},null,8,[`label`,`value`]))),128))]),_:2},1032,[`modelValue`,`onUpdate:modelValue`,`placeholder`])]),_:2},1032,[`label`]))),128)),a(F,{label:h.$t(`chat.scheduledTasks.form.mcpServers`)},{default:f(()=>[a(R,{modelValue:h.form.authorizedMcpServers,"onUpdate:modelValue":g[17]||=e=>h.form.authorizedMcpServers=e,style:{width:`100%`},multiple:``,filterable:``,"collapse-tags":``,"collapse-tags-tooltip":``,loading:h.skillsLoading,placeholder:h.$t(`chat.scheduledTasks.form.mcpServersPlaceholder`),onVisibleChange:h.onSkillSelectVisible},{default:f(()=>[(m(!0),s(l,null,p(h.authorizableMcpServers,e=>(m(),d(I,{key:e.slug,label:h.mcpServerLabel(e),value:e.slug},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`loading`,`placeholder`,`onVisibleChange`]),e(`div`,At,i(h.$t(`chat.scheduledTasks.form.mcpServersHint`)),1)]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.maxTurns`)},{default:f(()=>[a(V,{modelValue:h.form.maxTurns,"onUpdate:modelValue":g[18]||=e=>h.form.maxTurns=e,min:1,max:50,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,jt,i(h.$t(`chat.scheduledTasks.form.maxTurnsHint`)),1)]),_:1},8,[`label`])]),_:1},8,[`model`])]),_:1},8,[`modelValue`,`title`,`close-on-press-escape`,`show-close`])])}var Nt=U(he,[[`render`,Mt],[`__scopeId`,`data-v-06edef8a`]]);export{Nt 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,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{F as h}from"./icon-CDmWyIgD.js";import{p as g}from"./models-CwEjR6Nf.js";import{t as _}from"./chart-no-axes-combined-NmmizHnk.js";import{t as v}from"./check-D7wYAXxh.js";import{t as y}from"./coins-CA8lophH.js";import{t as b}from"./wallet-g88KrNyB.js";import{Dn as x,Ei as S,Fi as C,G as w,Ni as T,O as E,et as D,gi as O,pi as k}from"./index-DIgS5Gvp.js";import{t as A}from"./CopyToClipboard-BoetcLMP.js";var j=m({name:`ApplicationInfo`,components:{AnalyticsIcon:_,ConfirmIcon:v,CreditsIcon:y,ElButton:C,ElIcon:h,ElTag:T,CopyToClipboard:A,WalletIcon:b},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}},emits:[`buy`,`usage`],computed:{showPayment(){return x(this.$store.getters.site)?!1:!k()||this.application?.scope===`Global`?!0:(this.application?.packages||[]).some(e=>e?.metadata?.apple_product_id)},remainingAmountText(){let e=Number(this.application?.remaining_amount??0);return!Number.isFinite(e)||e<0?`0.00`:e.toFixed(2)}}}),M={class:`flex flex-col min-w-0`},N={key:0,class:`app-id-row`},P={class:`icon !mb-0 flex-shrink-0`},F={class:`app-id-line`},I={class:`app-id-label`},L={class:`app-id-value`},R={key:1,class:`icon`},z={class:`text-left`},B={class:`description`},ee={key:0},V={key:1},H={class:`value`},U={class:`description2`},W={key:0},G={key:1},K={class:`actions`};function q(n,c,f,m,h,g){let _=l(`confirm-icon`),v=l(`el-icon`),y=l(`wallet-icon`),b=l(`copy-to-clipboard`),x=l(`el-tag`),S=l(`analytics-icon`),C=l(`el-button`),w=l(`credits-icon`);return p(),s(`div`,null,[e(`div`,M,[a(v,{class:`check`},{default:d(()=>[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1}),n.showId?(p(),s(`div`,N,[e(`div`,P,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,F,[e(`span`,I,i(n.$t(`application.field.id`))+`:`,1),e(`span`,L,i(n.application.id),1),n.application.id?(p(),u(b,{key:0,content:n.application.id,class:`copy-small`},null,8,[`content`])):o(``,!0)])])):(p(),s(`div`,R,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`div`,z,[e(`p`,B,[n.application.service?(p(),s(`span`,V,i(n.$t(`application.title.applicationBalance`,{service:n.application.service?.title})),1)):(p(),s(`span`,ee,i(n.$t(`application.title.globalBalance`)),1)),n.application.role===`grantee`?(p(),u(x,{key:2,class:`shared-badge`,size:`small`,type:`warning`,effect:`dark`,round:``},{default:d(()=>[r(i(n.$t(`application.badge.shared`)),1)]),_:1})):o(``,!0)]),e(`p`,H,i(n.remainingAmountText)+` `+i(n.$t(`service.unit.`+(n.application?.service?.unit||`credit`)+`s`)),1),e(`p`,U,[n.application.type===`Period`?(p(),s(`span`,W,i(n.$t(`application.field.expiredAt`))+`: `+i(n.$dayjs.format(n.application.expired_at)),1)):(p(),s(`span`,G,i(n.$t(`application.message.neverExpire`)),1))])])]),e(`div`,K,[a(C,{size:`small`,round:``,onClick:c[0]||=t(e=>n.$emit(`usage`,n.application),[`stop`])},{default:d(()=>[a(S,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.usage`)),1)]),_:1}),n.showPayment?(p(),u(C,{key:0,type:`primary`,round:``,size:`small`,onClick:c[1]||=t(e=>n.$emit(`buy`,n.application),[`stop`])},{default:d(()=>[a(w,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.buyMore`)),1)]),_:1})):o(``,!0)])])}var J=m({name:`ApplicationStatus`,components:{WalletIcon:b,ElDialog:S,ApplicationInfo:E(j,[[`render`,q],[`__scopeId`,`data-v-5c43793c`]])},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},service:{type:Object,required:!0}},emits:[`select`],data(){return{visible:!1,applicationType:g}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user},balanceAmount(){return Number(this.application?.remaining_amount??0)},balanceUnit(){let e=`service.unit.${this.application?.service?.unit||`credit`}`+(this.balanceAmount===1?``:`s`);return this.$t(e)},balanceText(){let e=this.balanceAmount;return Number.isFinite(e)?e>=1e3?Math.round(e).toLocaleString():e>=100?e.toFixed(1):e.toFixed(2):`0`},balanceTitle(){return`${this.balanceText} ${this.balanceUnit}`}},methods:{onGoUsage(e){let t={name:D,query:{application_id:e.id}};if(O()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onBuyMore(e){let t={name:w,params:{id:e.id}};if(O()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onSelectApplication(e){this.$emit(`select`,e)}}}),Y={class:`status`},X={key:0},Z={class:`text-center mb-4`},Q={class:`flex flex-col gap-4 mb-6 overflow-y-auto`},$=[`title`],te={class:`entry-amount`},ne={class:`entry-unit`};function re(t,r,m,h,g,_){let v=l(`application-info`),y=l(`el-dialog`),b=l(`wallet-icon`);return p(),s(`div`,Y,[a(y,{modelValue:t.visible,"onUpdate:modelValue":r[0]||=e=>t.visible=e,class:`mt-12`,width:`450px`},{default:d(()=>[t.application?(p(),s(`div`,X,[e(`p`,Z,i(t.$t(`application.message.applicationSelection`)),1),e(`div`,Q,[(p(!0),s(c,null,f(t.applications,(e,r)=>(p(),u(v,{key:r,class:n({item:!0,active:t.application?.id===e.id}),application:e,"show-id":``,onClick:n=>t.onSelectApplication(e),onUsage:n=>t.onGoUsage(e),onBuy:n=>t.onBuyMore(e)},null,8,[`class`,`application`,`onClick`,`onUsage`,`onBuy`]))),128))])])):o(``,!0)]),_:1},8,[`modelValue`]),e(`button`,{type:`button`,class:`entry`,title:t.balanceTitle,onClick:r[1]||=e=>t.visible=!0},[a(b,{class:`entry-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,te,i(t.balanceText),1),e(`span`,ne,i(t.balanceUnit),1)],8,$)])}var ie=E(J,[[`render`,re],[`__scopeId`,`data-v-b2f8b2d1`]]);export{ie as t};
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{F as h}from"./icon-CDmWyIgD.js";import{p as g}from"./models-DcpkDkjF.js";import{t as _}from"./chart-no-axes-combined-C2XBdAJR.js";import{t as v}from"./check-C1SSXE37.js";import{t as y}from"./coins-gBDFWv_r.js";import{t as b}from"./wallet-9ymkHmqV.js";import{Dn as x,Ei as S,Fi as C,G as w,Ni as T,O as E,et as D,gi as O,pi as k}from"./index-CREYJmGZ.js";import{t as A}from"./CopyToClipboard-CLVp5I29.js";var j=m({name:`ApplicationInfo`,components:{AnalyticsIcon:_,ConfirmIcon:v,CreditsIcon:y,ElButton:C,ElIcon:h,ElTag:T,CopyToClipboard:A,WalletIcon:b},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}},emits:[`buy`,`usage`],computed:{showPayment(){return x(this.$store.getters.site)?!1:!k()||this.application?.scope===`Global`?!0:(this.application?.packages||[]).some(e=>e?.metadata?.apple_product_id)},remainingAmountText(){let e=Number(this.application?.remaining_amount??0);return!Number.isFinite(e)||e<0?`0.00`:e.toFixed(2)}}}),M={class:`flex flex-col min-w-0`},N={key:0,class:`app-id-row`},P={class:`icon !mb-0 flex-shrink-0`},F={class:`app-id-line`},I={class:`app-id-label`},L={class:`app-id-value`},R={key:1,class:`icon`},z={class:`text-left`},B={class:`description`},ee={key:0},V={key:1},H={class:`value`},U={class:`description2`},W={key:0},G={key:1},K={class:`actions`};function q(n,c,f,m,h,g){let _=l(`confirm-icon`),v=l(`el-icon`),y=l(`wallet-icon`),b=l(`copy-to-clipboard`),x=l(`el-tag`),S=l(`analytics-icon`),C=l(`el-button`),w=l(`credits-icon`);return p(),s(`div`,null,[e(`div`,M,[a(v,{class:`check`},{default:d(()=>[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1}),n.showId?(p(),s(`div`,N,[e(`div`,P,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,F,[e(`span`,I,i(n.$t(`application.field.id`))+`:`,1),e(`span`,L,i(n.application.id),1),n.application.id?(p(),u(b,{key:0,content:n.application.id,class:`copy-small`},null,8,[`content`])):o(``,!0)])])):(p(),s(`div`,R,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`div`,z,[e(`p`,B,[n.application.service?(p(),s(`span`,V,i(n.$t(`application.title.applicationBalance`,{service:n.application.service?.title})),1)):(p(),s(`span`,ee,i(n.$t(`application.title.globalBalance`)),1)),n.application.role===`grantee`?(p(),u(x,{key:2,class:`shared-badge`,size:`small`,type:`warning`,effect:`dark`,round:``},{default:d(()=>[r(i(n.$t(`application.badge.shared`)),1)]),_:1})):o(``,!0)]),e(`p`,H,i(n.remainingAmountText)+` `+i(n.$t(`service.unit.`+(n.application?.service?.unit||`credit`)+`s`)),1),e(`p`,U,[n.application.type===`Period`?(p(),s(`span`,W,i(n.$t(`application.field.expiredAt`))+`: `+i(n.$dayjs.format(n.application.expired_at)),1)):(p(),s(`span`,G,i(n.$t(`application.message.neverExpire`)),1))])])]),e(`div`,K,[a(C,{size:`small`,round:``,onClick:c[0]||=t(e=>n.$emit(`usage`,n.application),[`stop`])},{default:d(()=>[a(S,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.usage`)),1)]),_:1}),n.showPayment?(p(),u(C,{key:0,type:`primary`,round:``,size:`small`,onClick:c[1]||=t(e=>n.$emit(`buy`,n.application),[`stop`])},{default:d(()=>[a(w,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.buyMore`)),1)]),_:1})):o(``,!0)])])}var J=m({name:`ApplicationStatus`,components:{WalletIcon:b,ElDialog:S,ApplicationInfo:E(j,[[`render`,q],[`__scopeId`,`data-v-5c43793c`]])},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},service:{type:Object,required:!0}},emits:[`select`],data(){return{visible:!1,applicationType:g}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user},balanceAmount(){return Number(this.application?.remaining_amount??0)},balanceUnit(){let e=`service.unit.${this.application?.service?.unit||`credit`}`+(this.balanceAmount===1?``:`s`);return this.$t(e)},balanceText(){let e=this.balanceAmount;return Number.isFinite(e)?e>=1e3?Math.round(e).toLocaleString():e>=100?e.toFixed(1):e.toFixed(2):`0`},balanceTitle(){return`${this.balanceText} ${this.balanceUnit}`}},methods:{onGoUsage(e){let t={name:D,query:{application_id:e.id}};if(O()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onBuyMore(e){let t={name:w,params:{id:e.id}};if(O()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onSelectApplication(e){this.$emit(`select`,e)}}}),Y={class:`status`},X={key:0},Z={class:`text-center mb-4`},Q={class:`flex flex-col gap-4 mb-6 overflow-y-auto`},$=[`title`],te={class:`entry-amount`},ne={class:`entry-unit`};function re(t,r,m,h,g,_){let v=l(`application-info`),y=l(`el-dialog`),b=l(`wallet-icon`);return p(),s(`div`,Y,[a(y,{modelValue:t.visible,"onUpdate:modelValue":r[0]||=e=>t.visible=e,class:`mt-12`,width:`450px`},{default:d(()=>[t.application?(p(),s(`div`,X,[e(`p`,Z,i(t.$t(`application.message.applicationSelection`)),1),e(`div`,Q,[(p(!0),s(c,null,f(t.applications,(e,r)=>(p(),u(v,{key:r,class:n({item:!0,active:t.application?.id===e.id}),application:e,"show-id":``,onClick:n=>t.onSelectApplication(e),onUsage:n=>t.onGoUsage(e),onBuy:n=>t.onBuyMore(e)},null,8,[`class`,`application`,`onClick`,`onUsage`,`onBuy`]))),128))])])):o(``,!0)]),_:1},8,[`modelValue`]),e(`button`,{type:`button`,class:`entry`,title:t.balanceTitle,onClick:r[1]||=e=>t.visible=!0},[a(b,{class:`entry-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,te,i(t.balanceText),1),e(`span`,ne,i(t.balanceUnit),1)],8,$)])}var ie=E(J,[[`render`,re],[`__scopeId`,`data-v-b2f8b2d1`]]);export{ie as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{m,p as h,v as g}from"./models-CwEjR6Nf.js";import{t as _}from"./card-IQwqnRJR.js";import{n as v,t as y}from"./row-Cbv7FLTy.js";import{t as b}from"./empty-C5KjRN0h.js";import{t as x}from"./skeleton-Dj_a_iIP.js";import{t as S}from"./check-D7wYAXxh.js";import{Cn as C,Dn as w,Fi as T,G as E,K as D,Ni as O,Nr as k,O as A,Tr as j,X as M,an as N,lr as P,mr as F,pi as I,xn as L,yi as R}from"./index-DIgS5Gvp.js";var z=p({name:`ConsoleSubscriptionBuy`,components:{CloseIcon:R,ConfirmIcon:S,ElSkeleton:x,ElRow:y,ElTag:O,ElCol:v,ElCard:_,ElEmpty:b,ElButton:T},data(){return{application:void 0,application2:void 0,type:h.PERIOD,services:[],loading:!1,loadFailed:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){return this.$route.params?.id?.toString()},showPayment(){return!I()},effectiveMarkupRatio(){return C(this.application2,this.site)},pricingAvailable(){return this.effectiveMarkupRatio!==void 0},subscriptions(){let e=[{name:`WEEK`,label:this.$t(`console.subscription.weekly`),description:this.$t(`console.subscription.weekly.description`),duration:10080*60},{name:`MONTH`,label:this.$t(`console.subscription.monthly`),description:this.$t(`console.subscription.monthly.description`),duration:720*60*60},{name:`YEAR`,tag:this.$t(`console.button.suggested`),label:this.$t(`console.subscription.yearly`),description:this.$t(`console.subscription.yearly.description`),duration:365*24*60*60}];for(let t of e){console.log(`item`,t);let e=this.getPackages(t.duration);console.log(`pkgs`,e),t.available=e.length>0&&this.effectiveMarkupRatio!==void 0,t.available&&(t.price=L(e.reduce((e,t)=>e+t.price,0),this.effectiveMarkupRatio));for(let n of e)t.benefits||=[],t.benefits.push({enabled:!0,content:`${n?.service?.title} - ${n.amount} `+this.$t(`service.unit.`+n?.service?.unit+`s`)});t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit1`)}),t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit2`)})}return e},service(){return this.application?.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){if(w(this.$store.getters.site)){this.$router.replace({name:D});return}await this.onInitialize()},methods:{async onInitialize(){this.loading=!0,this.loadFailed=!1;try{await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.subscription=this.subscriptions.find(e=>e.available)}catch{this.loadFailed=!0}finally{this.loading=!1}},getPriceString:N,onBuyExtra(){this.$router.push({name:E,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];let n=[this.service].sort((e,t)=>this.serviceIds.indexOf(e.id)-this.serviceIds.indexOf(t.id));for(let r of n){let n=r.packages?.find(t=>t.type===m.PERIOD&&t.duration===e);n&&t.push({...n,service:r})}return t},async onCreateApplications(){let e=[];if(this.application2||e.push(this.application?.service?.id),e.length>0){for(let t of e)await j.create({service_id:t,type:h.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log(`onChangeType`,this.type),this.$router.push({name:E,params:this.$route.params})},async onFetchServices(){let{data:e}=await P.getAll({id:this.serviceIds});this.services=e.items,console.debug(`services`,this.services)},async onFetchApplication(){let{data:e}=await j.get(this.applicationId);this.application=e,console.debug(`application`,this.application)},async onFetchApplication2(){let{data:e}=await j.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:`-created_at`,service_id:this.serviceIds,type:h.PERIOD});this.application2=e.items?.[0],console.debug(`application2`,this.application2)},onCreateOrder(e){let t=this.getPackages(e.duration);if(!(!this.pricingAvailable||!e.available||t.length===0)){if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){g.error(this.$t(`console.message.applicationNotFound`)),this.creating=!1;return}k(`payment_initiated`,{service:this.service?.alias,action:`subscribe`,duration:e.duration}),F.create({application_ids:[this.application2.id],package_ids:t.map(e=>e.id),description:this.service?.title+` - `+e.label}).then(({data:e})=>{this.creating=!1,this.$router.push({name:M,params:{id:e.id}})}).catch(e=>{g.error(this.$t(`order.message.createFailed`)),this.creating=!1,k(`payment_failed`,{service:this.service?.alias,action:`subscribe`,error:e?.response?.data?.error?.message??String(e)})})}}}}),B={class:`title`},V={class:`introduction`},H={key:1,class:`text-center`},U={class:`name`},W={class:`price`},G={key:1,class:`text-[var(--el-text-color-secondary)]`},K={class:`description`},q={class:`benefits`},J={class:`operations`},Y={key:3,class:`extra`};function X(p,m,h,g,_,v){let y=c(`el-col`),b=c(`el-row`),x=c(`el-empty`),S=c(`el-skeleton`),C=c(`el-button`),w=c(`el-tag`),T=c(`confirm-icon`),E=c(`close-icon`),D=c(`el-card`);return f(),l(b,{class:`panel`},{default:u(()=>[i(y,{span:24},{default:u(()=>[i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[e(`h2`,B,r(p.$t(`common.title.buyMore`)),1)]),_:1})]),_:1}),i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[i(D,{shadow:`hover`,class:`card`},{default:u(()=>[i(b,null,{default:u(()=>[p.showPayment?(f(),l(y,{key:1,class:`max-w-4xl mx-auto`},{default:u(()=>[e(`p`,V,r(p.$t(`console.subscription.title`)),1),p.loading?(f(),l(S,{key:0})):p.loadFailed?(f(),o(`div`,H,[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`]),i(C,{type:`primary`,round:``,onClick:p.onInitialize},{default:u(()=>[n(r(p.$t(`common.button.refresh`)),1)]),_:1},8,[`onClick`])])):(f(),l(b,{key:2,gutter:15,class:`subscriptions`},{default:u(()=>[(f(!0),o(s,null,d(p.subscriptions,(c,m)=>(f(),l(y,{key:m,xs:24,md:24/(p.subscriptions?.length||4)},{default:u(()=>[i(D,{shadow:`hover`,class:t({subscription:!0,active:p.subscription?.name===c.name,disabled:!c.available}),onClick:e=>c.available&&(p.subscription=c)},{default:u(()=>[e(`h4`,U,[n(r(c.label)+` `,1),c.tag?(f(),l(w,{key:0,type:`warning`},{default:u(()=>[n(r(c.tag),1)]),_:2},1024)):a(``,!0)]),e(`h2`,W,[c.price===void 0?(f(),o(`span`,G,r(p.$t(`common.message.noData`)),1)):(f(),o(s,{key:0},[n(r(p.getPriceString({value:c.price})),1)],64))]),e(`p`,K,r(c.description),1),e(`div`,q,[(f(!0),o(s,null,d(c.benefits,(t,n)=>(f(),o(`div`,{key:n,class:`benefit`},[t.enabled?(f(),l(T,{key:0,class:`icon icon-check`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(f(),l(E,{key:1,class:`icon icon-xmark`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,r(t.content),1)]))),128))]),e(`div`,J,[p.showPayment?(f(),l(C,{key:0,class:`btn btn-subscribe`,type:p.subscription?.name===c?.name?`primary`:``,disabled:!c.available,round:``,onClick:e=>p.onCreateOrder(c)},{default:u(()=>[n(r(p.$t(`common.button.buy`)),1)]),_:1},8,[`type`,`disabled`,`onClick`])):a(``,!0)])]),_:2},1032,[`class`,`onClick`])]),_:2},1032,[`md`]))),128))]),_:1})),!p.loading&&!p.loadFailed&&p.showPayment?(f(),o(`div`,Y,[e(`span`,null,r(p.$t(`console.message.doNotWantSubscribe`)),1),i(C,{type:`primary`,class:`btn btn-extra`,round:``,size:`small`,onClick:p.onBuyExtra},{default:u(()=>[n(r(p.$t(`console.message.buyExtra`)),1)]),_:1},8,[`onClick`])])):a(``,!0)]),_:1})):(f(),l(y,{key:0,class:`max-w-4xl mx-auto`},{default:u(()=>[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`])]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Z=A(z,[[`render`,X],[`__scopeId`,`data-v-8b874c63`]]);export{Z as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{m,p as h,v as g}from"./models-DcpkDkjF.js";import{t as _}from"./card-IQwqnRJR.js";import{n as v,t as y}from"./row-DQqpuvYH.js";import{t as b}from"./empty-C5KjRN0h.js";import{t as x}from"./skeleton-Dj_a_iIP.js";import{t as S}from"./check-C1SSXE37.js";import{Cn as C,Dn as w,Fi as T,G as E,K as D,Ni as O,Nr as k,O as A,Tr as j,X as M,an as N,lr as P,mr as F,pi as I,xn as L,yi as R}from"./index-CREYJmGZ.js";var z=p({name:`ConsoleSubscriptionBuy`,components:{CloseIcon:R,ConfirmIcon:S,ElSkeleton:x,ElRow:y,ElTag:O,ElCol:v,ElCard:_,ElEmpty:b,ElButton:T},data(){return{application:void 0,application2:void 0,type:h.PERIOD,services:[],loading:!1,loadFailed:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){return this.$route.params?.id?.toString()},showPayment(){return!I()},effectiveMarkupRatio(){return C(this.application2,this.site)},pricingAvailable(){return this.effectiveMarkupRatio!==void 0},subscriptions(){let e=[{name:`WEEK`,label:this.$t(`console.subscription.weekly`),description:this.$t(`console.subscription.weekly.description`),duration:10080*60},{name:`MONTH`,label:this.$t(`console.subscription.monthly`),description:this.$t(`console.subscription.monthly.description`),duration:720*60*60},{name:`YEAR`,tag:this.$t(`console.button.suggested`),label:this.$t(`console.subscription.yearly`),description:this.$t(`console.subscription.yearly.description`),duration:365*24*60*60}];for(let t of e){console.log(`item`,t);let e=this.getPackages(t.duration);console.log(`pkgs`,e),t.available=e.length>0&&this.effectiveMarkupRatio!==void 0,t.available&&(t.price=L(e.reduce((e,t)=>e+t.price,0),this.effectiveMarkupRatio));for(let n of e)t.benefits||=[],t.benefits.push({enabled:!0,content:`${n?.service?.title} - ${n.amount} `+this.$t(`service.unit.`+n?.service?.unit+`s`)});t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit1`)}),t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit2`)})}return e},service(){return this.application?.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){if(w(this.$store.getters.site)){this.$router.replace({name:D});return}await this.onInitialize()},methods:{async onInitialize(){this.loading=!0,this.loadFailed=!1;try{await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.subscription=this.subscriptions.find(e=>e.available)}catch{this.loadFailed=!0}finally{this.loading=!1}},getPriceString:N,onBuyExtra(){this.$router.push({name:E,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];let n=[this.service].sort((e,t)=>this.serviceIds.indexOf(e.id)-this.serviceIds.indexOf(t.id));for(let r of n){let n=r.packages?.find(t=>t.type===m.PERIOD&&t.duration===e);n&&t.push({...n,service:r})}return t},async onCreateApplications(){let e=[];if(this.application2||e.push(this.application?.service?.id),e.length>0){for(let t of e)await j.create({service_id:t,type:h.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log(`onChangeType`,this.type),this.$router.push({name:E,params:this.$route.params})},async onFetchServices(){let{data:e}=await P.getAll({id:this.serviceIds});this.services=e.items,console.debug(`services`,this.services)},async onFetchApplication(){let{data:e}=await j.get(this.applicationId);this.application=e,console.debug(`application`,this.application)},async onFetchApplication2(){let{data:e}=await j.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:`-created_at`,service_id:this.serviceIds,type:h.PERIOD});this.application2=e.items?.[0],console.debug(`application2`,this.application2)},onCreateOrder(e){let t=this.getPackages(e.duration);if(!(!this.pricingAvailable||!e.available||t.length===0)){if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){g.error(this.$t(`console.message.applicationNotFound`)),this.creating=!1;return}k(`payment_initiated`,{service:this.service?.alias,action:`subscribe`,duration:e.duration}),F.create({application_ids:[this.application2.id],package_ids:t.map(e=>e.id),description:this.service?.title+` - `+e.label}).then(({data:e})=>{this.creating=!1,this.$router.push({name:M,params:{id:e.id}})}).catch(e=>{g.error(this.$t(`order.message.createFailed`)),this.creating=!1,k(`payment_failed`,{service:this.service?.alias,action:`subscribe`,error:e?.response?.data?.error?.message??String(e)})})}}}}),B={class:`title`},V={class:`introduction`},H={key:1,class:`text-center`},U={class:`name`},W={class:`price`},G={key:1,class:`text-[var(--el-text-color-secondary)]`},K={class:`description`},q={class:`benefits`},J={class:`operations`},Y={key:3,class:`extra`};function X(p,m,h,g,_,v){let y=c(`el-col`),b=c(`el-row`),x=c(`el-empty`),S=c(`el-skeleton`),C=c(`el-button`),w=c(`el-tag`),T=c(`confirm-icon`),E=c(`close-icon`),D=c(`el-card`);return f(),l(b,{class:`panel`},{default:u(()=>[i(y,{span:24},{default:u(()=>[i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[e(`h2`,B,r(p.$t(`common.title.buyMore`)),1)]),_:1})]),_:1}),i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[i(D,{shadow:`hover`,class:`card`},{default:u(()=>[i(b,null,{default:u(()=>[p.showPayment?(f(),l(y,{key:1,class:`max-w-4xl mx-auto`},{default:u(()=>[e(`p`,V,r(p.$t(`console.subscription.title`)),1),p.loading?(f(),l(S,{key:0})):p.loadFailed?(f(),o(`div`,H,[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`]),i(C,{type:`primary`,round:``,onClick:p.onInitialize},{default:u(()=>[n(r(p.$t(`common.button.refresh`)),1)]),_:1},8,[`onClick`])])):(f(),l(b,{key:2,gutter:15,class:`subscriptions`},{default:u(()=>[(f(!0),o(s,null,d(p.subscriptions,(c,m)=>(f(),l(y,{key:m,xs:24,md:24/(p.subscriptions?.length||4)},{default:u(()=>[i(D,{shadow:`hover`,class:t({subscription:!0,active:p.subscription?.name===c.name,disabled:!c.available}),onClick:e=>c.available&&(p.subscription=c)},{default:u(()=>[e(`h4`,U,[n(r(c.label)+` `,1),c.tag?(f(),l(w,{key:0,type:`warning`},{default:u(()=>[n(r(c.tag),1)]),_:2},1024)):a(``,!0)]),e(`h2`,W,[c.price===void 0?(f(),o(`span`,G,r(p.$t(`common.message.noData`)),1)):(f(),o(s,{key:0},[n(r(p.getPriceString({value:c.price})),1)],64))]),e(`p`,K,r(c.description),1),e(`div`,q,[(f(!0),o(s,null,d(c.benefits,(t,n)=>(f(),o(`div`,{key:n,class:`benefit`},[t.enabled?(f(),l(T,{key:0,class:`icon icon-check`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(f(),l(E,{key:1,class:`icon icon-xmark`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,r(t.content),1)]))),128))]),e(`div`,J,[p.showPayment?(f(),l(C,{key:0,class:`btn btn-subscribe`,type:p.subscription?.name===c?.name?`primary`:``,disabled:!c.available,round:``,onClick:e=>p.onCreateOrder(c)},{default:u(()=>[n(r(p.$t(`common.button.buy`)),1)]),_:1},8,[`type`,`disabled`,`onClick`])):a(``,!0)])]),_:2},1032,[`class`,`onClick`])]),_:2},1032,[`md`]))),128))]),_:1})),!p.loading&&!p.loadFailed&&p.showPayment?(f(),o(`div`,Y,[e(`span`,null,r(p.$t(`console.message.doNotWantSubscribe`)),1),i(C,{type:`primary`,class:`btn btn-extra`,round:``,size:`small`,onClick:p.onBuyExtra},{default:u(()=>[n(r(p.$t(`console.message.buyExtra`)),1)]),_:1},8,[`onClick`])])):a(``,!0)]),_:1})):(f(),l(y,{key:0,class:`max-w-4xl mx-auto`},{default:u(()=>[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`])]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Z=A(z,[[`render`,X],[`__scopeId`,`data-v-8b874c63`]]);export{Z as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{L as e,at as t,j as n,mt as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{n as o,t as s}from"./tabs-BFs4t-aK.js";import{O as c,ct as l,lt as u}from"./index-DIgS5Gvp.js";var d=a({name:`FishTabSwitcher`,components:{ElTabs:o,ElTabPane:s},data(){return{ROUTE_FISH_TTS_INDEX:u,ROUTE_FISH_MODEL_INDEX:l}},computed:{active(){return(this.$route?.name||``)===`fish-model-index`?l:u}},methods:{onUpdate(e){let t=String(e);t!==this.active&&this.$router.push({name:t})}}});function f(a,o,s,c,l,u){let d=t(`el-tab-pane`),f=t(`el-tabs`);return i(),n(f,{"model-value":a.active,class:`fish-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":a.onUpdate},{default:r(()=>[e(d,{label:a.$t(`fish.tab.tts`),name:a.ROUTE_FISH_TTS_INDEX},null,8,[`label`,`name`]),e(d,{label:a.$t(`fish.tab.model`),name:a.ROUTE_FISH_MODEL_INDEX},null,8,[`label`,`name`])]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var p=c(d,[[`render`,f],[`__scopeId`,`data-v-f942a514`]]);export{p as t};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{L as e,at as t,j as n,mt as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{n as o,t as s}from"./tabs-DsmI05G2.js";import{O as c,ct as l,lt as u}from"./index-CREYJmGZ.js";var d=a({name:`FishTabSwitcher`,components:{ElTabs:o,ElTabPane:s},data(){return{ROUTE_FISH_TTS_INDEX:u,ROUTE_FISH_MODEL_INDEX:l}},computed:{active(){return(this.$route?.name||``)===`fish-model-index`?l:u}},methods:{onUpdate(e){let t=String(e);t!==this.active&&this.$router.push({name:t})}}});function f(a,o,s,c,l,u){let d=t(`el-tab-pane`),f=t(`el-tabs`);return i(),n(f,{"model-value":a.active,class:`fish-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":a.onUpdate},{default:r(()=>[e(d,{label:a.$t(`fish.tab.tts`),name:a.ROUTE_FISH_TTS_INDEX},null,8,[`label`,`name`]),e(d,{label:a.$t(`fish.tab.model`),name:a.ROUTE_FISH_MODEL_INDEX},null,8,[`label`,`name`])]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var p=c(d,[[`render`,f],[`__scopeId`,`data-v-f942a514`]]);export{p as t};
@@ -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{n as h,r as g,t as _}from"./select-CUw_YhcY.js";import{t as v}from"./tooltip-xGYGkgTR.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-CwEjR6Nf.js";import{t as S}from"./slider-508i2Vb5.js";import{t as C}from"./clock-CS3ZX4nf.js";import{a as w,c as T,n as E,r as D,t as O}from"./pagination-CebMKB63.js";import{t as k}from"./info-C40CnPeL.js";import{t as A}from"./mic-CrSotd0p.js";import{t as ee}from"./trash-2-xb-Jm4i0.js";import{t as te}from"./triangle-alert-COLtfogn.js";import{t as j}from"./wand-sparkles-DDyMsIR4.js";import{ft as M,ht as ne}from"./constants-CQR8cCBL.js";import{Fi as N,Mn as P,Mr as re,O as F,Qt as I,bi as L,en as R,in as z,pn as B,xi as V}from"./index-DIgS5Gvp.js";import{t as H}from"./CopyToClipboard-BoetcLMP.js";import{t as U}from"./ReportButton-D7JGzuC6.js";import{t as W}from"./Consumption-64yHTpsG.js";import{t as G}from"./ApiCodeButton-CiYVI-BW.js";import{t as K}from"./BotPlaceholder-CWVuEjbL.js";import{t as q}from"./Hailuo-BgKkSb1Z.js";import{t as J}from"./TabSwitcher-ClLXbedz.js";var Y=L(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),X=m({name:`FishTextInput`,components:{PromptTextarea:w},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function ie(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.text,"onUpdate:modelValue":t[0]||=t=>e.text=t,title:e.$t(`fish.name.text`),info:e.$t(`fish.description.text`),placeholder:e.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ae=F(X,[[`render`,ie]]),oe=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:ne,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=M}}),se={class:`field`},ce={class:`title font-bold`};function le(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,se,[e(`h2`,ce,i(t.$t(`fish.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`fish.placeholder.select`)},{default:d(()=>[(p(!0),s(c,null,f(t.options,e=>(p(),u(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ue=F(oe,[[`render`,le],[`__scopeId`,`data-v-9702e6d3`]]),de=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),fe={class:`voice-option`},pe=[`aria-label`],me={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},_e={key:1,class:`preview placeholder`,"aria-hidden":`true`},ve={class:`meta`},ye={class:`label`},be={key:0,class:`description`};function xe(r,a,c,l,u,d){return p(),s(`div`,fe,[r.option.audio?(p(),s(`button`,{key:0,type:`button`,class:n([`preview`,{playing:r.playing,loading:r.loading}]),"aria-label":r.playing?`stop preview`:`play preview`,onMousedown:a[0]||=t(()=>{},[`prevent`]),onClick:a[1]||=t(e=>r.$emit(`preview`,r.option),[`stop`,`prevent`])},[r.loading?(p(),s(`svg`,me,[...a[2]||=[e(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-dasharray":`42 60`},null,-1)]])):r.playing?(p(),s(`svg`,he,[...a[3]||=[e(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1),e(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1)]])):(p(),s(`svg`,ge,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,pe)):(p(),s(`span`,_e,[...a[5]||=[e(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`},[e(`path`,{d:`M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11z`,fill:`currentColor`})],-1)]])),e(`div`,ve,[e(`span`,ye,i(r.option.label),1),r.option.description?(p(),s(`span`,be,i(r.option.description),1)):o(``,!0)])])}var Se=F(de,[[`render`,xe],[`__scopeId`,`data-v-c16a6a46`]]),Ce=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Ce(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},we=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:Se},data(){return{popularVoices:[],searchVoices:[],popularLoading:!1,searchLoading:!1,preloaded:!1,query:``,playingId:null,loadingId:null,labelCache:{},previewAudio:null,searchTimer:null,searchSeq:0}},computed:{remoteLoading(){return this.popularLoading||this.searchLoading},myVoices(){return this.$store.state.fish?.voices??[]},myOptions(){return this.myVoices.map(Z).filter(e=>!!e.value)},publicPool(){return this.query&&(this.searchVoices.length||this.searchLoading)?{voices:this.searchVoices,isSearch:!0}:{voices:this.popularVoices,isSearch:!1}},publicOptions(){let e=new Set(this.myOptions.map(e=>e.value));return this.publicPool.voices.map(Z).filter(t=>!!t.value&&!e.has(t.value))},filteredMyOptions(){return this.applyQuery(this.myOptions)},filteredPublicOptions(){return this.publicPool.isSearch?this.publicOptions:this.applyQuery(this.publicOptions)},fallbackOption(){let e=this.value;return!e||this.myOptions.some(t=>t.value===e)||this.publicOptions.some(t=>t.value===e)?null:{value:e,label:this.labelCache[e]||e}},noDataText(){return this.remoteLoading?this.$t(`fish.message.searching`):this.credential?.token?this.$t(`fish.message.searchVoiceHint`):this.$t(`fish.message.noVoices`)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{myOptions:{immediate:!0,handler(e){this.cacheLabels(e)}},publicOptions(e){this.cacheLabels(e)},credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`),this.preloaded||this.fetchPopular()}}},beforeUnmount(){this.stopPreview(),this.searchTimer&&clearTimeout(this.searchTimer)},methods:{cacheLabels(e){for(let t of e)this.labelCache[t.value]=t.label},applyQuery(e){let t=this.query.toLowerCase();return t?e.filter(e=>e.label.toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)):e},onVisibleChange(e){e&&!this.preloaded&&!this.popularLoading&&this.fetchPopular()},onFilter(e){if(this.query=(e||``).trim(),this.searchTimer&&clearTimeout(this.searchTimer),!this.query){this.searchSeq++,this.searchVoices=[],this.searchLoading=!1;return}this.searchTimer=setTimeout(()=>this.fetchSearch(this.query),350)},async fetchPopular(){let e=this.credential?.token;if(!(!e||this.popularLoading)){this.popularLoading=!0;try{let{data:t}=await P.listModels({self:!1,page_size:30,page_number:1},{token:e});this.popularVoices=t?.items??[],this.preloaded=!0}catch(e){console.error(`fish.loadPopularVoices failed`,e)}finally{this.popularLoading=!1}}},async fetchSearch(e){let t=this.credential?.token;if(!t)return;let n=++this.searchSeq;this.searchLoading=!0;try{let{data:r}=await P.listModels({self:!1,page_size:30,page_number:1,title:e},{token:t});if(n!==this.searchSeq)return;this.searchVoices=r?.items??[]}catch(e){n===this.searchSeq&&(this.searchVoices=[]),console.error(`fish.searchPublicVoices failed`,e)}finally{n===this.searchSeq&&(this.searchLoading=!1)}},togglePreview(e){if(!e.audio)return;if(this.playingId===e.value||this.loadingId===e.value){this.stopPreview();return}this.stopPreview();let t=new Audio(e.audio),n=()=>{this.previewAudio===t&&(this.loadingId=null,this.playingId=e.value)},r=()=>{this.previewAudio===t&&this.stopPreview()};t.addEventListener(`playing`,n),t.addEventListener(`ended`,r),t.addEventListener(`error`,r),this.previewAudio=t,this.loadingId=e.value,this.playingId=null,t.play().catch(()=>{this.previewAudio===t&&this.stopPreview()})},stopPreview(){this.previewAudio&&=(this.previewAudio.pause(),this.previewAudio.src=``,null),this.playingId=null,this.loadingId=null}}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,r,m,h,g){let _=l(`el-option`),v=l(`voice-option`),y=l(`el-option-group`),b=l(`el-select`);return p(),s(`div`,Te,[e(`h2`,Ee,i(t.$t(`fish.name.voice`)),1),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,"popper-class":`fish-voice-popper`,placeholder:t.$t(`fish.placeholder.voice`),clearable:``,filterable:``,"filter-method":t.onFilter,loading:t.remoteLoading,"loading-text":t.$t(`fish.message.searching`),"no-data-text":t.noDataText,onVisibleChange:t.onVisibleChange},{default:d(()=>[t.fallbackOption?(p(),u(_,{key:t.fallbackOption.value,label:t.fallbackOption.label,value:t.fallbackOption.value},null,8,[`label`,`value`])):o(``,!0),t.filteredMyOptions.length?(p(),u(y,{key:1,label:t.$t(`fish.title.myVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredMyOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.filteredPublicOptions.length?(p(),u(y,{key:2,label:t.$t(`fish.group.publicVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredPublicOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0)]),_:1},8,[`modelValue`,`placeholder`,`filter-method`,`loading`,`loading-text`,`no-data-text`,`onVisibleChange`])])}var Oe=m({name:`FishConfigPanel`,components:{MagicIcon:j,ElButton:N,ElSlider:S,TextInput:ae,ModelSelector:ue,VoicePicker:F(we,[[`render`,De],[`__scopeId`,`data-v-6183b210`]]),Consumption:W},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return z({...this.config,model:this.config?.model??`s2-pro`,byte_count:new TextEncoder().encode(e).byteLength},this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`field mb-4`},Me={class:`title font-bold`},Ne={class:`flex flex-col items-center justify-center px-5 pb-5`};function Pe(t,n,o,c,u,f){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,je,[e(`h2`,Me,i(t.$t(`fish.name.speed`)),1),a(_,{modelValue:t.speed,"onUpdate:modelValue":n[0]||=e=>t.speed=e,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),e(`div`,Ne,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Fe=F(Oe,[[`render`,Pe],[`__scopeId`,`data-v-dc4ea983`]]);function Ie(e){if(!e)return;let t=e.error;if(t){let e=typeof t==`string`?t:t.message;if(e)return e.trim()}let n=e.message;if(!(typeof n!=`string`||!n.trim()))return Q(n.trim())}function Q(e){if(e.startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length){let e=t.map(e=>{let t=typeof e?.msg==`string`?e.msg:void 0;if(!t)return;let n=Array.isArray(e?.loc)?e.loc.filter(e=>e!==`parameters`):[],r=n.length?n[n.length-1]:void 0;return r?`${r}: ${t}`:t}).filter(e=>!!e),n=Array.from(new Set(e));if(n.length)return n.join(`; `)}}catch{}if(e.startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t.message==`string`&&t.message.trim())return Q(t.message.trim())}catch{}return e}var Le=m({name:`FishTaskPreview`,components:{DeleteIcon:ee,ElTooltip:v,ChannelIcon:T,CpuIcon:Y,InfoIcon:k,MagicIcon:j,MicrophoneIcon:A,TimeIcon:C,WarningIcon:te,CopyToClipboard:H,ElAlert:y,ElButton:N,ApiCodeButton:G,ReportButton:U},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url},isFailure(){let e=this.modelValue?.response;if(!e||e.audio_url)return!1;if(e.success===!1||e.error)return!0;let t=Number(e.status);return!Number.isNaN(t)&&t>=400||!!e.message},failureReason(){return Ie(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await V.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(`fish/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Re={class:`preview`},ze={class:`left`},Be={class:`main`},Ve={class:`bot`},He={class:`datetime`},Ue=[`aria-label`],We={class:`info`},Ge={key:0,class:`prompt mt-2`},Ke={key:0},qe={key:0,class:`content`},Je=[`src`],Ye={class:`operations mt-2`},Xe={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={key:1,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:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},et={key:1,class:`content`},tt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},it={key:2,class:`content`},at={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ot(n,c,u,f,m,h){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`el-button`),b=l(`api-code-button`),x=l(`report-button`),S=l(`cpu-icon`),C=l(`microphone-icon`),w=l(`copy-to-clipboard`),T=l(`magic-icon`),E=l(`time-icon`),D=l(`el-alert`),O=l(`warning-icon`),k=l(`info-icon`),A=l(`channel-icon`);return p(),s(`div`,Re,[e(`div`,ze,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,Be,[e(`div`,Ve,[a(g,{capability:`fish`,part:`name`}),e(`span`,He,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default: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(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Ue)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,We,[n.prompt?(p(),s(`p`,Ge,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ke,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,qe,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,Je),e(`div`,Ye,[a(y,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.audioUrl),[`stop`])},{default:d(()=>[r(i(n.$t(`fish.button.download`)),1)]),_:1}),a(b,{path:`/fish/tts`,body:n.modelValue?.request},null,8,[`body`]),a(x,{service:`fish`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Xe,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.reference_id?(p(),s(`p`,Ze,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.referenceId`))+`: `+i(n.modelValue?.request?.reference_id)+` `,1),a(w,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Qe,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):n.isFailure?(p(),s(`div`,et,[a(D,{closable:!1,class:`failure`},{title:d(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,tt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(w,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(p(),s(`p`,rt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,it,[a(D,{closable:!1,class:`info`},{default:d(()=>[e(`p`,at,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var st=m({name:`FishRecentPanel`,components:{TaskPreview:F(Le,[[`render`,ot],[`__scopeId`,`data-v-79dbfe9e`]]),BotPlaceholder:K,NoTasks:D,ScrollList:E},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},lt={key:2,class:`w-full h-full flex items-center justify-center`};function ut(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`,ct,[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`,lt,[a(v)])):o(``,!0)],64)}var dt=m({name:`FishTtsIndex`,components:{ConfigPanel:Fe,Layout:q,RecentPanel:F(st,[[`render`,ut]]),TabSwitcher:J},mixins:[R],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService(),await this.$store.dispatch(`fish/getVoices`)},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(){await this.$store.dispatch(`fish/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!I(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){x.warning(this.$t(`fish.message.textRequired`));return}if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,async:!0};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),x.info(this.$t(`fish.message.startingTask`)),re(`fish`,P.generateTts(i,{token:n,model:r})).then(()=>{x.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?x.error(this.$t(`fish.message.usedUp`)):x.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),ft={class:`flex flex-col h-full`},pt={class:`flex-1 min-h-0`};function mt(t,n,r,i,o,s){let c=l(`tab-switcher`),f=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return p(),u(h,null,{config:d(()=>[e(`div`,ft,[a(c),e(`div`,pt,[a(f,{onGenerate:t.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[a(m,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ht=F(dt,[[`render`,mt]]);export{ht 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{n as h,r as g,t as _}from"./select-jRFQ1Hzk.js";import{t as v}from"./tooltip-bfg-03mE.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-DcpkDkjF.js";import{t as S}from"./slider-B_xhGTdh.js";import{t as C}from"./clock-DcgPnVJa.js";import{a as w,c as T,n as E,r as D,t as O}from"./pagination-BbFTEjBg.js";import{t as k}from"./info-B6zz-sKo.js";import{t as A}from"./mic-Dow6VrJE.js";import{t as ee}from"./trash-2-CDz5PwCk.js";import{t as te}from"./triangle-alert-Z8DwGNFK.js";import{t as j}from"./wand-sparkles-yU_7R4u-.js";import{ft as M,ht as ne}from"./constants-C44cV5UH.js";import{Fi as N,Mn as P,Mr as re,O as F,Qt as I,bi as L,en as R,in as z,pn as B,xi as V}from"./index-CREYJmGZ.js";import{t as H}from"./CopyToClipboard-CLVp5I29.js";import{t as U}from"./ReportButton-CYa13w8h.js";import{t as W}from"./Consumption-C1nuDweL.js";import{t as G}from"./ApiCodeButton-DnW2mEEl.js";import{t as K}from"./BotPlaceholder-hcIRfy3i.js";import{t as q}from"./Hailuo-CRu4cYR4.js";import{t as J}from"./TabSwitcher-C_N_7W5M.js";var Y=L(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),X=m({name:`FishTextInput`,components:{PromptTextarea:w},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function ie(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.text,"onUpdate:modelValue":t[0]||=t=>e.text=t,title:e.$t(`fish.name.text`),info:e.$t(`fish.description.text`),placeholder:e.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ae=F(X,[[`render`,ie]]),oe=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:ne,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=M}}),se={class:`field`},ce={class:`title font-bold`};function le(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,se,[e(`h2`,ce,i(t.$t(`fish.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`fish.placeholder.select`)},{default:d(()=>[(p(!0),s(c,null,f(t.options,e=>(p(),u(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ue=F(oe,[[`render`,le],[`__scopeId`,`data-v-9702e6d3`]]),de=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),fe={class:`voice-option`},pe=[`aria-label`],me={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},_e={key:1,class:`preview placeholder`,"aria-hidden":`true`},ve={class:`meta`},ye={class:`label`},be={key:0,class:`description`};function xe(r,a,c,l,u,d){return p(),s(`div`,fe,[r.option.audio?(p(),s(`button`,{key:0,type:`button`,class:n([`preview`,{playing:r.playing,loading:r.loading}]),"aria-label":r.playing?`stop preview`:`play preview`,onMousedown:a[0]||=t(()=>{},[`prevent`]),onClick:a[1]||=t(e=>r.$emit(`preview`,r.option),[`stop`,`prevent`])},[r.loading?(p(),s(`svg`,me,[...a[2]||=[e(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-dasharray":`42 60`},null,-1)]])):r.playing?(p(),s(`svg`,he,[...a[3]||=[e(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1),e(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1)]])):(p(),s(`svg`,ge,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,pe)):(p(),s(`span`,_e,[...a[5]||=[e(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`},[e(`path`,{d:`M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11z`,fill:`currentColor`})],-1)]])),e(`div`,ve,[e(`span`,ye,i(r.option.label),1),r.option.description?(p(),s(`span`,be,i(r.option.description),1)):o(``,!0)])])}var Se=F(de,[[`render`,xe],[`__scopeId`,`data-v-c16a6a46`]]),Ce=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Ce(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},we=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:Se},data(){return{popularVoices:[],searchVoices:[],popularLoading:!1,searchLoading:!1,preloaded:!1,query:``,playingId:null,loadingId:null,labelCache:{},previewAudio:null,searchTimer:null,searchSeq:0}},computed:{remoteLoading(){return this.popularLoading||this.searchLoading},myVoices(){return this.$store.state.fish?.voices??[]},myOptions(){return this.myVoices.map(Z).filter(e=>!!e.value)},publicPool(){return this.query&&(this.searchVoices.length||this.searchLoading)?{voices:this.searchVoices,isSearch:!0}:{voices:this.popularVoices,isSearch:!1}},publicOptions(){let e=new Set(this.myOptions.map(e=>e.value));return this.publicPool.voices.map(Z).filter(t=>!!t.value&&!e.has(t.value))},filteredMyOptions(){return this.applyQuery(this.myOptions)},filteredPublicOptions(){return this.publicPool.isSearch?this.publicOptions:this.applyQuery(this.publicOptions)},fallbackOption(){let e=this.value;return!e||this.myOptions.some(t=>t.value===e)||this.publicOptions.some(t=>t.value===e)?null:{value:e,label:this.labelCache[e]||e}},noDataText(){return this.remoteLoading?this.$t(`fish.message.searching`):this.credential?.token?this.$t(`fish.message.searchVoiceHint`):this.$t(`fish.message.noVoices`)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{myOptions:{immediate:!0,handler(e){this.cacheLabels(e)}},publicOptions(e){this.cacheLabels(e)},credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`),this.preloaded||this.fetchPopular()}}},beforeUnmount(){this.stopPreview(),this.searchTimer&&clearTimeout(this.searchTimer)},methods:{cacheLabels(e){for(let t of e)this.labelCache[t.value]=t.label},applyQuery(e){let t=this.query.toLowerCase();return t?e.filter(e=>e.label.toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)):e},onVisibleChange(e){e&&!this.preloaded&&!this.popularLoading&&this.fetchPopular()},onFilter(e){if(this.query=(e||``).trim(),this.searchTimer&&clearTimeout(this.searchTimer),!this.query){this.searchSeq++,this.searchVoices=[],this.searchLoading=!1;return}this.searchTimer=setTimeout(()=>this.fetchSearch(this.query),350)},async fetchPopular(){let e=this.credential?.token;if(!(!e||this.popularLoading)){this.popularLoading=!0;try{let{data:t}=await P.listModels({self:!1,page_size:30,page_number:1},{token:e});this.popularVoices=t?.items??[],this.preloaded=!0}catch(e){console.error(`fish.loadPopularVoices failed`,e)}finally{this.popularLoading=!1}}},async fetchSearch(e){let t=this.credential?.token;if(!t)return;let n=++this.searchSeq;this.searchLoading=!0;try{let{data:r}=await P.listModels({self:!1,page_size:30,page_number:1,title:e},{token:t});if(n!==this.searchSeq)return;this.searchVoices=r?.items??[]}catch(e){n===this.searchSeq&&(this.searchVoices=[]),console.error(`fish.searchPublicVoices failed`,e)}finally{n===this.searchSeq&&(this.searchLoading=!1)}},togglePreview(e){if(!e.audio)return;if(this.playingId===e.value||this.loadingId===e.value){this.stopPreview();return}this.stopPreview();let t=new Audio(e.audio),n=()=>{this.previewAudio===t&&(this.loadingId=null,this.playingId=e.value)},r=()=>{this.previewAudio===t&&this.stopPreview()};t.addEventListener(`playing`,n),t.addEventListener(`ended`,r),t.addEventListener(`error`,r),this.previewAudio=t,this.loadingId=e.value,this.playingId=null,t.play().catch(()=>{this.previewAudio===t&&this.stopPreview()})},stopPreview(){this.previewAudio&&=(this.previewAudio.pause(),this.previewAudio.src=``,null),this.playingId=null,this.loadingId=null}}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,r,m,h,g){let _=l(`el-option`),v=l(`voice-option`),y=l(`el-option-group`),b=l(`el-select`);return p(),s(`div`,Te,[e(`h2`,Ee,i(t.$t(`fish.name.voice`)),1),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,"popper-class":`fish-voice-popper`,placeholder:t.$t(`fish.placeholder.voice`),clearable:``,filterable:``,"filter-method":t.onFilter,loading:t.remoteLoading,"loading-text":t.$t(`fish.message.searching`),"no-data-text":t.noDataText,onVisibleChange:t.onVisibleChange},{default:d(()=>[t.fallbackOption?(p(),u(_,{key:t.fallbackOption.value,label:t.fallbackOption.label,value:t.fallbackOption.value},null,8,[`label`,`value`])):o(``,!0),t.filteredMyOptions.length?(p(),u(y,{key:1,label:t.$t(`fish.title.myVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredMyOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.filteredPublicOptions.length?(p(),u(y,{key:2,label:t.$t(`fish.group.publicVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredPublicOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0)]),_:1},8,[`modelValue`,`placeholder`,`filter-method`,`loading`,`loading-text`,`no-data-text`,`onVisibleChange`])])}var Oe=m({name:`FishConfigPanel`,components:{MagicIcon:j,ElButton:N,ElSlider:S,TextInput:ae,ModelSelector:ue,VoicePicker:F(we,[[`render`,De],[`__scopeId`,`data-v-6183b210`]]),Consumption:W},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return z({...this.config,model:this.config?.model??`s2-pro`,byte_count:new TextEncoder().encode(e).byteLength},this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`field mb-4`},Me={class:`title font-bold`},Ne={class:`flex flex-col items-center justify-center px-5 pb-5`};function Pe(t,n,o,c,u,f){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,je,[e(`h2`,Me,i(t.$t(`fish.name.speed`)),1),a(_,{modelValue:t.speed,"onUpdate:modelValue":n[0]||=e=>t.speed=e,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),e(`div`,Ne,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Fe=F(Oe,[[`render`,Pe],[`__scopeId`,`data-v-dc4ea983`]]);function Ie(e){if(!e)return;let t=e.error;if(t){let e=typeof t==`string`?t:t.message;if(e)return e.trim()}let n=e.message;if(!(typeof n!=`string`||!n.trim()))return Q(n.trim())}function Q(e){if(e.startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length){let e=t.map(e=>{let t=typeof e?.msg==`string`?e.msg:void 0;if(!t)return;let n=Array.isArray(e?.loc)?e.loc.filter(e=>e!==`parameters`):[],r=n.length?n[n.length-1]:void 0;return r?`${r}: ${t}`:t}).filter(e=>!!e),n=Array.from(new Set(e));if(n.length)return n.join(`; `)}}catch{}if(e.startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t.message==`string`&&t.message.trim())return Q(t.message.trim())}catch{}return e}var Le=m({name:`FishTaskPreview`,components:{DeleteIcon:ee,ElTooltip:v,ChannelIcon:T,CpuIcon:Y,InfoIcon:k,MagicIcon:j,MicrophoneIcon:A,TimeIcon:C,WarningIcon:te,CopyToClipboard:H,ElAlert:y,ElButton:N,ApiCodeButton:G,ReportButton:U},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url},isFailure(){let e=this.modelValue?.response;if(!e||e.audio_url)return!1;if(e.success===!1||e.error)return!0;let t=Number(e.status);return!Number.isNaN(t)&&t>=400||!!e.message},failureReason(){return Ie(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await V.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(`fish/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Re={class:`preview`},ze={class:`left`},Be={class:`main`},Ve={class:`bot`},He={class:`datetime`},Ue=[`aria-label`],We={class:`info`},Ge={key:0,class:`prompt mt-2`},Ke={key:0},qe={key:0,class:`content`},Je=[`src`],Ye={class:`operations mt-2`},Xe={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={key:1,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:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},et={key:1,class:`content`},tt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},it={key:2,class:`content`},at={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ot(n,c,u,f,m,h){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`el-button`),b=l(`api-code-button`),x=l(`report-button`),S=l(`cpu-icon`),C=l(`microphone-icon`),w=l(`copy-to-clipboard`),T=l(`magic-icon`),E=l(`time-icon`),D=l(`el-alert`),O=l(`warning-icon`),k=l(`info-icon`),A=l(`channel-icon`);return p(),s(`div`,Re,[e(`div`,ze,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,Be,[e(`div`,Ve,[a(g,{capability:`fish`,part:`name`}),e(`span`,He,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default: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(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Ue)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,We,[n.prompt?(p(),s(`p`,Ge,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ke,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,qe,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,Je),e(`div`,Ye,[a(y,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.audioUrl),[`stop`])},{default:d(()=>[r(i(n.$t(`fish.button.download`)),1)]),_:1}),a(b,{path:`/fish/tts`,body:n.modelValue?.request},null,8,[`body`]),a(x,{service:`fish`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Xe,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.reference_id?(p(),s(`p`,Ze,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.referenceId`))+`: `+i(n.modelValue?.request?.reference_id)+` `,1),a(w,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Qe,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):n.isFailure?(p(),s(`div`,et,[a(D,{closable:!1,class:`failure`},{title:d(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,tt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(w,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(p(),s(`p`,rt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,it,[a(D,{closable:!1,class:`info`},{default:d(()=>[e(`p`,at,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var st=m({name:`FishRecentPanel`,components:{TaskPreview:F(Le,[[`render`,ot],[`__scopeId`,`data-v-79dbfe9e`]]),BotPlaceholder:K,NoTasks:D,ScrollList:E},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},lt={key:2,class:`w-full h-full flex items-center justify-center`};function ut(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`,ct,[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`,lt,[a(v)])):o(``,!0)],64)}var dt=m({name:`FishTtsIndex`,components:{ConfigPanel:Fe,Layout:q,RecentPanel:F(st,[[`render`,ut]]),TabSwitcher:J},mixins:[R],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService(),await this.$store.dispatch(`fish/getVoices`)},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(){await this.$store.dispatch(`fish/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!I(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){x.warning(this.$t(`fish.message.textRequired`));return}if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,async:!0};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),x.info(this.$t(`fish.message.startingTask`)),re(`fish`,P.generateTts(i,{token:n,model:r})).then(()=>{x.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?x.error(this.$t(`fish.message.usedUp`)):x.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),ft={class:`flex flex-col h-full`},pt={class:`flex-1 min-h-0`};function mt(t,n,r,i,o,s){let c=l(`tab-switcher`),f=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return p(),u(h,null,{config:d(()=>[e(`div`,ft,[a(c),e(`div`,pt,[a(f,{onGenerate:t.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[a(m,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ht=F(dt,[[`render`,mt]]);export{ht as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./external-link-CgEa7yis.js";import{Fi as f,O as p}from"./index-DIgS5Gvp.js";import{t as m}from"./vue-plyr-wiIKa-zl.js";var h=u({name:`VideoPlayer`,components:{ElButton:f,ExternalLinkIcon:d,VuePlyr:m},props:{src:{type:String,required:!0},options:{type:Object,required:!1,default:()=>({})}},data(){return{failed:!1,mergedOptions:{controls:[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`fullscreen`],iconUrl:`https://cdn.acedata.cloud/7jq4t0.svg`,quality:{default:1080,options:[1080],...this.options.quality},...this.options}}},computed:{safeSrc(){return this.src.trim()}},watch:{safeSrc(){this.failed=!1}},methods:{onError(){this.failed=!0},onOpen(){window.open(this.safeSrc,`_blank`,`noopener,noreferrer`)}}}),g={class:`video max-w-[800px] max-h-[450px] rounded-[15px] overflow-hidden`},_=[`src`],v={key:1,class:`video-fallback`};function y(u,d,f,p,m,h){let y=o(`vue-plyr`),b=o(`external-link-icon`),x=o(`el-button`);return l(),a(`div`,g,[!u.failed&&u.safeSrc?(l(),s(y,{key:u.safeSrc,options:u.mergedOptions},{default:c(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,class:`w-full h-full aspect-[16/9]`,onError:d[0]||=(...e)=>u.onError&&u.onError(...e)},[e(`source`,{size:`1080`,src:u.safeSrc,type:`video/mp4`},null,8,_)],32)]),_:1},8,[`options`])):u.safeSrc?(l(),a(`div`,v,[r(x,{type:`primary`,round:``,onClick:u.onOpen},{default:c(()=>[r(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),t(` `+n(u.$t(`common.button.download`)),1)]),_:1},8,[`onClick`])])):i(``,!0)])}var b=p(h,[[`render`,y],[`__scopeId`,`data-v-0d13923b`]]);export{b as t};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./external-link-dZgWEqL4.js";import{Fi as f,O as p}from"./index-CREYJmGZ.js";import{t as m}from"./vue-plyr-wiIKa-zl.js";var h=u({name:`VideoPlayer`,components:{ElButton:f,ExternalLinkIcon:d,VuePlyr:m},props:{src:{type:String,required:!0},options:{type:Object,required:!1,default:()=>({})}},data(){return{failed:!1,mergedOptions:{controls:[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`fullscreen`],iconUrl:`https://cdn.acedata.cloud/7jq4t0.svg`,quality:{default:1080,options:[1080],...this.options.quality},...this.options}}},computed:{safeSrc(){return this.src.trim()}},watch:{safeSrc(){this.failed=!1}},methods:{onError(){this.failed=!0},onOpen(){window.open(this.safeSrc,`_blank`,`noopener,noreferrer`)}}}),g={class:`video max-w-[800px] max-h-[450px] rounded-[15px] overflow-hidden`},_=[`src`],v={key:1,class:`video-fallback`};function y(u,d,f,p,m,h){let y=o(`vue-plyr`),b=o(`external-link-icon`),x=o(`el-button`);return l(),a(`div`,g,[!u.failed&&u.safeSrc?(l(),s(y,{key:u.safeSrc,options:u.mergedOptions},{default:c(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,class:`w-full h-full aspect-[16/9]`,onError:d[0]||=(...e)=>u.onError&&u.onError(...e)},[e(`source`,{size:`1080`,src:u.safeSrc,type:`video/mp4`},null,8,_)],32)]),_:1},8,[`options`])):u.safeSrc?(l(),a(`div`,v,[r(x,{type:`primary`,round:``,onClick:u.onOpen},{default:c(()=>[r(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),t(` `+n(u.$t(`common.button.download`)),1)]),_:1},8,[`onClick`])])):i(``,!0)])}var b=p(h,[[`render`,y],[`__scopeId`,`data-v-0d13923b`]]);export{b as t};