@acedatacloud/nexior 3.330.12 → 3.330.13
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-CM6O887d.js → ApiCodeButton-ESjV90I4.js} +1 -1
- package/dist/assets/{Artifacts-C3fcoLFO.js → Artifacts-Ce-xuRxa.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-Cqq3mE9a.js → AskUserQuestionCard-Cq27SgYf.js} +1 -1
- package/dist/assets/{AudioPreview-BmeNphVK.js → AudioPreview-6icOwV8b.js} +1 -1
- package/dist/assets/{Auth-RuWKB9wU.js → Auth-CHXgA2-p.js} +1 -1
- package/dist/assets/{Bare-DyPdcbfQ.js → Bare-CXR7KRJ3.js} +1 -1
- package/dist/assets/{BotPlaceholder-CWdN2z-W.js → BotPlaceholder-60Ittost.js} +1 -1
- package/dist/assets/{BottomFooter-C4jLGt22.js → BottomFooter-dQ2kYE7_.js} +1 -1
- package/dist/assets/{Callback-CjqILcit.js → Callback-BtRyalNi.js} +1 -1
- package/dist/assets/{CodeSnippet-zzC59GyX.js → CodeSnippet-DaFc_zgg.js} +1 -1
- package/dist/assets/{Console-DenRmQQy.js → Console-DPEfTVtC.js} +1 -1
- package/dist/assets/{Consumption-BeC8mDVT.js → Consumption-C5-QJWxc.js} +1 -1
- package/dist/assets/{Conversation-BbeF0dC8.js → Conversation-CF_8aoBf.js} +1 -1
- package/dist/assets/{Conversation-CURHS5lU.js → Conversation-DHEAZsRi.js} +1 -1
- package/dist/assets/{CopyToClipboard-D2B1YdWc.js → CopyToClipboard-DMzrmhs6.js} +1 -1
- package/dist/assets/{Detail-BsdloB-d.js → Detail-BOcW5mO6.js} +2 -2
- package/dist/assets/{Extra-DGS94qB9.js → Extra-CeLsj853.js} +1 -1
- package/dist/assets/{FilePreview-CvI69Md4.js → FilePreview-k9s4AWkh.js} +1 -1
- package/dist/assets/{Hailuo-CJ--QljE.js → Hailuo-7zG40Dpo.js} +1 -1
- package/dist/assets/{History-DOBRcDN1.js → History-B5MmWpzB.js} +1 -1
- package/dist/assets/{ImagePreview-B2_86lPK.js → ImagePreview-CqonQxaO.js} +1 -1
- package/dist/assets/{ImageWrapper-U-smIFyU.js → ImageWrapper-BAqDx2VE.js} +1 -1
- package/dist/assets/{Index-DT1MRHJ92.js → Index-5ugMlEwU2.js} +1 -1
- package/dist/assets/{Index-C_MPGylh.js → Index-BMBEx5MA.js} +1 -1
- package/dist/assets/{Index-BVAu9bp0.js → Index-Bcw8E0KZ.js} +1 -1
- package/dist/assets/{Index-DqeF9i3X.js → Index-BfP_Pv7l.js} +1 -1
- package/dist/assets/{Index-BBRso_FX.js → Index-BicqqqWP.js} +1 -1
- package/dist/assets/{Index-jEaEzyxR.js → Index-C-sxprYC.js} +1 -1
- package/dist/assets/{Index-DxmvGKZA.js → Index-C0mohG1Y.js} +1 -1
- package/dist/assets/Index-C0nVxMEi.css +1 -0
- package/dist/assets/{Index-W1mp5Pmw2.js → Index-CJTaO59j2.js} +1 -1
- package/dist/assets/Index-COLQRvq9.js +1 -0
- package/dist/assets/{Index-CRduTzTu.js → Index-C_XzTrJa.js} +1 -1
- package/dist/assets/{Index-C_Zrl0VG.js → Index-CiGj9eQv.js} +1 -1
- package/dist/assets/{Index-ccFq8grC2.js → Index-CjcwNkmY2.js} +1 -1
- package/dist/assets/{Index-CdI_7I2R2.js → Index-CnVC4csn2.js} +1 -1
- package/dist/assets/{Index-7ENZegmL.js → Index-D1y1HMd2.js} +1 -1
- package/dist/assets/{Index-MUR3aroT.js → Index-D98_-SQx.js} +1 -1
- package/dist/assets/{Index-DQt5uo3A.js → Index-DGyQNFxI.js} +1 -1
- package/dist/assets/{Index-Q01aQLwq.js → Index-DInL_Op1.js} +1 -1
- package/dist/assets/{Index-C5u_BPfN.js → Index-DUDIY-fR.js} +1 -1
- package/dist/assets/{Index-CTJkwO5w.js → Index-DWydnG17.js} +1 -1
- package/dist/assets/{Index-BDDpRS_Y.js → Index-D_rRsuym.js} +1 -1
- package/dist/assets/{Index-RDVW6wEc.js → Index-DcCrfbdF.js} +1 -1
- package/dist/assets/{Index-BySLC4gg.js → Index-DkqbfxwM.js} +1 -1
- package/dist/assets/{Index-BvFJQRts.js → Index-DmcbvTVf.js} +1 -1
- package/dist/assets/{Index-CKaxjQKw.js → Index-DpX5BvAM.js} +1 -1
- package/dist/assets/{Index-CTyUNBg-.js → Index-DrlEbB62.js} +1 -1
- package/dist/assets/{Index-EJORSang2.js → Index-DvpJPa2B2.js} +1 -1
- package/dist/assets/{Index-B0b5VDX62.js → Index-KobqmpYi2.js} +1 -1
- package/dist/assets/{Index-HE1EC0SF2.js → Index-NkHb9EYO2.js} +1 -1
- package/dist/assets/{Index-DQsLAkf5.js → Index-SkR-OzgT.js} +1 -1
- package/dist/assets/{Index-DOOJkT9y.js → Index-lFq3L3aT.js} +1 -1
- package/dist/assets/{Invitees-0798oX3N.js → Invitees-CBpFJ0Va.js} +1 -1
- package/dist/assets/{List-BFT4QdDg.js → List-D2G9OCYR.js} +1 -1
- package/dist/assets/{List-CO31nOQs.js → List-EtJekfwq.js} +1 -1
- package/dist/assets/{List-CLYO1-y6.js → List-lDHnqsFh.js} +1 -1
- package/dist/assets/{LocalTools-CCSlSwkA.js → LocalTools-BTHQwENK.js} +1 -1
- package/dist/assets/{LocalTools-Ce6BSi4J.js → LocalTools-MnX_lVF5.js} +1 -1
- package/dist/assets/{Main-BPftTpqJ.js → Main-CBfdcF1R.js} +1 -1
- package/dist/assets/{Message-BxZ054Em.js → Message-DuHF8YyA.js} +1 -1
- package/dist/assets/{Model-Co71wgHD.js → Model-_7-sbyx4.js} +1 -1
- package/dist/assets/{Navigator-B2Ocxu1H.js → Navigator-BJ6niQUi.js} +3 -3
- package/dist/assets/{NotFound-CmNSbBi-.js → NotFound-C5zCrm7Z.js} +1 -1
- package/dist/assets/{Pay-D2pTOr2P.js → Pay-8Iyikc2D.js} +1 -1
- package/dist/assets/{Player-BJQqBHrL.js → Player-DGvt2su_.js} +1 -1
- package/dist/assets/{Poivelle-DlaXFbvg.js → Poivelle-Cipdg8Yr.js} +1 -1
- package/dist/assets/{PromptTextarea-DLF2mcEB.js → PromptTextarea-BwQ2pgsq.js} +1 -1
- package/dist/assets/{RealtimeCall-BuQjh0HP.js → RealtimeCall-BzzwwXFR.js} +1 -1
- package/dist/assets/{ScheduledTasks-CANTTsTJ.js → ScheduledTasks-B-qqFsg8.js} +1 -1
- package/dist/assets/{Status-DzJqpp0e.js → Status-DOSxpxFE.js} +1 -1
- package/dist/assets/{Subscribe-BVlgurpj.js → Subscribe-CcBmc2KP.js} +1 -1
- package/dist/assets/{TabSwitcher-BBV-lDVk.js → TabSwitcher-BIz8y25m.js} +1 -1
- package/dist/assets/{Tts-ByCg4BSQ.js → Tts-BS6a0FMa.js} +1 -1
- package/dist/assets/{VideoPlayer-8mtLa4d4.js → VideoPlayer-DfQm-G_M.js} +1 -1
- package/dist/assets/{alert-Dh2Gi1nh.js → alert-BsVzeQZL.js} +1 -1
- package/dist/assets/{arrow-down-wide-narrow-C7JD_UtJ.js → arrow-down-wide-narrow-D9DBjkHb.js} +1 -1
- package/dist/assets/arrow-down-yu22xkT4.js +1 -0
- package/dist/assets/arrow-left-IiETNkzN.js +1 -0
- package/dist/assets/arrow-right-Mhz5tsdk.js +1 -0
- package/dist/assets/arrow-up-42MhnI4S.js +1 -0
- package/dist/assets/{avatar-C_AXZOMp.js → avatar-WTS0mxhH.js} +1 -1
- package/dist/assets/{basic-CxonkI3o.js → basic-DYMjWp6M.js} +1 -1
- package/dist/assets/{box-CRxIbTQV.js → box-DlrCDW_Z.js} +1 -1
- package/dist/assets/{boxes-B_CX2B_J.js → boxes-CvTuRtD2.js} +1 -1
- package/dist/assets/{brain-BJOFauef.js → brain-DqkMK8o-.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-BD6WAQOZ.js → chart-no-axes-combined-DBZaBC_z.js} +1 -1
- package/dist/assets/{chat-ChOCCAAV.js → chat-l5ESPEs4.js} +1 -1
- package/dist/assets/check-DxZtOepN.js +1 -0
- package/dist/assets/chevron-down-BTplzcvu.js +1 -0
- package/dist/assets/chevron-right-D-eL6Zlc.js +1 -0
- package/dist/assets/circle-check-DvUAttOa.js +1 -0
- package/dist/assets/clock-DmoJeS1-.js +1 -0
- package/dist/assets/{codingBridge-Bhn3jqIx.js → codingBridge-DRJ9Q4Q8.js} +1 -1
- package/dist/assets/{codingBridgeNotify-DQzvYdPK.js → codingBridgeNotify-BfssShKZ.js} +2 -2
- package/dist/assets/{coins-Cc5PbnD7.js → coins-CnnnE904.js} +1 -1
- package/dist/assets/{collapse-BZHjPNBb.js → collapse-BGRzjqqi.js} +1 -1
- package/dist/assets/{constants-Nl0z6QvB.js → constants-Dwvkb2qI.js} +1 -1
- package/dist/assets/{copy-Cq7ODmKS.js → copy-CuiXD2DC.js} +1 -1
- package/dist/assets/{createTaskActions-Cloi4gec.js → createTaskActions-CHbmI2Xs.js} +1 -1
- package/dist/assets/{digitalhuman-CX1GJRq6.js → digitalhuman-fSroLub6.js} +1 -1
- package/dist/assets/{dollar-sign-BNwBeZtP.js → dollar-sign-CIPKXVvA.js} +1 -1
- package/dist/assets/{download-DzQI_3w7.js → download-CIEcPgI1.js} +1 -1
- package/dist/assets/{drawer-BXQvd2mA.js → drawer-91Rv4Ele.js} +1 -1
- package/dist/assets/{dropdown-BEloXzX1.js → dropdown-B16D8Kwq.js} +1 -1
- package/dist/assets/{dropdown-cjuwxQXd.js → dropdown-BclnCTCe.js} +1 -1
- package/dist/assets/{ellipsis-BCrScuCP.js → ellipsis-wwqxR-yn.js} +1 -1
- package/dist/assets/{esm-BQ37ljSO.js → esm-AIGoQnCh.js} +1 -1
- package/dist/assets/{esm-wmzwV3vS.js → esm-CGBr50zt.js} +1 -1
- package/dist/assets/{esm-CjfzPEvM.js → esm-CKLwFBUR.js} +2 -2
- package/dist/assets/{esm-CyXFIEfC.js → esm-DbP_Vy83.js} +1 -1
- package/dist/assets/{esm-BjDTUdQG.js → esm-DevbO36y.js} +2 -2
- package/dist/assets/{esm-DeCH2V1M.js → esm-Dr-ozfU7.js} +3 -3
- package/dist/assets/esm-SoR3Zq_9.js +1 -0
- package/dist/assets/{external-link-Y7lPTuRV.js → external-link-C-ELuFgb.js} +1 -1
- package/dist/assets/{eye-NUMvNL99.js → eye-tZeeHiqB.js} +1 -1
- package/dist/assets/{file-output-DWriAQrm.js → file-output-BWxfKqze.js} +1 -1
- package/dist/assets/{file-text-BuY0eham.js → file-text-CJtFUnbZ.js} +1 -1
- package/dist/assets/{fish-BXjZv54k.js → fish-HZgBzY8L.js} +1 -1
- package/dist/assets/{flux-By6VH24s.js → flux-BlF7I4ii.js} +1 -1
- package/dist/assets/{folder-Dm2QEOQw.js → folder-Dm3A7mhE.js} +1 -1
- package/dist/assets/gauge-BGyVJt7l.js +1 -0
- package/dist/assets/{globe-yxvY7ENf.js → globe-CbeIDOnV.js} +1 -1
- package/dist/assets/{grokvideo-u--nIqQZ.js → grokvideo-CbMcq6Nr.js} +1 -1
- package/dist/assets/{hailuo-DG69JI9G.js → hailuo-B3dCwVHZ.js} +1 -1
- package/dist/assets/{headphones-D_Gu55Yc.js → headphones-BYpy8Yka.js} +1 -1
- package/dist/assets/{history-BW3fkopp.js → history-etn9vvhi.js} +1 -1
- package/dist/assets/{i18n-CIEqmGuD.js → i18n-BwZABSLX.js} +1 -1
- package/dist/assets/{image-C1JnzZfz.js → image-8hx4YUb0.js} +1 -1
- package/dist/assets/{index-Cb8GIs2T.css → index-B3NUT6Sj.css} +1 -1
- package/dist/assets/{index-G9CdKzEY.js → index-D11lR21M.js} +4 -4
- package/dist/assets/{index.browser.esm-BCTf1I7a.js → index.browser.esm-BILJ0i0I.js} +1 -1
- package/dist/assets/{index.es-Bx2UrPxj.js → index.es-D9wpiZpG.js} +1 -1
- package/dist/assets/{info-CvJYv1iP.js → info-CsXueTRq.js} +1 -1
- package/dist/assets/{input-number-ikaIUTH-.js → input-number-DFaagkZ1.js} +1 -1
- package/dist/assets/{key-round-B5xrbsz-.js → key-round-BCeSp5Ky.js} +1 -1
- package/dist/assets/{kling-R2ZEQQCL.js → kling-BzpLIFkF.js} +1 -1
- package/dist/assets/{languages-iHa362yF.js → languages-BZ6oQUWe.js} +1 -1
- package/dist/assets/{laptop-CPAefLaG.js → laptop-D0nw4urN.js} +1 -1
- package/dist/assets/{lightbulb-EjuqUdgk.js → lightbulb-BLCPwpqb.js} +1 -1
- package/dist/assets/{link-BONhKDmP.js → link-DQWWASPf.js} +1 -1
- package/dist/assets/loader-circle-BtKiEz76.js +1 -0
- package/dist/assets/{luma-DyxQhH8_.js → luma-Cup5L_FW.js} +1 -1
- package/dist/assets/{maestro-CXfdP4AD.js → maestro-BeyFVvns.js} +1 -1
- package/dist/assets/{maestro-BbywcVW4.js → maestro-DtLtTGW-.js} +1 -1
- package/dist/assets/{mail-BaEVKBqO.js → mail-8p4gHxZ2.js} +1 -1
- package/dist/assets/{message-circle-aaY4_utG.js → message-circle-CbOdsqvj.js} +1 -1
- package/dist/assets/{mic-D-alzHzM.js → mic-Bah1fkJr.js} +1 -1
- package/dist/assets/{midjourney-si-PtM6-.js → midjourney-CWWqqsk2.js} +1 -1
- package/dist/assets/{mobileLocalExec-BErRlMAI.js → mobileLocalExec-DRMB0uEV.js} +2 -2
- package/dist/assets/{mouse-pointer-2-CeLCUmVV.js → mouse-pointer-2-rlN-I3Rd.js} +1 -1
- package/dist/assets/music-2-CbVeTVyL.js +1 -0
- package/dist/assets/{nanobanana-DGcUVRtp.js → nanobanana-WoQ_GrQA.js} +1 -1
- package/dist/assets/{omni-DKWE3svt.js → omni-DTCgIhYE.js} +1 -1
- package/dist/assets/{openaiimage-smtmUxoG.js → openaiimage-MJMThHzx.js} +1 -1
- package/dist/assets/{pagination-Bv4q6N1-.js → pagination-Blfeoga3.js} +1 -1
- package/dist/assets/{pagination-Cuo1XB2N.js → pagination-hQoJe8fE.js} +1 -1
- package/dist/assets/{palette-DUPs5jv6.js → palette-BShqy-O4.js} +1 -1
- package/dist/assets/{paperclip-9BxrrXNN.js → paperclip-Cpyt9097.js} +1 -1
- package/dist/assets/{pause-KBlho6vN.js → pause-BDGimkCB.js} +1 -1
- package/dist/assets/{pencil-OxSysCyi.js → pencil-UNDwTR7e.js} +1 -1
- package/dist/assets/{pika-BtE9xmA9.js → pika-C6m9u1gB.js} +1 -1
- package/dist/assets/{pixverse-h1vVVLIl.js → pixverse-Dav_Oxf1.js} +1 -1
- package/dist/assets/play-EJ5kX8EX.js +1 -0
- package/dist/assets/plus-B29mCsSP.js +1 -0
- package/dist/assets/{poivelle-CXtcXPfL.js → poivelle-2cCDBnGF.js} +1 -1
- package/dist/assets/{poivelle-B-4nGG9X.js → poivelle-3nkGbPvK.js} +1 -1
- package/dist/assets/{poivelle-B2wv8kv8.js → poivelle-BDQjle-B.js} +1 -1
- package/dist/assets/{poivelle-B_QSOwfv.js → poivelle-BDl71Lw7.js} +1 -1
- package/dist/assets/{poivelle-BU9sXd3Z.js → poivelle-BHawyBWB.js} +1 -1
- package/dist/assets/poivelle-BKNIo3KW.js +1 -0
- package/dist/assets/poivelle-BhmorJKu.js +1 -0
- package/dist/assets/poivelle-BtVTjxx6.js +1 -0
- package/dist/assets/poivelle-Bx0dh9by.js +1 -0
- package/dist/assets/poivelle-CB0hllHC.js +1 -0
- package/dist/assets/poivelle-CM6SlTIJ.js +1 -0
- package/dist/assets/poivelle-CSoaOAqi.js +1 -0
- package/dist/assets/poivelle-CThzSms4.js +1 -0
- package/dist/assets/poivelle-Cmwe3NjT.js +1 -0
- package/dist/assets/poivelle-CsmbOA_P.js +1 -0
- package/dist/assets/poivelle-Ctiextn_.js +1 -0
- package/dist/assets/poivelle-D3yO0lZe.js +1 -0
- package/dist/assets/poivelle-LElOo-0T.js +1 -0
- package/dist/assets/poivelle-a3jCqCKL.js +1 -0
- package/dist/assets/{popover-nEIb1ez5.js → popover-Dw95C5zL.js} +1 -1
- package/dist/assets/{producer-1F7ennq-.js → producer-Cx3GSOeP.js} +1 -1
- package/dist/assets/{qrart-COo0G_j0.js → qrart-CSs1C2gw.js} +1 -1
- package/dist/assets/{realtime-BcVNzndK.js → realtime-D8CiUCSa.js} +1 -1
- package/dist/assets/{refresh-cw-BIijAYXP.js → refresh-cw-c1f-4GL1.js} +1 -1
- package/dist/assets/rotate-ccw-DANBtoW5.js +1 -0
- package/dist/assets/rotate-cw-CQypZOeQ.js +1 -0
- package/dist/assets/{row-BqeIMega.js → row-D8Md0caP.js} +1 -1
- package/dist/assets/search-DorxMjPl.js +1 -0
- package/dist/assets/{seedance-dQjbCbVl.js → seedance-DLpT4YPq.js} +1 -1
- package/dist/assets/{seedream-Dz7EXmqg.js → seedream-HcChJpAo.js} +1 -1
- package/dist/assets/{select-xBG1Jx81.js → select-CY8L3FpM.js} +1 -1
- package/dist/assets/{serp-DNuVi-le.js → serp-CShPNdaC.js} +1 -1
- package/dist/assets/{shield-Dn9gugi2.js → shield-CCRYI_QA.js} +1 -1
- package/dist/assets/{shuffle-BAihE3Xu.js → shuffle-BHUsU0DE.js} +1 -1
- package/dist/assets/{slider-HNV5qIDR.js → slider-D3nQy28g.js} +1 -1
- package/dist/assets/{sliders-horizontal-yH1aJQfy.js → sliders-horizontal-DEmALzFN.js} +1 -1
- package/dist/assets/{solana-wallets-BdFQm-R5.js → solana-wallets-BPonbhZT.js} +2 -2
- package/dist/assets/{solana-wallets-vue-Luldm5EP.js → solana-wallets-vue-BS5ZFtn-.js} +1 -1
- package/dist/assets/{sora-BNFKfk-k.js → sora-CIMSVfhq.js} +1 -1
- package/dist/assets/{sparkles-CUbBfJfe.js → sparkles-FKYrDcPD.js} +1 -1
- package/dist/assets/square-RkQJNrTE.js +1 -0
- package/dist/assets/{suno-D2jVXcqR.js → suno-Kr_BOSJ-.js} +1 -1
- package/dist/assets/{switch-QrMkVi9r.js → switch-tSKAoZ0l.js} +1 -1
- package/dist/assets/{table-BT8sMwfi.js → table-Goh_lj7o.js} +1 -1
- package/dist/assets/{tabs-BY69n5Ec.js → tabs-tYFbYhk_.js} +1 -1
- package/dist/assets/{tag-CAI-4Lhp.js → tag-WjH23hVG.js} +1 -1
- package/dist/assets/{taskDrawerMixin-B56bIFa-.js → taskDrawerMixin-BbwfrIGa.js} +1 -1
- package/dist/assets/terminal-C8AgqXIs.js +1 -0
- package/dist/assets/{time-picker-C7ysJtMc.js → time-picker-BnuD2UEV.js} +1 -1
- package/dist/assets/{tooltip-BpDFvP8R.js → tooltip-BWksRWUx.js} +1 -1
- package/dist/assets/{trash-2-C0a72kws.js → trash-2-DguCsKzj.js} +1 -1
- package/dist/assets/{triangle-alert-CxfafsmQ.js → triangle-alert-D3h6_VD_.js} +1 -1
- package/dist/assets/{upload-B4APDzt3.js → upload--OMy2H6L.js} +1 -1
- package/dist/assets/{upload-CTDqPV40.js → upload-UU_EKVx7.js} +1 -1
- package/dist/assets/user-DLgTmCsN.js +1 -0
- package/dist/assets/{veo-CNuJ88fs.js → veo-CgoQdLl1.js} +1 -1
- package/dist/assets/{video-D5gHajAh.js → video-BUbgp2Mi.js} +1 -1
- package/dist/assets/{volume-2-C73Gxsow.js → volume-2-DlgXY7_9.js} +1 -1
- package/dist/assets/{wallet-DGYKB5JH.js → wallet-BDJiLzju.js} +1 -1
- package/dist/assets/{wan-Za1YFKMx.js → wan-BAjGeclK.js} +1 -1
- package/dist/assets/{wand-sparkles-By8eb-jt.js → wand-sparkles-G_omarUp.js} +1 -1
- package/dist/assets/{web-DXKBLOOh.js → web-C4KikJl4.js} +1 -1
- package/dist/assets/{web-BinB4cfA.js → web-DGHFIqIQ.js} +1 -1
- package/dist/assets/{web-C9O_a-Ln.js → web-IARqBYAj.js} +1 -1
- package/dist/assets/{web-laX29v9r.js → web-J_8DsY5v.js} +1 -1
- package/dist/assets/{web-DBG5b1QF.js → web-rlsEdgAb.js} +1 -1
- package/dist/assets/{webextrator-e9p1rXya.js → webextrator-DdS48rj0.js} +1 -1
- package/dist/assets/{zap-BioarhQj.js → zap-BY9oC9vX.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/Index-COH2u_8f.css +0 -1
- package/dist/assets/Index-CPUk-hOg.js +0 -1
- package/dist/assets/arrow-down-DknxbdEV.js +0 -1
- package/dist/assets/arrow-left-qtmdZb-0.js +0 -1
- package/dist/assets/arrow-right-2e_ox7O4.js +0 -1
- package/dist/assets/arrow-up-BzQvae-I.js +0 -1
- package/dist/assets/check-B1qtOsXO.js +0 -1
- package/dist/assets/chevron-down-_4PGwYM1.js +0 -1
- package/dist/assets/chevron-right-CcHeCniK.js +0 -1
- package/dist/assets/circle-check-53J9gvfx.js +0 -1
- package/dist/assets/clock-CdxE6gxb.js +0 -1
- package/dist/assets/esm-CWGTMrS4.js +0 -1
- package/dist/assets/gauge-DM3cXiga.js +0 -1
- package/dist/assets/loader-circle-Bm5emlT-.js +0 -1
- package/dist/assets/music-2-DmXhVAie.js +0 -1
- package/dist/assets/play-xBpmbpdH.js +0 -1
- package/dist/assets/plus-h5bF0hWY.js +0 -1
- package/dist/assets/poivelle-CVJFwmq5.js +0 -1
- package/dist/assets/poivelle-CiKxLOuT.js +0 -1
- package/dist/assets/poivelle-Cr6f1XNM.js +0 -1
- package/dist/assets/poivelle-Cu8yRgEl.js +0 -1
- package/dist/assets/poivelle-CyNOYDy-.js +0 -1
- package/dist/assets/poivelle-DDxnUoCb.js +0 -1
- package/dist/assets/poivelle-DFAUqjxK.js +0 -1
- package/dist/assets/poivelle-DHNobTmI.js +0 -1
- package/dist/assets/poivelle-DRT_oBTG.js +0 -1
- package/dist/assets/poivelle-DWpiT4AP.js +0 -1
- package/dist/assets/poivelle-JFwjJcOn.js +0 -1
- package/dist/assets/poivelle-PPNh0mDW.js +0 -1
- package/dist/assets/poivelle-pe1Nl83L.js +0 -1
- package/dist/assets/poivelle-u9RX9UkY.js +0 -1
- package/dist/assets/rotate-ccw-DvjF0MiA.js +0 -1
- package/dist/assets/rotate-cw-BR1Iah_6.js +0 -1
- package/dist/assets/search-FDjMZWgV.js +0 -1
- package/dist/assets/square-D5Tbfahf.js +0 -1
- package/dist/assets/terminal-BJOINtbv.js +0 -1
- package/dist/assets/user-57EBFB0-.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,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-B4APDzt3.js";import{t as y}from"./tooltip-BpDFvP8R.js";import{t as b}from"./alert-Dh2Gi1nh.js";import{t as x}from"./drawer-BXQvd2mA.js";import{t as S}from"./switch-QrMkVi9r.js";import{n as C}from"./taskDrawerMixin-B56bIFa-.js";import{t as w}from"./clock-CdxE6gxb.js";import{r as T,t as E}from"./PromptTextarea-DLF2mcEB.js";import{t as D}from"./info-CvJYv1iP.js";import{t as O}from"./triangle-alert-CxfafsmQ.js";import{t as k}from"./upload-CTDqPV40.js";import{t as A}from"./wand-sparkles-By8eb-jt.js";import"./constants-Nl0z6QvB.js";import{Bt as j,E as M,Gn as N,Gt as P,Ht as F,Mi as I,Ut as L,Vt as R,ai as z,en as ee,gr as te,ni as B,vi as V}from"./index-G9CdKzEY.js";import{t as H}from"./CopyToClipboard-D2B1YdWc.js";import{t as U}from"./FilePreview-CvI69Md4.js";import{t as W}from"./ImagePreview-B2_86lPK.js";import{t as G}from"./Consumption-BeC8mDVT.js";import{a as K,n as q,r as J,t as Y}from"./pagination-Bv4q6N1-.js";import{t as X}from"./VideoPlayer-8mtLa4d4.js";import{t as Z}from"./ApiCodeButton-CM6O887d.js";import{t as Q}from"./BotPlaceholder-CWdN2z-W.js";var ne=_({name:`LayoutLuma`,components:{MagicIcon:A,ElDrawer:x,ElButton:I},mixins:[C]}),re={class:`main flex flex-row flex-1`},ie={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)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,re,[e(`div`,ie,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[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 se=M(ne,[[`render`,oe],[`__scopeId`,`data-v-d13d43a9`]]),ce=_({name:`EnhancementSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),le={class:`relative`},ue={class:`flex justify-between`},de={class:`flex justify-start items-center`},fe={class:`text-sm font-bold`},pe={class:`flex justify-end items-center`};function me(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,le,[e(`div`,ue,[e(`div`,de,[e(`span`,fe,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var he=M(ce,[[`render`,me]]),ge=_({name:`CustomSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),_e={class:`relative`},ve={class:`flex justify-between`},ye={class:`flex justify-start items-center`},be={class:`text-sm font-bold`},xe={class:`flex justify-end items-center`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,_e,[e(`div`,ve,[e(`div`,ye,[e(`span`,be,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,xe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ce=M(ge,[[`render`,Se]]),we=_({name:`LoopSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Te={class:`relative`},Ee={class:`flex justify-between`},De={class:`flex justify-start items-center`},Oe={class:`text-sm font-bold`},ke={class:`flex justify-end items-center`};function Ae(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,Oe,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,ke,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var je=M(we,[[`render`,Ae]]),Me=_({name:`EndImage`,components:{UploadIcon:k,ElUpload:v,ElButton:I,ImagePreview:W,InfoIcon:K},mixins:[L,R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){V.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Ne={class:`relative`},Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`};function Le(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),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(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Re=M(Me,[[`render`,Le],[`__scopeId`,`data-v-e2470a75`]]),ze=_({name:`StartImage`,components:{UploadIcon:k,ElUpload:v,ElButton:I,ImagePreview:W,InfoIcon:K},mixins:[L,R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Be={class:`relative`},Ve={class:`flex justify-between`},He={class:`flex justify-start items-center`},Ue={class:`text-sm font-bold`};function We(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Be,[e(`div`,Ve,[e(`div`,He,[e(`span`,Ue,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ge=M(ze,[[`render`,We],[`__scopeId`,`data-v-122aced6`]]),Ke=_({name:`UploadVideo`,components:{UploadIcon:k,ElUpload:v,ElButton:I,InfoIcon:K,FilePreview:U},mixins:[R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){V.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){V.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(V.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(V.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Qe=M(Ke,[[`render`,Ze],[`__scopeId`,`data-v-8d27905e`]]),$e=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function et(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(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var tt=M($e,[[`render`,et]]),nt=_({name:`ExtendFromInput`,components:{VideoPlayer:X},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),rt={class:`relative`},it={class:`flex mb-2`},at={class:`text-sm font-bold`};function ot(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,rt,[e(`div`,it,[e(`span`,at,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var st=_({name:`ConfigPanel`,components:{MagicIcon:A,LoopSelector:je,StartImageInput:Ge,EndImageInput:Re,EnhancementSelector:he,ElButton:I,PromptInput:tt,ExtendFromInput:M(nt,[[`render`,ot]]),CustomSelector:Ce,UploadVideo:Qe,Consumption:G},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return P(this.config,this.service?.cost)},service(){return this.$store.state.luma?.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,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,ct,[e(`div`,lt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ut,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var ft=M(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ChannelIcon:T,InfoIcon:D,MagicIcon:A,TimeIcon:w,WarningIcon:O,CopyToClipboard:H,ElAlert:b,VideoPlayer:X,ElTooltip:y,ElButton:I,ApiCodeButton:Z},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0,failed:!0})},wt={key:0,class:`mb-4`},Tt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:1,class:n({content:!0})},Ot={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:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:2,class:n({content:!0})},Nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`video-player`),v=l(`el-button`),y=l(`el-tooltip`),b=l(`api-code-button`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`time-icon`),w=l(`el-alert`),T=l(`warning-icon`),E=l(`info-icon`),D=l(`channel-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(g,{capability:`luma`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,St,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[n.modelValue.response.video_url?(h(),s(`div`,wt,[a(_,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,Tt,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(b,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(w,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Et,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,Dt,[a(w,{closable:!1,class:`failure`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ot,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,kt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Mt,[a(w,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,Nt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Ft=_({name:`RecentPanel`,components:{BotPlaceholder:Q,TaskPreview:M(pt,[[`render`,Pt],[`__scopeId`,`data-v-8bf2a835`]]),NoTasks:J,ScrollList:q},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),It={key:0},Lt={key:2,class:`w-full h-full flex items-center justify-center`};function Rt(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`,It,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Lt,[a(v)])):o(``,!0)],64)}var zt=_({name:`LumaIndex`,components:{ConfigPanel:ft,Layout:se,RecentPanel:M(Ft,[[`render`,Rt]])},mixins:[F],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===B.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===B.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.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 Y({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(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!j(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){V.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!ee())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}V.info(this.$t(`luma.message.startingTask`)),te(`luma`,N.generate(e,{token:t})).then(()=>{V.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`luma.message.usedUp`)):V.error(this.$t(`luma.message.startTaskFailed`))}).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 Bt(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.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var Vt=M(zt,[[`render`,Bt]]);export{Vt 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{t as v}from"./upload--OMy2H6L.js";import{t as y}from"./tooltip-BWksRWUx.js";import{t as b}from"./alert-BsVzeQZL.js";import{t as x}from"./drawer-91Rv4Ele.js";import{t as S}from"./switch-tSKAoZ0l.js";import{n as C}from"./taskDrawerMixin-BbwfrIGa.js";import{t as w}from"./clock-DmoJeS1-.js";import{r as T,t as E}from"./PromptTextarea-BwQ2pgsq.js";import{t as D}from"./info-CsXueTRq.js";import{t as O}from"./triangle-alert-D3h6_VD_.js";import{t as k}from"./upload-UU_EKVx7.js";import{t as A}from"./wand-sparkles-G_omarUp.js";import"./constants-Dwvkb2qI.js";import{Bt as j,E as M,Gn as N,Gt as P,Ht as F,Mi as I,Ut as L,Vt as R,ai as z,en as ee,gr as te,ni as B,vi as V}from"./index-D11lR21M.js";import{t as H}from"./CopyToClipboard-DMzrmhs6.js";import{t as U}from"./FilePreview-k9s4AWkh.js";import{t as W}from"./ImagePreview-CqonQxaO.js";import{t as G}from"./Consumption-C5-QJWxc.js";import{a as K,n as q,r as J,t as Y}from"./pagination-Blfeoga3.js";import{t as X}from"./VideoPlayer-DfQm-G_M.js";import{t as Z}from"./ApiCodeButton-ESjV90I4.js";import{t as Q}from"./BotPlaceholder-60Ittost.js";var ne=_({name:`LayoutLuma`,components:{MagicIcon:A,ElDrawer:x,ElButton:I},mixins:[C]}),re={class:`main flex flex-row flex-1`},ie={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)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,re,[e(`div`,ie,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[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 se=M(ne,[[`render`,oe],[`__scopeId`,`data-v-d13d43a9`]]),ce=_({name:`EnhancementSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),le={class:`relative`},ue={class:`flex justify-between`},de={class:`flex justify-start items-center`},fe={class:`text-sm font-bold`},pe={class:`flex justify-end items-center`};function me(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,le,[e(`div`,ue,[e(`div`,de,[e(`span`,fe,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var he=M(ce,[[`render`,me]]),ge=_({name:`CustomSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),_e={class:`relative`},ve={class:`flex justify-between`},ye={class:`flex justify-start items-center`},be={class:`text-sm font-bold`},xe={class:`flex justify-end items-center`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,_e,[e(`div`,ve,[e(`div`,ye,[e(`span`,be,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,xe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ce=M(ge,[[`render`,Se]]),we=_({name:`LoopSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Te={class:`relative`},Ee={class:`flex justify-between`},De={class:`flex justify-start items-center`},Oe={class:`text-sm font-bold`},ke={class:`flex justify-end items-center`};function Ae(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,Oe,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,ke,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var je=M(we,[[`render`,Ae]]),Me=_({name:`EndImage`,components:{UploadIcon:k,ElUpload:v,ElButton:I,ImagePreview:W,InfoIcon:K},mixins:[L,R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){V.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Ne={class:`relative`},Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`};function Le(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),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(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Re=M(Me,[[`render`,Le],[`__scopeId`,`data-v-e2470a75`]]),ze=_({name:`StartImage`,components:{UploadIcon:k,ElUpload:v,ElButton:I,ImagePreview:W,InfoIcon:K},mixins:[L,R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){V.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Be={class:`relative`},Ve={class:`flex justify-between`},He={class:`flex justify-start items-center`},Ue={class:`text-sm font-bold`};function We(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Be,[e(`div`,Ve,[e(`div`,He,[e(`span`,Ue,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ge=M(ze,[[`render`,We],[`__scopeId`,`data-v-122aced6`]]),Ke=_({name:`UploadVideo`,components:{UploadIcon:k,ElUpload:v,ElButton:I,InfoIcon:K,FilePreview:U},mixins:[R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){V.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){V.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(V.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(V.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Qe=M(Ke,[[`render`,Ze],[`__scopeId`,`data-v-8d27905e`]]),$e=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function et(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(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var tt=M($e,[[`render`,et]]),nt=_({name:`ExtendFromInput`,components:{VideoPlayer:X},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),rt={class:`relative`},it={class:`flex mb-2`},at={class:`text-sm font-bold`};function ot(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,rt,[e(`div`,it,[e(`span`,at,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var st=_({name:`ConfigPanel`,components:{MagicIcon:A,LoopSelector:je,StartImageInput:Ge,EndImageInput:Re,EnhancementSelector:he,ElButton:I,PromptInput:tt,ExtendFromInput:M(nt,[[`render`,ot]]),CustomSelector:Ce,UploadVideo:Qe,Consumption:G},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return P(this.config,this.service?.cost)},service(){return this.$store.state.luma?.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,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,ct,[e(`div`,lt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ut,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var ft=M(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ChannelIcon:T,InfoIcon:D,MagicIcon:A,TimeIcon:w,WarningIcon:O,CopyToClipboard:H,ElAlert:b,VideoPlayer:X,ElTooltip:y,ElButton:I,ApiCodeButton:Z},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0,failed:!0})},wt={key:0,class:`mb-4`},Tt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:1,class:n({content:!0})},Ot={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:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:2,class:n({content:!0})},Nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`video-player`),v=l(`el-button`),y=l(`el-tooltip`),b=l(`api-code-button`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`time-icon`),w=l(`el-alert`),T=l(`warning-icon`),E=l(`info-icon`),D=l(`channel-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(g,{capability:`luma`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,St,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[n.modelValue.response.video_url?(h(),s(`div`,wt,[a(_,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,Tt,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(b,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(w,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Et,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,Dt,[a(w,{closable:!1,class:`failure`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ot,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,kt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Mt,[a(w,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,Nt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Ft=_({name:`RecentPanel`,components:{BotPlaceholder:Q,TaskPreview:M(pt,[[`render`,Pt],[`__scopeId`,`data-v-8bf2a835`]]),NoTasks:J,ScrollList:q},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),It={key:0},Lt={key:2,class:`w-full h-full flex items-center justify-center`};function Rt(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`,It,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Lt,[a(v)])):o(``,!0)],64)}var zt=_({name:`LumaIndex`,components:{ConfigPanel:ft,Layout:se,RecentPanel:M(Ft,[[`render`,Rt]])},mixins:[F],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===B.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===B.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.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 Y({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(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!j(this.uploadTracker,e=>this.$t(e),e=>V.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){V.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!ee())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}V.info(this.$t(`luma.message.startingTask`)),te(`luma`,N.generate(e,{token:t})).then(()=>{V.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?V.error(this.$t(`luma.message.usedUp`)):V.error(this.$t(`luma.message.startTaskFailed`))}).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 Bt(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.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var Vt=M(zt,[[`render`,Bt]]);export{Vt 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-xBG1Jx81.js";import{t as x}from"./upload-B4APDzt3.js";import{t as S}from"./tooltip-BpDFvP8R.js";import{t as C}from"./alert-Dh2Gi1nh.js";import{t as w}from"./drawer-BXQvd2mA.js";import{t as T}from"./input-number-ikaIUTH-.js";import{t as E}from"./switch-QrMkVi9r.js";import{n as D}from"./taskDrawerMixin-B56bIFa-.js";import{t as O}from"./box-CRxIbTQV.js";import{t as k}from"./clock-CdxE6gxb.js";import{r as A,t as j}from"./PromptTextarea-DLF2mcEB.js";import{t as M}from"./image-C1JnzZfz.js";import{t as N}from"./info-CvJYv1iP.js";import{t as P}from"./triangle-alert-CxfafsmQ.js";import{t as ee}from"./upload-CTDqPV40.js";import{t as F}from"./wand-sparkles-By8eb-jt.js";import{t as I}from"./zap-BioarhQj.js";import{An as L,Bn as te,Dn as ne,Fn as re,In as R,Mn as ie,Nn as ae,On as oe,Pn as se,Rn as z,kn as B,zn as V}from"./constants-Nl0z6QvB.js";import{Bt as H,E as U,Gt as W,Ht as G,Mi as K,Tn as q,Vt as ce,ai as le,en as ue,gr as de,ni as J,vi as Y}from"./index-G9CdKzEY.js";import{t as fe}from"./CopyToClipboard-D2B1YdWc.js";import{t as X}from"./ImagePreview-B2_86lPK.js";import{t as pe}from"./Consumption-BeC8mDVT.js";import{a as Z,n as me,r as he,t as ge}from"./pagination-Bv4q6N1-.js";import{t as _e}from"./ApiCodeButton-CM6O887d.js";import{t as ve}from"./BotPlaceholder-CWdN2z-W.js";import{t as ye}from"./ImageWrapper-U-smIFyU.js";var be=_({name:`LayoutNanobanana`,components:{MagicIcon:F,ElDrawer:w,ElButton:K},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=U(be,[[`render`,we],[`__scopeId`,`data-v-fa2172a6`]]),Ee=_({name:`PromptInput`,components:{PromptTextarea:j},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=U(Ee,[[`render`,De]]),ke=_({name:`ImageUrlsInput`,components:{UploadIcon:ee,ElUpload:x,ElButton:K,InfoIcon:Z,ImagePreview:X},mixins:[ce],data(){return{fileList:[],uploadUrl:le()+`/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(){Y.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){Y.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 min-h-8 w-full items-center justify-between gap-3`},je={class:`flex min-w-0 items-center`},Me={class:`title m-0 text-[14px] font-bold`},Ne={class:`file-list flex flex-wrap gap-[10px]`};function Pe(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ae,[e(`div`,je,[e(`h2`,Me,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit: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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Ne,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Fe=U(ke,[[`render`,Pe]]),Ie=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ie,label:this.$t(`openaiimage.model.gptImage1`)},{value:ae,label:this.$t(`openaiimage.model.gptImage15`)},{value:se,label:this.$t(`openaiimage.model.gptImage2`)},{value:re,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||=L}}),Le={class:`field`},Re={class:`label`},ze={class:`box`},Be={class:`title font-bold`};function Ve(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`h2`,Be,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 He=U(Ie,[[`render`,Ve],[`__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 Ue=_({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 B.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:z},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:V},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:te}]:[{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 ne},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:oe.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}`))}}}),We={class:`resolution`},Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`},Ye={class:`field custom-toggle`},Xe={class:`label`},Ze={class:`box`},Qe={class:`title font-bold`},$e={key:0,class:`custom-inputs`},et={class:`row`},tt={class:`row-label`},nt={class:`row`},rt={class:`row-label`},it={key:0,class:`error`};function at(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`,We,[e(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,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`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,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`,$e,[e(`div`,et,[e(`span`,tt,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`,nt,[e(`span`,rt,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`,it,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var ot=_({name:`ConfigPanel`,components:{MagicIcon:F,ElButton:K,PromptInput:Oe,Consumption:pe,ImageUrlsInput:Fe,ModelSelector:He,ResolutionSelector:U(Ue,[[`render`,at],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return W({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),st={class:`flex flex-col h-full`},ct={class:`flex-1 overflow-y-auto p-5`},lt={class:`flex flex-col items-center justify-center px-5 pb-5`};function ut(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`,st,[e(`div`,ct,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,lt,[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 dt=U(ot,[[`render`,ut]]),ft=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:A,ImageIcon:M,InfoIcon:N,LightningIcon:I,MagicIcon:F,TimeIcon:k,WarningIcon:P,CopyToClipboard:fe,ElAlert:C,ImageWrapper:ye,ElButton:K,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)}}}),pt={class:`preview`},mt={class:`left`},ht={class:`main`},gt={class:`bot`},_t={class:`datetime`},vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:0,class:n({content:!0,failed:!0})},Ct={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},wt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jt={key:1,class:n({content:!0})},Mt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Ut(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`,pt,[e(`div`,mt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,ht,[e(`div`,gt,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,_t,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,vt,[n.referenceImages.length>0?(h(),s(`div`,yt,[(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`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,St,[e(`div`,Ct,[(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`,wt,[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`,Tt,[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`,Et,[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`,Dt,[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`,Ot,[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`,kt,[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`,At,[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`,jt,[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`,Mt,[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`,Nt,[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`,$,[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`,Pt,[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`,Ft,[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`,It,[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`,Lt,[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`,Rt,[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`,zt,[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`,Bt,[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`,Vt,[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`,Ht,[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 Wt=_({name:`RecentPanel`,components:{TaskPreview:U(ft,[[`render`,Ut],[`__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?.()}}}),Gt={key:0},Kt={key:2,class:`w-full h-full flex items-center justify-center`};function qt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Gt,[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`,Kt,[a(v)])):o(``,!0)],64)}var Jt=_({name:`OpenAIImageIndex`,components:{ConfigPanel:dt,Layout:Te,RecentPanel:U(Wt,[[`render`,qt]])},mixins:[G],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===J.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(!H(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){Y.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(!ue())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}Y.info(this.$t(`openaiimage.message.startingTask`)),de(`openaiimage`,t?q.edit(r,{token:i}):q.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),Y.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?Y.error(this.$t(`openaiimage.message.usedUp`)):Y.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 Yt(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 Xt=U(Jt,[[`render`,Yt]]);export{Xt 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-CY8L3FpM.js";import{t as x}from"./upload--OMy2H6L.js";import{t as S}from"./tooltip-BWksRWUx.js";import{t as C}from"./alert-BsVzeQZL.js";import{t as w}from"./drawer-91Rv4Ele.js";import{t as T}from"./input-number-DFaagkZ1.js";import{t as E}from"./switch-tSKAoZ0l.js";import{n as D}from"./taskDrawerMixin-BbwfrIGa.js";import{t as O}from"./box-DlrCDW_Z.js";import{t as k}from"./clock-DmoJeS1-.js";import{r as A,t as j}from"./PromptTextarea-BwQ2pgsq.js";import{t as M}from"./image-8hx4YUb0.js";import{t as N}from"./info-CsXueTRq.js";import{t as P}from"./triangle-alert-D3h6_VD_.js";import{t as ee}from"./upload-UU_EKVx7.js";import{t as F}from"./wand-sparkles-G_omarUp.js";import{t as I}from"./zap-BY9oC9vX.js";import{An as L,Bn as te,Dn as ne,Fn as re,In as R,Mn as ie,Nn as ae,On as oe,Pn as se,Rn as z,kn as B,zn as V}from"./constants-Dwvkb2qI.js";import{Bt as H,E as U,Gt as W,Ht as G,Mi as K,Tn as q,Vt as ce,ai as le,en as ue,gr as de,ni as J,vi as Y}from"./index-D11lR21M.js";import{t as fe}from"./CopyToClipboard-DMzrmhs6.js";import{t as X}from"./ImagePreview-CqonQxaO.js";import{t as pe}from"./Consumption-C5-QJWxc.js";import{a as Z,n as me,r as he,t as ge}from"./pagination-Blfeoga3.js";import{t as _e}from"./ApiCodeButton-ESjV90I4.js";import{t as ve}from"./BotPlaceholder-60Ittost.js";import{t as ye}from"./ImageWrapper-BAqDx2VE.js";var be=_({name:`LayoutNanobanana`,components:{MagicIcon:F,ElDrawer:w,ElButton:K},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=U(be,[[`render`,we],[`__scopeId`,`data-v-fa2172a6`]]),Ee=_({name:`PromptInput`,components:{PromptTextarea:j},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=U(Ee,[[`render`,De]]),ke=_({name:`ImageUrlsInput`,components:{UploadIcon:ee,ElUpload:x,ElButton:K,InfoIcon:Z,ImagePreview:X},mixins:[ce],data(){return{fileList:[],uploadUrl:le()+`/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(){Y.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){Y.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 min-h-8 w-full items-center justify-between gap-3`},je={class:`flex min-w-0 items-center`},Me={class:`title m-0 text-[14px] font-bold`},Ne={class:`file-list flex flex-wrap gap-[10px]`};function Pe(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ae,[e(`div`,je,[e(`h2`,Me,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit: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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Ne,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Fe=U(ke,[[`render`,Pe]]),Ie=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ie,label:this.$t(`openaiimage.model.gptImage1`)},{value:ae,label:this.$t(`openaiimage.model.gptImage15`)},{value:se,label:this.$t(`openaiimage.model.gptImage2`)},{value:re,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||=L}}),Le={class:`field`},Re={class:`label`},ze={class:`box`},Be={class:`title font-bold`};function Ve(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`h2`,Be,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 He=U(Ie,[[`render`,Ve],[`__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 Ue=_({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 B.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:z},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:V},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:te}]:[{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 ne},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:oe.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}`))}}}),We={class:`resolution`},Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`},Ye={class:`field custom-toggle`},Xe={class:`label`},Ze={class:`box`},Qe={class:`title font-bold`},$e={key:0,class:`custom-inputs`},et={class:`row`},tt={class:`row-label`},nt={class:`row`},rt={class:`row-label`},it={key:0,class:`error`};function at(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`,We,[e(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,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`,Ye,[e(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,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`,$e,[e(`div`,et,[e(`span`,tt,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`,nt,[e(`span`,rt,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`,it,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var ot=_({name:`ConfigPanel`,components:{MagicIcon:F,ElButton:K,PromptInput:Oe,Consumption:pe,ImageUrlsInput:Fe,ModelSelector:He,ResolutionSelector:U(Ue,[[`render`,at],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return W({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),st={class:`flex flex-col h-full`},ct={class:`flex-1 overflow-y-auto p-5`},lt={class:`flex flex-col items-center justify-center px-5 pb-5`};function ut(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`,st,[e(`div`,ct,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,lt,[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 dt=U(ot,[[`render`,ut]]),ft=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:A,ImageIcon:M,InfoIcon:N,LightningIcon:I,MagicIcon:F,TimeIcon:k,WarningIcon:P,CopyToClipboard:fe,ElAlert:C,ImageWrapper:ye,ElButton:K,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)}}}),pt={class:`preview`},mt={class:`left`},ht={class:`main`},gt={class:`bot`},_t={class:`datetime`},vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:0,class:n({content:!0,failed:!0})},Ct={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},wt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jt={key:1,class:n({content:!0})},Mt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Ut(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`,pt,[e(`div`,mt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,ht,[e(`div`,gt,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,_t,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,vt,[n.referenceImages.length>0?(h(),s(`div`,yt,[(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`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,St,[e(`div`,Ct,[(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`,wt,[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`,Tt,[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`,Et,[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`,Dt,[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`,Ot,[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`,kt,[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`,At,[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`,jt,[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`,Mt,[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`,Nt,[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`,$,[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`,Pt,[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`,Ft,[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`,It,[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`,Lt,[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`,Rt,[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`,zt,[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`,Bt,[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`,Vt,[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`,Ht,[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 Wt=_({name:`RecentPanel`,components:{TaskPreview:U(ft,[[`render`,Ut],[`__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?.()}}}),Gt={key:0},Kt={key:2,class:`w-full h-full flex items-center justify-center`};function qt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Gt,[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`,Kt,[a(v)])):o(``,!0)],64)}var Jt=_({name:`OpenAIImageIndex`,components:{ConfigPanel:dt,Layout:Te,RecentPanel:U(Wt,[[`render`,qt]])},mixins:[G],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===J.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(!H(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){Y.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(!ue())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}Y.info(this.$t(`openaiimage.message.startingTask`)),de(`openaiimage`,t?q.edit(r,{token:i}):q.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),Y.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?Y.error(this.$t(`openaiimage.message.usedUp`)):Y.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 Yt(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 Xt=U(Jt,[[`render`,Yt]]);export{Xt 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-2e_ox7O4.js";import{t as h}from"./check-B1qtOsXO.js";import{t as g}from"./external-link-Y7lPTuRV.js";import{t as ee}from"./globe-yxvY7ENf.js";import{t as te}from"./wand-sparkles-By8eb-jt.js";import{A as _,E as v,Mi as y,i as b,in as x,r as S}from"./index-G9CdKzEY.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:y,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`||x()||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:S[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=v(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-Mhz5tsdk.js";import{t as h}from"./check-DxZtOepN.js";import{t as g}from"./external-link-C-ELuFgb.js";import{t as ee}from"./globe-CbeIDOnV.js";import{t as te}from"./wand-sparkles-G_omarUp.js";import{A as _,E as v,Mi as y,i as b,in as x,r as S}from"./index-D11lR21M.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:y,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`||x()||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:S[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=v(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-xBG1Jx81.js";import{t as x}from"./upload-B4APDzt3.js";import{t as S}from"./tooltip-BpDFvP8R.js";import{t as C}from"./alert-Dh2Gi1nh.js";import{t as w}from"./drawer-BXQvd2mA.js";import{n as T}from"./taskDrawerMixin-B56bIFa-.js";import{t as E}from"./box-CRxIbTQV.js";import{t as D}from"./clock-CdxE6gxb.js";import{n as O,r as k,t as A}from"./PromptTextarea-DLF2mcEB.js";import{t as ee}from"./info-CvJYv1iP.js";import{t as j}from"./triangle-alert-CxfafsmQ.js";import{t as M}from"./upload-CTDqPV40.js";import{t as N}from"./wand-sparkles-By8eb-jt.js";import{At as P,Bt as F,Ft as te,Ht as ne,It as re,Lt as ie,Mt as ae,Pt as oe,Rt as se,Ut as I,jt as L,kt as R,zt as z}from"./constants-Nl0z6QvB.js";import{Bt as B,E as V,Gt as H,Ht as U,Mi as W,Sn as G,Ut as K,Vt as q,ai as J,en as ce,gr as le,ni as Y,vi as X}from"./index-G9CdKzEY.js";import{t as ue}from"./CopyToClipboard-D2B1YdWc.js";import{t as Z}from"./ImagePreview-B2_86lPK.js";import{t as de}from"./Consumption-BeC8mDVT.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-Bv4q6N1-.js";import{t as he}from"./VideoPlayer-8mtLa4d4.js";import{t as ge}from"./ApiCodeButton-CM6O887d.js";import{t as _e}from"./BotPlaceholder-CWdN2z-W.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:N,ElDrawer:w,ElButton:W},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=V(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:A},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=V(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:te,label:this.$t(`grokvideo.model.default`)},{value:oe,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||=R}}),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=V(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 ne(this.model)},options(){return ae.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=V(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:z,label:`480p`},{value:F,label:`720p`},{value:se,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||=L}}),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=V(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:re,label:`16:9`,w:32,h:18},{value:ie,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||=P}}),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=V(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return I(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){X.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){X.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=V(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:J()+`/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(){X.warning(this.$t(`grokvideo.message.uploadReferenceExceed`))},onError(){X.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 min-h-8 w-full items-center justify-between gap-3`},gt={class:`flex min-w-0 items-center`},_t={class:`title m-0 text-[14px] font-bold`},vt={class:`file-list flex flex-wrap gap-[10px]`};function yt(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`grokvideo.name.referenceImages`)),1),a(_,{content:t.$t(`grokvideo.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{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`])]),e(`div`,vt,[(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))])])}var bt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:N,ElButton:W,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:V(mt,[[`render`,yt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!I(this.$store.state.grokvideo?.config?.model)},consumption(){return H(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),xt={class:`flex flex-col h-full`},St={class:`flex-1 overflow-y-auto p-5`},Ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function wt(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`,xt,[e(`div`,St,[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`,Ct,[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 Tt=V(bt,[[`render`,wt]]),Et=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:k,FullscreenIcon:O,InfoIcon:ee,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:ue,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:W,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`)}}}),Dt={class:`preview`},Ot={class:`left`},kt={class:`main`},At={class:`bot`},jt={class:`datetime`},Mt={class:`info`},Nt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Pt={key:1,class:`prompt mt-2`},Ft={key:0},It={key:1},Lt={key:0,class:n({content:!0})},Rt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Bt={key:1,class:n({content:!0})},Vt={key:0,class:`mb-4`},Ht={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Ut={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:0},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={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`},Yt={key:2,class:n({content:!0})},Xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$t={key:3,class:n({content:!0})},en={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function tn(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`,Dt,[e(`div`,Ot,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,kt,[e(`div`,At,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,jt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Mt,[n.inputImage?(g(),s(`div`,Nt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Pt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Ft,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Bt,[n.video?.video_url?(g(),s(`div`,Vt,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ht,[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`,Ut,[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`,Wt,[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`,Gt,[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`,Kt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,qt,[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`,$,[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`,Jt,[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`,Yt,[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`,Xt,[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`,Zt,[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`,Qt,[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`,$t,[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`,en,[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`,Lt,[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`,Rt,[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`,zt,[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 nn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:V(Et,[[`render`,tn],[`__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?.()}}}),rn={key:0},an={key:2,class:`w-full h-full flex items-center justify-center`};function on(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`,rn,[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`,an,[a(v)])):o(``,!0)],64)}var sn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Tt,Layout:Ce,RecentPanel:V(nn,[[`render`,on]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===Y.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(!B(this.uploadTracker,e=>this.$t(e),e=>X.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,(I(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(I(e?.model)&&!t){X.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){X.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!ce())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}X.info(this.$t(`grokvideo.message.startingTask`)),le(`grokvideo`,G.generate(n,{token:r})).then(()=>{X.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?X.error(this.$t(`grokvideo.message.usedUp`)):X.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 cn(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 ln=V(sn,[[`render`,cn]]);export{ln 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-CY8L3FpM.js";import{t as x}from"./upload--OMy2H6L.js";import{t as S}from"./tooltip-BWksRWUx.js";import{t as C}from"./alert-BsVzeQZL.js";import{t as w}from"./drawer-91Rv4Ele.js";import{n as T}from"./taskDrawerMixin-BbwfrIGa.js";import{t as E}from"./box-DlrCDW_Z.js";import{t as D}from"./clock-DmoJeS1-.js";import{n as O,r as k,t as A}from"./PromptTextarea-BwQ2pgsq.js";import{t as ee}from"./info-CsXueTRq.js";import{t as j}from"./triangle-alert-D3h6_VD_.js";import{t as M}from"./upload-UU_EKVx7.js";import{t as N}from"./wand-sparkles-G_omarUp.js";import{At as P,Bt as F,Ft as te,Ht as ne,It as re,Lt as ie,Mt as ae,Pt as oe,Rt as se,Ut as I,jt as L,kt as R,zt as z}from"./constants-Dwvkb2qI.js";import{Bt as B,E as V,Gt as H,Ht as U,Mi as W,Sn as G,Ut as K,Vt as q,ai as J,en as ce,gr as le,ni as Y,vi as X}from"./index-D11lR21M.js";import{t as ue}from"./CopyToClipboard-DMzrmhs6.js";import{t as Z}from"./ImagePreview-CqonQxaO.js";import{t as de}from"./Consumption-C5-QJWxc.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-Blfeoga3.js";import{t as he}from"./VideoPlayer-DfQm-G_M.js";import{t as ge}from"./ApiCodeButton-ESjV90I4.js";import{t as _e}from"./BotPlaceholder-60Ittost.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:N,ElDrawer:w,ElButton:W},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=V(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:A},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=V(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:te,label:this.$t(`grokvideo.model.default`)},{value:oe,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||=R}}),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=V(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 ne(this.model)},options(){return ae.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=V(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:z,label:`480p`},{value:F,label:`720p`},{value:se,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||=L}}),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=V(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:re,label:`16:9`,w:32,h:18},{value:ie,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||=P}}),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=V(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return I(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){X.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){X.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=V(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:M,ElUpload:x,ElButton:W,InfoIcon:Q,ImagePreview:Z},mixins:[K,q],data(){return{fileList:[],uploadUrl:J()+`/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(){X.warning(this.$t(`grokvideo.message.uploadReferenceExceed`))},onError(){X.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 min-h-8 w-full items-center justify-between gap-3`},gt={class:`flex min-w-0 items-center`},_t={class:`title m-0 text-[14px] font-bold`},vt={class:`file-list flex flex-wrap gap-[10px]`};function yt(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`grokvideo.name.referenceImages`)),1),a(_,{content:t.$t(`grokvideo.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{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`])]),e(`div`,vt,[(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))])])}var bt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:N,ElButton:W,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:V(mt,[[`render`,yt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!I(this.$store.state.grokvideo?.config?.model)},consumption(){return H(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),xt={class:`flex flex-col h-full`},St={class:`flex-1 overflow-y-auto p-5`},Ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function wt(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`,xt,[e(`div`,St,[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`,Ct,[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 Tt=V(bt,[[`render`,wt]]),Et=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:k,FullscreenIcon:O,InfoIcon:ee,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:ue,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:W,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`)}}}),Dt={class:`preview`},Ot={class:`left`},kt={class:`main`},At={class:`bot`},jt={class:`datetime`},Mt={class:`info`},Nt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Pt={key:1,class:`prompt mt-2`},Ft={key:0},It={key:1},Lt={key:0,class:n({content:!0})},Rt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Bt={key:1,class:n({content:!0})},Vt={key:0,class:`mb-4`},Ht={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Ut={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Kt={key:0},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={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`},Yt={key:2,class:n({content:!0})},Xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$t={key:3,class:n({content:!0})},en={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function tn(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`,Dt,[e(`div`,Ot,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,kt,[e(`div`,At,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,jt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Mt,[n.inputImage?(g(),s(`div`,Nt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Pt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Ft,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Bt,[n.video?.video_url?(g(),s(`div`,Vt,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ht,[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`,Ut,[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`,Wt,[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`,Gt,[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`,Kt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,qt,[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`,$,[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`,Jt,[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`,Yt,[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`,Xt,[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`,Zt,[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`,Qt,[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`,$t,[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`,en,[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`,Lt,[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`,Rt,[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`,zt,[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 nn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:V(Et,[[`render`,tn],[`__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?.()}}}),rn={key:0},an={key:2,class:`w-full h-full flex items-center justify-center`};function on(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`,rn,[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`,an,[a(v)])):o(``,!0)],64)}var sn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Tt,Layout:Ce,RecentPanel:V(nn,[[`render`,on]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===Y.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(!B(this.uploadTracker,e=>this.$t(e),e=>X.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,(I(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(I(e?.model)&&!t){X.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){X.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!ce())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}X.info(this.$t(`grokvideo.message.startingTask`)),le(`grokvideo`,G.generate(n,{token:r})).then(()=>{X.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?X.error(this.$t(`grokvideo.message.usedUp`)):X.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 cn(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 ln=V(sn,[[`render`,cn]]);export{ln as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,F as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,it as d,j as f,mt as p,rt as m,tt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{r as _,t as v}from"./select-xBG1Jx81.js";import{n as y,t as b}from"./tabs-BY69n5Ec.js";import{t as x}from"./tooltip-BpDFvP8R.js";import{t as S}from"./alert-Dh2Gi1nh.js";import{n as C,r as w}from"./radio-DgDgyT2l.js";import{n as T,t as E}from"./collapse-BZHjPNBb.js";import{t as D}from"./drawer-BXQvd2mA.js";import{t as O}from"./input-number-ikaIUTH-.js";import{t as k}from"./switch-QrMkVi9r.js";import{t as A}from"./clock-CdxE6gxb.js";import{t as j}from"./external-link-Y7lPTuRV.js";import{t as M}from"./globe-yxvY7ENf.js";import{t as N}from"./info-CvJYv1iP.js";import{t as P}from"./loader-circle-Bm5emlT-.js";import{t as F}from"./sliders-horizontal-yH1aJQfy.js";import{t as ee}from"./tag-CAI-4Lhp.js";import{t as te}from"./wand-sparkles-By8eb-jt.js";import{t as I}from"./zap-BioarhQj.js";import"./constants-Nl0z6QvB.js";import{E as L,Gt as R,Mi as z,Vi as B,en as V,gi as H,ni as U,vi as W,xi as G}from"./index-G9CdKzEY.js";import{t as K}from"./CopyToClipboard-D2B1YdWc.js";import{t as q}from"./Consumption-BeC8mDVT.js";var J=H(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),Y=g({name:`LayoutWebextrator`,components:{ControlsIcon:F,ElDrawer:D,ElButton:z},data(){return{drawer:!1}}}),X={class:`main flex flex-row flex-1`},Z={class:`config w-[340px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Q={class:`result h-full flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ne(t,n,r,i,o,c){let l=u(`controls-icon`),f=u(`el-button`),m=u(`el-drawer`);return h(),s(`div`,X,[e(`div`,Z,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Q,[d(t.$slots,`result`,{},void 0,!0)]),a(f,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var re=L(Y,[[`render`,ne],[`__scopeId`,`data-v-0ca47a5f`]]),ie=g({name:`ModeSelector`,components:{GlobeIcon:M,MagicIcon:te,ElRadioGroup:w,ElRadioButton:C},computed:{value:{get(){return this.$store.state.webextrator?.config?.mode},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,mode:e})}}}}),ae={class:`field`},oe={class:`title font-bold`};function se(t,n,o,c,l,d){let f=u(`magic-icon`),m=u(`el-radio-button`),g=u(`globe-icon`),_=u(`el-radio-group`);return h(),s(`div`,ae,[e(`h2`,oe,i(t.$t(`webextrator.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value w-full`},{default:p(()=>[a(m,{label:`extract`,value:`extract`},{default:p(()=>[a(f,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.extract`)),1)]),_:1}),a(m,{label:`render`,value:`render`},{default:p(()=>[a(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.render`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ce=L(ie,[[`render`,se],[`__scopeId`,`data-v-76c5bea5`]]),le=g({name:`UrlInput`,components:{ElInput:B},emits:[`submit`],computed:{url:{get(){return this.$store.state.webextrator?.config?.url||``},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,url:e})}}},methods:{onEnter(){this.$emit(`submit`)}}}),ue={class:`field`},de={class:`title font-bold`};function fe(n,r,o,l,d,f){let p=u(`el-input`);return h(),s(`div`,ue,[e(`h2`,de,i(n.$t(`webextrator.name.url`)),1),a(p,{modelValue:n.url,"onUpdate:modelValue":r[0]||=e=>n.url=e,type:`textarea`,rows:2,class:`prompt`,placeholder:n.$t(`webextrator.placeholder.url`),onKeydown:c(t(n.onEnter,[`exact`,`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])])}var pe=L(le,[[`render`,fe],[`__scopeId`,`data-v-18488009`]]),me=g({name:`ExpectedTypeSelector`,components:{ElSelect:_,ElOption:v},computed:{value:{get(){return this.$store.state.webextrator?.config?.expected_type},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,expected_type:e})}}},mounted(){this.value||=`general`}}),he={class:`field`},ge={class:`title font-bold`};function _e(t,n,r,o,c,l){let d=u(`el-option`),f=u(`el-select`);return h(),s(`div`,he,[e(`h2`,ge,i(t.$t(`webextrator.name.expectedType`)),1),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},{default:p(()=>[a(d,{value:`general`,label:t.$t(`webextrator.expectedType.general`)},null,8,[`label`]),a(d,{value:`article`,label:t.$t(`webextrator.expectedType.article`)},null,8,[`label`]),a(d,{value:`product`,label:t.$t(`webextrator.expectedType.product`)},null,8,[`label`])]),_:1},8,[`modelValue`])])}var ve=L(me,[[`render`,_e],[`__scopeId`,`data-v-3b572c49`]]),ye=g({name:`LlmToggle`,components:{InfoIcon:N,ElSwitch:k,ElTooltip:x},computed:{value:{get(){return!!this.$store.state.webextrator?.config?.enable_llm},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,enable_llm:e})}}}}),be={class:`field`},xe={class:`title font-bold`};function Se(t,n,o,c,l,d){let f=u(`info-icon`),m=u(`el-tooltip`),g=u(`el-switch`);return h(),s(`div`,be,[e(`h2`,xe,[r(i(t.$t(`webextrator.name.enableLlm`))+` `,1),a(m,{effect:`dark`,content:t.$t(`webextrator.description.enableLlm`),placement:`top`},{default:p(()=>[a(f,{class:`ml-1 text-[var(--el-text-color-secondary)] text-xs`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])]),a(g,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Ce=L(ye,[[`render`,Se],[`__scopeId`,`data-v-a0c2f78c`]]),we=[`image`,`font`,`media`,`stylesheet`,`xhr`,`fetch`],Te=g({name:`AdvancedOptions`,components:{ElCollapse:E,ElCollapseItem:T,ElInput:B,ElInputNumber:O,ElSelect:_,ElOption:v},data(){return{active:[]}},computed:{resourceKinds(){return we},waitUntil:{get(){return this.$store.state.webextrator?.config?.wait_until||`networkidle`},set(e){this.commit({wait_until:e})}},waitForSelector:{get(){return this.$store.state.webextrator?.config?.wait_for_selector||``},set(e){this.commit({wait_for_selector:e})}},timeout:{get(){return this.$store.state.webextrator?.config?.timeout??30},set(e){this.commit({timeout:e})}},delay:{get(){return this.$store.state.webextrator?.config?.delay??0},set(e){this.commit({delay:e})}},blockResources:{get(){return this.$store.state.webextrator?.config?.block_resources||[]},set(e){this.commit({block_resources:e})}}},methods:{commit(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,...e})}}}),Ee={class:`field`},De={class:`sub-title`},Oe={class:`field`},ke={class:`sub-title`},Ae={class:`field`},je={class:`sub-title`},Me={class:`field`},Ne={class:`sub-title`},Pe={class:`field`},Fe={class:`sub-title`};function Ie(t,n,r,o,c,d){let g=u(`el-option`),_=u(`el-select`),v=u(`el-input`),y=u(`el-input-number`),b=u(`el-collapse-item`),x=u(`el-collapse`);return h(),f(x,{modelValue:t.active,"onUpdate:modelValue":n[5]||=e=>t.active=e,class:`advanced`},{default:p(()=>[a(b,{title:t.$t(`webextrator.name.advanced`),name:`advanced`},{default:p(()=>[e(`div`,Ee,[e(`h2`,De,i(t.$t(`webextrator.name.waitUntil`)),1),a(_,{modelValue:t.waitUntil,"onUpdate:modelValue":n[0]||=e=>t.waitUntil=e,class:`value`},{default:p(()=>[a(g,{value:`networkidle`,label:t.$t(`webextrator.waitUntil.networkidle`)},null,8,[`label`]),a(g,{value:`load`,label:t.$t(`webextrator.waitUntil.load`)},null,8,[`label`]),a(g,{value:`domcontentloaded`,label:t.$t(`webextrator.waitUntil.domcontentloaded`)},null,8,[`label`]),a(g,{value:`commit`,label:t.$t(`webextrator.waitUntil.commit`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Oe,[e(`h2`,ke,i(t.$t(`webextrator.name.waitForSelector`)),1),a(v,{modelValue:t.waitForSelector,"onUpdate:modelValue":n[1]||=e=>t.waitForSelector=e,placeholder:t.$t(`webextrator.placeholder.waitForSelector`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,Ae,[e(`h2`,je,i(t.$t(`webextrator.name.timeout`)),1),a(y,{modelValue:t.timeout,"onUpdate:modelValue":n[2]||=e=>t.timeout=e,min:1,max:120,step:5,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Me,[e(`h2`,Ne,i(t.$t(`webextrator.name.delay`)),1),a(y,{modelValue:t.delay,"onUpdate:modelValue":n[3]||=e=>t.delay=e,min:0,max:30,step:1,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Pe,[e(`h2`,Fe,i(t.$t(`webextrator.name.blockResources`)),1),a(_,{modelValue:t.blockResources,"onUpdate:modelValue":n[4]||=e=>t.blockResources=e,multiple:``,"collapse-tags":``,placeholder:t.$t(`webextrator.placeholder.blockResources`),class:`w-full`},{default:p(()=>[(h(!0),s(l,null,m(t.resourceKinds,e=>(h(),f(g,{key:e,label:t.$t(`webextrator.blockResource.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Le=g({name:`WebextratorConfigPanel`,components:{LightningIcon:I,ElButton:z,ModeSelector:ce,UrlInput:pe,ExpectedTypeSelector:ve,LlmToggle:Ce,AdvancedOptions:L(Te,[[`render`,Ie],[`__scopeId`,`data-v-8f36d2df`]]),Consumption:q},emits:[`run`],computed:{config(){return this.$store.state.webextrator?.config},service(){return this.$store.state.webextrator?.service},consumption(){return R(this.config||{},this.service?.cost)},running(){return this.$store.state.webextrator?.status?.run===U.Request},isExtract(){return(this.config?.mode||`extract`)===`extract`},canRun(){let e=(this.config?.url||``).trim();return/^https?:\/\//i.test(e)}},methods:{onRun(){this.canRun&&this.$emit(`run`)}}}),Re={class:`flex flex-col h-full`},ze={class:`flex-1 overflow-y-auto p-5`},Be={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ve(t,n,c,d,f,m){let g=u(`mode-selector`),_=u(`url-input`),v=u(`expected-type-selector`),y=u(`llm-toggle`),b=u(`advanced-options`),x=u(`consumption`),S=u(`lightning-icon`),C=u(`el-button`);return h(),s(`div`,Re,[e(`div`,ze,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`,onSubmit:t.onRun},null,8,[`onSubmit`]),t.isExtract?(h(),s(l,{key:0},[a(v,{class:`mb-4`}),a(y,{class:`mb-4`})],64)):o(``,!0),a(b,{class:`mb-4`})]),e(`div`,Be,[a(x,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(C,{type:`primary`,class:`w-full`,round:``,loading:t.running,disabled:!t.canRun,onClick:t.onRun},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.isExtract?`webextrator.button.extract`:`webextrator.button.render`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])}var He=L(Le,[[`render`,Ve]]),Ue=e=>!!e&&e.kind!==`render`,We=g({name:`WebextratorResultPanel`,components:{ExternalLinkIcon:j,GlobeIcon:M,LabelIcon:ee,LoadingIcon:P,SignalIcon:J,TimeIcon:A,ElAlert:S,ElImage:G,ElTabs:y,ElTabPane:b,CopyToClipboard:K},data(){return{activeTab:`markdown`}},computed:{response(){return this.$store.state.webextrator?.response},running(){return this.$store.state.webextrator?.status?.run===U.Request},data(){return this.response?.data},renderData(){return this.data&&this.data.kind===`render`?this.data:void 0},extractData(){return Ue(this.data)?this.data:void 0},finalUrl(){let e=this.data;return e?.finalUrl||e?.final_url||e?.url},contentTypeLabel(){let e=this.data;return e?.contentType||e?.content_type||e?.expected_type},screenshotSrc(){let e=this.data?.screenshot;if(e)return e.startsWith(`data:`)||e.startsWith(`http`)?e:`data:image/png;base64,${e}`},markdown(){let e=this.data;return e?.markdown||e?.content||``},plainText(){return this.data?.text||``},html(){return this.data?.html||``},links(){return Array.isArray(this.data?.links)?this.data.links:[]},linksPlain(){return this.links.join(`
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,F as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,it as d,j as f,mt as p,rt as m,tt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{r as _,t as v}from"./select-CY8L3FpM.js";import{n as y,t as b}from"./tabs-tYFbYhk_.js";import{t as x}from"./tooltip-BWksRWUx.js";import{t as S}from"./alert-BsVzeQZL.js";import{n as C,r as w}from"./radio-DgDgyT2l.js";import{n as T,t as E}from"./collapse-BGRzjqqi.js";import{t as D}from"./drawer-91Rv4Ele.js";import{t as O}from"./input-number-DFaagkZ1.js";import{t as k}from"./switch-tSKAoZ0l.js";import{t as A}from"./clock-DmoJeS1-.js";import{t as j}from"./external-link-C-ELuFgb.js";import{t as M}from"./globe-CbeIDOnV.js";import{t as N}from"./info-CsXueTRq.js";import{t as P}from"./loader-circle-BtKiEz76.js";import{t as F}from"./sliders-horizontal-DEmALzFN.js";import{t as ee}from"./tag-WjH23hVG.js";import{t as te}from"./wand-sparkles-G_omarUp.js";import{t as I}from"./zap-BY9oC9vX.js";import"./constants-Dwvkb2qI.js";import{E as L,Gt as R,Mi as z,Vi as B,en as V,gi as H,ni as U,vi as W,xi as G}from"./index-D11lR21M.js";import{t as K}from"./CopyToClipboard-DMzrmhs6.js";import{t as q}from"./Consumption-C5-QJWxc.js";var J=H(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),Y=g({name:`LayoutWebextrator`,components:{ControlsIcon:F,ElDrawer:D,ElButton:z},data(){return{drawer:!1}}}),X={class:`main flex flex-row flex-1`},Z={class:`config w-[340px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Q={class:`result h-full flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ne(t,n,r,i,o,c){let l=u(`controls-icon`),f=u(`el-button`),m=u(`el-drawer`);return h(),s(`div`,X,[e(`div`,Z,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Q,[d(t.$slots,`result`,{},void 0,!0)]),a(f,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var re=L(Y,[[`render`,ne],[`__scopeId`,`data-v-0ca47a5f`]]),ie=g({name:`ModeSelector`,components:{GlobeIcon:M,MagicIcon:te,ElRadioGroup:w,ElRadioButton:C},computed:{value:{get(){return this.$store.state.webextrator?.config?.mode},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,mode:e})}}}}),ae={class:`field`},oe={class:`title font-bold`};function se(t,n,o,c,l,d){let f=u(`magic-icon`),m=u(`el-radio-button`),g=u(`globe-icon`),_=u(`el-radio-group`);return h(),s(`div`,ae,[e(`h2`,oe,i(t.$t(`webextrator.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value w-full`},{default:p(()=>[a(m,{label:`extract`,value:`extract`},{default:p(()=>[a(f,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.extract`)),1)]),_:1}),a(m,{label:`render`,value:`render`},{default:p(()=>[a(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`webextrator.mode.render`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ce=L(ie,[[`render`,se],[`__scopeId`,`data-v-76c5bea5`]]),le=g({name:`UrlInput`,components:{ElInput:B},emits:[`submit`],computed:{url:{get(){return this.$store.state.webextrator?.config?.url||``},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,url:e})}}},methods:{onEnter(){this.$emit(`submit`)}}}),ue={class:`field`},de={class:`title font-bold`};function fe(n,r,o,l,d,f){let p=u(`el-input`);return h(),s(`div`,ue,[e(`h2`,de,i(n.$t(`webextrator.name.url`)),1),a(p,{modelValue:n.url,"onUpdate:modelValue":r[0]||=e=>n.url=e,type:`textarea`,rows:2,class:`prompt`,placeholder:n.$t(`webextrator.placeholder.url`),onKeydown:c(t(n.onEnter,[`exact`,`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])])}var pe=L(le,[[`render`,fe],[`__scopeId`,`data-v-18488009`]]),me=g({name:`ExpectedTypeSelector`,components:{ElSelect:_,ElOption:v},computed:{value:{get(){return this.$store.state.webextrator?.config?.expected_type},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,expected_type:e})}}},mounted(){this.value||=`general`}}),he={class:`field`},ge={class:`title font-bold`};function _e(t,n,r,o,c,l){let d=u(`el-option`),f=u(`el-select`);return h(),s(`div`,he,[e(`h2`,ge,i(t.$t(`webextrator.name.expectedType`)),1),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},{default:p(()=>[a(d,{value:`general`,label:t.$t(`webextrator.expectedType.general`)},null,8,[`label`]),a(d,{value:`article`,label:t.$t(`webextrator.expectedType.article`)},null,8,[`label`]),a(d,{value:`product`,label:t.$t(`webextrator.expectedType.product`)},null,8,[`label`])]),_:1},8,[`modelValue`])])}var ve=L(me,[[`render`,_e],[`__scopeId`,`data-v-3b572c49`]]),ye=g({name:`LlmToggle`,components:{InfoIcon:N,ElSwitch:k,ElTooltip:x},computed:{value:{get(){return!!this.$store.state.webextrator?.config?.enable_llm},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,enable_llm:e})}}}}),be={class:`field`},xe={class:`title font-bold`};function Se(t,n,o,c,l,d){let f=u(`info-icon`),m=u(`el-tooltip`),g=u(`el-switch`);return h(),s(`div`,be,[e(`h2`,xe,[r(i(t.$t(`webextrator.name.enableLlm`))+` `,1),a(m,{effect:`dark`,content:t.$t(`webextrator.description.enableLlm`),placement:`top`},{default:p(()=>[a(f,{class:`ml-1 text-[var(--el-text-color-secondary)] text-xs`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])]),a(g,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])}var Ce=L(ye,[[`render`,Se],[`__scopeId`,`data-v-a0c2f78c`]]),we=[`image`,`font`,`media`,`stylesheet`,`xhr`,`fetch`],Te=g({name:`AdvancedOptions`,components:{ElCollapse:E,ElCollapseItem:T,ElInput:B,ElInputNumber:O,ElSelect:_,ElOption:v},data(){return{active:[]}},computed:{resourceKinds(){return we},waitUntil:{get(){return this.$store.state.webextrator?.config?.wait_until||`networkidle`},set(e){this.commit({wait_until:e})}},waitForSelector:{get(){return this.$store.state.webextrator?.config?.wait_for_selector||``},set(e){this.commit({wait_for_selector:e})}},timeout:{get(){return this.$store.state.webextrator?.config?.timeout??30},set(e){this.commit({timeout:e})}},delay:{get(){return this.$store.state.webextrator?.config?.delay??0},set(e){this.commit({delay:e})}},blockResources:{get(){return this.$store.state.webextrator?.config?.block_resources||[]},set(e){this.commit({block_resources:e})}}},methods:{commit(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,...e})}}}),Ee={class:`field`},De={class:`sub-title`},Oe={class:`field`},ke={class:`sub-title`},Ae={class:`field`},je={class:`sub-title`},Me={class:`field`},Ne={class:`sub-title`},Pe={class:`field`},Fe={class:`sub-title`};function Ie(t,n,r,o,c,d){let g=u(`el-option`),_=u(`el-select`),v=u(`el-input`),y=u(`el-input-number`),b=u(`el-collapse-item`),x=u(`el-collapse`);return h(),f(x,{modelValue:t.active,"onUpdate:modelValue":n[5]||=e=>t.active=e,class:`advanced`},{default:p(()=>[a(b,{title:t.$t(`webextrator.name.advanced`),name:`advanced`},{default:p(()=>[e(`div`,Ee,[e(`h2`,De,i(t.$t(`webextrator.name.waitUntil`)),1),a(_,{modelValue:t.waitUntil,"onUpdate:modelValue":n[0]||=e=>t.waitUntil=e,class:`value`},{default:p(()=>[a(g,{value:`networkidle`,label:t.$t(`webextrator.waitUntil.networkidle`)},null,8,[`label`]),a(g,{value:`load`,label:t.$t(`webextrator.waitUntil.load`)},null,8,[`label`]),a(g,{value:`domcontentloaded`,label:t.$t(`webextrator.waitUntil.domcontentloaded`)},null,8,[`label`]),a(g,{value:`commit`,label:t.$t(`webextrator.waitUntil.commit`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Oe,[e(`h2`,ke,i(t.$t(`webextrator.name.waitForSelector`)),1),a(v,{modelValue:t.waitForSelector,"onUpdate:modelValue":n[1]||=e=>t.waitForSelector=e,placeholder:t.$t(`webextrator.placeholder.waitForSelector`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,Ae,[e(`h2`,je,i(t.$t(`webextrator.name.timeout`)),1),a(y,{modelValue:t.timeout,"onUpdate:modelValue":n[2]||=e=>t.timeout=e,min:1,max:120,step:5,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Me,[e(`h2`,Ne,i(t.$t(`webextrator.name.delay`)),1),a(y,{modelValue:t.delay,"onUpdate:modelValue":n[3]||=e=>t.delay=e,min:0,max:30,step:1,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),e(`div`,Pe,[e(`h2`,Fe,i(t.$t(`webextrator.name.blockResources`)),1),a(_,{modelValue:t.blockResources,"onUpdate:modelValue":n[4]||=e=>t.blockResources=e,multiple:``,"collapse-tags":``,placeholder:t.$t(`webextrator.placeholder.blockResources`),class:`w-full`},{default:p(()=>[(h(!0),s(l,null,m(t.resourceKinds,e=>(h(),f(g,{key:e,label:t.$t(`webextrator.blockResource.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Le=g({name:`WebextratorConfigPanel`,components:{LightningIcon:I,ElButton:z,ModeSelector:ce,UrlInput:pe,ExpectedTypeSelector:ve,LlmToggle:Ce,AdvancedOptions:L(Te,[[`render`,Ie],[`__scopeId`,`data-v-8f36d2df`]]),Consumption:q},emits:[`run`],computed:{config(){return this.$store.state.webextrator?.config},service(){return this.$store.state.webextrator?.service},consumption(){return R(this.config||{},this.service?.cost)},running(){return this.$store.state.webextrator?.status?.run===U.Request},isExtract(){return(this.config?.mode||`extract`)===`extract`},canRun(){let e=(this.config?.url||``).trim();return/^https?:\/\//i.test(e)}},methods:{onRun(){this.canRun&&this.$emit(`run`)}}}),Re={class:`flex flex-col h-full`},ze={class:`flex-1 overflow-y-auto p-5`},Be={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ve(t,n,c,d,f,m){let g=u(`mode-selector`),_=u(`url-input`),v=u(`expected-type-selector`),y=u(`llm-toggle`),b=u(`advanced-options`),x=u(`consumption`),S=u(`lightning-icon`),C=u(`el-button`);return h(),s(`div`,Re,[e(`div`,ze,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`,onSubmit:t.onRun},null,8,[`onSubmit`]),t.isExtract?(h(),s(l,{key:0},[a(v,{class:`mb-4`}),a(y,{class:`mb-4`})],64)):o(``,!0),a(b,{class:`mb-4`})]),e(`div`,Be,[a(x,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(C,{type:`primary`,class:`w-full`,round:``,loading:t.running,disabled:!t.canRun,onClick:t.onRun},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.isExtract?`webextrator.button.extract`:`webextrator.button.render`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])}var He=L(Le,[[`render`,Ve]]),Ue=e=>!!e&&e.kind!==`render`,We=g({name:`WebextratorResultPanel`,components:{ExternalLinkIcon:j,GlobeIcon:M,LabelIcon:ee,LoadingIcon:P,SignalIcon:J,TimeIcon:A,ElAlert:S,ElImage:G,ElTabs:y,ElTabPane:b,CopyToClipboard:K},data(){return{activeTab:`markdown`}},computed:{response(){return this.$store.state.webextrator?.response},running(){return this.$store.state.webextrator?.status?.run===U.Request},data(){return this.response?.data},renderData(){return this.data&&this.data.kind===`render`?this.data:void 0},extractData(){return Ue(this.data)?this.data:void 0},finalUrl(){let e=this.data;return e?.finalUrl||e?.final_url||e?.url},contentTypeLabel(){let e=this.data;return e?.contentType||e?.content_type||e?.expected_type},screenshotSrc(){let e=this.data?.screenshot;if(e)return e.startsWith(`data:`)||e.startsWith(`http`)?e:`data:image/png;base64,${e}`},markdown(){let e=this.data;return e?.markdown||e?.content||``},plainText(){return this.data?.text||``},html(){return this.data?.html||``},links(){return Array.isArray(this.data?.links)?this.data.links:[]},linksPlain(){return this.links.join(`
|
|
2
2
|
`)},images(){return Array.isArray(this.data?.images)?this.data.images:[]},structuredPretty(){return this.extractData?.structured?JSON.stringify(this.extractData.structured,null,2):``},rawPretty(){return this.response?JSON.stringify(this.response,null,2):``},errorMessage(){if(this.response?.success===!1){let e=this.response?.error;return e?.message||e?.code||this.$t(`webextrator.message.failed`)}}},watch:{response:{handler(){this.resetTab()},immediate:!0}},methods:{resetTab(){this.markdown?this.activeTab=`markdown`:this.extractData?.structured?this.activeTab=`structured`:this.plainText?this.activeTab=`text`:this.html?this.activeTab=`html`:this.activeTab=`raw`}}}),Ge={class:`h-full overflow-y-auto p-6`},Ke={key:0,class:`max-w-4xl mx-auto py-4`},qe={class:`flex items-center gap-2 mb-3 text-[var(--el-color-primary)] text-sm`},Je={key:1,class:`flex flex-col items-center justify-center py-24 text-[var(--el-text-color-disabled)]`},Ye={class:`text-base mb-1`},Xe={class:`text-xs opacity-70`},Ze={key:2,class:`max-w-4xl mx-auto py-4`},Qe={class:`text-xs whitespace-pre-wrap break-words`},$e={key:3,class:`max-w-4xl mx-auto`},et={class:`mb-4`},tt={class:`text-xl font-semibold leading-snug mb-1 break-words text-[var(--el-text-color-primary)]`},nt={class:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-[var(--el-text-color-secondary)]`},rt=[`href`],it={key:1},at={key:2},ot={key:3},st={key:0,class:`mt-2 text-sm text-[var(--el-text-color-regular)] leading-relaxed line-clamp-3`},ct={key:0,class:`mb-5`},lt={class:`tab-toolbar`},ut={class:`content-block`},dt={class:`tab-toolbar`},ft={class:`content-block`},$={class:`tab-toolbar`},pt={class:`content-block code`},mt={class:`tab-toolbar`},ht={class:`links-list`},gt=[`href`],_t={class:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2`},vt={class:`tab-toolbar`},yt={class:`content-block code`},bt={class:`tab-toolbar`},xt={class:`content-block code`};function St(t,c,d,g,_,v){let y=u(`loading-icon`),b=u(`globe-icon`),x=u(`el-alert`),S=u(`external-link-icon`),C=u(`signal-icon`),w=u(`time-icon`),T=u(`label-icon`),E=u(`el-image`),D=u(`copy-to-clipboard`),O=u(`el-tab-pane`),k=u(`el-tabs`);return h(),s(`div`,Ge,[t.running?(h(),s(`div`,Ke,[e(`div`,qe,[a(y,{class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.$t(`webextrator.message.running`)),1)]),c[1]||=n(`<div class="mb-6 animate-pulse" data-v-4ec341a6><div class="h-5 w-3/5 rounded bg-[var(--el-fill-color-dark)] mb-2" data-v-4ec341a6></div><div class="h-3 w-2/5 rounded bg-[var(--el-fill-color)] mb-4" data-v-4ec341a6></div><div class="h-64 w-full rounded bg-[var(--el-fill-color)] mb-3" data-v-4ec341a6></div><div class="h-3 w-full rounded bg-[var(--el-fill-color)] mb-1" data-v-4ec341a6></div><div class="h-3 w-5/6 rounded bg-[var(--el-fill-color)] mb-1" data-v-4ec341a6></div><div class="h-3 w-4/6 rounded bg-[var(--el-fill-color)]" data-v-4ec341a6></div></div>`,1)])):!t.response&&!t.errorMessage?(h(),s(`div`,Je,[a(b,{class:`text-6xl mb-4 opacity-30`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,Ye,i(t.$t(`webextrator.description.intro`)),1),e(`p`,Xe,i(t.$t(`webextrator.description.introHint`)),1)])):t.errorMessage?(h(),s(`div`,Ze,[a(x,{type:`error`,closable:!1,"show-icon":``,title:t.$t(`webextrator.message.failed`)},{default:p(()=>[e(`pre`,Qe,i(t.errorMessage),1)]),_:1},8,[`title`])])):t.data?(h(),s(`div`,$e,[e(`header`,et,[e(`h1`,tt,i(t.data.title||t.$t(`webextrator.message.untitled`)),1),e(`div`,nt,[t.finalUrl?(h(),s(`a`,{key:0,href:t.finalUrl,target:`_blank`,rel:`noopener`,class:`hover:underline truncate max-w-[60%]`},[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.finalUrl),1)],8,rt)):o(``,!0),t.renderData?.status?(h(),s(`span`,it,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.renderData.status),1)])):o(``,!0),t.response?.elapsed?(h(),s(`span`,at,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.response.elapsed.toFixed(2))+`s `,1)])):o(``,!0),t.contentTypeLabel?(h(),s(`span`,ot,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.contentTypeLabel),1)])):o(``,!0)]),t.extractData?.description?(h(),s(`p`,st,i(t.extractData.description),1)):o(``,!0)]),t.screenshotSrc?(h(),s(`figure`,ct,[a(E,{src:t.screenshotSrc,fit:`contain`,"preview-src-list":[t.screenshotSrc],"preview-teleported":``,"hide-on-click-modal":``,class:`w-full max-h-[480px] rounded border border-[var(--app-border-subtle)] bg-[var(--el-fill-color-light)]`},null,8,[`src`,`preview-src-list`])])):o(``,!0),a(k,{modelValue:t.activeTab,"onUpdate:modelValue":c[0]||=e=>t.activeTab=e,class:`result-tabs`},{default:p(()=>[t.markdown?(h(),f(O,{key:0,label:t.$t(`webextrator.tab.markdown`),name:`markdown`},{default:p(()=>[e(`div`,lt,[a(D,{content:t.markdown},null,8,[`content`])]),e(`pre`,ut,i(t.markdown),1)]),_:1},8,[`label`])):o(``,!0),t.plainText?(h(),f(O,{key:1,label:t.$t(`webextrator.tab.text`),name:`text`},{default:p(()=>[e(`div`,dt,[a(D,{content:t.plainText},null,8,[`content`])]),e(`pre`,ft,i(t.plainText),1)]),_:1},8,[`label`])):o(``,!0),t.extractData?.structured?(h(),f(O,{key:2,label:t.$t(`webextrator.tab.structured`),name:`structured`},{default:p(()=>[e(`div`,$,[a(D,{content:t.structuredPretty},null,8,[`content`])]),e(`pre`,pt,i(t.structuredPretty),1)]),_:1},8,[`label`])):o(``,!0),t.links.length?(h(),f(O,{key:3,label:`${t.$t(`webextrator.tab.links`)} (${t.links.length})`,name:`links`},{default:p(()=>[e(`div`,mt,[a(D,{content:t.linksPlain},null,8,[`content`])]),e(`ul`,ht,[(h(!0),s(l,null,m(t.links,(t,n)=>(h(),s(`li`,{key:n,class:`truncate`},[e(`a`,{href:t,target:`_blank`,rel:`noopener`},i(t),9,gt)]))),128))])]),_:1},8,[`label`])):o(``,!0),t.images.length?(h(),f(O,{key:4,label:`${t.$t(`webextrator.tab.images`)} (${t.images.length})`,name:`images`},{default:p(()=>[e(`div`,_t,[(h(!0),s(l,null,m(t.images,(e,n)=>(h(),f(E,{key:n,src:e,fit:`cover`,loading:`lazy`,"preview-src-list":t.images,"initial-index":n,"preview-teleported":``,"hide-on-click-modal":``,class:`aspect-square w-full rounded bg-[var(--el-fill-color-light)]`},null,8,[`src`,`preview-src-list`,`initial-index`]))),128))])]),_:1},8,[`label`])):o(``,!0),t.html?(h(),f(O,{key:5,label:t.$t(`webextrator.tab.html`),name:`html`},{default:p(()=>[e(`div`,vt,[a(D,{content:t.html},null,8,[`content`])]),e(`pre`,yt,i(t.html),1)]),_:1},8,[`label`])):o(``,!0),a(O,{label:t.$t(`webextrator.tab.raw`),name:`raw`},{default:p(()=>[e(`div`,bt,[a(D,{content:t.rawPretty},null,8,[`content`])]),e(`pre`,xt,i(t.rawPretty),1)]),_:1},8,[`label`])]),_:1},8,[`modelValue`])])):o(``,!0)])}var Ct=g({name:`WebextratorIndex`,components:{Layout:re,ConfigPanel:He,ResultPanel:L(We,[[`render`,St],[`__scopeId`,`data-v-4ec341a6`]])},inject:[`initialized`],async mounted(){await this.$store.dispatch(`webextrator/getService`)},methods:{async onRun(){if(!V())return;let e=this.$store.state.webextrator?.config;if(!e?.url)return;let t=(e.mode||`extract`)===`extract`;W.info(this.$t(t?`webextrator.message.extracting`:`webextrator.message.rendering`));try{await this.$store.dispatch(`webextrator/run`),W.success(this.$t(`webextrator.message.success`))}catch(e){let t=e?.response?.data?.error?.code||e?.response?.data?.code;t===`used_up`?W.error(this.$t(`webextrator.message.usedUp`)):t===`too_many_requests`?W.error(this.$t(`webextrator.message.busy`)):t===`timeout`?W.error(this.$t(`webextrator.message.timeout`)):t===`antibot_blocked`?W.error(this.$t(`webextrator.message.antibotBlocked`)):W.error(this.$t(`webextrator.message.failed`))}}}});function wt(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`result-panel`),l=u(`layout`);return h(),f(l,null,{config:p(()=>[a(s,{onRun:e.onRun},null,8,[`onRun`])]),result:p(()=>[a(c)]),_:1})}var Tt=L(Ct,[[`render`,wt]]);export{Tt as default};
|