@acedatacloud/nexior 3.367.1 → 3.367.2
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.
- package/dist/assets/{ApiCodeButton-0y91ZmDI.js → ApiCodeButton-COttFgh2.js} +1 -1
- package/dist/assets/{ApiCodeDialog-DZUzlxQU.js → ApiCodeDialog-DsffRMtL.js} +1 -1
- package/dist/assets/{Artifacts-B5S2Mv4W.js → Artifacts-BIVhU40h.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-Bz5Pu48y.js → AskUserQuestionCard-Cl2w3_uO.js} +1 -1
- package/dist/assets/{AudioPreview-iExrnAWH.js → AudioPreview-LP7NUFmx.js} +1 -1
- package/dist/assets/{Auth-DmcR5J0z.js → Auth-C-Ghtu93.js} +1 -1
- package/dist/assets/{Bare-C4hB2DNE.js → Bare-vC4xRRYk.js} +1 -1
- package/dist/assets/{BotPlaceholder-Ckt-l7zX.js → BotPlaceholder-CC_Edbls.js} +1 -1
- package/dist/assets/{BottomFooter-8i60Fxds.js → BottomFooter-Ds-auF8K.js} +1 -1
- package/dist/assets/{BrowseConnectors-D0Jav2wP.js → BrowseConnectors-B4V6DJNw.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-Bjk4gkWX.js → BrowserPairingDialog-B9ajoMIv.js} +1 -1
- package/dist/assets/{Callback-DkNUOw74.js → Callback-9EH5VkSV.js} +1 -1
- package/dist/assets/{CodeSnippet-ClbyOjlk.js → CodeSnippet-B86fx8RC.js} +1 -1
- package/dist/assets/{Console-sg_2yG7l.js → Console-DlH3NLHt.js} +1 -1
- package/dist/assets/{Conversation-d_uJbvZc.js → Conversation-CkZNguCC.js} +1 -1
- package/dist/assets/{Conversation-Cv60RUNC.js → Conversation-TrJI-M_E.js} +1 -1
- package/dist/assets/{CopyToClipboard-b_INL3h6.js → CopyToClipboard-DpUrgAAx.js} +1 -1
- package/dist/assets/{Detail-DAmh0ySj.js → Detail-DqN6zlBi.js} +1 -1
- package/dist/assets/{Extra-CTiC_hpI.js → Extra-CXYqdiZx.js} +1 -1
- package/dist/assets/{FilePreview-xhsKBu8J.js → FilePreview-C3vFeL9V.js} +1 -1
- package/dist/assets/{Hailuo-DBLz21B9.js → Hailuo-C_IbuM3u.js} +1 -1
- package/dist/assets/{History-Cats5C7Z.js → History-D1G-IQNx.js} +1 -1
- package/dist/assets/{ImagePreview-DkitBzQz.js → ImagePreview-CW8yYgYB.js} +1 -1
- package/dist/assets/{ImageWrapper-BAIRHszj.js → ImageWrapper-B_W9Z0VL.js} +1 -1
- package/dist/assets/{Index-D5mGAUJP.js → Index-7KswQeDZ.js} +1 -1
- package/dist/assets/{Index-DYG_3tKb.js → Index-9c024aJ6.js} +1 -1
- package/dist/assets/{Index-DQ_055LO.js → Index-B7-Vqd5t.js} +1 -1
- package/dist/assets/{Index-DEMKkT3T.js → Index-B7IAZTzU.js} +1 -1
- package/dist/assets/{Index-B_6YBDjN.js → Index-BF_YGR-S.js} +1 -1
- package/dist/assets/{Index-BWP3oP1e.js → Index-BHPR-9Rd.js} +1 -1
- package/dist/assets/{Index-CxKjwDMI.js → Index-BNZPKIma.js} +1 -1
- package/dist/assets/{Index-C4B_N_pr2.js → Index-BNaKZ3gJ2.js} +1 -1
- package/dist/assets/{Index-CO1UOJdB.js → Index-BQ5VpmU3.js} +1 -1
- package/dist/assets/{Index-CtWNn7I7.js → Index-Bo8gFaRi.js} +1 -1
- package/dist/assets/{Index-6WUB-lzo.js → Index-BpdCo-21.js} +1 -1
- package/dist/assets/{Index-Bb_emfzh.js → Index-C1Fe99ZM.js} +1 -1
- package/dist/assets/{Index-DknDARJo.js → Index-C4GYU4kM.js} +1 -1
- package/dist/assets/{Index-osl2Te9l.js → Index-CayE1Gs8.js} +1 -1
- package/dist/assets/{Index-oziEeOWe.js → Index-CblBdfGW.js} +1 -1
- package/dist/assets/{Index-DV1Avm59.js → Index-CeDXaQ-p.js} +1 -1
- package/dist/assets/{Index-CjYVfEiS.js → Index-CmxhQGlH.js} +1 -1
- package/dist/assets/{Index-M9dwijWV.js → Index-CouxTSNZ.js} +1 -1
- package/dist/assets/{Index-DVUgzUr4.js → Index-Cxw58CPT.js} +1 -1
- package/dist/assets/{Index-BhhAhqBi.js → Index-D0-03Hvg.js} +1 -1
- package/dist/assets/{Index-Oi4wKpNW.js → Index-D0nUdb3K.js} +1 -1
- package/dist/assets/{Index-BzfOFA4a.js → Index-D9GBv581.js} +1 -1
- package/dist/assets/{Index-DF-NI3il.js → Index-DDKZEA1C.js} +1 -1
- package/dist/assets/{Index-zxCuqaZ5.js → Index-DDsIlS41.js} +1 -1
- package/dist/assets/{Index-DgirOE6_.js → Index-DL2eg6C0.js} +1 -1
- package/dist/assets/{Index-B3US1zHr.js → Index-D_d0kMvj.js} +1 -1
- package/dist/assets/{Index-Bth_AjSz.js → Index-Dir9DAUH.js} +1 -1
- package/dist/assets/{Index-DdqDLjZ3.js → Index-DjQ6dYB4.js} +1 -1
- package/dist/assets/{Index-Dm6PI_0q.js → Index-DruaK_AN.js} +1 -1
- package/dist/assets/{Index-jyo-5Xba.js → Index-Drv5Zz3u.js} +1 -1
- package/dist/assets/{Index-Bhpy-LoS.js → Index-DtNLL8Ne.js} +1 -1
- package/dist/assets/{Index-B55i2Khp.js → Index-Dx8Acve2.js} +1 -1
- package/dist/assets/{Index-u7EerdR2.js → Index-bri81HWb.js} +1 -1
- package/dist/assets/{Index-CtLSBUXX.js → Index-gheVcqfq.js} +1 -1
- package/dist/assets/{Index-B5PAIcjb.js → Index-rY1otLxz.js} +1 -1
- package/dist/assets/{Index-BjjKscfm.js → Index-xgEkrNLy.js} +1 -1
- package/dist/assets/{Index-DsXDZuK_.js → Index-zc9bNoXb.js} +1 -1
- package/dist/assets/{Invitees-CaWbYa_p.js → Invitees-CObBvUgi.js} +1 -1
- package/dist/assets/{List-ZHEaUoLL.js → List-BWk4piSH.js} +1 -1
- package/dist/assets/{List-CjUkkvM_.js → List-BczNNPBK.js} +1 -1
- package/dist/assets/{List-DTonlO_A.js → List-Cy9SxO5J.js} +1 -1
- package/dist/assets/{LocalTools-D-QAeYBr.js → LocalTools-CAdwPq4V.js} +1 -1
- package/dist/assets/{LocalTools-zbECYIha.js → LocalTools-DOnwxer9.js} +1 -1
- package/dist/assets/{Logo-DQ4THiss.js → Logo-DTQjOdyW.js} +1 -1
- package/dist/assets/{Main-B3LDNr3Z.js → Main-DGWWzzrS.js} +1 -1
- package/dist/assets/{Message-DTxF3H7A.js → Message-CVI5GFGW.js} +1 -1
- package/dist/assets/{Model-Bu_BS8Vx.js → Model-C_Pwh2RB.js} +1 -1
- package/dist/assets/{Navigator-Ci2-AZ1d.js → Navigator-u8kZ0d1f.js} +3 -3
- package/dist/assets/{NotFound-DkTX3yEJ.js → NotFound-tEKkZWnT.js} +1 -1
- package/dist/assets/{PageHeader-Bdkuv6Us.js → PageHeader-BzGclVTM.js} +1 -1
- package/dist/assets/{Pay-CU6LMha4.js → Pay-Do1FuC3J.js} +1 -1
- package/dist/assets/{Player-fZlu6fSt.js → Player-B0qKdyoe.js} +1 -1
- package/dist/assets/{Poivelle-CXZyBAyj.js → Poivelle-DqHGKr5R.js} +1 -1
- package/dist/assets/{RealtimeCall-D09Rfe3g.js → RealtimeCall-BKSNKBYm.js} +1 -1
- package/dist/assets/{ReportButton-C8TNdgFb.js → ReportButton-DRaakXvZ.js} +1 -1
- package/dist/assets/{ReportDialog-XfEbkb5H.js → ReportDialog-DytCawN6.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-I2LiUoDQ.js → ScenarioPaymentMode-OqLUCR7u.js} +1 -1
- package/dist/assets/{ScheduledTasks-4BCoXQN8.js → ScheduledTasks-dQLVMfv-.js} +1 -1
- package/dist/assets/{ServicePricingSummary-sOw4h4Xv.js → ServicePricingSummary-BM6vSOWv.js} +1 -1
- package/dist/assets/ShowcaseDetailDialog-DlwW14g1.css +1 -0
- package/dist/assets/ShowcaseDetailDialog-VCyw1l1t.js +1 -0
- package/dist/assets/{ShowcaseGrid-C5SZsF1c.js → ShowcaseGrid-mtD3qgtE.js} +1 -1
- package/dist/assets/{ShowcaseResultTabs-DWP3P1OW.js → ShowcaseResultTabs-CUyYGgjU.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-NqB3Oq-6.js → SolanaWalletPickerDialog-Bg_XivGe.js} +1 -1
- package/dist/assets/{Status-XjwNo7Js.js → Status-DYPsi5Jw.js} +1 -1
- package/dist/assets/{Subscribe-ibZaVFfM.js → Subscribe-DBwQBnZm.js} +1 -1
- package/dist/assets/{TabSwitcher-CcuM4DZl.js → TabSwitcher-QWPyUh55.js} +1 -1
- package/dist/assets/{Tts-BoLv4Cov.js → Tts-RVmeRwrD.js} +1 -1
- package/dist/assets/{VideoPlayer-DKc2OEmb.js → VideoPlayer-CaBeu7to.js} +1 -1
- package/dist/assets/{VideoPreview-B93Npx0e.js → VideoPreview-CYkNPuRj.js} +1 -1
- package/dist/assets/arrow-down-DX92ny1X.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-CjVIhfca.js → arrow-down-wide-narrow-BH3BfiRs.js} +1 -1
- package/dist/assets/arrow-left-CkyHsHow.js +1 -0
- package/dist/assets/arrow-right-BJbSSvJ0.js +1 -0
- package/dist/assets/arrow-up-DCxXdRAC.js +1 -0
- package/dist/assets/{authorizeFlow-CKLZjZwe.js → authorizeFlow-pMSHZiKG.js} +1 -1
- package/dist/assets/{avatar-DJjvsMOM.js → avatar-DkcVdpv2.js} +1 -1
- package/dist/assets/{basic-D6RUJpWK.js → basic-BrmA66cj.js} +1 -1
- package/dist/assets/{book-open-Bb4veJ9H.js → book-open-C_ueiu-7.js} +1 -1
- package/dist/assets/{box-CmUpezHl.js → box-CK8Q8K3k.js} +1 -1
- package/dist/assets/{boxes-DH6uKZ67.js → boxes-DaXPM6R4.js} +1 -1
- package/dist/assets/{brain-WCR_BF1T.js → brain-BqAe7ckb.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-BbYuF4BD.js → chart-no-axes-combined-wVsaaoUb.js} +1 -1
- package/dist/assets/{chat-C7uyvLoU.js → chat-D4EXIUuT.js} +1 -1
- package/dist/assets/check-C5QT0aqX.js +1 -0
- package/dist/assets/chevron-down-DtfhJUg5.js +1 -0
- package/dist/assets/chevron-right-BpEpvbRz.js +1 -0
- package/dist/assets/{circle-alert-Bt0PCPbE.js → circle-alert-BBdkRZMI.js} +1 -1
- package/dist/assets/circle-check-Dl-uxCgL.js +1 -0
- package/dist/assets/{circle-question-mark-DBUZlkWm.js → circle-question-mark-XsPVljRO.js} +1 -1
- package/dist/assets/{clipboard-list-FT0B7KW7.js → clipboard-list-GBfGExfY.js} +1 -1
- package/dist/assets/clock-BIk0gliD.js +1 -0
- package/dist/assets/code-CszxkgkT.js +1 -0
- package/dist/assets/{codingBridge-BFLiVLeE.js → codingBridge-Ds6ajOwX.js} +1 -1
- package/dist/assets/{coins-CFYLyBP6.js → coins-D-lLvSAk.js} +1 -1
- package/dist/assets/{copy-Cix8xw3o.js → copy-C3ih32SC.js} +1 -1
- package/dist/assets/{createTaskActions-BYt2vlwG.js → createTaskActions-BePlr06O.js} +1 -1
- package/dist/assets/{date-picker-qu7nMTj7.js → date-picker-D8mMqoO_.js} +1 -1
- package/dist/assets/{digitalhuman-C6vNaTVM.js → digitalhuman-BzuK0LbP.js} +1 -1
- package/dist/assets/{dollar-sign-SvRnwJNN.js → dollar-sign-DfAJ7PnP.js} +1 -1
- package/dist/assets/{download-PHnlxa9E.js → download-BDqW4GdI.js} +1 -1
- package/dist/assets/{drawer-Cj-FR2bV.js → drawer-Bs-px8rV.js} +1 -1
- package/dist/assets/{dropdown-Szm2aqS3.js → dropdown-By0tJCCL.js} +1 -1
- package/dist/assets/{dropdown-DAqIRPj_.js → dropdown-C4JYy1mf.js} +1 -1
- package/dist/assets/{ellipsis-BwmSdENx.js → ellipsis-BSF63Pr6.js} +1 -1
- package/dist/assets/{esm-D5ibRrr9.js → esm-B6sxkWWp.js} +2 -2
- package/dist/assets/{external-link-Bd8w-Z3E.js → external-link-2oBDlN-W.js} +1 -1
- package/dist/assets/{eye-BqDWtT8R.js → eye-Cke5Dz5k.js} +1 -1
- package/dist/assets/{file-BFpYT5J4.js → file-CHmDlQOR.js} +1 -1
- package/dist/assets/{file-output-3730qHHX.js → file-output-BmU7uLbG.js} +1 -1
- package/dist/assets/{file-text-Mfb6sGFK.js → file-text-Dqz0sa4Y.js} +1 -1
- package/dist/assets/{fish-CIUxVySQ.js → fish-DZXjPQD2.js} +1 -1
- package/dist/assets/{flux-CrhuLZpX.js → flux-CErhuzPg.js} +1 -1
- package/dist/assets/{folder-JUFFSCH3.js → folder-wEyyZNA3.js} +1 -1
- package/dist/assets/gauge-Bbsj7bwT.js +1 -0
- package/dist/assets/{generationInput-DT_KfPsx.js → generationInput-qrYUjgVF.js} +1 -1
- package/dist/assets/{globe-BgkIewH0.js → globe-C2PQZy46.js} +1 -1
- package/dist/assets/{grokvideo-DukS8CRt.js → grokvideo-sQ0sRyZm.js} +1 -1
- package/dist/assets/{hailuo-BL1_zZZ2.js → hailuo-Cocm4Vbc.js} +1 -1
- package/dist/assets/{headphones-S-U2nqdW.js → headphones-GIlR2Oiw.js} +1 -1
- package/dist/assets/{history-BW4IRqnK.js → history-CvBx2-32.js} +1 -1
- package/dist/assets/{house-P_iMDnsY.js → house-CSabWjeh.js} +1 -1
- package/dist/assets/{image-DP9OoNQA.js → image-BEMUVXib.js} +1 -1
- package/dist/assets/{index-ZgL-Sngk.js → index-Cxnu8Cai.js} +3 -3
- package/dist/assets/{index.es-xxt9TEy9.js → index.es-UN1oLyXR.js} +1 -1
- package/dist/assets/{info-6KLCmMcD.js → info-GaHinJWE.js} +1 -1
- package/dist/assets/{input-number-C12vdbYv.js → input-number-ekvKm-AN.js} +1 -1
- package/dist/assets/{key-round-DQMDzeSF.js → key-round-CfWUX322.js} +1 -1
- package/dist/assets/{kling-Chm_w30a.js → kling-ws-2lh8p.js} +1 -1
- package/dist/assets/{languages-CTneJs7a.js → languages-EmOgIEqS.js} +1 -1
- package/dist/assets/{laptop-CQIaQBhE.js → laptop-Djw_GUFC.js} +1 -1
- package/dist/assets/{lightbulb-DEfx2FHk.js → lightbulb-gGhM83XW.js} +1 -1
- package/dist/assets/{link-NZ5S08SD.js → link-DtMSQQDN.js} +1 -1
- package/dist/assets/loader-circle-K7IG_yY4.js +1 -0
- package/dist/assets/{lock-D_dkt0jZ.js → lock-BPWoQQI4.js} +1 -1
- package/dist/assets/{luma-WwjcD5LA.js → luma-BpG1v5db.js} +1 -1
- package/dist/assets/{maestro-C4jkuejG.js → maestro-BTtwep_z.js} +1 -1
- package/dist/assets/{mail-au9OcK_k.js → mail-BSAm0Bud.js} +1 -1
- package/dist/assets/{message-circle-DvMfOrJn.js → message-circle-Dxzj3bj8.js} +1 -1
- package/dist/assets/{mic-BoWsiakh.js → mic-CcbScHEk.js} +1 -1
- package/dist/assets/{midjourney-DrVLYqOd.js → midjourney-BUIPMUnr.js} +1 -1
- package/dist/assets/{minimax-BlaTNP64.js → minimax-Bsg17MMM.js} +1 -1
- package/dist/assets/{monitor-ByPEDkMx.js → monitor-BidDvVm_.js} +1 -1
- package/dist/assets/{mouse-pointer-2-T1wJeqmZ.js → mouse-pointer-2-B8SQlucd.js} +1 -1
- package/dist/assets/music-2-adjkHTtE.js +1 -0
- package/dist/assets/{nanobanana-BT3B5Gvc.js → nanobanana-CIfx4Who.js} +1 -1
- package/dist/assets/{omni-DswjSsmZ.js → omni-D592xEHJ.js} +1 -1
- package/dist/assets/{openaiimage-n2nz_OWF.js → openaiimage-Biw2R3MI.js} +1 -1
- package/dist/assets/{pagination-BtnijNAg.js → pagination-B-S7rzCK.js} +1 -1
- package/dist/assets/{pagination-Sdi1lOOd.js → pagination-CC9WpoPG.js} +1 -1
- package/dist/assets/{pagination-BSs64OGk.js → pagination-PI-pnQFZ.js} +1 -1
- package/dist/assets/{palette-BahmLZzd.js → palette-DsO2SPV_.js} +1 -1
- package/dist/assets/{paperclip-BvDkJrIL.js → paperclip-D8EV7sDJ.js} +1 -1
- package/dist/assets/{pause-B3pPF2Ht.js → pause-14z-8JrA.js} +1 -1
- package/dist/assets/{pencil-BSHKCRAv.js → pencil-BDTYIowf.js} +1 -1
- package/dist/assets/{pika-gwUfm_Fd.js → pika-D7vahg9G.js} +1 -1
- package/dist/assets/{pixverse-CF2L6GIg.js → pixverse-7-E1_x_o.js} +1 -1
- package/dist/assets/play-Dzeoyxfz.js +1 -0
- package/dist/assets/{plug-BwND3hAa.js → plug-Dq-l25ZW.js} +1 -1
- package/dist/assets/plus-rcng4d2o.js +1 -0
- package/dist/assets/{poivelle-HVXaxx_2.js → poivelle-D0hY-6hn.js} +1 -1
- package/dist/assets/{popover-CFDzwa24.js → popover-xMx8OoA7.js} +1 -1
- package/dist/assets/{producer-DT0Myx30.js → producer-CD9Eddgu.js} +1 -1
- package/dist/assets/{qrart-B6lxomGa.js → qrart-BJvu2ZYe.js} +1 -1
- package/dist/assets/{qwenimage-CMbgYleN.js → qwenimage-Dq-YyEgN.js} +1 -1
- package/dist/assets/{realtime-CZrlMbLE.js → realtime-Cyft2lCl.js} +1 -1
- package/dist/assets/{refresh-cw-CSuowut3.js → refresh-cw-hadrdulp.js} +1 -1
- package/dist/assets/rotate-ccw-DEtAfxZj.js +1 -0
- package/dist/assets/rotate-cw-DN0VV-vr.js +1 -0
- package/dist/assets/search-CGU6CV7g.js +1 -0
- package/dist/assets/{seedance-DBGuTj5X.js → seedance-Iaqop4mE.js} +1 -1
- package/dist/assets/{seedream-BqLQ4MPY.js → seedream-BejhWWRl.js} +1 -1
- package/dist/assets/{select-BH6TGdbU.js → select-8-kd2VyH.js} +1 -1
- package/dist/assets/{serp-mhIZVc-s.js → serp-zoJfFk2R.js} +1 -1
- package/dist/assets/{shield-BPmcux3l.js → shield-BNrlcH6z.js} +1 -1
- package/dist/assets/{showcase-CMYuiOVw.js → showcase-DaHpVQwT.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-D07tsJzV.js → showcaseRecreateMixin-O3d8pn1W.js} +1 -1
- package/dist/assets/{shuffle-CD6bV3X2.js → shuffle-BCPA93IP.js} +1 -1
- package/dist/assets/{siteBanner-D8LBiWVW.js → siteBanner-D7smBuBE.js} +1 -1
- package/dist/assets/{slider-DpkkSMm_.js → slider-eSIQ0FcJ.js} +1 -1
- package/dist/assets/{solana-wallets-C9pLPLtH.js → solana-wallets-Cnh6hE-y.js} +2 -2
- package/dist/assets/{sora-Dj_pYNR6.js → sora-CoModB3z.js} +1 -1
- package/dist/assets/{sparkles-Cxcp0ldh.js → sparkles-C2Padqdc.js} +1 -1
- package/dist/assets/square-C9OJLT1g.js +1 -0
- package/dist/assets/{store-B3yAOyZj.js → store-CUjMtA69.js} +1 -1
- package/dist/assets/{suno-BbkSUxR3.js → suno-D9NQTl5t.js} +1 -1
- package/dist/assets/{switch-TOscE6yZ.js → switch-DiUDO8o3.js} +1 -1
- package/dist/assets/{table--9HPvo6R.js → table-BUXPszeH.js} +1 -1
- package/dist/assets/{tag-DETuEPRp.js → tag-erzhWN4o.js} +1 -1
- package/dist/assets/terminal-C8Xohw9i.js +1 -0
- package/dist/assets/{time-picker-D48q0mvr.js → time-picker-BcVh8yzD.js} +1 -1
- package/dist/assets/{tooltip-Br2j6riA.js → tooltip-CHqcylXx.js} +1 -1
- package/dist/assets/{trash-2-BwD47HPA.js → trash-2-TOSJlrQC.js} +1 -1
- package/dist/assets/{triangle-alert-DXtYQCtP.js → triangle-alert-uTVBcsrd.js} +1 -1
- package/dist/assets/{upload-CjAmWnJO.js → upload-BMfV8Ire.js} +1 -1
- package/dist/assets/user-BTZ6pSuR.js +1 -0
- package/dist/assets/{veo-CG7Gvh8G.js → veo-DWvZVn2O.js} +1 -1
- package/dist/assets/{video-3E4DGfFY.js → video-DCnZdfA4.js} +1 -1
- package/dist/assets/{volume-2-qLy8pVJH.js → volume-2-F_P81zVh.js} +1 -1
- package/dist/assets/{wallet-DMn-aTWa.js → wallet-CBb5pOeH.js} +1 -1
- package/dist/assets/{wan-CH8vibyu.js → wan-Cogh00LH.js} +1 -1
- package/dist/assets/{wand-sparkles-CsIjUWGj.js → wand-sparkles-CjbeD1Xg.js} +1 -1
- package/dist/assets/{web-DdcCjInq.js → web-C3mx6wY9.js} +1 -1
- package/dist/assets/{webextrator-CBof90Y0.js → webextrator-BL6wV0m1.js} +1 -1
- package/dist/assets/{zap-B1tgGWX3.js → zap-DtfcYx1O.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ShowcaseDetailDialog-0r03PHZQ.js +0 -1
- package/dist/assets/ShowcaseDetailDialog-BQ_XnOOz.css +0 -1
- package/dist/assets/arrow-down-DnRxCHng.js +0 -1
- package/dist/assets/arrow-left-CCTyf2E5.js +0 -1
- package/dist/assets/arrow-right-C3ehhsUY.js +0 -1
- package/dist/assets/arrow-up-C4gv61Ek.js +0 -1
- package/dist/assets/check-Czwo7-vj.js +0 -1
- package/dist/assets/chevron-down-ygQGkXbe.js +0 -1
- package/dist/assets/chevron-right-CiVFwPib.js +0 -1
- package/dist/assets/circle-check-DGztZnzp.js +0 -1
- package/dist/assets/clock-auxp3wRO.js +0 -1
- package/dist/assets/code-BC5AxncC.js +0 -1
- package/dist/assets/gauge-Cb1EEu8V.js +0 -1
- package/dist/assets/loader-circle-C0AfogFq.js +0 -1
- package/dist/assets/music-2-aNhzvV62.js +0 -1
- package/dist/assets/play-CtoT2CaT.js +0 -1
- package/dist/assets/plus-BJSvOiJY.js +0 -1
- package/dist/assets/rotate-ccw-6jY7AY3c.js +0 -1
- package/dist/assets/rotate-cw-lDsDH4VC.js +0 -1
- package/dist/assets/search-CGiFzP3Q.js +0 -1
- package/dist/assets/square-R2P9QtBK.js +0 -1
- package/dist/assets/terminal-CHzkQftY.js +0 -1
- package/dist/assets/user-CkcEovV9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BH6TGdbU.js";import{n as x,t as S}from"./tabs-De_8qign.js";import{t as C}from"./upload-BXpBwasK.js";import{t as w}from"./tooltip-Br2j6riA.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-CPAfAKlf.js";import{t as O}from"./drawer-Cj-FR2bV.js";import{t as k}from"./switch-TOscE6yZ.js";import{t as A}from"./box-CmUpezHl.js";import{t as j}from"./clock-auxp3wRO.js";import{a as M,i as N,n as P,o as F,r as I,s as L,t as R}from"./pagination-BSs64OGk.js";import{t as ee}from"./info-6KLCmMcD.js";import{t as z}from"./languages-CTneJs7a.js";import{t as B}from"./trash-2-BwD47HPA.js";import{t as V}from"./triangle-alert-DXtYQCtP.js";import{t as te}from"./upload-CjAmWnJO.js";import{t as H}from"./wand-sparkles-CsIjUWGj.js";import{t as ne}from"./zap-B1tgGWX3.js";import{_i as re,gi as ie,hi as ae}from"./constants-B0wcHJpW.js";import{$ as oe,A as U,Fi as W,Fr as G,Ir as K,La as q,Li as J,Mr as Y,Na as se,Nr as X,O as ce,Pr as le,Sn as ue,Xi as de,Y as fe,Za as Z,et as pe,li as me,nt as he,rt as ge,si as _e,ta as ve,tt as ye}from"./index-ZgL-Sngk.js";import{t as be}from"./CopyToClipboard-b_INL3h6.js";import{t as xe}from"./ReportButton-C8TNdgFb.js";import{t as Q}from"./ImagePreview-DkitBzQz.js";import{n as Se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ce}from"./ServicePricingSummary-sOw4h4Xv.js";import{t as we}from"./VideoPlayer-DKc2OEmb.js";import{t as Te}from"./ScenarioPaymentMode-I2LiUoDQ.js";import{t as Ee}from"./ApiCodeButton-0y91ZmDI.js";import{t as De}from"./BotPlaceholder-Ckt-l7zX.js";import{t as Oe}from"./ShowcaseResultTabs-DWP3P1OW.js";import{t as ke}from"./showcaseRecreateMixin-D07tsJzV.js";import{n as Ae,t as je}from"./generationInput-DT_KfPsx.js";var Me=v({name:`LayoutVeo`,components:{MagicIcon:H,ElDrawer:O,ElButton:Z},mixins:[Se]}),Ne={class:`main flex flex-row flex-1`},Pe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Fe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ie(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ne,[e(`div`,Pe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Fe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Le=U(Me,[[`render`,Ie],[`__scopeId`,`data-v-293c9493`]]),Re=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},computed:{isModelLocked(){return this.$store.state.veo?.config?.action===`ingredients2video`},options(){return this.isModelLocked?[{value:G,label:`Veo 3.1 Fast`}]:le},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||=re}}),ze={class:`field`},Be={class:`title font-bold`};function Ve(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,ze,[e(`h2`,Be,i(t.$t(`veo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),disabled:t.isModelLocked},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var He=U(Re,[[`render`,Ve],[`__scopeId`,`data-v-90ed8cff`]]),Ue=v({name:`ActionSelector`,components:{ElTabs:x,ElTabPane:S},data(){return{}},computed:{options(){return[{value:`text2video`,label:this.$t(`veo.button.action1`)},{value:`image2video`,label:this.$t(`veo.button.action2`)},{value:`ingredients2video`,label:this.$t(`veo.button.actionIngredients`)}]},value(){return this.$store.state.veo?.config?.action||`text2video`}},mounted(){this.$store.state.veo?.config?.action||this.onUpdate(ae)},methods:{onUpdate(e){this.$store.commit(`veo/setConfig`,K(this.$store.state.veo?.config,e))}}}),We={class:`tab-label`},Ge={class:`text`};function Ke(t,n,r,a,o,u){let d=l(`el-tab-pane`),m=l(`el-tabs`);return g(),f(m,{"model-value":t.value,class:`action-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(d,{key:t.value,name:t.value},{label:p(()=>[e(`span`,We,[e(`span`,Ge,i(t.label),1)])]),_:2},1032,[`name`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var qe=U(Ue,[[`render`,Ke],[`__scopeId`,`data-v-c72fb85c`]]),Je=v({name:`TranslationSelector`,components:{ElSwitch:k,InfoIcon:M},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug(`set translation`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ye={class:`relative`},Xe={class:`flex justify-between`},Ze={class:`flex justify-start items-center`},Qe={class:`text-sm font-bold`},$e={class:`flex justify-end items-center`};function et(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`span`,Qe,i(t.$t(`veo.name.translation`)),1),a(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,$e,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var tt=U(Je,[[`render`,et]]),nt=v({name:`AspectRatioSelector`,data(){return{options:[{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||=ie}}),rt={class:`text-sm font-bold mb-2 block`},it={class:`items`},at=[`onClick`],ot={class:`name`};function st(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,rt,i(t.$t(`veo.name.ratio`)),1),e(`div`,it,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,ot,i(r.label),1)],10,at))),128))])])}var ct=U(nt,[[`render`,st],[`__scopeId`,`data-v-28c472c4`]]),lt=v({name:`StartEndImage`,components:{UploadIcon:te,ElUpload:C,ElButton:Z,InfoIcon:M,ImagePreview:Q},mixins:[ge,he,pe,fe],props:{limit:{type:Number,default:2},ingredients:{type:Boolean,default:!1}},emits:[`change`],data(){return{fileList:[],uploadUrl:se()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},title(){return this.ingredients?this.$t(`veo.button.actionIngredients`):this.$t(`veo.name.startEndImage`)},description(){return this.ingredients?this.$t(`veo.description.imageUrl`):this.$t(`veo.description.uploadStartEndImage`)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(e=>!!e)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},watch:{limit(){this.fileList.length>this.limit&&(this.fileList=this.fileList.slice(0,this.limit),this.onSetStartEndImageUrl())}},mounted(){this.fileList=(this.value||[]).map((e,t)=>({name:`reference-${t+1}`,percentage:100,response:{file_url:e},status:`success`,uid:Date.now()+t,url:e}))},methods:{onExceed(){D.warning(this.$t(`veo.message.uploadReferencesLimit`,{limit:this.limit}))},onError(){D.error(this.$t(`veo.message.uploadReferencesError`))},onSetStartEndImageUrl(){let e=this.urls;this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()},onRemove(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onSetStartEndImageUrl()}}}),ut={class:`relative`},dt={class:`flex justify-between`},ft={class:`flex justify-start items-center`},pt={class:`text-sm font-bold`};function mt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,ut,[e(`div`,dt,[e(`div`,ft,[e(`span`,pt,i(t.title),1),a(h,{content:t.description},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.limit,class:`upload-wrapper`,multiple:!0,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ht=U(lt,[[`render`,mt],[`__scopeId`,`data-v-a4391199`]]),gt=v({name:`PromptInput`,components:{PromptTextarea:N},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function _t(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`veo.name.prompt`),info:e.$t(`veo.description.prompt`),placeholder:e.$t(`veo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var vt=v({name:`ConfigPanel`,components:{MagicIcon:H,ElButton:Z,ServicePricingSummary:Ce,PromptInput:U(gt,[[`render`,_t]]),ModelSelector:He,StartEndImage:ht,ActionSelector:qe,TranslationSelector:tt,AspectRatioSelector:ct,ScenarioPaymentMode:Te},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return je(`veo`,Y(this.config))},config(){return this.$store.state.veo?.config},showsImages(){return this.config?.action===`image2video`||this.config?.action===`ingredients2video`},imageLimit(){return this.config?.action===`ingredients2video`?3:2},consumption(){return ue(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},walletMode(){return W()&&J(`veo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=J(`veo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=J(`veo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quote(Y(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),yt={class:`flex flex-col h-full`},bt={class:`flex-1 overflow-y-auto p-5`},xt={class:`flex flex-col items-center justify-center px-5 pb-5`};function St(t,n,c,u,d,m){let h=l(`action-selector`),_=l(`model-selector`),v=l(`start-end-image`),y=l(`prompt-input`),b=l(`aspect-ratio-selector`),x=l(`translation-selector`),S=l(`scenario-payment-mode`),C=l(`service-pricing-summary`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,yt,[e(`div`,bt,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),t.showsImages?(g(),f(v,{key:t.config?.action,class:`mb-4`,limit:t.imageLimit,ingredients:t.config?.action===`ingredients2video`},null,8,[`limit`,`ingredients`])):o(``,!0),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`})]),e(`div`,xt,[a(S,{scenario:`veo`}),t.walletMode?o(``,!0):(g(),f(C,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(T,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`veo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ct=U(vt,[[`render`,St]]),wt=v({name:`TaskPreview`,components:{DeleteIcon:B,ApplicationIcon:A,ChannelIcon:L,ExpandIcon:F,InfoIcon:ee,LanguageIcon:z,LightningIcon:ne,MagicIcon:H,TimeIcon:j,WarningIcon:V,CopyToClipboard:be,ElAlert:T,VideoPlayer:we,ImagePreview:Q,ElTooltip:w,ElButton:Z,ApiCodeButton:Ee,ReportButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{referenceImages(){let e=this.modelValue?.request?.image_urls;return Array.isArray(e)?e.filter(e=>typeof e==`string`&&!!e):[]},actionLabel(){let e=this.modelValue?.request,t=e?.model===`veo31-fast-ingredients`||this.referenceImages.length>2?`ingredients2video`:this.referenceImages.length>0?`image2video`:`text2video`,n=e?.action||t;return this.$t({text2video:`veo.button.action1`,image2video:`veo.button.action2`,ingredients2video:`veo.button.actionIngredients`}[n]||`veo.name.action`)},traceId(){return this.modelValue?.response?.trace_id||this.modelValue?.trace_id},taskInfoClass(){return this.modelValue?.response?.success===!0?`success`:this.modelValue?.response?.success===!1?`failure`:`info`}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`veo/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Tt={class:`preview`},Et={class:`left`},Dt={class:`main`},Ot={class:`bot`},kt={class:`datetime`},At=[`aria-label`],jt={class:`info`},Mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Nt={key:1,class:`prompt mt-2`},Pt={key:0},Ft={key:1},It={key:0,class:n({content:!0,failed:!0})},Lt={key:0,class:`mb-4`},Rt={key:1,class:n({operations:!0,"mt-2":!0})},zt={key:1,class:n({content:!0})},Bt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:n({content:!0})},Vt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Jt(u,d,m,_,v,y){let b=l(`capability-presentation`),x=l(`delete-icon`),S=l(`el-tooltip`),C=l(`image-preview`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`warning-icon`),k=l(`info-icon`),A=l(`copy-to-clipboard`),j=l(`el-alert`),M=l(`application-icon`),N=l(`lightning-icon`),P=l(`expand-icon`),F=l(`language-icon`),I=l(`magic-icon`),L=l(`time-icon`),R=l(`channel-icon`);return g(),s(`div`,Tt,[e(`div`,Et,[a(b,{capability:`veo`,part:`avatar`,class:`avatar`})]),e(`div`,Dt,[e(`div`,Ot,[a(b,{capability:`veo`,part:`name`}),e(`span`,kt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:u.$t(`common.button.delete`),placement:`top`},{default:p(()=>[u.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":u.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>u.onDelete&&u.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,At)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,jt,[u.referenceImages.length>0?(g(),s(`div`,Mt,[(g(!0),s(c,null,h(u.referenceImages,(e,t)=>(g(),f(C,{key:`${t}-${e}`,url:e,name:`reference-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(g(),s(`p`,Nt,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(g(),s(`span`,Pt,` - (`+i(u.$t(`veo.status.pending`))+`) `,1)),Array.isArray(u.modelValue?.response?.data)&&u.modelValue?.response?.data[0]?.state===`running`?(g(),s(`span`,Ft,` - (`+i(u.$t(`veo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),u.modelValue?.response?.success===!0&&u.modelValue?.response?.data?(g(),s(`div`,It,[u.modelValue?.response?.data[0]?.video_url?(g(),s(`div`,Lt,[a(w,{src:u.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):o(``,!0),u.modelValue?.response.success?(g(),s(`div`,Rt,[a(S,{class:`box-item`,effect:`dark`,content:u.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[u.modelValue?.response?.data[0]?.video_url?(g(),f(T,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:d[1]||=e=>u.onDownload(e,u.modelValue?.response?.data[0]?.video_url)},{default:p(()=>[r(i(u.$t(`veo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(E,{path:`/veo/videos`,body:u.modelValue?.request},null,8,[`body`]),a(D,{service:`veo`,"target-id":u.modelValue?.id,snapshot:{prompt:u.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0)])):o(``,!0),u.modelValue?.response?.success===!1?(g(),s(`div`,zt,[a(j,{closable:!1,class:`failure`},{template:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.failure`)),1)]),default:p(()=>[e(`p`,Bt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(A,{content:u.modelValue?.response?.error?.message},null,8,[`content`])])]),_:1})])):o(``,!0),e(`div`,$,[a(j,{closable:!1,class:n([`mt-2`,`task-metadata`,u.taskInfoClass])},{default:p(()=>[u.modelValue?.request?.model?(g(),s(`p`,Vt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.model`))+`: `+i(u.modelValue?.request?.model),1)])):o(``,!0),e(`p`,Ht,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.action`))+`: `+i(u.actionLabel),1)]),u.modelValue?.request?.aspect_ratio?(g(),s(`p`,Ut,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.ratio`))+`: `+i(u.modelValue?.request?.aspect_ratio),1)])):o(``,!0),u.modelValue?.request?.translation===void 0?o(``,!0):(g(),s(`p`,Wt,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.translation`))+`: `+i(u.$t(u.modelValue?.request?.translation?`seedance.button.on`:`seedance.button.off`)),1)])),e(`p`,Gt,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(A,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(g(),s(`p`,Kt,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.traceId?(g(),s(`p`,qt,[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.traceId`))+`: `+i(u.traceId)+` `,1),a(A,{content:u.traceId,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1},8,[`class`])])])])}var Yt=v({name:`RecentPanel`,components:{TaskPreview:U(wt,[[`render`,Jt],[`__scopeId`,`data-v-eb0880c2`]]),NoTasks:I,BotPlaceholder:De,ScrollList:P},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Xt={key:0},Zt={key:2,class:`w-full h-full flex items-center justify-center`};function Qt(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Xt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,(e,t)=>(g(),f(m,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Zt,[a(v)])):o(``,!0)],64)}var $t=v({name:`VeoIndex`,components:{ConfigPanel:Ct,Layout:Le,RecentPanel:U(Yt,[[`render`,Qt]]),ShowcaseResultTabs:Oe},mixins:[ye,ke(`veo`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks},walletMode(){return W()&&J(`veo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`veo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onGetTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onGetTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await R({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`veo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`veo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`veo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=Y(this.config),t=Ae(`veo`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!oe(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;if((e.action===`image2video`||e.action===`ingredients2video`)&&!(e.image_urls&&e.image_urls.length>0)){D.warning(this.$t(`veo.message.imageRequired`));return}let n;if(this.walletMode){let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=X.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ve())return;let t=this.credential?.token;if(!t)return;n=X.generate(e,{token:t})}D.info(this.$t(`veo.message.startingTask`)),de(`veo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),D.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{e instanceof _e||ce(e,`veo`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`veo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return me(this.$wallet)},async confirmWalletPayment(e){return q.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function en(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`veo`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var tn=U($t,[[`render`,en]]);export{tn as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-8-kd2VyH.js";import{n as x,t as S}from"./tabs-De_8qign.js";import{t as C}from"./upload-BXpBwasK.js";import{t as w}from"./tooltip-CHqcylXx.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-CPAfAKlf.js";import{t as O}from"./drawer-Bs-px8rV.js";import{t as k}from"./switch-DiUDO8o3.js";import{t as A}from"./box-CK8Q8K3k.js";import{t as j}from"./clock-BIk0gliD.js";import{a as M,i as N,n as P,o as F,r as I,s as L,t as R}from"./pagination-PI-pnQFZ.js";import{t as ee}from"./info-GaHinJWE.js";import{t as z}from"./languages-EmOgIEqS.js";import{t as B}from"./trash-2-TOSJlrQC.js";import{t as V}from"./triangle-alert-uTVBcsrd.js";import{t as te}from"./upload-BMfV8Ire.js";import{t as H}from"./wand-sparkles-CjbeD1Xg.js";import{t as ne}from"./zap-DtfcYx1O.js";import{_i as re,gi as ie,hi as ae}from"./constants-B0wcHJpW.js";import{$ as oe,A as U,Fi as W,Fr as G,Ir as K,La as q,Li as J,Mr as Y,Na as se,Nr as X,O as ce,Pr as le,Sn as ue,Xi as de,Y as fe,Za as Z,et as pe,li as me,nt as he,rt as ge,si as _e,ta as ve,tt as ye}from"./index-Cxnu8Cai.js";import{t as be}from"./CopyToClipboard-DpUrgAAx.js";import{t as xe}from"./ReportButton-DRaakXvZ.js";import{t as Q}from"./ImagePreview-CW8yYgYB.js";import{n as Se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ce}from"./ServicePricingSummary-BM6vSOWv.js";import{t as we}from"./VideoPlayer-CaBeu7to.js";import{t as Te}from"./ScenarioPaymentMode-OqLUCR7u.js";import{t as Ee}from"./ApiCodeButton-COttFgh2.js";import{t as De}from"./BotPlaceholder-CC_Edbls.js";import{t as Oe}from"./ShowcaseResultTabs-CUyYGgjU.js";import{t as ke}from"./showcaseRecreateMixin-O3d8pn1W.js";import{n as Ae,t as je}from"./generationInput-qrYUjgVF.js";var Me=v({name:`LayoutVeo`,components:{MagicIcon:H,ElDrawer:O,ElButton:Z},mixins:[Se]}),Ne={class:`main flex flex-row flex-1`},Pe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Fe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ie(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ne,[e(`div`,Pe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Fe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Le=U(Me,[[`render`,Ie],[`__scopeId`,`data-v-293c9493`]]),Re=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},computed:{isModelLocked(){return this.$store.state.veo?.config?.action===`ingredients2video`},options(){return this.isModelLocked?[{value:G,label:`Veo 3.1 Fast`}]:le},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||=re}}),ze={class:`field`},Be={class:`title font-bold`};function Ve(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,ze,[e(`h2`,Be,i(t.$t(`veo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),disabled:t.isModelLocked},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var He=U(Re,[[`render`,Ve],[`__scopeId`,`data-v-90ed8cff`]]),Ue=v({name:`ActionSelector`,components:{ElTabs:x,ElTabPane:S},data(){return{}},computed:{options(){return[{value:`text2video`,label:this.$t(`veo.button.action1`)},{value:`image2video`,label:this.$t(`veo.button.action2`)},{value:`ingredients2video`,label:this.$t(`veo.button.actionIngredients`)}]},value(){return this.$store.state.veo?.config?.action||`text2video`}},mounted(){this.$store.state.veo?.config?.action||this.onUpdate(ae)},methods:{onUpdate(e){this.$store.commit(`veo/setConfig`,K(this.$store.state.veo?.config,e))}}}),We={class:`tab-label`},Ge={class:`text`};function Ke(t,n,r,a,o,u){let d=l(`el-tab-pane`),m=l(`el-tabs`);return g(),f(m,{"model-value":t.value,class:`action-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(d,{key:t.value,name:t.value},{label:p(()=>[e(`span`,We,[e(`span`,Ge,i(t.label),1)])]),_:2},1032,[`name`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var qe=U(Ue,[[`render`,Ke],[`__scopeId`,`data-v-c72fb85c`]]),Je=v({name:`TranslationSelector`,components:{ElSwitch:k,InfoIcon:M},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug(`set translation`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ye={class:`relative`},Xe={class:`flex justify-between`},Ze={class:`flex justify-start items-center`},Qe={class:`text-sm font-bold`},$e={class:`flex justify-end items-center`};function et(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`span`,Qe,i(t.$t(`veo.name.translation`)),1),a(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,$e,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var tt=U(Je,[[`render`,et]]),nt=v({name:`AspectRatioSelector`,data(){return{options:[{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||=ie}}),rt={class:`text-sm font-bold mb-2 block`},it={class:`items`},at=[`onClick`],ot={class:`name`};function st(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,rt,i(t.$t(`veo.name.ratio`)),1),e(`div`,it,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,ot,i(r.label),1)],10,at))),128))])])}var ct=U(nt,[[`render`,st],[`__scopeId`,`data-v-28c472c4`]]),lt=v({name:`StartEndImage`,components:{UploadIcon:te,ElUpload:C,ElButton:Z,InfoIcon:M,ImagePreview:Q},mixins:[ge,he,pe,fe],props:{limit:{type:Number,default:2},ingredients:{type:Boolean,default:!1}},emits:[`change`],data(){return{fileList:[],uploadUrl:se()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},title(){return this.ingredients?this.$t(`veo.button.actionIngredients`):this.$t(`veo.name.startEndImage`)},description(){return this.ingredients?this.$t(`veo.description.imageUrl`):this.$t(`veo.description.uploadStartEndImage`)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(e=>!!e)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},watch:{limit(){this.fileList.length>this.limit&&(this.fileList=this.fileList.slice(0,this.limit),this.onSetStartEndImageUrl())}},mounted(){this.fileList=(this.value||[]).map((e,t)=>({name:`reference-${t+1}`,percentage:100,response:{file_url:e},status:`success`,uid:Date.now()+t,url:e}))},methods:{onExceed(){D.warning(this.$t(`veo.message.uploadReferencesLimit`,{limit:this.limit}))},onError(){D.error(this.$t(`veo.message.uploadReferencesError`))},onSetStartEndImageUrl(){let e=this.urls;this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()},onRemove(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onSetStartEndImageUrl()}}}),ut={class:`relative`},dt={class:`flex justify-between`},ft={class:`flex justify-start items-center`},pt={class:`text-sm font-bold`};function mt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,ut,[e(`div`,dt,[e(`div`,ft,[e(`span`,pt,i(t.title),1),a(h,{content:t.description},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.limit,class:`upload-wrapper`,multiple:!0,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ht=U(lt,[[`render`,mt],[`__scopeId`,`data-v-a4391199`]]),gt=v({name:`PromptInput`,components:{PromptTextarea:N},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function _t(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`veo.name.prompt`),info:e.$t(`veo.description.prompt`),placeholder:e.$t(`veo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var vt=v({name:`ConfigPanel`,components:{MagicIcon:H,ElButton:Z,ServicePricingSummary:Ce,PromptInput:U(gt,[[`render`,_t]]),ModelSelector:He,StartEndImage:ht,ActionSelector:qe,TranslationSelector:tt,AspectRatioSelector:ct,ScenarioPaymentMode:Te},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return je(`veo`,Y(this.config))},config(){return this.$store.state.veo?.config},showsImages(){return this.config?.action===`image2video`||this.config?.action===`ingredients2video`},imageLimit(){return this.config?.action===`ingredients2video`?3:2},consumption(){return ue(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},walletMode(){return W()&&J(`veo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=J(`veo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=J(`veo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quote(Y(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),yt={class:`flex flex-col h-full`},bt={class:`flex-1 overflow-y-auto p-5`},xt={class:`flex flex-col items-center justify-center px-5 pb-5`};function St(t,n,c,u,d,m){let h=l(`action-selector`),_=l(`model-selector`),v=l(`start-end-image`),y=l(`prompt-input`),b=l(`aspect-ratio-selector`),x=l(`translation-selector`),S=l(`scenario-payment-mode`),C=l(`service-pricing-summary`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,yt,[e(`div`,bt,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),t.showsImages?(g(),f(v,{key:t.config?.action,class:`mb-4`,limit:t.imageLimit,ingredients:t.config?.action===`ingredients2video`},null,8,[`limit`,`ingredients`])):o(``,!0),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`})]),e(`div`,xt,[a(S,{scenario:`veo`}),t.walletMode?o(``,!0):(g(),f(C,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(T,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`veo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ct=U(vt,[[`render`,St]]),wt=v({name:`TaskPreview`,components:{DeleteIcon:B,ApplicationIcon:A,ChannelIcon:L,ExpandIcon:F,InfoIcon:ee,LanguageIcon:z,LightningIcon:ne,MagicIcon:H,TimeIcon:j,WarningIcon:V,CopyToClipboard:be,ElAlert:T,VideoPlayer:we,ImagePreview:Q,ElTooltip:w,ElButton:Z,ApiCodeButton:Ee,ReportButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{referenceImages(){let e=this.modelValue?.request?.image_urls;return Array.isArray(e)?e.filter(e=>typeof e==`string`&&!!e):[]},actionLabel(){let e=this.modelValue?.request,t=e?.model===`veo31-fast-ingredients`||this.referenceImages.length>2?`ingredients2video`:this.referenceImages.length>0?`image2video`:`text2video`,n=e?.action||t;return this.$t({text2video:`veo.button.action1`,image2video:`veo.button.action2`,ingredients2video:`veo.button.actionIngredients`}[n]||`veo.name.action`)},traceId(){return this.modelValue?.response?.trace_id||this.modelValue?.trace_id},taskInfoClass(){return this.modelValue?.response?.success===!0?`success`:this.modelValue?.response?.success===!1?`failure`:`info`}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`veo/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Tt={class:`preview`},Et={class:`left`},Dt={class:`main`},Ot={class:`bot`},kt={class:`datetime`},At=[`aria-label`],jt={class:`info`},Mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Nt={key:1,class:`prompt mt-2`},Pt={key:0},Ft={key:1},It={key:0,class:n({content:!0,failed:!0})},Lt={key:0,class:`mb-4`},Rt={key:1,class:n({operations:!0,"mt-2":!0})},zt={key:1,class:n({content:!0})},Bt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:n({content:!0})},Vt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Jt(u,d,m,_,v,y){let b=l(`capability-presentation`),x=l(`delete-icon`),S=l(`el-tooltip`),C=l(`image-preview`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`warning-icon`),k=l(`info-icon`),A=l(`copy-to-clipboard`),j=l(`el-alert`),M=l(`application-icon`),N=l(`lightning-icon`),P=l(`expand-icon`),F=l(`language-icon`),I=l(`magic-icon`),L=l(`time-icon`),R=l(`channel-icon`);return g(),s(`div`,Tt,[e(`div`,Et,[a(b,{capability:`veo`,part:`avatar`,class:`avatar`})]),e(`div`,Dt,[e(`div`,Ot,[a(b,{capability:`veo`,part:`name`}),e(`span`,kt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:u.$t(`common.button.delete`),placement:`top`},{default:p(()=>[u.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":u.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>u.onDelete&&u.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,At)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,jt,[u.referenceImages.length>0?(g(),s(`div`,Mt,[(g(!0),s(c,null,h(u.referenceImages,(e,t)=>(g(),f(C,{key:`${t}-${e}`,url:e,name:`reference-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(g(),s(`p`,Nt,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(g(),s(`span`,Pt,` - (`+i(u.$t(`veo.status.pending`))+`) `,1)),Array.isArray(u.modelValue?.response?.data)&&u.modelValue?.response?.data[0]?.state===`running`?(g(),s(`span`,Ft,` - (`+i(u.$t(`veo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),u.modelValue?.response?.success===!0&&u.modelValue?.response?.data?(g(),s(`div`,It,[u.modelValue?.response?.data[0]?.video_url?(g(),s(`div`,Lt,[a(w,{src:u.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):o(``,!0),u.modelValue?.response.success?(g(),s(`div`,Rt,[a(S,{class:`box-item`,effect:`dark`,content:u.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[u.modelValue?.response?.data[0]?.video_url?(g(),f(T,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:d[1]||=e=>u.onDownload(e,u.modelValue?.response?.data[0]?.video_url)},{default:p(()=>[r(i(u.$t(`veo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(E,{path:`/veo/videos`,body:u.modelValue?.request},null,8,[`body`]),a(D,{service:`veo`,"target-id":u.modelValue?.id,snapshot:{prompt:u.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0)])):o(``,!0),u.modelValue?.response?.success===!1?(g(),s(`div`,zt,[a(j,{closable:!1,class:`failure`},{template:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.failure`)),1)]),default:p(()=>[e(`p`,Bt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(A,{content:u.modelValue?.response?.error?.message},null,8,[`content`])])]),_:1})])):o(``,!0),e(`div`,$,[a(j,{closable:!1,class:n([`mt-2`,`task-metadata`,u.taskInfoClass])},{default:p(()=>[u.modelValue?.request?.model?(g(),s(`p`,Vt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.model`))+`: `+i(u.modelValue?.request?.model),1)])):o(``,!0),e(`p`,Ht,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.action`))+`: `+i(u.actionLabel),1)]),u.modelValue?.request?.aspect_ratio?(g(),s(`p`,Ut,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.ratio`))+`: `+i(u.modelValue?.request?.aspect_ratio),1)])):o(``,!0),u.modelValue?.request?.translation===void 0?o(``,!0):(g(),s(`p`,Wt,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.translation`))+`: `+i(u.$t(u.modelValue?.request?.translation?`seedance.button.on`:`seedance.button.off`)),1)])),e(`p`,Gt,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(A,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(g(),s(`p`,Kt,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.traceId?(g(),s(`p`,qt,[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`veo.name.traceId`))+`: `+i(u.traceId)+` `,1),a(A,{content:u.traceId,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1},8,[`class`])])])])}var Yt=v({name:`RecentPanel`,components:{TaskPreview:U(wt,[[`render`,Jt],[`__scopeId`,`data-v-eb0880c2`]]),NoTasks:I,BotPlaceholder:De,ScrollList:P},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Xt={key:0},Zt={key:2,class:`w-full h-full flex items-center justify-center`};function Qt(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Xt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,(e,t)=>(g(),f(m,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Zt,[a(v)])):o(``,!0)],64)}var $t=v({name:`VeoIndex`,components:{ConfigPanel:Ct,Layout:Le,RecentPanel:U(Yt,[[`render`,Qt]]),ShowcaseResultTabs:Oe},mixins:[ye,ke(`veo`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks},walletMode(){return W()&&J(`veo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`veo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onGetTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onGetTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await R({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`veo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`veo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`veo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=Y(this.config),t=Ae(`veo`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!oe(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;if((e.action===`image2video`||e.action===`ingredients2video`)&&!(e.image_urls&&e.image_urls.length>0)){D.warning(this.$t(`veo.message.imageRequired`));return}let n;if(this.walletMode){let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=X.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ve())return;let t=this.credential?.token;if(!t)return;n=X.generate(e,{token:t})}D.info(this.$t(`veo.message.startingTask`)),de(`veo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),D.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{e instanceof _e||ce(e,`veo`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`veo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return me(this.$wallet)},async confirmWalletPayment(e){return q.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function en(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`veo`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var tn=U($t,[[`render`,en]]);export{tn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-BH6TGdbU.js";import{t as x}from"./upload-BXpBwasK.js";import{t as S}from"./tooltip-Br2j6riA.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-CPAfAKlf.js";import{t as E}from"./drawer-Cj-FR2bV.js";import{t as D}from"./input-number-C12vdbYv.js";import{t as O}from"./switch-TOscE6yZ.js";import{t as k}from"./box-CmUpezHl.js";import{t as A}from"./clock-auxp3wRO.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-BSs64OGk.js";import{t as ee}from"./image-DP9OoNQA.js";import{t as L}from"./info-6KLCmMcD.js";import{t as te}from"./trash-2-BwD47HPA.js";import{t as ne}from"./triangle-alert-DXtYQCtP.js";import{t as re}from"./upload-CjAmWnJO.js";import{t as R}from"./wand-sparkles-CsIjUWGj.js";import{t as ie}from"./zap-B1tgGWX3.js";import{$n as ae,Bn as oe,Gn as se,Jn as ce,Kn as le,Qn as ue,Rn as de,Vn as fe,Wn as z,Yn as B,Zn as V,er as H,qn as pe,zn as me}from"./constants-B0wcHJpW.js";import{$ as he,A as U,Fi as W,La as G,Li as K,Na as ge,O as _e,Sn as ve,Xi as ye,Y as be,Za as q,et as xe,li as Se,nt as Ce,rt as we,si as Te,ta as Ee,tr as J,tt as De,zi as Y}from"./index-ZgL-Sngk.js";import{t as Oe}from"./CopyToClipboard-b_INL3h6.js";import{t as ke}from"./ReportButton-C8TNdgFb.js";import{t as X}from"./ImagePreview-DkitBzQz.js";import{n as Ae}from"./taskDrawerMixin-DyAUhFEq.js";import{t as je}from"./ServicePricingSummary-sOw4h4Xv.js";import{t as Me}from"./ScenarioPaymentMode-I2LiUoDQ.js";import{t as Ne}from"./ApiCodeButton-0y91ZmDI.js";import{t as Pe}from"./BotPlaceholder-Ckt-l7zX.js";import{t as Fe}from"./ShowcaseResultTabs-DWP3P1OW.js";import{t as Ie}from"./showcaseRecreateMixin-D07tsJzV.js";import{t as Le}from"./ImageWrapper-BAIRHszj.js";import{n as Z}from"./imageRequests-DfqkbpTp.js";var Re=_({name:`LayoutNanobanana`,components:{MagicIcon:R,ElDrawer:E,ElButton:q},mixins:[Ae]}),ze={class:`main flex flex-row flex-1`},Be={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ve={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function He(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ze,[e(`div`,Be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ve,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ue=U(Re,[[`render`,He],[`__scopeId`,`data-v-fa2172a6`]]),We=_({name:`PromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ge(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ke=U(We,[[`render`,Ge]]),qe=_({name:`ImageUrlsInput`,components:{UploadIcon:re,ElUpload:x,ElButton:q,InfoIcon:j,ImagePreview:X},mixins:[we,Ce,xe,be],data(){return{fileList:[],uploadUrl:ge()+`/api/v1/files/`,suppressWatch:!1}},computed:{maxImages(){return 16},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){T.warning(this.$t(`openaiimage.message.uploadImageExceed`,{count:16}))},onError(){T.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Je={class:`field flex min-h-8 w-full items-center justify-between gap-3`},Ye={class:`flex min-w-0 items-center`},Xe={class:`title m-0 text-[14px] font-bold`},Ze={class:`file-list flex flex-wrap gap-[10px]`};function Qe(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.maxImages,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Ze,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var $e=U(qe,[[`render`,Qe]]),et=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{options:[{value:se,label:this.$t(`openaiimage.model.gptImage1`)},{value:le,label:this.$t(`openaiimage.model.gptImage15`)},{value:pe,label:this.$t(`openaiimage.model.gptImage2`)},{value:ce,label:this.$t(`openaiimage.model.gptImage2Official`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=fe}}),tt={class:`field`},nt={class:`label`},rt={class:`box`},it={class:`title font-bold`};function at(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`h2`,it,i(t.$t(`openaiimage.name.model`)),1),a(g,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ot=U(et,[[`render`,at],[`__scopeId`,`data-v-a42acad4`]]);function Q(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var st=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:O,ElInputNumber:D,InfoIcon:j},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},autoSizeValue(){return H},customSupported(){return oe.includes(this.model)},presets(){return B[this.model]??B[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:V},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:ue},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:ae}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize(H)}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.autoSizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return de},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:me.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||e===`auto`||this.presets.includes(e))return;let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize(H)}},storedSize(e){if(!e||e===`auto`){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Q(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),ct={class:`resolution`},lt={class:`field`},ut={class:`label`},dt={class:`box`},ft={class:`title font-bold`},pt={class:`field custom-toggle`},mt={class:`label`},ht={class:`box`},gt={class:`title font-bold`},_t={key:0,class:`custom-inputs`},vt={class:`row`},yt={class:`row-label`},bt={class:`row`},xt={class:`row-label`},St={key:0,class:`error`};function Ct(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`),x=l(`el-switch`),S=l(`el-input-number`);return h(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`div`,dt,[e(`h2`,ft,i(t.$t(`openaiimage.name.size`)),1),a(_,{content:t.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.presetValue,"onUpdate:modelValue":n[0]||=e=>t.presetValue=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`),disabled:t.useCustom},{default:p(()=>[a(v,{label:t.$t(`openaiimage.size.auto`),value:t.autoSizeValue},null,8,[`label`,`value`]),(h(!0),s(c,null,m(t.presetGroups,e=>(h(),f(y,{key:e.label,label:e.label},{default:p(()=>[(h(!0),s(c,null,m(e.options,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),t.customSupported?(h(),s(c,{key:0},[e(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`openaiimage.name.customSize`)),1),a(_,{content:t.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:t.useCustom,"onUpdate:modelValue":n[1]||=e=>t.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),t.useCustom?(h(),s(`div`,_t,[e(`div`,vt,[e(`span`,yt,i(t.$t(`openaiimage.name.width`)),1),a(S,{modelValue:t.customWidth,"onUpdate:modelValue":n[2]||=e=>t.customWidth=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e(`div`,bt,[e(`span`,xt,i(t.$t(`openaiimage.name.height`)),1),a(S,{modelValue:t.customHeight,"onUpdate:modelValue":n[3]||=e=>t.customHeight=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),t.customError?(h(),s(`div`,St,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var wt=U(st,[[`render`,Ct],[`__scopeId`,`data-v-22ab23e0`]]),Tt=350,Et=_({name:`ConfigPanel`,components:{MagicIcon:R,ElButton:q,PromptInput:Ke,ServicePricingSummary:je,ImageUrlsInput:$e,ModelSelector:ot,ResolutionSelector:wt,ScenarioPaymentMode:Me},props:{identityToken:{type:String,default:void 0}},emits:[`generate`],data(){return{OPENAIIMAGE_MODELS:z,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return ve({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service},walletMode(){return W()&&K(`openaiimage`).mode===`wallet`}},watch:{walletMode:{handler(e){e?this.scheduleQuote():this.cancelQuote()},immediate:!0},config:{handler(){this.walletMode?this.scheduleQuote():this.cancelQuote()},deep:!0},identityToken(){this.quoteRunId+=1,this.walletMode&&this.scheduleQuote()}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,Tt)},cancelQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},async refreshQuote(){let e=K(`openaiimage`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await J.quote(Z(this.config),this.identityToken);t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dt={class:`flex flex-col h-full`},Ot={class:`flex-1 overflow-y-auto p-5`},kt={class:`flex flex-col items-center justify-center px-5 pb-5`};function At(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`resolution-selector`),v=l(`prompt-input`),y=l(`image-urls-input`),b=l(`scenario-payment-mode`),x=l(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return h(),s(`div`,Dt,[e(`div`,Ot,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`})]),e(`div`,kt,[a(b,{scenario:`openaiimage`}),t.walletMode?o(``,!0):(h(),f(x,{key:0,value:t.consumption,service:t.service,"pricing-models":t.OPENAIIMAGE_MODELS,"pricing-model-default":`dall-e-3`,"pricing-unit-aliases":{n:`image`}},null,8,[`value`,`service`,`pricing-models`])),a(C,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var jt=U(Et,[[`render`,At]]),Mt=_({name:`TaskPreview`,components:{ApplicationIcon:k,ChannelIcon:F,DeleteIcon:te,ImageIcon:ee,InfoIcon:L,LightningIcon:ie,MagicIcon:R,TimeIcon:A,WarningIcon:ne,CopyToClipboard:Oe,ElAlert:C,ImageWrapper:Le,ElButton:q,ElTooltip:S,ImagePreview:X,ApiCodeButton:Ne,ReportButton:ke},props:{modelValue:{type:Object,required:!0}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await G.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(`openaiimage/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),Nt={class:`preview`},Pt={class:`left`},Ft={class:`main`},It={class:`bot`},Lt={class:`datetime`},Rt=[`aria-label`],zt={class:`info`},Bt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Vt={key:1,class:`prompt mt-2`},Ht={key:0},Ut={key:0,class:n({content:!0,failed:!0})},Wt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},Gt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Qt={key:1,class:n({content:!0})},$t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},en={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},on={key:2,class:n({content:!0})},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},un={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function dn(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`image-wrapper`),w=l(`el-button`),T=l(`api-code-button`),E=l(`report-button`),D=l(`application-icon`),O=l(`image-icon`),k=l(`lightning-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`channel-icon`),P=l(`el-alert`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,Nt,[e(`div`,Pt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,Ft,[e(`div`,It,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,Lt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Rt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,zt,[n.referenceImages.length>0?(h(),s(`div`,Bt,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,Vt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ht,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ut,[e(`div`,Wt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(C,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,Gt,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url||n.images?.[0]?.url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`]),a(E,{service:`openaiimage`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(P,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,qt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Jt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Yt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Xt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Zt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Qt,[a(P,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,$t,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,en,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,tn,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,nn,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,rn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,an,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,on,[a(P,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(I,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(M,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(n.$t(n.modelValue?.response?`openaiimage.name.status`:`openaiimage.status.pending`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,sn,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,cn,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,ln,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,un,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var fn=_({name:`RecentPanel`,components:{TaskPreview:U(Mt,[[`render`,dn],[`__scopeId`,`data-v-6519c932`]]),BotPlaceholder:Pe,NoTasks:P,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),pn={key:0},mn={key:2,class:`w-full h-full flex items-center justify-center`};function hn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,pn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,mn,[a(v)])):o(``,!0)],64)}var gn=_({name:`OpenAIImageIndex`,components:{ConfigPanel:jt,Layout:Ue,RecentPanel:U(fn,[[`render`,hn]]),ShowcaseResultTabs:Fe},mixins:[De,Ie(`openaiimage`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===w.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks},walletMode(){return W()&&K(`openaiimage`).mode===`wallet`}},watch:{config:{handler(e){Y(`openaiimage`,!(Array.isArray(e?.image_urls)&&e.image_urls.length>0))},deep:!0,immediate:!0},walletMode:{async handler(e,t){t===void 0||e===t||(this.$store.commit(`openaiimage/setTasks`,void 0),await this.onGetTasks(),await this.onScrollDown())}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await I({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})},async onGenerate(){if(!he(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;Y(`openaiimage`,!t);let n=K(`openaiimage`).mode;if(!this.hasText(e.prompt)){T.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let r=Z(e),i={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0},a;if(n===`wallet`){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}a=J.generate(r,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Ee())return;let e=this.credential?.token;if(!e){console.error(`no token specified`);return}a=t?J.edit(i,{token:e}):J.generate(r,{token:e})}T.info(this.$t(`openaiimage.message.startingTask`)),ye(`openaiimage`,a).then(e=>{let t=e?.data?.task_id;console.debug(`task accepted`,t),n===`wallet`&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{if(e instanceof Te)return;let t=e?.response?.data;_e(e,`openaiimage`)||(n===`wallet`?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Se(this.$wallet)},async confirmWalletPayment(e){return G.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function _n(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return h(),f(d,null,{config:p(()=>[a(s,{"identity-token":e.credential?.token,onGenerate:e.onGenerate},null,8,[`identity-token`,`onGenerate`])]),result:p(()=>[a(u,{service:`openai`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var vn=U(gn,[[`render`,_n]]);export{vn as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-8-kd2VyH.js";import{t as x}from"./upload-BXpBwasK.js";import{t as S}from"./tooltip-CHqcylXx.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-CPAfAKlf.js";import{t as E}from"./drawer-Bs-px8rV.js";import{t as D}from"./input-number-ekvKm-AN.js";import{t as O}from"./switch-DiUDO8o3.js";import{t as k}from"./box-CK8Q8K3k.js";import{t as A}from"./clock-BIk0gliD.js";import{a as j,i as M,n as N,r as P,s as F,t as I}from"./pagination-PI-pnQFZ.js";import{t as ee}from"./image-BEMUVXib.js";import{t as L}from"./info-GaHinJWE.js";import{t as te}from"./trash-2-TOSJlrQC.js";import{t as ne}from"./triangle-alert-uTVBcsrd.js";import{t as re}from"./upload-BMfV8Ire.js";import{t as R}from"./wand-sparkles-CjbeD1Xg.js";import{t as ie}from"./zap-DtfcYx1O.js";import{$n as ae,Bn as oe,Gn as se,Jn as ce,Kn as le,Qn as ue,Rn as de,Vn as fe,Wn as z,Yn as B,Zn as V,er as H,qn as pe,zn as me}from"./constants-B0wcHJpW.js";import{$ as he,A as U,Fi as W,La as G,Li as K,Na as ge,O as _e,Sn as ve,Xi as ye,Y as be,Za as q,et as xe,li as Se,nt as Ce,rt as we,si as Te,ta as Ee,tr as J,tt as De,zi as Y}from"./index-Cxnu8Cai.js";import{t as Oe}from"./CopyToClipboard-DpUrgAAx.js";import{t as ke}from"./ReportButton-DRaakXvZ.js";import{t as X}from"./ImagePreview-CW8yYgYB.js";import{n as Ae}from"./taskDrawerMixin-DyAUhFEq.js";import{t as je}from"./ServicePricingSummary-BM6vSOWv.js";import{t as Me}from"./ScenarioPaymentMode-OqLUCR7u.js";import{t as Ne}from"./ApiCodeButton-COttFgh2.js";import{t as Pe}from"./BotPlaceholder-CC_Edbls.js";import{t as Fe}from"./ShowcaseResultTabs-CUyYGgjU.js";import{t as Ie}from"./showcaseRecreateMixin-O3d8pn1W.js";import{t as Le}from"./ImageWrapper-B_W9Z0VL.js";import{n as Z}from"./imageRequests-DfqkbpTp.js";var Re=_({name:`LayoutNanobanana`,components:{MagicIcon:R,ElDrawer:E,ElButton:q},mixins:[Ae]}),ze={class:`main flex flex-row flex-1`},Be={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ve={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function He(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ze,[e(`div`,Be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ve,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ue=U(Re,[[`render`,He],[`__scopeId`,`data-v-fa2172a6`]]),We=_({name:`PromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ge(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ke=U(We,[[`render`,Ge]]),qe=_({name:`ImageUrlsInput`,components:{UploadIcon:re,ElUpload:x,ElButton:q,InfoIcon:j,ImagePreview:X},mixins:[we,Ce,xe,be],data(){return{fileList:[],uploadUrl:ge()+`/api/v1/files/`,suppressWatch:!1}},computed:{maxImages(){return 16},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){T.warning(this.$t(`openaiimage.message.uploadImageExceed`,{count:16}))},onError(){T.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Je={class:`field flex min-h-8 w-full items-center justify-between gap-3`},Ye={class:`flex min-w-0 items-center`},Xe={class:`title m-0 text-[14px] font-bold`},Ze={class:`file-list flex flex-wrap gap-[10px]`};function Qe(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.maxImages,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Ze,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var $e=U(qe,[[`render`,Qe]]),et=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{options:[{value:se,label:this.$t(`openaiimage.model.gptImage1`)},{value:le,label:this.$t(`openaiimage.model.gptImage15`)},{value:pe,label:this.$t(`openaiimage.model.gptImage2`)},{value:ce,label:this.$t(`openaiimage.model.gptImage2Official`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=fe}}),tt={class:`field`},nt={class:`label`},rt={class:`box`},it={class:`title font-bold`};function at(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`h2`,it,i(t.$t(`openaiimage.name.model`)),1),a(g,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ot=U(et,[[`render`,at],[`__scopeId`,`data-v-a42acad4`]]);function Q(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var st=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:O,ElInputNumber:D,InfoIcon:j},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},autoSizeValue(){return H},customSupported(){return oe.includes(this.model)},presets(){return B[this.model]??B[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:V},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:ue},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:ae}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize(H)}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.autoSizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return de},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:me.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||e===`auto`||this.presets.includes(e))return;let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize(H)}},storedSize(e){if(!e||e===`auto`){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Q(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),ct={class:`resolution`},lt={class:`field`},ut={class:`label`},dt={class:`box`},ft={class:`title font-bold`},pt={class:`field custom-toggle`},mt={class:`label`},ht={class:`box`},gt={class:`title font-bold`},_t={key:0,class:`custom-inputs`},vt={class:`row`},yt={class:`row-label`},bt={class:`row`},xt={class:`row-label`},St={key:0,class:`error`};function Ct(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`),x=l(`el-switch`),S=l(`el-input-number`);return h(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`div`,dt,[e(`h2`,ft,i(t.$t(`openaiimage.name.size`)),1),a(_,{content:t.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.presetValue,"onUpdate:modelValue":n[0]||=e=>t.presetValue=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`),disabled:t.useCustom},{default:p(()=>[a(v,{label:t.$t(`openaiimage.size.auto`),value:t.autoSizeValue},null,8,[`label`,`value`]),(h(!0),s(c,null,m(t.presetGroups,e=>(h(),f(y,{key:e.label,label:e.label},{default:p(()=>[(h(!0),s(c,null,m(e.options,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),t.customSupported?(h(),s(c,{key:0},[e(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`openaiimage.name.customSize`)),1),a(_,{content:t.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:t.useCustom,"onUpdate:modelValue":n[1]||=e=>t.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),t.useCustom?(h(),s(`div`,_t,[e(`div`,vt,[e(`span`,yt,i(t.$t(`openaiimage.name.width`)),1),a(S,{modelValue:t.customWidth,"onUpdate:modelValue":n[2]||=e=>t.customWidth=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e(`div`,bt,[e(`span`,xt,i(t.$t(`openaiimage.name.height`)),1),a(S,{modelValue:t.customHeight,"onUpdate:modelValue":n[3]||=e=>t.customHeight=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),t.customError?(h(),s(`div`,St,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var wt=U(st,[[`render`,Ct],[`__scopeId`,`data-v-22ab23e0`]]),Tt=350,Et=_({name:`ConfigPanel`,components:{MagicIcon:R,ElButton:q,PromptInput:Ke,ServicePricingSummary:je,ImageUrlsInput:$e,ModelSelector:ot,ResolutionSelector:wt,ScenarioPaymentMode:Me},props:{identityToken:{type:String,default:void 0}},emits:[`generate`],data(){return{OPENAIIMAGE_MODELS:z,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return ve({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service},walletMode(){return W()&&K(`openaiimage`).mode===`wallet`}},watch:{walletMode:{handler(e){e?this.scheduleQuote():this.cancelQuote()},immediate:!0},config:{handler(){this.walletMode?this.scheduleQuote():this.cancelQuote()},deep:!0},identityToken(){this.quoteRunId+=1,this.walletMode&&this.scheduleQuote()}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,Tt)},cancelQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},async refreshQuote(){let e=K(`openaiimage`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await J.quote(Z(this.config),this.identityToken);t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dt={class:`flex flex-col h-full`},Ot={class:`flex-1 overflow-y-auto p-5`},kt={class:`flex flex-col items-center justify-center px-5 pb-5`};function At(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`resolution-selector`),v=l(`prompt-input`),y=l(`image-urls-input`),b=l(`scenario-payment-mode`),x=l(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return h(),s(`div`,Dt,[e(`div`,Ot,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`})]),e(`div`,kt,[a(b,{scenario:`openaiimage`}),t.walletMode?o(``,!0):(h(),f(x,{key:0,value:t.consumption,service:t.service,"pricing-models":t.OPENAIIMAGE_MODELS,"pricing-model-default":`dall-e-3`,"pricing-unit-aliases":{n:`image`}},null,8,[`value`,`service`,`pricing-models`])),a(C,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var jt=U(Et,[[`render`,At]]),Mt=_({name:`TaskPreview`,components:{ApplicationIcon:k,ChannelIcon:F,DeleteIcon:te,ImageIcon:ee,InfoIcon:L,LightningIcon:ie,MagicIcon:R,TimeIcon:A,WarningIcon:ne,CopyToClipboard:Oe,ElAlert:C,ImageWrapper:Le,ElButton:q,ElTooltip:S,ImagePreview:X,ApiCodeButton:Ne,ReportButton:ke},props:{modelValue:{type:Object,required:!0}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await G.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(`openaiimage/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),Nt={class:`preview`},Pt={class:`left`},Ft={class:`main`},It={class:`bot`},Lt={class:`datetime`},Rt=[`aria-label`],zt={class:`info`},Bt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Vt={key:1,class:`prompt mt-2`},Ht={key:0},Ut={key:0,class:n({content:!0,failed:!0})},Wt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},Gt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Qt={key:1,class:n({content:!0})},$t={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},en={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},on={key:2,class:n({content:!0})},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},un={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function dn(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`image-wrapper`),w=l(`el-button`),T=l(`api-code-button`),E=l(`report-button`),D=l(`application-icon`),O=l(`image-icon`),k=l(`lightning-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`channel-icon`),P=l(`el-alert`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,Nt,[e(`div`,Pt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,Ft,[e(`div`,It,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,Lt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Rt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,zt,[n.referenceImages.length>0?(h(),s(`div`,Bt,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,Vt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ht,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ut,[e(`div`,Wt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(C,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,Gt,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url||n.images?.[0]?.url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`]),a(E,{service:`openaiimage`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(P,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,qt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Jt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Yt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Xt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Zt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Qt,[a(P,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,$t,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,en,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,tn,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,nn,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,rn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,an,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,on,[a(P,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(I,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(M,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(n.$t(n.modelValue?.response?`openaiimage.name.status`:`openaiimage.status.pending`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,sn,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,cn,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,ln,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,un,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var fn=_({name:`RecentPanel`,components:{TaskPreview:U(Mt,[[`render`,dn],[`__scopeId`,`data-v-6519c932`]]),BotPlaceholder:Pe,NoTasks:P,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),pn={key:0},mn={key:2,class:`w-full h-full flex items-center justify-center`};function hn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,pn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,mn,[a(v)])):o(``,!0)],64)}var gn=_({name:`OpenAIImageIndex`,components:{ConfigPanel:jt,Layout:Ue,RecentPanel:U(fn,[[`render`,hn]]),ShowcaseResultTabs:Fe},mixins:[De,Ie(`openaiimage`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===w.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks},walletMode(){return W()&&K(`openaiimage`).mode===`wallet`}},watch:{config:{handler(e){Y(`openaiimage`,!(Array.isArray(e?.image_urls)&&e.image_urls.length>0))},deep:!0,immediate:!0},walletMode:{async handler(e,t){t===void 0||e===t||(this.$store.commit(`openaiimage/setTasks`,void 0),await this.onGetTasks(),await this.onScrollDown())}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await I({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})},async onGenerate(){if(!he(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;Y(`openaiimage`,!t);let n=K(`openaiimage`).mode;if(!this.hasText(e.prompt)){T.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let r=Z(e),i={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0},a;if(n===`wallet`){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}a=J.generate(r,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Ee())return;let e=this.credential?.token;if(!e){console.error(`no token specified`);return}a=t?J.edit(i,{token:e}):J.generate(r,{token:e})}T.info(this.$t(`openaiimage.message.startingTask`)),ye(`openaiimage`,a).then(e=>{let t=e?.data?.task_id;console.debug(`task accepted`,t),n===`wallet`&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{if(e instanceof Te)return;let t=e?.response?.data;_e(e,`openaiimage`)||(n===`wallet`?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Se(this.$wallet)},async confirmWalletPayment(e){return G.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function _n(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return h(),f(d,null,{config:p(()=>[a(s,{"identity-token":e.credential?.token,onGenerate:e.onGenerate},null,8,[`identity-token`,`onGenerate`])]),result:p(()=>[a(u,{service:`openai`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var vn=U(gn,[[`render`,_n]]);export{vn 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,b as u,ht as d,j as f,mt as p,ot as m,qt as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-BH6TGdbU.js";import{n as S,t as C}from"./tabs-De_8qign.js";import{t as w}from"./tooltip-Br2j6riA.js";import{v as T}from"./models-CPAfAKlf.js";import{n as E,r as D,t as O}from"./dropdown-Szm2aqS3.js";import{t as k}from"./pagination-BtnijNAg.js";import{t as A}from"./switch-TOscE6yZ.js";import{t as j}from"./arrow-down-DnRxCHng.js";import{t as M}from"./arrow-left-CCTyf2E5.js";import{t as N}from"./book-open-Bb4veJ9H.js";import{t as P}from"./chevron-down-ygQGkXbe.js";import{t as F}from"./chevron-right-CiVFwPib.js";import{t as I}from"./circle-check-DGztZnzp.js";import{t as L}from"./circle-question-mark-DBUZlkWm.js";import{t as ee}from"./clipboard-list-FT0B7KW7.js";import{t as te}from"./code-BC5AxncC.js";import{t as R}from"./copy-Cix8xw3o.js";import{t as ne}from"./ellipsis-BwmSdENx.js";import{t as re}from"./eye-BqDWtT8R.js";import{t as ie}from"./file-text-Mfb6sGFK.js";import{t as z}from"./file-BFpYT5J4.js";import{t as ae}from"./folder-JUFFSCH3.js";import{t as oe}from"./image-DP9OoNQA.js";import{t as se}from"./lock-D_dkt0jZ.js";import{t as B}from"./plus-BJSvOiJY.js";import{n as ce,t as le}from"./store-B3yAOyZj.js";import{t as ue}from"./search-CGiFzP3Q.js";import{t as de}from"./trash-2-BwD47HPA.js";import{t as fe}from"./triangle-alert-DXtYQCtP.js";import{t as pe}from"./upload-CjAmWnJO.js";import{t as me}from"./wand-sparkles-CsIjUWGj.js";import{D as he,N as ge,O as _e,k as ve,w as ye}from"./i18n-9CWVvd05.js";import{A as V,Ha as H,Ia as U,Ji as W,La as be,Ma as xe,Ra as G,Ya as Se,Za as K,ao as q,qi as J}from"./index-ZgL-Sngk.js";import{a as Ce,c as we,d as Te,f as Ee,i as De,l as Oe,m as Y,n as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe}from"./vendor-highlight-BHrfT4-E.js";import{t as Ie}from"./index.es-xxt9TEy9.js";import{t as Le}from"./VueMarkdown-CiiRjbWs.js";import{t as Re}from"./PageHeader-Bdkuv6Us.js";var ze=U(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Be=U(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Ve=U(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),He=U(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ue=U(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),X=()=>({baseURL:`${xe()}/api/v1`}),Z=new class{key=`skills/installed`;async list(){return J.get(`/${this.key}/`,X())}async get(e){return J.get(`/${this.key}/${e}/`,X())}async createMarkdown(e){return J.post(`/${this.key}/`,e,X())}async createTarball(e){let t=new FormData;return t.append(`tarball`,e),J.post(`/${this.key}/`,t,{...X(),headers:{"Content-Type":`multipart/form-data`}})}async update(e,t){return J.patch(`/${this.key}/${e}/`,t,X())}async remove(e){return J.delete(`/${this.key}/${e}/`,X())}async enable(e){return J.post(`/${this.key}/${e}/enable/`,void 0,X())}async disable(e){return J.post(`/${this.key}/${e}/disable/`,void 0,X())}async fetchFile(e,t){let n=await J.get(`/${this.key}/${e}/files/`,{...X(),params:{path:t},responseType:`arraybuffer`}),r=n.headers[`content-type`]||`application/octet-stream`;return{blob:new Blob([n.data],{type:r}),contentType:r}}},Q=new class{key=`skills`;async list(e={}){return W.get(`/${this.key}/`,{...X(),params:e})}async get(e){return W.get(`/${this.key}/${e}/`,X())}async categories(){return W.get(`/${this.key}/categories/`,X())}async install(e,t={}){return J.post(`/${this.key}/${e}/install/`,t,X())}};function We(){let e=new Set;_e()&&e.add(`desktop`),ve()&&e.add(`ios`),he()&&e.add(`android`),ge()&&e.add(`web`);let t=ye();if(t===`mac`)e.add(`mac`);else if(t===`windows`)e.add(`windows`);else if(typeof navigator<`u`){let t=navigator.userAgent||``,n=navigator.userAgentData?.platform,r=/macintosh/i.test(t)&&(navigator.maxTouchPoints||0)>1;!ve()&&!r&&(n===`macOS`||/mac os x|macintosh/i.test(t))&&e.add(`mac`),(n===`Windows`||/windows nt/i.test(t))&&e.add(`windows`)}return e}var Ge=new Set([`mac`,`windows`,`desktop`,`web`,`ios`,`android`]);function Ke(e){let t=e.filter(e=>Ge.has(e));if(!t.length)return!0;let n=We();return t.some(e=>n.has(e))}Y.registerLanguage(`bash`,je),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var qe=12,Je=y({name:`BrowseSkillsDialog`,components:{VueMarkdown:Le,ElDialog:H,ElInput:q,ElButton:K,ElPagination:k,ElSelect:b,ElOption:x,FontAwesomeIcon:Ie,AddIcon:B,BackIcon:M,DownIcon:j,InstallIcon:ze,LockIcon:se,SearchIcon:ue,SuccessIcon:I},directives:{loading:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`installed`],data(){return{loading:!1,installing:!1,items:[],total:0,currentPage:1,searchQuery:``,namespaceFilter:``,sortBy:`popular`,selectedItem:null,searchTimer:null,knownNamespaces:[],publisherByNamespace:{}}},computed:{pageSize(){return qe},namespaceOptions(){let e=new Set(this.knownNamespaces);for(let t of this.items)e.add(t.namespace);return Array.from(e).sort().map(e=>({value:e,label:this.publisherForNamespace(e)}))},detailBody(){return this.selectedItem?this.selectedItem.content.replace(/^---\n[\s\S]*?\n---\n?/,``):``}},methods:{onOpen(){this.selectedItem=null,this.searchQuery=``,this.namespaceFilter=``,this.sortBy=`popular`,this.currentPage=1,this.knownNamespaces=[],this.publisherByNamespace={},this.loadFacets(),this.reload()},openDetail(e){this.selectedItem=e},async loadFacets(){try{let{data:e}=await Q.categories(),t=new Set;for(let n of e.namespaces)t.add(n.namespace);this.knownNamespaces=Array.from(t).sort()}catch(e){console.warn(`failed to load skill catalog facets`,e)}},reloadFromFirstPage(){this.currentPage=1,this.reload()},onPageChange(e){this.currentPage=e,this.reload(),this.$nextTick(()=>{let e=this.$el.querySelector(`.directory-grid-wrapper`);e&&(e.scrollTop=0)})},onSearchInput(){this.searchTimer!==null&&window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.reloadFromFirstPage()},250)},async reload(){this.loading=!0;try{let{data:e}=await Q.list({q:this.searchQuery.trim()||void 0,namespace:this.namespaceFilter||void 0,sort:this.sortBy,limit:this.pageSize,offset:(this.currentPage-1)*this.pageSize});this.items=e.items,this.total=e.total;for(let t of e.items)t.publisher&&(this.publisherByNamespace[t.namespace]=t.publisher)}catch(e){console.error(e),T.error(this.$t(`skill.directory.loadFailed`))}finally{this.loading=!1}},async onInstall(e){if(!this.installing&&!e.installed){if(!this.canInstallOnSurface(e)){T.warning(this.$t(`skill.directory.surfaceBlocked`,{platforms:this.surfaceLabels(e)}));return}this.installing=!0;try{let{data:t}=await Q.install(e.id);T.success(this.$t(`skill.directory.installSuccess`,{name:e.slug})),this.$emit(`installed`,t.id),e.installed=!0,e.install_count+=1}catch(t){let n=this.extractError(t);n.includes(`already exists`)?(e.installed=!0,T.warning(this.$t(`skill.directory.alreadyInstalled`,{name:e.slug}))):T.error(this.$t(`skill.directory.installFailed`,{detail:n}))}finally{this.installing=!1}}},extractError(e){return e?.response?.data?.detail||String(e)||`unknown error`},formatCount(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)},publisherForNamespace(e){if(this.publisherByNamespace[e])return this.publisherByNamespace[e];let t=this.items.find(t=>t.namespace===e);return t?t.publisher:e},restrictedSurfaces(e){let t=e.frontmatter?.surfaces;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim().toLowerCase()):[]},surfaceLabel(e){let t=`skill.directory.surface.${e}`,n=this.$t(t);return n===t?e:n},surfaceLabels(e){return this.restrictedSurfaces(e).map(e=>this.surfaceLabel(e)).join(` / `)},canInstallOnSurface(e){return Ke(this.restrictedSurfaces(e))}}}),Ye={class:`directory`},Xe={class:`directory-main`},Ze={class:`directory-header`},Qe={class:`directory-controls`},$e={class:`directory-grid-wrapper`},et={key:0,class:`directory-empty`},tt={key:1,class:`directory-grid`},nt=[`onClick`],rt={class:`directory-card-head`},it={class:`directory-card-title`},at=[`title`],ot=[`title`],st=[`aria-label`,`title`,`onClick`],ct=[`title`],lt={class:`directory-card-meta`},ut={class:`directory-card-publisher`},dt={key:0,class:`directory-card-count`},ft=[`title`],pt={class:`directory-card-desc`},mt={key:0,class:`directory-footer`},ht={class:`directory-detail-head`},gt={class:`directory-detail-actions`},_t=[`href`],vt={class:`directory-detail-body`},yt={class:`directory-detail-title`},bt={class:`directory-detail-meta`},xt={key:0},St={key:1},Ct=[`title`],wt={class:`directory-detail-desc`};function Tt(u,h,_,y,b,x){let S=l(`search-icon`),C=l(`el-input`),w=l(`el-option`),T=l(`el-select`),E=l(`success-icon`),D=l(`lock-icon`),O=l(`add-icon`),k=l(`down-icon`),A=l(`el-pagination`),j=l(`back-icon`),M=l(`font-awesome-icon`),N=l(`el-button`),P=l(`install-icon`),F=l(`vue-markdown`),I=l(`el-dialog`),L=m(`loading`);return v(),f(I,{"model-value":u.modelValue,title:u.$t(`skill.dialog.directoryTitle`),width:`min(960px, 94vw)`,"align-center":``,class:`directory-dialog`,"close-on-click-modal":!u.installing,"show-close":!u.installing,"onUpdate:modelValue":h[5]||=e=>u.$emit(`update:modelValue`,e),onOpen:u.onOpen},{default:p(()=>[e(`div`,Ye,[e(`main`,Xe,[u.selectedItem?(v(),s(c,{key:1},[e(`header`,ht,[e(`button`,{class:`directory-back-btn`,onClick:h[3]||=e=>u.selectedItem=null},[a(j,{size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.back`)),1)]),e(`div`,gt,[u.selectedItem.source_url?(v(),s(`a`,{key:0,href:u.selectedItem.source_url,target:`_blank`,class:`directory-link`},[a(M,{icon:`fa-brands fa-github`}),r(` `+i(u.$t(`skill.directory.viewSource`)),1)],8,_t)):o(``,!0),u.selectedItem.installed?(v(),f(N,{key:1,disabled:``,type:`success`,plain:``},{default:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.installed`)),1)]),_:1})):u.selectedItem.installable&&!u.canInstallOnSurface(u.selectedItem)?(v(),f(N,{key:2,disabled:``,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(u.selectedItem)})},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.surfaceUnavailable`)),1)]),_:1},8,[`title`])):u.selectedItem.installable?(v(),f(N,{key:3,type:`primary`,loading:u.installing,onClick:h[4]||=e=>u.onInstall(u.selectedItem)},{default:p(()=>[a(P,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.install`)),1)]),_:1},8,[`loading`])):(v(),f(N,{key:4,disabled:``,title:u.selectedItem.license},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.selectedItem.license||u.$t(`skill.directory.notInstallable`)),1)]),_:1},8,[`title`]))])]),e(`div`,vt,[e(`h2`,yt,`/`+i(u.selectedItem.slug),1),e(`div`,bt,[e(`span`,null,[e(`strong`,null,i(u.$t(`skill.meta.addedBy`))+`:`,1),r(` `+i(u.selectedItem.publisher),1)]),u.selectedItem.license?(v(),s(`span`,xt,[e(`strong`,null,i(u.$t(`skill.directory.license`))+`:`,1),r(` `+i(u.selectedItem.license),1)])):o(``,!0),u.selectedItem.version?(v(),s(`span`,St,`v`+i(u.selectedItem.version),1)):o(``,!0),u.surfaceLabels(u.selectedItem)?(v(),s(`span`,{key:2,class:`directory-detail-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.$t(`skill.directory.surfaceOnly`,{platforms:u.surfaceLabels(u.selectedItem)})),9,Ct)):o(``,!0)]),e(`p`,wt,i(u.selectedItem.description),1),a(F,{class:`directory-detail-content`,source:u.detailBody,sanitize:``},null,8,[`source`])])],64)):(v(),s(c,{key:0},[e(`header`,Ze,[a(C,{modelValue:u.searchQuery,"onUpdate:modelValue":h[0]||=e=>u.searchQuery=e,class:`directory-search`,size:`default`,clearable:``,placeholder:u.$t(`skill.directory.searchPlaceholder`),onInput:u.onSearchInput},{prefix:p(()=>[a(S,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`,`onInput`]),e(`div`,Qe,[a(T,{modelValue:u.namespaceFilter,"onUpdate:modelValue":h[1]||=e=>u.namespaceFilter=e,class:`directory-select`,placeholder:u.$t(`skill.directory.allPublishers`),clearable:``,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[(v(!0),s(c,null,g(u.namespaceOptions,e=>(v(),f(w,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),a(T,{modelValue:u.sortBy,"onUpdate:modelValue":h[2]||=e=>u.sortBy=e,class:`directory-select directory-select-sm`,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[a(w,{label:u.$t(`skill.directory.sort.popular`),value:`popular`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.recent`),value:`recent`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.name`),value:`name`},null,8,[`label`])]),_:1},8,[`modelValue`,`onChange`])])]),d((v(),s(`div`,$e,[!u.loading&&u.total===0?(v(),s(`p`,et,i(u.$t(`skill.directory.empty`)),1)):(v(),s(`div`,tt,[(v(!0),s(c,null,g(u.items,c=>(v(),s(`article`,{key:c.id,class:n([`directory-card`,{"is-installed":c.installed}]),onClick:e=>u.openDetail(c)},[e(`div`,rt,[e(`span`,it,`/`+i(c.slug),1),c.installed?(v(),s(`span`,{key:0,class:`directory-card-action is-installed`,title:u.$t(`skill.directory.installed`)},[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})],8,at)):c.installable&&!u.canInstallOnSurface(c)?(v(),s(`span`,{key:1,class:`directory-card-locked`,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(c)})},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ot)):c.installable?(v(),s(`button`,{key:2,class:`directory-card-action`,"aria-label":u.$t(`skill.directory.install`),title:u.$t(`skill.directory.install`),onClick:t(e=>u.onInstall(c),[`stop`])},[a(O,{size:16,"aria-hidden":`true`,focusable:`false`})],8,st)):(v(),s(`span`,{key:3,class:`directory-card-locked`,title:c.license},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ct))]),e(`div`,lt,[e(`span`,ut,i(c.publisher),1),c.install_count>0?(v(),s(`span`,dt,[a(k,{size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.formatCount(c.install_count)),1)])):o(``,!0),u.surfaceLabels(c)?(v(),s(`span`,{key:1,class:`directory-card-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.surfaceLabels(c)),9,ft)):o(``,!0)]),e(`p`,pt,i(c.description),1)],10,nt))),128))]))])),[[L,u.loading]]),u.total>u.pageSize?(v(),s(`footer`,mt,[a(A,{"current-page":u.currentPage,"page-size":u.pageSize,total:u.total,"pager-count":5,background:``,layout:`prev, pager, next, total`,onCurrentChange:u.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onCurrentChange`])])):o(``,!0)],64))])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`show-close`,`onOpen`])}var Et=V(Je,[[`render`,Tt],[`__scopeId`,`data-v-a9be2dc3`]]);Y.registerLanguage(`bash`,je),Y.registerLanguage(`css`,Ne),Y.registerLanguage(`go`,Ae),Y.registerLanguage(`javascript`,Ce),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`rust`,De),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`sql`,Me),Y.registerLanguage(`typescript`,ke),Y.registerLanguage(`xml`,Pe),Y.registerLanguage(`html`,Pe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),Y.registerAliases([`js`,`jsx`],{languageName:`javascript`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`rs`],{languageName:`rust`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var $=1e6;function Dt(e,t){let n=(e.split(`.`).pop()||``).toLowerCase();return n===`md`||t.startsWith(`text/markdown`)?`markdown`:n===`html`||n===`htm`||t.startsWith(`text/html`)?`html`:t.startsWith(`image/`)||[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`].includes(n)?`image`:t.startsWith(`text/`)||[`json`,`application/json`].includes(t.split(`;`)[0])?n?`code`:`text`:`binary`}function Ot(e){let t=(e.split(`.`).pop()||``).toLowerCase();return Y.getLanguage(t)?t:`plain`}var kt=y({name:`SkillFilePreview`,components:{ElButton:K,ElTooltip:w,ElTabs:S,ElTabPane:C,CodeIcon:te,CopyIcon:R,FileIcon:z,SaveIcon:He,SuccessIcon:I,ViewIcon:re,WarningIcon:fe,VueMarkdown:Le},directives:{loading:G},props:{skillId:{type:String,required:!0},path:{type:String,required:!0},editable:{type:Boolean,default:!1}},emits:[`save`],data(){return{MAX_PREVIEW_BYTES:$,loading:!1,error:``,contentType:``,size:0,textContent:``,imageUrl:``,truncated:!1,viewMode:`rendered`,dirty:!1,saving:!1,copied:!1,copiedTimer:void 0}},computed:{kind(){return this.path?Dt(this.path,this.contentType):`text`},canRender(){return this.kind===`markdown`||this.kind===`html`},hljsLang(){return`language-${Ot(this.path)}`},truncatedText(){return this.textContent}},watch:{path:{handler(){this.fetch()},immediate:!0}},beforeUnmount(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer)},methods:{humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},async fetch(){if(this.path){this.copied=!1,this.copiedTimer!==void 0&&(window.clearTimeout(this.copiedTimer),this.copiedTimer=void 0),this.loading=!0,this.error=``,this.textContent=``,this.truncated=!1,this.dirty=!1,this.imageUrl&&=(URL.revokeObjectURL(this.imageUrl),``);try{let{blob:e,contentType:t}=await Z.fetchFile(this.skillId,this.path);this.contentType=t,this.size=e.size;let n=Dt(this.path,t);if(n===`image`)this.imageUrl=URL.createObjectURL(e);else if(n!==`binary`){let t=await e.text();t.length>$&&(t=t.slice(0,$),this.truncated=!0),this.textContent=t,this.viewMode=n===`markdown`||n===`html`?`rendered`:`source`}}catch(e){let t=e,n=t?.response?.status,r=t?.response?.data?.detail||String(e);this.error=n?`(${n}) ${r}`:r}finally{this.loading=!1,this.$nextTick(()=>this.applyHighlight())}}},applyHighlight(){let e=this.$refs.codeEl;e&&this.kind===`code`&&this.viewMode!==`rendered`&&(delete e.dataset.highlighted,Y.highlightElement(e))},async onCopy(){if(this.textContent)try{await navigator.clipboard.writeText(this.textContent),this.copied=!0,this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1,this.copiedTimer=void 0},3e3),T.success(this.$t(`skill.preview.copied`))}catch{T.error(this.$t(`skill.preview.copyFailed`))}},async onSave(){this.saving=!0;try{await new Promise((e,t)=>{this.$emit(`save`,this.textContent,{resolve:e,reject:t})}),this.dirty=!1}catch{}finally{this.saving=!1}}}}),At={class:`preview-root`},jt={class:`toolbar`},Mt={class:`path-display`},Nt={key:0,class:`size-display`},Pt={class:`body`},Ft={key:0,class:`error`},It=[`srcdoc`],Lt={key:3,class:`image-pane`},Rt=[`src`,`alt`],zt={key:4,class:`binary`},Bt=[`placeholder`],Vt={key:6,class:`source-pane`},Ht={key:7,class:`truncated-warning`};function Ut(t,c,h,g,_,y){let b=l(`save-icon`),x=l(`el-button`),S=l(`success-icon`),C=l(`copy-icon`),w=l(`el-tooltip`),T=l(`view-icon`),E=l(`el-tab-pane`),D=l(`code-icon`),O=l(`el-tabs`),k=l(`warning-icon`),A=l(`vue-markdown`),j=l(`file-icon`),M=m(`loading`);return d((v(),s(`div`,At,[e(`div`,jt,[e(`span`,Mt,i(t.path||`—`),1),t.size?(v(),s(`span`,Nt,i(t.humanSize(t.size)),1)):o(``,!0),c[3]||=e(`span`,{class:`toolbar-spacer`},null,-1),t.editable?(v(),f(x,{key:1,type:`primary`,size:`small`,disabled:!t.dirty||t.saving,loading:t.saving,onClick:t.onSave},{default:p(()=>[a(b,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.save`)),1)]),_:1},8,[`disabled`,`loading`,`onClick`])):o(``,!0),a(w,{visible:t.copied,content:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),placement:`top-start`},{default:p(()=>[a(x,{size:`small`,circle:``,disabled:!t.textContent,"aria-label":t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),title:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),onClick:t.onCopy},{default:p(()=>[t.copied?(v(),f(S,{key:0,size:16,"aria-hidden":`true`,focusable:`false`})):(v(),f(C,{key:1,size:16,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`visible`,`content`])]),t.canRender?(v(),f(O,{key:0,modelValue:t.viewMode,"onUpdate:modelValue":c[0]||=e=>t.viewMode=e,class:`view-tabs`},{default:p(()=>[a(E,{name:`rendered`},{label:p(()=>[a(T,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewRendered`)),1)]),_:1}),a(E,{name:`source`},{label:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewSource`)),1)]),_:1})]),_:1},8,[`modelValue`])):o(``,!0),e(`div`,Pt,[t.error?(v(),s(`div`,Ft,[a(k,{class:`mr-2`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.error),1)])):t.kind===`markdown`&&t.viewMode===`rendered`?(v(),f(A,{key:1,class:`markdown-rendered`,source:t.textContent,sanitize:``},null,8,[`source`])):t.kind===`html`&&t.viewMode===`rendered`?(v(),s(`iframe`,{key:2,ref:`htmlFrame`,class:`html-frame`,sandbox:``,srcdoc:t.textContent},null,8,It)):t.kind===`image`?(v(),s(`div`,Lt,[e(`img`,{src:t.imageUrl,alt:t.path,class:`image-content`},null,8,Rt)])):t.kind===`binary`?(v(),s(`div`,zt,[a(j,{class:`binary-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.binary`,{type:t.contentType})),1)])):t.editable?d((v(),s(`textarea`,{key:5,"onUpdate:modelValue":c[1]||=e=>t.textContent=e,class:`source-editor`,spellcheck:`false`,placeholder:t.$t(`skill.placeholder.content`),onInput:c[2]||=e=>t.dirty=!0},null,40,Bt)),[[u,t.textContent]]):(v(),s(`pre`,Vt,[e(`code`,{ref:`codeEl`,class:n(t.hljsLang)},i(t.truncatedText),3)])),t.truncated?(v(),s(`p`,Ht,i(t.$t(`skill.preview.truncated`,{size:t.humanSize(t.MAX_PREVIEW_BYTES)})),1)):o(``,!0)])])),[[M,t.loading]])}var Wt=V(kt,[[`render`,Ut],[`__scopeId`,`data-v-872078d9`]]),Gt=new Set([`py`,`ts`,`tsx`,`js`,`jsx`,`json`,`yaml`,`yml`,`sh`,`bash`,`zsh`,`css`,`html`,`sql`,`go`,`rs`,`rb`,`java`,`cpp`,`c`,`h`,`toml`]),Kt=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function qt(e){let t=e.split(`/`).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();return t===`SKILL.md`?N:n===`md`?ie:Kt.has(n)?oe:Gt.has(n)?Ve:z}function Jt(e){let t=new Map;t.set(``,new Map);let n=(e,n)=>{let r=t.get(e);r||(r=new Map,t.set(e,r));let i=e?`${e}/${n}`:n,a=r.get(n);return a||(a={label:n,path:i,isLeaf:!1,children:[]},r.set(n,a),t.set(i,new Map)),a};for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length===0)continue;let i=e[e.length-1],a=e.slice(0,-1),o=``;for(let e of a)o=n(o,e).path;let s={label:i,path:r,isLeaf:!0},c=t.get(o);c||(c=new Map,t.set(o,c)),c.set(i,s)}let r=e=>{let n=t.get(e);if(!n)return[];let i=Array.from(n.values());for(let e of i)e.isLeaf||(e.children=r(e.path));return i.sort((e,t)=>e.path===`SKILL.md`?-1:t.path===`SKILL.md`?1:e.isLeaf===t.isLeaf?e.label.localeCompare(t.label):e.isLeaf?1:-1)};return r(``)}var Yt=y({name:`FileNode`,components:{ExpandDownIcon:P,ExpandRightIcon:F,FontAwesomeIcon:Ie},props:{node:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},skill:{type:Object,required:!0},depth:{type:Number,default:1}},emits:[`select-file`],data(){return{open:!0}},computed:{indent(){return 8+this.depth*16},isActive(){return this.node.isLeaf&&this.selectedSkillId===this.skill.id&&this.selectedPath===this.node.path}},methods:{isHtmlFile(e){return e.isLeaf&&e.path.toLowerCase().endsWith(`.html`)},iconFor(e){return e.isLeaf?qt(e.path):ae},onClick(){this.node.isLeaf?this.$emit(`select-file`,this.node.path):this.open=!this.open}}}),Xt=[`aria-label`,`title`],Zt={key:1,class:`node-chevron-spacer`},Qt={class:`node-label`},$t={key:0,class:`children`};function en(r,a,u,d,p,m){let y=l(`expand-down-icon`),b=l(`expand-right-icon`),x=l(`font-awesome-icon`),S=l(`file-node`,!0);return v(),s(`li`,null,[e(`div`,{class:n([`file-node`,{active:r.isActive}]),style:h({paddingLeft:r.indent+`px`}),onClick:a[1]||=(...e)=>r.onClick&&r.onClick(...e)},[r.node.isLeaf?(v(),s(`span`,Zt)):(v(),s(`button`,{key:0,class:`node-chevron`,"aria-label":r.$t(r.open?`common.button.collapse`:`common.button.expand`),title:r.$t(r.open?`common.button.collapse`:`common.button.expand`),onClick:a[0]||=t(e=>r.open=!r.open,[`stop`])},[r.open?(v(),f(y,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(b,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,Xt)),r.isHtmlFile(r.node)?(v(),f(x,{key:2,icon:`fa-brands fa-html5`,class:`node-icon`})):(v(),f(_(r.iconFor(r.node)),{key:3,class:`node-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Qt,i(r.node.label),1)],6),!r.node.isLeaf&&r.open?(v(),s(`ul`,$t,[(v(!0),s(c,null,g(r.node.children||[],e=>(v(),f(S,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:r.depth+1,onSelectFile:a[2]||=e=>r.$emit(`select-file`,e)},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`depth`]))),128))])):o(``,!0)])}var tn=y({name:`SkillRow`,components:{ExpandDownIcon:P,ExpandRightIcon:F,SkillIcon:ce,FileNode:V(Yt,[[`render`,en],[`__scopeId`,`data-v-5240087b`]])},props:{skill:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},expanded:{type:Boolean,default:!1}},emits:[`toggle-expand`,`select-skill`,`select-file`],computed:{tree(){return Jt(this.skill.asset_bundle_files)},hasChildren(){return this.skill.asset_bundle_files.length>1},isSkillSelected(){return this.selectedSkillId===this.skill.id&&!this.selectedPath}},methods:{onSelectFile(e){this.$emit(`select-file`,this.skill,e)}}}),nn={class:`skill-row-wrapper`},rn=[`aria-label`,`title`],an={key:1,class:`row-chevron-spacer`},on=[`title`],sn={key:0,class:`file-list`};function cn(r,u,d,p,m,h){let _=l(`expand-down-icon`),y=l(`expand-right-icon`),b=l(`skill-icon`),x=l(`file-node`);return v(),s(`li`,nn,[e(`div`,{class:n([`skill-row`,{active:r.isSkillSelected}]),onClick:u[1]||=e=>r.$emit(`select-skill`,r.skill)},[r.hasChildren?(v(),s(`button`,{key:0,class:`row-chevron`,"aria-label":r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),title:r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),onClick:u[0]||=t(e=>r.$emit(`toggle-expand`,r.skill),[`stop`])},[r.expanded?(v(),f(_,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(y,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,rn)):(v(),s(`span`,an)),a(b,{class:`row-icon`,size:16,"aria-hidden":`true`,focusable:`false`}),e(`span`,{class:`row-label`,title:r.skill.name},i(r.skill.slug),9,on)],2),r.expanded&&r.hasChildren?(v(),s(`ul`,sn,[(v(!0),s(c,null,g(r.tree,e=>(v(),f(x,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:1,onSelectFile:r.onSelectFile},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`onSelectFile`]))),128))])):o(``,!0)])}var ln=V(tn,[[`render`,cn],[`__scopeId`,`data-v-231c2ce1`]]),un=10*1024*1024,dn=/\.(tar\.gz|tgz|tar|zip|md)$/i,fn=y({name:`UploadSkillDialog`,components:{ElDialog:H,ElButton:K,AddFileIcon:Ue,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{file:null,isDragging:!1,uploading:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.uploading||this.$emit(`update:modelValue`,!1)},reset(){this.file=null,this.isDragging=!1;let e=this.$refs.fileInput;e&&(e.value=``)},humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},onPickFile(){this.uploading||this.$refs.fileInput?.click()},onFilePicked(e){let t=e.target.files?.[0]||null;this.acceptFile(t)},onDrop(e){this.isDragging=!1;let t=e.dataTransfer?.files?.[0]||null;this.acceptFile(t)},acceptFile(e){if(!e){this.file=null;return}if(e.size>un){T.error(this.$t(`skill.message.fileTooLarge`));return}if(!dn.test(e.name)){T.error(this.$t(`skill.message.fileTypeWrong`));return}this.file=e},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.file){this.uploading=!0;try{if(/\.md$/i.test(this.file.name)){let e=await this.file.text(),{data:t}=await Z.createMarkdown({content:e});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,t.id)}else{let{data:e}=await Z.createTarball(this.file);T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id)}this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.uploading=!1}}}}}),pn={key:0,class:`dropzone-hint`},mn={key:1,class:`dropzone-file`},hn={class:`dropzone-file-name`},gn={class:`dropzone-file-size`},_n={class:`requirements`},vn={class:`requirements-title`};function yn(o,c,u,d,m,h){let g=l(`add-file-icon`),_=l(`el-button`),y=l(`cloud-upload-icon`),b=l(`el-dialog`);return v(),f(b,{"model-value":o.modelValue,title:o.$t(`skill.dialog.uploadTitle`),width:`min(520px, 94vw)`,"align-center":``,"close-on-click-modal":!o.uploading,"close-on-press-escape":!o.uploading,"show-close":!o.uploading,"onUpdate:modelValue":o.onVisibleChange,onClosed:o.reset},{footer:p(()=>[a(_,{disabled:o.uploading,onClick:o.onClose},{default:p(()=>[r(i(o.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(_,{type:`primary`,loading:o.uploading,disabled:!o.file,onClick:o.onSubmit},{default:p(()=>[a(y,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`input`,{ref:`fileInput`,type:`file`,accept:`.tar.gz,.tgz,.tar,.zip,.md,application/gzip,application/zip,application/x-tar,text/markdown`,hidden:``,onChange:c[0]||=(...e)=>o.onFilePicked&&o.onFilePicked(...e)},null,544),e(`div`,{class:n([`dropzone`,{"is-dragging":o.isDragging,"has-file":!!o.file}]),onClick:c[1]||=(...e)=>o.onPickFile&&o.onPickFile(...e),onDragover:c[2]||=t(e=>o.isDragging=!0,[`prevent`]),onDragleave:c[3]||=t(e=>o.isDragging=!1,[`prevent`]),onDrop:c[4]||=t((...e)=>o.onDrop&&o.onDrop(...e),[`prevent`])},[a(g,{class:`dropzone-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),o.file?(v(),s(`p`,mn,[e(`span`,hn,i(o.file.name),1),e(`span`,gn,i(o.humanSize(o.file.size)),1)])):(v(),s(`p`,pn,i(o.$t(`skill.dialog.uploadDrop`)),1))],34),e(`div`,_n,[e(`p`,vn,i(o.$t(`skill.dialog.fileRequirements`)),1),e(`ul`,null,[e(`li`,null,i(o.$t(`skill.dialog.requirementMd`)),1),e(`li`,null,i(o.$t(`skill.dialog.requirementArchive`)),1)])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var bn=V(fn,[[`render`,yn],[`__scopeId`,`data-v-a38152b9`]]),xn=y({name:`WriteSkillDialog`,components:{ElDialog:H,ElButton:K,ElInput:q,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{content:``,saving:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.saving||this.$emit(`update:modelValue`,!1)},reset(){this.content=``},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.content.trim()){this.saving=!0;try{let{data:e}=await Z.createMarkdown({content:this.content});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id),this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.saving=!1}}}}}),Sn={class:`hint`};function Cn(t,n,o,s,c,u){let d=l(`el-input`),m=l(`el-button`),h=l(`cloud-upload-icon`),g=l(`el-dialog`);return v(),f(g,{"model-value":t.modelValue,title:t.$t(`skill.dialog.writeTitle`),width:`min(720px, 94vw)`,"align-center":``,"close-on-click-modal":!t.saving,"close-on-press-escape":!t.saving,"show-close":!t.saving,"onUpdate:modelValue":t.onVisibleChange,onClosed:t.reset},{footer:p(()=>[a(m,{disabled:t.saving,onClick:t.onClose},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(m,{type:`primary`,loading:t.saving,disabled:!t.content.trim(),onClick:t.onSubmit},{default:p(()=>[a(h,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`p`,Sn,i(t.$t(`skill.dialog.writeHint`)),1),a(d,{modelValue:t.content,"onUpdate:modelValue":n[0]||=e=>t.content=e,type:`textarea`,rows:18,placeholder:t.$t(`skill.placeholder.content`),spellcheck:`false`,class:`editor`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var wn=y({name:`UserSkills`,components:{ConsolePageHeader:Re,ElInput:q,ElSwitch:A,ElTag:Se,ElTooltip:w,ElDropdown:O,ElDropdownMenu:D,ElDropdownItem:E,AddIcon:B,AiCreateIcon:me,DeleteIcon:de,ExpandDownIcon:P,ExpandRightIcon:F,HelpIcon:L,MarketplaceIcon:le,MoreIcon:ne,SearchIcon:ue,SkillIcon:ce,UploadIcon:pe,WriteIcon:ee,BrowseSkillsDialog:Et,SkillFilePreview:Wt,SkillRow:ln,UploadSkillDialog:bn,WriteSkillDialog:V(xn,[[`render`,Cn],[`__scopeId`,`data-v-1946d5b3`]])},directives:{loading:G},data(){return{loading:!1,skills:[],togglingId:null,selectedSkillId:``,selectedPath:``,expandedSkillIds:[],personalOpen:!0,globalsOpen:!0,searchQuery:``,uploadVisible:!1,writeVisible:!1,browseVisible:!1}},computed:{personalSkills(){return this.skills.filter(e=>e.source!==`global`)},globalSkills(){return this.skills.filter(e=>e.source===`global`)},filteredPersonal(){return this.applyFilter(this.personalSkills)},filteredGlobal(){return this.applyFilter(this.globalSkills)},selectedSkill(){return this.skills.find(e=>e.id===this.selectedSkillId)||null}},mounted(){this.fetchSkills()},methods:{applyFilter(e){let t=this.searchQuery.trim().toLowerCase();return t?e.filter(e=>e.slug.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):e},async fetchSkills(){this.loading=!0;try{let{data:e}=await Z.list();if(this.skills=e||[],!this.selectedSkillId&&this.skills.length){let e=this.personalSkills[0]||this.skills[0];this.selectedSkillId=e.id}else this.selectedSkillId&&!this.skills.find(e=>e.id===this.selectedSkillId)&&(this.selectedSkillId=``,this.selectedPath=``)}catch(e){console.error(e),T.error(this.$t(`skill.message.loadFailed`))}finally{this.loading=!1}},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},selectSkill(e){this.selectedSkillId=e.id,this.selectedPath=``},selectFile(e,t){this.selectedSkillId=e.id,this.selectedPath=t},toggleExpand(e){let t=this.expandedSkillIds.indexOf(e.id);t>=0?this.expandedSkillIds.splice(t,1):this.expandedSkillIds.push(e.id)},openUpload(){this.uploadVisible=!0},openWrite(){this.writeVisible=!0},onBrowse(){this.browseVisible=!0},async onCreated(e){await this.fetchSkills();let t=this.skills.find(t=>t.id===e);t&&(this.selectedSkillId=t.id,this.selectedPath=``,this.personalOpen=!0)},async onSaveContent(e,t){if(!this.selectedSkill){t.reject();return}try{let{data:n}=await Z.update(this.selectedSkill.id,{content:e});T.success(this.$t(`skill.message.updateSuccess`));let r=this.skills.findIndex(e=>e.id===n.id);r>=0&&this.skills.splice(r,1,n),t.resolve()}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)})),t.reject(e)}},async onDelete(e){try{await be.confirm(this.$t(`skill.message.deleteConfirm`,{slug:e.slug}),this.$t(`common.button.delete`),{type:`warning`})}catch{return}try{await Z.remove(e.id),T.success(this.$t(`skill.message.deleteSuccess`)),this.selectedSkillId===e.id&&(this.selectedSkillId=``,this.selectedPath=``),await this.fetchSkills()}catch(e){T.error(this.extractError(e))}},async onToggleSkill(e,t){this.togglingId=e.id;try{t?(await Z.enable(e.id),T.success(this.$t(`skill.message.enableSuccess`))):(await Z.disable(e.id),T.success(this.$t(`skill.message.disableSuccess`))),e.enabled=t}catch(e){T.error(this.extractError(e))}finally{this.togglingId=null}}}}),Tn={class:`skills-page`},En={class:`skills-shell`},Dn={class:`left-pane`},On={class:`left-header`},kn=[`aria-label`,`title`],An={class:`submenu-trigger`},jn={class:`badge-soon`},Mn={class:`left-body`},Nn={class:`section`},Pn={key:0,class:`skill-list`},Fn={key:0,class:`empty-row`},In={key:0,class:`section`},Ln={key:0,class:`skill-list`},Rn={class:`right-pane`},zn={class:`right-header`},Bn={class:`right-title`},Vn={class:`right-actions`},Hn=[`aria-label`,`title`],Un={class:`meta-card`},Wn={class:`meta-grid`},Gn={class:`meta-cell`},Kn={class:`meta-label`},qn={class:`meta-value`},Jn={class:`meta-cell`},Yn={class:`meta-label`},Xn={class:`meta-value`},Zn={key:0,class:`meta-cell`},Qn={class:`meta-label`},$n={class:`meta-tags`},er={key:0,class:`meta-description`},tr={class:`meta-description-label`},nr={class:`meta-label`},rr={class:`preview-card`},ir={key:2,class:`right-empty`};function ar(t,n,u,h,_,y){let b=l(`console-page-header`),x=l(`search-icon`),S=l(`el-input`),C=l(`add-icon`),w=l(`marketplace-icon`),T=l(`el-dropdown-item`),E=l(`expand-right-icon`),D=l(`ai-create-icon`),O=l(`write-icon`),k=l(`upload-icon`),A=l(`el-dropdown-menu`),j=l(`el-dropdown`),M=l(`expand-down-icon`),N=l(`skill-row`),P=l(`el-switch`),F=l(`more-icon`),I=l(`delete-icon`),L=l(`el-tag`),ee=l(`help-icon`),te=l(`el-tooltip`),R=l(`skill-file-preview`),ne=l(`skill-icon`),re=l(`upload-skill-dialog`),ie=l(`write-skill-dialog`),z=l(`browse-skills-dialog`),ae=m(`loading`);return v(),s(`div`,Tn,[a(b,{title:t.$t(`skill.title.skills`),subtitle:t.$t(`skill.message.pageDescription`)},null,8,[`title`,`subtitle`]),e(`div`,En,[e(`aside`,Dn,[e(`header`,On,[a(S,{modelValue:t.searchQuery,"onUpdate:modelValue":n[0]||=e=>t.searchQuery=e,class:`search-input`,size:`default`,clearable:``,placeholder:t.$t(`skill.placeholder.search`)},{prefix:p(()=>[a(x,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`]),a(j,{trigger:`click`,placement:`bottom-end`,"hide-on-click":!1},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{onClick:t.onBrowse},{default:p(()=>[a(w,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.browse`)),1)]),_:1},8,[`onClick`]),a(T,{divided:``},{default:p(()=>[a(j,{trigger:`hover`,placement:`left-start`,"hide-on-click":!0},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{disabled:``},{default:p(()=>[a(D,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.createWithClaude`))+` `,1),e(`span`,jn,i(t.$t(`skill.menu.soon`)),1)]),_:1}),a(T,{onClick:t.openWrite},{default:p(()=>[a(O,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.write`)),1)]),_:1},8,[`onClick`]),a(T,{onClick:t.openUpload},{default:p(()=>[a(k,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.upload`)),1)]),_:1},8,[`onClick`])]),_:1})]),default:p(()=>[e(`span`,An,[a(C,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.create`))+` `,1),a(E,{class:`submenu-arrow`,size:14,"aria-hidden":`true`,focusable:`false`})])]),_:1})]),_:1})]),_:1})]),default:p(()=>[e(`button`,{type:`button`,class:`add-button`,"aria-label":t.$t(`skill.button.add`),title:t.$t(`skill.button.add`)},[a(C,{size:16,"aria-hidden":`true`,focusable:`false`})],8,kn)]),_:1})]),d((v(),s(`div`,Mn,[e(`section`,Nn,[e(`button`,{class:`section-header`,onClick:n[1]||=e=>t.personalOpen=!t.personalOpen},[t.personalOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.personal`)),1)]),t.personalOpen?(v(),s(`ul`,Pn,[!t.loading&&t.filteredPersonal.length===0?(v(),s(`li`,Fn,i(t.searchQuery?t.$t(`skill.empty.search`):t.$t(`skill.message.noSkills`)),1)):o(``,!0),(v(!0),s(c,null,g(t.filteredPersonal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)]),t.globalSkills.length>0?(v(),s(`section`,In,[e(`button`,{class:`section-header`,onClick:n[2]||=e=>t.globalsOpen=!t.globalsOpen},[t.globalsOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.platform`)),1)]),t.globalsOpen?(v(),s(`ul`,Ln,[(v(!0),s(c,null,g(t.filteredGlobal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)])):o(``,!0)])),[[ae,t.loading]])]),e(`main`,Rn,[t.selectedSkill&&!t.selectedPath?(v(),s(c,{key:0},[e(`header`,zn,[e(`h3`,Bn,i(t.selectedSkill.slug),1),e(`div`,Vn,[a(P,{"model-value":t.selectedSkill.enabled,size:`default`,loading:t.togglingId===t.selectedSkill.id,onChange:n[3]||=e=>t.onToggleSkill(t.selectedSkill,!!e)},null,8,[`model-value`,`loading`]),t.selectedSkill.source===`global`?o(``,!0):(v(),f(j,{key:0,trigger:`click`,placement:`bottom-end`},{dropdown:p(()=>[a(A,null,{default:p(()=>[a(T,{onClick:n[4]||=e=>t.onDelete(t.selectedSkill)},{default:p(()=>[a(I,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.delete`)),1)]),_:1})]),_:1})]),default:p(()=>[e(`button`,{class:`icon-btn`,"aria-label":t.$t(`skill.button.more`),title:t.$t(`skill.button.more`)},[a(F,{size:16,"aria-hidden":`true`,focusable:`false`})],8,Hn)]),_:1}))])]),e(`div`,Un,[e(`div`,Wn,[e(`div`,Gn,[e(`span`,Kn,i(t.$t(`skill.meta.addedBy`)),1),e(`span`,qn,i(t.selectedSkill.source===`global`?t.$t(`skill.meta.platform`):t.$t(`skill.meta.you`)),1)]),e(`div`,Jn,[e(`span`,Yn,i(t.$t(`skill.meta.lastUpdated`)),1),e(`span`,Xn,i(t.$dayjs.format(t.selectedSkill.updated_at)),1)]),t.selectedSkill.required_connections.length?(v(),s(`div`,Zn,[e(`span`,Qn,i(t.$t(`skill.field.requiredConnections`)),1),e(`div`,$n,[(v(!0),s(c,null,g(t.selectedSkill.required_connections,e=>(v(),f(L,{key:e,size:`small`,type:`info`},{default:p(()=>[r(i(e),1)]),_:2},1024))),128))])])):o(``,!0)]),t.selectedSkill.description?(v(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`skill.field.description`)),1),t.selectedSkill.when_to_use?(v(),f(te,{key:0,content:t.selectedSkill.when_to_use,placement:`top`},{default:p(()=>[a(ee,{class:`meta-info-icon`,size:12,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])):o(``,!0)]),e(`p`,null,i(t.selectedSkill.description),1)])):o(``,!0)]),e(`div`,rr,[(v(),f(R,{key:`${t.selectedSkill.id}:SKILL.md`,"skill-id":t.selectedSkill.id,path:`SKILL.md`,editable:t.selectedSkill.source===`upload`,onSave:t.onSaveContent},null,8,[`skill-id`,`editable`,`onSave`]))])],64)):t.selectedSkill&&t.selectedPath?(v(),f(R,{key:`${t.selectedSkill.id}:${t.selectedPath}`,"skill-id":t.selectedSkill.id,path:t.selectedPath,editable:!1},null,8,[`skill-id`,`path`])):(v(),s(`div`,ir,[a(ne,{class:`right-empty-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.selectSkill`)),1)]))])]),a(re,{modelValue:t.uploadVisible,"onUpdate:modelValue":n[5]||=e=>t.uploadVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(ie,{modelValue:t.writeVisible,"onUpdate:modelValue":n[6]||=e=>t.writeVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(z,{modelValue:t.browseVisible,"onUpdate:modelValue":n[7]||=e=>t.browseVisible=e,onInstalled:t.onCreated},null,8,[`modelValue`,`onInstalled`])])}var or=V(wn,[[`render`,ar],[`__scopeId`,`data-v-6d629e8e`]]);export{or 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,b as u,ht as d,j as f,mt as p,ot as m,qt as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-8-kd2VyH.js";import{n as S,t as C}from"./tabs-De_8qign.js";import{t as w}from"./tooltip-CHqcylXx.js";import{v as T}from"./models-CPAfAKlf.js";import{n as E,r as D,t as O}from"./dropdown-By0tJCCL.js";import{t as k}from"./pagination-B-S7rzCK.js";import{t as A}from"./switch-DiUDO8o3.js";import{t as j}from"./arrow-down-DX92ny1X.js";import{t as M}from"./arrow-left-CkyHsHow.js";import{t as N}from"./book-open-C_ueiu-7.js";import{t as P}from"./chevron-down-DtfhJUg5.js";import{t as F}from"./chevron-right-BpEpvbRz.js";import{t as I}from"./circle-check-Dl-uxCgL.js";import{t as L}from"./circle-question-mark-XsPVljRO.js";import{t as ee}from"./clipboard-list-GBfGExfY.js";import{t as te}from"./code-CszxkgkT.js";import{t as R}from"./copy-C3ih32SC.js";import{t as ne}from"./ellipsis-BSF63Pr6.js";import{t as re}from"./eye-Cke5Dz5k.js";import{t as ie}from"./file-text-Dqz0sa4Y.js";import{t as z}from"./file-CHmDlQOR.js";import{t as ae}from"./folder-wEyyZNA3.js";import{t as oe}from"./image-BEMUVXib.js";import{t as se}from"./lock-BPWoQQI4.js";import{t as B}from"./plus-rcng4d2o.js";import{n as ce,t as le}from"./store-CUjMtA69.js";import{t as ue}from"./search-CGU6CV7g.js";import{t as de}from"./trash-2-TOSJlrQC.js";import{t as fe}from"./triangle-alert-uTVBcsrd.js";import{t as pe}from"./upload-BMfV8Ire.js";import{t as me}from"./wand-sparkles-CjbeD1Xg.js";import{D as he,N as ge,O as _e,k as ve,w as ye}from"./i18n-9CWVvd05.js";import{A as V,Ha as H,Ia as U,Ji as W,La as be,Ma as xe,Ra as G,Ya as Se,Za as K,ao as q,qi as J}from"./index-Cxnu8Cai.js";import{a as Ce,c as we,d as Te,f as Ee,i as De,l as Oe,m as Y,n as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe}from"./vendor-highlight-BHrfT4-E.js";import{t as Ie}from"./index.es-UN1oLyXR.js";import{t as Le}from"./VueMarkdown-CiiRjbWs.js";import{t as Re}from"./PageHeader-BzGclVTM.js";var ze=U(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Be=U(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Ve=U(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),He=U(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ue=U(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),X=()=>({baseURL:`${xe()}/api/v1`}),Z=new class{key=`skills/installed`;async list(){return J.get(`/${this.key}/`,X())}async get(e){return J.get(`/${this.key}/${e}/`,X())}async createMarkdown(e){return J.post(`/${this.key}/`,e,X())}async createTarball(e){let t=new FormData;return t.append(`tarball`,e),J.post(`/${this.key}/`,t,{...X(),headers:{"Content-Type":`multipart/form-data`}})}async update(e,t){return J.patch(`/${this.key}/${e}/`,t,X())}async remove(e){return J.delete(`/${this.key}/${e}/`,X())}async enable(e){return J.post(`/${this.key}/${e}/enable/`,void 0,X())}async disable(e){return J.post(`/${this.key}/${e}/disable/`,void 0,X())}async fetchFile(e,t){let n=await J.get(`/${this.key}/${e}/files/`,{...X(),params:{path:t},responseType:`arraybuffer`}),r=n.headers[`content-type`]||`application/octet-stream`;return{blob:new Blob([n.data],{type:r}),contentType:r}}},Q=new class{key=`skills`;async list(e={}){return W.get(`/${this.key}/`,{...X(),params:e})}async get(e){return W.get(`/${this.key}/${e}/`,X())}async categories(){return W.get(`/${this.key}/categories/`,X())}async install(e,t={}){return J.post(`/${this.key}/${e}/install/`,t,X())}};function We(){let e=new Set;_e()&&e.add(`desktop`),ve()&&e.add(`ios`),he()&&e.add(`android`),ge()&&e.add(`web`);let t=ye();if(t===`mac`)e.add(`mac`);else if(t===`windows`)e.add(`windows`);else if(typeof navigator<`u`){let t=navigator.userAgent||``,n=navigator.userAgentData?.platform,r=/macintosh/i.test(t)&&(navigator.maxTouchPoints||0)>1;!ve()&&!r&&(n===`macOS`||/mac os x|macintosh/i.test(t))&&e.add(`mac`),(n===`Windows`||/windows nt/i.test(t))&&e.add(`windows`)}return e}var Ge=new Set([`mac`,`windows`,`desktop`,`web`,`ios`,`android`]);function Ke(e){let t=e.filter(e=>Ge.has(e));if(!t.length)return!0;let n=We();return t.some(e=>n.has(e))}Y.registerLanguage(`bash`,je),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var qe=12,Je=y({name:`BrowseSkillsDialog`,components:{VueMarkdown:Le,ElDialog:H,ElInput:q,ElButton:K,ElPagination:k,ElSelect:b,ElOption:x,FontAwesomeIcon:Ie,AddIcon:B,BackIcon:M,DownIcon:j,InstallIcon:ze,LockIcon:se,SearchIcon:ue,SuccessIcon:I},directives:{loading:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`installed`],data(){return{loading:!1,installing:!1,items:[],total:0,currentPage:1,searchQuery:``,namespaceFilter:``,sortBy:`popular`,selectedItem:null,searchTimer:null,knownNamespaces:[],publisherByNamespace:{}}},computed:{pageSize(){return qe},namespaceOptions(){let e=new Set(this.knownNamespaces);for(let t of this.items)e.add(t.namespace);return Array.from(e).sort().map(e=>({value:e,label:this.publisherForNamespace(e)}))},detailBody(){return this.selectedItem?this.selectedItem.content.replace(/^---\n[\s\S]*?\n---\n?/,``):``}},methods:{onOpen(){this.selectedItem=null,this.searchQuery=``,this.namespaceFilter=``,this.sortBy=`popular`,this.currentPage=1,this.knownNamespaces=[],this.publisherByNamespace={},this.loadFacets(),this.reload()},openDetail(e){this.selectedItem=e},async loadFacets(){try{let{data:e}=await Q.categories(),t=new Set;for(let n of e.namespaces)t.add(n.namespace);this.knownNamespaces=Array.from(t).sort()}catch(e){console.warn(`failed to load skill catalog facets`,e)}},reloadFromFirstPage(){this.currentPage=1,this.reload()},onPageChange(e){this.currentPage=e,this.reload(),this.$nextTick(()=>{let e=this.$el.querySelector(`.directory-grid-wrapper`);e&&(e.scrollTop=0)})},onSearchInput(){this.searchTimer!==null&&window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.reloadFromFirstPage()},250)},async reload(){this.loading=!0;try{let{data:e}=await Q.list({q:this.searchQuery.trim()||void 0,namespace:this.namespaceFilter||void 0,sort:this.sortBy,limit:this.pageSize,offset:(this.currentPage-1)*this.pageSize});this.items=e.items,this.total=e.total;for(let t of e.items)t.publisher&&(this.publisherByNamespace[t.namespace]=t.publisher)}catch(e){console.error(e),T.error(this.$t(`skill.directory.loadFailed`))}finally{this.loading=!1}},async onInstall(e){if(!this.installing&&!e.installed){if(!this.canInstallOnSurface(e)){T.warning(this.$t(`skill.directory.surfaceBlocked`,{platforms:this.surfaceLabels(e)}));return}this.installing=!0;try{let{data:t}=await Q.install(e.id);T.success(this.$t(`skill.directory.installSuccess`,{name:e.slug})),this.$emit(`installed`,t.id),e.installed=!0,e.install_count+=1}catch(t){let n=this.extractError(t);n.includes(`already exists`)?(e.installed=!0,T.warning(this.$t(`skill.directory.alreadyInstalled`,{name:e.slug}))):T.error(this.$t(`skill.directory.installFailed`,{detail:n}))}finally{this.installing=!1}}},extractError(e){return e?.response?.data?.detail||String(e)||`unknown error`},formatCount(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)},publisherForNamespace(e){if(this.publisherByNamespace[e])return this.publisherByNamespace[e];let t=this.items.find(t=>t.namespace===e);return t?t.publisher:e},restrictedSurfaces(e){let t=e.frontmatter?.surfaces;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim().toLowerCase()):[]},surfaceLabel(e){let t=`skill.directory.surface.${e}`,n=this.$t(t);return n===t?e:n},surfaceLabels(e){return this.restrictedSurfaces(e).map(e=>this.surfaceLabel(e)).join(` / `)},canInstallOnSurface(e){return Ke(this.restrictedSurfaces(e))}}}),Ye={class:`directory`},Xe={class:`directory-main`},Ze={class:`directory-header`},Qe={class:`directory-controls`},$e={class:`directory-grid-wrapper`},et={key:0,class:`directory-empty`},tt={key:1,class:`directory-grid`},nt=[`onClick`],rt={class:`directory-card-head`},it={class:`directory-card-title`},at=[`title`],ot=[`title`],st=[`aria-label`,`title`,`onClick`],ct=[`title`],lt={class:`directory-card-meta`},ut={class:`directory-card-publisher`},dt={key:0,class:`directory-card-count`},ft=[`title`],pt={class:`directory-card-desc`},mt={key:0,class:`directory-footer`},ht={class:`directory-detail-head`},gt={class:`directory-detail-actions`},_t=[`href`],vt={class:`directory-detail-body`},yt={class:`directory-detail-title`},bt={class:`directory-detail-meta`},xt={key:0},St={key:1},Ct=[`title`],wt={class:`directory-detail-desc`};function Tt(u,h,_,y,b,x){let S=l(`search-icon`),C=l(`el-input`),w=l(`el-option`),T=l(`el-select`),E=l(`success-icon`),D=l(`lock-icon`),O=l(`add-icon`),k=l(`down-icon`),A=l(`el-pagination`),j=l(`back-icon`),M=l(`font-awesome-icon`),N=l(`el-button`),P=l(`install-icon`),F=l(`vue-markdown`),I=l(`el-dialog`),L=m(`loading`);return v(),f(I,{"model-value":u.modelValue,title:u.$t(`skill.dialog.directoryTitle`),width:`min(960px, 94vw)`,"align-center":``,class:`directory-dialog`,"close-on-click-modal":!u.installing,"show-close":!u.installing,"onUpdate:modelValue":h[5]||=e=>u.$emit(`update:modelValue`,e),onOpen:u.onOpen},{default:p(()=>[e(`div`,Ye,[e(`main`,Xe,[u.selectedItem?(v(),s(c,{key:1},[e(`header`,ht,[e(`button`,{class:`directory-back-btn`,onClick:h[3]||=e=>u.selectedItem=null},[a(j,{size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.back`)),1)]),e(`div`,gt,[u.selectedItem.source_url?(v(),s(`a`,{key:0,href:u.selectedItem.source_url,target:`_blank`,class:`directory-link`},[a(M,{icon:`fa-brands fa-github`}),r(` `+i(u.$t(`skill.directory.viewSource`)),1)],8,_t)):o(``,!0),u.selectedItem.installed?(v(),f(N,{key:1,disabled:``,type:`success`,plain:``},{default:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.installed`)),1)]),_:1})):u.selectedItem.installable&&!u.canInstallOnSurface(u.selectedItem)?(v(),f(N,{key:2,disabled:``,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(u.selectedItem)})},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.surfaceUnavailable`)),1)]),_:1},8,[`title`])):u.selectedItem.installable?(v(),f(N,{key:3,type:`primary`,loading:u.installing,onClick:h[4]||=e=>u.onInstall(u.selectedItem)},{default:p(()=>[a(P,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.install`)),1)]),_:1},8,[`loading`])):(v(),f(N,{key:4,disabled:``,title:u.selectedItem.license},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.selectedItem.license||u.$t(`skill.directory.notInstallable`)),1)]),_:1},8,[`title`]))])]),e(`div`,vt,[e(`h2`,yt,`/`+i(u.selectedItem.slug),1),e(`div`,bt,[e(`span`,null,[e(`strong`,null,i(u.$t(`skill.meta.addedBy`))+`:`,1),r(` `+i(u.selectedItem.publisher),1)]),u.selectedItem.license?(v(),s(`span`,xt,[e(`strong`,null,i(u.$t(`skill.directory.license`))+`:`,1),r(` `+i(u.selectedItem.license),1)])):o(``,!0),u.selectedItem.version?(v(),s(`span`,St,`v`+i(u.selectedItem.version),1)):o(``,!0),u.surfaceLabels(u.selectedItem)?(v(),s(`span`,{key:2,class:`directory-detail-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.$t(`skill.directory.surfaceOnly`,{platforms:u.surfaceLabels(u.selectedItem)})),9,Ct)):o(``,!0)]),e(`p`,wt,i(u.selectedItem.description),1),a(F,{class:`directory-detail-content`,source:u.detailBody,sanitize:``},null,8,[`source`])])],64)):(v(),s(c,{key:0},[e(`header`,Ze,[a(C,{modelValue:u.searchQuery,"onUpdate:modelValue":h[0]||=e=>u.searchQuery=e,class:`directory-search`,size:`default`,clearable:``,placeholder:u.$t(`skill.directory.searchPlaceholder`),onInput:u.onSearchInput},{prefix:p(()=>[a(S,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`,`onInput`]),e(`div`,Qe,[a(T,{modelValue:u.namespaceFilter,"onUpdate:modelValue":h[1]||=e=>u.namespaceFilter=e,class:`directory-select`,placeholder:u.$t(`skill.directory.allPublishers`),clearable:``,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[(v(!0),s(c,null,g(u.namespaceOptions,e=>(v(),f(w,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),a(T,{modelValue:u.sortBy,"onUpdate:modelValue":h[2]||=e=>u.sortBy=e,class:`directory-select directory-select-sm`,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[a(w,{label:u.$t(`skill.directory.sort.popular`),value:`popular`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.recent`),value:`recent`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.name`),value:`name`},null,8,[`label`])]),_:1},8,[`modelValue`,`onChange`])])]),d((v(),s(`div`,$e,[!u.loading&&u.total===0?(v(),s(`p`,et,i(u.$t(`skill.directory.empty`)),1)):(v(),s(`div`,tt,[(v(!0),s(c,null,g(u.items,c=>(v(),s(`article`,{key:c.id,class:n([`directory-card`,{"is-installed":c.installed}]),onClick:e=>u.openDetail(c)},[e(`div`,rt,[e(`span`,it,`/`+i(c.slug),1),c.installed?(v(),s(`span`,{key:0,class:`directory-card-action is-installed`,title:u.$t(`skill.directory.installed`)},[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})],8,at)):c.installable&&!u.canInstallOnSurface(c)?(v(),s(`span`,{key:1,class:`directory-card-locked`,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(c)})},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ot)):c.installable?(v(),s(`button`,{key:2,class:`directory-card-action`,"aria-label":u.$t(`skill.directory.install`),title:u.$t(`skill.directory.install`),onClick:t(e=>u.onInstall(c),[`stop`])},[a(O,{size:16,"aria-hidden":`true`,focusable:`false`})],8,st)):(v(),s(`span`,{key:3,class:`directory-card-locked`,title:c.license},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ct))]),e(`div`,lt,[e(`span`,ut,i(c.publisher),1),c.install_count>0?(v(),s(`span`,dt,[a(k,{size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.formatCount(c.install_count)),1)])):o(``,!0),u.surfaceLabels(c)?(v(),s(`span`,{key:1,class:`directory-card-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.surfaceLabels(c)),9,ft)):o(``,!0)]),e(`p`,pt,i(c.description),1)],10,nt))),128))]))])),[[L,u.loading]]),u.total>u.pageSize?(v(),s(`footer`,mt,[a(A,{"current-page":u.currentPage,"page-size":u.pageSize,total:u.total,"pager-count":5,background:``,layout:`prev, pager, next, total`,onCurrentChange:u.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onCurrentChange`])])):o(``,!0)],64))])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`show-close`,`onOpen`])}var Et=V(Je,[[`render`,Tt],[`__scopeId`,`data-v-a9be2dc3`]]);Y.registerLanguage(`bash`,je),Y.registerLanguage(`css`,Ne),Y.registerLanguage(`go`,Ae),Y.registerLanguage(`javascript`,Ce),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`rust`,De),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`sql`,Me),Y.registerLanguage(`typescript`,ke),Y.registerLanguage(`xml`,Pe),Y.registerLanguage(`html`,Pe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),Y.registerAliases([`js`,`jsx`],{languageName:`javascript`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`rs`],{languageName:`rust`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var $=1e6;function Dt(e,t){let n=(e.split(`.`).pop()||``).toLowerCase();return n===`md`||t.startsWith(`text/markdown`)?`markdown`:n===`html`||n===`htm`||t.startsWith(`text/html`)?`html`:t.startsWith(`image/`)||[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`].includes(n)?`image`:t.startsWith(`text/`)||[`json`,`application/json`].includes(t.split(`;`)[0])?n?`code`:`text`:`binary`}function Ot(e){let t=(e.split(`.`).pop()||``).toLowerCase();return Y.getLanguage(t)?t:`plain`}var kt=y({name:`SkillFilePreview`,components:{ElButton:K,ElTooltip:w,ElTabs:S,ElTabPane:C,CodeIcon:te,CopyIcon:R,FileIcon:z,SaveIcon:He,SuccessIcon:I,ViewIcon:re,WarningIcon:fe,VueMarkdown:Le},directives:{loading:G},props:{skillId:{type:String,required:!0},path:{type:String,required:!0},editable:{type:Boolean,default:!1}},emits:[`save`],data(){return{MAX_PREVIEW_BYTES:$,loading:!1,error:``,contentType:``,size:0,textContent:``,imageUrl:``,truncated:!1,viewMode:`rendered`,dirty:!1,saving:!1,copied:!1,copiedTimer:void 0}},computed:{kind(){return this.path?Dt(this.path,this.contentType):`text`},canRender(){return this.kind===`markdown`||this.kind===`html`},hljsLang(){return`language-${Ot(this.path)}`},truncatedText(){return this.textContent}},watch:{path:{handler(){this.fetch()},immediate:!0}},beforeUnmount(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer)},methods:{humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},async fetch(){if(this.path){this.copied=!1,this.copiedTimer!==void 0&&(window.clearTimeout(this.copiedTimer),this.copiedTimer=void 0),this.loading=!0,this.error=``,this.textContent=``,this.truncated=!1,this.dirty=!1,this.imageUrl&&=(URL.revokeObjectURL(this.imageUrl),``);try{let{blob:e,contentType:t}=await Z.fetchFile(this.skillId,this.path);this.contentType=t,this.size=e.size;let n=Dt(this.path,t);if(n===`image`)this.imageUrl=URL.createObjectURL(e);else if(n!==`binary`){let t=await e.text();t.length>$&&(t=t.slice(0,$),this.truncated=!0),this.textContent=t,this.viewMode=n===`markdown`||n===`html`?`rendered`:`source`}}catch(e){let t=e,n=t?.response?.status,r=t?.response?.data?.detail||String(e);this.error=n?`(${n}) ${r}`:r}finally{this.loading=!1,this.$nextTick(()=>this.applyHighlight())}}},applyHighlight(){let e=this.$refs.codeEl;e&&this.kind===`code`&&this.viewMode!==`rendered`&&(delete e.dataset.highlighted,Y.highlightElement(e))},async onCopy(){if(this.textContent)try{await navigator.clipboard.writeText(this.textContent),this.copied=!0,this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1,this.copiedTimer=void 0},3e3),T.success(this.$t(`skill.preview.copied`))}catch{T.error(this.$t(`skill.preview.copyFailed`))}},async onSave(){this.saving=!0;try{await new Promise((e,t)=>{this.$emit(`save`,this.textContent,{resolve:e,reject:t})}),this.dirty=!1}catch{}finally{this.saving=!1}}}}),At={class:`preview-root`},jt={class:`toolbar`},Mt={class:`path-display`},Nt={key:0,class:`size-display`},Pt={class:`body`},Ft={key:0,class:`error`},It=[`srcdoc`],Lt={key:3,class:`image-pane`},Rt=[`src`,`alt`],zt={key:4,class:`binary`},Bt=[`placeholder`],Vt={key:6,class:`source-pane`},Ht={key:7,class:`truncated-warning`};function Ut(t,c,h,g,_,y){let b=l(`save-icon`),x=l(`el-button`),S=l(`success-icon`),C=l(`copy-icon`),w=l(`el-tooltip`),T=l(`view-icon`),E=l(`el-tab-pane`),D=l(`code-icon`),O=l(`el-tabs`),k=l(`warning-icon`),A=l(`vue-markdown`),j=l(`file-icon`),M=m(`loading`);return d((v(),s(`div`,At,[e(`div`,jt,[e(`span`,Mt,i(t.path||`—`),1),t.size?(v(),s(`span`,Nt,i(t.humanSize(t.size)),1)):o(``,!0),c[3]||=e(`span`,{class:`toolbar-spacer`},null,-1),t.editable?(v(),f(x,{key:1,type:`primary`,size:`small`,disabled:!t.dirty||t.saving,loading:t.saving,onClick:t.onSave},{default:p(()=>[a(b,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.save`)),1)]),_:1},8,[`disabled`,`loading`,`onClick`])):o(``,!0),a(w,{visible:t.copied,content:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),placement:`top-start`},{default:p(()=>[a(x,{size:`small`,circle:``,disabled:!t.textContent,"aria-label":t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),title:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),onClick:t.onCopy},{default:p(()=>[t.copied?(v(),f(S,{key:0,size:16,"aria-hidden":`true`,focusable:`false`})):(v(),f(C,{key:1,size:16,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`visible`,`content`])]),t.canRender?(v(),f(O,{key:0,modelValue:t.viewMode,"onUpdate:modelValue":c[0]||=e=>t.viewMode=e,class:`view-tabs`},{default:p(()=>[a(E,{name:`rendered`},{label:p(()=>[a(T,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewRendered`)),1)]),_:1}),a(E,{name:`source`},{label:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewSource`)),1)]),_:1})]),_:1},8,[`modelValue`])):o(``,!0),e(`div`,Pt,[t.error?(v(),s(`div`,Ft,[a(k,{class:`mr-2`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.error),1)])):t.kind===`markdown`&&t.viewMode===`rendered`?(v(),f(A,{key:1,class:`markdown-rendered`,source:t.textContent,sanitize:``},null,8,[`source`])):t.kind===`html`&&t.viewMode===`rendered`?(v(),s(`iframe`,{key:2,ref:`htmlFrame`,class:`html-frame`,sandbox:``,srcdoc:t.textContent},null,8,It)):t.kind===`image`?(v(),s(`div`,Lt,[e(`img`,{src:t.imageUrl,alt:t.path,class:`image-content`},null,8,Rt)])):t.kind===`binary`?(v(),s(`div`,zt,[a(j,{class:`binary-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.binary`,{type:t.contentType})),1)])):t.editable?d((v(),s(`textarea`,{key:5,"onUpdate:modelValue":c[1]||=e=>t.textContent=e,class:`source-editor`,spellcheck:`false`,placeholder:t.$t(`skill.placeholder.content`),onInput:c[2]||=e=>t.dirty=!0},null,40,Bt)),[[u,t.textContent]]):(v(),s(`pre`,Vt,[e(`code`,{ref:`codeEl`,class:n(t.hljsLang)},i(t.truncatedText),3)])),t.truncated?(v(),s(`p`,Ht,i(t.$t(`skill.preview.truncated`,{size:t.humanSize(t.MAX_PREVIEW_BYTES)})),1)):o(``,!0)])])),[[M,t.loading]])}var Wt=V(kt,[[`render`,Ut],[`__scopeId`,`data-v-872078d9`]]),Gt=new Set([`py`,`ts`,`tsx`,`js`,`jsx`,`json`,`yaml`,`yml`,`sh`,`bash`,`zsh`,`css`,`html`,`sql`,`go`,`rs`,`rb`,`java`,`cpp`,`c`,`h`,`toml`]),Kt=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function qt(e){let t=e.split(`/`).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();return t===`SKILL.md`?N:n===`md`?ie:Kt.has(n)?oe:Gt.has(n)?Ve:z}function Jt(e){let t=new Map;t.set(``,new Map);let n=(e,n)=>{let r=t.get(e);r||(r=new Map,t.set(e,r));let i=e?`${e}/${n}`:n,a=r.get(n);return a||(a={label:n,path:i,isLeaf:!1,children:[]},r.set(n,a),t.set(i,new Map)),a};for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length===0)continue;let i=e[e.length-1],a=e.slice(0,-1),o=``;for(let e of a)o=n(o,e).path;let s={label:i,path:r,isLeaf:!0},c=t.get(o);c||(c=new Map,t.set(o,c)),c.set(i,s)}let r=e=>{let n=t.get(e);if(!n)return[];let i=Array.from(n.values());for(let e of i)e.isLeaf||(e.children=r(e.path));return i.sort((e,t)=>e.path===`SKILL.md`?-1:t.path===`SKILL.md`?1:e.isLeaf===t.isLeaf?e.label.localeCompare(t.label):e.isLeaf?1:-1)};return r(``)}var Yt=y({name:`FileNode`,components:{ExpandDownIcon:P,ExpandRightIcon:F,FontAwesomeIcon:Ie},props:{node:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},skill:{type:Object,required:!0},depth:{type:Number,default:1}},emits:[`select-file`],data(){return{open:!0}},computed:{indent(){return 8+this.depth*16},isActive(){return this.node.isLeaf&&this.selectedSkillId===this.skill.id&&this.selectedPath===this.node.path}},methods:{isHtmlFile(e){return e.isLeaf&&e.path.toLowerCase().endsWith(`.html`)},iconFor(e){return e.isLeaf?qt(e.path):ae},onClick(){this.node.isLeaf?this.$emit(`select-file`,this.node.path):this.open=!this.open}}}),Xt=[`aria-label`,`title`],Zt={key:1,class:`node-chevron-spacer`},Qt={class:`node-label`},$t={key:0,class:`children`};function en(r,a,u,d,p,m){let y=l(`expand-down-icon`),b=l(`expand-right-icon`),x=l(`font-awesome-icon`),S=l(`file-node`,!0);return v(),s(`li`,null,[e(`div`,{class:n([`file-node`,{active:r.isActive}]),style:h({paddingLeft:r.indent+`px`}),onClick:a[1]||=(...e)=>r.onClick&&r.onClick(...e)},[r.node.isLeaf?(v(),s(`span`,Zt)):(v(),s(`button`,{key:0,class:`node-chevron`,"aria-label":r.$t(r.open?`common.button.collapse`:`common.button.expand`),title:r.$t(r.open?`common.button.collapse`:`common.button.expand`),onClick:a[0]||=t(e=>r.open=!r.open,[`stop`])},[r.open?(v(),f(y,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(b,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,Xt)),r.isHtmlFile(r.node)?(v(),f(x,{key:2,icon:`fa-brands fa-html5`,class:`node-icon`})):(v(),f(_(r.iconFor(r.node)),{key:3,class:`node-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Qt,i(r.node.label),1)],6),!r.node.isLeaf&&r.open?(v(),s(`ul`,$t,[(v(!0),s(c,null,g(r.node.children||[],e=>(v(),f(S,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:r.depth+1,onSelectFile:a[2]||=e=>r.$emit(`select-file`,e)},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`depth`]))),128))])):o(``,!0)])}var tn=y({name:`SkillRow`,components:{ExpandDownIcon:P,ExpandRightIcon:F,SkillIcon:ce,FileNode:V(Yt,[[`render`,en],[`__scopeId`,`data-v-5240087b`]])},props:{skill:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},expanded:{type:Boolean,default:!1}},emits:[`toggle-expand`,`select-skill`,`select-file`],computed:{tree(){return Jt(this.skill.asset_bundle_files)},hasChildren(){return this.skill.asset_bundle_files.length>1},isSkillSelected(){return this.selectedSkillId===this.skill.id&&!this.selectedPath}},methods:{onSelectFile(e){this.$emit(`select-file`,this.skill,e)}}}),nn={class:`skill-row-wrapper`},rn=[`aria-label`,`title`],an={key:1,class:`row-chevron-spacer`},on=[`title`],sn={key:0,class:`file-list`};function cn(r,u,d,p,m,h){let _=l(`expand-down-icon`),y=l(`expand-right-icon`),b=l(`skill-icon`),x=l(`file-node`);return v(),s(`li`,nn,[e(`div`,{class:n([`skill-row`,{active:r.isSkillSelected}]),onClick:u[1]||=e=>r.$emit(`select-skill`,r.skill)},[r.hasChildren?(v(),s(`button`,{key:0,class:`row-chevron`,"aria-label":r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),title:r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),onClick:u[0]||=t(e=>r.$emit(`toggle-expand`,r.skill),[`stop`])},[r.expanded?(v(),f(_,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(y,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,rn)):(v(),s(`span`,an)),a(b,{class:`row-icon`,size:16,"aria-hidden":`true`,focusable:`false`}),e(`span`,{class:`row-label`,title:r.skill.name},i(r.skill.slug),9,on)],2),r.expanded&&r.hasChildren?(v(),s(`ul`,sn,[(v(!0),s(c,null,g(r.tree,e=>(v(),f(x,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:1,onSelectFile:r.onSelectFile},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`onSelectFile`]))),128))])):o(``,!0)])}var ln=V(tn,[[`render`,cn],[`__scopeId`,`data-v-231c2ce1`]]),un=10*1024*1024,dn=/\.(tar\.gz|tgz|tar|zip|md)$/i,fn=y({name:`UploadSkillDialog`,components:{ElDialog:H,ElButton:K,AddFileIcon:Ue,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{file:null,isDragging:!1,uploading:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.uploading||this.$emit(`update:modelValue`,!1)},reset(){this.file=null,this.isDragging=!1;let e=this.$refs.fileInput;e&&(e.value=``)},humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},onPickFile(){this.uploading||this.$refs.fileInput?.click()},onFilePicked(e){let t=e.target.files?.[0]||null;this.acceptFile(t)},onDrop(e){this.isDragging=!1;let t=e.dataTransfer?.files?.[0]||null;this.acceptFile(t)},acceptFile(e){if(!e){this.file=null;return}if(e.size>un){T.error(this.$t(`skill.message.fileTooLarge`));return}if(!dn.test(e.name)){T.error(this.$t(`skill.message.fileTypeWrong`));return}this.file=e},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.file){this.uploading=!0;try{if(/\.md$/i.test(this.file.name)){let e=await this.file.text(),{data:t}=await Z.createMarkdown({content:e});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,t.id)}else{let{data:e}=await Z.createTarball(this.file);T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id)}this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.uploading=!1}}}}}),pn={key:0,class:`dropzone-hint`},mn={key:1,class:`dropzone-file`},hn={class:`dropzone-file-name`},gn={class:`dropzone-file-size`},_n={class:`requirements`},vn={class:`requirements-title`};function yn(o,c,u,d,m,h){let g=l(`add-file-icon`),_=l(`el-button`),y=l(`cloud-upload-icon`),b=l(`el-dialog`);return v(),f(b,{"model-value":o.modelValue,title:o.$t(`skill.dialog.uploadTitle`),width:`min(520px, 94vw)`,"align-center":``,"close-on-click-modal":!o.uploading,"close-on-press-escape":!o.uploading,"show-close":!o.uploading,"onUpdate:modelValue":o.onVisibleChange,onClosed:o.reset},{footer:p(()=>[a(_,{disabled:o.uploading,onClick:o.onClose},{default:p(()=>[r(i(o.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(_,{type:`primary`,loading:o.uploading,disabled:!o.file,onClick:o.onSubmit},{default:p(()=>[a(y,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`input`,{ref:`fileInput`,type:`file`,accept:`.tar.gz,.tgz,.tar,.zip,.md,application/gzip,application/zip,application/x-tar,text/markdown`,hidden:``,onChange:c[0]||=(...e)=>o.onFilePicked&&o.onFilePicked(...e)},null,544),e(`div`,{class:n([`dropzone`,{"is-dragging":o.isDragging,"has-file":!!o.file}]),onClick:c[1]||=(...e)=>o.onPickFile&&o.onPickFile(...e),onDragover:c[2]||=t(e=>o.isDragging=!0,[`prevent`]),onDragleave:c[3]||=t(e=>o.isDragging=!1,[`prevent`]),onDrop:c[4]||=t((...e)=>o.onDrop&&o.onDrop(...e),[`prevent`])},[a(g,{class:`dropzone-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),o.file?(v(),s(`p`,mn,[e(`span`,hn,i(o.file.name),1),e(`span`,gn,i(o.humanSize(o.file.size)),1)])):(v(),s(`p`,pn,i(o.$t(`skill.dialog.uploadDrop`)),1))],34),e(`div`,_n,[e(`p`,vn,i(o.$t(`skill.dialog.fileRequirements`)),1),e(`ul`,null,[e(`li`,null,i(o.$t(`skill.dialog.requirementMd`)),1),e(`li`,null,i(o.$t(`skill.dialog.requirementArchive`)),1)])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var bn=V(fn,[[`render`,yn],[`__scopeId`,`data-v-a38152b9`]]),xn=y({name:`WriteSkillDialog`,components:{ElDialog:H,ElButton:K,ElInput:q,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{content:``,saving:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.saving||this.$emit(`update:modelValue`,!1)},reset(){this.content=``},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.content.trim()){this.saving=!0;try{let{data:e}=await Z.createMarkdown({content:this.content});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id),this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.saving=!1}}}}}),Sn={class:`hint`};function Cn(t,n,o,s,c,u){let d=l(`el-input`),m=l(`el-button`),h=l(`cloud-upload-icon`),g=l(`el-dialog`);return v(),f(g,{"model-value":t.modelValue,title:t.$t(`skill.dialog.writeTitle`),width:`min(720px, 94vw)`,"align-center":``,"close-on-click-modal":!t.saving,"close-on-press-escape":!t.saving,"show-close":!t.saving,"onUpdate:modelValue":t.onVisibleChange,onClosed:t.reset},{footer:p(()=>[a(m,{disabled:t.saving,onClick:t.onClose},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(m,{type:`primary`,loading:t.saving,disabled:!t.content.trim(),onClick:t.onSubmit},{default:p(()=>[a(h,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`p`,Sn,i(t.$t(`skill.dialog.writeHint`)),1),a(d,{modelValue:t.content,"onUpdate:modelValue":n[0]||=e=>t.content=e,type:`textarea`,rows:18,placeholder:t.$t(`skill.placeholder.content`),spellcheck:`false`,class:`editor`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var wn=y({name:`UserSkills`,components:{ConsolePageHeader:Re,ElInput:q,ElSwitch:A,ElTag:Se,ElTooltip:w,ElDropdown:O,ElDropdownMenu:D,ElDropdownItem:E,AddIcon:B,AiCreateIcon:me,DeleteIcon:de,ExpandDownIcon:P,ExpandRightIcon:F,HelpIcon:L,MarketplaceIcon:le,MoreIcon:ne,SearchIcon:ue,SkillIcon:ce,UploadIcon:pe,WriteIcon:ee,BrowseSkillsDialog:Et,SkillFilePreview:Wt,SkillRow:ln,UploadSkillDialog:bn,WriteSkillDialog:V(xn,[[`render`,Cn],[`__scopeId`,`data-v-1946d5b3`]])},directives:{loading:G},data(){return{loading:!1,skills:[],togglingId:null,selectedSkillId:``,selectedPath:``,expandedSkillIds:[],personalOpen:!0,globalsOpen:!0,searchQuery:``,uploadVisible:!1,writeVisible:!1,browseVisible:!1}},computed:{personalSkills(){return this.skills.filter(e=>e.source!==`global`)},globalSkills(){return this.skills.filter(e=>e.source===`global`)},filteredPersonal(){return this.applyFilter(this.personalSkills)},filteredGlobal(){return this.applyFilter(this.globalSkills)},selectedSkill(){return this.skills.find(e=>e.id===this.selectedSkillId)||null}},mounted(){this.fetchSkills()},methods:{applyFilter(e){let t=this.searchQuery.trim().toLowerCase();return t?e.filter(e=>e.slug.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):e},async fetchSkills(){this.loading=!0;try{let{data:e}=await Z.list();if(this.skills=e||[],!this.selectedSkillId&&this.skills.length){let e=this.personalSkills[0]||this.skills[0];this.selectedSkillId=e.id}else this.selectedSkillId&&!this.skills.find(e=>e.id===this.selectedSkillId)&&(this.selectedSkillId=``,this.selectedPath=``)}catch(e){console.error(e),T.error(this.$t(`skill.message.loadFailed`))}finally{this.loading=!1}},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},selectSkill(e){this.selectedSkillId=e.id,this.selectedPath=``},selectFile(e,t){this.selectedSkillId=e.id,this.selectedPath=t},toggleExpand(e){let t=this.expandedSkillIds.indexOf(e.id);t>=0?this.expandedSkillIds.splice(t,1):this.expandedSkillIds.push(e.id)},openUpload(){this.uploadVisible=!0},openWrite(){this.writeVisible=!0},onBrowse(){this.browseVisible=!0},async onCreated(e){await this.fetchSkills();let t=this.skills.find(t=>t.id===e);t&&(this.selectedSkillId=t.id,this.selectedPath=``,this.personalOpen=!0)},async onSaveContent(e,t){if(!this.selectedSkill){t.reject();return}try{let{data:n}=await Z.update(this.selectedSkill.id,{content:e});T.success(this.$t(`skill.message.updateSuccess`));let r=this.skills.findIndex(e=>e.id===n.id);r>=0&&this.skills.splice(r,1,n),t.resolve()}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)})),t.reject(e)}},async onDelete(e){try{await be.confirm(this.$t(`skill.message.deleteConfirm`,{slug:e.slug}),this.$t(`common.button.delete`),{type:`warning`})}catch{return}try{await Z.remove(e.id),T.success(this.$t(`skill.message.deleteSuccess`)),this.selectedSkillId===e.id&&(this.selectedSkillId=``,this.selectedPath=``),await this.fetchSkills()}catch(e){T.error(this.extractError(e))}},async onToggleSkill(e,t){this.togglingId=e.id;try{t?(await Z.enable(e.id),T.success(this.$t(`skill.message.enableSuccess`))):(await Z.disable(e.id),T.success(this.$t(`skill.message.disableSuccess`))),e.enabled=t}catch(e){T.error(this.extractError(e))}finally{this.togglingId=null}}}}),Tn={class:`skills-page`},En={class:`skills-shell`},Dn={class:`left-pane`},On={class:`left-header`},kn=[`aria-label`,`title`],An={class:`submenu-trigger`},jn={class:`badge-soon`},Mn={class:`left-body`},Nn={class:`section`},Pn={key:0,class:`skill-list`},Fn={key:0,class:`empty-row`},In={key:0,class:`section`},Ln={key:0,class:`skill-list`},Rn={class:`right-pane`},zn={class:`right-header`},Bn={class:`right-title`},Vn={class:`right-actions`},Hn=[`aria-label`,`title`],Un={class:`meta-card`},Wn={class:`meta-grid`},Gn={class:`meta-cell`},Kn={class:`meta-label`},qn={class:`meta-value`},Jn={class:`meta-cell`},Yn={class:`meta-label`},Xn={class:`meta-value`},Zn={key:0,class:`meta-cell`},Qn={class:`meta-label`},$n={class:`meta-tags`},er={key:0,class:`meta-description`},tr={class:`meta-description-label`},nr={class:`meta-label`},rr={class:`preview-card`},ir={key:2,class:`right-empty`};function ar(t,n,u,h,_,y){let b=l(`console-page-header`),x=l(`search-icon`),S=l(`el-input`),C=l(`add-icon`),w=l(`marketplace-icon`),T=l(`el-dropdown-item`),E=l(`expand-right-icon`),D=l(`ai-create-icon`),O=l(`write-icon`),k=l(`upload-icon`),A=l(`el-dropdown-menu`),j=l(`el-dropdown`),M=l(`expand-down-icon`),N=l(`skill-row`),P=l(`el-switch`),F=l(`more-icon`),I=l(`delete-icon`),L=l(`el-tag`),ee=l(`help-icon`),te=l(`el-tooltip`),R=l(`skill-file-preview`),ne=l(`skill-icon`),re=l(`upload-skill-dialog`),ie=l(`write-skill-dialog`),z=l(`browse-skills-dialog`),ae=m(`loading`);return v(),s(`div`,Tn,[a(b,{title:t.$t(`skill.title.skills`),subtitle:t.$t(`skill.message.pageDescription`)},null,8,[`title`,`subtitle`]),e(`div`,En,[e(`aside`,Dn,[e(`header`,On,[a(S,{modelValue:t.searchQuery,"onUpdate:modelValue":n[0]||=e=>t.searchQuery=e,class:`search-input`,size:`default`,clearable:``,placeholder:t.$t(`skill.placeholder.search`)},{prefix:p(()=>[a(x,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`]),a(j,{trigger:`click`,placement:`bottom-end`,"hide-on-click":!1},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{onClick:t.onBrowse},{default:p(()=>[a(w,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.browse`)),1)]),_:1},8,[`onClick`]),a(T,{divided:``},{default:p(()=>[a(j,{trigger:`hover`,placement:`left-start`,"hide-on-click":!0},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{disabled:``},{default:p(()=>[a(D,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.createWithClaude`))+` `,1),e(`span`,jn,i(t.$t(`skill.menu.soon`)),1)]),_:1}),a(T,{onClick:t.openWrite},{default:p(()=>[a(O,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.write`)),1)]),_:1},8,[`onClick`]),a(T,{onClick:t.openUpload},{default:p(()=>[a(k,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.upload`)),1)]),_:1},8,[`onClick`])]),_:1})]),default:p(()=>[e(`span`,An,[a(C,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.create`))+` `,1),a(E,{class:`submenu-arrow`,size:14,"aria-hidden":`true`,focusable:`false`})])]),_:1})]),_:1})]),_:1})]),default:p(()=>[e(`button`,{type:`button`,class:`add-button`,"aria-label":t.$t(`skill.button.add`),title:t.$t(`skill.button.add`)},[a(C,{size:16,"aria-hidden":`true`,focusable:`false`})],8,kn)]),_:1})]),d((v(),s(`div`,Mn,[e(`section`,Nn,[e(`button`,{class:`section-header`,onClick:n[1]||=e=>t.personalOpen=!t.personalOpen},[t.personalOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.personal`)),1)]),t.personalOpen?(v(),s(`ul`,Pn,[!t.loading&&t.filteredPersonal.length===0?(v(),s(`li`,Fn,i(t.searchQuery?t.$t(`skill.empty.search`):t.$t(`skill.message.noSkills`)),1)):o(``,!0),(v(!0),s(c,null,g(t.filteredPersonal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)]),t.globalSkills.length>0?(v(),s(`section`,In,[e(`button`,{class:`section-header`,onClick:n[2]||=e=>t.globalsOpen=!t.globalsOpen},[t.globalsOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.platform`)),1)]),t.globalsOpen?(v(),s(`ul`,Ln,[(v(!0),s(c,null,g(t.filteredGlobal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)])):o(``,!0)])),[[ae,t.loading]])]),e(`main`,Rn,[t.selectedSkill&&!t.selectedPath?(v(),s(c,{key:0},[e(`header`,zn,[e(`h3`,Bn,i(t.selectedSkill.slug),1),e(`div`,Vn,[a(P,{"model-value":t.selectedSkill.enabled,size:`default`,loading:t.togglingId===t.selectedSkill.id,onChange:n[3]||=e=>t.onToggleSkill(t.selectedSkill,!!e)},null,8,[`model-value`,`loading`]),t.selectedSkill.source===`global`?o(``,!0):(v(),f(j,{key:0,trigger:`click`,placement:`bottom-end`},{dropdown:p(()=>[a(A,null,{default:p(()=>[a(T,{onClick:n[4]||=e=>t.onDelete(t.selectedSkill)},{default:p(()=>[a(I,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.delete`)),1)]),_:1})]),_:1})]),default:p(()=>[e(`button`,{class:`icon-btn`,"aria-label":t.$t(`skill.button.more`),title:t.$t(`skill.button.more`)},[a(F,{size:16,"aria-hidden":`true`,focusable:`false`})],8,Hn)]),_:1}))])]),e(`div`,Un,[e(`div`,Wn,[e(`div`,Gn,[e(`span`,Kn,i(t.$t(`skill.meta.addedBy`)),1),e(`span`,qn,i(t.selectedSkill.source===`global`?t.$t(`skill.meta.platform`):t.$t(`skill.meta.you`)),1)]),e(`div`,Jn,[e(`span`,Yn,i(t.$t(`skill.meta.lastUpdated`)),1),e(`span`,Xn,i(t.$dayjs.format(t.selectedSkill.updated_at)),1)]),t.selectedSkill.required_connections.length?(v(),s(`div`,Zn,[e(`span`,Qn,i(t.$t(`skill.field.requiredConnections`)),1),e(`div`,$n,[(v(!0),s(c,null,g(t.selectedSkill.required_connections,e=>(v(),f(L,{key:e,size:`small`,type:`info`},{default:p(()=>[r(i(e),1)]),_:2},1024))),128))])])):o(``,!0)]),t.selectedSkill.description?(v(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`skill.field.description`)),1),t.selectedSkill.when_to_use?(v(),f(te,{key:0,content:t.selectedSkill.when_to_use,placement:`top`},{default:p(()=>[a(ee,{class:`meta-info-icon`,size:12,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])):o(``,!0)]),e(`p`,null,i(t.selectedSkill.description),1)])):o(``,!0)]),e(`div`,rr,[(v(),f(R,{key:`${t.selectedSkill.id}:SKILL.md`,"skill-id":t.selectedSkill.id,path:`SKILL.md`,editable:t.selectedSkill.source===`upload`,onSave:t.onSaveContent},null,8,[`skill-id`,`editable`,`onSave`]))])],64)):t.selectedSkill&&t.selectedPath?(v(),f(R,{key:`${t.selectedSkill.id}:${t.selectedPath}`,"skill-id":t.selectedSkill.id,path:t.selectedPath,editable:!1},null,8,[`skill-id`,`path`])):(v(),s(`div`,ir,[a(ne,{class:`right-empty-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.selectSkill`)),1)]))])]),a(re,{modelValue:t.uploadVisible,"onUpdate:modelValue":n[5]||=e=>t.uploadVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(ie,{modelValue:t.writeVisible,"onUpdate:modelValue":n[6]||=e=>t.writeVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(z,{modelValue:t.browseVisible,"onUpdate:modelValue":n[7]||=e=>t.browseVisible=e,onInstalled:t.onCreated},null,8,[`modelValue`,`onInstalled`])])}var or=V(wn,[[`render`,ar],[`__scopeId`,`data-v-6d629e8e`]]);export{or as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Jt as t,L as n,at as r,ht as i,j as a,mt as o,ot as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{n as u,t as d}from"./table
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Jt as t,L as n,at as r,ht as i,j as a,mt as o,ot as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{n as u,t as d}from"./table-BUXPszeH.js";import{t as f}from"./card-IQwqnRJR.js";import{n as p,t as m}from"./row-PjVOGpsW.js";import{A as h,Gi as g}from"./index-Cxnu8Cai.js";import{t as _}from"./CopyToClipboard-DpUrgAAx.js";import{t as v}from"./pagination-CC9WpoPG.js";var y=l({name:`ConsoleDistributionInvitees`,components:{Pagination:v,CopyToClipboard:_,ElRow:m,ElCol:p,ElTable:d,ElTableColumn:u,ElCard:f},data(){return{invitees:[],loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onFetchInvitees(){let{data:e}=await g.getInvitees({limit:this.limit,offset:(this.page-1)*this.limit,ordering:`-created_at`});this.invitees=e.items,this.total=e.count}}}),b={class:`title`},x={class:`key`},S={class:`copy`},C={class:`description`},w={class:`description`},T={class:`description`},E={class:`created-at`},D={class:`pagination m-v-lg`};function O(l,u,d,f,p,m){let h=r(`el-col`),g=r(`el-row`),_=r(`copy-to-clipboard`),v=r(`el-table-column`),y=r(`el-table`),O=r(`el-card`),k=r(`pagination`),A=s(`loading`);return c(),a(g,{class:`panel`},{default:o(()=>[n(h,{span:24},{default:o(()=>[n(g,null,{default:o(()=>[n(h,{span:24},{default:o(()=>[e(`h2`,b,t(l.$t(`common.title.invitee`)),1)]),_:1})]),_:1}),n(g,null,{default:o(()=>[n(h,{span:24},{default:o(()=>[n(O,{shadow:`hover`},{default:o(()=>[i((c(),a(y,{data:l.invitees,stripe:``},{default:o(()=>[n(v,{prop:`id`,label:l.$t(`user.field.id`),"class-name":`text-center`,width:`350px`},{default:o(r=>[e(`span`,x,t(r.row.id),1),e(`span`,S,[n(_,{content:r.row.id},null,8,[`content`])])]),_:1},8,[`label`]),n(v,{label:l.$t(`user.field.username`),width:`300px`},{default:o(n=>[e(`span`,C,t(n.row?.username),1)]),_:1},8,[`label`]),n(v,{label:l.$t(`user.field.email`),width:`300px`},{default:o(n=>[e(`span`,w,t(n.row?.email),1)]),_:1},8,[`label`]),n(v,{label:l.$t(`user.field.nickname`),width:`200px`},{default:o(n=>[e(`span`,T,t(n.row.nickname),1)]),_:1},8,[`label`]),n(v,{label:l.$t(`user.field.dateJoined`)},{default:o(n=>[e(`span`,E,t(l.$dayjs.format(n.row.date_joined)),1)]),_:1},8,[`label`])]),_:1},8,[`data`])),[[A,l.loading]])]),_:1})]),_:1})]),_:1}),n(g,null,{default:o(()=>[n(h,{span:10,offset:14},{default:o(()=>[e(`div`,D,[n(k,{"current-page":l.page,"page-size":l.limit,total:l.total,onChange:l.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])]),_:1})]),_:1})]),_:1})]),_:1})}var k=h(y,[[`render`,O],[`__scopeId`,`data-v-b2200c49`]]);export{k as default};
|