@acedatacloud/nexior 3.276.4 → 3.276.6
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-DpYCu-EK.js → ApiCodeButton-CkZ3iTVh.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-CFwxSrmZ.js → AskUserQuestionCard-2rTABsxw.js} +1 -1
- package/dist/assets/{Auth-7LLt4q3p.js → Auth-BBoi-TLs.js} +1 -1
- package/dist/assets/{Bare-JAoG6sFQ.js → Bare-DvFjwNOW.js} +1 -1
- package/dist/assets/{BotPlaceholder-BVXWzbpi.js → BotPlaceholder-wd225tVu.js} +1 -1
- package/dist/assets/{BottomFooter-BTcNTyiV.js → BottomFooter-DlErxrCb.js} +1 -1
- package/dist/assets/{Callback-CW861dqy.js → Callback-B8-y6Mxj.js} +1 -1
- package/dist/assets/{Console-BOxYP152.js → Console-D95Q0R6U.js} +1 -1
- package/dist/assets/{Consumption-QfvilMcG.js → Consumption-QKE6OyNN.js} +1 -1
- package/dist/assets/{Conversation-C1Jb8AgW.js → Conversation-73fA_c9Z.js} +1 -1
- package/dist/assets/{CopyToClipboard-C8gyDUMn.js → CopyToClipboard-Cz8Ijlo-.js} +1 -1
- package/dist/assets/{Detail-BMuX9lMp.js → Detail-BPbuKYda.js} +2 -2
- package/dist/assets/{Extra-BshQjZAE.js → Extra-BTM4xAp2.js} +1 -1
- package/dist/assets/{FilePreview-sx756NB5.js → FilePreview-CUB5cN9j.js} +1 -1
- package/dist/assets/{Hailuo-y5ZOpsGB.js → Hailuo-Dj-cbD6I.js} +1 -1
- package/dist/assets/{History-CBejCufL.js → History-C1ivCYca.js} +1 -1
- package/dist/assets/{ImagePreview-DkXTeOKK.js → ImagePreview-Djdk9y6K.js} +1 -1
- package/dist/assets/{ImageWrapper-3eqDS8_u.js → ImageWrapper-ra2xxggC.js} +1 -1
- package/dist/assets/{Index-Bi4e1Cno.js → Index-80Cqm8v6.js} +1 -1
- package/dist/assets/{Index-BJ5FlOXw.js → Index-B0pEfwsB.js} +1 -1
- package/dist/assets/{Index-N6d4HE9o.js → Index-B5NALgjs.js} +1 -1
- package/dist/assets/{Index-CEt4sPAp.js → Index-BTf0xR2o.js} +1 -1
- package/dist/assets/{Index-D1ObDODx.js → Index-BZ8IABzW.js} +1 -1
- package/dist/assets/{Index-DuiQE6-J.js → Index-C1WFpemq.js} +1 -1
- package/dist/assets/{Index-BCYh1z7D.js → Index-CAn9DRR5.js} +1 -1
- package/dist/assets/{Index-vDMn1c6V.js → Index-CQ7fFp2L.js} +1 -1
- package/dist/assets/{Index-BS_kWluw.js → Index-CTDMWfgv.js} +1 -1
- package/dist/assets/{Index-DlZMH8SN.js → Index-CTbcuu8i.js} +1 -1
- package/dist/assets/{Index-B9wup2zp.js → Index-CmCzOYPe.js} +1 -1
- package/dist/assets/{Index-CpdPDUM5.js → Index-Cxj82Vc0.js} +1 -1
- package/dist/assets/{Index-B8H2_z9_.js → Index-DDC3-1QC.js} +1 -1
- package/dist/assets/{Index-VyvPGs_5.js → Index-DM-hbXLT.js} +1 -1
- package/dist/assets/{Index-CLgbPHLC.js → Index-DSISKJGF.js} +1 -1
- package/dist/assets/{Index-DbNh8zrA.js → Index-DYUt6wTx.js} +1 -1
- package/dist/assets/{Index-BRWua7Pn.js → Index-DonwS4SV.js} +1 -1
- package/dist/assets/{Index-05qa1gOC.js → Index-Ds4ukaGr.js} +1 -1
- package/dist/assets/{Index-twlRmX4y.js → Index-NUR3WES9.js} +1 -1
- package/dist/assets/{Index-Be7Y4LIt.js → Index-SyF7s-NP.js} +1 -1
- package/dist/assets/{Index-BJFLDUCM.js → Index-ZPsI7pCR.js} +1 -1
- package/dist/assets/{Index-irgLZ7_Q.js → Index-aGm8H6fg.js} +1 -1
- package/dist/assets/{Index-d635oMC0.js → Index-funcN7_h.js} +1 -1
- package/dist/assets/{Index-DREci_3x.js → Index-lc-LWGTM.js} +1 -1
- package/dist/assets/{Index-Di-zu-p8.js → Index-w-qbSOAb.js} +1 -1
- package/dist/assets/{Index-CKtL81ue.js → Index-yCPWKoF2.js} +1 -1
- package/dist/assets/{Invitees-C0R3g-Zf.js → Invitees-DbtpFrg6.js} +1 -1
- package/dist/assets/{List-DWwcbcPH.js → List-CQu73y1A.js} +1 -1
- package/dist/assets/{List-D6nFAmNC.js → List-DWY1ekah.js} +1 -1
- package/dist/assets/{List-DiYo0Int.js → List-D_yzcqU_.js} +1 -1
- package/dist/assets/{Main-DXUAcE9k.js → Main-CD3z3tUI.js} +1 -1
- package/dist/assets/{Model-CqYI1sS8.js → Model-zA_IjZ-2.js} +1 -1
- package/dist/assets/{Navigator-C2kRAciX.js → Navigator-BpuRhdFM.js} +1 -1
- package/dist/assets/{NoTasks-Dk1WXppl.js → NoTasks-C2vrqE3P.js} +1 -1
- package/dist/assets/{NotFound-Bqzv83rR.js → NotFound-DMuprw5v.js} +1 -1
- package/dist/assets/{Pagination-DYjyzEjF.js → Pagination-D_yTKnm3.js} +1 -1
- package/dist/assets/{Pay-DKdYx4a8.js → Pay-DbeIGxtj.js} +1 -1
- package/dist/assets/{Player-5nZKlwHx.js → Player-DNL2qxfZ.js} +1 -1
- package/dist/assets/{Seedance-CNYLui9X.js → Seedance-BFpJVfFy.js} +1 -1
- package/dist/assets/{Status-Dx6FNAbD.js → Status-BvoB5F2l.js} +1 -1
- package/dist/assets/{Subscribe-Q4ATea2Y.js → Subscribe-D2WHPW8N.js} +1 -1
- package/dist/assets/{TabSwitcher-BRab7qRM.js → TabSwitcher-CxHVPZaB.js} +1 -1
- package/dist/assets/{Tts-DegoQTKa.js → Tts-C863dVKw.js} +1 -1
- package/dist/assets/{VideoPlayer-BLPGe-uP.js → VideoPlayer-7JpKAZCW.js} +1 -1
- package/dist/assets/{avatar-TKtEO4Yl.js → avatar-C1vc0lfK.js} +1 -1
- package/dist/assets/{basic-Db4GCedU.js → basic-bBKvonBp.js} +1 -1
- package/dist/assets/{chat-C6NbygCS.js → chat-HtLYmxOJ.js} +1 -1
- package/dist/assets/{codingBridge-Df_5ydBi.js → codingBridge-BYOYYvbK.js} +1 -1
- package/dist/assets/{codingBridgeNotify-4sUlZ3Lg.js → codingBridgeNotify-BBLL2Ig7.js} +2 -2
- package/dist/assets/{collapse-BH0qROl8.js → collapse-BhykcYZf.js} +1 -1
- package/dist/assets/{createTaskActions-xgaPM_qk.js → createTaskActions-D-LmchXA.js} +1 -1
- package/dist/assets/{date-picker-DnWtfIDn.js → date-picker-BvfG2jlA.js} +1 -1
- package/dist/assets/{dropdown-BpL2qpyg.js → dropdown-Cb0KEP3u.js} +1 -1
- package/dist/assets/{esm-D7H9sAYC.js → esm-BHv9cyWK.js} +3 -3
- package/dist/assets/esm-DFflFti1.js +1 -0
- package/dist/assets/{esm-D8MgG7kP.js → esm-DkQIj-Qs.js} +1 -1
- package/dist/assets/{esm-SCvm8sjU.js → esm-DxcVs2dQ.js} +2 -2
- package/dist/assets/{esm-DRVKxMaD.js → esm-I6QolULl.js} +2 -2
- package/dist/assets/{esm-yeJT_40P.js → esm-UuQoCVdX.js} +1 -1
- package/dist/assets/{esm-y0EduL6s.js → esm-XITOKyZs.js} +1 -1
- package/dist/assets/{fish-C13ospyo.js → fish-D0FmSp_8.js} +1 -1
- package/dist/assets/{flux-CuTQgrEI.js → flux-15ixoZOq.js} +1 -1
- package/dist/assets/{grokvideo-Cxkcup4s.js → grokvideo-7CG4yEu2.js} +1 -1
- package/dist/assets/{hailuo-ld7fCVPo.js → hailuo-BUiLKL6R.js} +1 -1
- package/dist/assets/{headshots-BmUEgkoj.js → headshots-CqNbNCHj.js} +1 -1
- package/dist/assets/{image-CjzS-up0.js → image-qndhHcLK.js} +1 -1
- package/dist/assets/{index-CbswcM-E.css → index-BLOAxTz6.css} +1 -1
- package/dist/assets/{index-BY8YIwDb.js → index-DPVeprbd.js} +4 -4
- package/dist/assets/{index.browser.esm-li52u8xd.js → index.browser.esm-KnrET8Uk.js} +1 -1
- package/dist/assets/{index.es-CH5vwGaN.js → index.es-BixPU3yV.js} +1 -1
- package/dist/assets/{input-number-N0auilju.js → input-number-DTheCgJu.js} +1 -1
- package/dist/assets/{kling-COeQELLT.js → kling-vaT0cVvH.js} +1 -1
- package/dist/assets/{luma-sQSQhtbj.js → luma-B7wgJSJt.js} +1 -1
- package/dist/assets/{midjourney-CTQ-KItL.js → midjourney-Cve7XQCn.js} +1 -1
- package/dist/assets/{nanobanana-C22a0oYN.js → nanobanana-BG4vpYP6.js} +1 -1
- package/dist/assets/{openaiimage-Dq7MWBVX.js → openaiimage-DyFHPBmD.js} +1 -1
- package/dist/assets/{pagination-CjEVtILV.js → pagination-C85K_A44.js} +1 -1
- package/dist/assets/{pika-DU0QitGG.js → pika-D6bTZHdf.js} +1 -1
- package/dist/assets/{pixverse-C-xOT5MG.js → pixverse-C9-cqsJC.js} +1 -1
- package/dist/assets/{popover-1vWQQB0V.js → popover-BImYZMWS.js} +1 -1
- package/dist/assets/{producer-BGA_s87O.js → producer-DIhS-Bdc.js} +1 -1
- package/dist/assets/{qrart-tF6e5Ure.js → qrart-Dmq-bU4M.js} +1 -1
- package/dist/assets/{row-JqIo0dw3.js → row-RxbT4Yot.js} +1 -1
- package/dist/assets/{seedance-CPhZgXeS.js → seedance-C4Vo1cFC.js} +1 -1
- package/dist/assets/{seedream-DueKINO1.js → seedream-DhrGnDo2.js} +1 -1
- package/dist/assets/{select-B14L-681.js → select-CD8mHzh8.js} +1 -1
- package/dist/assets/{serp-DKsD2P4f.js → serp-6IVXC9Fu.js} +1 -1
- package/dist/assets/{slider-ypi7YrnL.js → slider-mTclohyo.js} +1 -1
- package/dist/assets/{solana-wallets-B-Ar3QV5.js → solana-wallets-DX_6id0O.js} +2 -2
- package/dist/assets/{solana-wallets-vue-BxEXL9wo.js → solana-wallets-vue-DPTziAoM.js} +1 -1
- package/dist/assets/{sora-Bvuj-CwF.js → sora-Bt-_PUKj.js} +1 -1
- package/dist/assets/{suno-DBUXJjOG.js → suno-DSDhhp51.js} +1 -1
- package/dist/assets/{switch-Dir3SgN_.js → switch-C7PXbvce.js} +1 -1
- package/dist/assets/{tabs-CllsgUVI.js → tabs-BeML51o2.js} +1 -1
- package/dist/assets/{upload-CgRMUkQi.js → upload-CBFWkkcP.js} +1 -1
- package/dist/assets/{veo-DJcppRgO.js → veo-Dwr0d3dT.js} +1 -1
- package/dist/assets/{wan-CXX5Z70L.js → wan-j93Fx8xo.js} +1 -1
- package/dist/assets/{web-B9iHXzqN.js → web-CQ7igkbM.js} +1 -1
- package/dist/assets/{web-Bgfp9ZAB.js → web-CQ9dbVLS.js} +1 -1
- package/dist/assets/{web-jBZ5VzL9.js → web-Cliv4r3R.js} +1 -1
- package/dist/assets/{web-AJVUYB9i.js → web-DqqZN8kI.js} +1 -1
- package/dist/assets/{web-Cr9qE3HH.js → web-u3VGLAMh.js} +1 -1
- package/dist/assets/{webextrator-CXlTr4A9.js → webextrator-0_8hTCyd.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/esm-I-Ydzkdh.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,D as t,E as n,M as r,N as i,O as a,P as o,Ut as s,X as c,et as l,k as u,lt as d}from"./vendor-chart-mdwpew_o.js";import{t as f}from"./button-DWzbdjZV.js";import{t as p}from"./tooltip-C3PYfh8V.js";import{E as m,Ir as h,Mr as g}from"./index-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,D as t,E as n,M as r,N as i,O as a,P as o,Ut as s,X as c,et as l,k as u,lt as d}from"./vendor-chart-mdwpew_o.js";import{t as f}from"./button-DWzbdjZV.js";import{t as p}from"./tooltip-C3PYfh8V.js";import{E as m,Ir as h,Mr as g}from"./index-DPVeprbd.js";import{t as _}from"./index.es-BixPU3yV.js";import{r as v,t as y}from"./taskDrawerMixin-Cr17Yxqk.js";import{i as b}from"./pagination-C85K_A44.js";var x=o({name:`PromptTextarea`,components:{ElInput:h,ElButton:f,ElTooltip:p,ElDialog:g,FontAwesomeIcon:_,InfoIcon:b},props:{modelValue:{type:String,default:``},title:{type:String,required:!0},info:{type:String,default:``},placeholder:{type:String,default:``},minRows:{type:Number,default:4},maxRows:{type:Number,default:12},maxlength:{type:Number,default:0},expandable:{type:Boolean,default:!0},dialogTitle:{type:String,default:``}},emits:[`update:modelValue`,`expand`],data(){return{expanded:!1}},computed:{text:{get(){return this.modelValue??``},set(e){this.$emit(`update:modelValue`,e)}},hasMaxlength(){return typeof this.maxlength==`number`&&this.maxlength>0},effectiveMaxlength(){return this.hasMaxlength?this.maxlength:void 0}},methods:{onExpand(){this.expanded=!0,this.$emit(`expand`)}}}),S={class:`prompt-textarea`},C={class:`header`},w={class:`title font-bold`},T={class:`actions`};function E(o,f,p,m,h,g){let _=l(`info-icon`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-input`),E=l(`el-dialog`);return c(),u(`div`,S,[n(`div`,C,[n(`h2`,w,s(o.title),1),n(`div`,T,[e(o.$slots,`actions`,{},void 0,!0),o.info?(c(),t(_,{key:0,content:o.info},null,8,[`content`])):a(``,!0),o.expandable?(c(),t(b,{key:1,content:o.$t(`common.button.expand`),placement:`top`},{default:d(()=>[i(y,{size:`small`,circle:``,class:`expand-btn`,onClick:o.onExpand},{default:d(()=>[i(v,{icon:`fa-solid fa-expand`})]),_:1},8,[`onClick`])]),_:1},8,[`content`])):a(``,!0)])]),e(o.$slots,`before`,{},void 0,!0),i(x,{modelValue:o.text,"onUpdate:modelValue":f[0]||=e=>o.text=e,type:`textarea`,class:`textarea`,autosize:{minRows:o.minRows,maxRows:o.maxRows},resize:`vertical`,placeholder:o.placeholder,maxlength:o.effectiveMaxlength,"show-word-limit":o.hasMaxlength},null,8,[`modelValue`,`autosize`,`placeholder`,`maxlength`,`show-word-limit`]),e(o.$slots,`after`,{},void 0,!0),o.expandable?(c(),t(E,{key:0,modelValue:o.expanded,"onUpdate:modelValue":f[3]||=e=>o.expanded=e,title:o.dialogTitle||o.title,width:`720px`,top:`5vh`,"close-on-click-modal":!1,class:`prompt-expand-dialog`,"append-to-body":``},{footer:d(()=>[i(y,{type:`primary`,onClick:f[2]||=e=>o.expanded=!1},{default:d(()=>[r(s(o.$t(`common.button.confirm`)),1)]),_:1})]),default:d(()=>[i(x,{modelValue:o.text,"onUpdate:modelValue":f[1]||=e=>o.text=e,type:`textarea`,autosize:{minRows:14,maxRows:28},placeholder:o.placeholder,maxlength:o.effectiveMaxlength,"show-word-limit":o.hasMaxlength,autofocus:``},null,8,[`modelValue`,`placeholder`,`maxlength`,`show-word-limit`])]),_:1},8,[`modelValue`,`title`])):a(``,!0)])}var D=m(x,[[`render`,E],[`__scopeId`,`data-v-8f4be1c1`]]),O=o({name:`NoTasks`,components:{FontAwesomeIcon:_},mounted(){v.empty=!0},beforeUnmount(){v.empty=!1},methods:{onClick(){window.matchMedia(`(max-width: 767px)`).matches&&y()}}}),k={class:`text-center text-[var(--el-text-color-secondary)] py-16`},A=[`aria-label`],j={class:`mt-4 text-sm`};function M(e,t,r,a,o,d){let f=l(`font-awesome-icon`);return c(),u(`div`,k,[n(`button`,{type:`button`,class:`no-tasks-btn inline-flex items-center justify-center w-16 h-16 rounded-full border border-[var(--el-color-primary-light-5)] bg-[var(--el-color-primary-light-9)] text-[var(--el-color-primary)] cursor-pointer transition duration-200 hover:bg-[var(--el-color-primary-light-7)] hover:scale-105 active:scale-95`,"aria-label":e.$t(`common.message.noTasks`),onClick:t[0]||=(...t)=>e.onClick&&e.onClick(...t)},[i(f,{icon:`fa-solid fa-magic`,class:`text-2xl`})],8,A),n(`p`,j,s(e.$t(`common.message.noTasks`)),1)])}var N=m(O,[[`render`,M]]);export{D as n,N as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{E as e,M as t,N as n,O as r,P as i,Ut as a,X as o,et as s,j as c,k as l,lt as u}from"./vendor-chart-mdwpew_o.js";import{t as d}from"./button-DWzbdjZV.js";import{E as f}from"./index-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{E as e,M as t,N as n,O as r,P as i,Ut as a,X as o,et as s,j as c,k as l,lt as u}from"./vendor-chart-mdwpew_o.js";import{t as d}from"./button-DWzbdjZV.js";import{E as f}from"./index-DPVeprbd.js";import{t as p}from"./index.es-BixPU3yV.js";var m=i({name:`NotFound`,components:{ElButton:d,FontAwesomeIcon:p},computed:{path(){return this.$route?.fullPath||``}},mounted(){let e=document.querySelector(`meta[name="robots"]`);e||(e=document.createElement(`meta`),e.setAttribute(`name`,`robots`),document.head.appendChild(e)),e.setAttribute(`content`,`noindex, nofollow`)},beforeUnmount(){let e=document.querySelector(`meta[name="robots"]`);e&&e.setAttribute(`content`,`index, follow`)},methods:{goHome(){this.$router.push(`/`)},goBack(){window.history.length>1?this.$router.back():this.$router.push(`/`)}}}),h={class:`not-found`},g={class:`container`},_={class:`hero`},v={class:`copy`},y={class:`eyebrow`},b={class:`title`},x={class:`subtitle`},S={class:`actions`},C={key:0,class:`meta`},w={class:`meta__label`},T={class:`meta__path`};function E(i,d,f,p,m,E){let D=s(`font-awesome-icon`),O=s(`el-button`);return o(),l(`div`,h,[d[2]||=e(`div`,{class:`ambient ambient--violet`},null,-1),d[3]||=e(`div`,{class:`ambient ambient--cyan`},null,-1),e(`div`,g,[e(`section`,_,[e(`div`,v,[e(`p`,y,a(i.$t(`common.message.notFoundEyebrow`)),1),d[0]||=e(`h1`,{class:`code`,"aria-hidden":`true`},`404`,-1),e(`h2`,b,a(i.$t(`common.title.notFound`)),1),e(`p`,x,a(i.$t(`common.message.notFound`)),1),e(`div`,S,[n(O,{type:`primary`,round:``,size:`large`,onClick:i.goHome},{default:u(()=>[n(D,{icon:`fa-solid fa-house`,class:`mr-2`}),t(` `+a(i.$t(`common.button.backToHome`)),1)]),_:1},8,[`onClick`]),n(O,{round:``,size:`large`,class:`secondary-action`,onClick:i.goBack},{default:u(()=>[n(D,{icon:`fa-solid fa-arrow-left`,class:`mr-2`}),t(` `+a(i.$t(`common.button.goBack`)),1)]),_:1},8,[`onClick`])]),i.path?(o(),l(`div`,C,[e(`span`,w,a(i.$t(`common.message.notFoundPath`)),1),e(`code`,T,a(i.path),1)])):r(``,!0)]),d[1]||=c(`<div class="art" aria-hidden="true" data-v-d213fd9f><div class="orb orb--lg" data-v-d213fd9f></div><div class="orb orb--md" data-v-d213fd9f></div><div class="orb orb--sm" data-v-d213fd9f></div><div class="grid" data-v-d213fd9f></div><div class="big-404" data-v-d213fd9f><span data-v-d213fd9f>4</span><span class="zero" data-v-d213fd9f><span class="zero__inner" data-v-d213fd9f></span></span><span data-v-d213fd9f>4</span></div></div>`,1)])])])}var D=f(m,[[`render`,E],[`__scopeId`,`data-v-d213fd9f`]]);export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,Dt as n,E as r,F as i,L as a,N as o,Nt as s,O as c,P as l,Q as u,R as d,T as f,Ut as p,X as m,Z as h,ct as g,et as _,k as v,lt as y,nt as b,st as x,v as S,x as C,yt as w}from"./vendor-chart-mdwpew_o.js";import{a as T,c as E,t as D}from"./install-ClulZuUd.js";import{n as O,r as k,s as A}from"./runtime-Cvku-lF9.js";import{O as j,R as M,St as N,_ as P,g as F,gt as I,ht as ee,k as te,m as L,mt as R,t as z,tt as B,vt as V}from"./use-deprecated-CPfQu7wa.js";import{r as ne,t as re}from"./select-B14L-681.js";import{t as H}from"./isEqual-XQKSKR3y.js";import{t as U}from"./event-BGnHezxC.js";import{E as W,Ir as G,Vr as K}from"./index-BY8YIwDb.js";var q=Symbol(`elPaginationKey`),J=O({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:L}}),Y={click:e=>e instanceof MouseEvent},X=T(l({...l({name:`ElPaginationPrev`}),props:J,emits:Y,setup(e){let r=e,{t:i}=V(),a=f(()=>r.disabled||r.currentPage<=1);return(e,r)=>(m(),v(`button`,{type:`button`,class:`btn-prev`,disabled:n(a),"aria-label":e.prevText||n(i)(`el.pagination.prev`),"aria-disabled":n(a),onClick:t=>e.$emit(`click`,t)},[e.prevText?(m(),v(`span`,{key:0},p(e.prevText),1)):(m(),t(n(B),{key:1},{default:y(()=>[(m(),t(b(e.prevIcon)))]),_:1}))],8,[`disabled`,`aria-label`,`aria-disabled`,`onClick`]))}}),[[`__file`,`prev.vue`]]),ie=O({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:L}}),ae=T(l({...l({name:`ElPaginationNext`}),props:ie,emits:[`click`],setup(e){let r=e,{t:i}=V(),a=f(()=>r.disabled||r.currentPage===r.pageCount||r.pageCount===0);return(e,r)=>(m(),v(`button`,{type:`button`,class:`btn-next`,disabled:n(a),"aria-label":e.nextText||n(i)(`el.pagination.next`),"aria-disabled":n(a),onClick:t=>e.$emit(`click`,t)},[e.nextText?(m(),v(`span`,{key:0},p(e.nextText),1)):(m(),t(n(B),{key:1},{default:y(()=>[(m(),t(b(e.nextIcon)))]),_:1}))],8,[`disabled`,`aria-label`,`aria-disabled`,`onClick`]))}}),[[`__file`,`next.vue`]]),Z=()=>d(q,{}),oe=O({pageSize:{type:Number,required:!0},pageSizes:{type:k(Array),default:()=>K([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:I},appendSizeTo:String}),se=T(l({...l({name:`ElPaginationSizes`}),props:oe,emits:[`page-size-change`],setup(r,{emit:i}){let a=r,{t:c}=V(),l=E(`pagination`),d=Z(),p=w(a.pageSize);x(()=>a.pageSizes,(e,t)=>{H(e,t)||s(e)&&i(`page-size-change`,e.includes(a.pageSize)?a.pageSize:a.pageSizes[0])}),x(()=>a.pageSize,e=>{p.value=e});let h=f(()=>a.pageSizes);function g(e){var t;e!==p.value&&(p.value=e,(t=d.handleSizeChange)==null||t.call(d,Number(e)))}return(r,i)=>(m(),v(`span`,{class:e(n(l).e(`sizes`))},[o(n(ne),{"model-value":p.value,disabled:r.disabled,"popper-class":r.popperClass,size:r.size,teleported:r.teleported,"validate-event":!1,"append-to":r.appendSizeTo,onChange:g},{default:y(()=>[(m(!0),v(C,null,u(n(h),e=>(m(),t(n(re),{key:e,value:e,label:e+n(c)(`el.pagination.pagesize`)},null,8,[`value`,`label`]))),128))]),_:1},8,[`model-value`,`disabled`,`popper-class`,`size`,`teleported`,`append-to`])],2))}}),[[`__file`,`sizes.vue`]]),ce=O({size:{type:String,values:I}}),le=T(l({...l({name:`ElPaginationJumper`}),props:ce,setup(t){let{t:i}=V(),a=E(`pagination`),{pageCount:s,disabled:c,currentPage:l,changeEvent:u}=Z(),d=w(),h=f(()=>d.value??l?.value);function g(e){d.value=e?+e:``}function _(e){e=Math.trunc(+e),u?.(e),d.value=void 0}return(t,l)=>(m(),v(`span`,{class:e(n(a).e(`jump`)),disabled:n(c)},[r(`span`,{class:e([n(a).e(`goto`)])},p(n(i)(`el.pagination.goto`)),3),o(n(G),{size:t.size,class:e([n(a).e(`editor`),n(a).is(`in-pagination`)]),min:1,max:n(s),disabled:n(c),"model-value":n(h),"validate-event":!1,"aria-label":n(i)(`el.pagination.page`),type:`number`,"onUpdate:modelValue":g,onChange:_},null,8,[`size`,`class`,`max`,`disabled`,`model-value`,`aria-label`]),r(`span`,{class:e([n(a).e(`classifier`)])},p(n(i)(`el.pagination.pageClassifier`)),3)],10,[`disabled`]))}}),[[`__file`,`jumper.vue`]]),ue=O({total:{type:Number,default:1e3}}),de=T(l({...l({name:`ElPaginationTotal`}),props:ue,setup(t){let{t:r}=V(),i=E(`pagination`),{disabled:a}=Z();return(t,o)=>(m(),v(`span`,{class:e(n(i).e(`total`)),disabled:n(a)},p(n(r)(`el.pagination.total`,{total:t.total})),11,[`disabled`]))}}),[[`__file`,`total.vue`]]),fe=O({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),pe=T(l({...l({name:`ElPaginationPager`}),props:fe,emits:[U],setup(r,{emit:i}){let a=r,o=E(`pager`),s=E(`icon`),{t:l}=V(),d=w(!1),h=w(!1),_=w(!1),y=w(!1),b=w(!1),x=w(!1),T=f(()=>{let e=a.pagerCount,t=(e-1)/2,n=Number(a.currentPage),r=Number(a.pageCount),i=!1,o=!1;r>e&&(n>e-t&&(i=!0),n<r-t&&(o=!0));let s=[];if(i&&!o){let t=r-(e-2);for(let e=t;e<r;e++)s.push(e)}else if(!i&&o)for(let t=2;t<e;t++)s.push(t);else if(i&&o){let t=Math.floor(e/2)-1;for(let e=n-t;e<=n+t;e++)s.push(e)}else for(let e=2;e<r;e++)s.push(e);return s}),D=f(()=>[`more`,`btn-quickprev`,s.b(),o.is(`disabled`,a.disabled)]),O=f(()=>[`more`,`btn-quicknext`,s.b(),o.is(`disabled`,a.disabled)]),k=f(()=>a.disabled?-1:0);g(()=>{let e=(a.pagerCount-1)/2;d.value=!1,h.value=!1,a.pageCount>a.pagerCount&&(a.currentPage>a.pagerCount-e&&(d.value=!0),a.currentPage<a.pageCount-e&&(h.value=!0))});function A(e=!1){a.disabled||(e?_.value=!0:y.value=!0)}function N(e=!1){e?b.value=!0:x.value=!0}function P(e){let t=e.target;if(t.tagName.toLowerCase()===`li`&&Array.from(t.classList).includes(`number`)){let e=Number(t.textContent);e!==a.currentPage&&i(U,e)}else t.tagName.toLowerCase()===`li`&&Array.from(t.classList).includes(`more`)&&F(e)}function F(e){let t=e.target;if(t.tagName.toLowerCase()===`ul`||a.disabled)return;let n=Number(t.textContent),r=a.pageCount,o=a.currentPage,s=a.pagerCount-2;t.className.includes(`more`)&&(t.className.includes(`quickprev`)?n=o-s:t.className.includes(`quicknext`)&&(n=o+s)),Number.isNaN(+n)||(n<1&&(n=1),n>r&&(n=r)),n!==o&&i(U,n)}return(r,i)=>(m(),v(`ul`,{class:e(n(o).b()),onClick:F,onKeyup:S(P,[`enter`])},[r.pageCount>0?(m(),v(`li`,{key:0,class:e([[n(o).is(`active`,r.currentPage===1),n(o).is(`disabled`,r.disabled)],`number`]),"aria-current":r.currentPage===1,"aria-label":n(l)(`el.pagination.currentPage`,{pager:1}),tabindex:n(k)},` 1 `,10,[`aria-current`,`aria-label`,`tabindex`])):c(`v-if`,!0),d.value?(m(),v(`li`,{key:1,class:e(n(D)),tabindex:n(k),"aria-label":n(l)(`el.pagination.prevPages`,{pager:r.pagerCount-2}),onMouseenter:e=>A(!0),onMouseleave:e=>_.value=!1,onFocus:e=>N(!0),onBlur:e=>b.value=!1},[(_.value||b.value)&&!r.disabled?(m(),t(n(j),{key:0})):(m(),t(n(M),{key:1}))],42,[`tabindex`,`aria-label`,`onMouseenter`,`onMouseleave`,`onFocus`,`onBlur`])):c(`v-if`,!0),(m(!0),v(C,null,u(n(T),t=>(m(),v(`li`,{key:t,class:e([[n(o).is(`active`,r.currentPage===t),n(o).is(`disabled`,r.disabled)],`number`]),"aria-current":r.currentPage===t,"aria-label":n(l)(`el.pagination.currentPage`,{pager:t}),tabindex:n(k)},p(t),11,[`aria-current`,`aria-label`,`tabindex`]))),128)),h.value?(m(),v(`li`,{key:2,class:e(n(O)),tabindex:n(k),"aria-label":n(l)(`el.pagination.nextPages`,{pager:r.pagerCount-2}),onMouseenter:e=>A(),onMouseleave:e=>y.value=!1,onFocus:e=>N(),onBlur:e=>x.value=!1},[(y.value||x.value)&&!r.disabled?(m(),t(n(te),{key:0})):(m(),t(n(M),{key:1}))],42,[`tabindex`,`aria-label`,`onMouseenter`,`onMouseleave`,`onFocus`,`onBlur`])):c(`v-if`,!0),r.pageCount>1?(m(),v(`li`,{key:3,class:e([[n(o).is(`active`,r.currentPage===r.pageCount),n(o).is(`disabled`,r.disabled)],`number`]),"aria-current":r.currentPage===r.pageCount,"aria-label":n(l)(`el.pagination.currentPage`,{pager:r.pageCount}),tabindex:n(k)},p(r.pageCount),11,[`aria-current`,`aria-label`,`tabindex`])):c(`v-if`,!0)],42,[`onKeyup`]))}}),[[`__file`,`pager.vue`]]),Q=e=>typeof e!=`number`,me=O({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:e=>A(e)&&Math.trunc(e)===e&&e>4&&e<22&&e%2==1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:[`prev`,`pager`,`next`,`jumper`,`->`,`total`].join(`, `)},pageSizes:{type:k(Array),default:()=>K([10,20,30,40,50,100])},popperClass:{type:String,default:``},prevText:{type:String,default:``},prevIcon:{type:L,default:()=>F},nextText:{type:String,default:``},nextIcon:{type:L,default:()=>P},teleported:{type:Boolean,default:!0},small:Boolean,size:ee,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),he={"update:current-page":e=>A(e),"update:page-size":e=>A(e),"size-change":e=>A(e),change:(e,t)=>A(e)&&A(t),"current-change":e=>A(e),"prev-click":e=>A(e),"next-click":e=>A(e)},$=`ElPagination`,ge=l({name:`Pagination`,components:{ElPagination:D(l({name:$,props:me,emits:he,setup(e,{emit:t,slots:n}){let{t:r}=V(),o=E(`pagination`),s=i().vnode.props||{},c=R(),l=f(()=>e.small?`small`:e.size??c.value);z({from:`small`,replacement:`size`,version:`3.0.0`,scope:`el-pagination`,ref:`https://element-plus.org/zh-CN/component/pagination.html`},f(()=>!!e.small));let u=`onUpdate:currentPage`in s||`onUpdate:current-page`in s||`onCurrentChange`in s,d=`onUpdate:pageSize`in s||`onUpdate:page-size`in s||`onSizeChange`in s,p=f(()=>{if(Q(e.total)&&Q(e.pageCount)||!Q(e.currentPage)&&!u)return!1;if(e.layout.includes(`sizes`)){if(!Q(e.pageCount)){if(!d)return!1}else if(!Q(e.total)&&!Q(e.pageSize)&&!d)return!1}return!0}),m=w(Q(e.defaultPageSize)?10:e.defaultPageSize),g=w(Q(e.defaultCurrentPage)?1:e.defaultCurrentPage),_=f({get(){return Q(e.pageSize)?m.value:e.pageSize},set(n){Q(e.pageSize)&&(m.value=n),d&&(t(`update:page-size`,n),t(`size-change`,n))}}),v=f(()=>{let t=0;return Q(e.pageCount)?Q(e.total)||(t=Math.max(1,Math.ceil(e.total/_.value))):t=e.pageCount,t}),y=f({get(){return Q(e.currentPage)?g.value:e.currentPage},set(n){let r=n;n<1?r=1:n>v.value&&(r=v.value),Q(e.currentPage)&&(g.value=r),u&&(t(`update:current-page`,r),t(`current-change`,r))}});x(v,e=>{y.value>e&&(y.value=e)}),x([y,_],e=>{t(U,...e)},{flush:`post`});function b(e){y.value=e}function S(e){_.value=e;let t=v.value;y.value>t&&(y.value=t)}function C(){e.disabled||(--y.value,t(`prev-click`,y.value))}function T(){e.disabled||(y.value+=1,t(`next-click`,y.value))}function D(e,t){e&&(e.props||={},e.props.class=[e.props.class,t].join(` `))}return h(q,{pageCount:v,disabled:f(()=>e.disabled),currentPage:y,changeEvent:b,handleSizeChange:S}),()=>{if(!p.value)return N($,r(`el.pagination.deprecationWarning`)),null;if(!e.layout||e.hideOnSinglePage&&v.value<=1)return null;let t=[],i=[],s=a(`div`,{class:o.e(`rightwrapper`)},i),c={prev:a(X,{disabled:e.disabled,currentPage:y.value,prevText:e.prevText,prevIcon:e.prevIcon,onClick:C}),jumper:a(le,{size:l.value}),pager:a(pe,{currentPage:y.value,pageCount:v.value,pagerCount:e.pagerCount,onChange:b,disabled:e.disabled}),next:a(ae,{disabled:e.disabled,currentPage:y.value,pageCount:v.value,nextText:e.nextText,nextIcon:e.nextIcon,onClick:T}),sizes:a(se,{pageSize:_.value,pageSizes:e.pageSizes,popperClass:e.popperClass,disabled:e.disabled,teleported:e.teleported,size:l.value,appendSizeTo:e.appendSizeTo}),slot:(n?.default)?.call(n)??null,total:a(de,{total:Q(e.total)?0:e.total})},u=e.layout.split(`,`).map(e=>e.trim()),d=!1;return u.forEach(e=>{if(e===`->`){d=!0;return}d?i.push(c[e]):t.push(c[e])}),D(t[0],o.is(`first`)),D(t[t.length-1],o.is(`last`)),d&&i.length>0&&(D(i[0],o.is(`first`)),D(i[i.length-1],o.is(`last`)),t.push(s)),a(`div`,{class:[o.b(),o.is(`background`,e.background),o.m(l.value)]},t)}}}))},props:{total:{type:Number,required:!1,default:void 0},currentPage:{type:Number,required:!0},pageSize:{type:Number,required:!0}},emits:[`change`],data(){return{loaded:!1}},mounted(){setTimeout(()=>{this.loaded=!0},1e3)},methods:{onPageChange(e){this.loaded&&this.$emit(`change`,e)}}});function _e(e,n,r,i,a,o){let s=_(`el-pagination`);return m(),t(s,{class:`mt-3 mb-3`,background:``,"hide-on-single-page":!1,layout:`prev, pager, next`,"current-page":e.currentPage,total:e.total,"page-size":e.pageSize,onCurrentChange:e.onPageChange},null,8,[`current-page`,`total`,`page-size`,`onCurrentChange`])}var ve=W(ge,[[`render`,_e]]);export{ve as t};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,Dt as n,E as r,F as i,L as a,N as o,Nt as s,O as c,P as l,Q as u,R as d,T as f,Ut as p,X as m,Z as h,ct as g,et as _,k as v,lt as y,nt as b,st as x,v as S,x as C,yt as w}from"./vendor-chart-mdwpew_o.js";import{a as T,c as E,t as D}from"./install-ClulZuUd.js";import{n as O,r as k,s as A}from"./runtime-Cvku-lF9.js";import{O as j,R as M,St as N,_ as P,g as F,gt as I,ht as ee,k as te,m as L,mt as R,t as z,tt as B,vt as V}from"./use-deprecated-CPfQu7wa.js";import{r as ne,t as re}from"./select-CD8mHzh8.js";import{t as H}from"./isEqual-XQKSKR3y.js";import{t as U}from"./event-BGnHezxC.js";import{E as W,Ir as G,Vr as K}from"./index-DPVeprbd.js";var q=Symbol(`elPaginationKey`),J=O({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:L}}),Y={click:e=>e instanceof MouseEvent},X=T(l({...l({name:`ElPaginationPrev`}),props:J,emits:Y,setup(e){let r=e,{t:i}=V(),a=f(()=>r.disabled||r.currentPage<=1);return(e,r)=>(m(),v(`button`,{type:`button`,class:`btn-prev`,disabled:n(a),"aria-label":e.prevText||n(i)(`el.pagination.prev`),"aria-disabled":n(a),onClick:t=>e.$emit(`click`,t)},[e.prevText?(m(),v(`span`,{key:0},p(e.prevText),1)):(m(),t(n(B),{key:1},{default:y(()=>[(m(),t(b(e.prevIcon)))]),_:1}))],8,[`disabled`,`aria-label`,`aria-disabled`,`onClick`]))}}),[[`__file`,`prev.vue`]]),ie=O({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:L}}),ae=T(l({...l({name:`ElPaginationNext`}),props:ie,emits:[`click`],setup(e){let r=e,{t:i}=V(),a=f(()=>r.disabled||r.currentPage===r.pageCount||r.pageCount===0);return(e,r)=>(m(),v(`button`,{type:`button`,class:`btn-next`,disabled:n(a),"aria-label":e.nextText||n(i)(`el.pagination.next`),"aria-disabled":n(a),onClick:t=>e.$emit(`click`,t)},[e.nextText?(m(),v(`span`,{key:0},p(e.nextText),1)):(m(),t(n(B),{key:1},{default:y(()=>[(m(),t(b(e.nextIcon)))]),_:1}))],8,[`disabled`,`aria-label`,`aria-disabled`,`onClick`]))}}),[[`__file`,`next.vue`]]),Z=()=>d(q,{}),oe=O({pageSize:{type:Number,required:!0},pageSizes:{type:k(Array),default:()=>K([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:I},appendSizeTo:String}),se=T(l({...l({name:`ElPaginationSizes`}),props:oe,emits:[`page-size-change`],setup(r,{emit:i}){let a=r,{t:c}=V(),l=E(`pagination`),d=Z(),p=w(a.pageSize);x(()=>a.pageSizes,(e,t)=>{H(e,t)||s(e)&&i(`page-size-change`,e.includes(a.pageSize)?a.pageSize:a.pageSizes[0])}),x(()=>a.pageSize,e=>{p.value=e});let h=f(()=>a.pageSizes);function g(e){var t;e!==p.value&&(p.value=e,(t=d.handleSizeChange)==null||t.call(d,Number(e)))}return(r,i)=>(m(),v(`span`,{class:e(n(l).e(`sizes`))},[o(n(ne),{"model-value":p.value,disabled:r.disabled,"popper-class":r.popperClass,size:r.size,teleported:r.teleported,"validate-event":!1,"append-to":r.appendSizeTo,onChange:g},{default:y(()=>[(m(!0),v(C,null,u(n(h),e=>(m(),t(n(re),{key:e,value:e,label:e+n(c)(`el.pagination.pagesize`)},null,8,[`value`,`label`]))),128))]),_:1},8,[`model-value`,`disabled`,`popper-class`,`size`,`teleported`,`append-to`])],2))}}),[[`__file`,`sizes.vue`]]),ce=O({size:{type:String,values:I}}),le=T(l({...l({name:`ElPaginationJumper`}),props:ce,setup(t){let{t:i}=V(),a=E(`pagination`),{pageCount:s,disabled:c,currentPage:l,changeEvent:u}=Z(),d=w(),h=f(()=>d.value??l?.value);function g(e){d.value=e?+e:``}function _(e){e=Math.trunc(+e),u?.(e),d.value=void 0}return(t,l)=>(m(),v(`span`,{class:e(n(a).e(`jump`)),disabled:n(c)},[r(`span`,{class:e([n(a).e(`goto`)])},p(n(i)(`el.pagination.goto`)),3),o(n(G),{size:t.size,class:e([n(a).e(`editor`),n(a).is(`in-pagination`)]),min:1,max:n(s),disabled:n(c),"model-value":n(h),"validate-event":!1,"aria-label":n(i)(`el.pagination.page`),type:`number`,"onUpdate:modelValue":g,onChange:_},null,8,[`size`,`class`,`max`,`disabled`,`model-value`,`aria-label`]),r(`span`,{class:e([n(a).e(`classifier`)])},p(n(i)(`el.pagination.pageClassifier`)),3)],10,[`disabled`]))}}),[[`__file`,`jumper.vue`]]),ue=O({total:{type:Number,default:1e3}}),de=T(l({...l({name:`ElPaginationTotal`}),props:ue,setup(t){let{t:r}=V(),i=E(`pagination`),{disabled:a}=Z();return(t,o)=>(m(),v(`span`,{class:e(n(i).e(`total`)),disabled:n(a)},p(n(r)(`el.pagination.total`,{total:t.total})),11,[`disabled`]))}}),[[`__file`,`total.vue`]]),fe=O({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),pe=T(l({...l({name:`ElPaginationPager`}),props:fe,emits:[U],setup(r,{emit:i}){let a=r,o=E(`pager`),s=E(`icon`),{t:l}=V(),d=w(!1),h=w(!1),_=w(!1),y=w(!1),b=w(!1),x=w(!1),T=f(()=>{let e=a.pagerCount,t=(e-1)/2,n=Number(a.currentPage),r=Number(a.pageCount),i=!1,o=!1;r>e&&(n>e-t&&(i=!0),n<r-t&&(o=!0));let s=[];if(i&&!o){let t=r-(e-2);for(let e=t;e<r;e++)s.push(e)}else if(!i&&o)for(let t=2;t<e;t++)s.push(t);else if(i&&o){let t=Math.floor(e/2)-1;for(let e=n-t;e<=n+t;e++)s.push(e)}else for(let e=2;e<r;e++)s.push(e);return s}),D=f(()=>[`more`,`btn-quickprev`,s.b(),o.is(`disabled`,a.disabled)]),O=f(()=>[`more`,`btn-quicknext`,s.b(),o.is(`disabled`,a.disabled)]),k=f(()=>a.disabled?-1:0);g(()=>{let e=(a.pagerCount-1)/2;d.value=!1,h.value=!1,a.pageCount>a.pagerCount&&(a.currentPage>a.pagerCount-e&&(d.value=!0),a.currentPage<a.pageCount-e&&(h.value=!0))});function A(e=!1){a.disabled||(e?_.value=!0:y.value=!0)}function N(e=!1){e?b.value=!0:x.value=!0}function P(e){let t=e.target;if(t.tagName.toLowerCase()===`li`&&Array.from(t.classList).includes(`number`)){let e=Number(t.textContent);e!==a.currentPage&&i(U,e)}else t.tagName.toLowerCase()===`li`&&Array.from(t.classList).includes(`more`)&&F(e)}function F(e){let t=e.target;if(t.tagName.toLowerCase()===`ul`||a.disabled)return;let n=Number(t.textContent),r=a.pageCount,o=a.currentPage,s=a.pagerCount-2;t.className.includes(`more`)&&(t.className.includes(`quickprev`)?n=o-s:t.className.includes(`quicknext`)&&(n=o+s)),Number.isNaN(+n)||(n<1&&(n=1),n>r&&(n=r)),n!==o&&i(U,n)}return(r,i)=>(m(),v(`ul`,{class:e(n(o).b()),onClick:F,onKeyup:S(P,[`enter`])},[r.pageCount>0?(m(),v(`li`,{key:0,class:e([[n(o).is(`active`,r.currentPage===1),n(o).is(`disabled`,r.disabled)],`number`]),"aria-current":r.currentPage===1,"aria-label":n(l)(`el.pagination.currentPage`,{pager:1}),tabindex:n(k)},` 1 `,10,[`aria-current`,`aria-label`,`tabindex`])):c(`v-if`,!0),d.value?(m(),v(`li`,{key:1,class:e(n(D)),tabindex:n(k),"aria-label":n(l)(`el.pagination.prevPages`,{pager:r.pagerCount-2}),onMouseenter:e=>A(!0),onMouseleave:e=>_.value=!1,onFocus:e=>N(!0),onBlur:e=>b.value=!1},[(_.value||b.value)&&!r.disabled?(m(),t(n(j),{key:0})):(m(),t(n(M),{key:1}))],42,[`tabindex`,`aria-label`,`onMouseenter`,`onMouseleave`,`onFocus`,`onBlur`])):c(`v-if`,!0),(m(!0),v(C,null,u(n(T),t=>(m(),v(`li`,{key:t,class:e([[n(o).is(`active`,r.currentPage===t),n(o).is(`disabled`,r.disabled)],`number`]),"aria-current":r.currentPage===t,"aria-label":n(l)(`el.pagination.currentPage`,{pager:t}),tabindex:n(k)},p(t),11,[`aria-current`,`aria-label`,`tabindex`]))),128)),h.value?(m(),v(`li`,{key:2,class:e(n(O)),tabindex:n(k),"aria-label":n(l)(`el.pagination.nextPages`,{pager:r.pagerCount-2}),onMouseenter:e=>A(),onMouseleave:e=>y.value=!1,onFocus:e=>N(),onBlur:e=>x.value=!1},[(y.value||x.value)&&!r.disabled?(m(),t(n(te),{key:0})):(m(),t(n(M),{key:1}))],42,[`tabindex`,`aria-label`,`onMouseenter`,`onMouseleave`,`onFocus`,`onBlur`])):c(`v-if`,!0),r.pageCount>1?(m(),v(`li`,{key:3,class:e([[n(o).is(`active`,r.currentPage===r.pageCount),n(o).is(`disabled`,r.disabled)],`number`]),"aria-current":r.currentPage===r.pageCount,"aria-label":n(l)(`el.pagination.currentPage`,{pager:r.pageCount}),tabindex:n(k)},p(r.pageCount),11,[`aria-current`,`aria-label`,`tabindex`])):c(`v-if`,!0)],42,[`onKeyup`]))}}),[[`__file`,`pager.vue`]]),Q=e=>typeof e!=`number`,me=O({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:e=>A(e)&&Math.trunc(e)===e&&e>4&&e<22&&e%2==1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:[`prev`,`pager`,`next`,`jumper`,`->`,`total`].join(`, `)},pageSizes:{type:k(Array),default:()=>K([10,20,30,40,50,100])},popperClass:{type:String,default:``},prevText:{type:String,default:``},prevIcon:{type:L,default:()=>F},nextText:{type:String,default:``},nextIcon:{type:L,default:()=>P},teleported:{type:Boolean,default:!0},small:Boolean,size:ee,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),he={"update:current-page":e=>A(e),"update:page-size":e=>A(e),"size-change":e=>A(e),change:(e,t)=>A(e)&&A(t),"current-change":e=>A(e),"prev-click":e=>A(e),"next-click":e=>A(e)},$=`ElPagination`,ge=l({name:`Pagination`,components:{ElPagination:D(l({name:$,props:me,emits:he,setup(e,{emit:t,slots:n}){let{t:r}=V(),o=E(`pagination`),s=i().vnode.props||{},c=R(),l=f(()=>e.small?`small`:e.size??c.value);z({from:`small`,replacement:`size`,version:`3.0.0`,scope:`el-pagination`,ref:`https://element-plus.org/zh-CN/component/pagination.html`},f(()=>!!e.small));let u=`onUpdate:currentPage`in s||`onUpdate:current-page`in s||`onCurrentChange`in s,d=`onUpdate:pageSize`in s||`onUpdate:page-size`in s||`onSizeChange`in s,p=f(()=>{if(Q(e.total)&&Q(e.pageCount)||!Q(e.currentPage)&&!u)return!1;if(e.layout.includes(`sizes`)){if(!Q(e.pageCount)){if(!d)return!1}else if(!Q(e.total)&&!Q(e.pageSize)&&!d)return!1}return!0}),m=w(Q(e.defaultPageSize)?10:e.defaultPageSize),g=w(Q(e.defaultCurrentPage)?1:e.defaultCurrentPage),_=f({get(){return Q(e.pageSize)?m.value:e.pageSize},set(n){Q(e.pageSize)&&(m.value=n),d&&(t(`update:page-size`,n),t(`size-change`,n))}}),v=f(()=>{let t=0;return Q(e.pageCount)?Q(e.total)||(t=Math.max(1,Math.ceil(e.total/_.value))):t=e.pageCount,t}),y=f({get(){return Q(e.currentPage)?g.value:e.currentPage},set(n){let r=n;n<1?r=1:n>v.value&&(r=v.value),Q(e.currentPage)&&(g.value=r),u&&(t(`update:current-page`,r),t(`current-change`,r))}});x(v,e=>{y.value>e&&(y.value=e)}),x([y,_],e=>{t(U,...e)},{flush:`post`});function b(e){y.value=e}function S(e){_.value=e;let t=v.value;y.value>t&&(y.value=t)}function C(){e.disabled||(--y.value,t(`prev-click`,y.value))}function T(){e.disabled||(y.value+=1,t(`next-click`,y.value))}function D(e,t){e&&(e.props||={},e.props.class=[e.props.class,t].join(` `))}return h(q,{pageCount:v,disabled:f(()=>e.disabled),currentPage:y,changeEvent:b,handleSizeChange:S}),()=>{if(!p.value)return N($,r(`el.pagination.deprecationWarning`)),null;if(!e.layout||e.hideOnSinglePage&&v.value<=1)return null;let t=[],i=[],s=a(`div`,{class:o.e(`rightwrapper`)},i),c={prev:a(X,{disabled:e.disabled,currentPage:y.value,prevText:e.prevText,prevIcon:e.prevIcon,onClick:C}),jumper:a(le,{size:l.value}),pager:a(pe,{currentPage:y.value,pageCount:v.value,pagerCount:e.pagerCount,onChange:b,disabled:e.disabled}),next:a(ae,{disabled:e.disabled,currentPage:y.value,pageCount:v.value,nextText:e.nextText,nextIcon:e.nextIcon,onClick:T}),sizes:a(se,{pageSize:_.value,pageSizes:e.pageSizes,popperClass:e.popperClass,disabled:e.disabled,teleported:e.teleported,size:l.value,appendSizeTo:e.appendSizeTo}),slot:(n?.default)?.call(n)??null,total:a(de,{total:Q(e.total)?0:e.total})},u=e.layout.split(`,`).map(e=>e.trim()),d=!1;return u.forEach(e=>{if(e===`->`){d=!0;return}d?i.push(c[e]):t.push(c[e])}),D(t[0],o.is(`first`)),D(t[t.length-1],o.is(`last`)),d&&i.length>0&&(D(i[0],o.is(`first`)),D(i[i.length-1],o.is(`last`)),t.push(s)),a(`div`,{class:[o.b(),o.is(`background`,e.background),o.m(l.value)]},t)}}}))},props:{total:{type:Number,required:!1,default:void 0},currentPage:{type:Number,required:!0},pageSize:{type:Number,required:!0}},emits:[`change`],data(){return{loaded:!1}},mounted(){setTimeout(()=>{this.loaded=!0},1e3)},methods:{onPageChange(e){this.loaded&&this.$emit(`change`,e)}}});function _e(e,n,r,i,a,o){let s=_(`el-pagination`);return m(),t(s,{class:`mt-3 mb-3`,background:``,"hide-on-single-page":!1,layout:`prev, pager, next`,"current-page":e.currentPage,total:e.total,"page-size":e.pageSize,onCurrentChange:e.onPageChange},null,8,[`current-page`,`total`,`page-size`,`onCurrentChange`])}var ve=W(ge,[[`render`,_e]]);export{ve as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,E as n,M as r,N as i,O as a,P as o,Ut as s,X as c,et as l,k as u,lt as d,x as f}from"./vendor-chart-mdwpew_o.js";import{t as p}from"./button-DWzbdjZV.js";import{t as ee}from"./alert-BJj7gY4q.js";import{t as te}from"./card-B1OoUKT4.js";import{n as m,t as h}from"./row-JqIo0dw3.js";import{i as g,n as _,r as v,t as y}from"./wechat-iv-pzVEX.js";import{t as b}from"./divider-Ba_Z3oBh.js";import{t as x}from"./skeleton-Cn4UY-T8.js";import{Cn as S,Cr as C,E as w,Et as T,It as E,Mr as D,Pr as O,Pt as k,dr as A,kr as j}from"./index-BY8YIwDb.js";import{t as M}from"./CopyToClipboard-C8gyDUMn.js";var N=o({name:`PublicWechatPayDialog`,components:{ElDialog:D,ElButton:p,QrCode:T,ElRow:h,ElCol:m},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return _()&&!y()},isMobileInsideWechat(){return _()&&y()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await E(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):j.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),P={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},F={class:`text-[14px] mb-3 leading-relaxed`},I={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},L={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},R={class:`text-[14px] mb-4 leading-relaxed`},z={class:`paycode wechat`},B={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function V(e,o,f,p,ee,te){let m=l(`qr-code`),h=l(`el-button`),g=l(`el-col`),_=l(`el-row`),v=l(`el-dialog`);return c(),t(v,{"model-value":e.visible,title:e.$t(`application.title.buyService`),width:e.dialogWidth,center:``,onClose:o[0]||=t=>e.$emit(`hide`)},{default:d(()=>[e.isMobileOutsideWechat?(c(),u(`div`,P,[n(`p`,F,s(e.$t(`order.message.wechatPayMobileScanTip`)),1),e.order?.pay_url?(c(),t(m,{key:0,value:e.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),n(`p`,I,s(e.$t(`order.message.wechatPayMobileHint`)),1),i(h,{size:`default`,round:``,class:`w-[220px]`,onClick:e.onCopyLink},{default:d(()=>[r(s(e.copied?e.$t(`common.message.copied`):e.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):e.isMobileInsideWechat?(c(),u(`div`,L,[n(`p`,R,s(e.$t(`order.message.wechatPayLongPressTip`)),1),e.order?.pay_url?(c(),t(m,{key:0,value:e.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(c(),t(_,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:d(()=>[i(g,{span:12},{default:d(()=>[n(`div`,z,[e.order?.pay_url?(c(),t(m,{key:0,value:e.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),n(`p`,B,s(e.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(g,{span:12},{default:d(()=>[...o[1]||=[n(`div`,{class:`help-img`},[n(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var H=w(N,[[`render`,V]]),U=o({name:`PublicStripePayDialog`,components:{ElDialog:D},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),W={class:`text-center`};function G(e,r,i,a,o,u){let f=l(`el-dialog`);return c(),t(f,{"model-value":e.visible,title:e.$t(`application.title.buyService`),width:`500px`,center:``,onClose:r[0]||=t=>e.$emit(`hide`)},{default:d(()=>[n(`p`,W,s(e.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var K=w(U,[[`render`,G]]),ne=o({name:`PublicAlipayPayDialog`,components:{ElDialog:D},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),q={class:`text-center`};function J(e,r,i,a,o,u){let f=l(`el-dialog`);return c(),t(f,{"model-value":e.visible,title:e.$t(`application.title.buyService`),width:`500px`,center:``,onClose:r[0]||=t=>e.$emit(`hide`)},{default:d(()=>[n(`p`,q,s(e.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var Y=w(ne,[[`render`,J]]),X=7e3,Z=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e}(Q||{}),re=o({name:`OrderPublicPay`,components:{ElButton:p,ElRow:h,ElCol:m,ElCard:te,ElSkeleton:x,ElDivider:b,ElAlert:ee,ElDescriptions:v,ElDescriptionsItem:g,ElTag:O,PublicWechatPay:H,PublicStripePay:K,PublicAlipayPay:Y,CopyToClipboard:M},data(){return{PayWay:Q,OrderState:A,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``}},watch:{paying(e){e?this.startOrderPolling(Z):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:k,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,S.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await S.get(this.id);if(this.order=e,e?.state===A.PAID||e?.state===A.FINISHED||e?.state===A.FAILED||e?.state===A.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,X))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=C()),S.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ie={class:`title`},ae={key:0,class:`pt-5`},oe={key:1,class:`pt-10 text-center`},$={key:2,class:`order`},se={key:0,class:`price current unfree`},ce={key:1,class:`price free`},le={key:0,class:`payways mb-6`},ue={class:`payname`},de={class:`payname`},fe={class:`payname`},pe={key:1},me={key:2};function he(o,p,ee,te,m,h){let g=l(`el-col`),_=l(`el-row`),v=l(`el-skeleton`),y=l(`el-alert`),b=l(`copy-to-clipboard`),x=l(`el-descriptions-item`),S=l(`el-tag`),C=l(`el-descriptions`),w=l(`el-divider`),T=l(`el-button`),E=l(`el-card`),D=l(`public-wechat-pay`),O=l(`public-stripe-pay`),k=l(`public-alipay-pay`);return c(),u(f,null,[i(_,{class:`wrapper`},{default:d(()=>[i(g,{span:24},{default:d(()=>[i(_,null,{default:d(()=>[i(g,{span:24},{default:d(()=>[n(`h2`,ie,s(o.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(_,{class:`panel`},{default:d(()=>[i(g,{span:24},{default:d(()=>[i(E,{shadow:`hover`},{default:d(()=>[i(_,null,{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[o.loading?(c(),u(`div`,ae,[i(v,{animated:``})])):o.order?(c(),u(`div`,$,[i(C,{column:1},{default:d(()=>[i(x,{label:o.$t(`order.field.id`)},{default:d(()=>[n(`span`,null,s(o.order.id),1),o.order.id?(c(),t(b,{key:0,content:o.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(x,{label:o.$t(`order.field.description`)},{default:d(()=>[r(s(o.order.description),1)]),_:1},8,[`label`]),o.order.pay_way?(c(),t(x,{key:0,label:o.$t(`order.field.payWay`)},{default:d(()=>[i(S,{type:`info`,effect:`dark`,round:``,size:`small`},{default:d(()=>[r(s(o.payWayLabel(o.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(x,{label:o.$t(`order.field.createdAt`)},{default:d(()=>[r(s(o.$dayjs.format(o.order.created_at||``)),1)]),_:1},8,[`label`]),i(x,{label:o.$t(`order.field.price`)},{default:d(()=>[o.order.price&&o.order.price>0?(c(),u(`span`,se,s(o.getPriceString({value:o.order.price})),1)):(c(),u(`span`,ce,s(o.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(c(),u(`div`,oe,[i(y,{title:o.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),o.order?.state===o.OrderState.PAID||o.order?.state===o.OrderState.FINISHED?(c(),t(_,{key:0,class:`mb-5`},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),i(y,{title:o.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),o.order?.state===o.OrderState.EXPIRED?(c(),t(_,{key:1,class:`mb-5`},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),i(y,{title:o.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),o.order?.state===o.OrderState.FAILED?(c(),t(_,{key:2,class:`mb-5`},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),i(y,{title:o.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),o.order?.state===o.OrderState.PENDING?(c(),t(_,{key:3},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),!o.order.pay_way&&o.order.price&&o.order.price>0?(c(),u(`div`,le,[n(`div`,{class:e({payway:!0,wechatpay:!0,active:o.payWay===o.PayWay.WechatPay}),onClick:p[0]||=e=>o.payWay=o.PayWay.WechatPay},[p[6]||=n(`span`,{class:`payicon wechatpay`},null,-1),n(`span`,ue,s(o.$t(`order.title.wechatPay`)),1)],2),n(`div`,{class:e({payway:!0,alipay:!0,active:o.payWay===o.PayWay.AliPay}),onClick:p[1]||=e=>o.payWay=o.PayWay.AliPay},[p[7]||=n(`span`,{class:`payicon alipay`},null,-1),n(`span`,de,s(o.$t(`order.title.aliPay`)),1)],2),n(`div`,{class:e({payway:!0,stripe:!0,active:o.payWay===o.PayWay.Stripe}),onClick:p[2]||=e=>o.payWay=o.PayWay.Stripe},[p[8]||=n(`span`,{class:`payicon stripe`},null,-1),n(`span`,fe,s(o.$t(`order.title.stripe`)),1)],2)])):a(``,!0),o.order.pay_way?(c(),u(`div`,me,[i(T,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:o.onRepay},{default:d(()=>[r(s(o.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(c(),u(`div`,pe,[i(T,{loading:o.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:o.onPay},{default:d(()=>[r(s(o.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),o.order&&o.payWay===o.PayWay.WechatPay?(c(),t(D,{key:0,order:o.order,visible:o.paying,onHide:p[3]||=e=>o.paying=!1},null,8,[`order`,`visible`])):a(``,!0),o.order&&o.payWay===o.PayWay.Stripe?(c(),t(O,{key:1,order:o.order,visible:o.paying,onHide:p[4]||=e=>o.paying=!1},null,8,[`order`,`visible`])):a(``,!0),o.order&&o.payWay===o.PayWay.AliPay?(c(),t(k,{key:2,order:o.order,visible:o.paying,onHide:p[5]||=e=>o.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ge=w(re,[[`render`,he],[`__scopeId`,`data-v-b09d60d0`]]);export{ge as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,E as n,M as r,N as i,O as a,P as o,Ut as s,X as c,et as l,k as u,lt as d,x as f}from"./vendor-chart-mdwpew_o.js";import{t as p}from"./button-DWzbdjZV.js";import{t as ee}from"./alert-BJj7gY4q.js";import{t as te}from"./card-B1OoUKT4.js";import{n as m,t as h}from"./row-RxbT4Yot.js";import{i as g,n as _,r as v,t as y}from"./wechat-iv-pzVEX.js";import{t as b}from"./divider-Ba_Z3oBh.js";import{t as x}from"./skeleton-Cn4UY-T8.js";import{Cn as S,Cr as C,E as w,Et as T,It as E,Mr as D,Pr as O,Pt as k,dr as A,kr as j}from"./index-DPVeprbd.js";import{t as M}from"./CopyToClipboard-Cz8Ijlo-.js";var N=o({name:`PublicWechatPayDialog`,components:{ElDialog:D,ElButton:p,QrCode:T,ElRow:h,ElCol:m},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return _()&&!y()},isMobileInsideWechat(){return _()&&y()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await E(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):j.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),P={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},F={class:`text-[14px] mb-3 leading-relaxed`},I={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},L={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},R={class:`text-[14px] mb-4 leading-relaxed`},z={class:`paycode wechat`},B={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function V(e,o,f,p,ee,te){let m=l(`qr-code`),h=l(`el-button`),g=l(`el-col`),_=l(`el-row`),v=l(`el-dialog`);return c(),t(v,{"model-value":e.visible,title:e.$t(`application.title.buyService`),width:e.dialogWidth,center:``,onClose:o[0]||=t=>e.$emit(`hide`)},{default:d(()=>[e.isMobileOutsideWechat?(c(),u(`div`,P,[n(`p`,F,s(e.$t(`order.message.wechatPayMobileScanTip`)),1),e.order?.pay_url?(c(),t(m,{key:0,value:e.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),n(`p`,I,s(e.$t(`order.message.wechatPayMobileHint`)),1),i(h,{size:`default`,round:``,class:`w-[220px]`,onClick:e.onCopyLink},{default:d(()=>[r(s(e.copied?e.$t(`common.message.copied`):e.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):e.isMobileInsideWechat?(c(),u(`div`,L,[n(`p`,R,s(e.$t(`order.message.wechatPayLongPressTip`)),1),e.order?.pay_url?(c(),t(m,{key:0,value:e.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(c(),t(_,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:d(()=>[i(g,{span:12},{default:d(()=>[n(`div`,z,[e.order?.pay_url?(c(),t(m,{key:0,value:e.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),n(`p`,B,s(e.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(g,{span:12},{default:d(()=>[...o[1]||=[n(`div`,{class:`help-img`},[n(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var H=w(N,[[`render`,V]]),U=o({name:`PublicStripePayDialog`,components:{ElDialog:D},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),W={class:`text-center`};function G(e,r,i,a,o,u){let f=l(`el-dialog`);return c(),t(f,{"model-value":e.visible,title:e.$t(`application.title.buyService`),width:`500px`,center:``,onClose:r[0]||=t=>e.$emit(`hide`)},{default:d(()=>[n(`p`,W,s(e.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var K=w(U,[[`render`,G]]),ne=o({name:`PublicAlipayPayDialog`,components:{ElDialog:D},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),q={class:`text-center`};function J(e,r,i,a,o,u){let f=l(`el-dialog`);return c(),t(f,{"model-value":e.visible,title:e.$t(`application.title.buyService`),width:`500px`,center:``,onClose:r[0]||=t=>e.$emit(`hide`)},{default:d(()=>[n(`p`,q,s(e.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var Y=w(ne,[[`render`,J]]),X=7e3,Z=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e}(Q||{}),re=o({name:`OrderPublicPay`,components:{ElButton:p,ElRow:h,ElCol:m,ElCard:te,ElSkeleton:x,ElDivider:b,ElAlert:ee,ElDescriptions:v,ElDescriptionsItem:g,ElTag:O,PublicWechatPay:H,PublicStripePay:K,PublicAlipayPay:Y,CopyToClipboard:M},data(){return{PayWay:Q,OrderState:A,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``}},watch:{paying(e){e?this.startOrderPolling(Z):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:k,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,S.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await S.get(this.id);if(this.order=e,e?.state===A.PAID||e?.state===A.FINISHED||e?.state===A.FAILED||e?.state===A.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,X))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=C()),S.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ie={class:`title`},ae={key:0,class:`pt-5`},oe={key:1,class:`pt-10 text-center`},$={key:2,class:`order`},se={key:0,class:`price current unfree`},ce={key:1,class:`price free`},le={key:0,class:`payways mb-6`},ue={class:`payname`},de={class:`payname`},fe={class:`payname`},pe={key:1},me={key:2};function he(o,p,ee,te,m,h){let g=l(`el-col`),_=l(`el-row`),v=l(`el-skeleton`),y=l(`el-alert`),b=l(`copy-to-clipboard`),x=l(`el-descriptions-item`),S=l(`el-tag`),C=l(`el-descriptions`),w=l(`el-divider`),T=l(`el-button`),E=l(`el-card`),D=l(`public-wechat-pay`),O=l(`public-stripe-pay`),k=l(`public-alipay-pay`);return c(),u(f,null,[i(_,{class:`wrapper`},{default:d(()=>[i(g,{span:24},{default:d(()=>[i(_,null,{default:d(()=>[i(g,{span:24},{default:d(()=>[n(`h2`,ie,s(o.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(_,{class:`panel`},{default:d(()=>[i(g,{span:24},{default:d(()=>[i(E,{shadow:`hover`},{default:d(()=>[i(_,null,{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[o.loading?(c(),u(`div`,ae,[i(v,{animated:``})])):o.order?(c(),u(`div`,$,[i(C,{column:1},{default:d(()=>[i(x,{label:o.$t(`order.field.id`)},{default:d(()=>[n(`span`,null,s(o.order.id),1),o.order.id?(c(),t(b,{key:0,content:o.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(x,{label:o.$t(`order.field.description`)},{default:d(()=>[r(s(o.order.description),1)]),_:1},8,[`label`]),o.order.pay_way?(c(),t(x,{key:0,label:o.$t(`order.field.payWay`)},{default:d(()=>[i(S,{type:`info`,effect:`dark`,round:``,size:`small`},{default:d(()=>[r(s(o.payWayLabel(o.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(x,{label:o.$t(`order.field.createdAt`)},{default:d(()=>[r(s(o.$dayjs.format(o.order.created_at||``)),1)]),_:1},8,[`label`]),i(x,{label:o.$t(`order.field.price`)},{default:d(()=>[o.order.price&&o.order.price>0?(c(),u(`span`,se,s(o.getPriceString({value:o.order.price})),1)):(c(),u(`span`,ce,s(o.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(c(),u(`div`,oe,[i(y,{title:o.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),o.order?.state===o.OrderState.PAID||o.order?.state===o.OrderState.FINISHED?(c(),t(_,{key:0,class:`mb-5`},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),i(y,{title:o.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),o.order?.state===o.OrderState.EXPIRED?(c(),t(_,{key:1,class:`mb-5`},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),i(y,{title:o.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),o.order?.state===o.OrderState.FAILED?(c(),t(_,{key:2,class:`mb-5`},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),i(y,{title:o.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),o.order?.state===o.OrderState.PENDING?(c(),t(_,{key:3},{default:d(()=>[i(g,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:d(()=>[i(w,{"border-style":`dashed`}),!o.order.pay_way&&o.order.price&&o.order.price>0?(c(),u(`div`,le,[n(`div`,{class:e({payway:!0,wechatpay:!0,active:o.payWay===o.PayWay.WechatPay}),onClick:p[0]||=e=>o.payWay=o.PayWay.WechatPay},[p[6]||=n(`span`,{class:`payicon wechatpay`},null,-1),n(`span`,ue,s(o.$t(`order.title.wechatPay`)),1)],2),n(`div`,{class:e({payway:!0,alipay:!0,active:o.payWay===o.PayWay.AliPay}),onClick:p[1]||=e=>o.payWay=o.PayWay.AliPay},[p[7]||=n(`span`,{class:`payicon alipay`},null,-1),n(`span`,de,s(o.$t(`order.title.aliPay`)),1)],2),n(`div`,{class:e({payway:!0,stripe:!0,active:o.payWay===o.PayWay.Stripe}),onClick:p[2]||=e=>o.payWay=o.PayWay.Stripe},[p[8]||=n(`span`,{class:`payicon stripe`},null,-1),n(`span`,fe,s(o.$t(`order.title.stripe`)),1)],2)])):a(``,!0),o.order.pay_way?(c(),u(`div`,me,[i(T,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:o.onRepay},{default:d(()=>[r(s(o.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(c(),u(`div`,pe,[i(T,{loading:o.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:o.onPay},{default:d(()=>[r(s(o.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),o.order&&o.payWay===o.PayWay.WechatPay?(c(),t(D,{key:0,order:o.order,visible:o.paying,onHide:p[3]||=e=>o.paying=!1},null,8,[`order`,`visible`])):a(``,!0),o.order&&o.payWay===o.PayWay.Stripe?(c(),t(O,{key:1,order:o.order,visible:o.paying,onHide:p[4]||=e=>o.paying=!1},null,8,[`order`,`visible`])):a(``,!0),o.order&&o.payWay===o.PayWay.AliPay?(c(),t(k,{key:2,order:o.order,visible:o.paying,onHide:p[5]||=e=>o.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ge=w(re,[[`render`,he],[`__scopeId`,`data-v-b09d60d0`]]);export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{D as t,Dt as n,E as r,N as i,P as a,R as o,T as s,Ut as c,W as l,X as u,Z as d,k as f,lt as p,mt as m,nt as h,st as g}from"./vendor-chart-mdwpew_o.js";import{t as _}from"./popover-1vWQQB0V.js";import{t as v}from"./slider-ypi7YrnL.js";import{br as y}from"./index-BY8YIwDb.js";function b(e){let t=Math.floor(e)%60;e=Math.floor(e/60);let n=e%60,r=n<10?`0${n}`:n,i=t<10?`0${t}`:t;return r+`:`+i}var x=e(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})})),S=Symbol(`AudioNamespace`),C=()=>{let e=o(S);if(!e)throw Error(`[player] useAudioNamespace() must be called inside <Player namespace="suno|producer">`);return e},w=e=>{let t=e??C(),n=y(),r=s({get:()=>n.state[t].audio,set:e=>n.commit(`${t}/setAudio`,e)}),i=e=>{n.commit(`${t}/setAudio`,{...n.state[t].audio,...e})};return{namespace:t,store:n,audio:r,field:e=>s({get:()=>n.state[t].audio?.[e],set:t=>i({[e]:t})}),patchAudio:i,dispatchAudio:e=>{n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...e})}}},T={class:`player-slider`},E=a({__name:`PlayerSlider`,setup(e){let{field:t,dispatchAudio:r}=w(),a=t(`progress`),o=t(`duration`),s=()=>{},c=e=>r({progress:Array.isArray(e)?e[0]:e});return(e,t)=>(u(),f(`div`,T,[i(n(v),{modelValue:n(a),"onUpdate:modelValue":t[0]||=e=>m(a)?a.value=e:null,"show-tooltip":!1,min:0,max:n(o),onChange:c,onInput:s},null,8,[`modelValue`,`max`])]))}}),D={class:`flex player-song`},O=[`src`],k={class:`ml-2 text-xs flex flex-col justify-between`},A={class:`w-52 2xl:w-96 cursor-pointer truncate`},j={class:`flex`},M={class:`ml-2 text-dc`},N=a({__name:`PlayerSong`,setup(e){let{audio:t,patchAudio:i}=w(),a=null,o=null,s=()=>{if(a){try{a.pause()}catch{}a.src=``,a=null}o&&=(o.abort(),null)};return g(t,(e,t)=>{if(e?.audio_url!==t?.audio_url){if(s(),!e?.audio_url)return;let t=new Audio(e.audio_url);a=t,o=new AbortController;let{signal:n}=o;e.state===`playing`?t.play().catch(()=>{}):t.pause(),t.addEventListener(`loadedmetadata`,()=>{t.currentTime=0},{signal:n}),t.addEventListener(`timeupdate`,()=>{i({progress:t.currentTime})},{signal:n}),i({object:t})}else e?.progress!==t?.progress&&e?.object&&Math.abs(e.progress-e.object.currentTime)>2?e.object.currentTime=e.progress:e?.state!==t?.state&&e?.object&&(e.state===`playing`?e.object.play().catch(()=>{}):e.object.pause());e?.volume!==t?.volume&&e?.object&&(e.object.volume=e.volume/100)}),l(s),(e,i)=>(u(),f(`div`,D,[r(`img`,{alt:``,class:`w-11 h-11 rounded`,src:n(t)?.image_url||n(`/assets/disk-XFRmVAfp.png`)},null,8,O),r(`div`,k,[r(`div`,A,[r(`div`,j,[r(`span`,null,c(n(t)?.title||`Music`),1),r(`span`,M,`- `+c(n(t)?.style||`SmallRuralDog`),1)])])])]))}}),P={class:`flex justify-end items-center gap-x-2.5`},F={class:`text-xs`},I=a({__name:`PlayerAction`,setup(e){let{field:t}=w(),i=t(`progress`),a=t(`duration`);return(e,t)=>(u(),f(`div`,P,[r(`span`,F,c(n(b)(n(i)))+` / `+c(n(b)(n(a))),1)]))}}),L={size:`1em`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`,rtl:!1,theme:`outline`,colors:{outline:{fill:`#333`,background:`transparent`},filled:{fill:`#333`,background:`#FFF`},twoTone:{fill:`#333`,twoTone:`#2F88FF`},multiColor:{outStrokeColor:`#333`,outFillColor:`#2F88FF`,innerStrokeColor:`#FFF`,innerFillColor:`#43CCF8`}},prefix:`i`};function R(){return`icon-`+((1+Math.random())*4294967296|0).toString(16).substring(1)}function ee(e,t,n){var r=typeof t.fill==`string`?[t.fill]:t.fill||[],i=[];switch(t.theme||n.theme){case`outline`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(`none`),i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(`none`);break;case`filled`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(`#FFF`),i.push(`#FFF`);break;case`two-tone`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[1]==`string`?r[1]:n.colors.twoTone.twoTone),i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[1]==`string`?r[1]:n.colors.twoTone.twoTone);break;case`multi-color`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[1]==`string`?r[1]:n.colors.multiColor.outFillColor),i.push(typeof r[2]==`string`?r[2]:n.colors.multiColor.innerStrokeColor),i.push(typeof r[3]==`string`?r[3]:n.colors.multiColor.innerFillColor);break}return{size:t.size||n.size,strokeWidth:t.strokeWidth||n.strokeWidth,strokeLinecap:t.strokeLinecap||n.strokeLinecap,strokeLinejoin:t.strokeLinejoin||n.strokeLinejoin,colors:i,id:e}}var z=Symbol(`icon-context`);function B(e,t,n){return{name:`icon-`+e,props:[`size`,`strokeWidth`,`strokeLinecap`,`strokeLinejoin`,`theme`,`fill`,`spin`],setup:function(r){var a=R(),s=o(z,L);return function(){var o=r.size,c=r.strokeWidth,l=r.strokeLinecap,u=r.strokeLinejoin,d=r.theme,f=r.fill,p=r.spin,m=ee(a,{size:o,strokeWidth:c,strokeLinecap:l,strokeLinejoin:u,theme:d,fill:f},s),h=[s.prefix+`-icon`];return h.push(s.prefix+`-icon-`+e),t&&s.rtl&&h.push(s.prefix+`-icon-rtl`),p&&h.push(s.prefix+`-icon-spin`),i(`span`,{class:h.join(` `)},[n(m)])}}}}var V=B(`pause-one`,!1,function(e){return i(`svg`,{width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`},[i(`path`,{d:`M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z`,fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M19 18V30`,stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M29 18V30`,stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),H=B(`play`,!0,function(e){return i(`svg`,{width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`},[i(`path`,{d:`M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z`,fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z`,fill:e.colors[3],stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null)])}),U=B(`volume-small`,!0,function(e){return i(`svg`,{width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`},[i(`path`,{d:`M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z`,fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33`,stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),W=a({__name:`IconPark`,props:{icon:{type:[Object,Function]},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(n,r)=>(u(),t(h(e.icon),{theme:e.theme,size:e.size,spin:e.spin,fill:e.fill,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,"stroke-width":e.strokeWidth},null,8,[`theme`,`size`,`spin`,`fill`,`stroke-linecap`,`stroke-linejoin`,`stroke-width`]))}}),G={class:`player-volume flex flex-col items-center pt-2`},K={class:`text-sm mt-3`},q=a({__name:`PlayerVolumeSlider`,setup(e){let{namespace:t,store:a,field:o}=w(),s=o(`volume`),l=o(`muted`),d=e=>a.dispatch(`${t}/setVolume`,Array.isArray(e)?e[0]:e);return(e,t)=>(u(),f(`div`,G,[i(n(v),{modelValue:n(s),"onUpdate:modelValue":t[0]||=e=>m(s)?s.value=e:null,vertical:``,height:`100px`,"show-tooltip":!1,max:100,min:0,size:`small`,disabled:n(l),onInput:d},null,8,[`modelValue`,`disabled`]),r(`div`,K,c(n(s)),1)]))}}),J={class:`flex items-center justify-center gap-x-3`},Y=a({__name:`PlayerController`,setup(e){let{audio:t,dispatchAudio:r}=w(),a=()=>r({state:t.value?.state===`playing`?`paused`:`playing`});return(e,r)=>(u(),f(`div`,J,[i(W,{icon:n(t)?.state===`playing`?n(V):n(H),size:`45`,theme:`filled`,class:`text-[var(--el-color-primary)] cursor-pointer`,onClick:a},null,8,[`icon`]),i(n(_),{placement:`top`,width:`50px`,trigger:`click`},{reference:p(()=>[i(W,{icon:n(U),size:`20`,"stroke-width":2,class:`cursor-pointer`},null,8,[`icon`])]),default:p(()=>[i(q)]),_:1})]))}}),X={class:`flex flex-col items-stretch h-20`},Z={class:`flex grow px-5 items-center`},Q={class:`flex-1`},$={class:`flex-1`},te={class:`flex-1`},ne=a({__name:`Player`,props:{namespace:{}},setup(e){return d(S,e.namespace),(e,t)=>(u(),f(`div`,X,[i(E),r(`div`,Z,[r(`div`,Q,[i(N)]),r(`div`,$,[i(Y)]),r(`div`,te,[i(I)])])]))}});export{x as n,b as r,ne as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{D as t,Dt as n,E as r,N as i,P as a,R as o,T as s,Ut as c,W as l,X as u,Z as d,k as f,lt as p,mt as m,nt as h,st as g}from"./vendor-chart-mdwpew_o.js";import{t as _}from"./popover-BImYZMWS.js";import{t as v}from"./slider-mTclohyo.js";import{br as y}from"./index-DPVeprbd.js";function b(e){let t=Math.floor(e)%60;e=Math.floor(e/60);let n=e%60,r=n<10?`0${n}`:n,i=t<10?`0${t}`:t;return r+`:`+i}var x=e(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})})),S=Symbol(`AudioNamespace`),C=()=>{let e=o(S);if(!e)throw Error(`[player] useAudioNamespace() must be called inside <Player namespace="suno|producer">`);return e},w=e=>{let t=e??C(),n=y(),r=s({get:()=>n.state[t].audio,set:e=>n.commit(`${t}/setAudio`,e)}),i=e=>{n.commit(`${t}/setAudio`,{...n.state[t].audio,...e})};return{namespace:t,store:n,audio:r,field:e=>s({get:()=>n.state[t].audio?.[e],set:t=>i({[e]:t})}),patchAudio:i,dispatchAudio:e=>{n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...e})}}},T={class:`player-slider`},E=a({__name:`PlayerSlider`,setup(e){let{field:t,dispatchAudio:r}=w(),a=t(`progress`),o=t(`duration`),s=()=>{},c=e=>r({progress:Array.isArray(e)?e[0]:e});return(e,t)=>(u(),f(`div`,T,[i(n(v),{modelValue:n(a),"onUpdate:modelValue":t[0]||=e=>m(a)?a.value=e:null,"show-tooltip":!1,min:0,max:n(o),onChange:c,onInput:s},null,8,[`modelValue`,`max`])]))}}),D={class:`flex player-song`},O=[`src`],k={class:`ml-2 text-xs flex flex-col justify-between`},A={class:`w-52 2xl:w-96 cursor-pointer truncate`},j={class:`flex`},M={class:`ml-2 text-dc`},N=a({__name:`PlayerSong`,setup(e){let{audio:t,patchAudio:i}=w(),a=null,o=null,s=()=>{if(a){try{a.pause()}catch{}a.src=``,a=null}o&&=(o.abort(),null)};return g(t,(e,t)=>{if(e?.audio_url!==t?.audio_url){if(s(),!e?.audio_url)return;let t=new Audio(e.audio_url);a=t,o=new AbortController;let{signal:n}=o;e.state===`playing`?t.play().catch(()=>{}):t.pause(),t.addEventListener(`loadedmetadata`,()=>{t.currentTime=0},{signal:n}),t.addEventListener(`timeupdate`,()=>{i({progress:t.currentTime})},{signal:n}),i({object:t})}else e?.progress!==t?.progress&&e?.object&&Math.abs(e.progress-e.object.currentTime)>2?e.object.currentTime=e.progress:e?.state!==t?.state&&e?.object&&(e.state===`playing`?e.object.play().catch(()=>{}):e.object.pause());e?.volume!==t?.volume&&e?.object&&(e.object.volume=e.volume/100)}),l(s),(e,i)=>(u(),f(`div`,D,[r(`img`,{alt:``,class:`w-11 h-11 rounded`,src:n(t)?.image_url||n(`/assets/disk-XFRmVAfp.png`)},null,8,O),r(`div`,k,[r(`div`,A,[r(`div`,j,[r(`span`,null,c(n(t)?.title||`Music`),1),r(`span`,M,`- `+c(n(t)?.style||`SmallRuralDog`),1)])])])]))}}),P={class:`flex justify-end items-center gap-x-2.5`},F={class:`text-xs`},I=a({__name:`PlayerAction`,setup(e){let{field:t}=w(),i=t(`progress`),a=t(`duration`);return(e,t)=>(u(),f(`div`,P,[r(`span`,F,c(n(b)(n(i)))+` / `+c(n(b)(n(a))),1)]))}}),L={size:`1em`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`,rtl:!1,theme:`outline`,colors:{outline:{fill:`#333`,background:`transparent`},filled:{fill:`#333`,background:`#FFF`},twoTone:{fill:`#333`,twoTone:`#2F88FF`},multiColor:{outStrokeColor:`#333`,outFillColor:`#2F88FF`,innerStrokeColor:`#FFF`,innerFillColor:`#43CCF8`}},prefix:`i`};function R(){return`icon-`+((1+Math.random())*4294967296|0).toString(16).substring(1)}function ee(e,t,n){var r=typeof t.fill==`string`?[t.fill]:t.fill||[],i=[];switch(t.theme||n.theme){case`outline`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(`none`),i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(`none`);break;case`filled`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(`#FFF`),i.push(`#FFF`);break;case`two-tone`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[1]==`string`?r[1]:n.colors.twoTone.twoTone),i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[1]==`string`?r[1]:n.colors.twoTone.twoTone);break;case`multi-color`:i.push(typeof r[0]==`string`?r[0]:`currentColor`),i.push(typeof r[1]==`string`?r[1]:n.colors.multiColor.outFillColor),i.push(typeof r[2]==`string`?r[2]:n.colors.multiColor.innerStrokeColor),i.push(typeof r[3]==`string`?r[3]:n.colors.multiColor.innerFillColor);break}return{size:t.size||n.size,strokeWidth:t.strokeWidth||n.strokeWidth,strokeLinecap:t.strokeLinecap||n.strokeLinecap,strokeLinejoin:t.strokeLinejoin||n.strokeLinejoin,colors:i,id:e}}var z=Symbol(`icon-context`);function B(e,t,n){return{name:`icon-`+e,props:[`size`,`strokeWidth`,`strokeLinecap`,`strokeLinejoin`,`theme`,`fill`,`spin`],setup:function(r){var a=R(),s=o(z,L);return function(){var o=r.size,c=r.strokeWidth,l=r.strokeLinecap,u=r.strokeLinejoin,d=r.theme,f=r.fill,p=r.spin,m=ee(a,{size:o,strokeWidth:c,strokeLinecap:l,strokeLinejoin:u,theme:d,fill:f},s),h=[s.prefix+`-icon`];return h.push(s.prefix+`-icon-`+e),t&&s.rtl&&h.push(s.prefix+`-icon-rtl`),p&&h.push(s.prefix+`-icon-spin`),i(`span`,{class:h.join(` `)},[n(m)])}}}}var V=B(`pause-one`,!1,function(e){return i(`svg`,{width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`},[i(`path`,{d:`M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z`,fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M19 18V30`,stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M29 18V30`,stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),H=B(`play`,!0,function(e){return i(`svg`,{width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`},[i(`path`,{d:`M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z`,fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z`,fill:e.colors[3],stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null)])}),U=B(`volume-small`,!0,function(e){return i(`svg`,{width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`},[i(`path`,{d:`M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z`,fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),i(`path`,{d:`M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33`,stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),W=a({__name:`IconPark`,props:{icon:{type:[Object,Function]},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(n,r)=>(u(),t(h(e.icon),{theme:e.theme,size:e.size,spin:e.spin,fill:e.fill,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,"stroke-width":e.strokeWidth},null,8,[`theme`,`size`,`spin`,`fill`,`stroke-linecap`,`stroke-linejoin`,`stroke-width`]))}}),G={class:`player-volume flex flex-col items-center pt-2`},K={class:`text-sm mt-3`},q=a({__name:`PlayerVolumeSlider`,setup(e){let{namespace:t,store:a,field:o}=w(),s=o(`volume`),l=o(`muted`),d=e=>a.dispatch(`${t}/setVolume`,Array.isArray(e)?e[0]:e);return(e,t)=>(u(),f(`div`,G,[i(n(v),{modelValue:n(s),"onUpdate:modelValue":t[0]||=e=>m(s)?s.value=e:null,vertical:``,height:`100px`,"show-tooltip":!1,max:100,min:0,size:`small`,disabled:n(l),onInput:d},null,8,[`modelValue`,`disabled`]),r(`div`,K,c(n(s)),1)]))}}),J={class:`flex items-center justify-center gap-x-3`},Y=a({__name:`PlayerController`,setup(e){let{audio:t,dispatchAudio:r}=w(),a=()=>r({state:t.value?.state===`playing`?`paused`:`playing`});return(e,r)=>(u(),f(`div`,J,[i(W,{icon:n(t)?.state===`playing`?n(V):n(H),size:`45`,theme:`filled`,class:`text-[var(--el-color-primary)] cursor-pointer`,onClick:a},null,8,[`icon`]),i(n(_),{placement:`top`,width:`50px`,trigger:`click`},{reference:p(()=>[i(W,{icon:n(U),size:`20`,"stroke-width":2,class:`cursor-pointer`},null,8,[`icon`])]),default:p(()=>[i(q)]),_:1})]))}}),X={class:`flex flex-col items-stretch h-20`},Z={class:`flex grow px-5 items-center`},Q={class:`flex-1`},$={class:`flex-1`},te={class:`flex-1`},ne=a({__name:`Player`,props:{namespace:{}},setup(e){return d(S,e.namespace),(e,t)=>(u(),f(`div`,X,[i(E),r(`div`,Z,[r(`div`,Q,[i(N)]),r(`div`,$,[i(Y)]),r(`div`,te,[i(I)])])]))}});export{x as n,b as r,ne as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,E as t,N as n,P as r,X as i,_ as a,et as o,k as s,lt as c,ut as l}from"./vendor-chart-mdwpew_o.js";import{t as u}from"./button-DWzbdjZV.js";import{t as d}from"./drawer-BvYPSxXh.js";import{E as f}from"./index-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,E as t,N as n,P as r,X as i,_ as a,et as o,k as s,lt as c,ut as l}from"./vendor-chart-mdwpew_o.js";import{t as u}from"./button-DWzbdjZV.js";import{t as d}from"./drawer-BvYPSxXh.js";import{E as f}from"./index-DPVeprbd.js";import{t as p}from"./index.es-BixPU3yV.js";import{n as m}from"./taskDrawerMixin-Cr17Yxqk.js";var h=r({name:`LayoutSeedance`,components:{ElDrawer:d,ElButton:u,FontAwesomeIcon:p},mixins:[m]}),g={class:`main flex flex-row flex-1`},_={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},v={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function y(r,u,d,f,p,m){let h=o(`font-awesome-icon`),y=o(`el-button`),b=o(`el-drawer`);return i(),s(`div`,g,[t(`div`,_,[e(r.$slots,`config`,{},void 0,!0)]),t(`div`,v,[e(r.$slots,`result`,{},void 0,!0)]),l(n(y,{circle:``,class:`menu`,onClick:u[0]||=e=>r.drawer=!0},{default:c(()=>[n(h,{icon:`fa-solid fa-magic`})]),_:1},512),[[a,!r.tasksEmpty]]),n(b,{modelValue:r.drawer,"onUpdate:modelValue":u[1]||=e=>r.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:c(()=>[e(r.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var b=f(h,[[`render`,y],[`__scopeId`,`data-v-ec312952`]]);export{b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,E as n,M as r,N as i,O as a,P as o,Q as s,Ut as c,X as l,et as u,k as d,lt as f,x as p,y as m}from"./vendor-chart-mdwpew_o.js";import{t as h}from"./button-DWzbdjZV.js";import{b as g,tt as _}from"./use-deprecated-CPfQu7wa.js";import{B as v,E as y,Mr as b,P as x,Tr as S,_r as C}from"./index-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,E as n,M as r,N as i,O as a,P as o,Q as s,Ut as c,X as l,et as u,k as d,lt as f,x as p,y as m}from"./vendor-chart-mdwpew_o.js";import{t as h}from"./button-DWzbdjZV.js";import{b as g,tt as _}from"./use-deprecated-CPfQu7wa.js";import{B as v,E as y,Mr as b,P as x,Tr as S,_r as C}from"./index-DPVeprbd.js";import{t as w}from"./index.es-BixPU3yV.js";import{t as T}from"./CopyToClipboard-Cz8Ijlo-.js";var E=o({name:`ApplicationInfo`,components:{FontAwesomeIcon:w,ElButton:h,Check:g,ElIcon:_,CopyToClipboard:T},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}},emits:[`buy`,`usage`],computed:{showPayment(){return!S()},remainingAmountText(){let e=Number(this.application?.remaining_amount??0);return!Number.isFinite(e)||e<0?`0.00`:e.toFixed(2)}}}),D={class:`flex flex-col min-w-0`},O={key:0,class:`app-id-row`},k={class:`icon !mb-0 flex-shrink-0`},A={class:`app-id-line`},j={class:`app-id-label`},M={class:`app-id-value`},N={key:1,class:`icon`},P={class:`text-left`},F={class:`description`},I={key:0},L={key:1},R={class:`value`},z={class:`description2`},B={key:0},V={key:1},H={class:`actions`};function U(e,o,s,p,h,g){let _=u(`check`),v=u(`el-icon`),y=u(`font-awesome-icon`),b=u(`copy-to-clipboard`),x=u(`el-tag`),S=u(`el-button`);return l(),d(`div`,null,[n(`div`,D,[i(v,{class:`check`},{default:f(()=>[i(_)]),_:1}),e.showId?(l(),d(`div`,O,[n(`div`,k,[i(y,{icon:`fa-solid fa-wallet`})]),n(`div`,A,[n(`span`,j,c(e.$t(`application.field.id`))+`:`,1),n(`span`,M,c(e.application.id),1),e.application.id?(l(),t(b,{key:0,content:e.application.id,class:`copy-small`},null,8,[`content`])):a(``,!0)])])):(l(),d(`div`,N,[i(y,{icon:`fa-solid fa-wallet`})])),n(`div`,P,[n(`p`,F,[e.application.service?(l(),d(`span`,L,c(e.$t(`application.title.applicationBalance`,{service:e.application.service?.title})),1)):(l(),d(`span`,I,c(e.$t(`application.title.globalBalance`)),1)),e.application.role===`grantee`?(l(),t(x,{key:2,class:`shared-badge`,size:`small`,type:`warning`,effect:`dark`,round:``},{default:f(()=>[r(c(e.$t(`application.badge.shared`)),1)]),_:1})):a(``,!0)]),n(`p`,R,c(e.remainingAmountText)+` `+c(e.$t(`service.unit.`+(e.application?.service?.unit||`credit`)+`s`)),1),n(`p`,z,[e.application.type===`Period`?(l(),d(`span`,B,c(e.$t(`application.field.expiredAt`))+`: `+c(e.$dayjs.format(e.application.expired_at)),1)):(l(),d(`span`,V,c(e.$t(`application.message.neverExpire`)),1))])])]),n(`div`,H,[i(S,{size:`small`,round:``,onClick:o[0]||=m(t=>e.$emit(`usage`,e.application),[`stop`])},{default:f(()=>[i(y,{icon:`fa-solid fa-chart-line`,class:`mr-1 text-[11px]`}),r(` `+c(e.$t(`application.button.usage`)),1)]),_:1}),e.showPayment?(l(),t(S,{key:0,type:`primary`,round:``,size:`small`,onClick:o[1]||=m(t=>e.$emit(`buy`,e.application),[`stop`])},{default:f(()=>[i(y,{icon:`fa-solid fa-coins`,class:`mr-1 text-[11px]`}),r(` `+c(e.$t(`application.button.buyMore`)),1)]),_:1})):a(``,!0)])])}var W=o({name:`ApplicationStatus`,components:{ElDialog:b,FontAwesomeIcon:w,ApplicationInfo:y(E,[[`render`,U],[`__scopeId`,`data-v-63c63f0f`]])},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},service:{type:Object,required:!0}},emits:[`select`],data(){return{visible:!1,applicationType:C}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user},balanceAmount(){return Number(this.application?.remaining_amount??0)},balanceUnit(){let e=`service.unit.${this.application?.service?.unit||`credit`}`+(this.balanceAmount===1?``:`s`);return this.$t(e)},balanceText(){let e=this.balanceAmount;return Number.isFinite(e)?e>=1e3?Math.round(e).toLocaleString():e>=100?e.toFixed(1):e.toFixed(2):`0`},balanceTitle(){return`${this.balanceText} ${this.balanceUnit}`}},methods:{onGoUsage(e){let t=this.$router.resolve({name:v,query:{application_id:e.id}});window.open(t.href,`_blank`)},onBuyMore(e){let t=this.$router.resolve({name:x,params:{id:e.id}}).href;window.open(t,`_blank`)},onSelectApplication(e){this.$emit(`select`,e)}}}),G={class:`status`},K={key:0},q={class:`text-center mb-4`},J={class:`flex flex-col gap-4 mb-6 overflow-y-auto`},Y=[`title`],X={class:`entry-amount`},Z={class:`entry-unit`};function Q(r,o,m,h,g,_){let v=u(`application-info`),y=u(`el-dialog`),b=u(`font-awesome-icon`);return l(),d(`div`,G,[i(y,{modelValue:r.visible,"onUpdate:modelValue":o[0]||=e=>r.visible=e,class:`mt-12`,width:`450px`},{default:f(()=>[r.application?(l(),d(`div`,K,[n(`p`,q,c(r.$t(`application.message.applicationSelection`)),1),n(`div`,J,[(l(!0),d(p,null,s(r.applications,(n,i)=>(l(),t(v,{key:i,class:e({item:!0,active:r.application?.id===n.id}),application:n,"show-id":``,onClick:e=>r.onSelectApplication(n),onUsage:e=>r.onGoUsage(n),onBuy:e=>r.onBuyMore(n)},null,8,[`class`,`application`,`onClick`,`onUsage`,`onBuy`]))),128))])])):a(``,!0)]),_:1},8,[`modelValue`]),n(`button`,{type:`button`,class:`entry`,title:r.balanceTitle,onClick:o[1]||=e=>r.visible=!0},[i(b,{icon:`fa-solid fa-wallet`,class:`entry-icon`}),n(`span`,X,c(r.balanceText),1),n(`span`,Z,c(r.balanceUnit),1)],8,Y)])}var $=y(W,[[`render`,Q],[`__scopeId`,`data-v-afd961d7`]]);export{$ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,E as n,M as r,N as i,O as a,P as o,Q as s,Ut as c,X as l,et as u,k as d,lt as f,x as p}from"./vendor-chart-mdwpew_o.js";import{t as m}from"./button-DWzbdjZV.js";import{t as h}from"./card-B1OoUKT4.js";import{n as g,t as _}from"./row-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{Bt as e,D as t,E as n,M as r,N as i,O as a,P as o,Q as s,Ut as c,X as l,et as u,k as d,lt as f,x as p}from"./vendor-chart-mdwpew_o.js";import{t as m}from"./button-DWzbdjZV.js";import{t as h}from"./card-B1OoUKT4.js";import{n as g,t as _}from"./row-RxbT4Yot.js";import{t as v}from"./skeleton-Cn4UY-T8.js";import{An as y,Cn as b,E as x,In as S,L as C,P as w,Pr as T,Pt as E,Tr as D,_r as O,kr as k,vn as A,vr as j}from"./index-DPVeprbd.js";import{t as M}from"./index.es-BixPU3yV.js";var N=o({name:`ConsoleSubscriptionBuy`,components:{ElSkeleton:v,ElRow:_,ElTag:T,ElCol:g,ElCard:h,FontAwesomeIcon:M,ElButton:m},data(){return{application:void 0,application2:void 0,type:O.PERIOD,services:[],loading:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){return this.$route.params?.id?.toString()},showPayment(){return!D()},subscriptions(){let e=[{name:`WEEK`,label:this.$t(`console.subscription.weekly`),description:this.$t(`console.subscription.weekly.description`),duration:10080*60},{name:`MONTH`,label:this.$t(`console.subscription.monthly`),description:this.$t(`console.subscription.monthly.description`),duration:720*60*60},{name:`YEAR`,tag:this.$t(`console.button.suggested`),label:this.$t(`console.subscription.yearly`),description:this.$t(`console.subscription.yearly.description`),duration:365*24*60*60}];for(let t of e){console.log(`item`,t);let e=this.getPackages(t.duration);console.log(`pkgs`,e),e&&(t.price=e.reduce((e,t)=>e+t.price,0));for(let n of e)t.benefits||=[],t.benefits.push({enabled:!0,content:`${n?.service?.title} - ${n.amount} `+this.$t(`service.unit.`+n?.service?.unit+`s`)});t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit1`)}),t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit2`)})}return e},service(){return this.application?.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){this.loading=!0,await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.loading=!1,this.subscription=this.subscriptions[2]},methods:{getPriceString:E,onBuyExtra(){this.$router.push({name:w,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];let n=[this.service].sort((e,t)=>this.serviceIds.indexOf(e.id)-this.serviceIds.indexOf(t.id));for(let r of n){let n=r.packages?.find(t=>t.type===j.PERIOD&&t.duration===e);n&&t.push({...n,service:r})}return t},async onCreateApplications(){let e=[];if(this.application2||e.push(this.application?.service?.id),e.length>0){for(let t of e)await y.create({service_id:t,type:O.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log(`onChangeType`,this.type),this.$router.push({name:w,params:this.$route.params})},async onFetchServices(){let{data:e}=await A.getAll({id:this.serviceIds});this.services=e.items,console.debug(`services`,this.services)},async onFetchApplication(){let{data:e}=await y.get(this.applicationId);this.application=e,console.debug(`application`,this.application)},async onFetchApplication2(){let{data:e}=await y.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:`-created_at`,service_id:this.serviceIds,type:O.PERIOD});this.application2=e.items?.[0],console.debug(`application2`,this.application2)},onCreateOrder(e){if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){k.error(this.$t(`console.message.applicationNotFound`)),this.creating=!1;return}S(`payment_initiated`,{service:this.service?.alias,action:`subscribe`,duration:e.duration}),b.create({application_ids:[this.application2.id],package_ids:this.getPackages(e.duration).map(e=>e.id),description:this.service?.title+` - `+e.label}).then(({data:e})=>{this.creating=!1,this.$router.push({name:C,params:{id:e.id}})}).catch(e=>{k.error(this.$t(`order.message.createFailed`)),this.creating=!1,S(`payment_failed`,{service:this.service?.alias,action:`subscribe`,error:e?.response?.data?.error?.message??String(e)})})}}}),P={class:`title`},F={class:`introduction`},I={class:`name`},L={class:`price`},R={class:`description`},z={class:`benefits`},B={class:`operations`},V={key:2,class:`extra`};function H(o,m,h,g,_,v){let y=u(`el-col`),b=u(`el-row`),x=u(`el-skeleton`),S=u(`el-tag`),C=u(`font-awesome-icon`),w=u(`el-button`),T=u(`el-card`);return l(),t(b,{class:`panel`},{default:f(()=>[i(y,{span:24},{default:f(()=>[i(b,null,{default:f(()=>[i(y,{span:24},{default:f(()=>[n(`h2`,P,c(o.$t(`common.title.buyMore`)),1)]),_:1})]),_:1}),i(b,null,{default:f(()=>[i(y,{span:24},{default:f(()=>[i(T,{shadow:`hover`,class:`card`},{default:f(()=>[i(b,null,{default:f(()=>[i(y,{class:`max-w-4xl mx-auto`},{default:f(()=>[n(`p`,F,c(o.$t(`console.subscription.title`)),1),o.loading?(l(),t(x,{key:0})):(l(),t(b,{key:1,gutter:15,class:`subscriptions`},{default:f(()=>[(l(!0),d(p,null,s(o.subscriptions,(u,m)=>(l(),t(y,{key:m,xs:24,md:24/(o.subscriptions?.length||4)},{default:f(()=>[i(T,{shadow:`hover`,class:e({subscription:!0,active:o.subscription?.name===u.name}),onClick:e=>o.subscription=u},{default:f(()=>[n(`h4`,I,[r(c(u.label)+` `,1),u.tag?(l(),t(S,{key:0,type:`warning`},{default:f(()=>[r(c(u.tag),1)]),_:2},1024)):a(``,!0)]),n(`h2`,L,c(o.getPriceString({value:u.price})),1),n(`p`,R,c(u.description),1),n(`div`,z,[(l(!0),d(p,null,s(u.benefits,(e,r)=>(l(),d(`div`,{key:r,class:`benefit`},[e.enabled?(l(),t(C,{key:0,icon:`fa-solid fa-check`,class:`icon icon-check`})):(l(),t(C,{key:1,icon:`fa-solid fa-xmark`,class:`icon icon-xmark`})),n(`span`,null,c(e.content),1)]))),128))]),n(`div`,B,[o.showPayment?(l(),t(w,{key:0,class:`btn btn-subscribe`,type:o.subscription?.name===u?.name?`primary`:``,round:``,onClick:e=>o.onCreateOrder(u)},{default:f(()=>[r(c(o.$t(`common.button.buy`)),1)]),_:1},8,[`type`,`onClick`])):a(``,!0)])]),_:2},1032,[`class`,`onClick`])]),_:2},1032,[`md`]))),128))]),_:1})),!o.loading&&o.showPayment?(l(),d(`div`,V,[n(`span`,null,c(o.$t(`console.message.doNotWantSubscribe`)),1),i(w,{type:`primary`,class:`btn btn-extra`,round:``,size:`small`,onClick:o.onBuyExtra},{default:f(()=>[r(c(o.$t(`console.message.buyExtra`)),1)]),_:1},8,[`onClick`])])):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var U=x(N,[[`render`,H],[`__scopeId`,`data-v-46816bf9`]]);export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{D as e,N as t,P as n,X as r,et as i,lt as a}from"./vendor-chart-mdwpew_o.js";import{n as o,t as s}from"./tabs-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{D as e,N as t,P as n,X as r,et as i,lt as a}from"./vendor-chart-mdwpew_o.js";import{n as o,t as s}from"./tabs-BeML51o2.js";import{E as c,J as l,q as u}from"./index-DPVeprbd.js";var d=n({name:`FishTabSwitcher`,components:{ElTabs:o,ElTabPane:s},data(){return{ROUTE_FISH_TTS_INDEX:l,ROUTE_FISH_MODEL_INDEX:u}},computed:{active(){return(this.$route?.name||``)===`fish-model-index`?u:l}},methods:{onUpdate(e){let t=String(e);t!==this.active&&this.$router.push({name:t})}}});function f(n,o,s,c,l,u){let d=i(`el-tab-pane`),f=i(`el-tabs`);return r(),e(f,{"model-value":n.active,class:`fish-tabs`,stretch:``,"onUpdate:modelValue":n.onUpdate},{default:a(()=>[t(d,{label:n.$t(`fish.tab.tts`),name:n.ROUTE_FISH_TTS_INDEX},null,8,[`label`,`name`]),t(d,{label:n.$t(`fish.tab.model`),name:n.ROUTE_FISH_MODEL_INDEX},null,8,[`label`,`name`])]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var p=c(d,[[`render`,f],[`__scopeId`,`data-v-11790655`]]);export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{D as e,E as t,M as n,N as r,O as i,P as a,Q as o,Ut as s,X as c,et as l,k as u,lt as d,x as f,y as p}from"./vendor-chart-mdwpew_o.js";import{t as m}from"./button-DWzbdjZV.js";import{r as h,t as g}from"./select-B14L-681.js";import{t as _}from"./image-CjzS-up0.js";import{t as v}from"./alert-BJj7gY4q.js";import{t as y}from"./slider-ypi7YrnL.js";import{ot as b,pi as x,rt as S}from"./constants-C-bSXdJ_.js";import{At as C,E as w,Fn as T,Nt as ee,Ot as te,kr as E,qt as D,yr as O}from"./index-BY8YIwDb.js";import{t as k}from"./index.es-CH5vwGaN.js";import{t as A}from"./CopyToClipboard-C8gyDUMn.js";import{t as j}from"./Hailuo-y5ZOpsGB.js";import{t as M}from"./BotPlaceholder-BVXWzbpi.js";import{t as N}from"./TabSwitcher-BRab7qRM.js";import{n as P,t as F}from"./pagination-CjEVtILV.js";import{n as I,t as L}from"./NoTasks-Dk1WXppl.js";import{t as R}from"./Consumption-QfvilMcG.js";import{t as z}from"./ApiCodeButton-DpYCu-EK.js";var B=a({name:`FishTextInput`,components:{PromptTextarea:I},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function V(t,n,r,i,a,o){let s=l(`prompt-textarea`);return c(),e(s,{modelValue:t.text,"onUpdate:modelValue":n[0]||=e=>t.text=e,title:t.$t(`fish.name.text`),info:t.$t(`fish.description.text`),placeholder:t.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var H=w(B,[[`render`,V]]),U=a({name:`FishModelSelector`,components:{ElSelect:h,ElOption:g},computed:{options(){return[{value:b,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=S}}),W={class:`field`},G={class:`title font-bold`};function K(n,i,a,p,m,h){let g=l(`el-option`),_=l(`el-select`);return c(),u(`div`,W,[t(`h2`,G,s(n.$t(`fish.name.model`)),1),r(_,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,class:`value`,placeholder:n.$t(`fish.placeholder.select`)},{default:d(()=>[(c(!0),u(f,null,o(n.options,t=>(c(),e(g,{key:t.value,label:t.label,value:t.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var q=w(U,[[`render`,K],[`__scopeId`,`data-v-9702e6d3`]]),J=a({name:`FishVoicePicker`,components:{ElSelect:h,ElOption:g},computed:{loading(){return this.$store.state.fish?.status?.getApplications===O.Request},options(){return this.$store.state.fish?.voices??[]},displayOptions(){return this.options.map(e=>{let t=e,n=(t.id||t._id||t.reference_id||``).toString();return{value:n,label:t.title||n}}).filter(e=>!!e.value)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`)}}}}),Y={class:`field`},X={class:`title font-bold`};function Z(n,i,a,p,m,h){let g=l(`el-option`),_=l(`el-select`);return c(),u(`div`,Y,[t(`h2`,X,s(n.$t(`fish.name.voice`)),1),r(_,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,class:`value`,placeholder:n.$t(`fish.placeholder.voice`),clearable:``,filterable:``,loading:n.loading,"no-data-text":n.$t(`fish.message.noVoices`)},{default:d(()=>[(c(!0),u(f,null,o(n.displayOptions,t=>(c(),e(g,{key:t.value,label:t.label,value:t.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`loading`,`no-data-text`])])}var Q=a({name:`FishConfigPanel`,components:{ElButton:m,ElSlider:y,FontAwesomeIcon:k,TextInput:H,ModelSelector:q,VoicePicker:w(J,[[`render`,Z],[`__scopeId`,`data-v-ac9e3a92`]]),Consumption:R},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){return ee(this.config,this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),ne={class:`flex flex-col h-full`},re={class:`flex-1 overflow-y-auto p-5`},ie={class:`field mb-2`},ae={class:`title font-bold`},oe={class:`flex flex-col items-center justify-center px-5 pb-5`};function se(e,i,a,o,f,p){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`font-awesome-icon`),b=l(`el-button`);return c(),u(`div`,ne,[t(`div`,re,[r(m,{class:`mb-4`}),r(h,{class:`mb-4`}),r(g,{class:`mb-4`}),t(`div`,ie,[t(`h2`,ae,s(e.$t(`fish.name.speed`)),1),r(_,{modelValue:e.speed,"onUpdate:modelValue":i[0]||=t=>e.speed=t,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),t(`div`,oe,[r(v,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),r(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!e.canGenerate,onClick:e.onGenerate},{default:d(()=>[r(y,{icon:`fa-solid fa-magic`,class:`mr-2`}),n(` `+s(e.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var ce=w(Q,[[`render`,se],[`__scopeId`,`data-v-1ccd36ba`]]),le=a({name:`FishTaskPreview`,components:{ElImage:_,CopyToClipboard:A,FontAwesomeIcon:k,ElAlert:v,ElButton:m,ApiCodeButton:z},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url}},methods:{onDownload(e){window.open(e,`_blank`)}}}),ue={class:`preview`},de={class:`left`},fe={class:`main`},pe={class:`bot`},me={class:`datetime`},he={class:`info`},ge={key:0,class:`prompt mt-2`},_e={key:0},ve={key:0,class:`content`},ye=[`src`],be={class:`operations mt-2`},xe={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Se={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ce={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},we={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Te={key:1,class:`content`},Ee={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function De(e,a,o,f,m,h){let g=l(`el-image`),_=l(`el-button`),v=l(`api-code-button`),y=l(`font-awesome-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`);return c(),u(`div`,ue,[t(`div`,de,[r(g,{src:`https://cdn.acedata.cloud/e40fccc727.png`,class:`avatar`})]),t(`div`,fe,[t(`div`,pe,[n(s(e.$t(`fish.name.fishBot`))+` `,1),t(`span`,me,s(e.$dayjs.format(``+new Date(parseFloat((e.modelValue?.created_at||``).toString())*1e3))),1)]),t(`div`,he,[e.prompt?(c(),u(`p`,ge,[n(s(e.prompt)+` `,1),e.modelValue?.response?i(``,!0):(c(),u(`span`,_e,` - (`+s(e.$t(`fish.status.pending`))+`) `,1))])):i(``,!0)]),e.audioUrl?(c(),u(`div`,ve,[t(`audio`,{src:e.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,ye),t(`div`,be,[r(_,{type:`info`,size:`small`,class:`mb-2`,onClick:a[0]||=p(t=>e.onDownload(e.audioUrl),[`stop`])},{default:d(()=>[n(s(e.$t(`fish.button.download`)),1)]),_:1}),r(v,{path:`/fish/tts`,body:e.modelValue?.request},null,8,[`body`])]),r(x,{closable:!1,class:`mt-2 success`},{default:d(()=>[e.modelValue?.request?.model?(c(),u(`p`,xe,[r(y,{icon:`fa-solid fa-microchip`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.model`))+`: `+s(e.modelValue?.request?.model),1)])):i(``,!0),e.modelValue?.request?.reference_id?(c(),u(`p`,Se,[r(y,{icon:`fa-solid fa-microphone`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.referenceId`))+`: `+s(e.modelValue?.request?.reference_id)+` `,1),r(b,{content:e.modelValue?.request?.reference_id},null,8,[`content`])])):i(``,!0),t(`p`,Ce,[r(y,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.taskId`))+`: `+s(e.modelValue?.id)+` `,1),r(b,{content:e.modelValue?.id},null,8,[`content`])]),e.modelValue?.elapsed?(c(),u(`p`,we,[r(y,{icon:`fa-solid fa-clock`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.elapsed`))+`: `+s(e.modelValue?.elapsed?.toFixed(2))+`s `,1)])):i(``,!0)]),_:1})])):(c(),u(`div`,Te,[r(x,{closable:!1,class:`info`},{default:d(()=>[t(`p`,Ee,[r(y,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.taskId`))+`: `+s(e.modelValue?.id)+` `,1),r(b,{content:e.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var $=a({name:`FishRecentPanel`,components:{TaskPreview:w(le,[[`render`,De],[`__scopeId`,`data-v-754753f2`]]),BotPlaceholder:M,NoTasks:L,ScrollList:P},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Oe={key:0},ke={key:2,class:`w-full h-full flex items-center justify-center`};function Ae(t,n,a,s,p,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return c(),u(f,null,[t.tasks?.items===void 0?(c(),u(`div`,Oe,[r(h)])):t.tasks?.items?.length&&t.tasks?.items?.length>0?(c(),e(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:t.loading,onReachTop:n[0]||=e=>t.$emit(`reach-top`)},{default:d(()=>[(c(!0),u(f,null,o(t.tasks?.items,t=>(c(),e(g,{key:t.id,"model-value":t},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):i(``,!0),t.tasks?.items?.length===0?(c(),u(`div`,ke,[r(v)])):i(``,!0)],64)}var je=w($,[[`render`,Ae]]),Me=x(`fish`),Ne=a({name:`FishTtsIndex`,components:{ConfigPanel:ce,Layout:j,RecentPanel:je,TabSwitcher:N},mixins:[C],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===O.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===O.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService(),await this.$store.dispatch(`fish/getVoices`)},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await F({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`fish/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!te(this.uploadTracker,e=>this.$t(e),e=>E.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){E.warning(this.$t(`fish.message.textRequired`));return}let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,callback_url:Me};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),E.info(this.$t(`fish.message.startingTask`)),T(`fish`,D.generateTts(i,{token:n,model:r})).then(()=>{E.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?E.error(this.$t(`fish.message.usedUp`)):E.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),Pe={class:`flex flex-col h-full`},Fe={class:`flex-1 min-h-0`};function Ie(n,i,a,o,s,u){let f=l(`tab-switcher`),p=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return c(),e(h,null,{config:d(()=>[t(`div`,Pe,[r(f),t(`div`,Fe,[r(p,{onGenerate:n.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[r(m,{ref:`recentPanel`,loading:n.loadingMore,onReachTop:n.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Le=w(Ne,[[`render`,Ie]]);export{Le as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{D as e,E as t,M as n,N as r,O as i,P as a,Q as o,Ut as s,X as c,et as l,k as u,lt as d,x as f,y as p}from"./vendor-chart-mdwpew_o.js";import{t as m}from"./button-DWzbdjZV.js";import{r as h,t as g}from"./select-CD8mHzh8.js";import{t as _}from"./image-qndhHcLK.js";import{t as v}from"./alert-BJj7gY4q.js";import{t as y}from"./slider-mTclohyo.js";import{ot as b,pi as x,rt as S}from"./constants-C-bSXdJ_.js";import{At as C,E as w,Fn as T,Nt as ee,Ot as te,kr as E,qt as D,yr as O}from"./index-DPVeprbd.js";import{t as k}from"./index.es-BixPU3yV.js";import{t as A}from"./CopyToClipboard-Cz8Ijlo-.js";import{t as j}from"./Hailuo-Dj-cbD6I.js";import{t as M}from"./BotPlaceholder-wd225tVu.js";import{t as N}from"./TabSwitcher-CxHVPZaB.js";import{n as P,t as F}from"./pagination-C85K_A44.js";import{n as I,t as L}from"./NoTasks-C2vrqE3P.js";import{t as R}from"./Consumption-QKE6OyNN.js";import{t as z}from"./ApiCodeButton-CkZ3iTVh.js";var B=a({name:`FishTextInput`,components:{PromptTextarea:I},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function V(t,n,r,i,a,o){let s=l(`prompt-textarea`);return c(),e(s,{modelValue:t.text,"onUpdate:modelValue":n[0]||=e=>t.text=e,title:t.$t(`fish.name.text`),info:t.$t(`fish.description.text`),placeholder:t.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var H=w(B,[[`render`,V]]),U=a({name:`FishModelSelector`,components:{ElSelect:h,ElOption:g},computed:{options(){return[{value:b,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=S}}),W={class:`field`},G={class:`title font-bold`};function K(n,i,a,p,m,h){let g=l(`el-option`),_=l(`el-select`);return c(),u(`div`,W,[t(`h2`,G,s(n.$t(`fish.name.model`)),1),r(_,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,class:`value`,placeholder:n.$t(`fish.placeholder.select`)},{default:d(()=>[(c(!0),u(f,null,o(n.options,t=>(c(),e(g,{key:t.value,label:t.label,value:t.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var q=w(U,[[`render`,K],[`__scopeId`,`data-v-9702e6d3`]]),J=a({name:`FishVoicePicker`,components:{ElSelect:h,ElOption:g},computed:{loading(){return this.$store.state.fish?.status?.getApplications===O.Request},options(){return this.$store.state.fish?.voices??[]},displayOptions(){return this.options.map(e=>{let t=e,n=(t.id||t._id||t.reference_id||``).toString();return{value:n,label:t.title||n}}).filter(e=>!!e.value)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`)}}}}),Y={class:`field`},X={class:`title font-bold`};function Z(n,i,a,p,m,h){let g=l(`el-option`),_=l(`el-select`);return c(),u(`div`,Y,[t(`h2`,X,s(n.$t(`fish.name.voice`)),1),r(_,{modelValue:n.value,"onUpdate:modelValue":i[0]||=e=>n.value=e,class:`value`,placeholder:n.$t(`fish.placeholder.voice`),clearable:``,filterable:``,loading:n.loading,"no-data-text":n.$t(`fish.message.noVoices`)},{default:d(()=>[(c(!0),u(f,null,o(n.displayOptions,t=>(c(),e(g,{key:t.value,label:t.label,value:t.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`loading`,`no-data-text`])])}var Q=a({name:`FishConfigPanel`,components:{ElButton:m,ElSlider:y,FontAwesomeIcon:k,TextInput:H,ModelSelector:q,VoicePicker:w(J,[[`render`,Z],[`__scopeId`,`data-v-ac9e3a92`]]),Consumption:R},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){return ee(this.config,this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),ne={class:`flex flex-col h-full`},re={class:`flex-1 overflow-y-auto p-5`},ie={class:`field mb-2`},ae={class:`title font-bold`},oe={class:`flex flex-col items-center justify-center px-5 pb-5`};function se(e,i,a,o,f,p){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`font-awesome-icon`),b=l(`el-button`);return c(),u(`div`,ne,[t(`div`,re,[r(m,{class:`mb-4`}),r(h,{class:`mb-4`}),r(g,{class:`mb-4`}),t(`div`,ie,[t(`h2`,ae,s(e.$t(`fish.name.speed`)),1),r(_,{modelValue:e.speed,"onUpdate:modelValue":i[0]||=t=>e.speed=t,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),t(`div`,oe,[r(v,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),r(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!e.canGenerate,onClick:e.onGenerate},{default:d(()=>[r(y,{icon:`fa-solid fa-magic`,class:`mr-2`}),n(` `+s(e.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var ce=w(Q,[[`render`,se],[`__scopeId`,`data-v-1ccd36ba`]]),le=a({name:`FishTaskPreview`,components:{ElImage:_,CopyToClipboard:A,FontAwesomeIcon:k,ElAlert:v,ElButton:m,ApiCodeButton:z},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url}},methods:{onDownload(e){window.open(e,`_blank`)}}}),ue={class:`preview`},de={class:`left`},fe={class:`main`},pe={class:`bot`},me={class:`datetime`},he={class:`info`},ge={key:0,class:`prompt mt-2`},_e={key:0},ve={key:0,class:`content`},ye=[`src`],be={class:`operations mt-2`},xe={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Se={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ce={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},we={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Te={key:1,class:`content`},Ee={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function De(e,a,o,f,m,h){let g=l(`el-image`),_=l(`el-button`),v=l(`api-code-button`),y=l(`font-awesome-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`);return c(),u(`div`,ue,[t(`div`,de,[r(g,{src:`https://cdn.acedata.cloud/e40fccc727.png`,class:`avatar`})]),t(`div`,fe,[t(`div`,pe,[n(s(e.$t(`fish.name.fishBot`))+` `,1),t(`span`,me,s(e.$dayjs.format(``+new Date(parseFloat((e.modelValue?.created_at||``).toString())*1e3))),1)]),t(`div`,he,[e.prompt?(c(),u(`p`,ge,[n(s(e.prompt)+` `,1),e.modelValue?.response?i(``,!0):(c(),u(`span`,_e,` - (`+s(e.$t(`fish.status.pending`))+`) `,1))])):i(``,!0)]),e.audioUrl?(c(),u(`div`,ve,[t(`audio`,{src:e.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,ye),t(`div`,be,[r(_,{type:`info`,size:`small`,class:`mb-2`,onClick:a[0]||=p(t=>e.onDownload(e.audioUrl),[`stop`])},{default:d(()=>[n(s(e.$t(`fish.button.download`)),1)]),_:1}),r(v,{path:`/fish/tts`,body:e.modelValue?.request},null,8,[`body`])]),r(x,{closable:!1,class:`mt-2 success`},{default:d(()=>[e.modelValue?.request?.model?(c(),u(`p`,xe,[r(y,{icon:`fa-solid fa-microchip`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.model`))+`: `+s(e.modelValue?.request?.model),1)])):i(``,!0),e.modelValue?.request?.reference_id?(c(),u(`p`,Se,[r(y,{icon:`fa-solid fa-microphone`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.referenceId`))+`: `+s(e.modelValue?.request?.reference_id)+` `,1),r(b,{content:e.modelValue?.request?.reference_id},null,8,[`content`])])):i(``,!0),t(`p`,Ce,[r(y,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.taskId`))+`: `+s(e.modelValue?.id)+` `,1),r(b,{content:e.modelValue?.id},null,8,[`content`])]),e.modelValue?.elapsed?(c(),u(`p`,we,[r(y,{icon:`fa-solid fa-clock`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.elapsed`))+`: `+s(e.modelValue?.elapsed?.toFixed(2))+`s `,1)])):i(``,!0)]),_:1})])):(c(),u(`div`,Te,[r(x,{closable:!1,class:`info`},{default:d(()=>[t(`p`,Ee,[r(y,{icon:`fa-solid fa-magic`,class:`mr-1`}),n(` `+s(e.$t(`fish.name.taskId`))+`: `+s(e.modelValue?.id)+` `,1),r(b,{content:e.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var $=a({name:`FishRecentPanel`,components:{TaskPreview:w(le,[[`render`,De],[`__scopeId`,`data-v-754753f2`]]),BotPlaceholder:M,NoTasks:L,ScrollList:P},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Oe={key:0},ke={key:2,class:`w-full h-full flex items-center justify-center`};function Ae(t,n,a,s,p,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return c(),u(f,null,[t.tasks?.items===void 0?(c(),u(`div`,Oe,[r(h)])):t.tasks?.items?.length&&t.tasks?.items?.length>0?(c(),e(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:t.loading,onReachTop:n[0]||=e=>t.$emit(`reach-top`)},{default:d(()=>[(c(!0),u(f,null,o(t.tasks?.items,t=>(c(),e(g,{key:t.id,"model-value":t},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):i(``,!0),t.tasks?.items?.length===0?(c(),u(`div`,ke,[r(v)])):i(``,!0)],64)}var je=w($,[[`render`,Ae]]),Me=x(`fish`),Ne=a({name:`FishTtsIndex`,components:{ConfigPanel:ce,Layout:j,RecentPanel:je,TabSwitcher:N},mixins:[C],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===O.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===O.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService(),await this.$store.dispatch(`fish/getVoices`)},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await F({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`fish/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!te(this.uploadTracker,e=>this.$t(e),e=>E.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){E.warning(this.$t(`fish.message.textRequired`));return}let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,callback_url:Me};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),E.info(this.$t(`fish.message.startingTask`)),T(`fish`,D.generateTts(i,{token:n,model:r})).then(()=>{E.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?E.error(this.$t(`fish.message.usedUp`)):E.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),Pe={class:`flex flex-col h-full`},Fe={class:`flex-1 min-h-0`};function Ie(n,i,a,o,s,u){let f=l(`tab-switcher`),p=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return c(),e(h,null,{config:d(()=>[t(`div`,Pe,[r(f),t(`div`,Fe,[r(p,{onGenerate:n.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[r(m,{ref:`recentPanel`,loading:n.loadingMore,onReachTop:n.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Le=w(Ne,[[`render`,Ie]]);export{Le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{D as e,E as t,M as n,N as r,O as i,P as a,Ut as o,X as s,et as c,k as l,lt as u}from"./vendor-chart-mdwpew_o.js";import{t as d}from"./button-DWzbdjZV.js";import{E as f}from"./index-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{D as e,E as t,M as n,N as r,O as i,P as a,Ut as o,X as s,et as c,k as l,lt as u}from"./vendor-chart-mdwpew_o.js";import{t as d}from"./button-DWzbdjZV.js";import{E as f}from"./index-DPVeprbd.js";import{t as p}from"./index.es-BixPU3yV.js";import{t as m}from"./vue-plyr-wiIKa-zl.js";var h=a({name:`VideoPlayer`,components:{ElButton:d,FontAwesomeIcon:p,VuePlyr:m},props:{src:{type:String,required:!0},options:{type:Object,required:!1,default:()=>({})}},data(){return{failed:!1,mergedOptions:{controls:[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`fullscreen`],iconUrl:`https://cdn.acedata.cloud/7jq4t0.svg`,quality:{default:1080,options:[1080],...this.options.quality},...this.options}}},computed:{safeSrc(){return this.src.trim()}},watch:{safeSrc(){this.failed=!1}},methods:{onError(){this.failed=!0},onOpen(){window.open(this.safeSrc,`_blank`,`noopener,noreferrer`)}}}),g={class:`video max-w-[800px] max-h-[450px] rounded-[15px] overflow-hidden`},_=[`src`],v={key:1,class:`video-fallback`};function y(a,d,f,p,m,h){let y=c(`vue-plyr`),b=c(`font-awesome-icon`),x=c(`el-button`);return s(),l(`div`,g,[!a.failed&&a.safeSrc?(s(),e(y,{key:a.safeSrc,options:a.mergedOptions},{default:u(()=>[t(`video`,{controls:``,playsinline:``,preload:`metadata`,class:`w-full h-full aspect-[16/9]`,onError:d[0]||=(...e)=>a.onError&&a.onError(...e)},[t(`source`,{size:`1080`,src:a.safeSrc,type:`video/mp4`},null,8,_)],32)]),_:1},8,[`options`])):a.safeSrc?(s(),l(`div`,v,[r(x,{type:`primary`,round:``,onClick:a.onOpen},{default:u(()=>[r(b,{icon:`fa-solid fa-up-right-from-square`,class:`mr-2`}),n(` `+o(a.$t(`common.button.download`)),1)]),_:1},8,[`onClick`])])):i(``,!0)])}var b=f(h,[[`render`,y],[`__scopeId`,`data-v-39c4a118`]]);export{b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,B as t,Bt as n,Ct as r,D as i,Dt as a,E as o,F as s,It as c,L as l,M as u,Nt as d,P as f,R as p,T as m,Ut as h,V as g,W as _,X as v,Z as y,_ as b,_t as ee,ct as x,k as S,lt as C,q as w,st as T,u as E,ut as D,x as O,yt as k,zt as A}from"./vendor-chart-mdwpew_o.js";import{r as j}from"./button-DWzbdjZV.js";import{a as M,c as N,i as P,t as F}from"./install-ClulZuUd.js";import{c as I,d as L,n as R,r as z,u as B}from"./runtime-Cvku-lF9.js";import{Ct as V,L as H,Rt as te,St as U,_ as ne,at as re,h as ie,kt as W,m as G,nt as K,ot as q,tt as ae}from"./use-deprecated-CPfQu7wa.js";import{t as oe}from"./tooltip-C3PYfh8V.js";import{c as J}from"./teleport-B3tPbGeJ.js";import{t as Y}from"./aria-CQaCu-Fx.js";import{n as X}from"./vnode-BMVwTmkF.js";import{t as Z}from"./click-outside-DSZqOY28.js";import{t as se}from"./collapse-transition-C7m30vMg.js";import{E as ce,Vr as le}from"./index-BY8YIwDb.js";var ue=class{constructor(e,t){this.parent=e,this.domNode=t,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll(`li`),this.addListeners()}gotoSubIndex(e){e===this.subMenuItems.length?e=0:e<0&&(e=this.subMenuItems.length-1),this.subMenuItems[e].focus(),this.subIndex=e}addListeners(){let e=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,t=>{t.addEventListener(`keydown`,t=>{let n=!1;switch(t.code){case Y.down:this.gotoSubIndex(this.subIndex+1),n=!0;break;case Y.up:this.gotoSubIndex(this.subIndex-1),n=!0;break;case Y.tab:J(e,`mouseleave`);break;case Y.enter:case Y.numpadEnter:case Y.space:n=!0,t.currentTarget.click();break}return n&&(t.preventDefault(),t.stopPropagation()),!1})})}},de=class{constructor(e,t){this.domNode=e,this.submenu=null,this.submenu=null,this.init(t)}init(e){this.domNode.setAttribute(`tabindex`,`0`);let t=this.domNode.querySelector(`.${e}-menu`);t&&(this.submenu=new ue(this,t)),this.addListeners()}addListeners(){this.domNode.addEventListener(`keydown`,e=>{let t=!1;switch(e.code){case Y.down:J(e.currentTarget,`mouseenter`),this.submenu&&this.submenu.gotoSubIndex(0),t=!0;break;case Y.up:J(e.currentTarget,`mouseenter`),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),t=!0;break;case Y.tab:J(e.currentTarget,`mouseleave`);break;case Y.enter:case Y.numpadEnter:case Y.space:t=!0,e.currentTarget.click();break}t&&e.preventDefault()})}},fe=class{constructor(e,t){this.domNode=e,this.init(t)}init(e){let t=this.domNode.childNodes;Array.from(t).forEach(t=>{t.nodeType===1&&new de(t,e)})}},pe=M(f({...f({name:`ElMenuCollapseTransition`}),setup(n){let r=N(`menu`),o={onBeforeEnter:e=>e.style.opacity=`0.2`,onEnter(e,t){K(e,`${r.namespace.value}-opacity-transition`),e.style.opacity=`1`,t()},onAfterEnter(e){q(e,`${r.namespace.value}-opacity-transition`),e.style.opacity=``},onBeforeLeave(e){e.dataset||={},re(e,r.m(`collapse`))?(q(e,r.m(`collapse`)),e.dataset.oldOverflow=e.style.overflow,e.dataset.scrollWidth=e.clientWidth.toString(),K(e,r.m(`collapse`))):(K(e,r.m(`collapse`)),e.dataset.oldOverflow=e.style.overflow,e.dataset.scrollWidth=e.clientWidth.toString(),q(e,r.m(`collapse`))),e.style.width=`${e.scrollWidth}px`,e.style.overflow=`hidden`},onLeave(e){K(e,`horizontal-collapse-transition`),e.style.width=`${e.dataset.scrollWidth}px`}};return(n,r)=>(v(),i(E,t({mode:`out-in`},a(o)),{default:C(()=>[e(n.$slots,`default`)]),_:3},16))}}),[[`__file`,`menu-collapse-transition.vue`]]);function me(e,t){let n=m(()=>{let n=e.parent,r=[t.value];for(;n.type.name!==`ElMenu`;)n.props.index&&r.unshift(n.props.index),n=n.parent;return r});return{parentMenu:m(()=>{let t=e.parent;for(;t&&![`ElMenu`,`ElSubMenu`].includes(t.type.name);)t=t.parent;return t}),indexPath:n}}function he(e){return m(()=>{let t=e.backgroundColor;return t?new j(t).shade(20).toString():``})}var ge=(e,t)=>{let n=N(`menu`);return m(()=>n.cssVarBlock({"text-color":e.textColor||``,"hover-text-color":e.textColor||``,"bg-color":e.backgroundColor||``,"hover-bg-color":he(e).value||``,"active-color":e.activeTextColor||``,level:`${t}`}))},_e=`rootMenu`,Q=`subMenu:`,ve=R({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:G},expandOpenIcon:{type:G},collapseCloseIcon:{type:G},collapseOpenIcon:{type:G}}),ye=`ElSubMenu`,be=f({name:ye,props:ve,setup(e,{slots:t,expose:n}){let r=s(),{indexPath:i,parentMenu:a}=me(r,m(()=>e.index)),o=N(`menu`),c=N(`sub-menu`),u=p(_e);u||V(ye,`can not inject root menu`);let d=p(`${Q}${a.value.uid}`);d||V(ye,`can not inject sub menu`);let f=k({}),h=k({}),g,v=k(!1),x=k(),S=k(),C=m(()=>R.value===`horizontal`&&j.value?`bottom-start`:`right-start`),E=m(()=>R.value===`horizontal`&&j.value||R.value===`vertical`&&!u.props.collapse?e.expandCloseIcon&&e.expandOpenIcon?I.value?e.expandOpenIcon:e.expandCloseIcon:ie:e.collapseCloseIcon&&e.collapseOpenIcon?I.value?e.collapseOpenIcon:e.collapseCloseIcon:ne),j=m(()=>d.level===0),M=m(()=>{let t=e.teleported;return B(t)?j.value:t}),P=m(()=>u.props.collapse?`${o.namespace.value}-zoom-in-left`:`${o.namespace.value}-zoom-in-top`),F=m(()=>R.value===`horizontal`&&j.value?[`bottom-start`,`bottom-end`,`top-start`,`top-end`,`right-start`,`left-start`]:[`right-start`,`right`,`right-end`,`left-start`,`bottom-start`,`bottom-end`,`top-start`,`top-end`]),I=m(()=>u.openedMenus.includes(e.index)),L=m(()=>[...Object.values(f.value),...Object.values(h.value)].some(({active:e})=>e)),R=m(()=>u.props.mode),z=m(()=>u.props.persistent),H=ee({index:e.index,indexPath:i,active:L}),U=ge(u.props,d.level+1),re=m(()=>e.popperOffset??u.props.popperOffset),W=m(()=>e.popperClass??u.props.popperClass),G=m(()=>e.showTimeout??u.props.showTimeout),K=m(()=>e.hideTimeout??u.props.hideTimeout),q=()=>(S.value?.popperRef?.popperInstanceRef)?.destroy(),J=e=>{e||q()},Y=()=>{u.props.menuTrigger===`hover`&&u.props.mode===`horizontal`||u.props.collapse&&u.props.mode===`vertical`||e.disabled||u.handleSubMenuClick({index:e.index,indexPath:i.value,active:L.value})},X=(t,n=G.value)=>{var r;if(t.type!==`focus`){if(u.props.menuTrigger===`click`&&u.props.mode===`horizontal`||!u.props.collapse&&u.props.mode===`vertical`||e.disabled){d.mouseInChild.value=!0;return}d.mouseInChild.value=!0,g?.(),{stop:g}=te(()=>{u.openMenu(e.index,i.value)},n),M.value&&((r=a.value.vnode.el)==null||r.dispatchEvent(new MouseEvent(`mouseenter`)))}},Z=(t=!1)=>{var n;if(u.props.menuTrigger===`click`&&u.props.mode===`horizontal`||!u.props.collapse&&u.props.mode===`vertical`){d.mouseInChild.value=!1;return}g?.(),d.mouseInChild.value=!1,{stop:g}=te(()=>!v.value&&u.closeMenu(e.index,i.value),K.value),M.value&&t&&((n=d.handleMouseleave)==null||n.call(d,!0))};return T(()=>u.props.collapse,e=>J(!!e)),y(`${Q}${r.uid}`,{addSubMenu:e=>{h.value[e.index]=e},removeSubMenu:e=>{delete h.value[e.index]},handleMouseleave:Z,mouseInChild:v,level:d.level+1}),n({opened:I}),w(()=>{u.addSubMenu(H),d.addSubMenu(H)}),_(()=>{d.removeSubMenu(H),u.removeSubMenu(H)}),()=>{let n=[t.title?.call(t),l(ae,{class:c.e(`icon-arrow`),style:{transform:I.value?e.expandCloseIcon&&e.expandOpenIcon||e.collapseCloseIcon&&e.collapseOpenIcon&&u.props.collapse?`none`:`rotateZ(180deg)`:`none`}},{default:()=>A(E.value)?l(r.appContext.components[E.value]):l(E.value)})],i=u.isMenuPopup?l(oe,{ref:S,visible:I.value,effect:`light`,pure:!0,offset:re.value,showArrow:!1,persistent:z.value,popperClass:W.value,placement:C.value,teleported:M.value,fallbackPlacements:F.value,transition:P.value,gpuAcceleration:!1},{content:()=>l(`div`,{class:[o.m(R.value),o.m(`popup-container`),W.value],onMouseenter:e=>X(e,100),onMouseleave:()=>Z(!0),onFocus:e=>X(e,100)},[l(`ul`,{class:[o.b(),o.m(`popup`),o.m(`popup-${C.value}`)],style:U.value},[t.default?.call(t)])]),default:()=>l(`div`,{class:c.e(`title`),onClick:Y},n)}):l(O,{},[l(`div`,{class:c.e(`title`),ref:x,onClick:Y},n),l(se,{},{default:()=>D(l(`ul`,{role:`menu`,class:[o.b(),o.m(`inline`)],style:U.value},[t.default?.call(t)]),[[b,I.value]])})]);return l(`li`,{class:[c.b(),c.is(`active`,L.value),c.is(`opened`,I.value),c.is(`disabled`,e.disabled)],role:`menuitem`,ariaHaspopup:!0,ariaExpanded:I.value,onMouseenter:X,onMouseleave:()=>Z(),onFocus:X},[i])}}}),xe=R({mode:{type:String,values:[`horizontal`,`vertical`],default:`vertical`},defaultActive:{type:String,default:``},defaultOpeneds:{type:z(Array),default:()=>le([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:[`hover`,`click`],default:`hover`},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:G,default:()=>H},popperEffect:{type:z(String),default:`dark`},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),Se=e=>d(e)&&e.every(e=>A(e)),Ce=f({name:`ElMenu`,props:xe,emits:{close:(e,t)=>A(e)&&Se(t),open:(e,t)=>A(e)&&Se(t),select:(e,t,n,r)=>A(e)&&Se(t)&&c(n)&&(B(r)||r instanceof Promise)},setup(e,{emit:t,slots:n,expose:r}){let i=s(),a=i.appContext.config.globalProperties.$router,o=k(),c=N(`menu`),u=N(`sub-menu`),d=k(-1),f=k(e.defaultOpeneds&&!e.collapse?e.defaultOpeneds.slice(0):[]),p=k(e.defaultActive),h=k({}),_=k({}),v=m(()=>e.mode===`horizontal`||e.mode===`vertical`&&e.collapse),b=()=>{let t=p.value&&h.value[p.value];!t||e.mode===`horizontal`||e.collapse||t.indexPath.forEach(e=>{let t=_.value[e];t&&S(e,t.indexPath)})},S=(n,r)=>{f.value.includes(n)||(e.uniqueOpened&&(f.value=f.value.filter(e=>r.includes(e))),f.value.push(n),t(`open`,n,r))},C=e=>{let t=f.value.indexOf(e);t!==-1&&f.value.splice(t,1)},E=(e,n)=>{C(e),t(`close`,e,n)},O=({index:e,indexPath:t})=>{f.value.includes(e)?E(e,t):S(e,t)},A=n=>{(e.mode===`horizontal`||e.collapse)&&(f.value=[]);let{index:r,indexPath:i}=n;if(!(L(r)||L(i)))if(e.router&&a){let e=n.route||r,o=a.push(e).then(e=>(e||(p.value=r),e));t(`select`,r,i,{index:r,indexPath:i,route:e},o)}else p.value=r,t(`select`,r,i,{index:r,indexPath:i})},j=t=>{let n=h.value;p.value=(n[t]||p.value&&n[p.value]||n[e.defaultActive])?.index??t},M=e=>{let t=getComputedStyle(e),n=Number.parseInt(t.marginLeft,10),r=Number.parseInt(t.marginRight,10);return e.offsetWidth+n+r||0},P=()=>{if(!o.value)return-1;let e=Array.from(o.value?.childNodes??[]).filter(e=>e.nodeName!==`#text`||e.nodeValue),t=getComputedStyle(o.value),n=Number.parseInt(t.paddingLeft,10),r=Number.parseInt(t.paddingRight,10),i=o.value.clientWidth-n-r,a=0,s=0;return e.forEach((e,t)=>{e.nodeName!==`#comment`&&(a+=M(e),a<=i-64&&(s=t+1))}),s===e.length?-1:s},F=e=>_.value[e].indexPath,I=(e,t=33.34)=>{let n;return()=>{n&&clearTimeout(n),n=setTimeout(()=>{e()},t)}},R=!0,z=()=>{if(d.value===P())return;let e=()=>{d.value=-1,g(()=>{d.value=P()})};R?e():I(e)(),R=!1};T(()=>e.defaultActive,e=>{h.value[e]||(p.value=``),j(e)}),T(()=>e.collapse,e=>{e&&(f.value=[])}),T(h.value,b);let B;x(()=>{e.mode===`horizontal`&&e.ellipsis?B=W(o,z).stop:B?.()});let V=k(!1);{let t=e=>{_.value[e.index]=e},n=e=>{delete _.value[e.index]};y(_e,ee({props:e,openedMenus:f,items:h,subMenus:_,activeIndex:p,isMenuPopup:v,addMenuItem:e=>{h.value[e.index]=e},removeMenuItem:e=>{delete h.value[e.index]},addSubMenu:t,removeSubMenu:n,openMenu:S,closeMenu:E,handleMenuItemClick:A,handleSubMenuClick:O})),y(`${Q}${i.uid}`,{addSubMenu:t,removeSubMenu:n,mouseInChild:V,level:0})}w(()=>{e.mode===`horizontal`&&new fe(i.vnode.el,c.namespace.value)}),r({open:e=>{let{indexPath:t}=_.value[e];t.forEach(e=>S(e,t))},close:C,updateActiveIndex:j,handleResize:z});let H=ge(e,0);return()=>{let r=n.default?.call(n)??[],i=[];if(e.mode===`horizontal`&&o.value){let t=X(r),n=d.value===-1?t:t.slice(0,d.value),a=d.value===-1?[]:t.slice(d.value);a?.length&&e.ellipsis&&(r=n,i.push(l(be,{index:`sub-menu-more`,class:u.e(`hide-arrow`),popperOffset:e.popperOffset},{title:()=>l(ae,{class:u.e(`icon-more`)},{default:()=>l(e.ellipsisIcon)}),default:()=>a})))}let a=e.closeOnClickOutside?[[Z,()=>{f.value.length&&(V.value||(f.value.forEach(e=>t(`close`,e,F(e))),f.value=[]))}]]:[],s=D(l(`ul`,{key:String(e.collapse),role:`menubar`,ref:o,style:H.value,class:{[c.b()]:!0,[c.m(e.mode)]:!0,[c.m(`collapse`)]:e.collapse}},[...r,...i]),a);return e.collapseTransition&&e.mode===`vertical`?l(pe,()=>s):s}}}),we=R({index:{type:z([String,null]),default:null},route:{type:z([String,Object])},disabled:Boolean}),Te={click:e=>A(e.index)&&d(e.indexPath)},$=`ElMenuItem`,Ee=M(f({...f({name:$}),props:we,emits:Te,setup(t,{expose:c,emit:l}){let u=t;I(u.index)&&U($,`Missing required prop: "index"`);let d=s(),f=p(_e),h=N(`menu`),g=N(`menu-item`);f||V($,`can not inject root menu`);let{parentMenu:y,indexPath:b}=me(d,r(u,`index`)),x=p(`${Q}${y.value.uid}`);x||V($,`can not inject sub menu`);let T=m(()=>u.index===f.activeIndex),E=ee({index:u.index,indexPath:b,active:T}),D=()=>{u.disabled||(f.handleMenuItemClick({index:u.index,indexPath:b.value,route:u.route}),l(`click`,E))};return w(()=>{x.addSubMenu(E),f.addMenuItem(E)}),_(()=>{x.removeSubMenu(E),f.removeMenuItem(E)}),c({parentMenu:y,rootMenu:f,active:T,nsMenu:h,nsMenuItem:g,handleClick:D}),(t,r)=>(v(),S(`li`,{class:n([a(g).b(),a(g).is(`active`,a(T)),a(g).is(`disabled`,t.disabled)]),role:`menuitem`,tabindex:`-1`,onClick:D},[a(y).type.name===`ElMenu`&&a(f).props.collapse&&t.$slots.title?(v(),i(a(oe),{key:0,effect:a(f).props.popperEffect,placement:`right`,"fallback-placements":[`left`],persistent:a(f).props.persistent},{content:C(()=>[e(t.$slots,`title`)]),default:C(()=>[o(`div`,{class:n(a(h).be(`tooltip`,`trigger`))},[e(t.$slots,`default`)],2)]),_:3},8,[`effect`,`persistent`])):(v(),S(O,{key:1},[e(t.$slots,`default`),e(t.$slots,`title`)],64))],2))}}),[[`__file`,`menu-item.vue`]]),De={title:String},Oe=M(f({...f({name:`ElMenuItemGroup`}),props:De,setup(t){let r=N(`menu-item-group`);return(t,i)=>(v(),S(`li`,{class:n(a(r).b())},[o(`div`,{class:n(a(r).e(`title`))},[t.$slots.title?e(t.$slots,`title`,{key:1}):(v(),S(O,{key:0},[u(h(t.title),1)],64))],2),o(`ul`,null,[e(t.$slots,`default`)])],2))}}),[[`__file`,`menu-item-group.vue`]]),ke=F(Ce,{MenuItem:Ee,MenuItemGroup:Oe,SubMenu:be}),Ae=P(Ee);P(Oe);var je=P(be),Me=f({props:{collapsed:{type:Boolean,default:!1}},emits:[`click`],computed:{siteTitle(){return this.$store.state.site?.title||`AceData`},url(){let e=this.$store.state.site,t=`https://platform.acedata.cloud/favicon.ico`;return this.collapsed?e?.favicon||e?.logo||t:e?.logo||e?.favicon||t}}}),Ne=[`aria-label`],Pe=[`src`,`alt`];function Fe(e,t,n,r,i,a){return v(),S(`button`,{type:`button`,class:`brand-logo`,"aria-label":e.siteTitle,onClick:t[0]||=t=>e.$emit(`click`)},[o(`img`,{src:e.url,class:`brand-logo__image`,alt:e.siteTitle},null,8,Pe)],8,Ne)}var Ie=ce(Me,[[`render`,Fe],[`__scopeId`,`data-v-fefbbe27`]]),Le=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAAAMFBMVEX///+3t7f4+Pi8vLzAwMDExMTS0tLIyMjk5OTz8/PY2NjOzs7u7u7d3d3p6enh4eFVKkJDAAAIfUlEQVR4nNVd15akOAylyRRQ9f9/O02BZJtgBQszfR/2zPahsJCvguVUFJYop35ux66pq6r6+fn9T910bTv3U2najBXK9zw2PxE07fz+n0Qf+raOyetL3g9PS7vgzRUYULfvZyXuR5nAgLF/SuK3UuJN7gf0PbyErDiieuU1zKmLyFJ3Y9u+vmh//V9dXT/b5VN3f+HbFq82nGivHH6999Vv8rC7P+NFzfBlF56xvl/sEy1Xbc8mZ9m3R7bcrO0jl+vXJH7J0YY78UvYKNuDjpWNTQd9tzd5ks9ePUm92u877WMlp4dhR+Y2OYkYdh3XmKclc9iATVwoXyFLZouXIobuBpEXlK+QcYbK7gOF2NpMaN2Vmfdr71LGirAbW5N3lr4F1rckC0GQbQw6cqrM1XACvzOr5EjT+2q+L24Vk6/sRGL7no6t5un9eQE+7JG4r+wk3+e9iGfXwzyeZHLjzDGFt0fEBB564ymOeRwzCg8dHaZ9kx8NZGZ8+UyOv0bSW3o9q5Tac5+0luajjGfqpsT2krIuTeaKZGQf4UUIKpx6xFbo2nGD9HSlpJZAGfSQILVjV02Z4CQsJhD2UdbcJ/dwyRfpNvozwaLo4q/0nMhLIrMThJSZZ4EhiJd6Ugti43SvzCTlPKnZmUNZMV+u4cYKwp85XlfcTBi/s6Z+MZ2LxADhGZzUDU9m5zjIr0woQhLxasAHWS7E9TgZU/Z1EBEIjbzxQYYxOudOxu73qTBcUGEaIzqD1hi96W6JTgzRoDSI/UhmITP7yUPFSYqaagD1R4wJkP8VnT8nTwVQqnauN06QjvtCvYt2IL3Zm/Uk9jjDz0RmMLggwx3SOuIUSniGpJv3bAJo1SAFr9mKH8aI+LqkI0RFtoIh9/L76Cc8GLCDoxxSjyAHgxxFYSEzJ18Ggly4YHQHnCQ2LRoCGINXQirim0JYUJpDatf/p24PP4mVwSblSg6MEhDGuzNVg6J5o8nEvAPAGZiAfk5MDRXNqxcmx/AVHPMprx8G1TEHwOzqTByseTgoDRxYDT6akSh9YSMzr6aLidOeTGCj3EqDkdC8GU9Q9c6voYlyJzxy0sOxOnRs8C3sQpSR92DOO4EDCXkAzoA935bPTy8AIgTBCIIyvyZsExF/uM2Byfk9A7VafuksfdyygFmJcc35NZ7tT5xUYMNwJYcI/FouGP7xOyT1YBOh+aVcsCHHBWCHZHLTxOfxF6ZA8HP82P7ASv4BJj5PMNMO/g3+H9ghqrtnGm4hIJLAd7byVxg5asGCA+AH2N2meYHvKPxZmQRIGtyMaOMweC/ZXJJJdJE0CF27Bm0oK8kWLKSWHxeILB8s7xN8gmxFi0VIFAkNqd5KiI3S7JBqJ7Ssycb70vAL2LAofMiE9hkBrQvX4OTXNLS4eGpwA8KlaxaGKHOy4OWWcSVoXSZz9ohYYLaxpB8bv4V2aFGeFiYOvqTb74V2mHkQ8IXjBKhMuKrMJIoLOQlmVGIiIlyPmXdguwJ6d8J/CZ1H0m4iB1Gr4D569HjCZalPaNoxeWtd5jKf4TRkpy30syh3KbLXPVZsWdIIQUK6dO8Jl+dkbUB6GfRranwIWx3hUzeVi5fRmggtDA6b/dWO3ELkLiF4QldqoXOPxhe8QOjt57LUpXhguGUhtEUFUtq9EBzUQluQWrphIV1oA1JLm0R6VFqh0z21eH30XmjFdofbF14dgC5PG1zS0w9pjuYFF2UYL9KHiXJGYhhXJkwLEk1RvrEMZVWmpgvSVC1XtEtNlYOAL1JYrdESOg3lcGtFQsVGs+Nu++msHdiu0BNEQQ5vYKssIWxQx3JNc1AqnbTFmg3qSoKmYz0mb//S7QDU1k5Vdu+VSnUFyA3aBES1ca9zkqb4PPVQUUVG74OVRfUNSqencXh+UR1sUnfqgy6+qLrVn75QThRt0I26VG0FU4dbRNfE1ULpqVVBIZBTN/kJ0PBDxY6QEbpp5v27JFCxI5xm1k3oIxT+Q+Wowgl93dIJhHzqVrW5erd0QrdIxUE8wFXxcL9IBXSlSRcLuSnq3NR+OZBq4ZWD1FXr8sn9wivVEjcPwtVuKtd6XOKmWUzoQeY/dCczHBcTKpZtnr2QB104gN70ukm+QNaHzBJV7DhbIAt/040ERMMXnbUDAwOtgvZVsUo0KaCi9Omib/SCqleKhE7KSsNIIt7IkFXoi40MSBrNO28X+ooHOKxWqPpuoVHRh7FDo3+pyHsorOZyG5R0w5kPUZmJffYFIrLhTLi1DzFJT0X+aWaZ3JGtfcJNlCvesTOuIpAcLBrdRIms5g4s+jFlM0PFPYY6ul1VtDG4PJzwqQHnGGpKKlA1fVKN0VqxX31Tx1DjOTBXaRFvs3vaWdkniPIEF3hdGgEmxpev0VpeHNf8ZuiROMBhet0hMch9qkogR2wXbeSojHI22jd5ifp1cLbY9dHB8NWhJCbOgkYzBxpFzxH3wu74F++ro8ckWsM7a5l7/IuzVnAxJX1MojGQ3shHslKCPPimY+b+jYfmU0qONPIOj5rzK9lDi33OyQttVpEaglXXMFoabQVmqny3QxaBW4opM3o4CtwDJazWGZtAUMi12ONkAtGMrNGS/1QI5yb+CxciLmc8EwoDKEokefK6CBKPRf47Mj/MEIujvv+MzA/6kKQLCR7y18q5Y8AjiWryrR1T9uwp/RqJ3YUdGWBxYUeR2RzN7gThn6ifCrtLaA7X/dwG4xtusvg+24uVihzKtr/Cqrh7OFPdcVlYcXItmyHS7x67ROwyxxTceAHegqsLHVOQ4WLH00sdE5DhUsev2IbaznR95gKrCnDGi0oXDOmTRrmvhP3i712+u+LvXXO84u9dKL2Cf3V33X7+i6u7N/y5S9IdvOvoF0G/19GP9tfR/wPQ21eEI8clLwAAAABJRU5ErkJggg==`;export{je as a,Ae as i,Ie as n,ke as r,Le as t};
|
|
1
|
+
import{$ as e,B as t,Bt as n,Ct as r,D as i,Dt as a,E as o,F as s,It as c,L as l,M as u,Nt as d,P as f,R as p,T as m,Ut as h,V as g,W as _,X as v,Z as y,_ as b,_t as ee,ct as x,k as S,lt as C,q as w,st as T,u as E,ut as D,x as O,yt as k,zt as A}from"./vendor-chart-mdwpew_o.js";import{r as j}from"./button-DWzbdjZV.js";import{a as M,c as N,i as P,t as F}from"./install-ClulZuUd.js";import{c as I,d as L,n as R,r as z,u as B}from"./runtime-Cvku-lF9.js";import{Ct as V,L as H,Rt as te,St as U,_ as ne,at as re,h as ie,kt as W,m as G,nt as K,ot as q,tt as ae}from"./use-deprecated-CPfQu7wa.js";import{t as oe}from"./tooltip-C3PYfh8V.js";import{c as J}from"./teleport-B3tPbGeJ.js";import{t as Y}from"./aria-CQaCu-Fx.js";import{n as X}from"./vnode-BMVwTmkF.js";import{t as Z}from"./click-outside-DSZqOY28.js";import{t as se}from"./collapse-transition-C7m30vMg.js";import{E as ce,Vr as le}from"./index-DPVeprbd.js";var ue=class{constructor(e,t){this.parent=e,this.domNode=t,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll(`li`),this.addListeners()}gotoSubIndex(e){e===this.subMenuItems.length?e=0:e<0&&(e=this.subMenuItems.length-1),this.subMenuItems[e].focus(),this.subIndex=e}addListeners(){let e=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,t=>{t.addEventListener(`keydown`,t=>{let n=!1;switch(t.code){case Y.down:this.gotoSubIndex(this.subIndex+1),n=!0;break;case Y.up:this.gotoSubIndex(this.subIndex-1),n=!0;break;case Y.tab:J(e,`mouseleave`);break;case Y.enter:case Y.numpadEnter:case Y.space:n=!0,t.currentTarget.click();break}return n&&(t.preventDefault(),t.stopPropagation()),!1})})}},de=class{constructor(e,t){this.domNode=e,this.submenu=null,this.submenu=null,this.init(t)}init(e){this.domNode.setAttribute(`tabindex`,`0`);let t=this.domNode.querySelector(`.${e}-menu`);t&&(this.submenu=new ue(this,t)),this.addListeners()}addListeners(){this.domNode.addEventListener(`keydown`,e=>{let t=!1;switch(e.code){case Y.down:J(e.currentTarget,`mouseenter`),this.submenu&&this.submenu.gotoSubIndex(0),t=!0;break;case Y.up:J(e.currentTarget,`mouseenter`),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),t=!0;break;case Y.tab:J(e.currentTarget,`mouseleave`);break;case Y.enter:case Y.numpadEnter:case Y.space:t=!0,e.currentTarget.click();break}t&&e.preventDefault()})}},fe=class{constructor(e,t){this.domNode=e,this.init(t)}init(e){let t=this.domNode.childNodes;Array.from(t).forEach(t=>{t.nodeType===1&&new de(t,e)})}},pe=M(f({...f({name:`ElMenuCollapseTransition`}),setup(n){let r=N(`menu`),o={onBeforeEnter:e=>e.style.opacity=`0.2`,onEnter(e,t){K(e,`${r.namespace.value}-opacity-transition`),e.style.opacity=`1`,t()},onAfterEnter(e){q(e,`${r.namespace.value}-opacity-transition`),e.style.opacity=``},onBeforeLeave(e){e.dataset||={},re(e,r.m(`collapse`))?(q(e,r.m(`collapse`)),e.dataset.oldOverflow=e.style.overflow,e.dataset.scrollWidth=e.clientWidth.toString(),K(e,r.m(`collapse`))):(K(e,r.m(`collapse`)),e.dataset.oldOverflow=e.style.overflow,e.dataset.scrollWidth=e.clientWidth.toString(),q(e,r.m(`collapse`))),e.style.width=`${e.scrollWidth}px`,e.style.overflow=`hidden`},onLeave(e){K(e,`horizontal-collapse-transition`),e.style.width=`${e.dataset.scrollWidth}px`}};return(n,r)=>(v(),i(E,t({mode:`out-in`},a(o)),{default:C(()=>[e(n.$slots,`default`)]),_:3},16))}}),[[`__file`,`menu-collapse-transition.vue`]]);function me(e,t){let n=m(()=>{let n=e.parent,r=[t.value];for(;n.type.name!==`ElMenu`;)n.props.index&&r.unshift(n.props.index),n=n.parent;return r});return{parentMenu:m(()=>{let t=e.parent;for(;t&&![`ElMenu`,`ElSubMenu`].includes(t.type.name);)t=t.parent;return t}),indexPath:n}}function he(e){return m(()=>{let t=e.backgroundColor;return t?new j(t).shade(20).toString():``})}var ge=(e,t)=>{let n=N(`menu`);return m(()=>n.cssVarBlock({"text-color":e.textColor||``,"hover-text-color":e.textColor||``,"bg-color":e.backgroundColor||``,"hover-bg-color":he(e).value||``,"active-color":e.activeTextColor||``,level:`${t}`}))},_e=`rootMenu`,Q=`subMenu:`,ve=R({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:G},expandOpenIcon:{type:G},collapseCloseIcon:{type:G},collapseOpenIcon:{type:G}}),ye=`ElSubMenu`,be=f({name:ye,props:ve,setup(e,{slots:t,expose:n}){let r=s(),{indexPath:i,parentMenu:a}=me(r,m(()=>e.index)),o=N(`menu`),c=N(`sub-menu`),u=p(_e);u||V(ye,`can not inject root menu`);let d=p(`${Q}${a.value.uid}`);d||V(ye,`can not inject sub menu`);let f=k({}),h=k({}),g,v=k(!1),x=k(),S=k(),C=m(()=>R.value===`horizontal`&&j.value?`bottom-start`:`right-start`),E=m(()=>R.value===`horizontal`&&j.value||R.value===`vertical`&&!u.props.collapse?e.expandCloseIcon&&e.expandOpenIcon?I.value?e.expandOpenIcon:e.expandCloseIcon:ie:e.collapseCloseIcon&&e.collapseOpenIcon?I.value?e.collapseOpenIcon:e.collapseCloseIcon:ne),j=m(()=>d.level===0),M=m(()=>{let t=e.teleported;return B(t)?j.value:t}),P=m(()=>u.props.collapse?`${o.namespace.value}-zoom-in-left`:`${o.namespace.value}-zoom-in-top`),F=m(()=>R.value===`horizontal`&&j.value?[`bottom-start`,`bottom-end`,`top-start`,`top-end`,`right-start`,`left-start`]:[`right-start`,`right`,`right-end`,`left-start`,`bottom-start`,`bottom-end`,`top-start`,`top-end`]),I=m(()=>u.openedMenus.includes(e.index)),L=m(()=>[...Object.values(f.value),...Object.values(h.value)].some(({active:e})=>e)),R=m(()=>u.props.mode),z=m(()=>u.props.persistent),H=ee({index:e.index,indexPath:i,active:L}),U=ge(u.props,d.level+1),re=m(()=>e.popperOffset??u.props.popperOffset),W=m(()=>e.popperClass??u.props.popperClass),G=m(()=>e.showTimeout??u.props.showTimeout),K=m(()=>e.hideTimeout??u.props.hideTimeout),q=()=>(S.value?.popperRef?.popperInstanceRef)?.destroy(),J=e=>{e||q()},Y=()=>{u.props.menuTrigger===`hover`&&u.props.mode===`horizontal`||u.props.collapse&&u.props.mode===`vertical`||e.disabled||u.handleSubMenuClick({index:e.index,indexPath:i.value,active:L.value})},X=(t,n=G.value)=>{var r;if(t.type!==`focus`){if(u.props.menuTrigger===`click`&&u.props.mode===`horizontal`||!u.props.collapse&&u.props.mode===`vertical`||e.disabled){d.mouseInChild.value=!0;return}d.mouseInChild.value=!0,g?.(),{stop:g}=te(()=>{u.openMenu(e.index,i.value)},n),M.value&&((r=a.value.vnode.el)==null||r.dispatchEvent(new MouseEvent(`mouseenter`)))}},Z=(t=!1)=>{var n;if(u.props.menuTrigger===`click`&&u.props.mode===`horizontal`||!u.props.collapse&&u.props.mode===`vertical`){d.mouseInChild.value=!1;return}g?.(),d.mouseInChild.value=!1,{stop:g}=te(()=>!v.value&&u.closeMenu(e.index,i.value),K.value),M.value&&t&&((n=d.handleMouseleave)==null||n.call(d,!0))};return T(()=>u.props.collapse,e=>J(!!e)),y(`${Q}${r.uid}`,{addSubMenu:e=>{h.value[e.index]=e},removeSubMenu:e=>{delete h.value[e.index]},handleMouseleave:Z,mouseInChild:v,level:d.level+1}),n({opened:I}),w(()=>{u.addSubMenu(H),d.addSubMenu(H)}),_(()=>{d.removeSubMenu(H),u.removeSubMenu(H)}),()=>{let n=[t.title?.call(t),l(ae,{class:c.e(`icon-arrow`),style:{transform:I.value?e.expandCloseIcon&&e.expandOpenIcon||e.collapseCloseIcon&&e.collapseOpenIcon&&u.props.collapse?`none`:`rotateZ(180deg)`:`none`}},{default:()=>A(E.value)?l(r.appContext.components[E.value]):l(E.value)})],i=u.isMenuPopup?l(oe,{ref:S,visible:I.value,effect:`light`,pure:!0,offset:re.value,showArrow:!1,persistent:z.value,popperClass:W.value,placement:C.value,teleported:M.value,fallbackPlacements:F.value,transition:P.value,gpuAcceleration:!1},{content:()=>l(`div`,{class:[o.m(R.value),o.m(`popup-container`),W.value],onMouseenter:e=>X(e,100),onMouseleave:()=>Z(!0),onFocus:e=>X(e,100)},[l(`ul`,{class:[o.b(),o.m(`popup`),o.m(`popup-${C.value}`)],style:U.value},[t.default?.call(t)])]),default:()=>l(`div`,{class:c.e(`title`),onClick:Y},n)}):l(O,{},[l(`div`,{class:c.e(`title`),ref:x,onClick:Y},n),l(se,{},{default:()=>D(l(`ul`,{role:`menu`,class:[o.b(),o.m(`inline`)],style:U.value},[t.default?.call(t)]),[[b,I.value]])})]);return l(`li`,{class:[c.b(),c.is(`active`,L.value),c.is(`opened`,I.value),c.is(`disabled`,e.disabled)],role:`menuitem`,ariaHaspopup:!0,ariaExpanded:I.value,onMouseenter:X,onMouseleave:()=>Z(),onFocus:X},[i])}}}),xe=R({mode:{type:String,values:[`horizontal`,`vertical`],default:`vertical`},defaultActive:{type:String,default:``},defaultOpeneds:{type:z(Array),default:()=>le([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:[`hover`,`click`],default:`hover`},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:G,default:()=>H},popperEffect:{type:z(String),default:`dark`},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),Se=e=>d(e)&&e.every(e=>A(e)),Ce=f({name:`ElMenu`,props:xe,emits:{close:(e,t)=>A(e)&&Se(t),open:(e,t)=>A(e)&&Se(t),select:(e,t,n,r)=>A(e)&&Se(t)&&c(n)&&(B(r)||r instanceof Promise)},setup(e,{emit:t,slots:n,expose:r}){let i=s(),a=i.appContext.config.globalProperties.$router,o=k(),c=N(`menu`),u=N(`sub-menu`),d=k(-1),f=k(e.defaultOpeneds&&!e.collapse?e.defaultOpeneds.slice(0):[]),p=k(e.defaultActive),h=k({}),_=k({}),v=m(()=>e.mode===`horizontal`||e.mode===`vertical`&&e.collapse),b=()=>{let t=p.value&&h.value[p.value];!t||e.mode===`horizontal`||e.collapse||t.indexPath.forEach(e=>{let t=_.value[e];t&&S(e,t.indexPath)})},S=(n,r)=>{f.value.includes(n)||(e.uniqueOpened&&(f.value=f.value.filter(e=>r.includes(e))),f.value.push(n),t(`open`,n,r))},C=e=>{let t=f.value.indexOf(e);t!==-1&&f.value.splice(t,1)},E=(e,n)=>{C(e),t(`close`,e,n)},O=({index:e,indexPath:t})=>{f.value.includes(e)?E(e,t):S(e,t)},A=n=>{(e.mode===`horizontal`||e.collapse)&&(f.value=[]);let{index:r,indexPath:i}=n;if(!(L(r)||L(i)))if(e.router&&a){let e=n.route||r,o=a.push(e).then(e=>(e||(p.value=r),e));t(`select`,r,i,{index:r,indexPath:i,route:e},o)}else p.value=r,t(`select`,r,i,{index:r,indexPath:i})},j=t=>{let n=h.value;p.value=(n[t]||p.value&&n[p.value]||n[e.defaultActive])?.index??t},M=e=>{let t=getComputedStyle(e),n=Number.parseInt(t.marginLeft,10),r=Number.parseInt(t.marginRight,10);return e.offsetWidth+n+r||0},P=()=>{if(!o.value)return-1;let e=Array.from(o.value?.childNodes??[]).filter(e=>e.nodeName!==`#text`||e.nodeValue),t=getComputedStyle(o.value),n=Number.parseInt(t.paddingLeft,10),r=Number.parseInt(t.paddingRight,10),i=o.value.clientWidth-n-r,a=0,s=0;return e.forEach((e,t)=>{e.nodeName!==`#comment`&&(a+=M(e),a<=i-64&&(s=t+1))}),s===e.length?-1:s},F=e=>_.value[e].indexPath,I=(e,t=33.34)=>{let n;return()=>{n&&clearTimeout(n),n=setTimeout(()=>{e()},t)}},R=!0,z=()=>{if(d.value===P())return;let e=()=>{d.value=-1,g(()=>{d.value=P()})};R?e():I(e)(),R=!1};T(()=>e.defaultActive,e=>{h.value[e]||(p.value=``),j(e)}),T(()=>e.collapse,e=>{e&&(f.value=[])}),T(h.value,b);let B;x(()=>{e.mode===`horizontal`&&e.ellipsis?B=W(o,z).stop:B?.()});let V=k(!1);{let t=e=>{_.value[e.index]=e},n=e=>{delete _.value[e.index]};y(_e,ee({props:e,openedMenus:f,items:h,subMenus:_,activeIndex:p,isMenuPopup:v,addMenuItem:e=>{h.value[e.index]=e},removeMenuItem:e=>{delete h.value[e.index]},addSubMenu:t,removeSubMenu:n,openMenu:S,closeMenu:E,handleMenuItemClick:A,handleSubMenuClick:O})),y(`${Q}${i.uid}`,{addSubMenu:t,removeSubMenu:n,mouseInChild:V,level:0})}w(()=>{e.mode===`horizontal`&&new fe(i.vnode.el,c.namespace.value)}),r({open:e=>{let{indexPath:t}=_.value[e];t.forEach(e=>S(e,t))},close:C,updateActiveIndex:j,handleResize:z});let H=ge(e,0);return()=>{let r=n.default?.call(n)??[],i=[];if(e.mode===`horizontal`&&o.value){let t=X(r),n=d.value===-1?t:t.slice(0,d.value),a=d.value===-1?[]:t.slice(d.value);a?.length&&e.ellipsis&&(r=n,i.push(l(be,{index:`sub-menu-more`,class:u.e(`hide-arrow`),popperOffset:e.popperOffset},{title:()=>l(ae,{class:u.e(`icon-more`)},{default:()=>l(e.ellipsisIcon)}),default:()=>a})))}let a=e.closeOnClickOutside?[[Z,()=>{f.value.length&&(V.value||(f.value.forEach(e=>t(`close`,e,F(e))),f.value=[]))}]]:[],s=D(l(`ul`,{key:String(e.collapse),role:`menubar`,ref:o,style:H.value,class:{[c.b()]:!0,[c.m(e.mode)]:!0,[c.m(`collapse`)]:e.collapse}},[...r,...i]),a);return e.collapseTransition&&e.mode===`vertical`?l(pe,()=>s):s}}}),we=R({index:{type:z([String,null]),default:null},route:{type:z([String,Object])},disabled:Boolean}),Te={click:e=>A(e.index)&&d(e.indexPath)},$=`ElMenuItem`,Ee=M(f({...f({name:$}),props:we,emits:Te,setup(t,{expose:c,emit:l}){let u=t;I(u.index)&&U($,`Missing required prop: "index"`);let d=s(),f=p(_e),h=N(`menu`),g=N(`menu-item`);f||V($,`can not inject root menu`);let{parentMenu:y,indexPath:b}=me(d,r(u,`index`)),x=p(`${Q}${y.value.uid}`);x||V($,`can not inject sub menu`);let T=m(()=>u.index===f.activeIndex),E=ee({index:u.index,indexPath:b,active:T}),D=()=>{u.disabled||(f.handleMenuItemClick({index:u.index,indexPath:b.value,route:u.route}),l(`click`,E))};return w(()=>{x.addSubMenu(E),f.addMenuItem(E)}),_(()=>{x.removeSubMenu(E),f.removeMenuItem(E)}),c({parentMenu:y,rootMenu:f,active:T,nsMenu:h,nsMenuItem:g,handleClick:D}),(t,r)=>(v(),S(`li`,{class:n([a(g).b(),a(g).is(`active`,a(T)),a(g).is(`disabled`,t.disabled)]),role:`menuitem`,tabindex:`-1`,onClick:D},[a(y).type.name===`ElMenu`&&a(f).props.collapse&&t.$slots.title?(v(),i(a(oe),{key:0,effect:a(f).props.popperEffect,placement:`right`,"fallback-placements":[`left`],persistent:a(f).props.persistent},{content:C(()=>[e(t.$slots,`title`)]),default:C(()=>[o(`div`,{class:n(a(h).be(`tooltip`,`trigger`))},[e(t.$slots,`default`)],2)]),_:3},8,[`effect`,`persistent`])):(v(),S(O,{key:1},[e(t.$slots,`default`),e(t.$slots,`title`)],64))],2))}}),[[`__file`,`menu-item.vue`]]),De={title:String},Oe=M(f({...f({name:`ElMenuItemGroup`}),props:De,setup(t){let r=N(`menu-item-group`);return(t,i)=>(v(),S(`li`,{class:n(a(r).b())},[o(`div`,{class:n(a(r).e(`title`))},[t.$slots.title?e(t.$slots,`title`,{key:1}):(v(),S(O,{key:0},[u(h(t.title),1)],64))],2),o(`ul`,null,[e(t.$slots,`default`)])],2))}}),[[`__file`,`menu-item-group.vue`]]),ke=F(Ce,{MenuItem:Ee,MenuItemGroup:Oe,SubMenu:be}),Ae=P(Ee);P(Oe);var je=P(be),Me=f({props:{collapsed:{type:Boolean,default:!1}},emits:[`click`],computed:{siteTitle(){return this.$store.state.site?.title||`AceData`},url(){let e=this.$store.state.site,t=`https://platform.acedata.cloud/favicon.ico`;return this.collapsed?e?.favicon||e?.logo||t:e?.logo||e?.favicon||t}}}),Ne=[`aria-label`],Pe=[`src`,`alt`];function Fe(e,t,n,r,i,a){return v(),S(`button`,{type:`button`,class:`brand-logo`,"aria-label":e.siteTitle,onClick:t[0]||=t=>e.$emit(`click`)},[o(`img`,{src:e.url,class:`brand-logo__image`,alt:e.siteTitle},null,8,Pe)],8,Ne)}var Ie=ce(Me,[[`render`,Fe],[`__scopeId`,`data-v-fefbbe27`]]),Le=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAAAMFBMVEX///+3t7f4+Pi8vLzAwMDExMTS0tLIyMjk5OTz8/PY2NjOzs7u7u7d3d3p6enh4eFVKkJDAAAIfUlEQVR4nNVd15akOAylyRRQ9f9/O02BZJtgBQszfR/2zPahsJCvguVUFJYop35ux66pq6r6+fn9T910bTv3U2najBXK9zw2PxE07fz+n0Qf+raOyetL3g9PS7vgzRUYULfvZyXuR5nAgLF/SuK3UuJN7gf0PbyErDiieuU1zKmLyFJ3Y9u+vmh//V9dXT/b5VN3f+HbFq82nGivHH6999Vv8rC7P+NFzfBlF56xvl/sEy1Xbc8mZ9m3R7bcrO0jl+vXJH7J0YY78UvYKNuDjpWNTQd9tzd5ks9ePUm92u877WMlp4dhR+Y2OYkYdh3XmKclc9iATVwoXyFLZouXIobuBpEXlK+QcYbK7gOF2NpMaN2Vmfdr71LGirAbW5N3lr4F1rckC0GQbQw6cqrM1XACvzOr5EjT+2q+L24Vk6/sRGL7no6t5un9eQE+7JG4r+wk3+e9iGfXwzyeZHLjzDGFt0fEBB564ymOeRwzCg8dHaZ9kx8NZGZ8+UyOv0bSW3o9q5Tac5+0luajjGfqpsT2krIuTeaKZGQf4UUIKpx6xFbo2nGD9HSlpJZAGfSQILVjV02Z4CQsJhD2UdbcJ/dwyRfpNvozwaLo4q/0nMhLIrMThJSZZ4EhiJd6Ugti43SvzCTlPKnZmUNZMV+u4cYKwp85XlfcTBi/s6Z+MZ2LxADhGZzUDU9m5zjIr0woQhLxasAHWS7E9TgZU/Z1EBEIjbzxQYYxOudOxu73qTBcUGEaIzqD1hi96W6JTgzRoDSI/UhmITP7yUPFSYqaagD1R4wJkP8VnT8nTwVQqnauN06QjvtCvYt2IL3Zm/Uk9jjDz0RmMLggwx3SOuIUSniGpJv3bAJo1SAFr9mKH8aI+LqkI0RFtoIh9/L76Cc8GLCDoxxSjyAHgxxFYSEzJ18Ggly4YHQHnCQ2LRoCGINXQirim0JYUJpDatf/p24PP4mVwSblSg6MEhDGuzNVg6J5o8nEvAPAGZiAfk5MDRXNqxcmx/AVHPMprx8G1TEHwOzqTByseTgoDRxYDT6akSh9YSMzr6aLidOeTGCj3EqDkdC8GU9Q9c6voYlyJzxy0sOxOnRs8C3sQpSR92DOO4EDCXkAzoA935bPTy8AIgTBCIIyvyZsExF/uM2Byfk9A7VafuksfdyygFmJcc35NZ7tT5xUYMNwJYcI/FouGP7xOyT1YBOh+aVcsCHHBWCHZHLTxOfxF6ZA8HP82P7ASv4BJj5PMNMO/g3+H9ghqrtnGm4hIJLAd7byVxg5asGCA+AH2N2meYHvKPxZmQRIGtyMaOMweC/ZXJJJdJE0CF27Bm0oK8kWLKSWHxeILB8s7xN8gmxFi0VIFAkNqd5KiI3S7JBqJ7Ssycb70vAL2LAofMiE9hkBrQvX4OTXNLS4eGpwA8KlaxaGKHOy4OWWcSVoXSZz9ohYYLaxpB8bv4V2aFGeFiYOvqTb74V2mHkQ8IXjBKhMuKrMJIoLOQlmVGIiIlyPmXdguwJ6d8J/CZ1H0m4iB1Gr4D569HjCZalPaNoxeWtd5jKf4TRkpy30syh3KbLXPVZsWdIIQUK6dO8Jl+dkbUB6GfRranwIWx3hUzeVi5fRmggtDA6b/dWO3ELkLiF4QldqoXOPxhe8QOjt57LUpXhguGUhtEUFUtq9EBzUQluQWrphIV1oA1JLm0R6VFqh0z21eH30XmjFdofbF14dgC5PG1zS0w9pjuYFF2UYL9KHiXJGYhhXJkwLEk1RvrEMZVWmpgvSVC1XtEtNlYOAL1JYrdESOg3lcGtFQsVGs+Nu++msHdiu0BNEQQ5vYKssIWxQx3JNc1AqnbTFmg3qSoKmYz0mb//S7QDU1k5Vdu+VSnUFyA3aBES1ca9zkqb4PPVQUUVG74OVRfUNSqencXh+UR1sUnfqgy6+qLrVn75QThRt0I26VG0FU4dbRNfE1ULpqVVBIZBTN/kJ0PBDxY6QEbpp5v27JFCxI5xm1k3oIxT+Q+Wowgl93dIJhHzqVrW5erd0QrdIxUE8wFXxcL9IBXSlSRcLuSnq3NR+OZBq4ZWD1FXr8sn9wivVEjcPwtVuKtd6XOKmWUzoQeY/dCczHBcTKpZtnr2QB104gN70ukm+QNaHzBJV7DhbIAt/040ERMMXnbUDAwOtgvZVsUo0KaCi9Omib/SCqleKhE7KSsNIIt7IkFXoi40MSBrNO28X+ooHOKxWqPpuoVHRh7FDo3+pyHsorOZyG5R0w5kPUZmJffYFIrLhTLi1DzFJT0X+aWaZ3JGtfcJNlCvesTOuIpAcLBrdRIms5g4s+jFlM0PFPYY6ul1VtDG4PJzwqQHnGGpKKlA1fVKN0VqxX31Tx1DjOTBXaRFvs3vaWdkniPIEF3hdGgEmxpev0VpeHNf8ZuiROMBhet0hMch9qkogR2wXbeSojHI22jd5ifp1cLbY9dHB8NWhJCbOgkYzBxpFzxH3wu74F++ro8ckWsM7a5l7/IuzVnAxJX1MojGQ3shHslKCPPimY+b+jYfmU0qONPIOj5rzK9lDi33OyQttVpEaglXXMFoabQVmqny3QxaBW4opM3o4CtwDJazWGZtAUMi12ONkAtGMrNGS/1QI5yb+CxciLmc8EwoDKEokefK6CBKPRf47Mj/MEIujvv+MzA/6kKQLCR7y18q5Y8AjiWryrR1T9uwp/RqJ3YUdGWBxYUeR2RzN7gThn6ifCrtLaA7X/dwG4xtusvg+24uVihzKtr/Cqrh7OFPdcVlYcXItmyHS7x67ROwyxxTceAHegqsLHVOQ4WLH00sdE5DhUsev2IbaznR95gKrCnDGi0oXDOmTRrmvhP3i712+u+LvXXO84u9dKL2Cf3V33X7+i6u7N/y5S9IdvOvoF0G/19GP9tfR/wPQ21eEI8clLwAAAABJRU5ErkJggg==`;export{je as a,Ae as i,Ie as n,ke as r,Le as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./rolldown-runtime--c01j_DQ.js";import{Dt as n}from"./index-
|
|
1
|
+
import{o as e,t}from"./rolldown-runtime--c01j_DQ.js";import{Dt as n}from"./index-DPVeprbd.js";import{i as r,l as i,n as a,o,t as s}from"./lit-Czpkz5lw.js";import{a as c,i as l,n as u,o as d,r as f,t as p}from"./wui-text-IdpNh4yv.js";import{$ as m,G as h,H as g,J as _,K as v,Q as ee,U as y,W as b,X as x,Y as S,Z as C,a as w,et as te,g as T,i as ne,n as E,p as re,r as D,s as O,u as ie,v as ae}from"./ConstantsUtil-CiJQ7E9o.js";import{n as oe,t as se}from"./ConnectorUtil-BNHqGaBo.js";var ce=i`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
background-color: var(--wui-color-gray-glass-002);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Zr as e}from"./constants-C-bSXdJ_.js";import{An as t,On as n,_n as r,or as i,vn as a,yr as o}from"./index-
|
|
1
|
+
import{Zr as e}from"./constants-C-bSXdJ_.js";import{An as t,On as n,_n as r,or as i,vn as a,yr as o}from"./index-DPVeprbd.js";var s={namespaced:!0,state:i,mutations:{setModel:(e,t)=>{e.model=t},setModelGroup:(e,t)=>{e.modelGroup=t},setService:(e,t)=>{e.service=t},setCredential:(e,t)=>{e.credential=t},setConversations:(e,t)=>{e.conversations=t},setApplication:(e,t)=>{e.application=t},setApplications:(e,t)=>{e.applications=t},setPendingDraft:(e,t)=>{e.pendingDraft=t||``},resetAll:e=>{Object.assign(e,i())}},actions:{resetAll:({commit:e})=>{e(`resetAll`)},createCredential:async({commit:e,state:t})=>{let n=t.application;if(console.debug(`prepare to create credential for application for chat`,n),!n){console.error(`Application not found`);return}console.debug(`creating create credential for application for chat`,n);let{data:i}=await r.create({application_id:n?.id,host:window.location.origin});return console.debug(`created credential success`,i),e(`setCredential`,i),console.debug(`end createCredential`),i},setModel:async({commit:e},t)=>{e(`setModel`,t)},setModelGroup:async({commit:e},t)=>{e(`setModelGroup`,t)},getService:async({commit:t,state:n})=>{n.status.getService=o.Request;try{let{data:r}=await a.get(e);return n.status.getService=o.Success,t(`setService`,r),r}catch{n.status.getService=o.Error,t(`setService`,void 0)}},setService:async({commit:e},t)=>{console.debug(`set service for chat`,t),e(`setService`,t)},setCredential:async({commit:e},t)=>{console.debug(`set credential`,t),e(`setCredential`,t)},setApplication:async({commit:e,dispatch:t,rootState:n},r)=>{if(console.debug(`set application`,r),e(`setApplication`,r),console.debug(`application is set`),!r){console.debug(`application is null, return`);return}let i=n?.user?.id,a=r?.role===`grantee`,o=r?.credentials?.find(e=>e?.host===window.location.origin);!o&&a&&(o=r?.credentials?.find(e=>e?.user_id===i)),o?(console.debug(`credential exists, set credential`,o),e(`setCredential`,o)):a?(console.warn(`no credential available for granted application`,r),e(`setCredential`,void 0)):(console.debug(`credential not exists, start to create credential for application`,r),await t(`createCredential`))},setApplications:async({commit:e},t)=>{console.debug(`set applications for chat`,t),e(`setApplications`,t)},getApplications:async({commit:n,state:r})=>{console.debug(`start to get applications for chat`),r.status.getApplications=o.Request;try{let{data:i}=await t.getAll({user_id:`me`,service_id:e,affiliation:[`owner`,`granted`]});return console.debug(`get applications success for chat`,i),r.status.getApplications=o.Success,n(`setApplications`,i.items),console.debug(`set applications for chat`,i.items),i.items}catch(e){console.error(`get applications failed for chat`,e),r.status.getApplications=o.Error,n(`setApplications`,void 0),n(`setApplication`,void 0)}},setConversation:async({commit:e,state:t},n)=>{console.debug(`set conversation`,n);let r=t.conversations||[],i=r?.findIndex(e=>e.id===n.id);i>-1?r[i]=n:r?.unshift(n),e(`setConversations`,r),console.debug(`set conversation success`,r)},setConversations:async({commit:e},t)=>{console.debug(`set conversations`,t),e(`setConversations`,t)},getConversations:async({commit:e,state:t,rootState:r})=>{t.status.getConversations=o.Request;let i=t.credential?.token,a=t.modelGroup?.name;if(!i||!a)return t.status.getConversations=o.Error,e(`setConversations`,[]),[];try{let{data:s}=await n.getConversations({userId:r.user?.id,modelGroup:a},{token:i});return console.debug(`get conversations success`,s?.items?.length,`group=`,a),t.status.getConversations=o.Success,e(`setConversations`,s.items),s.items}catch{return t.status.getConversations=o.Error,e(`setConversations`,[]),[]}},getConversation:async({commit:e,state:t},r)=>{let i=t.credential?.token;if(!(!i||!r))try{let{data:a}=await n.getConversation(r,{token:i}),o=t.conversations||[],s=o.findIndex(e=>e.id===r),c=s>-1?{...o[s],...a}:a;if(s>-1){let t=[...o];t[s]=c,e(`setConversations`,t)}return c}catch(e){console.error(`getConversation failed`,r,e);return}}}};export{s as chat,s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as e,B as t,C as n,D as r,E as i,F as a,I as o,L as s,M as c,N as l,O as u,P as d,R as f,S as ee,T as te,_ as ne,a as p,b as m,c as h,d as g,f as _,fi as v,g as re,h as y,i as b,j as ie,k as x,l as S,m as C,n as w,o as T,p as E,r as D,s as O,t as k,u as A,v as j,w as M,x as N,y as P,z as F}from"./constants-C-bSXdJ_.js";import{Dr as I,Ln as L,Tr as R,Wt as z,yr as B}from"./index-
|
|
1
|
+
import{A as e,B as t,C as n,D as r,E as i,F as a,I as o,L as s,M as c,N as l,O as u,P as d,R as f,S as ee,T as te,_ as ne,a as p,b as m,c as h,d as g,f as _,fi as v,g as re,h as y,i as b,j as ie,k as x,l as S,m as C,n as w,o as T,p as E,r as D,s as O,t as k,u as A,v as j,w as M,x as N,y as P,z as F}from"./constants-C-bSXdJ_.js";import{Dr as I,Ln as L,Tr as R,Wt as z,yr as B}from"./index-DPVeprbd.js";import{a as ae,i as V,n as H,o as U,r as W}from"./codingBridgeNotify-BBLL2Ig7.js";var G=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID().replace(/-/g,``):`${Date.now().toString(16)}${Math.random().toString(16).slice(2)}`,K=()=>{try{return typeof localStorage<`u`&&localStorage.getItem(`cbDebug`)===`1`}catch{return!1}},q=(e,t)=>{if(!K())return;let n=t?.payload??{};console.debug(`[codingBridge]`,e,{type:t?.type,id:t?.id,node_id:t?.node_id??t?.from_node,action:n?.action,event:n?.event,session_id:n?.session_id,trace_id:n?.trace_id})},J=class{ws;token;handlers;reconnectDelay=t;reconnectTimer;closedByUser=!1;constructor(e,t){this.token=e,this.handlers=t}get isOpen(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.closedByUser=!1,this.open()}open(){if(this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))return;let e=`${v}?token=${encodeURIComponent(this.token)}`,n;try{n=new WebSocket(e)}catch(e){console.warn(`[codingBridge] failed to open socket`,e),this.scheduleReconnect();return}this.ws=n,n.onopen=()=>{this.reconnectDelay=t,this.handlers.onOpen?.()},n.onmessage=e=>this.onMessage(e),n.onclose=()=>{this.handlers.onClose?.(),this.closedByUser||this.scheduleReconnect()},n.onerror=()=>{n.close()}}onMessage(e){let t;try{t=JSON.parse(e.data)}catch{return}let n=t?.payload??{};switch(q(`recv`,t),t?.type){case f:this.handlers.onEvent?.(n,t?.from_node);break;case o:this.handlers.onNodesSnapshot?.(n.nodes??[]);break;case s:this.handlers.onNodeStatus?.(n.node_id,n.status);break;case y:this.handlers.onRelayError?.(n.code??`error`,n.message??``);break;default:break}}scheduleReconnect(){if(this.closedByUser||this.reconnectTimer)return;let e=this.reconnectDelay;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,this.open()},e),this.reconnectDelay=Math.min(this.reconnectDelay*2,F)}sendEnvelope(e,t){if(!this.isOpen)return;let n={v:2,id:G(),ts:Date.now(),type:e,...t};q(`send`,n),this.ws?.send(JSON.stringify(n))}sendToNode(e,t){this.sendEnvelope(C,{node_id:e,payload:t})}listNodes(){this.sendEnvelope(_,{})}resume(e){this.sendEnvelope(E,{payload:{resume_from:e}})}close(){if(this.closedByUser=!0,this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),void 0),this.ws){this.ws.onclose=null,this.ws.onerror=null,this.ws.onmessage=null,this.ws.onopen=null;try{this.ws.close()}catch{}this.ws=void 0}}},Y,X=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID().replace(/-/g,``):`${Date.now().toString(16)}${Math.random().toString(16).slice(2)}`,Z=(e,t,n)=>({id:X(),session_id:e,kind:t,ts:Date.now(),...n}),Q=e=>{try{let t=JSON.parse(e);if(t&&typeof t==`object`)return t}catch{}return{answers:{}}},oe=e=>{let t=Q(e).answers??{};return Object.entries(t).map(([e,t])=>`${e} → ${Array.isArray(t)?t.join(`, `):t}`).join(`
|
|
2
2
|
`)},se=(e,t)=>{H({title:`Approval needed`,body:`Claude wants to use ${t.tool||`a tool`}. Tap to review.`,data:t},t=>{t.node_id&&e(`selectNode`,t.node_id)})},ce=(t,o,s,f,p)=>{let h=f?.event,g=f?.session_id,_=f?.trace_id,v=f?.seq;if(typeof v==`number`&&g){let e=s.lastSeq[g];if(e!==void 0&&v<=e)return;t(`setLastSeq`,{session_id:g,seq:v})}switch(g&&_&&t(`updateSession`,{session_id:g,trace_id:_}),h){case x:t(`upsertSession`,{session_id:g,node_id:p,status:`running`,cwd:f.cwd,model:f.model,trace_id:_});break;case c:{let e=f.id;e&&s.events[g]?.find(t=>t.kind===`text`&&t.stream_id===e)?t(`appendDelta`,{session_id:g,stream_id:e,text:f.text??``}):t(`appendEvent`,Z(g,`text`,{text:f.text??``,stream_id:e,streaming:!0,trace_id:_}));break}case ie:{let e=f.id;e&&s.events[g]?.find(t=>t.kind===`text`&&t.stream_id===e)?t(`finalizeStream`,{session_id:g,stream_id:e,text:f.text}):t(`appendEvent`,Z(g,`text`,{text:f.text,trace_id:_}));break}case l:t(`appendEvent`,Z(g,`thinking`,{text:f.text,trace_id:_}));break;case a:t(`appendEvent`,Z(g,`tool_use`,{tool:f.tool,tool_use_id:f.tool_use_id,input:f.input,trace_id:_}));break;case d:t(`appendEvent`,Z(g,`tool_result`,{tool_use_id:f.tool_use_id,content:f.content,is_error:f.is_error,trace_id:_}));break;case N:t(`addPermission`,{request_id:f.request_id,session_id:g,node_id:p,tool:f.tool,input:f.input,title:f.title,display_name:f.display_name,description:f.description}),se(o,{node_id:p,session_id:g,request_id:f.request_id,tool:f.display_name||f.title||f.tool});break;case m:for(let e of f.requests??[])t(`addPermission`,{request_id:e.request_id,session_id:e.session_id,node_id:p,tool:e.tool,input:e.input,title:e.title,display_name:e.display_name,description:e.description});break;case ee:t(`removePermission`,f.request_id);break;case r:t(`finalizeAllStreams`,{session_id:g}),t(`appendEvent`,Z(g,`result`,{subtype:f.subtype,is_error:f.is_error,text:f.result,cost_usd:f.cost_usd,cut_uuid:f.cut_uuid,sdk_session_id:f.sdk_session_id,trace_id:_})),t(`updateSession`,{session_id:g,status:`idle`,cost_usd:f.cost_usd,...f.sdk_session_id?{sdk_session_id:f.sdk_session_id}:{}});break;case i:t(`appendEvent`,Z(g,`notice`,{text:f.text,subtype:f.code,command:f.command,level:f.level}));break;case te:t(`finalizeAllStreams`,{session_id:g}),t(`appendEvent`,Z(g,`error`,{text:f.message,trace_id:_})),t(`updateSession`,{session_id:g,status:`error`});break;case M:t(`finalizeAllStreams`,{session_id:g}),t(`updateSession`,{session_id:g,status:`closed`});break;case u:t(`rewindToCut`,{session_id:g,cut_uuid:f.cut_uuid}),f.prompt&&t(`appendEvent`,Z(g,`prompt`,{text:f.prompt,trace_id:_})),t(`updateSession`,{session_id:g,status:`running`});break;case e:o(`resyncSession`,g);break;case n:for(let e of f.sessions??[])t(`upsertSession`,{session_id:e.session_id,node_id:p,status:e.status??`idle`,cwd:e.cwd,model:e.model});break;case P:if(p){t(`setHistory`,{node_id:p,sessions:f.sessions??[]}),t(`updateStatus`,{key:`getHistory`,value:B.Success});let e=s.historyRef;e&&e.node_id===p&&!s.currentSessionId&&o(`getHistoryDetail`,e)}break;case j:le(t,f,p);break;case ne:t(`setDirectory`,{path:f.path,parent:f.parent??null,sep:f.sep??`/`,entries:f.entries??[],truncated:f.truncated,error:f.error});break;case re:p&&t(`setCapabilities`,{node_id:p,capabilities:{providers:f.providers??[]}});break;default:break}},le=(e,t,n)=>{let r=t?.session_id,i=t?.provider===`codex`?`codex`:`claude`;if(!r||!n)return;let a=i===`claude`;e(`upsertSession`,{session_id:r,node_id:n,status:`idle`,cwd:t.cwd,model:t.model,provider:i,started:!1,readonly:!a,resume_session_id:a?r:void 0}),e(`setEvents`,{session_id:r,events:(t.events??[]).map((e,t)=>({id:X(),session_id:r,kind:e.kind,ts:typeof e.ts==`number`?e.ts:Date.now()+t,text:e.text,tool:e.tool,tool_use_id:e.tool_use_id,input:e.input,content:e.content,is_error:e.is_error,subtype:e.subtype,cost_usd:e.cost_usd}))}),e(`setCurrentNode`,n),e(`setCurrentSession`,r),e(`setHistoryRef`,{node_id:n,provider:i,session_id:r})},$={namespaced:!0,state:L,mutations:{resetAll:e=>{Object.assign(e,L())},updateStatus:(e,t)=>{e.status[t.key]=t.value},setConnection:(e,t)=>{e.connection=t},setNodes:(e,t)=>{e.nodes=t},mergeNodeSnapshot:(e,t)=>{let n=new Set(t.map(e=>e.node_id));for(let t of e.nodes)t.status=n.has(t.node_id)?`online`:`offline`;for(let n of t)e.nodes.some(e=>e.node_id===n.node_id)||e.nodes.push({...n,status:`online`})},setNodeStatus:(e,t)=>{let n=e.nodes.find(e=>e.node_id===t.node_id);n&&(n.status=t.status)},setCurrentNode:(e,t)=>{e.currentNodeId=t},setCurrentSession:(e,t)=>{e.currentSessionId=t},upsertSession:(e,t)=>{e.sessions[t.session_id]={...e.sessions[t.session_id],...t},e.events[t.session_id]||(e.events[t.session_id]=[])},updateSession:(e,t)=>{let n=e.sessions[t.session_id];n&&(e.sessions[t.session_id]={...n,...t})},appendEvent:(e,t)=>{e.events[t.session_id]||(e.events[t.session_id]=[]),e.events[t.session_id].push(t)},truncateEventsBefore:(e,t)=>{let n=e.events[t.session_id];if(!n)return;let r=n.findIndex(e=>e.id===t.event_id);r>=0&&(e.events[t.session_id]=n.slice(0,r))},rewindToCut:(e,t)=>{let n=e.events[t.session_id];if(!n)return;if(!t.cut_uuid){e.events[t.session_id]=[];return}let r=n.findIndex(e=>e.kind===`result`&&e.cut_uuid===t.cut_uuid);r>=0&&(e.events[t.session_id]=n.slice(0,r+1))},setLastSeq:(e,t)=>{let n=e.lastSeq[t.session_id]??0;t.seq>n&&(e.lastSeq[t.session_id]=t.seq)},appendDelta:(e,t)=>{let n=e.events[t.session_id];if(!n)return;let r=n.find(e=>e.kind===`text`&&e.stream_id===t.stream_id);r&&(r.text=(r.text??``)+(t.text??``))},finalizeStream:(e,t)=>{let n=e.events[t.session_id];if(!n)return;let r=n.find(e=>e.kind===`text`&&e.stream_id===t.stream_id);r&&(typeof t.text==`string`&&(r.text=t.text),r.streaming=!1)},finalizeAllStreams:(e,t)=>{let n=e.events[t.session_id];if(n)for(let e of n)e.streaming&&=!1},setEvents:(e,t)=>{e.events[t.session_id]=t.events},setHistory:(e,t)=>{e.history[t.node_id]=t.sessions},setHistoryRef:(e,t)=>{e.historyRef=t},setDirectory:(e,t)=>{e.directory=t,e.directoryLoading=!1},setDirectoryLoading:(e,t)=>{e.directoryLoading=t},setLastComposer:(e,t)=>{e.lastComposer={...e.lastComposer,[t.node_id]:{...e.lastComposer[t.node_id],...t.prefs}}},setCapabilities:(e,t)=>{e.capabilities[t.node_id]=t.capabilities},addPermission:(e,t)=>{e.permissions.some(e=>e.request_id===t.request_id)||e.permissions.push(t)},removePermission:(e,t)=>{e.permissions=e.permissions.filter(e=>e.request_id!==t)},removeNodeData:(e,t)=>{delete e.history[t],delete e.capabilities[t],e.historyRef?.node_id===t&&(e.historyRef=void 0);for(let n of Object.values(e.sessions))n.node_id===t&&(delete e.sessions[n.session_id],delete e.events[n.session_id],delete e.lastSeq[n.session_id],e.currentSessionId===n.session_id&&(e.currentSessionId=void 0))}},actions:{resetAll:({commit:e})=>{e(`resetAll`)},getApplications:async()=>{},setApplication:async()=>{},getNodes:async({commit:e,rootState:t})=>{let n=t.token?.access;if(!n)return[];e(`updateStatus`,{key:`getNodes`,value:B.Request});try{let{data:t}=await z.getNodes({token:n});return e(`setNodes`,t.nodes??[]),e(`updateStatus`,{key:`getNodes`,value:B.Success}),t.nodes??[]}catch(t){throw e(`updateStatus`,{key:`getNodes`,value:B.Error}),t}},claimPair:async({commit:e,dispatch:t,rootState:n},r)=>{let i=n.token?.access;if(!i)throw Error(`not authenticated`);e(`updateStatus`,{key:`claimPair`,value:B.Request});try{let{data:n}=await z.claimPair(r.trim(),{token:i});return e(`updateStatus`,{key:`claimPair`,value:B.Success}),await t(`getNodes`),n.node_name}catch(t){throw e(`updateStatus`,{key:`claimPair`,value:B.Error}),t}},deleteNode:async({commit:e,dispatch:t,state:n,rootState:r},i)=>{let a=r.token?.access;if(!a)throw Error(`not authenticated`);e(`updateStatus`,{key:`deleteNode`,value:B.Request});try{await z.deleteNode(i,{token:a}),e(`removeNodeData`,i),n.currentNodeId===i&&(e(`setCurrentNode`,void 0),e(`setCurrentSession`,void 0)),e(`updateStatus`,{key:`deleteNode`,value:B.Success}),await t(`getNodes`)}catch(t){throw e(`updateStatus`,{key:`deleteNode`,value:B.Error}),t}},connect:({commit:e,dispatch:t,state:n,rootState:r})=>{let i=r.token?.access;i&&(Y?.isOpen||(Y?.close(),e(`setConnection`,`connecting`),Y=new J(i,{onOpen:()=>{e(`setConnection`,`connected`);let r={...n.lastSeq};Object.keys(r).length&&Y?.resume(r),n.currentNodeId&&(t(`getHistory`,n.currentNodeId),t(`getCapabilities`,n.currentNodeId),t(`requestPendingPermissions`,n.currentNodeId))},onClose:()=>e(`setConnection`,`disconnected`),onEvent:(r,i)=>ce(e,t,n,r,i),onNodesSnapshot:t=>{e(`mergeNodeSnapshot`,t)},onNodeStatus:(r,i)=>{e(`setNodeStatus`,{node_id:r,status:i}),i===`online`&&r===n.currentNodeId&&(t(`getHistory`,r),t(`getCapabilities`,r),t(`requestPendingPermissions`,r))},onRelayError:(e,t)=>console.warn(`[codingBridge] relay error`,e,t)}),Y.connect()))},disconnect:({commit:e})=>{Y?.close(),Y=void 0,e(`setConnection`,`disconnected`)},selectNode:({commit:e,dispatch:t,state:n},r)=>{if(e(`setCurrentNode`,r),!r){e(`setCurrentSession`,void 0);return}let i=Object.values(n.sessions).filter(e=>e.node_id===r).map(e=>e.session_id);e(`setCurrentSession`,i.length?i[i.length-1]:void 0),t(`getHistory`,r),t(`getCapabilities`,r),t(`requestPendingPermissions`,r)},requestPendingPermissions:({state:e},t)=>{let n=t??e.currentNodeId;!n||!Y||Y.sendToNode(n,{action:p})},enableNotifications:async({dispatch:e,rootState:t})=>{let n=t.token?.access;if(!n)return`unsupported`;if(I()){let t=await W(t=>{t?.node_id&&(e(`selectNode`,t.node_id),e(`requestPendingPermissions`,t.node_id))});return t?(await z.savePushSubscription({kind:R()?`apns`:`fcm`,token:t,ua:navigator.userAgent},{token:n}),`enabled`):`denied`}let r=await V();if(r===`unsupported`)return`unsupported`;if(r!==`granted`)return`denied`;try{let{data:e}=await z.getPushConfig();if(e.web_push_enabled&&e.vapid_public_key){let t=await ae(e.vapid_public_key);t&&await z.savePushSubscription({kind:`webpush`,subscription:t,ua:navigator.userAgent},{token:n})}}catch(e){console.warn(`[codingBridge] web push setup skipped`,e)}return`enabled`},disableNotifications:async({rootState:e})=>{let t=e.token?.access;if(I()||!t)return;let n=await U();if(n)try{await z.deletePushSubscription({endpoint:n},{token:t})}catch(e){console.warn(`[codingBridge] failed to deregister web push`,e)}},newSession:({commit:e})=>{e(`setCurrentSession`,void 0),e(`setHistoryRef`,void 0)},sendPrompt:({commit:e,state:t},n)=>{let r=t.currentNodeId,i=n.prompt?.trim(),a=n.images?.length?n.images:void 0,o=n.attachments?.length?n.attachments:void 0;if(!r||!Y||!i&&!a&&!o)return;let s=X(),c=t.currentSessionId,l=c?t.sessions[c]:void 0;if(!l||!l.started){let t=l?.provider||n.provider||`claude`;l?(c=l.session_id,e(`updateSession`,{session_id:c,status:`starting`,trace_id:s})):(c=X(),e(`upsertSession`,{session_id:c,node_id:r,status:`starting`,cwd:n.cwd,model:n.model,provider:t,trace_id:s}),e(`setCurrentSession`,c)),e(`appendEvent`,Z(c,`prompt`,{text:i,images:a,attachments:o,trace_id:s})),e(`updateSession`,{session_id:c,started:!0}),Y.sendToNode(r,{action:g,session_id:c,trace_id:s,prompt:i,cwd:n.cwd||l?.cwd||void 0,model:n.model||l?.model||void 0,permission_mode:n.permissionMode||`default`,provider:t,effort:n.effort||void 0,images:a,attachments:o,resume_session_id:l?.resume_session_id||void 0})}else e(`updateSession`,{session_id:c,trace_id:s}),e(`appendEvent`,Z(c,`prompt`,{text:i,images:a,attachments:o,trace_id:s})),e(`updateSession`,{session_id:c,status:`running`,model:n.model||void 0}),Y.sendToNode(r,{action:A,session_id:c,trace_id:s,prompt:i,model:n.model??``,images:a,attachments:o})},editPrompt:({commit:e,state:t},n)=>{let r=t.currentNodeId,i=t.currentSessionId,a=n.prompt?.trim();if(!r||!i||!Y||!a)return;let o=t.sessions[i],s=t.events[i]??[],c=s.findIndex(e=>e.id===n.eventId);if(!o||c<0)return;let l;for(let e=c-1;e>=0;e--)if(s[e].kind===`result`&&s[e].cut_uuid){l=s[e].cut_uuid;break}let u=n.images?.length?n.images:void 0,d=n.attachments?.length?n.attachments:void 0,f=X();e(`truncateEventsBefore`,{session_id:i,event_id:n.eventId}),e(`updateSession`,{session_id:i,status:`running`,trace_id:f,model:n.model||o.model||void 0}),e(`appendEvent`,Z(i,`prompt`,{text:a,images:u,attachments:d,trace_id:f})),Y.sendToNode(r,{action:h,session_id:i,trace_id:f,cut_uuid:l,prompt:a,model:n.model||o.model||void 0,permission_mode:n.permissionMode||void 0,effort:n.effort||void 0,images:u,attachments:d,restore_code:!!n.restoreCode})},retryLastPrompt:({commit:e,dispatch:t,state:n})=>{let r=n.currentSessionId;if(!r)return;let i=n.sessions[r],a=[...n.events[r]??[]].reverse().find(e=>e.kind===`prompt`);!i||!a||(e(`updateSession`,{session_id:r,started:!1}),t(`sendPrompt`,{prompt:a.text??``,cwd:i.cwd,model:i.model,provider:i.provider,images:a.images,attachments:a.attachments}))},interruptSession:({state:e})=>{let t=e.currentSessionId,n=e.currentNodeId;!t||!n||!Y||Y.sendToNode(n,{action:S,session_id:t})},closeSession:({commit:e,state:t},n)=>{let r=n??t.currentSessionId;if(!r)return;let i=t.sessions[r]?.node_id??t.currentNodeId;i&&Y&&Y.sendToNode(i,{action:O,session_id:r}),e(`updateSession`,{session_id:r,status:`closed`}),t.currentSessionId===r&&e(`setCurrentSession`,void 0)},resolvePermission:({commit:e,state:t},n)=>{let r=t.permissions.find(e=>e.request_id===n.request_id);r&&(Y?.sendToNode(r.node_id,{action:T,request_id:n.request_id,decision:n.decision}),e(`removePermission`,n.request_id))},answerQuestion:({commit:e,state:t},n)=>{let r=t.permissions.find(e=>e.request_id===n.request_id);r&&(Y?.sendToNode(r.node_id,{action:T,request_id:n.request_id,decision:`allow`,answer:Q(n.output),answer_text:oe(n.output)}),e(`removePermission`,n.request_id))},getHistory:({commit:e,state:t},n)=>{let r=n??t.currentNodeId;!r||!Y||(e(`updateStatus`,{key:`getHistory`,value:B.Request}),Y.sendToNode(r,{action:b,limit:200}))},getHistoryDetail:(e,t)=>{!t?.node_id||!t?.session_id||!Y||Y.sendToNode(t.node_id,{action:D,provider:t.provider,session_id:t.session_id})},resyncSession:({state:e,dispatch:t},n)=>{let r=e.sessions[n];r?.node_id&&t(`getHistoryDetail`,{node_id:r.node_id,session_id:n,provider:r.provider??`claude`})},browseDir:({commit:e,state:t},n)=>{let r=t.currentNodeId;!r||!Y||(e(`setDirectoryLoading`,!0),Y.sendToNode(r,{action:w,path:n||void 0}))},clearDirectory:({commit:e})=>{e(`setDirectory`,void 0)},getCapabilities:({state:e},t)=>{let n=t??e.currentNodeId;!n||!Y||Y.sendToNode(n,{action:k})}}};export{$ as codingBridge,$ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-
|
|
2
|
-
import{t as e}from"./preload-helper-zJ_50EbN.js";import{Dr as t}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-DxcVs2dQ.js","assets/index-DPVeprbd.js","assets/rolldown-runtime--c01j_DQ.js","assets/preload-helper-zJ_50EbN.js","assets/button-DWzbdjZV.js","assets/use-deprecated-CPfQu7wa.js","assets/vendor-chart-mdwpew_o.js","assets/install-ClulZuUd.js","assets/en-CpRrS3Ur.js","assets/runtime-Cvku-lF9.js","assets/constants-C-bSXdJ_.js","assets/vendor-axios-Ck2ffRoh.js","assets/vendor-vue-CCKiwo0U.js","assets/vendor-dayjs-C9ICuEWn.js","assets/use-dialog-Daprv7SC.js","assets/teleport-B3tPbGeJ.js","assets/aria-CQaCu-Fx.js","assets/event-BGnHezxC.js","assets/scroll-Dk1pKbmY.js","assets/vnode-BMVwTmkF.js","assets/use-aria-B1wQLdcx.js","assets/vendor-vue-router-ChMPprnO.js","assets/index-BLOAxTz6.css","assets/esm-DFflFti1.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-zJ_50EbN.js";import{Dr as t}from"./index-DPVeprbd.js";var n=`/sw.js`,r=()=>typeof window<`u`&&`Notification`in window,i=()=>typeof navigator<`u`&&`serviceWorker`in navigator,a=()=>i()&&`PushManager`in window,o=()=>r()?Notification.permission:`unsupported`,s=e=>{let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r},c=async()=>{if(!i())return null;try{return await navigator.serviceWorker.getRegistration(n)??await navigator.serviceWorker.register(n)}catch(e){return console.warn(`[codingBridge] service worker registration failed`,e),null}},l=async()=>{if(!r())return`unsupported`;if(Notification.permission!==`default`)return Notification.permission;try{return await Notification.requestPermission()}catch{return`denied`}},u=(e,n)=>{if(!(typeof document<`u`&&document.visibilityState===`visible`)){if(t()){d(e);return}if(!(!r()||Notification.permission!==`granted`))try{let t=new Notification(e.title,{body:e.body,tag:e.data.request_id||`coding-bridge-permission`,data:e.data});t.onclick=()=>{try{window.focus()}catch{}n?.(e.data),t.close()}}catch(e){console.warn(`[codingBridge] failed to raise local notification`,e)}}},d=async t=>{try{let{LocalNotifications:n}=await e(async()=>{let{LocalNotifications:e}=await import(`./esm-DxcVs2dQ.js`);return{LocalNotifications:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));if((await n.checkPermissions()).display!==`granted`&&(await n.requestPermissions()).display!==`granted`)return;await n.schedule({notifications:[{id:f(t.data.request_id||`permission`),title:t.title,body:t.body,extra:t.data}]})}catch(e){console.warn(`[codingBridge] native local notification failed`,e)}},f=e=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)%2147483e3},p=async e=>{if(!a()||!e||await l()!==`granted`)return null;let t=await c();if(!t)return null;try{return(await t.pushManager.getSubscription()??await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s(e)})).toJSON()}catch(e){return console.warn(`[codingBridge] web push subscribe failed`,e),null}},m=async()=>{if(!a())return null;let e=await(await c())?.pushManager.getSubscription();if(!e)return null;let t=e.endpoint;try{await e.unsubscribe()}catch{}return t},h=async n=>{if(!t())return null;try{let{PushNotifications:t}=await e(async()=>{let{PushNotifications:e}=await import(`./esm-DFflFti1.js`);return{PushNotifications:e}},__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));if((await t.requestPermissions()).receive!==`granted`)return null;let r=await new Promise(e=>{let n=setTimeout(()=>e(null),1e4);t.addListener(`registration`,t=>{clearTimeout(n),e(t.value)}),t.addListener(`registrationError`,()=>{clearTimeout(n),e(null)}),t.register()});return n&&t.addListener(`pushNotificationActionPerformed`,e=>{n(e.notification?.data??{})}),r}catch(e){return console.warn(`[codingBridge] native push registration failed`,e),null}};export{p as a,l as i,u as n,m as o,h as r,r as s,o as t};
|