@acedatacloud/nexior 3.16.0 → 3.16.1
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/{Auth-CNBDbT0N.js → Auth-BkuwlRoo.js} +1 -1
- package/dist/assets/{BotPlaceholder-wrUqwxwn.js → BotPlaceholder-DOhMSuSg.js} +1 -1
- package/dist/assets/{Callback-B97YzZfd.js → Callback-LTQJypAB.js} +1 -1
- package/dist/assets/{Console-DN-XIbtp.js → Console--z9Y3v_M.js} +1 -1
- package/dist/assets/{Conversation-ySuFUkkz.js → Conversation-Dq-9qyVg.js} +2 -2
- package/dist/assets/{CopyToClipboard-BEbsggaT.js → CopyToClipboard-BIu2bCpR.js} +1 -1
- package/dist/assets/{Detail-BMCXOPw6.js → Detail-ifZWQwqk.js} +1 -1
- package/dist/assets/{EditArray-DbG9Ri4G.js → EditArray-rKzAa6Wh.js} +1 -1
- package/dist/assets/{Extra-CniwhZyT.js → Extra-DoCcSdV7.js} +1 -1
- package/dist/assets/{FilePreview-Zsr8sVg4.js → FilePreview-Dzcap-lr.js} +1 -1
- package/dist/assets/{History-96RqrW7u.js → History-Ckw35no-.js} +1 -1
- package/dist/assets/{ImagePreview-CWQ70Tp6.js → ImagePreview-D_8VP_T0.js} +1 -1
- package/dist/assets/{ImageWrapper-cO6ZlZLt.js → ImageWrapper-ChQNPH-9.js} +1 -1
- package/dist/assets/{Index-CHNrKJix.js → Index-B5dKecAV.js} +1 -1
- package/dist/assets/{Index-Ch4bxXt1.js → Index-BIAryaS2.js} +1 -1
- package/dist/assets/{Index-dGfoRC0n.js → Index-BOtwcGZT.js} +1 -1
- package/dist/assets/{Index-DIXfVpin.js → Index-BXrOomgN.js} +1 -1
- package/dist/assets/{Index-DCdD63LF.js → Index-Bwl6xgRR.js} +1 -1
- package/dist/assets/{Index-Bc0VLKAI.js → Index-CkDSyVOt.js} +1 -1
- package/dist/assets/{Index-D8vv6FgT.js → Index-D0b-qid1.js} +1 -1
- package/dist/assets/{Index-9SsYRlzq.js → Index-DBml4as3.js} +1 -1
- package/dist/assets/{Index-D4uQk3xf.js → Index-DL6MtFfh.js} +1 -1
- package/dist/assets/{Index-DVd7DMyc.js → Index-DQOS0eHA.js} +1 -1
- package/dist/assets/{Index-Bhhix8sz.js → Index-DqM54IVU.js} +1 -1
- package/dist/assets/{Index-CAct8X70.js → Index-kBzxfovf.js} +1 -1
- package/dist/assets/{Index-d8zoF81Q.js → Index-pudkbDgQ.js} +1 -1
- package/dist/assets/{InfoIcon-Cu9nteOi.js → InfoIcon-D6PUDRo_.js} +1 -1
- package/dist/assets/{Invitees-CzrZg5CP.js → Invitees-BaMTYTou.js} +1 -1
- package/dist/assets/{List-DEOgj1g9.js → List-CqFdyLED.js} +1 -1
- package/dist/assets/{List-Bx_pD5-l.js → List-D3UbKccZ.js} +1 -1
- package/dist/assets/{List-B4zncx46.js → List-Y0x1Nxy5.js} +1 -1
- package/dist/assets/{Login-DIF29O8T.js → Login-Bi06eMin.js} +1 -1
- package/dist/assets/{Main-C4jFNKxR.js → Main-CQXFn9ty.js} +1 -1
- package/dist/assets/{Navigator-pEorQgaK.js → Navigator-ghNnzyAd.js} +1 -1
- package/dist/assets/{NoTasks-CN0Xtzxd.js → NoTasks-DWe30n2J.js} +1 -1
- package/dist/assets/{Pagination-DHmv5bxi.js → Pagination-Bf0Ix9ET.js} +1 -1
- package/dist/assets/{Status-DJ6IzasW.js → Status-DMSStC55.js} +1 -1
- package/dist/assets/{Subscribe-Dxuo77zK.js → Subscribe-5JYfDCXK.js} +1 -1
- package/dist/assets/{VideoPlayer-DYKUrPPj.js → VideoPlayer-dcpMk5wp.js} +1 -1
- package/dist/assets/{_Uint8Array-CHD4Y_mO.js → _Uint8Array-B4Ba1PVM.js} +1 -1
- package/dist/assets/{_baseClone-B7ednKLK.js → _baseClone-CP-pCuea.js} +1 -1
- package/dist/assets/{_baseIteratee-Cgizesz2.js → _baseIteratee-CWuQF0Pw.js} +1 -1
- package/dist/assets/{_initCloneObject-BqE7Da_v.js → _initCloneObject-BH7jWQ_I.js} +1 -1
- package/dist/assets/{castArray-uDXgTM1I.js → castArray-BHtbvzcE.js} +1 -1
- package/dist/assets/{debounce-DqPxSsTs.js → debounce-BD0Llk1h.js} +1 -1
- package/dist/assets/{distribution-B07q57RU.js → distribution-D3LHUbpf.js} +1 -1
- package/dist/assets/{dropdown-DNahd1Cl.js → dropdown-C1t8uY18.js} +1 -1
- package/dist/assets/{index-qYOPzHa3.js → index-4aBt5Vjx.js} +3 -3
- package/dist/assets/{index-Do4mf29F.js → index-B7dvDo-P.js} +1 -1
- package/dist/assets/{index-CUrIFq7s.js → index-BJ9sBisj.js} +1 -1
- package/dist/assets/{index-c6uS2eYO.js → index-BVisl222.js} +1 -1
- package/dist/assets/{index-BCSDQbp7.js → index-BpH4Ggsl.js} +1 -1
- package/dist/assets/{index-Ca_0PSe5.js → index-BsJuzfM9.js} +1 -1
- package/dist/assets/{index-CwoMR9Zh.js → index-BvYpsGFP.js} +1 -1
- package/dist/assets/{index-DNXXN3cK.js → index-C6hA5TWo.js} +1 -1
- package/dist/assets/{index-0D_fkmJi.js → index-CA6dWpXZ.js} +1 -1
- package/dist/assets/{index-BGZPjVvS.js → index-CJH_hr7w.js} +1 -1
- package/dist/assets/{index-CR-JJVSC.js → index-CNTA3A3f.js} +1 -1
- package/dist/assets/{index-ihRgEA1V.js → index-CXToY2-h.js} +1 -1
- package/dist/assets/{index-CZiG7xy4.js → index-CclW0Rit.js} +1 -1
- package/dist/assets/{index-CrPi685m.js → index-CjnHN7w2.js} +1 -1
- package/dist/assets/{index-MXxFmX5t.js → index-CvGE-1KG.js} +1 -1
- package/dist/assets/{index-C0KVUojO.js → index-D0mYfORH.js} +1 -1
- package/dist/assets/{index-B4ait4ZA.js → index-D4Nbe_d4.js} +1 -1
- package/dist/assets/{index-DqxOlx4F.js → index-DLQX8ces.js} +1 -1
- package/dist/assets/{index-INC-04VE.js → index-DeUpuRmm.js} +1 -1
- package/dist/assets/{index-DMk3kAFX.js → index-DffkKKNy.js} +1 -1
- package/dist/assets/{index-lcjelBxA.js → index-DhqaUZXu.js} +1 -1
- package/dist/assets/{index-D9rY4c7j.js → index-DsSgo1-j.js} +1 -1
- package/dist/assets/{index-C2rPB2WO.js → index-Dt3STBTu.js} +1 -1
- package/dist/assets/{index-Bwld9Tt3.js → index-DuzqMVIQ.js} +1 -1
- package/dist/assets/{index-DrA3YGrQ.js → index-S8RkxyHh.js} +1 -1
- package/dist/assets/{index-B1ZbY0SP.js → index-ThOzPa5J.js} +1 -1
- package/dist/assets/{index-BO6fi2jd.js → index-WvATVaSG.js} +1 -1
- package/dist/assets/{index-CaPw9RgB.js → index-cwwhbHoU.js} +1 -1
- package/dist/assets/{index-PFOP6Q8b.js → index-vSn3l9f9.js} +1 -1
- package/dist/assets/{index.es-2lOPsuAc.js → index.es-BOpBg0UI.js} +1 -1
- package/dist/assets/{isEqual-BOj-wF30.js → isEqual-Dbw7tVId.js} +1 -1
- package/dist/assets/{isPlainObject-CYkmV2Wf.js → isPlainObject-pRg19Jue.js} +1 -1
- package/dist/assets/{order-DB58Q-34.js → order-BnPp2oTp.js} +1 -1
- package/dist/assets/price-onQYeDGi.js +1 -0
- package/dist/assets/{strings-BS0KugmX.js → strings-JVRUlEcU.js} +1 -1
- package/dist/assets/{typescript-Bqm6wRd8.js → typescript-BDQzoLbE.js} +1 -1
- package/dist/assets/{use-form-item-BzJ-FpAT.js → use-form-item-CoynAZx1.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/price-BvNqCXqY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as S}from"./index.es-2lOPsuAc.js";import{E as I}from"./index-CrPi685m.js";import{E as O}from"./index-DqxOlx4F.js";import{d as v,h as b,b as m,t as n,k as t,r as T,j as u,l as s,o as a,ef as N,x as i,eg as q,eh as H,c4 as j,D as g,i as k,y as f,n as C,af as z,F as D,v as K,ei as J,dp as Q,dk as W}from"./index-qYOPzHa3.js";import{I as U}from"./InfoIcon-Cu9nteOi.js";import{E as A}from"./index-PFOP6Q8b.js";import{I as F}from"./ImagePreview-CWQ70Tp6.js";import{E as R}from"./index-DMk3kAFX.js";import{E}from"./index-B4ait4ZA.js";import{F as X}from"./FilePreview-Zsr8sVg4.js";import{E as Y}from"./index-MXxFmX5t.js";import{V as M}from"./VideoPlayer-DYKUrPPj.js";import{C as Z,N as x}from"./NoTasks-CN0Xtzxd.js";import{a as ee}from"./price-BvNqCXqY.js";import{C as te}from"./CopyToClipboard-BEbsggaT.js";import{E as oe}from"./index-Do4mf29F.js";import{E as se}from"./index-Ca_0PSe5.js";import{E as ne}from"./index-CUrIFq7s.js";import{B as ae}from"./BotPlaceholder-wrUqwxwn.js";import"./use-form-item-BzJ-FpAT.js";import"./index-r5W6hzzQ.js";import"./index-C0KVUojO.js";import"./index-C2rPB2WO.js";import"./typescript-Bqm6wRd8.js";import"./_baseClone-B7ednKLK.js";import"./_Uint8Array-CHD4Y_mO.js";import"./_initCloneObject-BqE7Da_v.js";import"./isEqual-BOj-wF30.js";import"./index-INC-04VE.js";import"./vue-plyr-QZFBikSk.js";import"./debounce-DqPxSsTs.js";import"./index-c6uS2eYO.js";const le=v({name:"LayoutLuma",components:{ElDrawer:O,ElButton:I,FontAwesomeIcon:S},data(){return{drawer:!1}}}),ie={class:"main"},re={class:"config"},ce={class:"result"};function me(e,o,p,h,w,y){const r=s("font-awesome-icon"),d=s("el-button"),c=s("el-drawer");return a(),m("div",ie,[n("div",re,[T(e.$slots,"config",{},void 0,!0)]),n("div",ce,[T(e.$slots,"result",{},void 0,!0)]),t(d,{round:"",class:"menu",onClick:o[0]||(o[0]=$=>e.drawer=!0)},{default:u(()=>[t(r,{icon:"fa-solid fa-magic"})]),_:1}),t(c,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"350px",class:"drawer"},{default:u(()=>[T(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=b(le,[["render",me],["__scopeId","data-v-dd0ea8bc"]]),de=v({name:"EnhancementSelector",components:{ElSwitch:A,InfoIcon:U},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug("set enhancement",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=N)}}),pe={class:"relative"},fe={class:"flex justify-between"},_e={class:"flex justify-start items-center"},he={class:"text-sm font-bold"},$e={class:"flex justify-end items-center"};function ge(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-switch");return a(),m("div",pe,[n("div",fe,[n("div",_e,[n("span",he,i(e.$t("luma.name.enhancement")),1),t(r,{content:e.$t("luma.description.enhancement")},null,8,["content"])]),n("div",$e,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.value=c),class:"value"},null,8,["modelValue"])])])])}const ve=b(de,[["render",ge]]),be=v({name:"CustomSelector",components:{ElSwitch:A,InfoIcon:U},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug("set custom",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=q)}}),we={class:"relative"},ye={class:"flex justify-between"},ke={class:"flex justify-start items-center"},Ee={class:"text-sm font-bold"},Ve={class:"flex justify-end items-center"};function Ue(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-switch");return a(),m("div",we,[n("div",ye,[n("div",ke,[n("span",Ee,i(e.$t("luma.name.custom")),1),t(r,{content:e.$t("luma.description.custom")},null,8,["content"])]),n("div",Ve,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.value=c),class:"value"},null,8,["modelValue"])])])])}const Se=b(be,[["render",Ue]]),Ie=v({name:"LoopSelector",components:{ElSwitch:A,InfoIcon:U},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug("set loop",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=H)}}),Le={class:"relative"},Ce={class:"flex justify-between"},Te={class:"flex justify-start items-center"},je={class:"text-sm font-bold"},Ae={class:"flex justify-end items-center"};function Re(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-switch");return a(),m("div",Le,[n("div",Ce,[n("div",Te,[n("span",je,i(e.$t("luma.name.loop")),1),t(r,{content:e.$t("luma.description.loop")},null,8,["content"])]),n("div",Ae,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.value=c),class:"value"},null,8,["modelValue"])])])])}const Ge=b(Ie,[["render",Re]]),Pe=v({name:"EndImage",components:{ElUpload:R,ElButton:I,ImagePreview:F,InfoIcon:U,FontAwesomeIcon:S},data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){E.warning(this.$t("luma.message.uploadReferencesExceed"))},onError(){E.error(this.$t("luma.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),ze={class:"relative"},De={class:"flex justify-between"},Fe={class:"flex justify-start items-center"},Me={class:"text-sm font-bold"};function Be(e,o,p,h,w,y){const r=s("info-icon"),d=s("image-preview"),c=s("font-awesome-icon"),$=s("el-button"),_=s("el-upload");return a(),m("div",ze,[n("div",De,[n("div",Fe,[n("span",Me,i(e.$t("luma.name.endImageUrl")),1),t(r,{content:e.$t("luma.description.endImageUrl")},null,8,["content"])])]),t(_,{"file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=l=>e.fileList=l),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.url&&l.percentage!==void 0?(a(),k(d,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:u(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(c,{icon:"fa-solid fa-upload",class:"icon mr-1"}),g(" "+i(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const Oe=b(Pe,[["render",Be],["__scopeId","data-v-7ab78c3e"]]),Ne=v({name:"StartImage",components:{ElUpload:R,ElButton:I,ImagePreview:F,InfoIcon:U,FontAwesomeIcon:S},data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("luma.message.uploadReferencesExceed"))},onError(){E.error(this.$t("luma.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),qe={class:"relative"},He={class:"flex justify-between"},Ke={class:"flex justify-start items-center"},Je={class:"text-sm font-bold"};function Qe(e,o,p,h,w,y){const r=s("info-icon"),d=s("image-preview"),c=s("font-awesome-icon"),$=s("el-button"),_=s("el-upload");return a(),m("div",qe,[n("div",He,[n("div",Ke,[n("span",Je,i(e.$t("luma.name.startImageUrl")),1),t(r,{content:e.$t("luma.description.startImageUrl")},null,8,["content"])])]),t(_,{"file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=l=>e.fileList=l),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.percentage!=null?(a(),k(d,{key:0,url:l.url||l.response.file_url,name:l.name,percentage:l.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:u(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(c,{icon:"fa-solid fa-upload",class:"icon mr-1"}),g(" "+i(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const We=b(Ne,[["render",Qe],["__scopeId","data-v-425a8cec"]]),Xe=v({name:"UploadVideo",components:{ElUpload:R,ElButton:I,InfoIcon:U,FilePreview:X,FontAwesomeIcon:S},data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){E.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){E.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const o=e.type==="video/mp4",p=e.size/1024/1024<10;return o?p?!0:(E.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(E.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_url:e,action:"extend"})},async onSuccess(){this.onSetVideoUrl()}}}),Ye={class:"relative"},Ze={class:"flex justify-between"},xe={class:"flex justify-start items-center"},et={class:"text-sm font-bold"};function tt(e,o,p,h,w,y){const r=s("info-icon"),d=s("file-preview"),c=s("font-awesome-icon"),$=s("el-button"),_=s("el-upload");return a(),m("div",Ye,[n("div",Ze,[n("div",xe,[n("span",et,i(e.$t("luma.name.videoUrl")),1),t(r,{content:e.$t("luma.description.videoUrl")},null,8,["content"])])]),t(_,{"file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=l=>e.fileList=l),accept:".mp4",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.percentage!=null?(a(),k(d,{key:0,url:l.url||l.response?.file_url,name:l.name,percentage:l.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:u(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(c,{icon:"fa-solid fa-upload",class:"icon mr-1"}),g(" "+i(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const ot=b(Xe,[["render",tt],["__scopeId","data-v-74e51526"]]),st="",nt=v({name:"PromptInput",components:{ElInput:Y,InfoIcon:U},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=st)}}),at={class:"field"},lt={class:"box"},it={class:"title font-bold"};function rt(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-input");return a(),m("div",at,[n("div",lt,[n("h2",it,i(e.$t("luma.name.prompt")),1),t(r,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),t(d,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt"),maxlength:2e3,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const ct=b(nt,[["render",rt],["__scopeId","data-v-e8284075"]]),mt=v({name:"ExtendFromInput",components:{VideoPlayer:M},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.luma?.config}}}),ut={class:"relative"},dt={class:"flex mb-2"},pt={class:"text-sm font-bold"};function ft(e,o,p,h,w,y){const r=s("video-player");return a(),m("div",ut,[n("div",dt,[n("span",pt,i(e.$t("luma.name.extend")),1)]),n("div",null,[e.config?.video_url?(a(),k(r,{key:0,src:e.config?.video_url},null,8,["src"])):f("",!0)])])}const _t=b(mt,[["render",ft]]),ht=v({name:"ConfigPanel",components:{LoopSelector:Ge,StartImageInput:We,EndImageInput:Oe,EnhancementSelector:ve,ElButton:I,FontAwesomeIcon:S,PromptInput:ct,ExtendFromInput:_t,CustomSelector:Se,UploadVideo:ot,Consumption:Z},emits:["generate"],computed:{config(){return this.$store.state.luma?.config},consumption(){return ee(this.config,this.service?.metadata?.price)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit("generate")}}}),$t={class:"flex flex-col h-full"},gt={class:"flex-1 overflow-y-auto p-[15px]"},vt={class:"flex flex-col items-center justify-center px-[15px] pb-[15px]"};function bt(e,o,p,h,w,y){const r=s("extend-from-input"),d=s("prompt-input"),c=s("custom-selector"),$=s("upload-video"),_=s("start-image-input"),l=s("end-image-input"),V=s("enhancement-selector"),L=s("loop-selector"),B=s("consumption"),G=s("font-awesome-icon"),P=s("el-button");return a(),m("div",$t,[n("div",gt,[e.config?.video_id||e.config?.video_url?(a(),k(r,{key:0,class:"mb-4"})):f("",!0),t(d,{class:"mb-4"}),e.config?.video_id?f("",!0):(a(),k(c,{key:1,class:"mb-4"})),e.config?.custom?(a(),k($,{key:2,class:"mb-4"})):f("",!0),!(e.config?.video_id||e.config?.video_url)&&!e.config?.custom?(a(),k(_,{key:3,class:"mb-4"})):f("",!0),t(l,{class:"mb-4"}),t(V,{class:"mb-4"}),t(L,{class:"mb-4"})]),n("div",vt,[t(B,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),k(P,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(G,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(a(),k(P,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(G,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])}const wt=b(ht,[["render",bt]]),yt=v({name:"TaskPreview",components:{ElImage:ne,CopyToClipboard:te,FontAwesomeIcon:S,ElAlert:se,VideoPlayer:M,ElTooltip:oe,ElButton:I},props:{modelValue:{type:Object,required:!0}},emits:["extend"],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{onExtend(e,o){console.debug("set config",o),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_id:o.video_id,prompt:o.prompt,action:"extend",thumbnail_url:o.thumbnail_url,video_url:o.video_url}),this.$emit("extend")},onDownload(e){window.open(e,"_blank")}}}),kt={class:"preview"},Et={class:"left"},Vt={class:"main"},Ut={class:"bot"},St={class:"datetime"},It={class:"info"},Lt={key:0,class:"prompt mt-2"},Ct={key:0},Tt={key:1},jt={key:0,class:C({content:!0,failed:!0})},At={key:0,class:"mb-4"},Rt={key:1,class:C({operations:!0,"mt-2":!0,"mb-4":!0})},Gt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Pt={key:1,class:C({content:!0})},zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Mt={key:2,class:C({content:!0})},Bt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ot(e,o,p,h,w,y){const r=s("el-image"),d=s("video-player"),c=s("el-button"),$=s("el-tooltip"),_=s("font-awesome-icon"),l=s("copy-to-clipboard"),V=s("el-alert");return a(),m("div",kt,[n("div",Et,[t(r,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),n("div",Vt,[n("div",Ut,[g(i(e.$t("luma.name.lumaBot"))+" ",1),n("span",St,i(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),n("div",It,[e.modelValue?.request?.prompt?(a(),m("p",Lt,[g(i(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?f("",!0):(a(),m("span",Ct," - ("+i(e.$t("luma.status.pending"))+") ",1)),e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"?(a(),m("span",Tt," - ("+i(e.$t("luma.status.processing"))+") ",1)):f("",!0)])):f("",!0)]),e.modelValue?.response?.success===!0?(a(),m("div",jt,[e.modelValue.response.video_url?(a(),m("div",At,[t(d,{src:e.modelValue.response.video_url},null,8,["src"])])):f("",!0),e.modelValue?.response&&!e.config?.custom?(a(),m("div",Rt,[t($,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:u(()=>[t(c,{type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=z(L=>e.onExtend(L,e.modelValue?.response),["stop"]))},{default:u(()=>[g(i(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),t($,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:u(()=>[t(c,{type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=z(L=>e.onDownload(e.modelValue?.response?.video_url),["stop"]))},{default:u(()=>[g(i(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):f("",!0),t(V,{closable:!1,class:"mt-2 success"},{default:u(()=>[n("p",Gt,[t(_,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(l,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):f("",!0),e.modelValue?.response?.state==="failed"||e.modelValue?.response?.success===!1?(a(),m("div",Pt,[t(V,{closable:!1,class:"failure"},{template:u(()=>[t(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:u(()=>[n("p",zt,[t(_,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(l,{content:e.modelValue?.id},null,8,["content"])]),n("p",Dt,[t(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+i(e.$t("luma.name.failureReason"))+": "+i(e.modelValue?.response?.error?.message)+" ",1),t(l,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),n("p",Ft,[t(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+i(e.$t("luma.name.traceId"))+": "+i(e.modelValue?.trace_id)+" ",1),t(l,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):f("",!0),!e.modelValue?.response||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"?(a(),m("div",Mt,[t(V,{closable:!1,class:"info"},{template:u(()=>[t(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:u(()=>[n("p",Bt,[t(_,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(l,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):f("",!0)])])}const Nt=b(yt,[["render",Ot],["__scopeId","data-v-1b4a59bc"]]),qt=v({name:"RecentPanel",components:{BotPlaceholder:ae,TaskPreview:Nt,NoTasks:x},emits:["reach-top","extend"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Ht={key:0},Kt={key:1,class:"tasks w-full h-full overflow-y-auto"},Jt={key:2,class:"w-full h-full flex items-center justify-center"};function Qt(e,o,p,h,w,y){const r=s("bot-placeholder"),d=s("task-preview"),c=s("no-tasks");return a(),m(D,null,[e.tasks?.items===void 0?(a(),m("div",Ht,[t(r)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),m("div",Kt,[(a(!0),m(D,null,K(e.tasks?.items,($,_)=>(a(),k(d,{key:_,"model-value":$,onExtend:o[0]||(o[0]=l=>e.$emit("extend"))},null,8,["model-value"]))),128))])):f("",!0),e.tasks?.items?.length===0?(a(),m("div",Jt,[t(c)])):f("",!0)],64)}const Wt=b(qt,[["render",Qt]]),Xt="https://webhook.acedata.cloud/luma",Yt=v({name:"LumaIndex",components:{ConfigPanel:wt,Layout:ue,RecentPanel:Wt},inject:["initialized"],emits:["extend"],data(){return{task:void 0,job:0}},computed:{loading(){return this.$store.state.luma?.status?.getApplications===W.Request},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){clearInterval(this.job)},methods:{async onReachTop(){console.debug("reached top"),await this.onGetTasks({createdAtMax:this.tasks?.items?.[0]?.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){console.debug("scrolling down"),setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:p,createdAtMax:h}=e||{};console.debug("limit",o,"createdAtMin",p,"createdAtMax",h),await this.$store.dispatch("luma/getTasks",{limit:o,createdAtMin:p,createdAtMax:h})},async onGenerate(){const e={...this.config,callback_url:Xt},o=this.credential?.token;if(!o){console.error("no token specified");return}E.info(this.$t("luma.message.startingTask")),J.generate(e,{token:o}).then(()=>{E.success(this.$t("luma.message.startTaskSuccess"))}).catch(p=>{p?.response?.data?.error?.code===Q?E.error(this.$t("luma.message.usedUp")):E.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Zt(e,o,p,h,w,y){const r=s("config-panel"),d=s("recent-panel"),c=s("layout");return a(),k(c,null,{config:u(()=>[t(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(d,{onReachTop:e.onReachTop,onExtend:o[0]||(o[0]=$=>e.$emit("extend"))},null,8,["onReachTop"])]),_:1})}const jo=b(Yt,[["render",Zt]]);export{jo as default};
|
|
1
|
+
import{F as S}from"./index.es-BOpBg0UI.js";import{E as I}from"./index-CjnHN7w2.js";import{E as O}from"./index-DLQX8ces.js";import{d as v,h as b,b as m,t as n,k as t,r as T,j as u,l as s,o as a,ef as N,x as i,eg as q,eh as H,c4 as j,D as g,i as k,y as f,n as C,af as z,F as D,v as K,ei as J,dp as Q,dk as W}from"./index-4aBt5Vjx.js";import{I as U}from"./InfoIcon-D6PUDRo_.js";import{E as A}from"./index-vSn3l9f9.js";import{I as F}from"./ImagePreview-D_8VP_T0.js";import{E as R}from"./index-DffkKKNy.js";import{E}from"./index-D4Nbe_d4.js";import{F as X}from"./FilePreview-Dzcap-lr.js";import{E as Y}from"./index-CvGE-1KG.js";import{V as M}from"./VideoPlayer-dcpMk5wp.js";import{C as Z,N as x}from"./NoTasks-DWe30n2J.js";import{a as ee}from"./price-onQYeDGi.js";import{C as te}from"./CopyToClipboard-BIu2bCpR.js";import{E as oe}from"./index-B7dvDo-P.js";import{E as se}from"./index-BsJuzfM9.js";import{E as ne}from"./index-BJ9sBisj.js";import{B as ae}from"./BotPlaceholder-DOhMSuSg.js";import"./use-form-item-CoynAZx1.js";import"./index-r5W6hzzQ.js";import"./index-D0mYfORH.js";import"./index-Dt3STBTu.js";import"./typescript-BDQzoLbE.js";import"./_baseClone-CP-pCuea.js";import"./_Uint8Array-B4Ba1PVM.js";import"./_initCloneObject-BH7jWQ_I.js";import"./isEqual-Dbw7tVId.js";import"./index-DeUpuRmm.js";import"./vue-plyr-QZFBikSk.js";import"./debounce-BD0Llk1h.js";import"./index-BVisl222.js";const le=v({name:"LayoutLuma",components:{ElDrawer:O,ElButton:I,FontAwesomeIcon:S},data(){return{drawer:!1}}}),ie={class:"main"},re={class:"config"},ce={class:"result"};function me(e,o,p,h,w,y){const r=s("font-awesome-icon"),d=s("el-button"),c=s("el-drawer");return a(),m("div",ie,[n("div",re,[T(e.$slots,"config",{},void 0,!0)]),n("div",ce,[T(e.$slots,"result",{},void 0,!0)]),t(d,{round:"",class:"menu",onClick:o[0]||(o[0]=$=>e.drawer=!0)},{default:u(()=>[t(r,{icon:"fa-solid fa-magic"})]),_:1}),t(c,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"350px",class:"drawer"},{default:u(()=>[T(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=b(le,[["render",me],["__scopeId","data-v-dd0ea8bc"]]),de=v({name:"EnhancementSelector",components:{ElSwitch:A,InfoIcon:U},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug("set enhancement",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=N)}}),pe={class:"relative"},fe={class:"flex justify-between"},_e={class:"flex justify-start items-center"},he={class:"text-sm font-bold"},$e={class:"flex justify-end items-center"};function ge(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-switch");return a(),m("div",pe,[n("div",fe,[n("div",_e,[n("span",he,i(e.$t("luma.name.enhancement")),1),t(r,{content:e.$t("luma.description.enhancement")},null,8,["content"])]),n("div",$e,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.value=c),class:"value"},null,8,["modelValue"])])])])}const ve=b(de,[["render",ge]]),be=v({name:"CustomSelector",components:{ElSwitch:A,InfoIcon:U},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug("set custom",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=q)}}),we={class:"relative"},ye={class:"flex justify-between"},ke={class:"flex justify-start items-center"},Ee={class:"text-sm font-bold"},Ve={class:"flex justify-end items-center"};function Ue(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-switch");return a(),m("div",we,[n("div",ye,[n("div",ke,[n("span",Ee,i(e.$t("luma.name.custom")),1),t(r,{content:e.$t("luma.description.custom")},null,8,["content"])]),n("div",Ve,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.value=c),class:"value"},null,8,["modelValue"])])])])}const Se=b(be,[["render",Ue]]),Ie=v({name:"LoopSelector",components:{ElSwitch:A,InfoIcon:U},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug("set loop",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=H)}}),Le={class:"relative"},Ce={class:"flex justify-between"},Te={class:"flex justify-start items-center"},je={class:"text-sm font-bold"},Ae={class:"flex justify-end items-center"};function Re(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-switch");return a(),m("div",Le,[n("div",Ce,[n("div",Te,[n("span",je,i(e.$t("luma.name.loop")),1),t(r,{content:e.$t("luma.description.loop")},null,8,["content"])]),n("div",Ae,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.value=c),class:"value"},null,8,["modelValue"])])])])}const Ge=b(Ie,[["render",Re]]),Pe=v({name:"EndImage",components:{ElUpload:R,ElButton:I,ImagePreview:F,InfoIcon:U,FontAwesomeIcon:S},data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){E.warning(this.$t("luma.message.uploadReferencesExceed"))},onError(){E.error(this.$t("luma.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),ze={class:"relative"},De={class:"flex justify-between"},Fe={class:"flex justify-start items-center"},Me={class:"text-sm font-bold"};function Be(e,o,p,h,w,y){const r=s("info-icon"),d=s("image-preview"),c=s("font-awesome-icon"),$=s("el-button"),_=s("el-upload");return a(),m("div",ze,[n("div",De,[n("div",Fe,[n("span",Me,i(e.$t("luma.name.endImageUrl")),1),t(r,{content:e.$t("luma.description.endImageUrl")},null,8,["content"])])]),t(_,{"file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=l=>e.fileList=l),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.url&&l.percentage!==void 0?(a(),k(d,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:u(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(c,{icon:"fa-solid fa-upload",class:"icon mr-1"}),g(" "+i(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const Oe=b(Pe,[["render",Be],["__scopeId","data-v-7ab78c3e"]]),Ne=v({name:"StartImage",components:{ElUpload:R,ElButton:I,ImagePreview:F,InfoIcon:U,FontAwesomeIcon:S},data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("luma.message.uploadReferencesExceed"))},onError(){E.error(this.$t("luma.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),qe={class:"relative"},He={class:"flex justify-between"},Ke={class:"flex justify-start items-center"},Je={class:"text-sm font-bold"};function Qe(e,o,p,h,w,y){const r=s("info-icon"),d=s("image-preview"),c=s("font-awesome-icon"),$=s("el-button"),_=s("el-upload");return a(),m("div",qe,[n("div",He,[n("div",Ke,[n("span",Je,i(e.$t("luma.name.startImageUrl")),1),t(r,{content:e.$t("luma.description.startImageUrl")},null,8,["content"])])]),t(_,{"file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=l=>e.fileList=l),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.percentage!=null?(a(),k(d,{key:0,url:l.url||l.response.file_url,name:l.name,percentage:l.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:u(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(c,{icon:"fa-solid fa-upload",class:"icon mr-1"}),g(" "+i(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const We=b(Ne,[["render",Qe],["__scopeId","data-v-425a8cec"]]),Xe=v({name:"UploadVideo",components:{ElUpload:R,ElButton:I,InfoIcon:U,FilePreview:X,FontAwesomeIcon:S},data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){E.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){E.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const o=e.type==="video/mp4",p=e.size/1024/1024<10;return o?p?!0:(E.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(E.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_url:e,action:"extend"})},async onSuccess(){this.onSetVideoUrl()}}}),Ye={class:"relative"},Ze={class:"flex justify-between"},xe={class:"flex justify-start items-center"},et={class:"text-sm font-bold"};function tt(e,o,p,h,w,y){const r=s("info-icon"),d=s("file-preview"),c=s("font-awesome-icon"),$=s("el-button"),_=s("el-upload");return a(),m("div",Ye,[n("div",Ze,[n("div",xe,[n("span",et,i(e.$t("luma.name.videoUrl")),1),t(r,{content:e.$t("luma.description.videoUrl")},null,8,["content"])])]),t(_,{"file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=l=>e.fileList=l),accept:".mp4",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.percentage!=null?(a(),k(d,{key:0,url:l.url||l.response?.file_url,name:l.name,percentage:l.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:u(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(c,{icon:"fa-solid fa-upload",class:"icon mr-1"}),g(" "+i(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const ot=b(Xe,[["render",tt],["__scopeId","data-v-74e51526"]]),st="",nt=v({name:"PromptInput",components:{ElInput:Y,InfoIcon:U},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=st)}}),at={class:"field"},lt={class:"box"},it={class:"title font-bold"};function rt(e,o,p,h,w,y){const r=s("info-icon"),d=s("el-input");return a(),m("div",at,[n("div",lt,[n("h2",it,i(e.$t("luma.name.prompt")),1),t(r,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),t(d,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt"),maxlength:2e3,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const ct=b(nt,[["render",rt],["__scopeId","data-v-e8284075"]]),mt=v({name:"ExtendFromInput",components:{VideoPlayer:M},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.luma?.config}}}),ut={class:"relative"},dt={class:"flex mb-2"},pt={class:"text-sm font-bold"};function ft(e,o,p,h,w,y){const r=s("video-player");return a(),m("div",ut,[n("div",dt,[n("span",pt,i(e.$t("luma.name.extend")),1)]),n("div",null,[e.config?.video_url?(a(),k(r,{key:0,src:e.config?.video_url},null,8,["src"])):f("",!0)])])}const _t=b(mt,[["render",ft]]),ht=v({name:"ConfigPanel",components:{LoopSelector:Ge,StartImageInput:We,EndImageInput:Oe,EnhancementSelector:ve,ElButton:I,FontAwesomeIcon:S,PromptInput:ct,ExtendFromInput:_t,CustomSelector:Se,UploadVideo:ot,Consumption:Z},emits:["generate"],computed:{config(){return this.$store.state.luma?.config},consumption(){return ee(this.config,this.service?.metadata?.price)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit("generate")}}}),$t={class:"flex flex-col h-full"},gt={class:"flex-1 overflow-y-auto p-[15px]"},vt={class:"flex flex-col items-center justify-center px-[15px] pb-[15px]"};function bt(e,o,p,h,w,y){const r=s("extend-from-input"),d=s("prompt-input"),c=s("custom-selector"),$=s("upload-video"),_=s("start-image-input"),l=s("end-image-input"),V=s("enhancement-selector"),L=s("loop-selector"),B=s("consumption"),G=s("font-awesome-icon"),P=s("el-button");return a(),m("div",$t,[n("div",gt,[e.config?.video_id||e.config?.video_url?(a(),k(r,{key:0,class:"mb-4"})):f("",!0),t(d,{class:"mb-4"}),e.config?.video_id?f("",!0):(a(),k(c,{key:1,class:"mb-4"})),e.config?.custom?(a(),k($,{key:2,class:"mb-4"})):f("",!0),!(e.config?.video_id||e.config?.video_url)&&!e.config?.custom?(a(),k(_,{key:3,class:"mb-4"})):f("",!0),t(l,{class:"mb-4"}),t(V,{class:"mb-4"}),t(L,{class:"mb-4"})]),n("div",vt,[t(B,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),k(P,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(G,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(a(),k(P,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(G,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])}const wt=b(ht,[["render",bt]]),yt=v({name:"TaskPreview",components:{ElImage:ne,CopyToClipboard:te,FontAwesomeIcon:S,ElAlert:se,VideoPlayer:M,ElTooltip:oe,ElButton:I},props:{modelValue:{type:Object,required:!0}},emits:["extend"],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{onExtend(e,o){console.debug("set config",o),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_id:o.video_id,prompt:o.prompt,action:"extend",thumbnail_url:o.thumbnail_url,video_url:o.video_url}),this.$emit("extend")},onDownload(e){window.open(e,"_blank")}}}),kt={class:"preview"},Et={class:"left"},Vt={class:"main"},Ut={class:"bot"},St={class:"datetime"},It={class:"info"},Lt={key:0,class:"prompt mt-2"},Ct={key:0},Tt={key:1},jt={key:0,class:C({content:!0,failed:!0})},At={key:0,class:"mb-4"},Rt={key:1,class:C({operations:!0,"mt-2":!0,"mb-4":!0})},Gt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Pt={key:1,class:C({content:!0})},zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Mt={key:2,class:C({content:!0})},Bt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ot(e,o,p,h,w,y){const r=s("el-image"),d=s("video-player"),c=s("el-button"),$=s("el-tooltip"),_=s("font-awesome-icon"),l=s("copy-to-clipboard"),V=s("el-alert");return a(),m("div",kt,[n("div",Et,[t(r,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),n("div",Vt,[n("div",Ut,[g(i(e.$t("luma.name.lumaBot"))+" ",1),n("span",St,i(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),n("div",It,[e.modelValue?.request?.prompt?(a(),m("p",Lt,[g(i(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?f("",!0):(a(),m("span",Ct," - ("+i(e.$t("luma.status.pending"))+") ",1)),e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"?(a(),m("span",Tt," - ("+i(e.$t("luma.status.processing"))+") ",1)):f("",!0)])):f("",!0)]),e.modelValue?.response?.success===!0?(a(),m("div",jt,[e.modelValue.response.video_url?(a(),m("div",At,[t(d,{src:e.modelValue.response.video_url},null,8,["src"])])):f("",!0),e.modelValue?.response&&!e.config?.custom?(a(),m("div",Rt,[t($,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:u(()=>[t(c,{type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=z(L=>e.onExtend(L,e.modelValue?.response),["stop"]))},{default:u(()=>[g(i(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),t($,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:u(()=>[t(c,{type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=z(L=>e.onDownload(e.modelValue?.response?.video_url),["stop"]))},{default:u(()=>[g(i(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):f("",!0),t(V,{closable:!1,class:"mt-2 success"},{default:u(()=>[n("p",Gt,[t(_,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(l,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):f("",!0),e.modelValue?.response?.state==="failed"||e.modelValue?.response?.success===!1?(a(),m("div",Pt,[t(V,{closable:!1,class:"failure"},{template:u(()=>[t(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:u(()=>[n("p",zt,[t(_,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(l,{content:e.modelValue?.id},null,8,["content"])]),n("p",Dt,[t(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+i(e.$t("luma.name.failureReason"))+": "+i(e.modelValue?.response?.error?.message)+" ",1),t(l,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),n("p",Ft,[t(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+i(e.$t("luma.name.traceId"))+": "+i(e.modelValue?.trace_id)+" ",1),t(l,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):f("",!0),!e.modelValue?.response||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"?(a(),m("div",Mt,[t(V,{closable:!1,class:"info"},{template:u(()=>[t(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:u(()=>[n("p",Bt,[t(_,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i(e.modelValue?.id)+" ",1),t(l,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):f("",!0)])])}const Nt=b(yt,[["render",Ot],["__scopeId","data-v-1b4a59bc"]]),qt=v({name:"RecentPanel",components:{BotPlaceholder:ae,TaskPreview:Nt,NoTasks:x},emits:["reach-top","extend"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Ht={key:0},Kt={key:1,class:"tasks w-full h-full overflow-y-auto"},Jt={key:2,class:"w-full h-full flex items-center justify-center"};function Qt(e,o,p,h,w,y){const r=s("bot-placeholder"),d=s("task-preview"),c=s("no-tasks");return a(),m(D,null,[e.tasks?.items===void 0?(a(),m("div",Ht,[t(r)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),m("div",Kt,[(a(!0),m(D,null,K(e.tasks?.items,($,_)=>(a(),k(d,{key:_,"model-value":$,onExtend:o[0]||(o[0]=l=>e.$emit("extend"))},null,8,["model-value"]))),128))])):f("",!0),e.tasks?.items?.length===0?(a(),m("div",Jt,[t(c)])):f("",!0)],64)}const Wt=b(qt,[["render",Qt]]),Xt="https://webhook.acedata.cloud/luma",Yt=v({name:"LumaIndex",components:{ConfigPanel:wt,Layout:ue,RecentPanel:Wt},inject:["initialized"],emits:["extend"],data(){return{task:void 0,job:0}},computed:{loading(){return this.$store.state.luma?.status?.getApplications===W.Request},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){clearInterval(this.job)},methods:{async onReachTop(){console.debug("reached top"),await this.onGetTasks({createdAtMax:this.tasks?.items?.[0]?.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){console.debug("scrolling down"),setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:p,createdAtMax:h}=e||{};console.debug("limit",o,"createdAtMin",p,"createdAtMax",h),await this.$store.dispatch("luma/getTasks",{limit:o,createdAtMin:p,createdAtMax:h})},async onGenerate(){const e={...this.config,callback_url:Xt},o=this.credential?.token;if(!o){console.error("no token specified");return}E.info(this.$t("luma.message.startingTask")),J.generate(e,{token:o}).then(()=>{E.success(this.$t("luma.message.startTaskSuccess"))}).catch(p=>{p?.response?.data?.error?.code===Q?E.error(this.$t("luma.message.usedUp")):E.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Zt(e,o,p,h,w,y){const r=s("config-panel"),d=s("recent-panel"),c=s("layout");return a(),k(c,null,{config:u(()=>[t(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(d,{onReachTop:e.onReachTop,onExtend:o[0]||(o[0]=$=>e.$emit("extend"))},null,8,["onReachTop"])]),_:1})}const jo=b(Yt,[["render",Zt]]);export{jo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E,a as T,b as D}from"./EditArray-
|
|
1
|
+
import{E,a as T,b as D}from"./EditArray-rKzAa6Wh.js";import{d as F,H as U,h as V,i as q,j as s,k as t,l as n,t as l,x as o,D as m,b as I,v as A,F as _,o as w,J as k,y as j,K as C}from"./index-4aBt5Vjx.js";import{E as B,a as L}from"./index-CXToY2-h.js";import{E as N}from"./index-vSn3l9f9.js";import{E as R,a as K,b as O}from"./index-CJH_hr7w.js";import{E as Q}from"./index-BJ9sBisj.js";import{E as H}from"./index-BpH4Ggsl.js";import"./index-CjnHN7w2.js";import"./use-form-item-CoynAZx1.js";import"./index-r5W6hzzQ.js";import"./index-CvGE-1KG.js";import"./typescript-BDQzoLbE.js";import"./index-D0mYfORH.js";import"./index-DeUpuRmm.js";import"./index.es-BOpBg0UI.js";import"./index-DffkKKNy.js";import"./index-Dt3STBTu.js";import"./_baseClone-CP-pCuea.js";import"./_Uint8Array-B4Ba1PVM.js";import"./_initCloneObject-BH7jWQ_I.js";import"./isEqual-Dbw7tVId.js";import"./index-D4Nbe_d4.js";import"./castArray-BHtbvzcE.js";import"./debounce-BD0Llk1h.js";const J=F({name:"SiteIndex",components:{EditText:D,EditImage:T,EditArray:E,ElDivider:H,ElRow:O,ElImage:Q,ElCol:K,ElCard:R,ElForm:L,ElSwitch:N,ElFormItem:B},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){const a={...this.site,...e};U.update(this.site?.id,a).then(()=>{console.debug("getSite for id",this.site?.id),this.$store.dispatch("getSite")})}}}),W={class:"title"},z={class:"title"},G={class:"block w-full"},M={class:"block tip"},P={class:"block w-full"},X={class:"block tip"},Y={class:"block w-full"},Z={class:"block tip"},x={class:"block w-full"},ee={class:"block tip"},te={class:"block w-full"},ie={class:"block tip"},se={class:"title"},le={class:"block w-full"},oe={class:"block tip"},ae={class:"block w-full"},de={class:"block tip"},ne={class:"title"},re={class:"block tip"},me={class:"block tip"},pe={class:"title"},ue={class:"w-full"},fe={class:"block tip w-full"},be={key:0},ve={class:"block w-full"},he={class:"block w-full"};function ce(e,a,$e,ge,we,ke){const f=n("el-col"),h=n("el-row"),p=n("el-divider"),d=n("el-form-item"),u=n("edit-text"),c=n("el-image"),$=n("edit-image"),y=n("edit-array"),b=n("el-form"),v=n("el-card"),g=n("el-switch");return w(),q(h,{class:"panel"},{default:s(()=>[t(f,{span:24},{default:s(()=>[t(h,null,{default:s(()=>[t(f,{span:24},{default:s(()=>[l("h2",W,o(e.$t("common.title.site")),1)]),_:1})]),_:1}),t(h,{gutter:15},{default:s(()=>[t(f,{md:12,xs:24},{default:s(()=>[t(v,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",z,o(e.$t("site.title.basicConfig")),1),t(p),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.origin")},{default:s(()=>[l("span",G,o(e.site.origin),1),l("span",M,o(e.$t("site.message.originTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.title")},{default:s(()=>[l("span",P,[m(o(e.site.title)+" ",1),t(u,{"model-value":e.site.title,title:e.$t("site.title.editTitle"),placeholder:e.$t("site.placeholder.title"),onConfirm:a[0]||(a[0]=i=>e.onSave({title:i}))},null,8,["model-value","title","placeholder"])]),l("span",X,o(e.$t("site.message.titleTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.logo")},{default:s(()=>[l("span",Y,[t(c,{src:e.site.logo,class:"logo"},null,8,["src"]),t($,{"model-value":e.site.logo,title:e.$t("site.title.editLogo"),tip:e.$t("site.message.editLogoTip"),onConfirm:a[1]||(a[1]=i=>e.onSave({logo:i}))},null,8,["model-value","title","tip"])]),l("span",Z,o(e.$t("site.message.logoTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.favicon")},{default:s(()=>[l("span",x,[t(c,{src:e.site.favicon,class:"favicon"},null,8,["src"]),t($,{"model-value":e.site.favicon,title:e.$t("site.title.editFavicon"),tip:e.$t("site.message.editFaviconTip"),onConfirm:a[2]||(a[2]=i=>e.onSave({favicon:i}))},null,8,["model-value","title","tip"])]),l("span",ee,o(e.$t("site.message.faviconTip")),1)]),_:1},8,["label"]),t(p,{"border-style":"dashed"}),t(d,{label:e.$t("site.field.admins")},{default:s(()=>[l("span",te,[m(o(e.site.admins?.join(", "))+" ",1),t(y,{"model-value":e.site?.admins||[],title:e.$t("site.title.editAdmins"),placeholder:e.$t("site.placeholder.admins"),tip:e.$t("site.message.adminsTip2"),min:1,"min-error-message":e.$t("site.message.atLeastOneAdmin"),onConfirm:a[3]||(a[3]=i=>e.onSave({admins:i}))},null,8,["model-value","title","placeholder","tip","min-error-message"])]),l("span",ie,o(e.$t("site.message.adminsTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),t(v,{shadow:"hover"},{default:s(()=>[l("h4",se,o(e.$t("site.title.seoConfig")),1),t(p),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.description")},{default:s(()=>[l("span",le,[m(o(e.site.description)+" ",1),t(u,{"model-value":e.site.description,title:e.$t("site.title.editDescription"),placeholder:e.$t("site.placeholder.description"),onConfirm:a[4]||(a[4]=i=>e.onSave({description:i}))},null,8,["model-value","title","placeholder"])]),l("span",oe,o(e.$t("site.message.descriptionTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.keywords")},{default:s(()=>[l("span",ae,[m(o(e.site.keywords?.join(", "))+" ",1),t(y,{"model-value":e.site?.keywords||[],title:e.$t("site.title.editKeywords"),placeholder:e.$t("site.placeholder.keywords"),tip:e.$t("site.message.keywordsTip2"),onConfirm:a[5]||(a[5]=i=>e.onSave({keywords:i}))},null,8,["model-value","title","placeholder","tip"])]),l("span",de,o(e.$t("site.message.keywordsTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1}),t(f,{md:12,xs:24},{default:s(()=>[t(v,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",ne,o(e.$t("site.title.distributionConfig")),1),t(p),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.distributionDefaultInviterId")},{default:s(()=>[m(o(e.site.distribution?.default_inviter_id)+" ",1),t(u,{"model-value":e.site.distribution?.default_inviter_id,title:e.$t("site.title.editDistributionDefaultInviterId"),placeholder:e.$t("site.placeholder.editDistributionDefaultInviterId"),onConfirm:a[6]||(a[6]=i=>e.onSave({distribution:{...e.site.distribution,default_inviter_id:i}}))},null,8,["model-value","title","placeholder"]),l("span",re,o(e.$t("site.message.distributionDefaultInviterIdTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.distributionForceInviterId")},{default:s(()=>[m(o(e.site.distribution?.force_inviter_id)+" ",1),t(u,{"model-value":e.site.distribution?.force_inviter_id,title:e.$t("site.title.editDistributionForceInviterId"),placeholder:e.$t("site.placeholder.editDistributionForceInviterId"),onConfirm:a[7]||(a[7]=i=>e.onSave({distribution:{...e.site.distribution,force_inviter_id:i}}))},null,8,["model-value","title","placeholder"]),l("span",me,o(e.$t("site.message.distributionForceInviterIdTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),t(v,{shadow:"hover"},{default:s(()=>[l("h4",pe,o(e.$t("site.title.featuresConfig")),1),t(p),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[(w(),I(_,null,A(["chat","midjourney","qrart","suno","luma","pika","kling","flux","hailuo","headshots","support"],(i,S)=>t(d,{key:S,label:e.$t("site.field.features"+i.charAt(0).toUpperCase()+i.slice(1))},{default:s(()=>[l("div",ue,[t(g,{"model-value":e.site.features[i]?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],enabled:r}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),l("span",fe,o(e.$t("site.message.features"+i.charAt(0).toUpperCase()+i.slice(1))),1),i==="support"?k((w(),I("div",be,[t(d,{label:"WeChat"},{default:s(()=>[t(g,{"model-value":e.site.features[i]?.wechat?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...e.site.features[i]?.wechat,enabled:r}}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),_:2},1024),k(t(d,{label:e.$t("site.field.qr")},{default:s(()=>[l("span",ve,[t(c,{src:e.site.features[i]?.wechat?.qr},null,8,["src"]),t($,{"model-value":e.site.features[i]?.wechat?.qr,title:e.$t("site.title.editQR"),tip:e.$t("site.message.editQRTip"),onConfirm:r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...e.site.features[i]?.wechat,qr:r}}}})},null,8,["model-value","title","tip","onConfirm"])])]),_:2},1032,["label"]),[[C,e.site.features[i]?.wechat?.enabled]]),t(d,{label:"Discord"},{default:s(()=>[t(g,{"model-value":e.site.features[i]?.discord?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...e.site.features[i]?.discord,enabled:r}}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),_:2},1024),k(t(d,{label:e.$t("site.field.url")},{default:s(()=>[l("span",he,[m(o(e.site.features[i]?.discord?.url)+" ",1),t(u,{"model-value":e.site.features[i]?.discord?.url,title:e.$t("site.title.editUrl"),placeholder:e.$t("site.placeholder.editUrl"),onConfirm:r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...e.site.features[i]?.discord,url:r}}}})},null,8,["model-value","title","placeholder","onConfirm"])])]),_:2},1032,["label"]),[[C,e.site.features[i]?.discord?.enabled]])],512)),[[C,e.site.features[i]?.enabled]]):j("",!0)]),_:2},1032,["label"])),64))]),_:1},8,["model"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const ze=V(J,[["render",ce],["__scopeId","data-v-61e4ae55"]]);export{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as q}from"./index.es-2lOPsuAc.js";import{E as H}from"./index-CrPi685m.js";import{E as de}from"./index-DqxOlx4F.js";import{ah as pe,an as me,bG as he,ai as ie,c7 as fe,_ as _e,d as C,a as $e,aj as ve,c as V,bf as ge,bl as ke,au as ae,b as _,o as a,i as w,r as U,f as oe,e as L,j as $,b6 as le,E as G,n as ye,g as we,h as j,t as l,k as s,l as c,eG as se,x as v,F as z,v as N,eH as Q,c4 as be,D as T,eI as x,eJ as ee,y,J as K,cL as te,eK as O,dk as W,eL as R,al as Ce,K as Se,eM as Le,dc as je,dj as Ae}from"./index-qYOPzHa3.js";import{E as re}from"./index-PFOP6Q8b.js";import{E as Ee,a as Ve}from"./index-CwoMR9Zh.js";import{I as D}from"./InfoIcon-Cu9nteOi.js";import{E as Ie}from"./index-DMk3kAFX.js";import{E}from"./index-B4ait4ZA.js";import{E as Z}from"./index-MXxFmX5t.js";import{E as Te,a as ce}from"./index-Bwld9Tt3.js";import{E as X}from"./index-CUrIFq7s.js";import{C as Pe,N as Fe}from"./NoTasks-CN0Xtzxd.js";import{a as Ue}from"./price-BvNqCXqY.js";import{E as ze,a as Me,b as Ge}from"./index-CR-JJVSC.js";import{E as Re}from"./index-Do4mf29F.js";import{E as De}from"./index-CaPw9RgB.js";import{a as Oe,E as We}from"./index-c6uS2eYO.js";import{E as Be}from"./index-CZiG7xy4.js";import"./use-form-item-BzJ-FpAT.js";import"./index-r5W6hzzQ.js";import"./index-C0KVUojO.js";import"./strings-BS0KugmX.js";import"./castArray-uDXgTM1I.js";import"./isEqual-BOj-wF30.js";import"./_Uint8Array-CHD4Y_mO.js";import"./typescript-Bqm6wRd8.js";import"./debounce-DqPxSsTs.js";import"./_baseIteratee-Cgizesz2.js";import"./index-0D_fkmJi.js";import"./index-C2rPB2WO.js";import"./_baseClone-B7ednKLK.js";import"./_initCloneObject-BqE7Da_v.js";import"./index-INC-04VE.js";import"./dropdown-DNahd1Cl.js";const Ne=pe({size:{type:[Number,String],values:fe,default:"",validator:e=>ie(e)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:he},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:me(String),default:"cover"}}),qe={error:e=>e instanceof Event},He=C({name:"ElAvatar"}),Ke=C({...He,props:Ne,emits:qe,setup(e,{emit:t}){const i=e,o=$e("avatar"),r=ve(!1),d=V(()=>{const{size:n,icon:m,shape:k}=i,h=[o.b()];return ge(n)&&h.push(o.m(n)),m&&h.push(o.m("icon")),k&&h.push(o.m(k)),h}),u=V(()=>{const{size:n}=i;return ie(n)?o.cssVarBlock({size:ke(n)||""}):void 0}),p=V(()=>({objectFit:i.fit}));ae(()=>i.src,()=>r.value=!1);function f(n){r.value=!0,t("error",n)}return(n,m)=>(a(),_("span",{class:ye(L(d)),style:oe(L(u))},[(n.src||n.srcSet)&&!r.value?(a(),_("img",{key:0,src:n.src,alt:n.alt,srcset:n.srcSet,style:oe(L(p)),onError:f},null,44,["src","alt","srcset"])):n.icon?(a(),w(L(G),{key:1},{default:$(()=>[(a(),w(le(n.icon)))]),_:1})):U(n.$slots,"default",{key:2})],6))}});var Ze=_e(Ke,[["__file","avatar.vue"]]);const Xe=we(Ze),Je=C({name:"LayoutSuno",components:{ElDrawer:de,ElButton:H,FontAwesomeIcon:q},data(){return{drawer:!1,preview:!1}},computed:{}}),Ye={class:"main"},Qe={class:"config"},xe={class:"result"},et={class:"preview"};function tt(e,t,i,o,r,d){const u=c("font-awesome-icon"),p=c("el-button"),f=c("el-drawer");return a(),_("div",Ye,[l("div",Qe,[U(e.$slots,"config",{},void 0,!0)]),l("div",xe,[U(e.$slots,"result",{},void 0,!0)]),l("div",et,[U(e.$slots,"preview",{},void 0,!0)]),s(p,{round:"",class:"menu",onClick:t[0]||(t[0]=n=>e.drawer=!0)},{default:$(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=n=>e.drawer=n),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:$(()=>[U(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ot=j(Je,[["render",tt],["__scopeId","data-v-5859e958"]]),st=C({name:"VersionSelector",components:{ElSelect:Ve,ElOption:Ee,ElSwitch:re},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{label:this.$t("suno.model.model1"),value:"chirp-v2-xxl-alpha"},{label:this.$t("suno.model.model2"),value:"chirp-v3-0"},{label:this.$t("suno.model.model3"),value:"chirp-v3-5"},{label:this.$t("suno.model.model4"),value:"chirp-v4"},{label:this.$t("suno.model.model45"),value:"chirp-v4-5"}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom},set(e){console.debug("set custom",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){console.debug("set model",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||(console.debug("set default type",se),this.model=se)}}),nt={class:"field"},it={class:"title font-bold"};function at(e,t,i,o,r,d){const u=c("el-switch"),p=c("el-option"),f=c("el-select");return a(),_("div",nt,[l("h2",it,v(e.$t("suno.name.type")),1),s(u,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=n=>e.custom=n),class:"value"},null,8,["modelValue"]),s(f,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=n=>e.model=n),class:"value",placeholder:e.$t("suno.placeholder.select")},{default:$(()=>[(a(!0),_(z,null,N(e.options,n=>(a(),w(p,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const lt=j(st,[["render",at],["__scopeId","data-v-5a66a01f"]]),rt=C({name:"UploadAudio",components:{ElUpload:Ie,ElButton:H,InfoIcon:D,FontAwesomeIcon:q},emits:["change"],data(){return{fileList:[],uploadUrl:be()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){E.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){E.error(this.$t("suno.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},i=this.credential?.token;if(!i){console.error("no token specified");return}E.info(this.$t("suno.message.startingUploadAudio")),Q.upload(t,{token:i}).then(o=>{console.debug("get upload music success",o.data);const r=o.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:r,action:"upload_extend"}),E.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(o=>{E.error(o?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))})},onSetAudio(){}}}),ct={class:"relative"},ut={class:"flex justify-between"},dt={class:"flex justify-start items-center"},pt={class:"text-sm font-bold"};function mt(e,t,i,o,r,d){const u=c("info-icon"),p=c("font-awesome-icon"),f=c("el-button"),n=c("el-upload");return a(),_("div",ct,[l("div",ut,[l("div",dt,[l("span",pt,v(e.$t("suno.name.referenceAudios")),1),s(u,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),s(n,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:$(()=>[s(f,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:$(()=>[s(p,{icon:"fa-solid fa-upload",class:"icon mr-1"}),T(" "+v(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const ht=j(rt,[["render",mt],["__scopeId","data-v-6236152c"]]),ft="",_t=C({name:"PromptInput",components:{ElInput:Z,ElSwitch:re,InfoIcon:D},data(){return{}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental},set(e){console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}}},mounted(){this.prompt||(this.prompt=ft)}}),$t={class:"field"},vt={class:"box"},gt={class:"title-info"},kt={class:"title font-bold"},yt={class:"instrumental"},wt={class:"title inline-block"};function bt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-switch"),f=c("el-input");return a(),_("div",$t,[l("div",vt,[l("div",gt,[l("h2",kt,v(e.$t("suno.name.prompt")),1),s(u,{content:e.$t("suno.description.prompt"),class:"info"},null,8,["content"])]),l("div",yt,[s(p,{modelValue:e.instrumental,"onUpdate:modelValue":t[0]||(t[0]=n=>e.instrumental=n),class:"value mr-2"},null,8,["modelValue"]),l("h2",wt,v(e.$t("suno.name.instrumental")),1)])]),s(f,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=n=>e.prompt=n),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("suno.placeholder.prompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const Ct=j(_t,[["render",bt],["__scopeId","data-v-d7004a7c"]]),St="",Lt=C({name:"LyricInput",components:{ElInput:Z,InfoIcon:D},data(){return{}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){console.debug("set lyric",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config}},mounted(){this.lyric||(this.lyric=St)}}),jt={class:"field"},At={class:"box"},Et={class:"title font-bold"};function Vt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-input");return a(),_("div",jt,[l("div",At,[l("h2",Et,v(e.$t("suno.name.lyrics")),1),s(u,{content:e.$t("suno.description.lyrics"),class:"info"},null,8,["content"])]),e.config?.action!=="extend"?(a(),w(p,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=f=>e.lyric=f),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"])):(a(),w(p,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=f=>e.lyric=f),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"]))])}const It=j(Lt,[["render",Vt],["__scopeId","data-v-99dfded8"]]),Tt=C({name:"StyleInput",components:{ElInput:Z,InfoIcon:D},data(){return{}},computed:{style:{get(){return this.$store.state.suno?.config?.style},set(e){console.debug("set style",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style:e})}},config(){return this.$store.state.suno?.config}}}),Pt={class:"field"},Ft={class:"title-container"},Ut={class:"titlefont-bold"};function zt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-input");return a(),_("div",Pt,[l("div",Ft,[l("h2",Ut,v(e.$t("suno.name.style")),1),s(u,{content:e.$t("suno.description.style"),class:"info"},null,8,["content"])]),s(p,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=f=>e.style=f),rows:3,type:"textarea",class:"style",placeholder:e.$t("suno.placeholder.style"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const Mt=j(Tt,[["render",zt],["__scopeId","data-v-85bbfcaa"]]),Gt=C({name:"TitleInput",components:{ElInput:Z,InfoIcon:D},data(){return{}},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){console.debug("set title",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,title:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental},set(e){console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}}}}),Rt={class:"field"},Dt={class:"title-container"},Ot={class:"title font-bold"};function Wt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-input");return a(),_("div",Rt,[l("div",Dt,[l("h2",Ot,v(e.$t("suno.name.title")),1),s(u,{content:e.$t("suno.description.title"),class:"info"},null,8,["content"])]),s(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=f=>e.title=f),rows:3,type:"textarea",class:"title",placeholder:e.$t("suno.placeholder.title"),maxlength:80,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const Bt=j(Gt,[["render",Wt],["__scopeId","data-v-ce70fe34"]]);function M(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const i=e%60,o=i<10?`0${i}`:i,r=t<10?`0${t}`:t;return o+":"+r}const Nt=C({name:"ExtendFromInput",components:{ElImage:X,ElIcon:G,ElInputNumber:Te,VideoPlay:ee,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:M,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),qt={class:"field"},Ht={class:"box"},Kt={class:"title font-bold"},Zt={class:"input-wrapper"},Xt={class:"task"},Jt={class:"left"},Yt={key:2,class:"duration"},Qt={class:"info"},xt={class:"title"},eo={class:"style"};function to(e,t,i,o,r,d){const u=c("el-input-number"),p=c("el-image"),f=c("video-pause"),n=c("el-icon"),m=c("video-play"),k=te("loading");return a(),_("div",qt,[l("div",Ht,[l("h2",Kt,v(e.$t("suno.name.extend")),1),l("div",Zt,[s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=h=>e.value=h),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),l("div",Xt,[e.audio?(a(),_("div",{key:0,class:"audio",onClick:t[3]||(t[3]=h=>e.onClick(e.audio))},[K((a(),_("div",Jt,[s(p,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(a(),_("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=h=>e.onPause(e.audio))},[s(n,null,{default:$(()=>[s(f)]),_:1})])):y("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(a(),_("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=h=>e.onPlay(e.audio))},[s(n,null,{default:$(()=>[s(m)]),_:1})])):y("",!0),e.audio?.duration?(a(),_("div",Yt,v(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[k,!e.audio?.audio_url]]),l("div",Qt,[l("h2",xt,v(e.audio?.title),1),l("p",eo,v(e.audio?.style),1)])])):y("",!0)])])}const oo=j(Nt,[["render",to],["__scopeId","data-v-bcce4821"]]),so=C({name:"CoverFromInput",components:{ElImage:X,ElIcon:G,VideoPlay:ee,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:M,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),no={class:"field"},io={class:"box"},ao={class:"title font-bold"},lo={class:"task"},ro={class:"left"},co={key:2,class:"duration"},uo={class:"info"},po={class:"title"},mo={class:"style"};function ho(e,t,i,o,r,d){const u=c("el-image"),p=c("video-pause"),f=c("el-icon"),n=c("video-play"),m=te("loading");return a(),_("div",no,[l("div",io,[l("h2",ao,v(e.$t("suno.name.cover")),1)]),l("div",lo,[e.audio?(a(),_("div",{key:0,class:"audio",onClick:t[2]||(t[2]=k=>e.onClick(e.audio))},[K((a(),_("div",ro,[s(u,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(a(),_("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=k=>e.onPause(e.audio))},[s(f,null,{default:$(()=>[s(p)]),_:1})])):y("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(a(),_("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=k=>e.onPlay(e.audio))},[s(f,null,{default:$(()=>[s(n)]),_:1})])):y("",!0),e.audio?.duration?(a(),_("div",co,v(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[m,!e.audio?.audio_url]]),l("div",uo,[l("h2",po,v(e.audio?.title),1),l("p",mo,v(e.audio?.style),1)])])):y("",!0)])])}const fo=j(so,[["render",ho],["__scopeId","data-v-06640216"]]),_o=C({name:"PresetPanel",components:{TypeSelector:lt,PromptInput:Ct,LyricInput:It,StyleInput:Mt,TitleInput:Bt,ExtendFromInput:oo,CoverFromInput:fo,UploadAudio:ht,FontAwesomeIcon:q,ElButton:H,Consumption:Pe},emits:["generate"],computed:{config(){return this.$store.state.suno?.config},consumption(){return Ue(this.config,this.service?.metadata?.price)},service(){return this.$store.state.suno?.service}},methods:{onGenerate(){this.$emit("generate")}}}),$o={class:"flex flex-col h-full"},vo={class:"flex-1 overflow-y-auto p-[15px]"},go={class:"flex flex-col items-center justify-center px-[15px] pb-[15px]"};function ko(e,t,i,o,r,d){const u=c("type-selector"),p=c("upload-audio"),f=c("prompt-input"),n=c("lyric-input"),m=c("style-input"),k=c("title-input"),h=c("extend-from-input"),b=c("cover-from-input"),P=c("consumption"),I=c("font-awesome-icon"),A=c("el-button");return a(),_("div",$o,[l("div",vo,[s(u,{class:"mb-4"}),s(p,{class:"mb-4"}),e.config?.custom?y("",!0):(a(),w(f,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(a(),w(n,{key:1,class:"mb-4"})):y("",!0),e.config?.custom?(a(),w(m,{key:2,class:"mb-4"})):y("",!0),e.config?.custom?(a(),w(k,{key:3,class:"mb-4"})):y("",!0),e.config?.action==="extend"?(a(),w(h,{key:4,class:"mb-4"})):y("",!0),e.config?.action==="cover"?(a(),w(b,{key:5,class:"mb-4"})):y("",!0)]),l("div",go,[s(P,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.action!=="extend"?(a(),w(A,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:$(()=>[s(I,{icon:"fa-solid fa-magic",class:"mr-2"}),T(" "+v(e.$t("suno.button.generate")),1)]),_:1},8,["onClick"])):(a(),w(A,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:$(()=>[s(I,{icon:"fa-solid fa-magic",class:"mr-2"}),T(" "+v(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"]))])])}const yo=j(_o,[["render",ko],["__scopeId","data-v-b9fab929"]]);var B={exports:{}},wo=B.exports,ne;function bo(){return ne||(ne=1,function(e,t){(function(i,o){o()})(wo,function(){function i(n,m){return typeof m>"u"?m={autoBom:!1}:typeof m!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),m={autoBom:!m}),m.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob(["\uFEFF",n],{type:n.type}):n}function o(n,m,k){var h=new XMLHttpRequest;h.open("GET",n),h.responseType="blob",h.onload=function(){f(h.response,m,k)},h.onerror=function(){console.error("could not download file")},h.send()}function r(n){var m=new XMLHttpRequest;m.open("HEAD",n,!1);try{m.send()}catch{}return 200<=m.status&&299>=m.status}function d(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{var m=document.createEvent("MouseEvents");m.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(m)}}var u=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof O=="object"&&O.global===O?O:void 0,p=u.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),f=u.saveAs||(typeof window!="object"||window!==u?function(){}:"download"in HTMLAnchorElement.prototype&&!p?function(n,m,k){var h=u.URL||u.webkitURL,b=document.createElement("a");m=m||n.name||"download",b.download=m,b.rel="noopener",typeof n=="string"?(b.href=n,b.origin===location.origin?d(b):r(b.href)?o(n,m,k):d(b,b.target="_blank")):(b.href=h.createObjectURL(n),setTimeout(function(){h.revokeObjectURL(b.href)},4e4),setTimeout(function(){d(b)},0))}:"msSaveOrOpenBlob"in navigator?function(n,m,k){if(m=m||n.name||"download",typeof n!="string")navigator.msSaveOrOpenBlob(i(n,k),m);else if(r(n))o(n,m,k);else{var h=document.createElement("a");h.href=n,h.target="_blank",setTimeout(function(){d(h)})}}:function(n,m,k,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof n=="string")return o(n,m,k);var b=n.type==="application/octet-stream",P=/constructor/i.test(u.HTMLElement)||u.safari,I=/CriOS\/[\d]+/.test(navigator.userAgent);if((I||b&&P||p)&&typeof FileReader<"u"){var A=new FileReader;A.onloadend=function(){var S=A.result;S=I?S:S.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=S:location=S,h=null},A.readAsDataURL(n)}else{var g=u.URL||u.webkitURL,F=g.createObjectURL(n);h?h.location=F:location.href=F,h=null,setTimeout(function(){g.revokeObjectURL(F)},4e4)}});u.saveAs=f.saveAs=f,e.exports=f})}(B)),B.exports}var Co=bo();const So="https://webhook.acedata.cloud/suno",Lo=C({name:"TaskPreview",components:{ElImage:X,ElIcon:G,ElTooltip:Re,ElButton:H,FontAwesomeIcon:q,VideoPlay:ee,VideoPause:x,ElDropdown:Ge,ElDropdownMenu:Me,ElDropdownItem:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===W.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){return this.$store.state.suno?.tasks},audios(){let e=[];const t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(i=>{let o=i;t&&(o.action=t),e.push(o)}),e},application(){return this.$store.state.suno?.application},active(){return this.$store.state.suno?.tasks?.active}},methods:{useFormatDuring:M,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e.stopPropagation(),console.log("on download",t);const o=new URL(t).pathname,r=o.substring(o.lastIndexOf("/")+1);console.log("on preview",r),fetch(t).then(d=>d.blob()).then(d=>{Co.saveAs(d,r)})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){console.log("on cover"),console.debug("set config",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl("concat",e)},async onGenerateAudioUrl(e,t){const i={action:e,audio_id:t,callback_url:So},o=this.credential?.token;if(!o){console.error("no token specified");return}E.info(this.$t("suno.message.startingTask")),Q.audio(i,{token:o}).then(()=>{E.success(this.$t("suno.message.startTaskSuccess"))}).catch(r=>{E.error(r?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),jo={class:"task"},Ao=["onClick"],Eo={class:"left"},Vo=["onClick"],Io=["onClick"],To={key:2,class:"duration"},Po={class:"info"},Fo={class:"title"},Uo={class:"style"},zo={class:"right"},Mo={class:"el-dropdown-link"},Go={class:"el-dropdown-link"};function Ro(e,t,i,o,r,d){const u=c("el-image"),p=c("video-pause"),f=c("el-icon"),n=c("video-play"),m=c("el-button"),k=c("font-awesome-icon"),h=c("el-tooltip"),b=c("el-dropdown-item"),P=c("el-dropdown-menu"),I=c("el-dropdown"),A=te("loading");return a(),_("div",jo,[(a(!0),_(z,null,N(e.audios,(g,F)=>(a(),_("div",{key:F,class:"audio",onClick:S=>e.onClick(g)},[K((a(),_("div",Eo,[s(u,{src:g?.image_url,class:"cover",fit:"cover"},null,8,["src"]),g?.audio_url&&e.$store.state?.suno?.audio?.id===g.id&&e.$store.state?.suno?.audio?.state==="playing"?(a(),_("div",{key:0,class:"overlay",onClick:S=>e.onPause(g)},[s(f,null,{default:$(()=>[s(p)]),_:1})],8,Vo)):y("",!0),g?.audio_url&&(e.$store.state?.suno?.audio?.id!==g.id||e.$store.state?.suno?.audio?.id===g.id&&e.$store.state?.suno?.audio?.state==="paused")?(a(),_("div",{key:1,class:"overlay",onClick:S=>e.onPlay(g)},[s(f,null,{default:$(()=>[s(n)]),_:1})],8,Io)):y("",!0),g?.duration?(a(),_("div",To,v(e.useFormatDuring(g?.duration)),1)):y("",!0)])),[[A,!g?.audio_url]]),l("div",Po,[l("h2",Fo,v(g?.title),1),l("p",Uo,v(g?.style),1)]),l("div",zo,[g?.audio_url?(a(),w(m,{key:0,size:"small",round:"",onClick:S=>e.onExtend(S,g)},{default:$(()=>[T(v(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):y("",!0),s(h,{effect:"dark",content:e.$t("suno.button.video"),placement:"top"},{default:$(()=>[g?.video_url?(a(),w(k,{key:0,icon:"fa-solid fa-clapperboard",class:"icon icon-preview",onClick:S=>e.onPreview(S,g?.video_url)},null,8,["onClick"])):y("",!0)]),_:2},1032,["content"]),s(I,null,{dropdown:$(()=>[s(P,null,{default:$(()=>[g?.video_url?(a(),w(b,{key:0,onClick:S=>e.onDownload(S,g?.video_url)},{default:$(()=>[T(v(e.$t("suno.button.download_video")),1)]),_:2},1032,["onClick"])):y("",!0),g?.audio_url?(a(),w(b,{key:1,onClick:S=>e.onDownload(S,g?.audio_url)},{default:$(()=>[T(v(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):y("",!0)]),_:2},1024)]),default:$(()=>[l("span",Mo,[s(h,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:$(()=>[g?.audio_url||g?.video_url?(a(),w(k,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(I,null,{dropdown:$(()=>[s(P,null,{default:$(()=>[g.id?(a(),w(b,{key:0,onClick:S=>e.onGetStems(g.id)},{default:$(()=>[T(v(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):y("",!0),s(b,{onClick:S=>e.onCover(g)},{default:$(()=>[T(v(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"]),g?.id&&g?.action==="extend"?(a(),w(b,{key:1,onClick:S=>e.onConcatMusic(g?.id)},{default:$(()=>[T(v(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):y("",!0)]),_:2},1024)]),default:$(()=>[l("span",Go,[s(h,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:$(()=>[g?.audio_url||g?.video_url?(a(),w(k,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,Ao))),128))])}const Do=j(Lo,[["render",Ro]]),Oo={class:"player-slider"},Wo=C({__name:"PlayerSlider",setup(e){const t=R(),i=V({get:()=>t.state.suno?.audio?.progress,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:u})}),o=V({get:()=>t.state.suno?.audio?.duration,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:u})}),r=()=>{},d=u=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:u});return(u,p)=>(a(),_("div",Oo,[s(L(ce),{modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=f=>i.value=f),"show-tooltip":!1,min:0,max:o.value,onChange:d,onInput:r},null,8,["modelValue","max"])]))}}),Bo="/assets/disk-XFRmVAfp.png",No={class:"flex player-song"},qo=["src"],Ho={class:"ml-2 text-xs flex flex-col justify-between"},Ko={class:"w-52 2xl:w-96 cursor-pointer truncate"},Zo={class:"flex"},Xo={class:"ml-2 text-dc"},Jo=C({__name:"PlayerSong",setup(e){const t=R(),i=V({get:()=>t.state.suno.audio,set:o=>t.commit("suno/setAudio",o)});return ae(i,(o,r)=>{if(o?.audio_url!==r?.audio_url){console.log("audio changed",o),o.object&&(console.log("111",o.object),o.object.pause(),delete o.object);const d=new Audio(o.audio_url);o.state==="playing"?d.play():d.pause(),d.addEventListener("loadedmetadata",()=>{d.currentTime=0,d.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:d.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:d})}else if(o?.progress!==r?.progress&&Math.abs(o.progress-o.object.currentTime)>2){console.log("progress changed",o.progress);const d=t.state.suno.audio;d.object&&(d.object.currentTime=d.progress)}else o?.state!==r?.state&&(console.log("state changed",o.state),o.object&&(o.state==="playing"?o.object.play():o.object.pause()));o?.volume!==r?.volume&&(console.log("volume changed",o.volume),o.object&&(o.object.volume=o.volume/100))}),(o,r)=>(a(),_("div",No,[l("img",{alt:"",class:"w-11 h-11 rounded",src:i.value?.image_url||L(Bo)},null,8,qo),l("div",Ho,[l("div",Ko,[l("div",Zo,[l("span",null,v(i.value?.title||"Music"),1),l("span",Xo,"- "+v(i.value?.style||"SmallRuralDog"),1)])])])]))}}),Yo={class:"flex justify-end items-center gap-x-2.5"},Qo={class:"text-xs"},xo=C({__name:"PlayerAction",setup(e){const t=R(),i=V({get:()=>t.state.suno?.audio?.progress,set:r=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:r})}),o=V({get:()=>t.state.suno?.audio?.duration,set:r=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:r})});return(r,d)=>(a(),_("div",Yo,[l("span",Qo,v(L(M)(i.value))+" / "+v(L(M)(o.value)),1)]))}});var es={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 ts(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function os(e,t,i){var o=typeof t.fill=="string"?[t.fill]:t.fill||[],r=[],d=t.theme||i.theme;switch(d){case"outline":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none");break;case"filled":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("#FFF"),r.push("#FFF");break;case"two-tone":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:i.colors.twoTone.twoTone),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:i.colors.twoTone.twoTone);break;case"multi-color":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:i.colors.multiColor.outFillColor),r.push(typeof o[2]=="string"?o[2]:i.colors.multiColor.innerStrokeColor),r.push(typeof o[3]=="string"?o[3]:i.colors.multiColor.innerFillColor);break}return{size:t.size||i.size,strokeWidth:t.strokeWidth||i.strokeWidth,strokeLinecap:t.strokeLinecap||i.strokeLinecap,strokeLinejoin:t.strokeLinejoin||i.strokeLinejoin,colors:r,id:e}}var ss=Symbol("icon-context");function J(e,t,i){var o={name:"icon-"+e,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(d){var u=ts(),p=Ce(ss,es);return function(){var f=d.size,n=d.strokeWidth,m=d.strokeLinecap,k=d.strokeLinejoin,h=d.theme,b=d.fill,P=d.spin,I=os(u,{size:f,strokeWidth:n,strokeLinecap:m,strokeLinejoin:k,theme:h,fill:b},p),A=[p.prefix+"-icon"];return A.push(p.prefix+"-icon-"+e),t&&p.rtl&&A.push(p.prefix+"-icon-rtl"),P&&A.push(p.prefix+"-icon-spin"),s("span",{class:A.join(" ")},[i(I)])}}};return o}const ns=J("pause-one",!1,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("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),s("path",{d:"M19 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M29 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),is=J("play",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("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),s("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)])}),as=J("volume-mute",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("rect",{opacity:"0.01",x:"30",y:"18",width:"13",height:"13",fill:e.colors[2]},null),s("mask",{id:e.id+"603476ab",maskUnits:"userSpaceOnUse",x:"30",y:"18",width:"13",height:"13",style:{maskType:"alpha"}},[s("rect",{x:"30",y:"18",width:"13",height:"13",fill:e.colors[2]},null)]),s("g",{mask:"url(#"+e.id+"603476ab)"},[s("path",{d:"M40.7348 20.2858L32.2495 28.7711",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M32.2496 20.2858L40.7349 28.7711",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)]),s("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)])}),ue=J("volume-small",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("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),s("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)])}),Y=C({__name:"IconPark",props:{icon:{},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(t,i)=>(a(),w(le(t.icon),{theme:t.theme,size:t.size,spin:t.spin,fill:t.fill,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin,"stroke-width":t.strokeWidth},null,8,["theme","size","spin","fill","stroke-linecap","stroke-linejoin","stroke-width"]))}}),ls={class:"player-volume flex flex-col items-center pt-2"},rs={class:"text-sm mt-3"},cs={class:"mt-2"},us=C({__name:"PlayerVolumeSlider",setup(e){const t=R(),i=V({get:()=>t.state.suno.audio?.volume,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:u})}),o=V({get:()=>t.state.suno.audio?.muted,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:u})}),r=()=>t.dispatch("suno/toggleMuted"),d=u=>t.dispatch("suno/setVolume",u);return(u,p)=>(a(),_("div",ls,[l("div",null,[s(L(ce),{modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=f=>i.value=f),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:o.value,onInput:d},null,8,["modelValue","disabled"])]),l("div",rs,v(i.value),1),l("div",cs,[s(Y,{icon:o.value?L(as):L(ue),size:"16",theme:"filled",class:"hover-text",onClick:r},null,8,["icon"])])]))}}),ds={class:"flex items-center justify-center gap-x-3"},ps=C({__name:"PlayerController",setup(e){const t=R(),i=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),o=V(()=>t.state.suno.audio);return(r,d)=>(a(),_("div",ds,[s(Y,{icon:o.value?.state==="playing"?L(ns):L(is),size:"45",theme:"filled",class:"control",onClick:i},null,8,["icon"]),s(L(De),{placement:"top",width:"50px"},{reference:$(()=>[s(Y,{icon:L(ue),size:"20","stroke-width":3,class:"hover-text"},null,8,["icon"])]),default:$(()=>[s(us)]),_:1})]))}}),ms={class:"flex flex-col items-stretch h-20"},hs={class:"flex grow px-5 items-center"},fs={class:"flex-1"},_s={class:"flex-1"},$s={class:"flex-1"},vs=C({__name:"Player",setup(e){return(t,i)=>(a(),_("div",ms,[s(Wo),l("div",hs,[l("div",fs,[s(Jo)]),l("div",_s,[s(ps)]),l("div",$s,[s(xo)])])]))}}),gs=C({name:"RecentPanel",components:{TaskPreview:Do,ElSkeleton:We,ElSkeletonItem:Oe,Player:vs,NoTasks:Fe},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),ks={key:0,class:"tasks"},ys={class:"left"},ws={class:"main"},bs={key:1,class:"tasks"},Cs={key:2,class:"w-full h-full flex items-center justify-center"},Ss={class:"flex-1 flex flex-col"},Ls={class:"h-20"};function js(e,t,i,o,r,d){const u=c("el-skeleton-item"),p=c("el-skeleton"),f=c("task-preview"),n=c("no-tasks"),m=c("player");return a(),_(z,null,[l("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...k)=>e.onHandleScroll&&e.onHandleScroll(...k))},[e.tasks?.items===void 0?(a(),_("div",ks,[(a(),_(z,null,N(3,k=>l("div",{key:k,class:"task placeholder"},[l("div",ys,[s(p,{animated:""},{template:$(()=>[s(u,{variant:"image",class:"avatar"})]),_:1})]),l("div",ws,[s(p,{animated:""},{template:$(()=>[s(u,{variant:"p",class:"title"}),s(u,{variant:"text",style:{"margin-right":"16px"}}),s(u,{variant:"text",style:{width:"80%"}})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),_("div",bs,[(a(!0),_(z,null,N(e.tasks?.items,(k,h)=>(a(),w(f,{key:h,"model-value":k,class:"preview"},null,8,["model-value"]))),128))])):y("",!0),e.tasks?.items?.length===0?(a(),_("div",Cs,[s(n)])):y("",!0)],544),K(l("div",Ss,[l("div",Ls,[s(m)])],512),[[Se,!!e.$store?.state?.suno?.audio?.object]])],64)}const As=j(gs,[["render",js],["__scopeId","data-v-959f8920"]]),Es=C({name:"TaskPreview",components:{ElScrollbar:Be,IconPicture:Le,ElImage:X,ElAvatar:Xe,ElIcon:G},data(){return{showCloseIcon:!0}},computed:{audio(){return this.$store.state.suno?.audio}},methods:{closeCard(){this.showCloseIcon=!this.showCloseIcon}}}),Vs={key:0,class:"card"},Is={class:"image-container"},Ts={class:"image-slot"},Ps={class:"title"},Fs={class:"content"},Us={class:"artist"},zs={class:"style"},Ms={class:"time"},Gs={class:"lyrics"},Rs={key:1,class:"gradient-background"};function Ds(e,t,i,o,r,d){const u=c("icon-picture"),p=c("el-icon"),f=c("el-image"),n=c("el-avatar"),m=c("el-scrollbar");return a(),w(m,{class:"right-panel"},{default:$(()=>[e.audio?.object?(a(),_("div",Vs,[l("div",Is,[s(f,{src:e.audio.image_url,fit:"cover"},{error:$(()=>[l("div",Ts,[s(p,null,{default:$(()=>[s(u)]),_:1})])]),_:1},8,["src"]),l("h2",Ps,v(e.audio?.title),1)]),l("div",Fs,[l("div",Us,[s(n,{size:30,src:e.audio?.image_url},null,8,["src"]),l("span",null,v(e.audio?.prompt),1)]),l("p",zs,v(e.audio?.style),1),l("p",Ms,v(e.$dayjs.format(e.audio?.created_at)),1),l("div",Gs,[l("p",null,v(e.audio?.lyric),1)])])])):(a(),_("div",Rs))]),_:1})}const Os=j(Es,[["render",Ds],["__scopeId","data-v-9b29e9f9"]]),Ws="https://webhook.acedata.cloud/suno",Bs=C({name:"SunoIndex",components:{Layout:ot,ConfigPanel:yo,RecentPanel:As,PreviewPanel:Os},inject:["initialized"],data(){return{task:void 0,job:0}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===W.Request},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===W.Request},needApply(){return this.$store.state.suno.status.getApplications===W.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){clearInterval(this.job)},methods:{async onReachTop(){console.debug("reached top"),await this.onGetTasks({createdAtMax:this.tasks?.items?.[0]?.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){je.create({application:this.application}).then(({data:e})=>{this.application=e,E.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Ae&&E.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:i,createdAtMax:o}=e||{};console.debug("limit",t,"createdAtMin",i,"createdAtMax",o),await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:i,createdAtMax:o})},async onGenerateAudio(){const e={...this.config,callback_url:Ws},t=this.credential?.token;if(!t){console.error("no token specified");return}E.info(this.$t("suno.message.startingTask")),Q.audio(e,{token:t}).then(()=>{E.success(this.$t("suno.message.startTaskSuccess"))}).catch(i=>{E.error(i?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ns(e,t,i,o,r,d){const u=c("config-panel"),p=c("recent-panel"),f=c("preview-panel"),n=c("layout");return a(),w(n,null,{config:$(()=>[s(u,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:$(()=>[s(p,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),preview:$(()=>[s(f)]),_:1})}const jn=j(Bs,[["render",Ns],["__scopeId","data-v-f5721d95"]]);export{jn as default};
|
|
1
|
+
import{F as q}from"./index.es-BOpBg0UI.js";import{E as H}from"./index-CjnHN7w2.js";import{E as de}from"./index-DLQX8ces.js";import{ah as pe,an as me,bG as he,ai as ie,c7 as fe,_ as _e,d as C,a as $e,aj as ve,c as V,bf as ge,bl as ke,au as ae,b as _,o as a,i as w,r as U,f as oe,e as L,j as $,b6 as le,E as G,n as ye,g as we,h as j,t as l,k as s,l as c,eG as se,x as v,F as z,v as N,eH as Q,c4 as be,D as T,eI as x,eJ as ee,y,J as K,cL as te,eK as O,dk as W,eL as R,al as Ce,K as Se,eM as Le,dc as je,dj as Ae}from"./index-4aBt5Vjx.js";import{E as re}from"./index-vSn3l9f9.js";import{E as Ee,a as Ve}from"./index-BvYpsGFP.js";import{I as D}from"./InfoIcon-D6PUDRo_.js";import{E as Ie}from"./index-DffkKKNy.js";import{E}from"./index-D4Nbe_d4.js";import{E as Z}from"./index-CvGE-1KG.js";import{E as Te,a as ce}from"./index-DuzqMVIQ.js";import{E as X}from"./index-BJ9sBisj.js";import{C as Pe,N as Fe}from"./NoTasks-DWe30n2J.js";import{a as Ue}from"./price-onQYeDGi.js";import{E as ze,a as Me,b as Ge}from"./index-CNTA3A3f.js";import{E as Re}from"./index-B7dvDo-P.js";import{E as De}from"./index-cwwhbHoU.js";import{a as Oe,E as We}from"./index-BVisl222.js";import{E as Be}from"./index-CclW0Rit.js";import"./use-form-item-CoynAZx1.js";import"./index-r5W6hzzQ.js";import"./index-D0mYfORH.js";import"./strings-JVRUlEcU.js";import"./castArray-BHtbvzcE.js";import"./isEqual-Dbw7tVId.js";import"./_Uint8Array-B4Ba1PVM.js";import"./typescript-BDQzoLbE.js";import"./debounce-BD0Llk1h.js";import"./_baseIteratee-CWuQF0Pw.js";import"./index-CA6dWpXZ.js";import"./index-Dt3STBTu.js";import"./_baseClone-CP-pCuea.js";import"./_initCloneObject-BH7jWQ_I.js";import"./index-DeUpuRmm.js";import"./dropdown-C1t8uY18.js";const Ne=pe({size:{type:[Number,String],values:fe,default:"",validator:e=>ie(e)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:he},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:me(String),default:"cover"}}),qe={error:e=>e instanceof Event},He=C({name:"ElAvatar"}),Ke=C({...He,props:Ne,emits:qe,setup(e,{emit:t}){const i=e,o=$e("avatar"),r=ve(!1),d=V(()=>{const{size:n,icon:m,shape:k}=i,h=[o.b()];return ge(n)&&h.push(o.m(n)),m&&h.push(o.m("icon")),k&&h.push(o.m(k)),h}),u=V(()=>{const{size:n}=i;return ie(n)?o.cssVarBlock({size:ke(n)||""}):void 0}),p=V(()=>({objectFit:i.fit}));ae(()=>i.src,()=>r.value=!1);function f(n){r.value=!0,t("error",n)}return(n,m)=>(a(),_("span",{class:ye(L(d)),style:oe(L(u))},[(n.src||n.srcSet)&&!r.value?(a(),_("img",{key:0,src:n.src,alt:n.alt,srcset:n.srcSet,style:oe(L(p)),onError:f},null,44,["src","alt","srcset"])):n.icon?(a(),w(L(G),{key:1},{default:$(()=>[(a(),w(le(n.icon)))]),_:1})):U(n.$slots,"default",{key:2})],6))}});var Ze=_e(Ke,[["__file","avatar.vue"]]);const Xe=we(Ze),Je=C({name:"LayoutSuno",components:{ElDrawer:de,ElButton:H,FontAwesomeIcon:q},data(){return{drawer:!1,preview:!1}},computed:{}}),Ye={class:"main"},Qe={class:"config"},xe={class:"result"},et={class:"preview"};function tt(e,t,i,o,r,d){const u=c("font-awesome-icon"),p=c("el-button"),f=c("el-drawer");return a(),_("div",Ye,[l("div",Qe,[U(e.$slots,"config",{},void 0,!0)]),l("div",xe,[U(e.$slots,"result",{},void 0,!0)]),l("div",et,[U(e.$slots,"preview",{},void 0,!0)]),s(p,{round:"",class:"menu",onClick:t[0]||(t[0]=n=>e.drawer=!0)},{default:$(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=n=>e.drawer=n),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:$(()=>[U(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ot=j(Je,[["render",tt],["__scopeId","data-v-5859e958"]]),st=C({name:"VersionSelector",components:{ElSelect:Ve,ElOption:Ee,ElSwitch:re},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{label:this.$t("suno.model.model1"),value:"chirp-v2-xxl-alpha"},{label:this.$t("suno.model.model2"),value:"chirp-v3-0"},{label:this.$t("suno.model.model3"),value:"chirp-v3-5"},{label:this.$t("suno.model.model4"),value:"chirp-v4"},{label:this.$t("suno.model.model45"),value:"chirp-v4-5"}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom},set(e){console.debug("set custom",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){console.debug("set model",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||(console.debug("set default type",se),this.model=se)}}),nt={class:"field"},it={class:"title font-bold"};function at(e,t,i,o,r,d){const u=c("el-switch"),p=c("el-option"),f=c("el-select");return a(),_("div",nt,[l("h2",it,v(e.$t("suno.name.type")),1),s(u,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=n=>e.custom=n),class:"value"},null,8,["modelValue"]),s(f,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=n=>e.model=n),class:"value",placeholder:e.$t("suno.placeholder.select")},{default:$(()=>[(a(!0),_(z,null,N(e.options,n=>(a(),w(p,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const lt=j(st,[["render",at],["__scopeId","data-v-5a66a01f"]]),rt=C({name:"UploadAudio",components:{ElUpload:Ie,ElButton:H,InfoIcon:D,FontAwesomeIcon:q},emits:["change"],data(){return{fileList:[],uploadUrl:be()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){E.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){E.error(this.$t("suno.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},i=this.credential?.token;if(!i){console.error("no token specified");return}E.info(this.$t("suno.message.startingUploadAudio")),Q.upload(t,{token:i}).then(o=>{console.debug("get upload music success",o.data);const r=o.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:r,action:"upload_extend"}),E.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(o=>{E.error(o?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))})},onSetAudio(){}}}),ct={class:"relative"},ut={class:"flex justify-between"},dt={class:"flex justify-start items-center"},pt={class:"text-sm font-bold"};function mt(e,t,i,o,r,d){const u=c("info-icon"),p=c("font-awesome-icon"),f=c("el-button"),n=c("el-upload");return a(),_("div",ct,[l("div",ut,[l("div",dt,[l("span",pt,v(e.$t("suno.name.referenceAudios")),1),s(u,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),s(n,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:$(()=>[s(f,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:$(()=>[s(p,{icon:"fa-solid fa-upload",class:"icon mr-1"}),T(" "+v(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const ht=j(rt,[["render",mt],["__scopeId","data-v-6236152c"]]),ft="",_t=C({name:"PromptInput",components:{ElInput:Z,ElSwitch:re,InfoIcon:D},data(){return{}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental},set(e){console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}}},mounted(){this.prompt||(this.prompt=ft)}}),$t={class:"field"},vt={class:"box"},gt={class:"title-info"},kt={class:"title font-bold"},yt={class:"instrumental"},wt={class:"title inline-block"};function bt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-switch"),f=c("el-input");return a(),_("div",$t,[l("div",vt,[l("div",gt,[l("h2",kt,v(e.$t("suno.name.prompt")),1),s(u,{content:e.$t("suno.description.prompt"),class:"info"},null,8,["content"])]),l("div",yt,[s(p,{modelValue:e.instrumental,"onUpdate:modelValue":t[0]||(t[0]=n=>e.instrumental=n),class:"value mr-2"},null,8,["modelValue"]),l("h2",wt,v(e.$t("suno.name.instrumental")),1)])]),s(f,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=n=>e.prompt=n),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("suno.placeholder.prompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const Ct=j(_t,[["render",bt],["__scopeId","data-v-d7004a7c"]]),St="",Lt=C({name:"LyricInput",components:{ElInput:Z,InfoIcon:D},data(){return{}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){console.debug("set lyric",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config}},mounted(){this.lyric||(this.lyric=St)}}),jt={class:"field"},At={class:"box"},Et={class:"title font-bold"};function Vt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-input");return a(),_("div",jt,[l("div",At,[l("h2",Et,v(e.$t("suno.name.lyrics")),1),s(u,{content:e.$t("suno.description.lyrics"),class:"info"},null,8,["content"])]),e.config?.action!=="extend"?(a(),w(p,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=f=>e.lyric=f),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"])):(a(),w(p,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=f=>e.lyric=f),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"]))])}const It=j(Lt,[["render",Vt],["__scopeId","data-v-99dfded8"]]),Tt=C({name:"StyleInput",components:{ElInput:Z,InfoIcon:D},data(){return{}},computed:{style:{get(){return this.$store.state.suno?.config?.style},set(e){console.debug("set style",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style:e})}},config(){return this.$store.state.suno?.config}}}),Pt={class:"field"},Ft={class:"title-container"},Ut={class:"titlefont-bold"};function zt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-input");return a(),_("div",Pt,[l("div",Ft,[l("h2",Ut,v(e.$t("suno.name.style")),1),s(u,{content:e.$t("suno.description.style"),class:"info"},null,8,["content"])]),s(p,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=f=>e.style=f),rows:3,type:"textarea",class:"style",placeholder:e.$t("suno.placeholder.style"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const Mt=j(Tt,[["render",zt],["__scopeId","data-v-85bbfcaa"]]),Gt=C({name:"TitleInput",components:{ElInput:Z,InfoIcon:D},data(){return{}},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){console.debug("set title",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,title:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental},set(e){console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}}}}),Rt={class:"field"},Dt={class:"title-container"},Ot={class:"title font-bold"};function Wt(e,t,i,o,r,d){const u=c("info-icon"),p=c("el-input");return a(),_("div",Rt,[l("div",Dt,[l("h2",Ot,v(e.$t("suno.name.title")),1),s(u,{content:e.$t("suno.description.title"),class:"info"},null,8,["content"])]),s(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=f=>e.title=f),rows:3,type:"textarea",class:"title",placeholder:e.$t("suno.placeholder.title"),maxlength:80,"show-word-limit":""},null,8,["modelValue","placeholder"])])}const Bt=j(Gt,[["render",Wt],["__scopeId","data-v-ce70fe34"]]);function M(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const i=e%60,o=i<10?`0${i}`:i,r=t<10?`0${t}`:t;return o+":"+r}const Nt=C({name:"ExtendFromInput",components:{ElImage:X,ElIcon:G,ElInputNumber:Te,VideoPlay:ee,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:M,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),qt={class:"field"},Ht={class:"box"},Kt={class:"title font-bold"},Zt={class:"input-wrapper"},Xt={class:"task"},Jt={class:"left"},Yt={key:2,class:"duration"},Qt={class:"info"},xt={class:"title"},eo={class:"style"};function to(e,t,i,o,r,d){const u=c("el-input-number"),p=c("el-image"),f=c("video-pause"),n=c("el-icon"),m=c("video-play"),k=te("loading");return a(),_("div",qt,[l("div",Ht,[l("h2",Kt,v(e.$t("suno.name.extend")),1),l("div",Zt,[s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=h=>e.value=h),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),l("div",Xt,[e.audio?(a(),_("div",{key:0,class:"audio",onClick:t[3]||(t[3]=h=>e.onClick(e.audio))},[K((a(),_("div",Jt,[s(p,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(a(),_("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=h=>e.onPause(e.audio))},[s(n,null,{default:$(()=>[s(f)]),_:1})])):y("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(a(),_("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=h=>e.onPlay(e.audio))},[s(n,null,{default:$(()=>[s(m)]),_:1})])):y("",!0),e.audio?.duration?(a(),_("div",Yt,v(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[k,!e.audio?.audio_url]]),l("div",Qt,[l("h2",xt,v(e.audio?.title),1),l("p",eo,v(e.audio?.style),1)])])):y("",!0)])])}const oo=j(Nt,[["render",to],["__scopeId","data-v-bcce4821"]]),so=C({name:"CoverFromInput",components:{ElImage:X,ElIcon:G,VideoPlay:ee,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:M,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),no={class:"field"},io={class:"box"},ao={class:"title font-bold"},lo={class:"task"},ro={class:"left"},co={key:2,class:"duration"},uo={class:"info"},po={class:"title"},mo={class:"style"};function ho(e,t,i,o,r,d){const u=c("el-image"),p=c("video-pause"),f=c("el-icon"),n=c("video-play"),m=te("loading");return a(),_("div",no,[l("div",io,[l("h2",ao,v(e.$t("suno.name.cover")),1)]),l("div",lo,[e.audio?(a(),_("div",{key:0,class:"audio",onClick:t[2]||(t[2]=k=>e.onClick(e.audio))},[K((a(),_("div",ro,[s(u,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(a(),_("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=k=>e.onPause(e.audio))},[s(f,null,{default:$(()=>[s(p)]),_:1})])):y("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(a(),_("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=k=>e.onPlay(e.audio))},[s(f,null,{default:$(()=>[s(n)]),_:1})])):y("",!0),e.audio?.duration?(a(),_("div",co,v(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[m,!e.audio?.audio_url]]),l("div",uo,[l("h2",po,v(e.audio?.title),1),l("p",mo,v(e.audio?.style),1)])])):y("",!0)])])}const fo=j(so,[["render",ho],["__scopeId","data-v-06640216"]]),_o=C({name:"PresetPanel",components:{TypeSelector:lt,PromptInput:Ct,LyricInput:It,StyleInput:Mt,TitleInput:Bt,ExtendFromInput:oo,CoverFromInput:fo,UploadAudio:ht,FontAwesomeIcon:q,ElButton:H,Consumption:Pe},emits:["generate"],computed:{config(){return this.$store.state.suno?.config},consumption(){return Ue(this.config,this.service?.metadata?.price)},service(){return this.$store.state.suno?.service}},methods:{onGenerate(){this.$emit("generate")}}}),$o={class:"flex flex-col h-full"},vo={class:"flex-1 overflow-y-auto p-[15px]"},go={class:"flex flex-col items-center justify-center px-[15px] pb-[15px]"};function ko(e,t,i,o,r,d){const u=c("type-selector"),p=c("upload-audio"),f=c("prompt-input"),n=c("lyric-input"),m=c("style-input"),k=c("title-input"),h=c("extend-from-input"),b=c("cover-from-input"),P=c("consumption"),I=c("font-awesome-icon"),A=c("el-button");return a(),_("div",$o,[l("div",vo,[s(u,{class:"mb-4"}),s(p,{class:"mb-4"}),e.config?.custom?y("",!0):(a(),w(f,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(a(),w(n,{key:1,class:"mb-4"})):y("",!0),e.config?.custom?(a(),w(m,{key:2,class:"mb-4"})):y("",!0),e.config?.custom?(a(),w(k,{key:3,class:"mb-4"})):y("",!0),e.config?.action==="extend"?(a(),w(h,{key:4,class:"mb-4"})):y("",!0),e.config?.action==="cover"?(a(),w(b,{key:5,class:"mb-4"})):y("",!0)]),l("div",go,[s(P,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.action!=="extend"?(a(),w(A,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:$(()=>[s(I,{icon:"fa-solid fa-magic",class:"mr-2"}),T(" "+v(e.$t("suno.button.generate")),1)]),_:1},8,["onClick"])):(a(),w(A,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:$(()=>[s(I,{icon:"fa-solid fa-magic",class:"mr-2"}),T(" "+v(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"]))])])}const yo=j(_o,[["render",ko],["__scopeId","data-v-b9fab929"]]);var B={exports:{}},wo=B.exports,ne;function bo(){return ne||(ne=1,function(e,t){(function(i,o){o()})(wo,function(){function i(n,m){return typeof m>"u"?m={autoBom:!1}:typeof m!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),m={autoBom:!m}),m.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob(["\uFEFF",n],{type:n.type}):n}function o(n,m,k){var h=new XMLHttpRequest;h.open("GET",n),h.responseType="blob",h.onload=function(){f(h.response,m,k)},h.onerror=function(){console.error("could not download file")},h.send()}function r(n){var m=new XMLHttpRequest;m.open("HEAD",n,!1);try{m.send()}catch{}return 200<=m.status&&299>=m.status}function d(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{var m=document.createEvent("MouseEvents");m.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(m)}}var u=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof O=="object"&&O.global===O?O:void 0,p=u.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),f=u.saveAs||(typeof window!="object"||window!==u?function(){}:"download"in HTMLAnchorElement.prototype&&!p?function(n,m,k){var h=u.URL||u.webkitURL,b=document.createElement("a");m=m||n.name||"download",b.download=m,b.rel="noopener",typeof n=="string"?(b.href=n,b.origin===location.origin?d(b):r(b.href)?o(n,m,k):d(b,b.target="_blank")):(b.href=h.createObjectURL(n),setTimeout(function(){h.revokeObjectURL(b.href)},4e4),setTimeout(function(){d(b)},0))}:"msSaveOrOpenBlob"in navigator?function(n,m,k){if(m=m||n.name||"download",typeof n!="string")navigator.msSaveOrOpenBlob(i(n,k),m);else if(r(n))o(n,m,k);else{var h=document.createElement("a");h.href=n,h.target="_blank",setTimeout(function(){d(h)})}}:function(n,m,k,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof n=="string")return o(n,m,k);var b=n.type==="application/octet-stream",P=/constructor/i.test(u.HTMLElement)||u.safari,I=/CriOS\/[\d]+/.test(navigator.userAgent);if((I||b&&P||p)&&typeof FileReader<"u"){var A=new FileReader;A.onloadend=function(){var S=A.result;S=I?S:S.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=S:location=S,h=null},A.readAsDataURL(n)}else{var g=u.URL||u.webkitURL,F=g.createObjectURL(n);h?h.location=F:location.href=F,h=null,setTimeout(function(){g.revokeObjectURL(F)},4e4)}});u.saveAs=f.saveAs=f,e.exports=f})}(B)),B.exports}var Co=bo();const So="https://webhook.acedata.cloud/suno",Lo=C({name:"TaskPreview",components:{ElImage:X,ElIcon:G,ElTooltip:Re,ElButton:H,FontAwesomeIcon:q,VideoPlay:ee,VideoPause:x,ElDropdown:Ge,ElDropdownMenu:Me,ElDropdownItem:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===W.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){return this.$store.state.suno?.tasks},audios(){let e=[];const t=this.modelValue?.request?.action;return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(i=>{let o=i;t&&(o.action=t),e.push(o)}),e},application(){return this.$store.state.suno?.application},active(){return this.$store.state.suno?.tasks?.active}},methods:{useFormatDuring:M,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e.stopPropagation(),console.log("on download",t);const o=new URL(t).pathname,r=o.substring(o.lastIndexOf("/")+1);console.log("on preview",r),fetch(t).then(d=>d.blob()).then(d=>{Co.saveAs(d,r)})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){console.log("on cover"),console.debug("set config",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl("concat",e)},async onGenerateAudioUrl(e,t){const i={action:e,audio_id:t,callback_url:So},o=this.credential?.token;if(!o){console.error("no token specified");return}E.info(this.$t("suno.message.startingTask")),Q.audio(i,{token:o}).then(()=>{E.success(this.$t("suno.message.startTaskSuccess"))}).catch(r=>{E.error(r?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),jo={class:"task"},Ao=["onClick"],Eo={class:"left"},Vo=["onClick"],Io=["onClick"],To={key:2,class:"duration"},Po={class:"info"},Fo={class:"title"},Uo={class:"style"},zo={class:"right"},Mo={class:"el-dropdown-link"},Go={class:"el-dropdown-link"};function Ro(e,t,i,o,r,d){const u=c("el-image"),p=c("video-pause"),f=c("el-icon"),n=c("video-play"),m=c("el-button"),k=c("font-awesome-icon"),h=c("el-tooltip"),b=c("el-dropdown-item"),P=c("el-dropdown-menu"),I=c("el-dropdown"),A=te("loading");return a(),_("div",jo,[(a(!0),_(z,null,N(e.audios,(g,F)=>(a(),_("div",{key:F,class:"audio",onClick:S=>e.onClick(g)},[K((a(),_("div",Eo,[s(u,{src:g?.image_url,class:"cover",fit:"cover"},null,8,["src"]),g?.audio_url&&e.$store.state?.suno?.audio?.id===g.id&&e.$store.state?.suno?.audio?.state==="playing"?(a(),_("div",{key:0,class:"overlay",onClick:S=>e.onPause(g)},[s(f,null,{default:$(()=>[s(p)]),_:1})],8,Vo)):y("",!0),g?.audio_url&&(e.$store.state?.suno?.audio?.id!==g.id||e.$store.state?.suno?.audio?.id===g.id&&e.$store.state?.suno?.audio?.state==="paused")?(a(),_("div",{key:1,class:"overlay",onClick:S=>e.onPlay(g)},[s(f,null,{default:$(()=>[s(n)]),_:1})],8,Io)):y("",!0),g?.duration?(a(),_("div",To,v(e.useFormatDuring(g?.duration)),1)):y("",!0)])),[[A,!g?.audio_url]]),l("div",Po,[l("h2",Fo,v(g?.title),1),l("p",Uo,v(g?.style),1)]),l("div",zo,[g?.audio_url?(a(),w(m,{key:0,size:"small",round:"",onClick:S=>e.onExtend(S,g)},{default:$(()=>[T(v(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):y("",!0),s(h,{effect:"dark",content:e.$t("suno.button.video"),placement:"top"},{default:$(()=>[g?.video_url?(a(),w(k,{key:0,icon:"fa-solid fa-clapperboard",class:"icon icon-preview",onClick:S=>e.onPreview(S,g?.video_url)},null,8,["onClick"])):y("",!0)]),_:2},1032,["content"]),s(I,null,{dropdown:$(()=>[s(P,null,{default:$(()=>[g?.video_url?(a(),w(b,{key:0,onClick:S=>e.onDownload(S,g?.video_url)},{default:$(()=>[T(v(e.$t("suno.button.download_video")),1)]),_:2},1032,["onClick"])):y("",!0),g?.audio_url?(a(),w(b,{key:1,onClick:S=>e.onDownload(S,g?.audio_url)},{default:$(()=>[T(v(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):y("",!0)]),_:2},1024)]),default:$(()=>[l("span",Mo,[s(h,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:$(()=>[g?.audio_url||g?.video_url?(a(),w(k,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(I,null,{dropdown:$(()=>[s(P,null,{default:$(()=>[g.id?(a(),w(b,{key:0,onClick:S=>e.onGetStems(g.id)},{default:$(()=>[T(v(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):y("",!0),s(b,{onClick:S=>e.onCover(g)},{default:$(()=>[T(v(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"]),g?.id&&g?.action==="extend"?(a(),w(b,{key:1,onClick:S=>e.onConcatMusic(g?.id)},{default:$(()=>[T(v(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):y("",!0)]),_:2},1024)]),default:$(()=>[l("span",Go,[s(h,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:$(()=>[g?.audio_url||g?.video_url?(a(),w(k,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,Ao))),128))])}const Do=j(Lo,[["render",Ro]]),Oo={class:"player-slider"},Wo=C({__name:"PlayerSlider",setup(e){const t=R(),i=V({get:()=>t.state.suno?.audio?.progress,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:u})}),o=V({get:()=>t.state.suno?.audio?.duration,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:u})}),r=()=>{},d=u=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:u});return(u,p)=>(a(),_("div",Oo,[s(L(ce),{modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=f=>i.value=f),"show-tooltip":!1,min:0,max:o.value,onChange:d,onInput:r},null,8,["modelValue","max"])]))}}),Bo="/assets/disk-XFRmVAfp.png",No={class:"flex player-song"},qo=["src"],Ho={class:"ml-2 text-xs flex flex-col justify-between"},Ko={class:"w-52 2xl:w-96 cursor-pointer truncate"},Zo={class:"flex"},Xo={class:"ml-2 text-dc"},Jo=C({__name:"PlayerSong",setup(e){const t=R(),i=V({get:()=>t.state.suno.audio,set:o=>t.commit("suno/setAudio",o)});return ae(i,(o,r)=>{if(o?.audio_url!==r?.audio_url){console.log("audio changed",o),o.object&&(console.log("111",o.object),o.object.pause(),delete o.object);const d=new Audio(o.audio_url);o.state==="playing"?d.play():d.pause(),d.addEventListener("loadedmetadata",()=>{d.currentTime=0,d.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:d.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:d})}else if(o?.progress!==r?.progress&&Math.abs(o.progress-o.object.currentTime)>2){console.log("progress changed",o.progress);const d=t.state.suno.audio;d.object&&(d.object.currentTime=d.progress)}else o?.state!==r?.state&&(console.log("state changed",o.state),o.object&&(o.state==="playing"?o.object.play():o.object.pause()));o?.volume!==r?.volume&&(console.log("volume changed",o.volume),o.object&&(o.object.volume=o.volume/100))}),(o,r)=>(a(),_("div",No,[l("img",{alt:"",class:"w-11 h-11 rounded",src:i.value?.image_url||L(Bo)},null,8,qo),l("div",Ho,[l("div",Ko,[l("div",Zo,[l("span",null,v(i.value?.title||"Music"),1),l("span",Xo,"- "+v(i.value?.style||"SmallRuralDog"),1)])])])]))}}),Yo={class:"flex justify-end items-center gap-x-2.5"},Qo={class:"text-xs"},xo=C({__name:"PlayerAction",setup(e){const t=R(),i=V({get:()=>t.state.suno?.audio?.progress,set:r=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:r})}),o=V({get:()=>t.state.suno?.audio?.duration,set:r=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:r})});return(r,d)=>(a(),_("div",Yo,[l("span",Qo,v(L(M)(i.value))+" / "+v(L(M)(o.value)),1)]))}});var es={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 ts(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function os(e,t,i){var o=typeof t.fill=="string"?[t.fill]:t.fill||[],r=[],d=t.theme||i.theme;switch(d){case"outline":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none");break;case"filled":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("#FFF"),r.push("#FFF");break;case"two-tone":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:i.colors.twoTone.twoTone),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:i.colors.twoTone.twoTone);break;case"multi-color":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:i.colors.multiColor.outFillColor),r.push(typeof o[2]=="string"?o[2]:i.colors.multiColor.innerStrokeColor),r.push(typeof o[3]=="string"?o[3]:i.colors.multiColor.innerFillColor);break}return{size:t.size||i.size,strokeWidth:t.strokeWidth||i.strokeWidth,strokeLinecap:t.strokeLinecap||i.strokeLinecap,strokeLinejoin:t.strokeLinejoin||i.strokeLinejoin,colors:r,id:e}}var ss=Symbol("icon-context");function J(e,t,i){var o={name:"icon-"+e,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(d){var u=ts(),p=Ce(ss,es);return function(){var f=d.size,n=d.strokeWidth,m=d.strokeLinecap,k=d.strokeLinejoin,h=d.theme,b=d.fill,P=d.spin,I=os(u,{size:f,strokeWidth:n,strokeLinecap:m,strokeLinejoin:k,theme:h,fill:b},p),A=[p.prefix+"-icon"];return A.push(p.prefix+"-icon-"+e),t&&p.rtl&&A.push(p.prefix+"-icon-rtl"),P&&A.push(p.prefix+"-icon-spin"),s("span",{class:A.join(" ")},[i(I)])}}};return o}const ns=J("pause-one",!1,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("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),s("path",{d:"M19 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M29 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),is=J("play",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("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),s("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)])}),as=J("volume-mute",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("rect",{opacity:"0.01",x:"30",y:"18",width:"13",height:"13",fill:e.colors[2]},null),s("mask",{id:e.id+"603476ab",maskUnits:"userSpaceOnUse",x:"30",y:"18",width:"13",height:"13",style:{maskType:"alpha"}},[s("rect",{x:"30",y:"18",width:"13",height:"13",fill:e.colors[2]},null)]),s("g",{mask:"url(#"+e.id+"603476ab)"},[s("path",{d:"M40.7348 20.2858L32.2495 28.7711",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M32.2496 20.2858L40.7349 28.7711",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)]),s("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)])}),ue=J("volume-small",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("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),s("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)])}),Y=C({__name:"IconPark",props:{icon:{},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(t,i)=>(a(),w(le(t.icon),{theme:t.theme,size:t.size,spin:t.spin,fill:t.fill,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin,"stroke-width":t.strokeWidth},null,8,["theme","size","spin","fill","stroke-linecap","stroke-linejoin","stroke-width"]))}}),ls={class:"player-volume flex flex-col items-center pt-2"},rs={class:"text-sm mt-3"},cs={class:"mt-2"},us=C({__name:"PlayerVolumeSlider",setup(e){const t=R(),i=V({get:()=>t.state.suno.audio?.volume,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:u})}),o=V({get:()=>t.state.suno.audio?.muted,set:u=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:u})}),r=()=>t.dispatch("suno/toggleMuted"),d=u=>t.dispatch("suno/setVolume",u);return(u,p)=>(a(),_("div",ls,[l("div",null,[s(L(ce),{modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=f=>i.value=f),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:o.value,onInput:d},null,8,["modelValue","disabled"])]),l("div",rs,v(i.value),1),l("div",cs,[s(Y,{icon:o.value?L(as):L(ue),size:"16",theme:"filled",class:"hover-text",onClick:r},null,8,["icon"])])]))}}),ds={class:"flex items-center justify-center gap-x-3"},ps=C({__name:"PlayerController",setup(e){const t=R(),i=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),o=V(()=>t.state.suno.audio);return(r,d)=>(a(),_("div",ds,[s(Y,{icon:o.value?.state==="playing"?L(ns):L(is),size:"45",theme:"filled",class:"control",onClick:i},null,8,["icon"]),s(L(De),{placement:"top",width:"50px"},{reference:$(()=>[s(Y,{icon:L(ue),size:"20","stroke-width":3,class:"hover-text"},null,8,["icon"])]),default:$(()=>[s(us)]),_:1})]))}}),ms={class:"flex flex-col items-stretch h-20"},hs={class:"flex grow px-5 items-center"},fs={class:"flex-1"},_s={class:"flex-1"},$s={class:"flex-1"},vs=C({__name:"Player",setup(e){return(t,i)=>(a(),_("div",ms,[s(Wo),l("div",hs,[l("div",fs,[s(Jo)]),l("div",_s,[s(ps)]),l("div",$s,[s(xo)])])]))}}),gs=C({name:"RecentPanel",components:{TaskPreview:Do,ElSkeleton:We,ElSkeletonItem:Oe,Player:vs,NoTasks:Fe},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),ks={key:0,class:"tasks"},ys={class:"left"},ws={class:"main"},bs={key:1,class:"tasks"},Cs={key:2,class:"w-full h-full flex items-center justify-center"},Ss={class:"flex-1 flex flex-col"},Ls={class:"h-20"};function js(e,t,i,o,r,d){const u=c("el-skeleton-item"),p=c("el-skeleton"),f=c("task-preview"),n=c("no-tasks"),m=c("player");return a(),_(z,null,[l("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...k)=>e.onHandleScroll&&e.onHandleScroll(...k))},[e.tasks?.items===void 0?(a(),_("div",ks,[(a(),_(z,null,N(3,k=>l("div",{key:k,class:"task placeholder"},[l("div",ys,[s(p,{animated:""},{template:$(()=>[s(u,{variant:"image",class:"avatar"})]),_:1})]),l("div",ws,[s(p,{animated:""},{template:$(()=>[s(u,{variant:"p",class:"title"}),s(u,{variant:"text",style:{"margin-right":"16px"}}),s(u,{variant:"text",style:{width:"80%"}})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),_("div",bs,[(a(!0),_(z,null,N(e.tasks?.items,(k,h)=>(a(),w(f,{key:h,"model-value":k,class:"preview"},null,8,["model-value"]))),128))])):y("",!0),e.tasks?.items?.length===0?(a(),_("div",Cs,[s(n)])):y("",!0)],544),K(l("div",Ss,[l("div",Ls,[s(m)])],512),[[Se,!!e.$store?.state?.suno?.audio?.object]])],64)}const As=j(gs,[["render",js],["__scopeId","data-v-959f8920"]]),Es=C({name:"TaskPreview",components:{ElScrollbar:Be,IconPicture:Le,ElImage:X,ElAvatar:Xe,ElIcon:G},data(){return{showCloseIcon:!0}},computed:{audio(){return this.$store.state.suno?.audio}},methods:{closeCard(){this.showCloseIcon=!this.showCloseIcon}}}),Vs={key:0,class:"card"},Is={class:"image-container"},Ts={class:"image-slot"},Ps={class:"title"},Fs={class:"content"},Us={class:"artist"},zs={class:"style"},Ms={class:"time"},Gs={class:"lyrics"},Rs={key:1,class:"gradient-background"};function Ds(e,t,i,o,r,d){const u=c("icon-picture"),p=c("el-icon"),f=c("el-image"),n=c("el-avatar"),m=c("el-scrollbar");return a(),w(m,{class:"right-panel"},{default:$(()=>[e.audio?.object?(a(),_("div",Vs,[l("div",Is,[s(f,{src:e.audio.image_url,fit:"cover"},{error:$(()=>[l("div",Ts,[s(p,null,{default:$(()=>[s(u)]),_:1})])]),_:1},8,["src"]),l("h2",Ps,v(e.audio?.title),1)]),l("div",Fs,[l("div",Us,[s(n,{size:30,src:e.audio?.image_url},null,8,["src"]),l("span",null,v(e.audio?.prompt),1)]),l("p",zs,v(e.audio?.style),1),l("p",Ms,v(e.$dayjs.format(e.audio?.created_at)),1),l("div",Gs,[l("p",null,v(e.audio?.lyric),1)])])])):(a(),_("div",Rs))]),_:1})}const Os=j(Es,[["render",Ds],["__scopeId","data-v-9b29e9f9"]]),Ws="https://webhook.acedata.cloud/suno",Bs=C({name:"SunoIndex",components:{Layout:ot,ConfigPanel:yo,RecentPanel:As,PreviewPanel:Os},inject:["initialized"],data(){return{task:void 0,job:0}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===W.Request},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===W.Request},needApply(){return this.$store.state.suno.status.getApplications===W.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){clearInterval(this.job)},methods:{async onReachTop(){console.debug("reached top"),await this.onGetTasks({createdAtMax:this.tasks?.items?.[0]?.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){je.create({application:this.application}).then(({data:e})=>{this.application=e,E.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Ae&&E.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:i,createdAtMax:o}=e||{};console.debug("limit",t,"createdAtMin",i,"createdAtMax",o),await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:i,createdAtMax:o})},async onGenerateAudio(){const e={...this.config,callback_url:Ws},t=this.credential?.token;if(!t){console.error("no token specified");return}E.info(this.$t("suno.message.startingTask")),Q.audio(e,{token:t}).then(()=>{E.success(this.$t("suno.message.startTaskSuccess"))}).catch(i=>{E.error(i?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ns(e,t,i,o,r,d){const u=c("config-panel"),p=c("recent-panel"),f=c("preview-panel"),n=c("layout");return a(),w(n,null,{config:$(()=>[s(u,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:$(()=>[s(p,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),preview:$(()=>[s(f)]),_:1})}const jn=j(Bs,[["render",Ns],["__scopeId","data-v-f5721d95"]]);export{jn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as g,L as O,S as v,h as k,i as f,j as i,k as s,y as _,l as t,D as $,x as p,t as o,o as r,R as A,eO as S,m as N,p as T,q as L,eP as D,c4 as P,b as h,f as R,F as U,v as B,n as q}from"./index-
|
|
1
|
+
import{d as g,L as O,S as v,h as k,i as f,j as i,k as s,y as _,l as t,D as $,x as p,t as o,o as r,R as A,eO as S,m as N,p as T,q as L,eP as D,c4 as P,b as h,f as R,F as U,v as B,n as q}from"./index-4aBt5Vjx.js";import{F as w}from"./index.es-BOpBg0UI.js";import{E as F,a as V}from"./index-C6hA5TWo.js";import{E as j}from"./index-cwwhbHoU.js";import{E as b}from"./index-BJ9sBisj.js";import"./typescript-BDQzoLbE.js";import"./index-B7dvDo-P.js";import"./index-D0mYfORH.js";import"./index-r5W6hzzQ.js";import"./index-CA6dWpXZ.js";import"./dropdown-C1t8uY18.js";import"./debounce-BD0Llk1h.js";import"./index-DeUpuRmm.js";const H=g({name:"HelpEntry",components:{ElImage:b,ElDialog:O,ElPopover:j,ElMenu:V,ElMenuItem:F,FontAwesomeIcon:w},props:{visible:{type:Boolean,default:!0}},emits:["close"],computed:{site(){return this.$store.state.site}},methods:{onJoin(){window.open(this.$store.state.site?.features?.support?.discord?.url,"_blank")},onProfit(){this.$router.push({name:v})}}}),M={class:"flex"},X={class:"flex-1 text-center"};function z(e,n,E,y,I,x){const c=t("font-awesome-icon"),l=t("el-menu-item"),d=t("el-image"),m=t("el-popover"),a=t("el-menu"),u=t("el-dialog");return r(),f(u,{"model-value":e.visible,width:200,class:"text-center",onClose:n[0]||(n[0]=C=>e.$emit("close"))},{default:i(()=>[s(a,{collapse:!1,class:"menu"},{default:i(()=>[e.site?.features?.support?.discord?.enabled?(r(),f(l,{key:0,index:"1",onClick:e.onJoin},{title:i(()=>[$(p(e.$t("common.message.joinDiscord")),1)]),default:i(()=>[s(c,{icon:"fa-brands fa-discord",class:"mr-2"})]),_:1},8,["onClick"])):_("",!0),s(m,{width:350,trigger:"hover"},{reference:i(()=>[e.site?.features?.support?.wechat?.enabled?(r(),f(l,{key:0,index:"2"},{title:i(()=>[$(p(e.$t("common.message.addWeChat")),1)]),default:i(()=>[s(c,{icon:"fa-brands fa-weixin",class:"mr-2"})]),_:1})):_("",!0)]),default:i(()=>[o("div",M,[o("div",X,[s(d,{src:e.site?.features?.support?.wechat?.qr},null,8,["src"])])])]),_:1})]),_:1})]),_:1},8,["model-value"])}const J=k(H,[["render",z],["__scopeId","data-v-0fce633f"]]),G=g({name:"ProfileIndex",components:{ElImage:b,HelpDialog:J,FontAwesomeIcon:w},data(){return{operating:{locale:!1,dark:!1,help:!1}}},computed:{user(){return this.$store.getters.user},showSupport(){return this.$store?.state?.site?.features?.support?.enabled&&(this.$store?.state?.site?.features?.support?.discord?.enabled||this.$store?.state?.site?.features?.support?.wechat?.enabled)},showSite(){return this.$store?.state?.site?.admins?.includes(this.$store.getters.user?.id)},links(){return[{key:"profile",text:this.$t("console.menu.userProfile"),href:`${S()}/user/profile`,icon:"fa-regular fa-user"},{key:"application-list",text:this.$t("console.menu.applicationList"),name:N,icon:"fa-solid fa-cube"},{key:"order-list",text:this.$t("console.menu.orderList"),name:T,icon:"fa-solid fa-store"},{key:"usage-list",text:this.$t("console.menu.usageList"),name:L,icon:"fa-solid fa-rotate-left"},{key:"distribution-index",text:this.$t("console.menu.distributionIndex"),name:v,icon:"fa-solid fa-coins"},...this.showSite?[{key:"site-index",text:this.$t("common.nav.site"),name:D,icon:"fa-solid fa-gear"}]:[],{key:"dark-setting",text:this.$t("common.nav.darkMode"),icon:"fa-solid fa-moon",callback:()=>{this.operating.dark=!0}},{key:"locale-setting",text:this.$t("common.nav.locale"),icon:"fa-solid fa-language",callback:()=>{this.operating.locale=!0}},{key:"developerPlatform",text:this.$t("console.menu.developerPlatform"),href:P(),icon:"fa-solid fa-laptop-code"},...this.showSupport?[{key:"support",text:this.$t("common.nav.support"),callback:()=>{this.operating.help=!0},icon:"fa-solid fa-question"}]:[],{key:"logout",text:this.$t("common.nav.logOut"),icon:"fa-solid fa-arrow-right-from-bracket",callback:async()=>{await this.$store.dispatch("resetAll"),await this.$store.dispatch("chat/resetAll"),await this.$store.dispatch("midjourney/resetAll"),await this.$store.dispatch("qrart/resetAll"),await this.$store.dispatch("flux/resetAll"),await this.$store.dispatch("hailuo/resetAll"),await this.$store.dispatch("headshots/resetAll"),await this.$store.dispatch("kling/resetAll"),await this.$store.dispatch("luma/resetAll"),await this.$store.dispatch("pika/resetAll"),await this.$store.dispatch("suno/resetAll"),await this.$store.dispatch("login")}}]}},methods:{onHome(){this.$router.push({name:A})},onNavigate(e){e.name?this.$router.push({name:e.name}):e.href?window.open(e.href,"_blank"):e.callback&&e.callback()}}}),W={class:"profile"},K={class:"info"},Q={class:"links"},Y=["onClick"],Z={class:"icon"},ee={class:"text"},te={class:"suffix"};function se(e,n,E,y,I,x){const c=t("el-image"),l=t("font-awesome-icon"),d=t("locale-selector"),m=t("help-dialog");return r(),h("div",W,[o("div",K,[s(c,{src:e.user.avatar,fit:"cover",class:"avatar"},null,8,["src"]),o("h2",null,p(e.user.username),1),o("div",{style:R({backgroundImage:"url("+e.user.avatar+")"}),class:"background"},null,4)]),o("div",Q,[(r(!0),h(U,null,B(e.links,(a,u)=>(r(),h("a",{key:u,class:q({link:!0,active:e.$route.name===a.name}),onClick:C=>e.onNavigate(a)},[o("span",Z,[s(l,{icon:a.icon,class:"text-sm"},null,8,["icon"])]),o("span",ee,p(a.text),1),o("span",te,[s(l,{icon:"fa-solid fa-chevron-right",class:"text-sm"})])],10,Y))),128))]),s(d,{visible:e.operating.locale==!0,onClose:n[0]||(n[0]=a=>e.operating.locale=!1)},null,8,["visible"]),s(m,{visible:e.operating.help==!0,onClose:n[1]||(n[1]=a=>e.operating.help=!1)},null,8,["visible"])])}const _e=k(G,[["render",se],["__scopeId","data-v-54290de4"]]);export{_e as default};
|