@acedatacloud/nexior 3.329.39 → 3.329.41
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-BuAXokaf.js → ApiCodeButton-D4DyTm8N.js} +1 -1
- package/dist/assets/{Artifacts-C_ScvWGC.js → Artifacts-DdtyFhWI.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BgMBQkQ1.js → AskUserQuestionCard-CJVfZLOM.js} +1 -1
- package/dist/assets/{AudioPreview-UZ5qR4-4.js → AudioPreview-Dtyu_YGA.js} +1 -1
- package/dist/assets/{Auth-Scu_-6vi.js → Auth-CgH3cmEu.js} +1 -1
- package/dist/assets/{Bare-BklIgjvU.js → Bare-4MPoNaEF.js} +1 -1
- package/dist/assets/{BotPlaceholder-DrMa4leC.js → BotPlaceholder-CHZUU5yo.js} +1 -1
- package/dist/assets/{BottomFooter-95nzDKMZ.js → BottomFooter-BZtOsgBh.js} +1 -1
- package/dist/assets/{Callback-Beh4v6eb.js → Callback-DSeKEq0s.js} +1 -1
- package/dist/assets/{CodeSnippet-BjKN570c.js → CodeSnippet-YjGMY28l.js} +1 -1
- package/dist/assets/{Console-Cd3P1A21.js → Console-ZOWh2c0i.js} +1 -1
- package/dist/assets/{Consumption-BNM0d3BL.js → Consumption-C97cUgXC.js} +1 -1
- package/dist/assets/{Conversation-DDeKXrRR.js → Conversation-CxCyD9st.js} +1 -1
- package/dist/assets/{Conversation-CJs41Kc-.js → Conversation-Dwf8lbl6.js} +1 -1
- package/dist/assets/{CopyToClipboard-CZA6WQWP.js → CopyToClipboard-7Ujng4SJ.js} +1 -1
- package/dist/assets/{Detail-DiPWoB2s.js → Detail-JNl1AUc0.js} +2 -2
- package/dist/assets/{Extra-D25qV1lg.js → Extra-2nfFjrAm.js} +1 -1
- package/dist/assets/{FilePreview-DrpFw-4j.js → FilePreview-BPOT3MBw.js} +1 -1
- package/dist/assets/{Hailuo-DyffmeCo.js → Hailuo-ChXNC1uP.js} +1 -1
- package/dist/assets/{History-DpKO0bsE.js → History-DA5un6Et.js} +1 -1
- package/dist/assets/{ImagePreview-Cegc7Kc9.js → ImagePreview-DA0KgRxc.js} +1 -1
- package/dist/assets/{ImageWrapper-hjcr_HZW.js → ImageWrapper-EqRNomt5.js} +1 -1
- package/dist/assets/{Index-Bw2-9tdT.js → Index-5vVR1uEZ.js} +1 -1
- package/dist/assets/{Index-D7BDo-b9.js → Index-8cz1pkQj.js} +1 -1
- package/dist/assets/{Index-2yKdqfjL.js → Index-B-Q-tYbl.js} +1 -1
- package/dist/assets/{Index-DpRUOhpv.js → Index-BPU6acKc.js} +1 -1
- package/dist/assets/{Index-CnyeH_9w.js → Index-BTjgZuXM.js} +1 -1
- package/dist/assets/{Index-8hxmZLEo.js → Index-BUId6ddH.js} +1 -1
- package/dist/assets/{Index-BPBBjoUQ.js → Index-BfdSjI8y.js} +1 -1
- package/dist/assets/Index-Bq7fABAM.css +1 -0
- package/dist/assets/{Index-CAVtjGzp.js → Index-BtxocUnx.js} +1 -1
- package/dist/assets/{Index-C_A6EuF8.js → Index-BxxXxMNc.js} +1 -1
- package/dist/assets/{Index-DnTTV7kF.js → Index-CI2sWQSD.js} +1 -1
- package/dist/assets/{Index-DQI6AhRg.js → Index-CSXdSJgi.js} +1 -1
- package/dist/assets/{Index-S7_VI00E.js → Index-CUYFJm6D.js} +1 -1
- package/dist/assets/Index-CWXcCOk-.css +1 -0
- package/dist/assets/{Index-WuAShMJl.js → Index-CXSxjps3.js} +1 -1
- package/dist/assets/{Index-Ddgg1D5S.js → Index-CXki_6g-.js} +1 -1
- package/dist/assets/{Index-Bh8ixOJX.js → Index-CXz3XseY.js} +1 -1
- package/dist/assets/{Index-CPnZI5Ip.js → Index-Cl3UPLMK.js} +1 -1
- package/dist/assets/{Index-BSErpN9e.js → Index-Cq4uQRKs.js} +1 -1
- package/dist/assets/{Index-Ci2qFXPi.css → Index-CxCilrE-.css} +1 -1
- package/dist/assets/{Index-rcZfLP8q.js → Index-D3xPss1X.js} +1 -1
- package/dist/assets/{Index-D7df7jMb.js → Index-D5UGTWZT.js} +1 -1
- package/dist/assets/{Index-Ck_lbC7I.css → Index-DL-lm09l.css} +1 -1
- package/dist/assets/{Index-D_kggTLc.js → Index-DMKzaQIw.js} +1 -1
- package/dist/assets/{Index-BziNJIYk.js → Index-DUcEfWWj.js} +1 -1
- package/dist/assets/{Index-bBF9gQIC.js → Index-DWdLjHTO.js} +1 -1
- package/dist/assets/Index-DsmXPjSQ.css +1 -0
- package/dist/assets/{Index-BQi4Ibhl.js → Index-Dvw1nrhP.js} +1 -1
- package/dist/assets/{Index-BQ8Z9SPM.js → Index-EE1jkU5I.js} +1 -1
- package/dist/assets/{Index-D0SPUkT9.js → Index-PgQ5o_bm.js} +1 -1
- package/dist/assets/{Index-DpLiKGhi.js → Index-Ri5OOvWF.js} +1 -1
- package/dist/assets/{Index-jIbp_A6c.js → Index-Yd8OMzys.js} +1 -1
- package/dist/assets/Index-Zv9Dp3N_.js +1 -0
- package/dist/assets/{Index-CWGHoBNO.js → Index-lcqXSWlX.js} +1 -1
- package/dist/assets/{Invitees-BjmGIzyW.js → Invitees-0Vt5xQ7n.js} +1 -1
- package/dist/assets/{List-jCr_3xxr.js → List-81J_QiS7.js} +1 -1
- package/dist/assets/{List-CNsZdFsU.js → List-DTiU9nLl.js} +1 -1
- package/dist/assets/{List-DY_uBDOU.js → List-c083pWf7.js} +1 -1
- package/dist/assets/{LocalTools-C8Kp14hS.js → LocalTools-DaZCHwjp.js} +1 -1
- package/dist/assets/{LocalTools-DTuKyWpl.js → LocalTools-dOhHrwBv.js} +1 -1
- package/dist/assets/{Main-DhnHqDHL.js → Main-CVUHL4mI.js} +1 -1
- package/dist/assets/{Message-DcWcy4WT.js → Message-BlxsMm0E.js} +1 -1
- package/dist/assets/{Model-D12WLuuu.js → Model-B_tSzZME.js} +1 -1
- package/dist/assets/{Navigator-7RDEpA4f.js → Navigator-DyAVFjja.js} +3 -3
- package/dist/assets/{NotFound-BBertoyE.js → NotFound-BNpzzXgY.js} +1 -1
- package/dist/assets/{Pay-D5g__Bcv.js → Pay-CUJhfi2k.js} +1 -1
- package/dist/assets/{Player-VQ1ihHfF.js → Player-CLiciT40.js} +1 -1
- package/dist/assets/{PromptTextarea-Bdpc7bLs.js → PromptTextarea-Ct-ACb4r.js} +1 -1
- package/dist/assets/{RealtimeCall-DvGIysM1.js → RealtimeCall-L2QHJYd7.js} +1 -1
- package/dist/assets/{ScheduledTasks-0enf4zs0.js → ScheduledTasks-jAertOEm.js} +1 -1
- package/dist/assets/{Status-9JYM_YYi.js → Status-C1DbtsVH.js} +1 -1
- package/dist/assets/{Subscribe-BJ9TzS2H.js → Subscribe-DIupwp9T.js} +1 -1
- package/dist/assets/TabSwitcher-CLJnjjhG.css +1 -0
- package/dist/assets/TabSwitcher-CTWg2HQV.js +1 -0
- package/dist/assets/{Tts-JKdRzrkr.js → Tts-_CsjDkmg.js} +1 -1
- package/dist/assets/{VideoPlayer-B7-ByfsD.js → VideoPlayer-C13TiYLD.js} +1 -1
- package/dist/assets/{alert-Dd3pcgZr.js → alert-CbdM7xM3.js} +1 -1
- package/dist/assets/arrow-down-D378Sa6t.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-BaRHxbNJ.js → arrow-down-wide-narrow-CAWhbKUp.js} +1 -1
- package/dist/assets/arrow-left-Bd-QaJXo.js +1 -0
- package/dist/assets/arrow-right-CazdMwg5.js +1 -0
- package/dist/assets/arrow-up-BCGyBQ3t.js +1 -0
- package/dist/assets/{avatar-L9MQHvwq.js → avatar-BmfJNxiL.js} +1 -1
- package/dist/assets/{basic-CJByVeYk.js → basic-DL5D3JS7.js} +1 -1
- package/dist/assets/{box-BNgmySYi.js → box-DUbdQWmp.js} +1 -1
- package/dist/assets/{boxes-D3iyMhpE.js → boxes-CUMj6T4o.js} +1 -1
- package/dist/assets/{brain-DIO_FYaz.js → brain-D2D6T1w_.js} +1 -1
- package/dist/assets/{chart-no-axes-combined--MOMNF5_.js → chart-no-axes-combined-B4PNgl5C.js} +1 -1
- package/dist/assets/{chat-l4obLcWq.js → chat-B7rfd7lL.js} +1 -1
- package/dist/assets/check-DSFVyLIN.js +1 -0
- package/dist/assets/chevron-down-NkImLNI7.js +1 -0
- package/dist/assets/chevron-right-BwCLRk37.js +1 -0
- package/dist/assets/circle-check-CzXvsqoT.js +1 -0
- package/dist/assets/clock-DRnti55a.js +1 -0
- package/dist/assets/{codingBridge-CNCAGBZ0.js → codingBridge-BMSdrad4.js} +1 -1
- package/dist/assets/{codingBridgeNotify-BAkwB4Sh.js → codingBridgeNotify-CtWpRzU2.js} +2 -2
- package/dist/assets/{coins-DKcM60Q6.js → coins-kClPhm7N.js} +1 -1
- package/dist/assets/{collapse-BhMaU5Zx.js → collapse-CrzsSJ_g.js} +1 -1
- package/dist/assets/{createTaskActions-DP5rzSmh.js → createTaskActions-l8_quKQ-.js} +1 -1
- package/dist/assets/{digitalhuman-DGLxr77A.js → digitalhuman-BoW4kGbU.js} +1 -1
- package/dist/assets/{dollar-sign-DGBglg_W.js → dollar-sign-Zn9tEPI5.js} +1 -1
- package/dist/assets/{download-DVU6oOkC.js → download-Dbp--E-D.js} +1 -1
- package/dist/assets/{drawer-anvkTtti.js → drawer-KfWBQxDz.js} +1 -1
- package/dist/assets/{dropdown-Dn5Hextn.js → dropdown-BLz0Hx40.js} +1 -1
- package/dist/assets/{dropdown-BZLB3S0N.js → dropdown-DZUIorQS.js} +1 -1
- package/dist/assets/{ellipsis-wz3p-GZ2.js → ellipsis-B869VnSA.js} +1 -1
- package/dist/assets/{esm-DVKqrnL_.js → esm-CUKMz__P.js} +3 -3
- package/dist/assets/{esm-BB947M9B.js → esm-CfQwE1cP.js} +2 -2
- package/dist/assets/esm-Cn2WL6VC.js +1 -0
- package/dist/assets/{esm-BhtjOBvO.js → esm-CpHxVLZ7.js} +2 -2
- package/dist/assets/{esm-5HhMFf9I.js → esm-Jk-4F3oV.js} +1 -1
- package/dist/assets/{esm-6PmU3KpF.js → esm-ofHMMJDe.js} +1 -1
- package/dist/assets/{esm-BgqIn2yW.js → esm-qbNepX1g.js} +1 -1
- package/dist/assets/{external-link-DpG3vEdE.js → external-link-B18wUPg2.js} +1 -1
- package/dist/assets/{eye-BIfEjJFV.js → eye-DwKHCHJV.js} +1 -1
- package/dist/assets/{file-output-DH97iOje.js → file-output-i1KIle70.js} +1 -1
- package/dist/assets/{file-text-CSbvyzIm.js → file-text-Dt4EeRMX.js} +1 -1
- package/dist/assets/{fish-bYPGpKO3.js → fish-Levt_LmX.js} +1 -1
- package/dist/assets/{flux-DDK7FsA8.js → flux--nKcg4_8.js} +1 -1
- package/dist/assets/{folder-DytMwKnG.js → folder-BK_sxTGn.js} +1 -1
- package/dist/assets/gauge-ipD6dM22.js +1 -0
- package/dist/assets/{globe-DkpQWUKq.js → globe-skZazDQw.js} +1 -1
- package/dist/assets/{grokvideo-C-lDTab7.js → grokvideo-tcvmjk-z.js} +1 -1
- package/dist/assets/{hailuo-7Eje19xk.js → hailuo-B9MWfuxy.js} +1 -1
- package/dist/assets/{headphones-CFEVoRGH.js → headphones-h5HZf1m_.js} +1 -1
- package/dist/assets/{history-Bpoyg9PI.js → history-DJRZsk5K.js} +1 -1
- package/dist/assets/{image-Ba6DqjQ8.js → image-CHb7KY3Y.js} +1 -1
- package/dist/assets/{index-Cfewjxc5.css → index-C0-sWesJ.css} +1 -1
- package/dist/assets/{index-D2ugFcRR.js → index-CV77yiwr.js} +3 -3
- package/dist/assets/{index.browser.esm-IHXO0Qn5.js → index.browser.esm-CF1Lm80h.js} +1 -1
- package/dist/assets/{index.es-C7Z-tC9B.js → index.es-b9W-mFrR.js} +1 -1
- package/dist/assets/{info-DhKCbyPk.js → info-DIS9MTgX.js} +1 -1
- package/dist/assets/{input-number-DFySdlyu.js → input-number-DeTsh-4B.js} +1 -1
- package/dist/assets/{key-round-Bpo_BFv-.js → key-round-DTfZU9_1.js} +1 -1
- package/dist/assets/{kling-BOzdQsBG.js → kling-Cpc4Ch1D.js} +1 -1
- package/dist/assets/{languages-Cr5vLlEK.js → languages-DNM9nm-V.js} +1 -1
- package/dist/assets/{laptop-llu3yX1o.js → laptop-AKb-ASgl.js} +1 -1
- package/dist/assets/{lightbulb-BjylYVln.js → lightbulb-Dgy7gnNE.js} +1 -1
- package/dist/assets/{link-DNn-Vrqh.js → link-CTSKiE5Z.js} +1 -1
- package/dist/assets/loader-circle-PaDWwd4t.js +1 -0
- package/dist/assets/{luma-3MJudKx7.js → luma-CFm4Bzy-.js} +1 -1
- package/dist/assets/{maestro-C7DGfQzn.js → maestro-QccsGrGO.js} +1 -1
- package/dist/assets/{mail-CZzTnC--.js → mail-DduGKqdB.js} +1 -1
- package/dist/assets/{message-circle-B2Ogr05P.js → message-circle-CBgZlc-Z.js} +1 -1
- package/dist/assets/{mic-rW_ChD67.js → mic-BbF9jmRs.js} +1 -1
- package/dist/assets/{midjourney-DAwbbNh2.js → midjourney-BkMsURmY.js} +1 -1
- package/dist/assets/{mobileLocalExec-CKus95h2.js → mobileLocalExec-C5dzNaKe.js} +2 -2
- package/dist/assets/{mouse-pointer-2-DFSbcb0W.js → mouse-pointer-2-D4u2M3R3.js} +1 -1
- package/dist/assets/music-2-DGXiZuAb.js +1 -0
- package/dist/assets/{nanobanana-D4Gy2-Nv.js → nanobanana-OiXNrdbD.js} +1 -1
- package/dist/assets/{omni-K1Uk6LoW.js → omni-Bgqk69vL.js} +1 -1
- package/dist/assets/{openaiimage-BX3dYCUU.js → openaiimage-h19FCBLh.js} +1 -1
- package/dist/assets/{pagination-B0NnI5zw.js → pagination-BtF_LmES.js} +1 -1
- package/dist/assets/{pagination-DdsSvKkV.js → pagination-DyPo67Lf.js} +1 -1
- package/dist/assets/{palette-oClr90sr.js → palette-BTqy_06l.js} +1 -1
- package/dist/assets/{paperclip-oXc2BFvc.js → paperclip-CDFNS2jh.js} +1 -1
- package/dist/assets/{pause-Bq9JCMIo.js → pause-BOpSdNzf.js} +1 -1
- package/dist/assets/{pencil-Yrfa0b1p.js → pencil-Dqs40u2w.js} +1 -1
- package/dist/assets/{pika-6-xurNNm.js → pika-CMyhHD01.js} +1 -1
- package/dist/assets/{pixverse-DYTE6_nK.js → pixverse-Bp4_jDTO.js} +1 -1
- package/dist/assets/play-CqKXLebL.js +1 -0
- package/dist/assets/plus-CnWMWiFL.js +1 -0
- package/dist/assets/{popover-DSTJp5Cr.js → popover-C0tVwOh7.js} +1 -1
- package/dist/assets/{producer-65nXoXpa.js → producer-asc-q-pM.js} +1 -1
- package/dist/assets/{qrart-CAeYMrba.js → qrart-yGlEi_oO.js} +1 -1
- package/dist/assets/{realtime-CH5vjNue.js → realtime-BXrOBJZf.js} +1 -1
- package/dist/assets/{refresh-cw-aDmtppBJ.js → refresh-cw-DfNre0Ck.js} +1 -1
- package/dist/assets/rotate-ccw-CexVuEXo.js +1 -0
- package/dist/assets/rotate-cw-JkOI8Cqx.js +1 -0
- package/dist/assets/{row-MIrnxpN3.js → row-Db1UIu1H.js} +1 -1
- package/dist/assets/search-B7rlZHQ2.js +1 -0
- package/dist/assets/{seedance-Hn9ocI6A.js → seedance-jCrUEC26.js} +1 -1
- package/dist/assets/{seedream-D49_VDnJ.js → seedream-Ca-NiHwa.js} +1 -1
- package/dist/assets/{select-BLM0v92m.js → select-CiXAUiuv.js} +1 -1
- package/dist/assets/{serp-64GruYbw.js → serp-BHo5Yi3M.js} +1 -1
- package/dist/assets/{shield-CYJpqJPB.js → shield-Uz5Wty0p.js} +1 -1
- package/dist/assets/{shuffle-CmK9qICx.js → shuffle-CwkN8eL6.js} +1 -1
- package/dist/assets/{slider-BqxpYCLY.js → slider-BusOHeSU.js} +1 -1
- package/dist/assets/{sliders-horizontal-BVxEasbo.js → sliders-horizontal-B2X6JnDU.js} +1 -1
- package/dist/assets/{solana-wallets-Bt6Xh5VB.js → solana-wallets-Lj3pzCBs.js} +2 -2
- package/dist/assets/{solana-wallets-vue-o4t4wDHw.js → solana-wallets-vue-D2xByoDr.js} +1 -1
- package/dist/assets/{sora-ClMzh50a.js → sora-CDdANlOi.js} +1 -1
- package/dist/assets/square-DBuIbs37.js +1 -0
- package/dist/assets/{suno-VLNVgNuR.js → suno-Dxzkat6g.js} +1 -1
- package/dist/assets/{switch-CzEQE2DH.js → switch-Clv7FWdl.js} +1 -1
- package/dist/assets/{table-BYj2mLeB.js → table-B8WcbeSJ.js} +1 -1
- package/dist/assets/{tabs-lcFoTVMT.js → tabs-VIxPOc3b.js} +1 -1
- package/dist/assets/{tag-DpGMo9Ys.js → tag-D72CAEly.js} +1 -1
- package/dist/assets/{taskDrawerMixin-Bsm_pfmZ.js → taskDrawerMixin-CPhjUGCy.js} +1 -1
- package/dist/assets/terminal-BZoBwdPp.js +1 -0
- package/dist/assets/{time-picker-C3lVX0v3.js → time-picker-CMNpcjIG.js} +1 -1
- package/dist/assets/{tooltip-CaHCcyJq.js → tooltip-CqIZfKUP.js} +1 -1
- package/dist/assets/{trash-2-C9z6HAJ5.js → trash-2-C13muunN.js} +1 -1
- package/dist/assets/{triangle-alert-vfYvzN9x.js → triangle-alert-DY6fUtMw.js} +1 -1
- package/dist/assets/{upload-dOdEM0mX.js → upload-BzBhmZxi.js} +1 -1
- package/dist/assets/{upload-25kqK9dU.js → upload-Cx-GvBHT.js} +1 -1
- package/dist/assets/user-BoLedcgo.js +1 -0
- package/dist/assets/{veo-BpQovylx.js → veo-BrsDpMFw.js} +1 -1
- package/dist/assets/{video-CXyjFmts.js → video-TPwwGwr7.js} +1 -1
- package/dist/assets/{volume-2-C05cqKlS.js → volume-2-BRpke5tk.js} +1 -1
- package/dist/assets/{wallet-1hdAbKHb.js → wallet-Dr83XtK-.js} +1 -1
- package/dist/assets/{wan-9u7vGHI6.js → wan-CjrJH99R.js} +1 -1
- package/dist/assets/{wand-sparkles-C2tZqsJR.js → wand-sparkles-DlpvrxJE.js} +1 -1
- package/dist/assets/{web-CRO88HEi.js → web-BbBvkXcu.js} +1 -1
- package/dist/assets/{web-CR4Od62x.js → web-CCkdvUhL.js} +1 -1
- package/dist/assets/{web-BGkThKPE.js → web-CNfMwITe.js} +1 -1
- package/dist/assets/{web-Cx58U-5S.js → web-CamzY9zA.js} +1 -1
- package/dist/assets/{web-BIo0zoS8.js → web-D4GmM4EZ.js} +1 -1
- package/dist/assets/{webextrator-D0CfIdjK.js → webextrator-CTY2Fcvk.js} +1 -1
- package/dist/assets/{zap-T3F5bwrg.js → zap-DlJNa_Tm.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/Index-C-HGrlwS.css +0 -1
- package/dist/assets/Index-D9srmVjK.css +0 -1
- package/dist/assets/Index-DbxRnJBR.css +0 -1
- package/dist/assets/Index-wt9gxcJX.js +0 -1
- package/dist/assets/TabSwitcher-BZYY-iDD.css +0 -1
- package/dist/assets/TabSwitcher-Dc2ee1pS.js +0 -1
- package/dist/assets/arrow-down-j7nSyZ4M.js +0 -1
- package/dist/assets/arrow-left-DVpFd5jw.js +0 -1
- package/dist/assets/arrow-right-3fwfmhvM.js +0 -1
- package/dist/assets/arrow-up-BKl4Vbl7.js +0 -1
- package/dist/assets/check-Cc02Y3ax.js +0 -1
- package/dist/assets/chevron-down-BA-bCfF8.js +0 -1
- package/dist/assets/chevron-right-Zj6yHMSB.js +0 -1
- package/dist/assets/circle-check-DQepOQOd.js +0 -1
- package/dist/assets/clock-CWEF1y39.js +0 -1
- package/dist/assets/esm-DC_cszHZ.js +0 -1
- package/dist/assets/gauge-B9FwpRZA.js +0 -1
- package/dist/assets/loader-circle-Ccv7sDWk.js +0 -1
- package/dist/assets/music-2-D-TcLLg4.js +0 -1
- package/dist/assets/play-yRXwqcYt.js +0 -1
- package/dist/assets/plus-DqHwKrUU.js +0 -1
- package/dist/assets/rotate-ccw-CirseUef.js +0 -1
- package/dist/assets/rotate-cw-BRu0_G2r.js +0 -1
- package/dist/assets/search-BlPlwyB8.js +0 -1
- package/dist/assets/square-XwzVLVKy.js +0 -1
- package/dist/assets/terminal-D7Fyyun9.js +0 -1
- package/dist/assets/user-JE9H71yP.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-BLM0v92m.js";import{t as x}from"./upload-dOdEM0mX.js";import{t as S}from"./tooltip-CaHCcyJq.js";import{t as C}from"./alert-Dd3pcgZr.js";import{t as w}from"./drawer-anvkTtti.js";import{n as T}from"./taskDrawerMixin-Bsm_pfmZ.js";import{t as E}from"./box-BNgmySYi.js";import{t as D}from"./clock-CWEF1y39.js";import{t as O}from"./CopyToClipboard-CZA6WQWP.js";import{n as k,r as A,t as j}from"./PromptTextarea-Bdpc7bLs.js";import{t as M}from"./info-DhKCbyPk.js";import{t as N}from"./triangle-alert-vfYvzN9x.js";import{t as P}from"./upload-25kqK9dU.js";import{t as F}from"./wand-sparkles-C2tZqsJR.js";import{At as I,Bt as L,Ft as ee,Ht as te,It as ne,Lt as re,Mt as ie,Pt as ae,Rt as oe,Ut as R,jt as z,kt as B,zt as V}from"./constants-Bq6v7ZuS.js";import{$t as H,Ai as U,Bt as W,E as G,Ht as K,Vt as q,Wt as se,ei as J,gi as Y,mr as ce,ri as X,xn as le,zt as ue}from"./index-D2ugFcRR.js";import{t as Z}from"./ImagePreview-Cegc7Kc9.js";import{t as de}from"./Consumption-BNM0d3BL.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-DdsSvKkV.js";import{t as he}from"./VideoPlayer-B7-ByfsD.js";import{t as ge}from"./ApiCodeButton-BuAXokaf.js";import{t as _e}from"./BotPlaceholder-DrMa4leC.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:F,ElDrawer:w,ElButton:U},mixins:[T]}),ye={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[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 Ce=G(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.grokvideo?.config?.prompt},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(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(`grokvideo.name.prompt`),info:e.$t(`grokvideo.description.prompt`),placeholder:e.$t(`grokvideo.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=G(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:ee,label:this.$t(`grokvideo.model.default`)},{value:ae,label:this.$t(`grokvideo.model.preview15`)}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.model},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,model:e})}}},mounted(){this.value||=B}}),Oe={class:`field`},ke={class:`label`},Ae={class:`box`},je={class:`title font-bold`};function Me(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`grokvideo.name.model`)),1),a(m,{content:t.$t(`grokvideo.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=G(De,[[`render`,Me],[`__scopeId`,`data-v-291d93fb`]]),Pe=v({name:`GrokVideoDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.grokvideo?.config?.model},maxDuration(){return te(this.model)},options(){return ie.filter(e=>e<=this.maxDuration).map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.grokvideo?.config?.duration},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,duration:e})}}},watch:{maxDuration(e){this.value&&this.value>e&&(this.value=e)}},mounted(){this.value||=6}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`grokvideo.name.duration`)),1),a(m,{content:t.$t(`grokvideo.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Be=G(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:V,label:`480p`},{value:L,label:`720p`},{value:oe,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.resolution},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,resolution:e})}}},mounted(){this.value||=z}}),He={class:`resolution`},Ue={class:`header`},We={class:`title font-bold`},Ge={class:`items`},Ke=[`onClick`];function qe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`grokvideo.name.resolution`)),1),a(p,{content:t.$t(`grokvideo.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ge,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Ke))),128))])])}var Je=G(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:ne,label:`16:9`,w:32,h:18},{value:re,label:`9:16`,w:18,h:32},{value:`1:1`,label:`1:1`,w:24,h:24},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`3:2`,label:`3:2`,w:30,h:20},{value:`2:3`,label:`2:3`,w:20,h:30}]},value:{get(){return this.$store.state.grokvideo?.config?.aspect_ratio},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,aspect_ratio:e})}}},mounted(){this.value||=I}}),Xe={class:`ratio`},Ze={class:`header`},Qe={class:`title font-bold`},$e={class:`items`},et=[`onClick`],tt={class:`preview`},nt={class:`name`};function rt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`grokvideo.name.ratio`)),1),a(p,{content:t.$t(`grokvideo.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,$e,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,tt,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,nt,i(r.label),1)],10,et))),128))])])}var it=G(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return R(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){Y.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,image_url:e||void 0})},async onSuccess(){this.onSetImageUrl()},async onRemove(){this.onSetImageUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`},ut={key:0,class:`required-badge`};function dt(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`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`grokvideo.name.image`)),1),t.required?(g(),s(`span`,ut,i(t.$t(`grokvideo.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`grokvideo.description.image`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.fileList.splice(t.fileList.indexOf(e),1)},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(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])}var ft=G(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`,limit:pt,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.grokvideo?.config?.reference_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}}},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.onSetReferenceImages()},onExceed(){Y.warning(this.$t(`grokvideo.message.uploadReferenceExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,reference_image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},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.onSetReferenceImages()}}}),ht={class:`field mb-[10px] flex items-center justify-between`},gt={class:`title m-0 text-[14px] font-bold`},_t={class:`upload-wrapper flex flex-col items-start gap-[8px]`},vt={class:`controls flex items-center`},yt={class:`file-list flex flex-wrap gap-[10px]`};function bt(t,n,o,u,d,m){let _=l(`upload-icon`),v=l(`el-button`),y=l(`el-upload`),b=l(`info-icon`),x=l(`image-preview`);return g(),s(c,null,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`grokvideo.name.referenceImages`)),1),e(`div`,_t,[e(`div`,vt,[a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:t.limit,multiple:!0,"show-file-list":!1,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(v,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(_,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:t.$t(`grokvideo.description.referenceImages`)},null,8,[`content`])])])]),e(`div`,yt,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),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))])],64)}var xt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:F,ElButton:U,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:G(mt,[[`render`,bt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!R(this.$store.state.grokvideo?.config?.model)},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),St={class:`flex flex-col h-full`},Ct={class:`flex-1 overflow-y-auto p-5`},wt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Tt(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`image-input`),S=l(`reference-images-input`),C=l(`consumption`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,St,[e(`div`,Ct,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),t.supportsReferenceImages?(g(),f(S,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,wt,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Et=G(xt,[[`render`,Tt]]),Dt=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:A,FullscreenIcon:k,InfoIcon:M,MagicIcon:F,TimeIcon:D,WarningIcon:N,CopyToClipboard:O,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:U,ImagePreview:Z,ApiCodeButton:ge},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_url},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),Ot={class:`preview`},kt={class:`left`},At={class:`main`},jt={class:`bot`},Mt={class:`datetime`},Nt={class:`info`},Pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Ft={key:1,class:`prompt mt-2`},It={key:0},Lt={key:1},Rt={key:0,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vt={key:1,class:n({content:!0})},Ht={key:0,class:`mb-4`},Ut={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Wt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:0},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xt={key:2,class:n({content:!0})},Zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$t={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:3,class:n({content:!0})},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function nn(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`fullscreen-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,Ot,[e(`div`,kt,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,At,[e(`div`,jt,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,Mt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Nt,[n.inputImage?(g(),s(`div`,Pt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Ft,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,Lt,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Vt,[n.video?.video_url?(g(),s(`div`,Ht,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ut,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`grokvideo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`grokvideo.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/grok/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Wt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Gt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,qt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,$,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Jt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Yt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Xt,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failure`)),1)]),default:p(()=>[e(`p`,Zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Qt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$t,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,en,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.status`)),1)]),default:p(()=>[e(`p`,tn,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Rt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Bt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var rn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:G(Dt,[[`render`,nn],[`__scopeId`,`data-v-714ce001`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.grokvideo?.tasks,items:this.$store.state.grokvideo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),an={key:0},on={key:2,class:`w-full h-full flex items-center justify-center`};function sn(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`,an,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,on,[a(v)])):o(``,!0)],64)}var cn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Et,Layout:Ce,RecentPanel:G(rn,[[`render`,sn]])},mixins:[q],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===J.Request||this.fetchingTasks},credential(){return this.$store.state.grokvideo?.credential},config(){return this.$store.state.grokvideo?.config},tasks(){return this.$store.state.grokvideo?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await me({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`grokvideo/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`grokvideo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ue(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config||{}};typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),typeof e?.image_url==`string`&&!e.image_url.trim()&&delete e.image_url,(R(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(R(e?.model)&&!t){Y.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){Y.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!H())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}Y.info(this.$t(`grokvideo.message.startingTask`)),ce(`grokvideo`,le.generate(n,{token:r})).then(()=>{Y.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?Y.error(this.$t(`grokvideo.message.usedUp`)):Y.error(this.$t(`grokvideo.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ln(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var un=G(cn,[[`render`,ln]]);export{un 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-CiXAUiuv.js";import{t as x}from"./upload-BzBhmZxi.js";import{t as S}from"./tooltip-CqIZfKUP.js";import{t as C}from"./alert-CbdM7xM3.js";import{t as w}from"./drawer-KfWBQxDz.js";import{n as T}from"./taskDrawerMixin-CPhjUGCy.js";import{t as E}from"./box-DUbdQWmp.js";import{t as D}from"./clock-DRnti55a.js";import{t as O}from"./CopyToClipboard-7Ujng4SJ.js";import{n as k,r as A,t as j}from"./PromptTextarea-Ct-ACb4r.js";import{t as M}from"./info-DIS9MTgX.js";import{t as N}from"./triangle-alert-DY6fUtMw.js";import{t as P}from"./upload-Cx-GvBHT.js";import{t as F}from"./wand-sparkles-DlpvrxJE.js";import{At as I,Bt as L,Ft as ee,Ht as te,It as ne,Lt as re,Mt as ie,Pt as ae,Rt as oe,Ut as R,jt as z,kt as B,zt as V}from"./constants-Bq6v7ZuS.js";import{$t as H,Ai as U,Bt as W,E as G,Ht as K,Vt as q,Wt as se,ei as J,gi as Y,mr as ce,ri as X,xn as le,zt as ue}from"./index-CV77yiwr.js";import{t as Z}from"./ImagePreview-DA0KgRxc.js";import{t as de}from"./Consumption-C97cUgXC.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-DyPo67Lf.js";import{t as he}from"./VideoPlayer-C13TiYLD.js";import{t as ge}from"./ApiCodeButton-D4DyTm8N.js";import{t as _e}from"./BotPlaceholder-CHZUU5yo.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:F,ElDrawer:w,ElButton:U},mixins:[T]}),ye={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[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 Ce=G(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.grokvideo?.config?.prompt},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(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(`grokvideo.name.prompt`),info:e.$t(`grokvideo.description.prompt`),placeholder:e.$t(`grokvideo.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=G(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:ee,label:this.$t(`grokvideo.model.default`)},{value:ae,label:this.$t(`grokvideo.model.preview15`)}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.model},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,model:e})}}},mounted(){this.value||=B}}),Oe={class:`field`},ke={class:`label`},Ae={class:`box`},je={class:`title font-bold`};function Me(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`grokvideo.name.model`)),1),a(m,{content:t.$t(`grokvideo.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=G(De,[[`render`,Me],[`__scopeId`,`data-v-291d93fb`]]),Pe=v({name:`GrokVideoDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.grokvideo?.config?.model},maxDuration(){return te(this.model)},options(){return ie.filter(e=>e<=this.maxDuration).map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.grokvideo?.config?.duration},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,duration:e})}}},watch:{maxDuration(e){this.value&&this.value>e&&(this.value=e)}},mounted(){this.value||=6}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`grokvideo.name.duration`)),1),a(m,{content:t.$t(`grokvideo.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Be=G(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:V,label:`480p`},{value:L,label:`720p`},{value:oe,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.resolution},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,resolution:e})}}},mounted(){this.value||=z}}),He={class:`resolution`},Ue={class:`header`},We={class:`title font-bold`},Ge={class:`items`},Ke=[`onClick`];function qe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`grokvideo.name.resolution`)),1),a(p,{content:t.$t(`grokvideo.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ge,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Ke))),128))])])}var Je=G(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:ne,label:`16:9`,w:32,h:18},{value:re,label:`9:16`,w:18,h:32},{value:`1:1`,label:`1:1`,w:24,h:24},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`3:2`,label:`3:2`,w:30,h:20},{value:`2:3`,label:`2:3`,w:20,h:30}]},value:{get(){return this.$store.state.grokvideo?.config?.aspect_ratio},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,aspect_ratio:e})}}},mounted(){this.value||=I}}),Xe={class:`ratio`},Ze={class:`header`},Qe={class:`title font-bold`},$e={class:`items`},et=[`onClick`],tt={class:`preview`},nt={class:`name`};function rt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`grokvideo.name.ratio`)),1),a(p,{content:t.$t(`grokvideo.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,$e,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,tt,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,nt,i(r.label),1)],10,et))),128))])])}var it=G(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return R(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){Y.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,image_url:e||void 0})},async onSuccess(){this.onSetImageUrl()},async onRemove(){this.onSetImageUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`},ut={key:0,class:`required-badge`};function dt(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`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`grokvideo.name.image`)),1),t.required?(g(),s(`span`,ut,i(t.$t(`grokvideo.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`grokvideo.description.image`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.fileList.splice(t.fileList.indexOf(e),1)},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(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])}var ft=G(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`,limit:pt,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.grokvideo?.config?.reference_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}}},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.onSetReferenceImages()},onExceed(){Y.warning(this.$t(`grokvideo.message.uploadReferenceExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,reference_image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},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.onSetReferenceImages()}}}),ht={class:`field mb-[10px] flex items-center justify-between`},gt={class:`title m-0 text-[14px] font-bold`},_t={class:`upload-wrapper flex flex-col items-start gap-[8px]`},vt={class:`controls flex items-center`},yt={class:`file-list flex flex-wrap gap-[10px]`};function bt(t,n,o,u,d,m){let _=l(`upload-icon`),v=l(`el-button`),y=l(`el-upload`),b=l(`info-icon`),x=l(`image-preview`);return g(),s(c,null,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`grokvideo.name.referenceImages`)),1),e(`div`,_t,[e(`div`,vt,[a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:t.limit,multiple:!0,"show-file-list":!1,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(v,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(_,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:t.$t(`grokvideo.description.referenceImages`)},null,8,[`content`])])])]),e(`div`,yt,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),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))])],64)}var xt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:F,ElButton:U,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:G(mt,[[`render`,bt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!R(this.$store.state.grokvideo?.config?.model)},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),St={class:`flex flex-col h-full`},Ct={class:`flex-1 overflow-y-auto p-5`},wt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Tt(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`image-input`),S=l(`reference-images-input`),C=l(`consumption`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,St,[e(`div`,Ct,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),t.supportsReferenceImages?(g(),f(S,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,wt,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Et=G(xt,[[`render`,Tt]]),Dt=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:A,FullscreenIcon:k,InfoIcon:M,MagicIcon:F,TimeIcon:D,WarningIcon:N,CopyToClipboard:O,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:U,ImagePreview:Z,ApiCodeButton:ge},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_url},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),Ot={class:`preview`},kt={class:`left`},At={class:`main`},jt={class:`bot`},Mt={class:`datetime`},Nt={class:`info`},Pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Ft={key:1,class:`prompt mt-2`},It={key:0},Lt={key:1},Rt={key:0,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vt={key:1,class:n({content:!0})},Ht={key:0,class:`mb-4`},Ut={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Wt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:0},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xt={key:2,class:n({content:!0})},Zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$t={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:3,class:n({content:!0})},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function nn(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`fullscreen-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,Ot,[e(`div`,kt,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,At,[e(`div`,jt,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,Mt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Nt,[n.inputImage?(g(),s(`div`,Pt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Ft,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,Lt,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Vt,[n.video?.video_url?(g(),s(`div`,Ht,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ut,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`grokvideo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`grokvideo.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/grok/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Wt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Gt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,qt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,$,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Jt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Yt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Xt,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failure`)),1)]),default:p(()=>[e(`p`,Zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Qt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$t,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,en,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.status`)),1)]),default:p(()=>[e(`p`,tn,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Rt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Bt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var rn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:G(Dt,[[`render`,nn],[`__scopeId`,`data-v-714ce001`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.grokvideo?.tasks,items:this.$store.state.grokvideo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),an={key:0},on={key:2,class:`w-full h-full flex items-center justify-center`};function sn(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`,an,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,on,[a(v)])):o(``,!0)],64)}var cn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Et,Layout:Ce,RecentPanel:G(rn,[[`render`,sn]])},mixins:[q],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===J.Request||this.fetchingTasks},credential(){return this.$store.state.grokvideo?.credential},config(){return this.$store.state.grokvideo?.config},tasks(){return this.$store.state.grokvideo?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await me({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`grokvideo/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`grokvideo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ue(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config||{}};typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),typeof e?.image_url==`string`&&!e.image_url.trim()&&delete e.image_url,(R(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(R(e?.model)&&!t){Y.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){Y.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!H())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}Y.info(this.$t(`grokvideo.message.startingTask`)),ce(`grokvideo`,le.generate(n,{token:r})).then(()=>{Y.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?Y.error(this.$t(`grokvideo.message.usedUp`)):Y.error(this.$t(`grokvideo.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ln(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var un=G(cn,[[`render`,ln]]);export{un as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-3fwfmhvM.js";import{t as h}from"./check-Cc02Y3ax.js";import{t as g}from"./external-link-DpG3vEdE.js";import{t as ee}from"./globe-DkpQWUKq.js";import{t as te}from"./wand-sparkles-C2tZqsJR.js";import{A as _,Ai as v,E as y,i as b,r as x,rn as S}from"./index-D2ugFcRR.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||S()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:x[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-CazdMwg5.js";import{t as h}from"./check-DSFVyLIN.js";import{t as g}from"./external-link-B18wUPg2.js";import{t as ee}from"./globe-skZazDQw.js";import{t as te}from"./wand-sparkles-DlpvrxJE.js";import{A as _,Ai as v,E as y,i as b,r as x,rn as S}from"./index-CV77yiwr.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||S()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:x[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as f}from"./table-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as f}from"./table-B8WcbeSJ.js";import{t as ee}from"./tooltip-CqIZfKUP.js";import{t as p}from"./card-D-4S-l7a.js";import{n as m,t as h}from"./row-Db1UIu1H.js";import{t as g}from"./divider-BNWJAaA2.js";import{t as _}from"./progress-BeEbKKvj.js";import{t as v}from"./skeleton-BVbQKb45.js";import{t as y}from"./coins-kClPhm7N.js";import{t as b}from"./CopyToClipboard-7Ujng4SJ.js";import{t as x}from"./link-CTSKiE5Z.js";import{t as S}from"./user-BoLedcgo.js";import{t as C}from"./wallet-Dr83XtK-.js";import{Ai as w,E as T,Ft as E,Gt as D,Jn as O,Q as k,X as A,Xn as j,Yn as M,in as N,mi as P,or as F}from"./index-CV77yiwr.js";var I=u({name:`ConsoleDistributionList`,components:{CreditsIcon:y,LinkIcon:x,PercentIcon:P(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),UserIcon:S,WalletIcon:C,CopyToClipboard:b,QrCode:E,ElProgress:_,ElRow:h,ElCol:m,ElButton:w,ElDivider:g,ElCard:p,ElTooltip:ee,ElTable:f,ElTableColumn:d,ElSkeleton:v},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)},qrColor(){let e=document.documentElement.classList.contains(`dark`);return{dark:e?`#ffffff`:`#000000`,light:e?`#1e1e1e`:`#ffffff`}},distributionLevelMap(){let e={};return this.distributionLevels.forEach(t=>{e[t.level]=t}),e}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:D,goHistory(){this.$router.push({name:A})},goInvitees(){this.$router.push({name:k})},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},getPercentageForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-e)/(t-e)*100)},getDeltaForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(e-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await M.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){let e=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{let t=(await j.create(e))?.data?.data?.url||e;this.distributionLink=N()?t.replace(`surl.id`,`share.acedata.cloud`):t}catch{this.distributionLink=e}},async onFetchDistributionStatus(){let{data:e}=await M.getAll({user_id:this.$store.getters.user.id});e.items&&e.items.length>0&&(this.distributionStatus=e.items[0])},async onFetchDistributionLevels(){let{data:e}=await O.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=e.items},async onFetchInvitees(){let{data:e}=await F.getInvitees({});this.invitees=e.items,this.inviteesCount=e.count}}}),L={class:`title`},R={key:1},z={class:`icon-wrapper`},B={class:`text-left`},V={class:`description`},H={class:`value`},U={key:1},W={class:`icon-wrapper`},G={class:`text-left`},K={class:`description`},q={class:`value`},J={key:1},Y={class:`icon-wrapper`},X={class:`text-left`},Z={class:`description`},te={class:`value`},Q={key:1},ne={class:`icon-wrapper`},re={class:`text-left`},ie={class:`description`},ae={class:`value`},oe={key:1},se={class:`title`},ce={class:`clear-both overflow-hidden`},le={class:`float-left description`},ue={class:`float-right description`},de={class:`description`},fe={class:`level`},pe={class:`level`},$={class:`level`},me={key:1},he={class:`title`},ge={class:`link-wrapper text-center`},_e=[`href`],ve={class:`qr-wrapper ml-auto mr-auto`},ye={class:`mt-0`},be={class:`description`},xe={class:`more`};function Se(u,d,f,ee,p,m){let h=o(`el-col`),g=o(`el-row`),_=o(`el-skeleton`),v=o(`wallet-icon`),y=o(`el-button`),b=o(`el-card`),x=o(`credits-icon`),S=o(`el-tooltip`),C=o(`percent-icon`),w=o(`user-icon`),T=o(`el-progress`),E=o(`el-divider`),D=o(`el-table-column`),O=o(`el-table`);o(`link-icon`);let k=o(`copy-to-clipboard`),A=o(`qr-code`);return l(),s(g,{class:`panel`},{default:c(()=>[r(h,{span:24},{default:c(()=>[r(g,null,{default:c(()=>[r(h,{span:24},{default:c(()=>[e(`h2`,L,n(u.$t(`common.title.distribution`)),1)]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,R,[e(`div`,z,[r(v,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,B,[e(`p`,V,n(u.$t(`distribution.title.price`)),1),e(`p`,H,n(u.getPriceString({value:u.distributionStatus?.price})),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goHistory},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,U,[e(`div`,W,[r(x,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,G,[e(`p`,K,n(u.$t(`distribution.title.reward`)),1),e(`p`,q,n(u.getPriceString({value:u.distributionStatus?.reward})),1)]),r(S,{effect:`dark`,content:u.$t(`distribution.message.developingWithDrawal`),placement:`top`},{default:c(()=>[r(y,{type:`primary`,round:``,size:`small`,class:`btn`},{default:c(()=>[t(n(u.$t(`distribution.button.withdrawal`)),1)]),_:1})]),_:1},8,[`content`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,J,[e(`div`,Y,[r(C,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,X,[e(`p`,Z,n(u.$t(`distribution.title.percentage`)),1),e(`p`,te,n(u.distributionStatus?.level?.percentage)+`%`,1)])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,Q,[e(`div`,ne,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,re,[e(`p`,ie,n(u.$t(`distribution.title.inviteesCount`)),1),e(`p`,ae,n(u.inviteesCount),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goInvitees},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`level-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,oe,[e(`h4`,se,n(u.$t(`distribution.title.levelInfo`)),1),e(`div`,ce,[e(`div`,le,[e(`p`,null,n(u.$t(`distribution.title.currentLevel`))+`: L`+n(u.distributionStatus?.level?.level),1),e(`p`,null,n(u.$t(`distribution.title.currentPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level]?.percentage)+`% `,1)]),e(`div`,ue,[e(`p`,null,n(u.$t(`distribution.title.nextLevel`))+`: L`+n(u.distributionStatus?.level?.level+1),1),e(`p`,null,n(u.$t(`distribution.title.nextPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level+1]?.percentage)+`% `,1)])]),r(T,{"text-inside":!0,"stroke-width":20,percentage:u.getPercentageForNextLevel(),class:`mb-2`},null,8,[`percentage`]),e(`p`,de,n(u.$t(`distribution.message.deltaPriceForNextLevel`))+`: $`+n(u.getDeltaForNextLevel()),1),r(E),u.distributionLevels?(l(),s(O,{key:0,data:u.distributionLevels,stripe:``},{default:c(()=>[r(D,{label:u.$t(`distribution.field.level`)},{default:c(t=>[e(`span`,fe,`L`+n(t.row?.level),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.threshold`)},{default:c(t=>[e(`span`,pe,`$`+n(t.row?.threshold),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.percentage`)},{default:c(t=>[e(`span`,$,n(t.row?.percentage)+`%`,1)]),_:1},8,[`label`])]),_:1},8,[`data`])):i(``,!0)]))]),_:1})]),_:1}),r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`distribution-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,me,[e(`h4`,he,n(u.$t(`distribution.title.distributionLink`)),1),r(E),e(`div`,ge,[i(``,!0),e(`a`,{href:u.distributionLink,class:`link`},n(u.distributionLink),9,_e),r(k,{content:u.distributionLink},null,8,[`content`])]),e(`div`,ve,[u.distributionLink?(l(),s(A,{key:0,value:u.distributionLink,size:180,margin:2,class:`block mb-2 ml-auto mr-auto`,type:`image/png`,color:u.qrColor},null,8,[`value`,`color`])):i(``,!0),e(`p`,ye,n(u.$t(`distribution.message.distributionQrDescription`)),1)]),e(`p`,be,[t(n(u.$t(`distribution.message.distributionLinkDescription`))+` `,1),e(`span`,xe,[r(S,{effect:`dark`,content:u.$t(`distribution.message.distributionLinkDescription2`),placement:`top`},{default:c(()=>[t(n(u.$t(`distribution.message.technicalDetail`)),1)]),_:1},8,[`content`])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Ce=T(I,[[`render`,Se],[`__scopeId`,`data-v-3657f823`]]);export{Ce as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-CiXAUiuv.js";import{n as b,t as x}from"./tabs-VIxPOc3b.js";import{t as S}from"./upload-BzBhmZxi.js";import{t as C}from"./tooltip-CqIZfKUP.js";import{t as w}from"./alert-CbdM7xM3.js";import{t as T}from"./drawer-KfWBQxDz.js";import{t as E}from"./switch-Clv7FWdl.js";import{n as D}from"./taskDrawerMixin-CPhjUGCy.js";import{t as O}from"./box-DUbdQWmp.js";import{t as k}from"./clock-DRnti55a.js";import{t as A}from"./CopyToClipboard-7Ujng4SJ.js";import{n as j,r as M,t as N}from"./PromptTextarea-Ct-ACb4r.js";import{t as P}from"./info-DIS9MTgX.js";import{t as F}from"./languages-DNM9nm-V.js";import{t as ee}from"./triangle-alert-DY6fUtMw.js";import{t as te}from"./upload-Cx-GvBHT.js";import{t as I}from"./wand-sparkles-DlpvrxJE.js";import{t as ne}from"./zap-DlJNa_Tm.js";import{$r as L,ei as R,ti as z}from"./constants-Bq6v7ZuS.js";import{$t as re,Ai as B,Bn as ie,Bt as ae,E as V,Ht as H,Vt as U,Wt as W,ei as G,gi as K,mr as q,ri as J,zt as oe}from"./index-CV77yiwr.js";import{t as Y}from"./ImagePreview-DA0KgRxc.js";import{t as se}from"./Consumption-C97cUgXC.js";import{a as X,n as ce,r as le,t as ue}from"./pagination-DyPo67Lf.js";import{t as de}from"./VideoPlayer-C13TiYLD.js";import{t as fe}from"./ApiCodeButton-D4DyTm8N.js";import{t as pe}from"./BotPlaceholder-CHZUU5yo.js";var me=_({name:`LayoutVeo`,components:{MagicIcon:I,ElDrawer:T,ElButton:B},mixins:[D]}),he={class:`main flex flex-row flex-1`},ge={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)]`},_e={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ve(t,n,r,a,s,d){let p=c(`magic-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,he,[e(`div`,ge,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,_e,[u(t.$slots,`result`,{},void 0,!0)]),l(i(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:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=V(me,[[`render`,ve],[`__scopeId`,`data-v-293c9493`]]),Z=`veo31-fast-ingredients`,be=[{value:`veo31-fast`,label:`Veo 3.1 Fast`},{value:`veo3-fast`,label:`Veo 3 Fast`},{value:`veo31`,label:`Veo 3.1`},{value:`veo3`,label:`Veo 3`}],Q=(e,t)=>{let n=!!(e?.action&&e.action!==t),r={...e,action:t};return t===`text2video`?(r.model=r.model===`veo31-fast-ingredients`?z:r.model||`veo31-fast`,delete r.image_urls,r):t===`ingredients2video`?(r.model=Z,n?delete r.image_urls:r.image_urls=r.image_urls?.slice(0,3),r):(r.model=r.model===`veo31-fast-ingredients`?z:r.model||`veo31-fast`,n?delete r.image_urls:r.image_urls=r.image_urls?.slice(0,2),r)},xe=e=>{let t={...Q(e,e?.action||`text2video`),async:!0};return t.image_urls?.length||delete t.image_urls,t},Se=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},computed:{isModelLocked(){return this.$store.state.veo?.config?.action===`ingredients2video`},options(){return this.isModelLocked?[{value:Z,label:`Veo 3.1 Fast`}]:be},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||=z}}),Ce={class:`field`},we={class:`title font-bold`};function Te(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ce,[e(`h2`,we,r(t.$t(`veo.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),disabled:t.isModelLocked},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var Ee=V(Se,[[`render`,Te],[`__scopeId`,`data-v-90ed8cff`]]),De=_({name:`ActionSelector`,components:{ElTabs:b,ElTabPane:x},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(L)},methods:{onUpdate(e){this.$store.commit(`veo/setConfig`,Q(this.$store.state.veo?.config,e))}}});function Oe(e,t,n,r,i,a){let l=c(`el-tab-pane`),u=c(`el-tabs`);return h(),d(u,{"model-value":e.value,class:`action-tabs scenario-tabs scenario-tabs--divided`,stretch:``,"onUpdate:modelValue":e.onUpdate},{default:f(()=>[(h(!0),o(s,null,m(e.options,e=>(h(),d(l,{key:e.value,name:e.value,label:e.label},null,8,[`name`,`label`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var ke=V(De,[[`render`,Oe],[`__scopeId`,`data-v-531a5c55`]]),Ae=_({name:`TranslationSelector`,components:{ElSwitch:E,InfoIcon:X},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)}}),je={class:`relative`},Me={class:`flex justify-between`},Ne={class:`flex justify-start items-center`},Pe={class:`text-sm font-bold`},Fe={class:`flex justify-end items-center`};function Ie(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-switch`);return h(),o(`div`,je,[e(`div`,Me,[e(`div`,Ne,[e(`span`,Pe,r(t.$t(`veo.name.translation`)),1),i(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,Fe,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Le=V(Ae,[[`render`,Ie]]),Re=_({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||=R}}),ze={class:`text-sm font-bold mb-2 block`},Be={class:`items`},Ve=[`onClick`],He={class:`name`};function Ue(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,ze,r(n.$t(`veo.name.ratio`)),1),e(`div`,Be,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,He,r(i.label),1)],10,Ve))),128))])])}var We=V(Re,[[`render`,Ue],[`__scopeId`,`data-v-28c472c4`]]),Ge=_({name:`StartEndImage`,components:{UploadIcon:te,ElUpload:S,ElButton:B,InfoIcon:X,ImagePreview:Y},mixins:[H,ae],props:{limit:{type:Number,default:2},ingredients:{type:Boolean,default:!1}},emits:[`change`],data(){return{fileList:[],uploadUrl:J()+`/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(){K.warning(this.$t(`veo.message.uploadReferencesLimit`,{limit:this.limit}))},onError(){K.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()}}}),Ke={class:`relative`},qe={class:`flex justify-between`},Je={class:`flex justify-start items-center`},Ye={class:`text-sm font-bold`};function Xe(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`upload-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`span`,Ye,r(t.title),1),i(g,{content:t.description},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.limit,class:`upload-wrapper`,multiple:!0,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ze=V(Ge,[[`render`,Xe],[`__scopeId`,`data-v-89137805`]]),Qe=_({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 $e(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(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 et=_({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:B,Consumption:se,PromptInput:V(Qe,[[`render`,$e]]),ModelSelector:Ee,StartEndImage:Ze,ActionSelector:ke,TranslationSelector:Le,AspectRatioSelector:We},emits:[`generate`],computed:{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 W(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),tt={class:`flex flex-col h-full`},nt={class:`flex-1 overflow-y-auto p-5`},rt={class:`flex flex-col items-center justify-center px-5 pb-5`};function it(t,s,l,u,p,m){let g=c(`action-selector`),_=c(`model-selector`),v=c(`start-end-image`),y=c(`prompt-input`),b=c(`aspect-ratio-selector`),x=c(`translation-selector`),S=c(`consumption`),C=c(`magic-icon`),w=c(`el-button`);return h(),o(`div`,tt,[e(`div`,nt,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),t.showsImages?(h(),d(v,{key:t.config?.action,class:`mb-4`,limit:t.imageLimit,ingredients:t.config?.action===`ingredients2video`},null,8,[`limit`,`ingredients`])):a(``,!0),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`})]),e(`div`,rt,[i(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`veo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var at=V(et,[[`render`,it]]),ot=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:M,ExpandIcon:j,InfoIcon:P,LanguageIcon:F,LightningIcon:ne,MagicIcon:I,TimeIcon:k,WarningIcon:ee,CopyToClipboard:A,ElAlert:w,VideoPlayer:de,ImagePreview:Y,ElTooltip:C,ElButton:B,ApiCodeButton:fe},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:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),st={class:`preview`},ct={class:`left`},lt={class:`main`},ut={class:`bot`},dt={class:`datetime`},ft={class:`info`},pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},mt={key:1,class:`prompt mt-2`},ht={key:0},gt={key:1},_t={key:0,class:t({content:!0,failed:!0})},vt={key:0,class:`mb-4`},yt={key:1,class:t({operations:!0,"mt-2":!0})},bt={key:1,class:t({content:!0})},xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={class:t({content:!0})},Ct={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function kt(l,u,p,g,_,v){let y=c(`capability-presentation`),b=c(`image-preview`),x=c(`video-player`),S=c(`el-button`),C=c(`el-tooltip`),w=c(`api-code-button`),T=c(`warning-icon`),E=c(`info-icon`),D=c(`copy-to-clipboard`),O=c(`el-alert`),k=c(`application-icon`),A=c(`lightning-icon`),j=c(`expand-icon`),M=c(`language-icon`),N=c(`magic-icon`),P=c(`time-icon`),F=c(`channel-icon`);return h(),o(`div`,st,[e(`div`,ct,[i(y,{capability:`veo`,part:`avatar`,class:`avatar`})]),e(`div`,lt,[e(`div`,ut,[i(y,{capability:`veo`,part:`name`}),e(`span`,dt,r(l.$dayjs.format(``+new Date(parseFloat((l.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,ft,[l.referenceImages.length>0?(h(),o(`div`,pt,[(h(!0),o(s,null,m(l.referenceImages,(e,t)=>(h(),d(b,{key:`${t}-${e}`,url:e,name:`reference-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):a(``,!0),l.modelValue?.request?.prompt?(h(),o(`p`,mt,[n(r(l.modelValue?.request?.prompt)+` `,1),l.modelValue?.response?a(``,!0):(h(),o(`span`,ht,` - (`+r(l.$t(`veo.status.pending`))+`) `,1)),Array.isArray(l.modelValue?.response?.data)&&l.modelValue?.response?.data[0]?.state===`running`?(h(),o(`span`,gt,` - (`+r(l.$t(`veo.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),l.modelValue?.response?.success===!0&&l.modelValue?.response?.data?(h(),o(`div`,_t,[l.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,vt,[i(x,{src:l.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),l.modelValue?.response.success?(h(),o(`div`,yt,[i(C,{class:`box-item`,effect:`dark`,content:l.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:f(()=>[l.modelValue?.response?.data[0]?.video_url?(h(),d(S,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=e=>l.onDownload(e,l.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(l.$t(`veo.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(w,{path:`/veo/videos`,body:l.modelValue?.request},null,8,[`body`])])):a(``,!0)])):a(``,!0),l.modelValue?.response?.success===!1?(h(),o(`div`,bt,[i(O,{closable:!1,class:`failure`},{template:f(()=>[i(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.failure`)),1)]),default:f(()=>[e(`p`,xt,[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.failureReason`))+`: `+r(l.modelValue?.response?.error?.message)+` `,1),i(D,{content:l.modelValue?.response?.error?.message},null,8,[`content`])])]),_:1})])):a(``,!0),e(`div`,St,[i(O,{closable:!1,class:t([`mt-2`,`task-metadata`,l.taskInfoClass])},{default:f(()=>[l.modelValue?.request?.model?(h(),o(`p`,Ct,[i(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.model`))+`: `+r(l.modelValue?.request?.model),1)])):a(``,!0),e(`p`,wt,[i(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.action`))+`: `+r(l.actionLabel),1)]),l.modelValue?.request?.aspect_ratio?(h(),o(`p`,Tt,[i(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.ratio`))+`: `+r(l.modelValue?.request?.aspect_ratio),1)])):a(``,!0),l.modelValue?.request?.translation===void 0?a(``,!0):(h(),o(`p`,Et,[i(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.translation`))+`: `+r(l.$t(l.modelValue?.request?.translation?`seedance.button.on`:`seedance.button.off`)),1)])),e(`p`,$,[i(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.taskId`))+`: `+r(l.modelValue?.id)+` `,1),i(D,{content:l.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),l.modelValue?.elapsed?(h(),o(`p`,Dt,[i(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.elapsed`))+`: `+r(l.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),l.traceId?(h(),o(`p`,Ot,[i(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.traceId`))+`: `+r(l.traceId)+` `,1),i(D,{content:l.traceId,class:`btn-copy inline-block`},null,8,[`content`])])):a(``,!0)]),_:1},8,[`class`])])])])}var At=_({name:`RecentPanel`,components:{TaskPreview:V(ot,[[`render`,kt],[`__scopeId`,`data-v-54ddb667`]]),NoTasks:le,BotPlaceholder:pe,ScrollList:ce},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?.()}}}),jt={key:0},Mt={key:2,class:`w-full h-full flex items-center justify-center`};function Nt(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,jt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{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:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,Mt,[i(v)])):a(``,!0)],64)}var Pt=_({name:`VeoIndex`,components:{ConfigPanel:at,Layout:ye,RecentPanel:V(At,[[`render`,Nt]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ue({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})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!oe(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e=xe(this.config);if(!re())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}if((e.action===`image2video`||e.action===`ingredients2video`)&&!(e.image_urls&&e.image_urls.length>0)){K.warning(this.$t(`veo.message.imageRequired`));return}K.info(this.$t(`veo.message.startingTask`)),q(`veo`,ie.generate(e,{token:t})).then(()=>{K.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`veo.message.usedUp`)):K.error(this.$t(`veo.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ft(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var It=V(Pt,[[`render`,Ft]]);export{It 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-BLM0v92m.js";import{t as x}from"./upload-dOdEM0mX.js";import{t as S}from"./tooltip-CaHCcyJq.js";import{t as C}from"./alert-Dd3pcgZr.js";import{t as w}from"./drawer-anvkTtti.js";import{t as T}from"./input-number-DFySdlyu.js";import{t as E}from"./switch-CzEQE2DH.js";import{n as D}from"./taskDrawerMixin-Bsm_pfmZ.js";import{t as O}from"./box-BNgmySYi.js";import{t as k}from"./clock-CWEF1y39.js";import{t as A}from"./CopyToClipboard-CZA6WQWP.js";import{r as j,t as M}from"./PromptTextarea-Bdpc7bLs.js";import{t as N}from"./image-Ba6DqjQ8.js";import{t as P}from"./info-DhKCbyPk.js";import{t as F}from"./triangle-alert-vfYvzN9x.js";import{t as ee}from"./upload-25kqK9dU.js";import{t as I}from"./wand-sparkles-C2tZqsJR.js";import{t as L}from"./zap-T3F5bwrg.js";import{An as te,Bn as ne,Dn as re,Fn as ie,In as R,Mn as ae,Nn as oe,On as se,Pn as z,Rn as B,kn as V,zn as H}from"./constants-Bq6v7ZuS.js";import{$t as U,Ai as W,Bt as G,E as K,Vt as ce,Wt as le,ei as q,gi as J,mr as ue,ri as de,wn as Y,zt as fe}from"./index-D2ugFcRR.js";import{t as X}from"./ImagePreview-Cegc7Kc9.js";import{t as pe}from"./Consumption-BNM0d3BL.js";import{a as Z,n as me,r as he,t as ge}from"./pagination-DdsSvKkV.js";import{t as _e}from"./ApiCodeButton-BuAXokaf.js";import{t as ve}from"./BotPlaceholder-DrMa4leC.js";import{t as ye}from"./ImageWrapper-hjcr_HZW.js";var be=_({name:`LayoutNanobanana`,components:{MagicIcon:I,ElDrawer:w,ElButton:W},mixins:[D]}),xe={class:`main flex flex-row flex-1`},Se={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)]`},Ce={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function we(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,xe,[e(`div`,Se,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ce,[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 Te=K(be,[[`render`,we],[`__scopeId`,`data-v-fa2172a6`]]),Ee=_({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 De(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 Oe=K(Ee,[[`render`,De]]),ke=_({name:`ImageUrlsInput`,components:{UploadIcon:ee,ElUpload:x,ElButton:W,InfoIcon:Z,ImagePreview:X},mixins:[G],data(){return{fileList:[],uploadUrl:de()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.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(){J.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){J.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()}}}),Ae={class:`field flex items-center justify-between`},je={class:`title font-bold text-[14px] mb-[10px]`},Me={class:`upload-wrapper flex flex-col items-start gap-[8px]`},Ne={class:`controls flex items-center`},Pe={class:`file-list flex flex-wrap gap-[10px]`};function Fe(t,n,o,u,d,g){let _=l(`upload-icon`),v=l(`el-button`),y=l(`el-upload`),b=l(`info-icon`),x=l(`image-preview`);return h(),s(c,null,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`openaiimage.name.imageUrls`)),1),e(`div`,Me,[e(`div`,Ne,[a(y,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:5,multiple:!0,"show-file-list":!1,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(v,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(_,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:t.$t(`openaiimage.description.imageUrls`),class:`ml-2`},null,8,[`content`])])])]),e(`div`,Pe,[(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))])],64)}var Ie=K(ke,[[`render`,Fe]]),Le=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ae,label:this.$t(`openaiimage.model.gptImage1`)},{value:oe,label:this.$t(`openaiimage.model.gptImage15`)},{value:z,label:this.$t(`openaiimage.model.gptImage2`)},{value:ie,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||=te}}),Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`};function He(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`h2`,Ve,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 Ue=K(Le,[[`render`,He],[`__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 We=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:E,ElInputNumber:T,InfoIcon:Z},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},emptySizeValue(){return``},customSupported(){return V.includes(this.model)},presets(){return R[this.model]??R[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:B},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:H},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:ne}]:[{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()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return re},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:se.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||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()}},storedSize(e){if(!e){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}`))}}}),Ge={class:`resolution`},Ke={class:`field`},qe={class:`label`},Je={class:`box`},Ye={class:`title font-bold`},Xe={class:`field custom-toggle`},Ze={class:`label`},Qe={class:`box`},$e={class:`title font-bold`},et={key:0,class:`custom-inputs`},tt={class:`row`},nt={class:`row-label`},rt={class:`row`},it={class:`row-label`},at={key:0,class:`error`};function ot(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`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,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(`suno.gender.auto`),value:t.emptySizeValue},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`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`h2`,$e,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`,et,[e(`div`,tt,[e(`span`,nt,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`,rt,[e(`span`,it,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`,at,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var st=_({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:W,PromptInput:Oe,Consumption:pe,ImageUrlsInput:Ie,ModelSelector:Ue,ResolutionSelector:K(We,[[`render`,ot],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return le({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ct={class:`flex flex-col h-full`},lt={class:`flex-1 overflow-y-auto p-5`},ut={class:`flex flex-col items-center justify-center px-5 pb-5`};function dt(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`resolution-selector`),g=l(`prompt-input`),_=l(`image-urls-input`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return h(),s(`div`,ct,[e(`div`,lt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,ut,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ft=K(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:j,ImageIcon:N,InfoIcon:P,LightningIcon:L,MagicIcon:I,TimeIcon:k,WarningIcon:F,CopyToClipboard:A,ElAlert:C,ImageWrapper:ye,ElButton:W,ElTooltip:S,ImagePreview:X,ApiCodeButton:_e},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)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},xt={key:1,class:`prompt mt-2`},St={key:0},Ct={key:0,class:n({content:!0,failed:!0})},wt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},Tt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Et={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:1,class:n({content:!0})},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={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`},Bt={key:2,class:n({content:!0})},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Wt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`image-preview`),x=l(`image-wrapper`),S=l(`el-button`),C=l(`el-tooltip`),w=l(`api-code-button`),T=l(`application-icon`),E=l(`image-icon`),D=l(`lightning-icon`),O=l(`magic-icon`),k=l(`copy-to-clipboard`),A=l(`time-icon`),j=l(`channel-icon`),M=l(`el-alert`),N=l(`warning-icon`),P=l(`info-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.referenceImages.length>0?(h(),s(`div`,bt,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,xt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,St,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[e(`div`,wt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,Tt,[a(C,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(S,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=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(w,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`])]),a(M,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Et,[a(T,{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`,Dt,[a(E,{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`,Ot,[a(D,{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`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(A,{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`,jt,[a(j,{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(k,{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`,Mt,[a(M,{closable:!1,class:`failure`},{template:p(()=>[a(N,{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`,Nt,[a(T,{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`,Pt,[a(E,{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`,Ft,[a(D,{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`,It,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Lt,[a(P,{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(k,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Rt,[a(A,{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(j,{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(k,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Bt,[a(M,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(P,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(A,{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`,$,[a(T,{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`,Vt,[a(E,{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`,Ht,[a(D,{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`,Ut,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Gt=_({name:`RecentPanel`,components:{TaskPreview:K(pt,[[`render`,Wt],[`__scopeId`,`data-v-85516d80`]]),BotPlaceholder:ve,NoTasks:he,ScrollList:me},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?.()}}}),Kt={key:0},qt={key:2,class:`w-full h-full flex items-center justify-center`};function Jt(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`,Kt,[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`,qt,[a(v)])):o(``,!0)],64)}var Yt=_({name:`OpenAIImageIndex`,components:{ConfigPanel:ft,Layout:Te,RecentPanel:K(Gt,[[`render`,Jt]])},mixins:[ce],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===q.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}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ge({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}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!fe(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){J.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 n={...e,action:`generate`,async:!0},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0};if(!U())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}J.info(this.$t(`openaiimage.message.startingTask`)),ue(`openaiimage`,t?Y.edit(r,{token:i}):Y.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),J.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`openaiimage.message.usedUp`)):J.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Xt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Zt=K(Yt,[[`render`,Xt]]);export{Zt 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-CiXAUiuv.js";import{t as x}from"./upload-BzBhmZxi.js";import{t as S}from"./tooltip-CqIZfKUP.js";import{t as C}from"./alert-CbdM7xM3.js";import{t as w}from"./drawer-KfWBQxDz.js";import{t as T}from"./input-number-DeTsh-4B.js";import{t as E}from"./switch-Clv7FWdl.js";import{n as D}from"./taskDrawerMixin-CPhjUGCy.js";import{t as O}from"./box-DUbdQWmp.js";import{t as k}from"./clock-DRnti55a.js";import{t as A}from"./CopyToClipboard-7Ujng4SJ.js";import{r as j,t as M}from"./PromptTextarea-Ct-ACb4r.js";import{t as N}from"./image-CHb7KY3Y.js";import{t as P}from"./info-DIS9MTgX.js";import{t as F}from"./triangle-alert-DY6fUtMw.js";import{t as ee}from"./upload-Cx-GvBHT.js";import{t as I}from"./wand-sparkles-DlpvrxJE.js";import{t as L}from"./zap-DlJNa_Tm.js";import{An as te,Bn as ne,Dn as re,Fn as ie,In as R,Mn as ae,Nn as oe,On as se,Pn as z,Rn as B,kn as V,zn as H}from"./constants-Bq6v7ZuS.js";import{$t as U,Ai as W,Bt as G,E as K,Vt as ce,Wt as le,ei as q,gi as J,mr as ue,ri as de,wn as Y,zt as fe}from"./index-CV77yiwr.js";import{t as X}from"./ImagePreview-DA0KgRxc.js";import{t as pe}from"./Consumption-C97cUgXC.js";import{a as Z,n as me,r as he,t as ge}from"./pagination-DyPo67Lf.js";import{t as _e}from"./ApiCodeButton-D4DyTm8N.js";import{t as ve}from"./BotPlaceholder-CHZUU5yo.js";import{t as ye}from"./ImageWrapper-EqRNomt5.js";var be=_({name:`LayoutNanobanana`,components:{MagicIcon:I,ElDrawer:w,ElButton:W},mixins:[D]}),xe={class:`main flex flex-row flex-1`},Se={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)]`},Ce={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function we(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,xe,[e(`div`,Se,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ce,[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 Te=K(be,[[`render`,we],[`__scopeId`,`data-v-fa2172a6`]]),Ee=_({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 De(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 Oe=K(Ee,[[`render`,De]]),ke=_({name:`ImageUrlsInput`,components:{UploadIcon:ee,ElUpload:x,ElButton:W,InfoIcon:Z,ImagePreview:X},mixins:[G],data(){return{fileList:[],uploadUrl:de()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.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(){J.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){J.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()}}}),Ae={class:`field flex items-center justify-between`},je={class:`title font-bold text-[14px] mb-[10px]`},Me={class:`upload-wrapper flex flex-col items-start gap-[8px]`},Ne={class:`controls flex items-center`},Pe={class:`file-list flex flex-wrap gap-[10px]`};function Fe(t,n,o,u,d,g){let _=l(`upload-icon`),v=l(`el-button`),y=l(`el-upload`),b=l(`info-icon`),x=l(`image-preview`);return h(),s(c,null,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`openaiimage.name.imageUrls`)),1),e(`div`,Me,[e(`div`,Ne,[a(y,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:5,multiple:!0,"show-file-list":!1,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(v,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(_,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:t.$t(`openaiimage.description.imageUrls`),class:`ml-2`},null,8,[`content`])])])]),e(`div`,Pe,[(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))])],64)}var Ie=K(ke,[[`render`,Fe]]),Le=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ae,label:this.$t(`openaiimage.model.gptImage1`)},{value:oe,label:this.$t(`openaiimage.model.gptImage15`)},{value:z,label:this.$t(`openaiimage.model.gptImage2`)},{value:ie,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||=te}}),Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`};function He(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`h2`,Ve,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 Ue=K(Le,[[`render`,He],[`__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 We=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:E,ElInputNumber:T,InfoIcon:Z},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},emptySizeValue(){return``},customSupported(){return V.includes(this.model)},presets(){return R[this.model]??R[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:B},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:H},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:ne}]:[{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()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return re},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:se.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||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()}},storedSize(e){if(!e){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}`))}}}),Ge={class:`resolution`},Ke={class:`field`},qe={class:`label`},Je={class:`box`},Ye={class:`title font-bold`},Xe={class:`field custom-toggle`},Ze={class:`label`},Qe={class:`box`},$e={class:`title font-bold`},et={key:0,class:`custom-inputs`},tt={class:`row`},nt={class:`row-label`},rt={class:`row`},it={class:`row-label`},at={key:0,class:`error`};function ot(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`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,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(`suno.gender.auto`),value:t.emptySizeValue},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`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`h2`,$e,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`,et,[e(`div`,tt,[e(`span`,nt,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`,rt,[e(`span`,it,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`,at,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var st=_({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:W,PromptInput:Oe,Consumption:pe,ImageUrlsInput:Ie,ModelSelector:Ue,ResolutionSelector:K(We,[[`render`,ot],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return le({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ct={class:`flex flex-col h-full`},lt={class:`flex-1 overflow-y-auto p-5`},ut={class:`flex flex-col items-center justify-center px-5 pb-5`};function dt(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`resolution-selector`),g=l(`prompt-input`),_=l(`image-urls-input`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return h(),s(`div`,ct,[e(`div`,lt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,ut,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ft=K(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:j,ImageIcon:N,InfoIcon:P,LightningIcon:L,MagicIcon:I,TimeIcon:k,WarningIcon:F,CopyToClipboard:A,ElAlert:C,ImageWrapper:ye,ElButton:W,ElTooltip:S,ImagePreview:X,ApiCodeButton:_e},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)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},xt={key:1,class:`prompt mt-2`},St={key:0},Ct={key:0,class:n({content:!0,failed:!0})},wt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},Tt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Et={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:1,class:n({content:!0})},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={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`},Bt={key:2,class:n({content:!0})},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Wt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`image-preview`),x=l(`image-wrapper`),S=l(`el-button`),C=l(`el-tooltip`),w=l(`api-code-button`),T=l(`application-icon`),E=l(`image-icon`),D=l(`lightning-icon`),O=l(`magic-icon`),k=l(`copy-to-clipboard`),A=l(`time-icon`),j=l(`channel-icon`),M=l(`el-alert`),N=l(`warning-icon`),P=l(`info-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.referenceImages.length>0?(h(),s(`div`,bt,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,xt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,St,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[e(`div`,wt,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,Tt,[a(C,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(S,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=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(w,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`])]),a(M,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Et,[a(T,{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`,Dt,[a(E,{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`,Ot,[a(D,{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`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(A,{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`,jt,[a(j,{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(k,{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`,Mt,[a(M,{closable:!1,class:`failure`},{template:p(()=>[a(N,{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`,Nt,[a(T,{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`,Pt,[a(E,{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`,Ft,[a(D,{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`,It,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Lt,[a(P,{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(k,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Rt,[a(A,{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(j,{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(k,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Bt,[a(M,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(P,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(A,{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`,$,[a(T,{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`,Vt,[a(E,{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`,Ht,[a(D,{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`,Ut,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(k,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Gt=_({name:`RecentPanel`,components:{TaskPreview:K(pt,[[`render`,Wt],[`__scopeId`,`data-v-85516d80`]]),BotPlaceholder:ve,NoTasks:he,ScrollList:me},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?.()}}}),Kt={key:0},qt={key:2,class:`w-full h-full flex items-center justify-center`};function Jt(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`,Kt,[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`,qt,[a(v)])):o(``,!0)],64)}var Yt=_({name:`OpenAIImageIndex`,components:{ConfigPanel:ft,Layout:Te,RecentPanel:K(Gt,[[`render`,Jt]])},mixins:[ce],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===q.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}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ge({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}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!fe(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){J.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 n={...e,action:`generate`,async:!0},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0};if(!U())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}J.info(this.$t(`openaiimage.message.startingTask`)),ue(`openaiimage`,t?Y.edit(r,{token:i}):Y.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),J.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`openaiimage.message.usedUp`)):J.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Xt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Zt=K(Yt,[[`render`,Xt]]);export{Zt 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-B8WcbeSJ.js";import{t as f}from"./card-D-4S-l7a.js";import{n as p,t as m}from"./row-Db1UIu1H.js";import{t as h}from"./pagination-BtF_LmES.js";import{t as g}from"./CopyToClipboard-7Ujng4SJ.js";import{E as _,or as v}from"./index-CV77yiwr.js";var y=l({name:`ConsoleDistributionInvitees`,components:{Pagination:h,CopyToClipboard:g,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 v.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=_(y,[[`render`,O],[`__scopeId`,`data-v-b2200c49`]]);export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,N as i,T as a,at as o,ht as s,j as c,mt as l,ot as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{r as m,t as h}from"./select-BLM0v92m.js";import{n as g,t as _}from"./table-BYj2mLeB.js";import{t as v}from"./card-D-4S-l7a.js";import{n as y,t as b}from"./file-output-DH97iOje.js";import{n as x,t as S}from"./row-MIrnxpN3.js";import{t as C}from"./pagination-B0NnI5zw.js";import{t as w}from"./skeleton-BVbQKb45.js";import{t as T}from"./circle-check-DQepOQOd.js";import{t as E}from"./clock-CWEF1y39.js";import{t as D}from"./CopyToClipboard-CZA6WQWP.js";import{t as O}from"./dollar-sign-DGBglg_W.js";import{Ai as k,E as A,Gt as j,Kr as M,Oi as N,Zn as P,mi as F}from"./index-D2ugFcRR.js";var I=F(`receipt`,[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]),L={total_count:0,total_spent:0,state_counts:{}},R=p({name:`ConsoleOrderList`,components:{ExportIcon:b,MoneyIcon:O,ReceiptIcon:I,SuccessIcon:T,TimeIcon:E,Pagination:C,CopyToClipboard:D,ElRow:S,ElCol:x,ElTable:_,ElTableColumn:g,ElButton:k,ElTag:N,ElCard:v,ElSelect:m,ElOption:h,ElDatePicker:y,ElSkeleton:w},data(){return{OrderState:M,orders:[],loading:!1,total:void 0,limit:10,filterState:this.$route.query.state?.toString()||``,filterPayWay:this.$route.query.pay_way?.toString()||``,createdAtRange:(()=>{let e=this.$route.query.created_at_from?.toString(),t=this.$route.query.created_at_to?.toString();if(e&&t)return[new Date(e),new Date(t)]})(),summary:{...L},summaryLoading:!1,exporting:!1,shortcuts:[{text:this.$t(`usage.shortcuts.today`),value:()=>{let e=new Date,t=new Date;return t.setHours(0,0,0,0),[t,e]}},{text:this.$t(`usage.shortcuts.last7Days`),value:()=>{let e=new Date,t=new Date;return t.setDate(t.getDate()-7),[t,e]}},{text:this.$t(`usage.shortcuts.last1Month`),value:()=>{let e=new Date,t=new Date;return t.setMonth(t.getMonth()-1),[t,e]}}]}},computed:{page(){return parseInt(this.$route.query.page?.toString()||`1`)},stateOptions(){return[{value:M.PENDING,label:this.$t(`order.state.pending`)},{value:M.FINISHED,label:this.$t(`order.state.finished`)},{value:M.PAID,label:this.$t(`order.state.paid`)},{value:M.EXPIRED,label:this.$t(`order.state.expired`)},{value:M.FAILED,label:this.$t(`order.state.failed`)},{value:M.REFUNDED,label:this.$t(`order.state.refunded`)}]},payWayOptions(){return[{value:`WechatPay`,label:this.$t(`order.title.wechatPay`)},{value:`Stripe`,label:this.$t(`order.title.stripe`)},{value:`AliPay`,label:this.$t(`order.title.aliPay`)},{value:`X402`,label:this.$t(`order.title.x402`)},{value:`PayPal`,label:this.$t(`order.title.paypal`)}]},filterQuery(){let e={user_id:this.$store.getters.user?.id};return this.filterState&&(e.state=this.filterState),this.filterPayWay&&(e.pay_way=this.filterPayWay),this.createdAtRange?.[0]&&(e.created_at_from=this.createdAtRange[0]),this.createdAtRange?.[1]&&(e.created_at_to=this.createdAtRange[1]),e}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData(),this.onFetchSummary()},methods:{getPriceString:j,stateTagType(e){return e===M.FINISHED||e===M.PAID?`success`:e===M.EXPIRED||e===M.FAILED?`danger`:e===M.REFUNDED?`warning`:`info`},stateLabel(e){return{[M.PENDING]:this.$t(`order.state.pending`),[M.PAID]:this.$t(`order.state.paid`),[M.FINISHED]:this.$t(`order.state.finished`),[M.EXPIRED]:this.$t(`order.state.expired`),[M.FAILED]:this.$t(`order.state.failed`),[M.REFUNDED]:this.$t(`order.state.refunded`)}[e]||e},isPendingAction(e){return e!==M.PAID&&e!==M.FINISHED&&e!==M.EXPIRED&&e!==M.FAILED&&e!==M.REFUNDED},goToDetail(e){this.$router.push({name:`console-order-detail`,params:{id:e}})},async onFilterChange(){await this.$router.push({name:this.$route.name?.toString(),query:{page:1,...this.filterState?{state:this.filterState}:{},...this.filterPayWay?{pay_way:this.filterPayWay}:{},...this.createdAtRange?.[0]?{created_at_from:this.createdAtRange[0].toISOString()}:{},...this.createdAtRange?.[1]?{created_at_to:this.createdAtRange[1].toISOString()}:{}}}),this.onFetchData(),this.onFetchSummary()},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{...this.$route.query,page:e}})},onFetchData(){this.loading=!0,P.getAll({ordering:`-created_at`,limit:this.limit,offset:(this.page-1)*this.limit,...this.filterQuery}).then(({data:e})=>{this.orders=e.items,this.total=e.count}).catch(()=>{}).finally(()=>{this.loading=!1})},onFetchSummary(){this.summaryLoading=!0,P.getSummary(this.filterQuery).then(({data:e})=>{this.summary=e}).catch(()=>{this.summary={...L}}).finally(()=>{this.summaryLoading=!1})},onExport(){this.exporting=!0,P.exportCsv(this.filterQuery).then(({data:e})=>{let t=window.URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`orders.csv`,n.click(),window.URL.revokeObjectURL(t)}).catch(()=>{}).finally(()=>{this.exporting=!1})}}}),z={class:`title`},B={key:1,class:`card-content`},V={class:`icon-wrapper`},H={class:`description`},U={class:`value`},W={key:1,class:`card-content`},G={class:`icon-wrapper`},K={class:`description`},q={class:`value`},J={key:1,class:`card-content`},ee={class:`icon-wrapper`},Y={class:`description`},X={class:`value`},Z={key:1,class:`card-content`},Q={class:`icon-wrapper`},$={class:`description`},te={class:`value`},ne={class:`filter-row mb-3`},re={class:`key`},ie={class:`cursor-pointer`},ae={class:`price`},oe={class:`description`},se={class:`text-gray-500`},ce={class:`created-at`},le={class:`flex items-center justify-center flex-wrap`},ue={class:`float-right`};function de(p,m,h,g,_,v){let y=o(`el-col`),b=o(`el-row`),x=o(`el-skeleton`),S=o(`receipt-icon`),C=o(`el-card`),w=o(`money-icon`),T=o(`success-icon`),E=o(`time-icon`),D=o(`el-option`),O=o(`el-select`),k=o(`el-date-picker`),A=o(`export-icon`),j=o(`el-button`),M=o(`copy-to-clipboard`),N=o(`el-table-column`),P=o(`el-tag`),F=o(`el-table`),I=o(`pagination`),L=u(`loading`);return f(),c(b,{class:`panel`},{default:l(()=>[r(y,{span:24},{default:l(()=>[r(b,null,{default:l(()=>[r(y,{span:24},{default:l(()=>[e(`h2`,z,n(p.$t(`common.title.allOrders`)),1)]),_:1})]),_:1}),r(b,{gutter:16},{default:l(()=>[r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,B,[e(`div`,V,[r(S,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,H,n(p.$t(`order.title.totalOrders`)),1),e(`p`,U,n(p.summary.total_count),1)]))]),_:1})]),_:1}),r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,W,[e(`div`,G,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,K,n(p.$t(`order.title.totalSpent`)),1),e(`p`,q,n(p.getPriceString({value:p.summary.total_spent})),1)]))]),_:1})]),_:1}),r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,J,[e(`div`,ee,[r(T,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,Y,n(p.$t(`order.title.finishedOrders`)),1),e(`p`,X,n(p.summary.state_counts?.Finished||0),1)]))]),_:1})]),_:1}),r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,Z,[e(`div`,Q,[r(E,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,$,n(p.$t(`order.title.pendingOrders`)),1),e(`p`,te,n(p.summary.state_counts?.Pending||0),1)]))]),_:1})]),_:1})]),_:1}),e(`div`,ne,[r(O,{modelValue:p.filterState,"onUpdate:modelValue":m[0]||=e=>p.filterState=e,clearable:``,placeholder:p.$t(`order.field.allStates`),class:`filter-select`,onChange:p.onFilterChange},{default:l(()=>[(f(!0),i(a,null,d(p.stateOptions,e=>(f(),c(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),r(O,{modelValue:p.filterPayWay,"onUpdate:modelValue":m[1]||=e=>p.filterPayWay=e,clearable:``,placeholder:p.$t(`order.field.allPayWays`),class:`filter-select`,onChange:p.onFilterChange},{default:l(()=>[(f(!0),i(a,null,d(p.payWayOptions,e=>(f(),c(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),r(k,{modelValue:p.createdAtRange,"onUpdate:modelValue":m[2]||=e=>p.createdAtRange=e,type:`datetimerange`,shortcuts:p.shortcuts,"range-separator":p.$t(`usage.placeholder.to`),"start-placeholder":p.$t(`usage.placeholder.startDate`),"end-placeholder":p.$t(`usage.placeholder.endDate`),onChange:p.onFilterChange},null,8,[`modelValue`,`shortcuts`,`range-separator`,`start-placeholder`,`end-placeholder`,`onChange`]),r(j,{type:`primary`,plain:``,loading:p.exporting,onClick:p.onExport},{default:l(()=>[r(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),t(` `+n(p.$t(`order.button.export`)),1)]),_:1},8,[`loading`,`onClick`])]),r(b,null,{default:l(()=>[r(y,{span:24},{default:l(()=>[r(C,{shadow:`hover`},{default:l(()=>[s((f(),c(F,{data:p.orders,stripe:``,"empty-text":p.$t(`common.message.noData`),class:`min-h-[calc(100vh-450px)] mb-[20px]`},{default:l(()=>[r(N,{prop:`id`,label:p.$t(`order.field.id`),"class-name":`text-center`,width:`200px`},{default:l(t=>[e(`span`,re,n(t.row.id),1),e(`span`,ie,[r(M,{content:t.row.id,class:`inline-block`},null,8,[`content`])])]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.price`),width:`110px`,align:`center`},{default:l(t=>[e(`span`,ae,n(p.getPriceString({value:t.row?.price})),1)]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.description`),"min-width":`220px`,"class-name":`hidden md:table-cell`,"label-class-name":`hidden md:table-cell`},{default:l(t=>[e(`span`,oe,n(t.row.description),1)]),_:1},8,[`label`]),r(N,{prop:`state`,label:p.$t(`order.field.state`),width:`130px`,align:`center`},{default:l(e=>[r(P,{type:p.stateTagType(e.row.state),class:`mx-1`,effect:`dark`,round:``,size:`small`},{default:l(()=>[t(n(p.stateLabel(e.row.state)),1)]),_:2},1032,[`type`])]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.payWay`),width:`120px`,align:`center`,"class-name":`hidden md:table-cell`,"label-class-name":`hidden md:table-cell`},{default:l(t=>[e(`span`,se,n(t.row.pay_way||`-`),1)]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.createdAt`),width:`200px`,"class-name":`hidden sm:table-cell`,"label-class-name":`hidden sm:table-cell`},{default:l(t=>[e(`span`,ce,n(p.$dayjs.format(t.row.created_at)),1)]),_:1},8,[`label`]),r(N,{"min-width":`130px`,fixed:`right`},{default:l(r=>[e(`div`,le,[p.isPendingAction(r.row.state)?(f(),c(j,{key:0,type:`primary`,size:`small`,onClick:e=>p.goToDetail(r.row.id)},{default:l(()=>[t(n(p.$t(`order.button.continuePay`)),1)]),_:1},8,[`onClick`])):(f(),c(j,{key:1,size:`small`,onClick:e=>p.goToDetail(r.row.id)},{default:l(()=>[t(n(p.$t(`order.button.checkDetail`)),1)]),_:1},8,[`onClick`]))])]),_:1})]),_:1},8,[`data`,`empty-text`])),[[L,p.loading]])]),_:1})]),_:1})]),_:1}),r(b,null,{default:l(()=>[r(y,{span:10,offset:14},{default:l(()=>[e(`div`,ue,[r(I,{"current-page":p.page,"page-size":p.limit,total:p.total,onChange:p.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])]),_:1})]),_:1})]),_:1})]),_:1})}var fe=A(R,[[`render`,de],[`__scopeId`,`data-v-c1fc3317`]]);export{fe as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,N as i,T as a,at as o,ht as s,j as c,mt as l,ot as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{r as m,t as h}from"./select-CiXAUiuv.js";import{n as g,t as _}from"./table-B8WcbeSJ.js";import{t as v}from"./card-D-4S-l7a.js";import{n as y,t as b}from"./file-output-i1KIle70.js";import{n as x,t as S}from"./row-Db1UIu1H.js";import{t as C}from"./pagination-BtF_LmES.js";import{t as w}from"./skeleton-BVbQKb45.js";import{t as T}from"./circle-check-CzXvsqoT.js";import{t as E}from"./clock-DRnti55a.js";import{t as D}from"./CopyToClipboard-7Ujng4SJ.js";import{t as O}from"./dollar-sign-Zn9tEPI5.js";import{Ai as k,E as A,Gt as j,Kr as M,Oi as N,Zn as P,mi as F}from"./index-CV77yiwr.js";var I=F(`receipt`,[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]),L={total_count:0,total_spent:0,state_counts:{}},R=p({name:`ConsoleOrderList`,components:{ExportIcon:b,MoneyIcon:O,ReceiptIcon:I,SuccessIcon:T,TimeIcon:E,Pagination:C,CopyToClipboard:D,ElRow:S,ElCol:x,ElTable:_,ElTableColumn:g,ElButton:k,ElTag:N,ElCard:v,ElSelect:m,ElOption:h,ElDatePicker:y,ElSkeleton:w},data(){return{OrderState:M,orders:[],loading:!1,total:void 0,limit:10,filterState:this.$route.query.state?.toString()||``,filterPayWay:this.$route.query.pay_way?.toString()||``,createdAtRange:(()=>{let e=this.$route.query.created_at_from?.toString(),t=this.$route.query.created_at_to?.toString();if(e&&t)return[new Date(e),new Date(t)]})(),summary:{...L},summaryLoading:!1,exporting:!1,shortcuts:[{text:this.$t(`usage.shortcuts.today`),value:()=>{let e=new Date,t=new Date;return t.setHours(0,0,0,0),[t,e]}},{text:this.$t(`usage.shortcuts.last7Days`),value:()=>{let e=new Date,t=new Date;return t.setDate(t.getDate()-7),[t,e]}},{text:this.$t(`usage.shortcuts.last1Month`),value:()=>{let e=new Date,t=new Date;return t.setMonth(t.getMonth()-1),[t,e]}}]}},computed:{page(){return parseInt(this.$route.query.page?.toString()||`1`)},stateOptions(){return[{value:M.PENDING,label:this.$t(`order.state.pending`)},{value:M.FINISHED,label:this.$t(`order.state.finished`)},{value:M.PAID,label:this.$t(`order.state.paid`)},{value:M.EXPIRED,label:this.$t(`order.state.expired`)},{value:M.FAILED,label:this.$t(`order.state.failed`)},{value:M.REFUNDED,label:this.$t(`order.state.refunded`)}]},payWayOptions(){return[{value:`WechatPay`,label:this.$t(`order.title.wechatPay`)},{value:`Stripe`,label:this.$t(`order.title.stripe`)},{value:`AliPay`,label:this.$t(`order.title.aliPay`)},{value:`X402`,label:this.$t(`order.title.x402`)},{value:`PayPal`,label:this.$t(`order.title.paypal`)}]},filterQuery(){let e={user_id:this.$store.getters.user?.id};return this.filterState&&(e.state=this.filterState),this.filterPayWay&&(e.pay_way=this.filterPayWay),this.createdAtRange?.[0]&&(e.created_at_from=this.createdAtRange[0]),this.createdAtRange?.[1]&&(e.created_at_to=this.createdAtRange[1]),e}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData(),this.onFetchSummary()},methods:{getPriceString:j,stateTagType(e){return e===M.FINISHED||e===M.PAID?`success`:e===M.EXPIRED||e===M.FAILED?`danger`:e===M.REFUNDED?`warning`:`info`},stateLabel(e){return{[M.PENDING]:this.$t(`order.state.pending`),[M.PAID]:this.$t(`order.state.paid`),[M.FINISHED]:this.$t(`order.state.finished`),[M.EXPIRED]:this.$t(`order.state.expired`),[M.FAILED]:this.$t(`order.state.failed`),[M.REFUNDED]:this.$t(`order.state.refunded`)}[e]||e},isPendingAction(e){return e!==M.PAID&&e!==M.FINISHED&&e!==M.EXPIRED&&e!==M.FAILED&&e!==M.REFUNDED},goToDetail(e){this.$router.push({name:`console-order-detail`,params:{id:e}})},async onFilterChange(){await this.$router.push({name:this.$route.name?.toString(),query:{page:1,...this.filterState?{state:this.filterState}:{},...this.filterPayWay?{pay_way:this.filterPayWay}:{},...this.createdAtRange?.[0]?{created_at_from:this.createdAtRange[0].toISOString()}:{},...this.createdAtRange?.[1]?{created_at_to:this.createdAtRange[1].toISOString()}:{}}}),this.onFetchData(),this.onFetchSummary()},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{...this.$route.query,page:e}})},onFetchData(){this.loading=!0,P.getAll({ordering:`-created_at`,limit:this.limit,offset:(this.page-1)*this.limit,...this.filterQuery}).then(({data:e})=>{this.orders=e.items,this.total=e.count}).catch(()=>{}).finally(()=>{this.loading=!1})},onFetchSummary(){this.summaryLoading=!0,P.getSummary(this.filterQuery).then(({data:e})=>{this.summary=e}).catch(()=>{this.summary={...L}}).finally(()=>{this.summaryLoading=!1})},onExport(){this.exporting=!0,P.exportCsv(this.filterQuery).then(({data:e})=>{let t=window.URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`orders.csv`,n.click(),window.URL.revokeObjectURL(t)}).catch(()=>{}).finally(()=>{this.exporting=!1})}}}),z={class:`title`},B={key:1,class:`card-content`},V={class:`icon-wrapper`},H={class:`description`},U={class:`value`},W={key:1,class:`card-content`},G={class:`icon-wrapper`},K={class:`description`},q={class:`value`},J={key:1,class:`card-content`},ee={class:`icon-wrapper`},Y={class:`description`},X={class:`value`},Z={key:1,class:`card-content`},Q={class:`icon-wrapper`},$={class:`description`},te={class:`value`},ne={class:`filter-row mb-3`},re={class:`key`},ie={class:`cursor-pointer`},ae={class:`price`},oe={class:`description`},se={class:`text-gray-500`},ce={class:`created-at`},le={class:`flex items-center justify-center flex-wrap`},ue={class:`float-right`};function de(p,m,h,g,_,v){let y=o(`el-col`),b=o(`el-row`),x=o(`el-skeleton`),S=o(`receipt-icon`),C=o(`el-card`),w=o(`money-icon`),T=o(`success-icon`),E=o(`time-icon`),D=o(`el-option`),O=o(`el-select`),k=o(`el-date-picker`),A=o(`export-icon`),j=o(`el-button`),M=o(`copy-to-clipboard`),N=o(`el-table-column`),P=o(`el-tag`),F=o(`el-table`),I=o(`pagination`),L=u(`loading`);return f(),c(b,{class:`panel`},{default:l(()=>[r(y,{span:24},{default:l(()=>[r(b,null,{default:l(()=>[r(y,{span:24},{default:l(()=>[e(`h2`,z,n(p.$t(`common.title.allOrders`)),1)]),_:1})]),_:1}),r(b,{gutter:16},{default:l(()=>[r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,B,[e(`div`,V,[r(S,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,H,n(p.$t(`order.title.totalOrders`)),1),e(`p`,U,n(p.summary.total_count),1)]))]),_:1})]),_:1}),r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,W,[e(`div`,G,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,K,n(p.$t(`order.title.totalSpent`)),1),e(`p`,q,n(p.getPriceString({value:p.summary.total_spent})),1)]))]),_:1})]),_:1}),r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,J,[e(`div`,ee,[r(T,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,Y,n(p.$t(`order.title.finishedOrders`)),1),e(`p`,X,n(p.summary.state_counts?.Finished||0),1)]))]),_:1})]),_:1}),r(y,{md:6,sm:12,xs:24},{default:l(()=>[r(C,{shadow:`hover`,class:`item-mini mb-3`},{default:l(()=>[p.summaryLoading?(f(),c(x,{key:0})):(f(),i(`div`,Z,[e(`div`,Q,[r(E,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`p`,$,n(p.$t(`order.title.pendingOrders`)),1),e(`p`,te,n(p.summary.state_counts?.Pending||0),1)]))]),_:1})]),_:1})]),_:1}),e(`div`,ne,[r(O,{modelValue:p.filterState,"onUpdate:modelValue":m[0]||=e=>p.filterState=e,clearable:``,placeholder:p.$t(`order.field.allStates`),class:`filter-select`,onChange:p.onFilterChange},{default:l(()=>[(f(!0),i(a,null,d(p.stateOptions,e=>(f(),c(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),r(O,{modelValue:p.filterPayWay,"onUpdate:modelValue":m[1]||=e=>p.filterPayWay=e,clearable:``,placeholder:p.$t(`order.field.allPayWays`),class:`filter-select`,onChange:p.onFilterChange},{default:l(()=>[(f(!0),i(a,null,d(p.payWayOptions,e=>(f(),c(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),r(k,{modelValue:p.createdAtRange,"onUpdate:modelValue":m[2]||=e=>p.createdAtRange=e,type:`datetimerange`,shortcuts:p.shortcuts,"range-separator":p.$t(`usage.placeholder.to`),"start-placeholder":p.$t(`usage.placeholder.startDate`),"end-placeholder":p.$t(`usage.placeholder.endDate`),onChange:p.onFilterChange},null,8,[`modelValue`,`shortcuts`,`range-separator`,`start-placeholder`,`end-placeholder`,`onChange`]),r(j,{type:`primary`,plain:``,loading:p.exporting,onClick:p.onExport},{default:l(()=>[r(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),t(` `+n(p.$t(`order.button.export`)),1)]),_:1},8,[`loading`,`onClick`])]),r(b,null,{default:l(()=>[r(y,{span:24},{default:l(()=>[r(C,{shadow:`hover`},{default:l(()=>[s((f(),c(F,{data:p.orders,stripe:``,"empty-text":p.$t(`common.message.noData`),class:`min-h-[calc(100vh-450px)] mb-[20px]`},{default:l(()=>[r(N,{prop:`id`,label:p.$t(`order.field.id`),"class-name":`text-center`,width:`200px`},{default:l(t=>[e(`span`,re,n(t.row.id),1),e(`span`,ie,[r(M,{content:t.row.id,class:`inline-block`},null,8,[`content`])])]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.price`),width:`110px`,align:`center`},{default:l(t=>[e(`span`,ae,n(p.getPriceString({value:t.row?.price})),1)]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.description`),"min-width":`220px`,"class-name":`hidden md:table-cell`,"label-class-name":`hidden md:table-cell`},{default:l(t=>[e(`span`,oe,n(t.row.description),1)]),_:1},8,[`label`]),r(N,{prop:`state`,label:p.$t(`order.field.state`),width:`130px`,align:`center`},{default:l(e=>[r(P,{type:p.stateTagType(e.row.state),class:`mx-1`,effect:`dark`,round:``,size:`small`},{default:l(()=>[t(n(p.stateLabel(e.row.state)),1)]),_:2},1032,[`type`])]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.payWay`),width:`120px`,align:`center`,"class-name":`hidden md:table-cell`,"label-class-name":`hidden md:table-cell`},{default:l(t=>[e(`span`,se,n(t.row.pay_way||`-`),1)]),_:1},8,[`label`]),r(N,{label:p.$t(`order.field.createdAt`),width:`200px`,"class-name":`hidden sm:table-cell`,"label-class-name":`hidden sm:table-cell`},{default:l(t=>[e(`span`,ce,n(p.$dayjs.format(t.row.created_at)),1)]),_:1},8,[`label`]),r(N,{"min-width":`130px`,fixed:`right`},{default:l(r=>[e(`div`,le,[p.isPendingAction(r.row.state)?(f(),c(j,{key:0,type:`primary`,size:`small`,onClick:e=>p.goToDetail(r.row.id)},{default:l(()=>[t(n(p.$t(`order.button.continuePay`)),1)]),_:1},8,[`onClick`])):(f(),c(j,{key:1,size:`small`,onClick:e=>p.goToDetail(r.row.id)},{default:l(()=>[t(n(p.$t(`order.button.checkDetail`)),1)]),_:1},8,[`onClick`]))])]),_:1})]),_:1},8,[`data`,`empty-text`])),[[L,p.loading]])]),_:1})]),_:1})]),_:1}),r(b,null,{default:l(()=>[r(y,{span:10,offset:14},{default:l(()=>[e(`div`,ue,[r(I,{"current-page":p.page,"page-size":p.limit,total:p.total,onChange:p.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])]),_:1})]),_:1})]),_:1})]),_:1})}var fe=A(R,[[`render`,de],[`__scopeId`,`data-v-c1fc3317`]]);export{fe as default};
|