@acedatacloud/nexior 3.1.0 → 3.2.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.
Files changed (65) hide show
  1. package/dist/assets/{Auth.c4fd6543.js → Auth.eb29fecd.js} +1 -1
  2. package/dist/assets/{Callback.784adadb.js → Callback.bce756e7.js} +1 -1
  3. package/dist/assets/{Chatdoc.e863aecb.js → Chatdoc.2bb8cda8.js} +1 -1
  4. package/dist/assets/{Console.9bbeec04.js → Console.6f0786f8.js} +1 -1
  5. package/dist/assets/Conversation.25d261b6.js +1 -0
  6. package/dist/assets/{Conversation.f2f4c9e3.js → Conversation.759ee12a.js} +1 -1
  7. package/dist/assets/{CopyToClipboard.9a6d36b2.js → CopyToClipboard.8ebe33f6.js} +1 -1
  8. package/dist/assets/{Detail.b724d57c.js → Detail.818f0f0f.js} +1 -1
  9. package/dist/assets/EditArray.d15327ac.js +1 -0
  10. package/dist/assets/{Extra.6693c258.js → Extra.0d9481ce.js} +1 -1
  11. package/dist/assets/{History.599d23bb.js → History.6dca5230.js} +1 -1
  12. package/dist/assets/{ImagePreview.ff6cbf48.js → ImagePreview.ea09ed5a.js} +1 -1
  13. package/dist/assets/{Index.96124590.js → Index.2cd1e2e3.js} +1 -1
  14. package/dist/assets/Index.3c3f4fc1.js +1 -0
  15. package/dist/assets/Index.42e8374d.js +1 -0
  16. package/dist/assets/{Index.2775b4f2.js → Index.69a9fb96.js} +1 -1
  17. package/dist/assets/{Index.9e24d783.css → Index.6c8f5464.css} +1 -1
  18. package/dist/assets/{Index.901aeb60.js → Index.6d6821d7.js} +1 -1
  19. package/dist/assets/Index.7ee208d3.js +1 -0
  20. package/dist/assets/{Index.9c2425da.js → Index.81276373.js} +1 -1
  21. package/dist/assets/{Index.dee49574.js → Index.8a860c6b.js} +1 -1
  22. package/dist/assets/Index.9f518f05.css +1 -0
  23. package/dist/assets/Index.a1a6a08f.js +1 -0
  24. package/dist/assets/Index.b5db29b1.css +1 -0
  25. package/dist/assets/Index.c7a00d2d.js +1 -0
  26. package/dist/assets/Index.ccacec38.js +1 -0
  27. package/dist/assets/Index.d8f1673b.js +1 -0
  28. package/dist/assets/Index.e7e7118c.css +1 -0
  29. package/dist/assets/Index.e988e706.js +3 -0
  30. package/dist/assets/{InfoIcon.22d607b5.js → InfoIcon.1ef9ef71.js} +1 -1
  31. package/dist/assets/{Invitees.f2ae1c14.js → Invitees.263d89e3.js} +1 -1
  32. package/dist/assets/{List.6c917dd6.js → List.11b23cd7.js} +1 -1
  33. package/dist/assets/{List.7e7413f7.js → List.c31ec3d1.js} +1 -1
  34. package/dist/assets/{List.9387cdb4.js → List.f3eb857a.js} +1 -1
  35. package/dist/assets/{Login.fb01d4c3.js → Login.9ed2b526.js} +1 -1
  36. package/dist/assets/{Main.3a9c8c9e.js → Main.0008686f.js} +1 -1
  37. package/dist/assets/{Manage.0e25feaa.js → Manage.780d1470.js} +1 -1
  38. package/dist/assets/{MarkdownRenderer.b8dddcde.js → MarkdownRenderer.257f3d63.js} +1 -1
  39. package/dist/assets/Navigator.87c585b8.js +1 -0
  40. package/dist/assets/{Pagination.30a7754d.js → Pagination.3b90ea43.js} +1 -1
  41. package/dist/assets/{Setting.944d243b.js → Setting.541358e7.js} +1 -1
  42. package/dist/assets/{Status.a3b342f7.js → Status.d10547c8.js} +1 -1
  43. package/dist/assets/{Subscribe.ed7f40d2.js → Subscribe.f1acca46.js} +1 -1
  44. package/dist/assets/{distribution.af63f352.js → distribution.bb1d0ed8.js} +1 -1
  45. package/dist/assets/index.56bf2312.css +1 -0
  46. package/dist/assets/{index.59517cde.js → index.d28a66ae.js} +3 -3
  47. package/dist/assets/{order.33583a13.js → order.6d451728.js} +1 -1
  48. package/dist/assets/{price.b9f5653c.js → price.e1faf3aa.js} +1 -1
  49. package/dist/index.html +2 -2
  50. package/package.json +1 -1
  51. package/dist/assets/Conversation.cc9f14fd.js +0 -1
  52. package/dist/assets/EditArray.66507131.js +0 -1
  53. package/dist/assets/Index.04f93f38.js +0 -1
  54. package/dist/assets/Index.15209515.js +0 -1
  55. package/dist/assets/Index.2535d92b.js +0 -3
  56. package/dist/assets/Index.34ce5dc0.css +0 -1
  57. package/dist/assets/Index.6e0fe5f0.css +0 -1
  58. package/dist/assets/Index.7dade7fc.js +0 -1
  59. package/dist/assets/Index.85a3f7a8.css +0 -1
  60. package/dist/assets/Index.b15395c6.js +0 -1
  61. package/dist/assets/Index.c49d2ae9.js +0 -1
  62. package/dist/assets/Index.d8c59104.js +0 -1
  63. package/dist/assets/Index.da37bfdf.js +0 -1
  64. package/dist/assets/Navigator.b29c6fbe.js +0 -1
  65. package/dist/assets/index.e6a7c4b6.css +0 -1
@@ -0,0 +1,3 @@
1
+ import{af as ke,ag as J,ah as we,ai as $e,aj as be,ak as Ce}from"./vendor-others.e28a6fa7.js";import{ar as ie}from"./vendor-fortawesome.0d8f27df.js";import{_ as k,aX as ve,A as Pe,aY as pe,a0 as se,F as Ae,ad as Se}from"./index.d28a66ae.js";import{Q as Ie,u as ae,N as Ne,O as Te,p as ge,x as Ee,y as F,t as le,m as re,k as ce,S as Ve,Y as _e,Z as me,s as Ue,h as je,i as Fe,j as Le,R as ye,_ as De,H as Ge,V as Re,$ as Me,a0 as qe,a1 as Oe}from"./vendor-element-plus.7eade167.js";import{H as w,al as u,o as r,e as _,R as $,f as a,I as oe,V as l,M as h,T as f,U as X,ai as ne,L as g,S as G,av as he,O as ue,m as K,u as L,s as ze,Q as Be,W as xe}from"./vendor-@vue.8cef8b94.js";import{I as ee}from"./InfoIcon.1ef9ef71.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const He=w({name:"LayoutSuno",components:{ElDrawer:Ie,ElButton:ae,FontAwesomeIcon:ie},data(){return{drawer:!1,preview:!1}},computed:{isPlaying(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.player)==null?void 0:t.isPlaying}}}),We={class:"main"},Ye={class:"config"},Ke={class:"result"},Qe={class:"preview"};function Xe(e,t,n,s,c,d){const i=u("font-awesome-icon"),p=u("el-button"),m=u("el-drawer");return r(),_("div",We,[$(" \u6700\u5DE6\u4FA7\u914D\u7F6E\u680F "),a("div",Ye,[oe(e.$slots,"config",{},void 0,!0)]),$(" \u4E2D\u95F4\u6B4C\u66F2\u5217\u8868\u680F "),a("div",Ke,[oe(e.$slots,"result",{},void 0,!0)]),$(" \u6700\u53F3\u8FB9\u6B4C\u66F2\u9884\u89C8\u680F "),a("div",Qe,[oe(e.$slots,"preview",{},void 0,!0)]),l(p,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:h(()=>[l(i,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),l(m,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:h(()=>[oe(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"]),$(` <el-drawer v-model="isPlaying" :with-header="false" size="340px" class="preview_drawer">
2
+ <slot name="preview" />
3
+ </el-drawer> `)])}var Ze=k(He,[["render",Xe],["__scopeId","data-v-0621513c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Suno.vue"]]);const Je=w({name:"VersionSelector",components:{ElSelect:Ne,ElOption:Te,ElSwitch:ge},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"}]}},computed:{custom:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,custom:e})}},model:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;console.debug("set model",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,model:e})}}},mounted(){this.model||(console.debug("set default type",ve),this.model=ve)}}),et={class:"field"},tt={class:"title font-bold"};function ot(e,t,n,s,c,d){const i=u("el-switch"),p=u("el-option"),m=u("el-select");return r(),_("div",et,[a("h2",tt,f(e.$t("suno.name.type")),1),l(i,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=v=>e.custom=v),class:"value"},null,8,["modelValue"]),l(m,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=v=>e.model=v),class:"value",placeholder:e.$t("suno.placeholder.select")},{default:h(()=>[(r(!0),_(X,null,ne(e.options,v=>(r(),g(p,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var st=k(Je,[["render",ot],["__scopeId","data-v-6d5f21aa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TypeSelector.vue"]]);const nt=w({name:"UploadAudio",components:{ElUpload:Ee,ElButton:ae,InfoIcon:ee,FontAwesomeIcon:ie},emits:["change"],data(){return{fileList:[],uploadUrl:Pe()+"/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=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio_id},set(e){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){F.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){F.error(this.$t("suno.message.uploadReferencesError"))},async onSuccess(){var t;const e=(t=this.urls)==null?void 0:t[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){var s;const t={audio_url:e},n=(s=this.credential)==null?void 0:s.token;if(!n){console.error("no token specified");return}F.info(this.$t("suno.message.startingUploadAudio")),pe.upload(t,{token:n}).then(c=>{var i,p;console.debug("get upload music success",c.data);const d=(i=c.data)==null?void 0:i.data.audio_id;this.$store.commit("suno/setConfig",{...(p=this.$store.state.suno)==null?void 0:p.config,audio_id:d,action:"upload_extend"}),F.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(c=>{var d,i,p;F.error(((p=(i=(d=c==null?void 0:c.response)==null?void 0:d.data)==null?void 0:i.error)==null?void 0:p.message)||this.$t("suno.message.startUploadAudioFailed"))})},onSetAudio(){}}}),it={class:"relative"},at={class:"flex justify-between"},lt={class:"flex justify-start items-center"},rt={class:"text-sm font-bold"};function ct(e,t,n,s,c,d){const i=u("info-icon"),p=u("font-awesome-icon"),m=u("el-button"),v=u("el-upload");return r(),_("div",it,[a("div",at,[a("div",lt,[a("span",rt,f(e.$t("suno.name.referenceAudios")),1),l(i,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),l(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=C=>e.fileList=C),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:h(()=>[l(m,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[l(p,{icon:"fa-solid fa-upload",class:"icon mr-1"}),G(" "+f(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var ut=k(nt,[["render",ct],["__scopeId","data-v-3fef3e18"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/UploadAudio.vue"]]);const dt="",pt=w({name:"PromptInput",components:{ElInput:le,ElSwitch:ge,InfoIcon:ee},data(){return{}},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,prompt:e})}},instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,instrumental:e})}}},mounted(){this.value||(this.value=dt)}}),_t={class:"field"},mt={class:"box"},ht={class:"title-info"},ft={class:"title font-bold"},vt={class:"instrumental"},$t={class:"title inline-block"};function gt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-switch"),m=u("el-input");return r(),_("div",_t,[a("div",mt,[a("div",ht,[a("h2",ft,f(e.$t("suno.name.prompt")),1),l(i,{content:e.$t("suno.description.prompt"),class:"info"},null,8,["content"])]),a("div",vt,[l(p,{modelValue:e.instrumental,"onUpdate:modelValue":t[0]||(t[0]=v=>e.instrumental=v),class:"value mr-2"},null,8,["modelValue"]),a("h2",$t,f(e.$t("suno.name.instrumental")),1)])]),l(m,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=v=>e.prompt=v),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("suno.placeholder.prompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var yt=k(pt,[["render",gt],["__scopeId","data-v-11b65236"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/PromptInput.vue"]]);const kt="",wt=w({name:"LyricInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{lyric:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.lyric},set(e){var t;console.debug("set lyric",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,lyric:e})}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},mounted(){this.value||(this.value=kt)}}),bt={class:"field"},Ct={class:"box"},Pt={class:"title font-bold"};function At(e,t,n,s,c,d){var m;const i=u("info-icon"),p=u("el-input");return r(),_("div",bt,[a("div",Ct,[a("h2",Pt,f(e.$t("suno.name.lyrics")),1),l(i,{content:e.$t("suno.description.lyrics"),class:"info"},null,8,["content"])]),((m=e.config)==null?void 0:m.action)!=="extend"?(r(),g(p,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"])):(r(),g(p,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"]))])}var St=k(wt,[["render",At],["__scopeId","data-v-b47f1748"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/LyricInput.vue"]]);const It=w({name:"StyleInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{style:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.style},set(e){var t;console.debug("set style",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,style:e})}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}}}),Nt={class:"field"},Tt={class:"title-container"},Et={class:"titlefont-bold"};function Vt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-input");return r(),_("div",Nt,[a("div",Tt,[a("h2",Et,f(e.$t("suno.name.style")),1),l(i,{content:e.$t("suno.description.style"),class:"info"},null,8,["content"])]),l(p,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=m=>e.style=m),rows:3,type:"textarea",class:"style",placeholder:e.$t("suno.placeholder.style"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Ut=k(It,[["render",Vt],["__scopeId","data-v-075e574a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/StyleInput.vue"]]);const jt="",Ft=w({name:"TitleInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{title:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.title},set(e){var t;console.debug("set title",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,title:e})}},instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,instrumental:e})}}},mounted(){this.value||(this.value=jt)}}),Lt={class:"field"},Dt={class:"title-container"},Gt={class:"title font-bold"};function Rt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-input");return r(),_("div",Lt,[a("div",Dt,[a("h2",Gt,f(e.$t("suno.name.title")),1),l(i,{content:e.$t("suno.description.title"),class:"info"},null,8,["content"])]),l(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=m=>e.title=m),rows:3,type:"textarea",class:"title",placeholder:e.$t("suno.placeholder.title"),maxlength:80,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Mt=k(Ft,[["render",Rt],["__scopeId","data-v-f9bac2fa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TitleInput.vue"]]);function Z(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const n=e%60,s=n<10?`0${n}`:n,c=t<10?`0${t}`:t;return s+":"+c}const qt=w({name:"ExtendFromInput",components:{ElImage:re,ElIcon:ce,ElInputNumber:Ve,VideoPlay:_e,VideoPause:me},data(){return{}},computed:{audio(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.continue_at},set(e){var t;console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){var t,n;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(n=this.audio)==null?void 0:n.duration:this.value=e},useFormatDuring:Z,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){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})}}}),Ot={class:"field"},zt={class:"box"},Bt={class:"title font-bold"},xt={class:"input-wrapper"},Ht={class:"task"},Wt={class:"left"},Yt={key:2,class:"duration"},Kt={class:"info"},Qt={class:"title"},Xt={class:"style"};function Zt(e,t,n,s,c,d){var P,b,A,S,T,o,j,E,V,U,I,D,R,M,q,O,z,B,x,H,W,Y,y,Q,fe;const i=u("el-input-number"),p=u("el-image"),m=u("video-pause"),v=u("el-icon"),C=u("video-play"),N=he("loading");return r(),_("div",Ot,[a("div",zt,[a("h2",Bt,f(e.$t("suno.name.extend")),1),a("div",xt,[l(i,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=te=>e.value=te),class:"value",min:0,max:(P=e.audio)==null?void 0:P.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),a("div",Ht,[a("div",{class:"audio",onClick:t[3]||(t[3]=te=>e.onClick(e.audio))},[ue((r(),_("div",Wt,[l(p,{src:(b=e.audio)==null?void 0:b.image_url,class:"cover",fit:"cover"},null,8,["src"]),((A=e.audio)==null?void 0:A.audio_url)&&((o=(T=(S=e.$store.state)==null?void 0:S.suno)==null?void 0:T.audio)==null?void 0:o.id)===e.audio.id&&((V=(E=(j=e.$store.state)==null?void 0:j.suno)==null?void 0:E.audio)==null?void 0:V.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=te=>e.onPause(e.audio))},[l(v,null,{default:h(()=>[l(m)]),_:1})])):$("v-if",!0),((U=e.audio)==null?void 0:U.audio_url)&&(((R=(D=(I=e.$store.state)==null?void 0:I.suno)==null?void 0:D.audio)==null?void 0:R.id)!==e.audio.id||((O=(q=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:q.audio)==null?void 0:O.id)===e.audio.id&&((x=(B=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:B.audio)==null?void 0:x.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=te=>e.onPlay(e.audio))},[l(v,null,{default:h(()=>[l(C)]),_:1})])):$("v-if",!0),(H=e.audio)!=null&&H.duration?(r(),_("div",Yt,f(e.useFormatDuring((W=e.audio)==null?void 0:W.duration)),1)):$("v-if",!0)])),[[N,!((Y=e.audio)!=null&&Y.audio_url)||!((y=e.audio)!=null&&y.video_url)]]),a("div",Kt,[a("h2",Qt,f((Q=e.audio)==null?void 0:Q.title),1),a("p",Xt,f((fe=e.audio)==null?void 0:fe.style),1)])])])])}var Jt=k(qt,[["render",Zt],["__scopeId","data-v-040b76e5"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/ExtendFromInput.vue"]]);const eo=w({name:"CoverFromInput",components:{ElImage:re,ElIcon:ce,VideoPlay:_e,VideoPause:me},data(){return{}},computed:{audio(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.continue_at},set(e){var t;console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){var t,n;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(n=this.audio)==null?void 0:n.duration:this.value=e},useFormatDuring:Z,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){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})}}}),to={class:"field"},oo={class:"box"},so={class:"title font-bold"},no={class:"task"},io={class:"left"},ao={key:2,class:"duration"},lo={class:"info"},ro={class:"title"},co={class:"style"};function uo(e,t,n,s,c,d){var N,P,b,A,S,T,o,j,E,V,U,I,D,R,M,q,O,z,B,x,H,W,Y,y;const i=u("el-image"),p=u("video-pause"),m=u("el-icon"),v=u("video-play"),C=he("loading");return r(),_("div",to,[a("div",oo,[a("h2",so,f(e.$t("suno.name.cover")),1)]),a("div",no,[e.audio?(r(),_("div",{key:0,class:"audio",onClick:t[2]||(t[2]=Q=>e.onClick(e.audio))},[ue((r(),_("div",io,[l(i,{src:(N=e.audio)==null?void 0:N.image_url,class:"cover",fit:"cover"},null,8,["src"]),((P=e.audio)==null?void 0:P.audio_url)&&((S=(A=(b=e.$store.state)==null?void 0:b.suno)==null?void 0:A.audio)==null?void 0:S.id)===e.audio.id&&((j=(o=(T=e.$store.state)==null?void 0:T.suno)==null?void 0:o.audio)==null?void 0:j.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=Q=>e.onPause(e.audio))},[l(m,null,{default:h(()=>[l(p)]),_:1})])):$("v-if",!0),((E=e.audio)==null?void 0:E.audio_url)&&(((I=(U=(V=e.$store.state)==null?void 0:V.suno)==null?void 0:U.audio)==null?void 0:I.id)!==e.audio.id||((M=(R=(D=e.$store.state)==null?void 0:D.suno)==null?void 0:R.audio)==null?void 0:M.id)===e.audio.id&&((z=(O=(q=e.$store.state)==null?void 0:q.suno)==null?void 0:O.audio)==null?void 0:z.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=Q=>e.onPlay(e.audio))},[l(m,null,{default:h(()=>[l(v)]),_:1})])):$("v-if",!0),(B=e.audio)!=null&&B.duration?(r(),_("div",ao,f(e.useFormatDuring((x=e.audio)==null?void 0:x.duration)),1)):$("v-if",!0)])),[[C,!((H=e.audio)!=null&&H.audio_url)||!((W=e.audio)!=null&&W.video_url)]]),a("div",lo,[a("h2",ro,f((Y=e.audio)==null?void 0:Y.title),1),a("p",co,f((y=e.audio)==null?void 0:y.style),1)])])):$("v-if",!0)])])}var po=k(eo,[["render",uo],["__scopeId","data-v-68ea6e7a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/CoverFromInput.vue"]]);const _o=w({name:"PresetPanel",components:{TypeSelector:st,PromptInput:yt,LyricInput:St,StyleInput:Ut,TitleInput:Mt,ExtendFromInput:Jt,CoverFromInput:po,UploadAudio:ut,FontAwesomeIcon:ie,ElButton:ae},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),mo={class:"panel"},ho={class:"config"},fo={class:"actions"};function vo(e,t,n,s,c,d){var T,o,j,E,V,U,I;const i=u("type-selector"),p=u("upload-audio"),m=u("prompt-input"),v=u("lyric-input"),C=u("style-input"),N=u("title-input"),P=u("extend-from-input"),b=u("cover-from-input"),A=u("font-awesome-icon"),S=u("el-button");return r(),_("div",mo,[a("div",ho,[l(i,{class:"mb-4"}),l(p,{class:"mb-4"}),(T=e.config)!=null&&T.custom?$("v-if",!0):(r(),g(m,{key:0,class:"mb-4"})),((o=e.config)==null?void 0:o.custom)&&!e.config.instrumental?(r(),g(v,{key:1,class:"mb-4"})):$("v-if",!0),(j=e.config)!=null&&j.custom?(r(),g(C,{key:2,class:"mb-4"})):$("v-if",!0),(E=e.config)!=null&&E.custom?(r(),g(N,{key:3,class:"mb-4"})):$("v-if",!0),((V=e.config)==null?void 0:V.action)==="extend"?(r(),g(P,{key:4,class:"mb-4"})):$("v-if",!0),((U=e.config)==null?void 0:U.action)==="cover"?(r(),g(b,{key:5,class:"mb-4"})):$("v-if",!0),a("div",fo,[((I=e.config)==null?void 0:I.action)!=="extend"?(r(),g(S,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[l(A,{icon:"fa-solid fa-magic",class:"mr-2"}),G(" "+f(e.$t("suno.button.generate")),1)]),_:1},8,["onClick"])):(r(),g(S,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[l(A,{icon:"fa-solid fa-magic",class:"mr-2"}),G(" "+f(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"]))])])])}var $o=k(_o,[["render",vo],["__scopeId","data-v-38bb3c66"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/ConfigPanel.vue"]]);const go="https://webhook.acedata.cloud/suno",yo=w({name:"TaskPreview",components:{ElImage:re,ElIcon:ce,ElTooltip:Ue,ElButton:ae,FontAwesomeIcon:ie,VideoPlay:_e,VideoPause:me,ElDropdown:je,ElDropdownMenu:Fe,ElDropdownItem:Le},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{loading(){var e,t;return((t=(e=this.$store.state.suno)==null?void 0:e.status)==null?void 0:t.getApplications)===se.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){var e;return(e=this.$store.state.suno)==null?void 0:e.tasks},audios(){var n,s,c,d,i,p,m;let e=[];const t=(s=(n=this.modelValue)==null?void 0:n.request)==null?void 0:s.action;return Array.isArray((d=(c=this.modelValue)==null?void 0:c.response)==null?void 0:d.data)&&((m=(p=(i=this.modelValue)==null?void 0:i.response)==null?void 0:p.data)==null||m.forEach(v=>{let C=v;t&&(C.action=t),e.push(C)})),e},application(){var e;return(e=this.$store.state.suno)==null?void 0:e.application},active(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.tasks)==null?void 0:t.active}},methods:{useFormatDuring:Z,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){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){var n;e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...(n=this.$store.state.suno)==null?void 0:n.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 s=new URL(t).pathname,c=s.substring(s.lastIndexOf("/")+1);console.log("on preview",c),fetch(t).then(d=>d.blob()).then(d=>{ke.exports.saveAs(d,c)})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e,t){e.stopPropagation(),console.log("on get stems",t),await this.onGenerateAudioUrl("stems",t)},onCover(e,t){var n;e.stopPropagation(),console.log("on cover"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...(n=this.$store.state.suno)==null?void 0:n.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"cover",audio:t,audio_id:t.id})},async onConcatMusic(e,t){e.stopPropagation(),console.log("on get concat",t),await this.onGenerateAudioUrl("concat",t)},async onGenerateAudioUrl(e,t){var c;const n={action:e,audio_id:t,callback_url:go},s=(c=this.credential)==null?void 0:c.token;if(!s){console.error("no token specified");return}F.info(this.$t("suno.message.startingTask")),pe.audio(n,{token:s}).then(()=>{F.success(this.$t("suno.message.startTaskSuccess"))}).catch(d=>{var i,p,m;F.error(((m=(p=(i=d==null?void 0:d.response)==null?void 0:i.data)==null?void 0:p.error)==null?void 0:m.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})}}}),ko={class:"task"},wo=["onClick"],bo={class:"left"},Co=["onClick"],Po=["onClick"],Ao={key:2,class:"duration"},So={class:"info"},Io={class:"title"},No={class:"style"},To={class:"right"},Eo={class:"el-dropdown-link"},Vo={class:"el-dropdown-link"};function Uo(e,t,n,s,c,d){const i=u("el-image"),p=u("video-pause"),m=u("el-icon"),v=u("video-play"),C=u("el-button"),N=u("font-awesome-icon"),P=u("el-tooltip"),b=u("el-dropdown-item"),A=u("el-dropdown-menu"),S=u("el-dropdown"),T=he("loading");return r(),_("div",ko,[(r(!0),_(X,null,ne(e.audios,(o,j)=>{var E,V,U,I,D,R,M,q,O,z,B,x,H,W,Y;return r(),_("div",{key:j,class:"audio",onClick:y=>e.onClick(o)},[ue((r(),_("div",bo,[l(i,{src:o==null?void 0:o.image_url,class:"cover",fit:"cover"},null,8,["src"]),(o==null?void 0:o.audio_url)&&((U=(V=(E=e.$store.state)==null?void 0:E.suno)==null?void 0:V.audio)==null?void 0:U.id)===o.id&&((R=(D=(I=e.$store.state)==null?void 0:I.suno)==null?void 0:D.audio)==null?void 0:R.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:y=>e.onPause(o)},[l(m,null,{default:h(()=>[l(p)]),_:1})],8,Co)):$("v-if",!0),(o==null?void 0:o.audio_url)&&(((O=(q=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:q.audio)==null?void 0:O.id)!==o.id||((x=(B=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:B.audio)==null?void 0:x.id)===o.id&&((Y=(W=(H=e.$store.state)==null?void 0:H.suno)==null?void 0:W.audio)==null?void 0:Y.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:y=>e.onPlay(o)},[l(m,null,{default:h(()=>[l(v)]),_:1})],8,Po)):$("v-if",!0),o!=null&&o.duration?(r(),_("div",Ao,f(e.useFormatDuring(o==null?void 0:o.duration)),1)):$("v-if",!0)])),[[T,!(o!=null&&o.audio_url)||!(o!=null&&o.video_url)]]),a("div",So,[a("h2",Io,f(o==null?void 0:o.title),1),a("p",No,f(o==null?void 0:o.style),1)]),a("div",To,[(o==null?void 0:o.audio_url)&&(o==null?void 0:o.video_url)?(r(),g(C,{key:0,size:"small",round:"",onClick:y=>e.onExtend(y,o)},{default:h(()=>[G(f(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):$("v-if",!0),l(P,{effect:"dark",content:e.$t("suno.button.video"),placement:"top"},{default:h(()=>[o!=null&&o.video_url?(r(),g(N,{key:0,icon:"fa-solid fa-clapperboard",class:"icon icon-preview",onClick:y=>e.onPreview(y,o==null?void 0:o.video_url)},null,8,["onClick"])):$("v-if",!0)]),_:2},1032,["content"]),l(S,null,{dropdown:h(()=>[l(A,null,{default:h(()=>[o!=null&&o.video_url?(r(),g(b,{key:0,onClick:y=>e.onDownload(y,o==null?void 0:o.video_url)},{default:h(()=>[G(f(e.$t("suno.button.download_video")),1)]),_:2},1032,["onClick"])):$("v-if",!0),o!=null&&o.audio_url?(r(),g(b,{key:1,onClick:y=>e.onDownload(y,o==null?void 0:o.audio_url)},{default:h(()=>[G(f(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):$("v-if",!0)]),_:2},1024)]),default:h(()=>[a("span",Eo,[l(P,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:h(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),g(N,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):$("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024),l(S,null,{dropdown:h(()=>[l(A,null,{default:h(()=>[o!=null&&o.video_url?(r(),g(b,{key:0,onClick:y=>e.onGetStems(y,o==null?void 0:o.id)},{default:h(()=>[G(f(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):$("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),g(b,{key:1,onClick:y=>e.onCover(y,o)},{default:h(()=>[G(f(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"])):$("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),g(b,{key:2,onClick:y=>e.onConcatMusic(y,o==null?void 0:o.id)},{default:h(()=>[G(f(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):$("v-if",!0)]),_:2},1024)]),default:h(()=>[a("span",Vo,[l(P,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:h(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),g(N,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):$("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,wo)}),128))])}var jo=k(yo,[["render",Uo],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/task/Preview.vue"]]);const Fo={class:"player-slider"},Lo=w({__name:"PlayerSlider",setup(e){const t=J(),n=K({get:()=>{var i,p;return(p=(i=t.state.suno)==null?void 0:i.audio)==null?void 0:p.progress},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:i})}),s=K({get:()=>{var i,p;return(p=(i=t.state.suno)==null?void 0:i.audio)==null?void 0:p.duration},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:i})}),c=()=>{},d=i=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:i});return(i,p)=>(r(),_("div",Fo,[l(L(ye),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),"show-tooltip":!1,min:0,max:s.value,onChange:d,onInput:c},null,8,["modelValue","max"])]))}});var Do=k(Lo,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSlider.vue"]]),Go="/assets/disk.4907c891.png";const Ro={class:"flex player-song"},Mo=["src"],qo={class:"ml-2 text-xs flex flex-col justify-between"},Oo={class:"w-52 2xl:w-96 cursor-pointer truncate"},zo={class:"flex"},Bo={class:"ml-2 text-dc"},xo=w({__name:"PlayerSong",setup(e){const t=J(),n=K({get:()=>t.state.suno.audio,set:s=>t.commit("suno/setAudio",s)});return ze(n,(s,c)=>{if((s==null?void 0:s.audio_url)!==(c==null?void 0:c.audio_url)){console.log("audio changed",s),s.object&&(console.log("111",s.object),s.object.pause(),delete s.object);const d=new Audio(s.audio_url);s.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((s==null?void 0:s.progress)!==(c==null?void 0:c.progress)&&Math.abs(s.progress-s.object.currentTime)>2){console.log("progress changed",s.progress);const d=t.state.suno.audio;d.object&&(d.object.currentTime=d.progress)}else(s==null?void 0:s.state)!==(c==null?void 0:c.state)&&(console.log("state changed",s.state),s.object&&(s.state==="playing"?s.object.play():s.object.pause()));(s==null?void 0:s.volume)!==(c==null?void 0:c.volume)&&(console.log("volume changed",s.volume),s.object&&(s.object.volume=s.volume/100))}),(s,c)=>{var d,i,p;return r(),_("div",Ro,[a("img",{alt:"",class:"w-11 h-11 rounded",src:((d=n.value)==null?void 0:d.image_url)||L(Go)},null,8,Mo),a("div",qo,[a("div",Oo,[a("div",zo,[a("span",null,f(((i=n.value)==null?void 0:i.title)||"Music"),1),a("span",Bo,"- "+f(((p=n.value)==null?void 0:p.style)||"SmallRuralDog"),1)])])])])}}});var Ho=k(xo,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSong.vue"]]);const Wo={class:"flex justify-end items-center gap-x-2.5"},Yo={class:"text-xs"},Ko=w({__name:"PlayerAction",setup(e){const t=J(),n=K({get:()=>{var c,d;return(d=(c=t.state.suno)==null?void 0:c.audio)==null?void 0:d.progress},set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:c})}),s=K({get:()=>{var c,d;return(d=(c=t.state.suno)==null?void 0:c.audio)==null?void 0:d.duration},set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:c})});return(c,d)=>(r(),_("div",Wo,[a("span",Yo,f(L(Z)(n.value))+" / "+f(L(Z)(s.value)),1)]))}});var Qo=k(Ko,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerAction.vue"]]);const Xo=w({__name:"IconPark",props:{icon:{type:null,required:!0},theme:{type:String,required:!1},size:{type:[Number,String],required:!1},spin:{type:Boolean,required:!1},fill:{type:[String,Array],required:!1},strokeLinecap:{type:String,required:!1},strokeLinejoin:{type:String,required:!1},strokeWidth:{type:Number,required:!1}},setup(e){return(t,n)=>(r(),g(Be(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"]))}});var de=k(Xo,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/IconPark.vue"]]);const Zo={class:"player-volume flex flex-col items-center pt-2"},Jo={class:"text-sm mt-3"},es={class:"mt-2"},ts=w({__name:"PlayerVolumeSlider",setup(e){const t=J(),n=K({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.volume},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:i})}),s=K({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.muted},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:i})}),c=()=>t.dispatch("suno/toggleMuted"),d=i=>t.dispatch("suno/setVolume",i);return(i,p)=>(r(),_("div",Zo,[a("div",null,[l(L(ye),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:s.value,onInput:d},null,8,["modelValue","disabled"])]),a("div",Jo,f(n.value),1),a("div",es,[l(de,{icon:s.value?L(we):L($e),size:"16",theme:"filled",class:"hover-text",onClick:c},null,8,["icon"])])]))}});var os=k(ts,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerVolumeSlider.vue"]]);const ss={class:"flex items-center justify-center gap-x-3"},ns=w({__name:"PlayerController",setup(e){const t=J(),n=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),s=K(()=>t.state.suno.audio);return(c,d)=>{var i;return r(),_("div",ss,[l(de,{icon:((i=s.value)==null?void 0:i.state)==="playing"?L(be):L(Ce),size:"45",theme:"filled",class:"control",onClick:n},null,8,["icon"]),l(L(De),{placement:"top",width:"50px"},{reference:h(()=>[l(de,{icon:L($e),size:"20","stroke-width":3,class:"hover-text"},null,8,["icon"])]),default:h(()=>[l(os)]),_:1})])}}});var is=k(ns,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerController.vue"]]);const as={class:"flex flex-col items-stretch h-20"},ls={class:"flex grow px-5 items-center"},rs={class:"flex-1"},cs={class:"flex-1"},us={class:"flex-1"},ds=w({__name:"Player",setup(e){return(t,n)=>(r(),_("div",as,[l(Do),a("div",ls,[a("div",rs,[l(Ho)]),a("div",cs,[l(is)]),a("div",us,[l(Qo)])])]))}});var ps=k(ds,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/Player.vue"]]);const _s=w({name:"RecentPanel",components:{TaskPreview:jo,ElSkeleton:Ge,ElSkeletonItem:Re,Player:ps},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,n,s;return{...(e=this.$store.state.suno)==null?void 0:e.tasks,items:(s=(n=(t=this.$store.state.suno)==null?void 0:t.tasks)==null?void 0:n.items)==null?void 0:s.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),ms={key:0,class:"tasks"},hs={class:"left"},fs={class:"main"},vs={key:1,class:"tasks"},$s={key:2,class:"description"},gs={class:"flex-1 flex flex-col"},ys={class:"h-20"};function ks(e,t,n,s,c,d){var C,N,P,b,A,S,T,o,j,E,V,U;const i=u("el-skeleton-item"),p=u("el-skeleton"),m=u("task-preview"),v=u("player");return r(),_(X,null,[a("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...I)=>e.onHandleScroll&&e.onHandleScroll(...I))},[((C=e.tasks)==null?void 0:C.items)===void 0?(r(),_("div",ms,[(r(),_(X,null,ne(3,I=>a("div",{key:I,class:"task placeholder"},[a("div",hs,[l(p,{animated:""},{template:h(()=>[l(i,{variant:"image",class:"avatar"})]),_:1})]),a("div",fs,[l(p,{animated:""},{template:h(()=>[l(i,{variant:"p",class:"title"}),l(i,{variant:"text",style:{"margin-right":"16px"}}),l(i,{variant:"text",style:{width:"80%"}})]),_:1})])])),64))])):((P=(N=e.tasks)==null?void 0:N.items)==null?void 0:P.length)&&((A=(b=e.tasks)==null?void 0:b.items)==null?void 0:A.length)>0?(r(),_("div",vs,[(r(!0),_(X,null,ne((S=e.tasks)==null?void 0:S.items,(I,D)=>(r(),g(m,{key:D,"model-value":I,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((o=(T=e.tasks)==null?void 0:T.items)==null?void 0:o.length)===0?(r(),_("p",$s,f(e.$t("suno.message.noTasks")),1)):$("v-if",!0)],544),ue(a("div",gs,[a("div",ys,[l(v)])],512),[[xe,!!((U=(V=(E=(j=e.$store)==null?void 0:j.state)==null?void 0:E.suno)==null?void 0:V.audio)!=null&&U.object)]])],64)}var ws=k(_s,[["render",ks],["__scopeId","data-v-9a683526"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/RecentPanel.vue"]]);const bs=w({name:"TaskPreview",components:{ElScrollbar:Me,IconPicture:qe,ElImage:re,ElAvatar:Oe,ElIcon:ce},data(){return{showCloseIcon:!0}},computed:{audio(){var e;return(e=this.$store.state.suno)==null?void 0:e.audio}},methods:{closeCard(){this.showCloseIcon=!this.showCloseIcon}}}),Cs={key:0,class:"card"},Ps={class:"image-container"},As={class:"image-slot"},Ss={class:"title"},Is={class:"content"},Ns={class:"artist"},Ts={class:"style"},Es={class:"time"},Vs={class:"lyrics"},Us={key:1,class:"gradient-background"};function js(e,t,n,s,c,d){const i=u("icon-picture"),p=u("el-icon"),m=u("el-image"),v=u("el-avatar"),C=u("el-scrollbar");return r(),g(C,{class:"right-panel"},{default:h(()=>{var N,P,b,A,S,T,o;return[(N=e.audio)!=null&&N.object?(r(),_("div",Cs,[a("div",Ps,[l(m,{src:e.audio.image_url,fit:"cover"},{error:h(()=>[a("div",As,[l(p,null,{default:h(()=>[l(i)]),_:1})])]),_:1},8,["src"]),a("h2",Ss,f((P=e.audio)==null?void 0:P.title),1)]),a("div",Is,[a("div",Ns,[l(v,{size:30,src:(b=e.audio)==null?void 0:b.image_url},null,8,["src"]),a("span",null,f((A=e.audio)==null?void 0:A.prompt),1)]),a("p",Ts,f((S=e.audio)==null?void 0:S.style),1),a("p",Es,f(e.$dayjs.format((T=e.audio)==null?void 0:T.created_at)),1),a("div",Vs,[a("p",null,f((o=e.audio)==null?void 0:o.lyric),1)])])])):(r(),_("div",Us))]}),_:1})}var Fs=k(bs,[["render",js],["__scopeId","data-v-19e67a48"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/PreviewPanel.vue"]]);const Ls="https://webhook.acedata.cloud/suno",Ds=w({name:"SunoIndex",components:{Layout:Ze,ConfigPanel:$o,RecentPanel:ws,PreviewPanel:Fs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.suno)==null?void 0:e.status)==null?void 0:t.getApplications)===se.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===se.Request},needApply(){return this.$store.state.suno.status.getApplications===se.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){var n,s;((n=e==null?void 0:e.items)==null?void 0:n.length)>((s=t==null?void 0:t.items)==null?void 0:s.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,n;console.debug("reached top"),await this.onGetTasks({createdAtMax:(n=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:n.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(){Ae.create({application:this.application}).then(({data:e})=>{this.application=e,F.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,n;((n=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:n.code)===Se&&F.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:n,createdAtMax:s}=e||{};console.debug("limit",t,"createdAtMin",n,"createdAtMax",s),await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:n,createdAtMax:s})},async onGenerateAudio(){var n;const e={...this.config,callback_url:Ls},t=(n=this.credential)==null?void 0:n.token;if(!t){console.error("no token specified");return}F.info(this.$t("suno.message.startingTask")),pe.audio(e,{token:t}).then(()=>{F.success(this.$t("suno.message.startTaskSuccess"))}).catch(s=>{var c,d,i;F.error(((i=(d=(c=s==null?void 0:s.response)==null?void 0:c.data)==null?void 0:d.error)==null?void 0:i.message)||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Gs(e,t,n,s,c,d){const i=u("config-panel"),p=u("recent-panel"),m=u("preview-panel"),v=u("layout");return r(),g(v,null,{config:h(()=>[l(i,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:h(()=>[l(p,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),preview:h(()=>[l(m)]),_:1})}var Ws=k(Ds,[["render",Gs],["__scopeId","data-v-11d62c6c"],["__file","/home/runner/work/Nexior/Nexior/src/pages/suno/Index.vue"]]);export{Ws as default};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{ar as c}from"./vendor-fortawesome.0d8f27df.js";import{_ as r}from"./index.59517cde.js";import{s as a}from"./vendor-element-plus.7eade167.js";import{H as s,al as o,o as p,L as _,M as i,V as m}from"./vendor-@vue.8cef8b94.js";const f=s({name:"InfoIcon",components:{FontAwesomeIcon:c,ElTooltip:a},props:{content:{type:String,required:!0}}});function l(e,d,u,I,v,x){const n=o("font-awesome-icon"),t=o("el-tooltip");return p(),_(t,{effect:"dark",content:e.content,placement:"top"},{default:i(()=>[m(n,{icon:"fa-solid fa-info",class:"icon icon-rotate"})]),_:1},8,["content"])}var C=r(f,[["render",l],["__scopeId","data-v-43d426ab"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/InfoIcon.vue"]]);export{C as I};
1
+ import"./vendor-others.e28a6fa7.js";import{ar as c}from"./vendor-fortawesome.0d8f27df.js";import{_ as r}from"./index.d28a66ae.js";import{s as a}from"./vendor-element-plus.7eade167.js";import{H as s,al as o,o as p,L as _,M as i,V as m}from"./vendor-@vue.8cef8b94.js";const f=s({name:"InfoIcon",components:{FontAwesomeIcon:c,ElTooltip:a},props:{content:{type:String,required:!0}}});function l(e,d,u,I,v,x){const n=o("font-awesome-icon"),t=o("el-tooltip");return p(),_(t,{effect:"dark",content:e.content,placement:"top"},{default:i(()=>[m(n,{icon:"fa-solid fa-info",class:"icon icon-rotate"})]),_:1},8,["content"])}var C=r(f,[["render",l],["__scopeId","data-v-43d426ab"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/InfoIcon.vue"]]);export{C as I};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{P as b}from"./Pagination.30a7754d.js";import{C as w}from"./CopyToClipboard.9a6d36b2.js";import{_ as C,ak as $}from"./index.59517cde.js";import{A as y,B as I,C as D,D as k,F}from"./vendor-element-plus.7eade167.js";import{H as E,al as s,av as P,L as _,M as t,o as u,V as a,f as n,T as i,O as B}from"./vendor-@vue.8cef8b94.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const N=E({name:"ConsoleDistributionInvitees",components:{Pagination:b,CopyToClipboard:w,ElRow:y,ElCol:I,ElTable:D,ElTableColumn:k,ElCard:F},data(){return{invitees:[],loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onPageChange(e){var p;this.$router.push({name:(p=this.$route.name)==null?void 0:p.toString(),query:{page:e}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onFetchInvitees(){const{data:e}=await $.getInvitees({limit:this.limit,offset:(this.page-1)*this.limit,ordering:"-created_at"});this.invitees=e.items,this.total=e.count}}}),T={class:"title"},q={class:"key"},S={class:"copy"},V={class:"description"},j={class:"description"},z={class:"description"},O={class:"created-at"},A={class:"pagination m-v-lg"};function H(e,p,J,L,M,R){const d=s("el-col"),c=s("el-row"),m=s("copy-to-clipboard"),l=s("el-table-column"),h=s("el-table"),f=s("el-card"),g=s("pagination"),v=P("loading");return u(),_(c,{class:"panel"},{default:t(()=>[a(d,{span:24},{default:t(()=>[a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[n("h2",T,i(e.$t("common.title.invitee")),1)]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[a(f,{shadow:"hover"},{default:t(()=>[B((u(),_(h,{data:e.invitees,stripe:""},{default:t(()=>[a(l,{prop:"id",label:e.$t("user.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",q,i(o.row.id),1),n("span",S,[a(m,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(l,{label:e.$t("user.field.username"),width:"300px"},{default:t(o=>{var r;return[n("span",V,i((r=o.row)==null?void 0:r.username),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.email"),width:"300px"},{default:t(o=>{var r;return[n("span",j,i((r=o.row)==null?void 0:r.email),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.nickname"),width:"200px"},{default:t(o=>[n("span",z,i(o.row.nickname),1)]),_:1},8,["label"]),a(l,{label:e.$t("user.field.dateJoined")},{default:t(o=>[n("span",O,i(e.$dayjs.format(o.row.date_joined)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[v,e.loading]])]),_:1})]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:10,offset:14},{default:t(()=>[n("div",A,[a(g,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ee=C(N,[["render",H],["__scopeId","data-v-7cfed024"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Invitees.vue"]]);export{ee as default};
1
+ import"./vendor-others.e28a6fa7.js";import{P as b}from"./Pagination.3b90ea43.js";import{C as w}from"./CopyToClipboard.8ebe33f6.js";import{_ as C,ai as $}from"./index.d28a66ae.js";import{A as y,B as I,C as D,D as k,F}from"./vendor-element-plus.7eade167.js";import{H as E,al as s,av as P,L as _,M as t,o as u,V as a,f as n,T as i,O as B}from"./vendor-@vue.8cef8b94.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const N=E({name:"ConsoleDistributionInvitees",components:{Pagination:b,CopyToClipboard:w,ElRow:y,ElCol:I,ElTable:D,ElTableColumn:k,ElCard:F},data(){return{invitees:[],loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onPageChange(e){var p;this.$router.push({name:(p=this.$route.name)==null?void 0:p.toString(),query:{page:e}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onFetchInvitees(){const{data:e}=await $.getInvitees({limit:this.limit,offset:(this.page-1)*this.limit,ordering:"-created_at"});this.invitees=e.items,this.total=e.count}}}),T={class:"title"},q={class:"key"},S={class:"copy"},V={class:"description"},j={class:"description"},z={class:"description"},O={class:"created-at"},A={class:"pagination m-v-lg"};function H(e,p,J,L,M,R){const d=s("el-col"),c=s("el-row"),m=s("copy-to-clipboard"),l=s("el-table-column"),h=s("el-table"),f=s("el-card"),g=s("pagination"),v=P("loading");return u(),_(c,{class:"panel"},{default:t(()=>[a(d,{span:24},{default:t(()=>[a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[n("h2",T,i(e.$t("common.title.invitee")),1)]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[a(f,{shadow:"hover"},{default:t(()=>[B((u(),_(h,{data:e.invitees,stripe:""},{default:t(()=>[a(l,{prop:"id",label:e.$t("user.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",q,i(o.row.id),1),n("span",S,[a(m,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(l,{label:e.$t("user.field.username"),width:"300px"},{default:t(o=>{var r;return[n("span",V,i((r=o.row)==null?void 0:r.username),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.email"),width:"300px"},{default:t(o=>{var r;return[n("span",j,i((r=o.row)==null?void 0:r.email),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.nickname"),width:"200px"},{default:t(o=>[n("span",z,i(o.row.nickname),1)]),_:1},8,["label"]),a(l,{label:e.$t("user.field.dateJoined")},{default:t(o=>[n("span",O,i(e.$dayjs.format(o.row.date_joined)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[v,e.loading]])]),_:1})]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:10,offset:14},{default:t(()=>[n("div",A,[a(g,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ee=C(N,[["render",H],["__scopeId","data-v-7cfed024"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Invitees.vue"]]);export{ee as default};
@@ -1 +1 @@
1
- var S=Object.defineProperty;var D=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var w=(e,t,o)=>(D(e,typeof t!="symbol"?t+"":t,o),o);import"./vendor-others.e28a6fa7.js";import{I as T}from"./credential.26787c24.js";import{D as C,_ as N,H as L}from"./index.59517cde.js";import{P as O}from"./Pagination.30a7754d.js";import{C as B}from"./CopyToClipboard.9a6d36b2.js";import{b as P,C as R,N as z,O as H,A as j,B as M,D as G,F as J}from"./vendor-element-plus.7eade167.js";import{H as K,al as i,av as Q,L as g,M as n,o as u,V as l,f as r,T as s,e as f,ai as $,U as b,O as W,S as X,R as Y}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";class Z{constructor(){w(this,"key","usage/apis")}async getAll(t){return await C.get(`/${this.key}/`,{params:t})}async get(t){return await C.get(`/${this.key}/${t}`)}}const x=new Z;const U=K({name:"ConsoleUsageList",components:{Pagination:O,ElTag:P,ElTable:R,ElSelect:z,ElOption:H,CopyToClipboard:B,ElRow:j,ElCol:M,ElTableColumn:G,ElCard:J},data(){var e,t;return{applicationId:(e=this.$route.query.application_id)==null?void 0:e.toString(),apiId:(t=this.$route.query.api_id)==null?void 0:t.toString(),applications:[],credentialType:T,apiUsages:[],loading:!1,total:void 0,limit:15}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")},apis(){return this.applications.filter(e=>this.applicationId?e.id===this.applicationId:!0).map(e=>{var t;return(t=e.service)==null?void 0:t.apis}).flat()}},watch:{page:{handler(){this.onFetchApiUsages()}},type:{handler(){this.onFetchApiUsages()}}},mounted(){this.onFetchApplications(),this.onFetchApiUsages()},methods:{async onApiChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,api_id:e}}),this.onFetchApiUsages()},async onApplicationChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,application_id:e}}),this.onFetchApiUsages()},onPageChange(e){var t;this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,page:e}})},getRemainingAmount(e){var o,d;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.remaining_amount)==null?void 0:d.toFixed(6)} ${t}`},getUsedAmount(e){var o,d;if(e.used_amount===void 0||e.used_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.used_amount)==null?void 0:d.toFixed(6)} ${t}`},getDeductedAmount(e){var o,d;if((e==null?void 0:e.deducted_amount)===void 0||(e==null?void 0:e.deducted_amount)===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.deducted_amount)==null?void 0:d.toFixed(6)} ${t}`},onFetchApplications(){L.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.total=e.count}).catch(()=>{})},onFetchApiUsages(){this.loading=!0,x.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at",...this.applicationId?{application_id:this.applicationId}:{},...this.apiId?{api_id:this.apiId}:{}}).then(({data:e})=>{this.apiUsages=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),ee={class:"title"},te={class:"inline-block mr-3"},ae={class:"inline-block mr-3"},ne={class:"key"},le={key:0,class:"copy"},oe={class:"created-at"},ie={class:"pagination"};function se(e,t,o,d,re,de){const A=i("help-entry"),h=i("el-col"),m=i("el-row"),y=i("el-option"),v=i("el-select"),p=i("el-table-column"),I=i("el-tag"),k=i("copy-to-clipboard"),F=i("el-table"),V=i("el-card"),q=i("pagination"),E=Q("loading");return u(),g(m,{class:"panel"},{default:n(()=>[l(A,{class:"help"}),l(h,{span:24},{default:n(()=>[l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[r("h2",ee,s(e.$t("common.title.allUsages")),1)]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",te,s(e.$t("usage.field.application")),1),l(v,{modelValue:e.applicationId,"onUpdate:modelValue":t[0]||(t[0]=a=>e.applicationId=a),placeholder:e.$t("usage.field.application"),clearable:"",onChange:e.onApplicationChange},{default:n(()=>[(u(!0),f(b,null,$(e.applications,a=>{var c;return u(),g(y,{key:a.id,label:(c=a.service)==null?void 0:c.title,value:a==null?void 0:a.id},null,8,["label","value"])}),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1}),l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",ae,s(e.$t("usage.field.api")),1),l(v,{modelValue:e.apiId,"onUpdate:modelValue":t[1]||(t[1]=a=>e.apiId=a),placeholder:e.$t("usage.field.api"),clearable:"",onChange:e.onApiChange},{default:n(()=>[(u(!0),f(b,null,$(e.apis,a=>(u(),g(y,{key:a==null?void 0:a.id,label:a==null?void 0:a.title,value:a==null?void 0:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[l(V,{shadow:"hover"},{default:n(()=>[W((u(),g(F,{data:e.apiUsages,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:n(()=>[l(p,{label:e.$t("application.field.name"),width:"160px"},{default:n(a=>{var c,_;return[r("span",null,s((_=(c=a.row)==null?void 0:c.api)==null?void 0:_.title),1)]}),_:1},8,["label"]),l(p,{label:e.$t("usage.field.statusCode"),width:"120px"},{default:n(a=>[r("span",null,s(a.row.status_code),1)]),_:1},8,["label"]),l(p,{prop:"remaining_amount",label:e.$t("usage.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getRemainingAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"deducted_amount",label:e.$t("usage.field.deductedAmount"),width:"150px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getDeductedAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"metadata",label:e.$t("usage.field.metadata"),width:"200px","class-name":"text-center"},{default:n(a=>[(u(!0),f(b,null,$(a.row.metadata,(c,_)=>(u(),g(I,{key:_,class:"mb-2"},{default:n(()=>[X(s(_)+": "+s(c),1)]),_:2},1024))),128))]),_:1},8,["label"]),l(p,{prop:"trace_id",label:e.$t("application.field.traceId"),width:"200px","class-name":"text-center"},{default:n(a=>[r("span",ne,s(a.row.trace_id),1),a.row.trace_id?(u(),f("span",le,[l(k,{content:a.row.trace_id,class:"inline-block"},null,8,["content"])])):Y("v-if",!0)]),_:1},8,["label"]),l(p,{label:e.$t("usage.field.createdAt"),width:"200px"},{default:n(a=>[r("span",oe,s(e.$dayjs.format(a.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data","empty-text"])),[[E,e.loading]])]),_:1})]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,null,{default:n(()=>[r("div",ie,[l(q,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ve=N(U,[["render",se],["__scopeId","data-v-1d3a6fa8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/usage/List.vue"]]);export{ve as default};
1
+ var S=Object.defineProperty;var T=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var w=(e,t,o)=>(T(e,typeof t!="symbol"?t+"":t,o),o);import"./vendor-others.e28a6fa7.js";import{I as D}from"./credential.26787c24.js";import{B as C,_ as N,F as B}from"./index.d28a66ae.js";import{P as L}from"./Pagination.3b90ea43.js";import{C as O}from"./CopyToClipboard.8ebe33f6.js";import{b as P,C as R,N as z,O as j,A as H,B as M,D as G,F as J}from"./vendor-element-plus.7eade167.js";import{H as K,al as i,av as Q,L as g,M as n,o as u,V as l,f as r,T as s,e as f,ai as $,U as b,O as W,S as X,R as Y}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";class Z{constructor(){w(this,"key","usage/apis")}async getAll(t){return await C.get(`/${this.key}/`,{params:t})}async get(t){return await C.get(`/${this.key}/${t}`)}}const x=new Z;const U=K({name:"ConsoleUsageList",components:{Pagination:L,ElTag:P,ElTable:R,ElSelect:z,ElOption:j,CopyToClipboard:O,ElRow:H,ElCol:M,ElTableColumn:G,ElCard:J},data(){var e,t;return{applicationId:(e=this.$route.query.application_id)==null?void 0:e.toString(),apiId:(t=this.$route.query.api_id)==null?void 0:t.toString(),applications:[],credentialType:D,apiUsages:[],loading:!1,total:void 0,limit:15}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")},apis(){return this.applications.filter(e=>this.applicationId?e.id===this.applicationId:!0).map(e=>{var t;return(t=e.service)==null?void 0:t.apis}).flat()}},watch:{page:{handler(){this.onFetchApiUsages()}},type:{handler(){this.onFetchApiUsages()}}},mounted(){this.onFetchApplications(),this.onFetchApiUsages()},methods:{async onApiChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,api_id:e}}),this.onFetchApiUsages()},async onApplicationChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,application_id:e}}),this.onFetchApiUsages()},onPageChange(e){var t;this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,page:e}})},getRemainingAmount(e){var o,d;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.remaining_amount)==null?void 0:d.toFixed(6)} ${t}`},getUsedAmount(e){var o,d;if(e.used_amount===void 0||e.used_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.used_amount)==null?void 0:d.toFixed(6)} ${t}`},getDeductedAmount(e){var o,d;if((e==null?void 0:e.deducted_amount)===void 0||(e==null?void 0:e.deducted_amount)===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.deducted_amount)==null?void 0:d.toFixed(6)} ${t}`},onFetchApplications(){B.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.total=e.count}).catch(()=>{})},onFetchApiUsages(){this.loading=!0,x.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at",...this.applicationId?{application_id:this.applicationId}:{},...this.apiId?{api_id:this.apiId}:{}}).then(({data:e})=>{this.apiUsages=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),ee={class:"title"},te={class:"inline-block mr-3"},ae={class:"inline-block mr-3"},ne={class:"key"},le={key:0,class:"copy"},oe={class:"created-at"},ie={class:"pagination"};function se(e,t,o,d,re,de){const A=i("help-entry"),h=i("el-col"),m=i("el-row"),y=i("el-option"),v=i("el-select"),p=i("el-table-column"),I=i("el-tag"),F=i("copy-to-clipboard"),k=i("el-table"),V=i("el-card"),q=i("pagination"),E=Q("loading");return u(),g(m,{class:"panel"},{default:n(()=>[l(A,{class:"help"}),l(h,{span:24},{default:n(()=>[l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[r("h2",ee,s(e.$t("common.title.allUsages")),1)]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",te,s(e.$t("usage.field.application")),1),l(v,{modelValue:e.applicationId,"onUpdate:modelValue":t[0]||(t[0]=a=>e.applicationId=a),placeholder:e.$t("usage.field.application"),clearable:"",onChange:e.onApplicationChange},{default:n(()=>[(u(!0),f(b,null,$(e.applications,a=>{var c;return u(),g(y,{key:a.id,label:(c=a.service)==null?void 0:c.title,value:a==null?void 0:a.id},null,8,["label","value"])}),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1}),l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",ae,s(e.$t("usage.field.api")),1),l(v,{modelValue:e.apiId,"onUpdate:modelValue":t[1]||(t[1]=a=>e.apiId=a),placeholder:e.$t("usage.field.api"),clearable:"",onChange:e.onApiChange},{default:n(()=>[(u(!0),f(b,null,$(e.apis,a=>(u(),g(y,{key:a==null?void 0:a.id,label:a==null?void 0:a.title,value:a==null?void 0:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[l(V,{shadow:"hover"},{default:n(()=>[W((u(),g(k,{data:e.apiUsages,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:n(()=>[l(p,{label:e.$t("application.field.name"),width:"160px"},{default:n(a=>{var c,_;return[r("span",null,s((_=(c=a.row)==null?void 0:c.api)==null?void 0:_.title),1)]}),_:1},8,["label"]),l(p,{label:e.$t("usage.field.statusCode"),width:"120px"},{default:n(a=>[r("span",null,s(a.row.status_code),1)]),_:1},8,["label"]),l(p,{prop:"remaining_amount",label:e.$t("usage.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getRemainingAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"deducted_amount",label:e.$t("usage.field.deductedAmount"),width:"150px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getDeductedAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"metadata",label:e.$t("usage.field.metadata"),width:"200px","class-name":"text-center"},{default:n(a=>[(u(!0),f(b,null,$(a.row.metadata,(c,_)=>(u(),g(I,{key:_,class:"mb-2"},{default:n(()=>[X(s(_)+": "+s(c),1)]),_:2},1024))),128))]),_:1},8,["label"]),l(p,{prop:"trace_id",label:e.$t("application.field.traceId"),width:"200px","class-name":"text-center"},{default:n(a=>[r("span",ne,s(a.row.trace_id),1),a.row.trace_id?(u(),f("span",le,[l(F,{content:a.row.trace_id,class:"inline-block"},null,8,["content"])])):Y("v-if",!0)]),_:1},8,["label"]),l(p,{label:e.$t("usage.field.createdAt"),width:"200px"},{default:n(a=>[r("span",oe,s(e.$dayjs.format(a.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data","empty-text"])),[[E,e.loading]])]),_:1})]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,null,{default:n(()=>[r("div",ie,[l(q,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ve=N(U,[["render",se],["__scopeId","data-v-1d3a6fa8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/usage/List.vue"]]);export{ve as default};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{o as E}from"./order.33583a13.js";import{P as O}from"./Pagination.30a7754d.js";import{C as I}from"./CopyToClipboard.9a6d36b2.js";import{O as P}from"./order.aa35b6fb.js";import{_ as N}from"./index.59517cde.js";import{g as F}from"./price.b9f5653c.js";import{A,B,C as L,D as T,u as V,b as z,F as H}from"./vendor-element-plus.7eade167.js";import{H as R,al as s,av as q,L as m,M as t,o as l,V as a,f as n,T as r,O as M,e as u,S as d,R as X}from"./vendor-@vue.8cef8b94.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const j=R({name:"ConsoleOrderList",components:{Pagination:O,CopyToClipboard:I,ElRow:A,ElCol:B,ElTable:L,ElTableColumn:T,ElButton:V,ElTag:z,ElCard:H},data(){return{OrderState:P,orders:[],loading:!1,total:void 0,limit:Math.floor((window.innerHeight-300)/50)}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:F,onPageChange(e){var h;this.$router.push({name:(h=this.$route.name)==null?void 0:h.toString(),query:{page:e}})},onFetchData(){this.loading=!0,E.getAll({ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id}).then(({data:e})=>{this.orders=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),G={class:"title"},J={class:"key"},K={class:"copy"},Q={class:"price"},U={key:0},W={key:1,class:"state state-paid"},Y={key:2,class:"state state-finished"},Z={key:3,class:"state state-expired"},x={key:4,class:"state state-failed"},ee={class:"description"},te={class:"created-at"},ae={class:"float-right"},oe={class:"pagination"};function re(e,h,se,le,ne,ie){const _=s("el-col"),f=s("el-row"),k=s("copy-to-clipboard"),p=s("el-table-column"),c=s("el-tag"),g=s("el-button"),v=s("el-table"),C=s("el-card"),S=s("pagination"),D=q("loading");return l(),m(f,{class:"panel"},{default:t(()=>[a(_,{span:24},{default:t(()=>[a(f,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[n("h2",G,r(e.$t("common.title.allOrders")),1)]),_:1})]),_:1}),a(f,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[a(C,{shadow:"hover"},{default:t(()=>[M((l(),m(v,{data:e.orders,stripe:""},{default:t(()=>[a(p,{prop:"id",label:e.$t("order.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",J,r(o.row.id),1),n("span",K,[a(k,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(p,{label:e.$t("order.field.price"),width:"100px"},{default:t(o=>{var i;return[n("span",Q,r(e.getPriceString({value:(i=o.row)==null?void 0:i.price})),1)]}),_:1},8,["label"]),a(p,{prop:"state",label:e.$t("order.field.state"),"class-name":"text-center",width:"150px"},{default:t(o=>{var i,w,y,$,b;return[o.row.state===((i=e.OrderState)==null?void 0:i.PENDING)?(l(),u("span",U,[a(c,{type:"info",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.pending")),1)]),_:1})])):o.row.state===((w=e.OrderState)==null?void 0:w.PAID)?(l(),u("span",W,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.paid")),1)]),_:1})])):o.row.state===((y=e.OrderState)==null?void 0:y.FINISHED)?(l(),u("span",Y,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.finished")),1)]),_:1})])):o.row.state===(($=e.OrderState)==null?void 0:$.EXPIRED)?(l(),u("span",Z,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.expired")),1)]),_:1})])):o.row.state===((b=e.OrderState)==null?void 0:b.FAILED)?(l(),u("span",x,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.failed")),1)]),_:1})])):X("v-if",!0)]}),_:1},8,["label"]),a(p,{label:e.$t("order.field.description"),width:"300px"},{default:t(o=>[n("span",ee,r(o.row.description),1)]),_:1},8,["label"]),a(p,{label:e.$t("order.field.createdAt"),width:"180px"},{default:t(o=>[n("span",te,r(e.$dayjs.format(o.row.created_at)),1)]),_:1},8,["label"]),a(p,{fixed:"right","min-width":"120px"},{default:t(o=>[n("div",ae,[o.row.state!==e.OrderState.PAID&&o.row.state!==e.OrderState.FINISHED&&o.row.state!==e.OrderState.EXPIRED?(l(),m(g,{key:0,type:"primary",size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.continuePay")),1)]),_:2},1032,["onClick"])):(l(),m(g,{key:1,size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.checkDetail")),1)]),_:2},1032,["onClick"]))])]),_:1})]),_:1},8,["data"])),[[D,e.loading]])]),_:1})]),_:1})]),_:1}),a(f,null,{default:t(()=>[a(_,null,{default:t(()=>[n("div",oe,[a(S,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var be=N(j,[["render",re],["__scopeId","data-v-388af89b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/order/List.vue"]]);export{be as default};
1
+ import"./vendor-others.e28a6fa7.js";import{o as E}from"./order.6d451728.js";import{P as O}from"./Pagination.3b90ea43.js";import{C as I}from"./CopyToClipboard.8ebe33f6.js";import{O as P}from"./order.aa35b6fb.js";import{_ as N}from"./index.d28a66ae.js";import{g as F}from"./price.e1faf3aa.js";import{A,B,C as L,D as T,u as V,b as z,F as H}from"./vendor-element-plus.7eade167.js";import{H as R,al as s,av as q,L as m,M as t,o as l,V as a,f as n,T as r,O as M,e as u,S as d,R as X}from"./vendor-@vue.8cef8b94.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const j=R({name:"ConsoleOrderList",components:{Pagination:O,CopyToClipboard:I,ElRow:A,ElCol:B,ElTable:L,ElTableColumn:T,ElButton:V,ElTag:z,ElCard:H},data(){return{OrderState:P,orders:[],loading:!1,total:void 0,limit:Math.floor((window.innerHeight-300)/50)}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:F,onPageChange(e){var h;this.$router.push({name:(h=this.$route.name)==null?void 0:h.toString(),query:{page:e}})},onFetchData(){this.loading=!0,E.getAll({ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id}).then(({data:e})=>{this.orders=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),G={class:"title"},J={class:"key"},K={class:"copy"},Q={class:"price"},U={key:0},W={key:1,class:"state state-paid"},Y={key:2,class:"state state-finished"},Z={key:3,class:"state state-expired"},x={key:4,class:"state state-failed"},ee={class:"description"},te={class:"created-at"},ae={class:"float-right"},oe={class:"pagination"};function re(e,h,se,le,ne,ie){const _=s("el-col"),f=s("el-row"),k=s("copy-to-clipboard"),p=s("el-table-column"),c=s("el-tag"),g=s("el-button"),v=s("el-table"),C=s("el-card"),S=s("pagination"),D=q("loading");return l(),m(f,{class:"panel"},{default:t(()=>[a(_,{span:24},{default:t(()=>[a(f,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[n("h2",G,r(e.$t("common.title.allOrders")),1)]),_:1})]),_:1}),a(f,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[a(C,{shadow:"hover"},{default:t(()=>[M((l(),m(v,{data:e.orders,stripe:""},{default:t(()=>[a(p,{prop:"id",label:e.$t("order.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",J,r(o.row.id),1),n("span",K,[a(k,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(p,{label:e.$t("order.field.price"),width:"100px"},{default:t(o=>{var i;return[n("span",Q,r(e.getPriceString({value:(i=o.row)==null?void 0:i.price})),1)]}),_:1},8,["label"]),a(p,{prop:"state",label:e.$t("order.field.state"),"class-name":"text-center",width:"150px"},{default:t(o=>{var i,w,y,$,b;return[o.row.state===((i=e.OrderState)==null?void 0:i.PENDING)?(l(),u("span",U,[a(c,{type:"info",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.pending")),1)]),_:1})])):o.row.state===((w=e.OrderState)==null?void 0:w.PAID)?(l(),u("span",W,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.paid")),1)]),_:1})])):o.row.state===((y=e.OrderState)==null?void 0:y.FINISHED)?(l(),u("span",Y,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.finished")),1)]),_:1})])):o.row.state===(($=e.OrderState)==null?void 0:$.EXPIRED)?(l(),u("span",Z,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.expired")),1)]),_:1})])):o.row.state===((b=e.OrderState)==null?void 0:b.FAILED)?(l(),u("span",x,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.failed")),1)]),_:1})])):X("v-if",!0)]}),_:1},8,["label"]),a(p,{label:e.$t("order.field.description"),width:"300px"},{default:t(o=>[n("span",ee,r(o.row.description),1)]),_:1},8,["label"]),a(p,{label:e.$t("order.field.createdAt"),width:"180px"},{default:t(o=>[n("span",te,r(e.$dayjs.format(o.row.created_at)),1)]),_:1},8,["label"]),a(p,{fixed:"right","min-width":"120px"},{default:t(o=>[n("div",ae,[o.row.state!==e.OrderState.PAID&&o.row.state!==e.OrderState.FINISHED&&o.row.state!==e.OrderState.EXPIRED?(l(),m(g,{key:0,type:"primary",size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.continuePay")),1)]),_:2},1032,["onClick"])):(l(),m(g,{key:1,size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.checkDetail")),1)]),_:2},1032,["onClick"]))])]),_:1})]),_:1},8,["data"])),[[D,e.loading]])]),_:1})]),_:1})]),_:1}),a(f,null,{default:t(()=>[a(_,null,{default:t(()=>[n("div",oe,[a(S,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var be=N(j,[["render",re],["__scopeId","data-v-388af89b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/order/List.vue"]]);export{be as default};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{_ as E,G as B,H as T}from"./index.59517cde.js";import{I as D}from"./credential.26787c24.js";import{P as N}from"./Pagination.30a7754d.js";import{C as P}from"./CopyToClipboard.9a6d36b2.js";import{C as x,A as F,u as I,B as L,b as S,D as O,F as R}from"./vendor-element-plus.7eade167.js";import{H as U,al as i,av as V,L as c,M as a,o as _,V as n,f as s,T as l,O as q,S as y,R as g,e as M}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";const z=U({name:"ConsoleApplicationList",components:{Pagination:N,CopyToClipboard:P,ElTable:x,ElRow:F,ElButton:I,ElCol:L,ElTag:S,ElTableColumn:O,ElCard:R},data(){return{credentialType:D,applications:[],loading:!1,total:void 0,buying:!1,limit:10,form:{amount:1},active:{service:void 0,application:void 0}}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}},type:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onBuyMore(e){this.$router.push({name:B,params:{id:e.id}})},onPageChange(e){var d;this.$router.push({name:(d=this.$route.name)==null?void 0:d.toString(),query:{...this.$route.query,page:e}})},onFetchData(){this.loading=!0,T.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})},getRemainingAmount(e){var p,m;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.remaining_amount)==null?void 0:m.toFixed(6)} ${d}`},getUsedAmount(e){var p,m;if(e.used_amount===void 0||e.used_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.used_amount)==null?void 0:m.toFixed(6)} ${d}`}}}),H={class:"title"},j={class:"copy"},G={key:0,class:"expired-at"},J={class:"float-right"},K={class:"pagination"};function Q(e,d,p,m,W,X){const f=i("el-col"),h=i("el-row"),$=i("copy-to-clipboard"),u=i("el-table-column"),v=i("el-tag"),b=i("el-button"),w=i("el-table"),C=i("el-card"),k=i("pagination"),A=V("loading");return _(),c(h,{class:"panel"},{default:a(()=>[n(f,{span:24},{default:a(()=>[n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[s("h2",H,l(e.$t("common.title.allApplications")),1)]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[n(C,{shadow:"hover"},{default:a(()=>[q((_(),c(w,{data:e.applications,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:a(()=>[n(u,{prop:"id",label:e.$t("application.field.id"),width:"280px","class-name":"text-center"},{default:a(t=>{var o;return[s("span",null,l(t.row.id),1),s("span",j,[n($,{content:(o=t==null?void 0:t.row)==null?void 0:o.id,class:"inline-block"},null,8,["content"])])]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.type"),width:"80px"},{default:a(t=>{var o,r;return[((o=t.row)==null?void 0:o.type)==="Period"?(_(),c(v,{key:0,type:"success",effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.period")),1)]),_:1})):g("v-if",!0),((r=t.row)==null?void 0:r.type)==="Usage"?(_(),c(v,{key:1,effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.usage")),1)]),_:1})):g("v-if",!0)]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.name"),width:"180px"},{default:a(t=>{var o,r;return[s("span",null,l((r=(o=t.row)==null?void 0:o.service)==null?void 0:r.title),1)]}),_:1},8,["label"]),n(u,{prop:"remaining_amount",label:e.$t("application.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getRemainingAmount(t.row)),1)]),_:1},8,["label"]),n(u,{prop:"used_amount",label:e.$t("application.field.usedAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getUsedAmount(t.row)),1)]),_:1},8,["label"]),n(u,{label:e.$t("application.field.expiredAt"),width:"200px"},{default:a(t=>[t.row.expired_at?(_(),M("span",G,l(e.$dayjs.format(t.row.expired_at)),1)):g("v-if",!0)]),_:1},8,["label"]),n(u,{fixed:"right",width:"120px"},{default:a(t=>{var o,r;return[s("div",J,[((o=t==null?void 0:t.row)==null?void 0:o.type)==="Period"||((r=t==null?void 0:t.row)==null?void 0:r.type)==="Usage"?(_(),c(b,{key:0,type:"primary",round:"",size:"small",onClick:Y=>e.onBuyMore(t==null?void 0:t.row)},{default:a(()=>[y(l(e.$t("application.button.buyMore")),1)]),_:2},1032,["onClick"])):g("v-if",!0)])]}),_:1})]),_:1},8,["data","empty-text"])),[[A,e.loading]])]),_:1})]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,null,{default:a(()=>[s("div",K,[n(k,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var de=E(z,[["render",Q],["__scopeId","data-v-31a091d9"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/List.vue"]]);export{de as default};
1
+ import"./vendor-others.e28a6fa7.js";import{_ as E,E as B,F as T}from"./index.d28a66ae.js";import{I as D}from"./credential.26787c24.js";import{P as F}from"./Pagination.3b90ea43.js";import{C as N}from"./CopyToClipboard.8ebe33f6.js";import{C as P,A as x,u as I,B as L,b as S,D as O,F as R}from"./vendor-element-plus.7eade167.js";import{H as U,al as i,av as V,L as c,M as a,o as _,V as n,f as s,T as l,O as q,S as y,R as g,e as M}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";const z=U({name:"ConsoleApplicationList",components:{Pagination:F,CopyToClipboard:N,ElTable:P,ElRow:x,ElButton:I,ElCol:L,ElTag:S,ElTableColumn:O,ElCard:R},data(){return{credentialType:D,applications:[],loading:!1,total:void 0,buying:!1,limit:10,form:{amount:1},active:{service:void 0,application:void 0}}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}},type:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onBuyMore(e){this.$router.push({name:B,params:{id:e.id}})},onPageChange(e){var d;this.$router.push({name:(d=this.$route.name)==null?void 0:d.toString(),query:{...this.$route.query,page:e}})},onFetchData(){this.loading=!0,T.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})},getRemainingAmount(e){var p,m;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.remaining_amount)==null?void 0:m.toFixed(6)} ${d}`},getUsedAmount(e){var p,m;if(e.used_amount===void 0||e.used_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.used_amount)==null?void 0:m.toFixed(6)} ${d}`}}}),j={class:"title"},H={class:"copy"},G={key:0,class:"expired-at"},J={class:"float-right"},K={class:"pagination"};function Q(e,d,p,m,W,X){const f=i("el-col"),h=i("el-row"),$=i("copy-to-clipboard"),u=i("el-table-column"),v=i("el-tag"),b=i("el-button"),w=i("el-table"),C=i("el-card"),k=i("pagination"),A=V("loading");return _(),c(h,{class:"panel"},{default:a(()=>[n(f,{span:24},{default:a(()=>[n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[s("h2",j,l(e.$t("common.title.allApplications")),1)]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[n(C,{shadow:"hover"},{default:a(()=>[q((_(),c(w,{data:e.applications,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:a(()=>[n(u,{prop:"id",label:e.$t("application.field.id"),width:"280px","class-name":"text-center"},{default:a(t=>{var o;return[s("span",null,l(t.row.id),1),s("span",H,[n($,{content:(o=t==null?void 0:t.row)==null?void 0:o.id,class:"inline-block"},null,8,["content"])])]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.type"),width:"80px"},{default:a(t=>{var o,r;return[((o=t.row)==null?void 0:o.type)==="Period"?(_(),c(v,{key:0,type:"success",effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.period")),1)]),_:1})):g("v-if",!0),((r=t.row)==null?void 0:r.type)==="Usage"?(_(),c(v,{key:1,effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.usage")),1)]),_:1})):g("v-if",!0)]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.name"),width:"180px"},{default:a(t=>{var o,r;return[s("span",null,l((r=(o=t.row)==null?void 0:o.service)==null?void 0:r.title),1)]}),_:1},8,["label"]),n(u,{prop:"remaining_amount",label:e.$t("application.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getRemainingAmount(t.row)),1)]),_:1},8,["label"]),n(u,{prop:"used_amount",label:e.$t("application.field.usedAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getUsedAmount(t.row)),1)]),_:1},8,["label"]),n(u,{label:e.$t("application.field.expiredAt"),width:"200px"},{default:a(t=>[t.row.expired_at?(_(),M("span",G,l(e.$dayjs.format(t.row.expired_at)),1)):g("v-if",!0)]),_:1},8,["label"]),n(u,{fixed:"right",width:"120px"},{default:a(t=>{var o,r;return[s("div",J,[((o=t==null?void 0:t.row)==null?void 0:o.type)==="Period"||((r=t==null?void 0:t.row)==null?void 0:r.type)==="Usage"?(_(),c(b,{key:0,type:"primary",round:"",size:"small",onClick:Y=>e.onBuyMore(t==null?void 0:t.row)},{default:a(()=>[y(l(e.$t("application.button.buyMore")),1)]),_:2},1032,["onClick"])):g("v-if",!0)])]}),_:1})]),_:1},8,["data","empty-text"])),[[A,e.loading]])]),_:1})]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,null,{default:a(()=>[s("div",K,[n(k,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var de=E(z,[["render",Q],["__scopeId","data-v-31a091d9"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/List.vue"]]);export{de as default};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{_ as r}from"./index.59517cde.js";import{H as e}from"./vendor-@vue.8cef8b94.js";import"./vendor-element-plus.7eade167.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";const o=e({name:"AuthLogin",data(){var t;return{redirect:(t=this.$route.query.redirect)==null?void 0:t.toString()}},async mounted(){this.$store.state.token.access?this.$router.push(this.redirect||"/"):this.$store.dispatch("login")}});var u=r(o,[["__file","/home/runner/work/Nexior/Nexior/src/pages/auth/Login.vue"]]);export{u as default};
1
+ import"./vendor-others.e28a6fa7.js";import{_ as r}from"./index.d28a66ae.js";import{H as e}from"./vendor-@vue.8cef8b94.js";import"./vendor-element-plus.7eade167.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";import"./vendor-fortawesome.0d8f27df.js";const o=e({name:"AuthLogin",data(){var t;return{redirect:(t=this.$route.query.redirect)==null?void 0:t.toString()}},async mounted(){this.$store.state.token.access?this.$router.push(this.redirect||"/"):this.$store.dispatch("login")}});var u=r(o,[["__file","/home/runner/work/Nexior/Nexior/src/pages/auth/Login.vue"]]);export{u as default};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{N as i}from"./Navigator.b29c6fbe.js";import{_ as a}from"./index.59517cde.js";import{H as s,al as o,e as _,V as e,o as m}from"./vendor-@vue.8cef8b94.js";import"./vendor-element-plus.7eade167.js";import"./vendor-fortawesome.0d8f27df.js";import"./EditArray.66507131.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const c=s({name:"LayoutMain",components:{Navigator:i},data(){return{mobile:window.innerWidth<768}},mounted(){window.addEventListener("resize",()=>{this.mobile=window.innerWidth<768})}}),p={class:"wrapper"};function d(n,l,u,v,w,f){const r=o("router-view"),t=o("navigator");return m(),_("div",p,[e(r,{class:"main"}),e(t,{class:"navigator",direction:n.mobile?"row":"column"},null,8,["direction"])])}var B=a(c,[["render",d],["__scopeId","data-v-63155678"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Main.vue"]]);export{B as default};
1
+ import"./vendor-others.e28a6fa7.js";import{N as i}from"./Navigator.87c585b8.js";import{_ as a}from"./index.d28a66ae.js";import{H as s,al as o,e as _,V as e,o as m}from"./vendor-@vue.8cef8b94.js";import"./vendor-element-plus.7eade167.js";import"./vendor-fortawesome.0d8f27df.js";import"./EditArray.d15327ac.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const c=s({name:"LayoutMain",components:{Navigator:i},data(){return{mobile:window.innerWidth<768}},mounted(){window.addEventListener("resize",()=>{this.mobile=window.innerWidth<768})}}),p={class:"wrapper"};function d(n,l,u,v,w,f){const r=o("router-view"),t=o("navigator");return m(),_("div",p,[e(r,{class:"main"}),e(t,{class:"navigator",direction:n.mobile?"row":"column"},null,8,["direction"])])}var B=a(c,[["render",d],["__scopeId","data-v-63155678"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Main.vue"]]);export{B as default};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{L as A}from"./Chatdoc.e863aecb.js";import{u as D,E as L,x as N,k as z,X as B,y as p,C as T,b as F,D as M}from"./vendor-element-plus.7eade167.js";import{C as P,_ as k,a2 as w}from"./index.59517cde.js";import{H as E,al as l,o as n,e as b,V as s,M as o,P as R,L as m,R as h,f as c,T as a,S as d,U as K,av as O,O as j}from"./vendor-@vue.8cef8b94.js";import{A as q}from"./Status.a3b342f7.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const H=E({name:"UploadDocument",components:{ElButton:D,ElDialog:L,ElUpload:N,ElIcon:z,UploadFilled:B},data(){return{dialogVisible:!1,fileList:[],learning:!1,uploadUrl:P()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})}},async mounted(){},methods:{onExceed(){p.warning(this.$t("chatdoc.message.uploadDocumentsExceed"))},onError(){p.error(this.$t("chatdoc.message.uploadDocumentsError"))},async onSuccess(){p.success(this.$t("chatdoc.message.uploadDocumentsSuccess")),p.info(this.$t("chatdoc.message.startCreateDocument")),this.learning=!0,this.$store.dispatch("chatdoc/createDocument",{repositoryId:this.$route.params.repositoryId,fileUrl:this.urls[0],fileName:this.fileList[0].name}).then(()=>{p.success(this.$t("chatdoc.message.createDocumentSuccess")),this.dialogVisible=!1,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.$route.params.repositoryId}),this.$store.dispatch("chatdoc/getApplications")}).catch(()=>{p.error(this.$t("chatdoc.message.createDocumentError"))}).finally(()=>{this.fileList=[],this.learning=!1})}}}),X={key:1,class:"el-upload__text"},G={key:2};function J(e,t,_,$,C,I){const v=l("upload-filled"),y=l("el-icon"),r=l("el-upload"),f=l("el-dialog"),g=l("el-button");return n(),b(K,null,[s(f,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[1]||(t[1]=u=>e.dialogVisible=u)},{default:o(()=>[s(r,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=u=>e.fileList=u),accept:".docx,.doc,.pdf,.txt,.csv,.enex,.epub,.eml,.html,.htm,.shtml,.md,.odt,.ppt,.pptx,.txt",drag:"",class:R({upload:!0}),name:"file","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:o(()=>[e.learning?h("v-if",!0):(n(),m(y,{key:0,class:"el-icon--upload"},{default:o(()=>[s(v)]),_:1})),e.learning?h("v-if",!0):(n(),b("div",X,[c("p",null,a(e.$t("chatdoc.message.dragOrClickToUpload")),1),c("p",null,a(e.$t("chatdoc.message.supportedFiles")),1)])),e.learning?(n(),b("div",G,a(e.$t("chatdoc.message.learningDocument")),1)):h("v-if",!0)]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),_:1},8,["modelValue"]),s(g,{type:"primary",round:"",onClick:t[2]||(t[2]=u=>e.dialogVisible=!0)},{default:o(()=>[d(a(e.$t("chatdoc.button.uploadDocuments")),1)]),_:1})],64)}var Q=k(H,[["render",J],["__scopeId","data-v-4a88fdfb"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/UploadDocument.vue"]]);const W=E({name:"ChatdocKnowledge",components:{Layout:A,ElButton:D,ElTable:T,ElTag:F,ApplicationStatus:q,ElTableColumn:M,UploadDocument:Q},data(){return{loading:!1,repositoryId:this.$route.params.repositoryId.toString()}},computed:{repository(){var e,t,_;return(_=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:_.find($=>$.id===this.repositoryId)},documents(){var e;return(e=this.repository)==null?void 0:e.documents},needApply(){return this.$store.state.chatdoc.status.getApplications===w.Success&&!this.application},service(){return this.$store.state.chatdoc.service},application(){return this.$store.state.chatdoc.application},initializing(){return this.$store.state.chatdoc.status.getApplications===w.Request}},async mounted(){console.log("start get documents"),this.loading=!0,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId}).then(()=>{this.loading=!1}).catch(()=>{this.loading=!1})},methods:{onDelete(e){this.$store.dispatch("chatdoc/deleteDocument",{id:e}).then(()=>{p.success(this.$t("chatdoc.message.deleteDocumentSuccess")),this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId})})},onPreview(e){window.open(e,"_blank")}}}),Y={class:"wrapper"},Z={class:"title"},x={class:"introduction"},ee={class:"status"},te={class:"operations"},oe={class:"documents"};function se(e,t,_,$,C,I){const v=l("application-status"),y=l("upload-document"),r=l("el-table-column"),f=l("el-tag"),g=l("el-button"),u=l("el-table"),U=l("layout"),V=O("loading");return n(),m(U,null,{chatdoc:o(()=>[c("div",Y,[c("div",Z,a(e.$t("chatdoc.title.manage")),1),c("div",x,a(e.$t("chatdoc.message.introductionForKnowledge")),1),c("div",ee,[s(v,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=i=>e.$store.dispatch("chatdoc/getApplications"))},null,8,["initializing","application","need-apply","service"])]),c("div",te,[s(y)]),c("div",oe,[j((n(),m(u,{data:e.documents,border:""},{default:o(()=>[s(r,{prop:"id",label:"ID"}),s(r,{prop:"file_name",label:e.$t("chatdoc.field.fileName")},null,8,["label"]),s(r,{label:e.$t("chatdoc.field.fileExtension"),width:"100px"},{default:o(i=>[d(a(i.row.file_name.split(".").pop()),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.createdAt"),width:"200px"},{default:o(i=>[d(a(i.row.created_at?e.$dayjs.format(i.row.created_at):""),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.state"),width:"180px"},{default:o(i=>[i.row.state==="processing"?(n(),m(f,{key:0,type:"info"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateProcessing")),1)]),_:1})):h("v-if",!0),i.row.state==="failed"?(n(),m(f,{key:1,type:"danger"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateFailed")),1)]),_:1})):h("v-if",!0),i.row.state==="completed"?(n(),m(f,{key:2,type:"success"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateCompleted")),1)]),_:1})):h("v-if",!0)]),_:1},8,["label"]),s(r,null,{default:o(i=>[s(g,{type:"primary",round:"",size:"small",onClick:S=>e.onPreview(i.row.file_url)},{default:o(()=>[d(a(e.$t("common.button.preview")),1)]),_:2},1032,["onClick"]),s(g,{type:"danger",round:"",size:"small",onClick:S=>e.onDelete(i.row.id)},{default:o(()=>[d(a(e.$t("common.button.delete")),1)]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[V,e.loading]])])])]),_:1})}var me=k(W,[["render",se],["__scopeId","data-v-69ae9518"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Manage.vue"]]);export{me as default};
1
+ import"./vendor-others.e28a6fa7.js";import{L as S}from"./Chatdoc.2bb8cda8.js";import{u as D,E as L,x as N,k as z,X as B,y as p,C as T,b as F,D as M}from"./vendor-element-plus.7eade167.js";import{A as P,_ as k,a0 as w}from"./index.d28a66ae.js";import{H as E,al as l,o as n,e as b,V as s,M as o,P as R,L as m,R as h,f as c,T as a,S as d,U as K,av as O,O as j}from"./vendor-@vue.8cef8b94.js";import{A as q}from"./Status.d10547c8.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const H=E({name:"UploadDocument",components:{ElButton:D,ElDialog:L,ElUpload:N,ElIcon:z,UploadFilled:B},data(){return{dialogVisible:!1,fileList:[],learning:!1,uploadUrl:P()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})}},async mounted(){},methods:{onExceed(){p.warning(this.$t("chatdoc.message.uploadDocumentsExceed"))},onError(){p.error(this.$t("chatdoc.message.uploadDocumentsError"))},async onSuccess(){p.success(this.$t("chatdoc.message.uploadDocumentsSuccess")),p.info(this.$t("chatdoc.message.startCreateDocument")),this.learning=!0,this.$store.dispatch("chatdoc/createDocument",{repositoryId:this.$route.params.repositoryId,fileUrl:this.urls[0],fileName:this.fileList[0].name}).then(()=>{p.success(this.$t("chatdoc.message.createDocumentSuccess")),this.dialogVisible=!1,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.$route.params.repositoryId}),this.$store.dispatch("chatdoc/getApplications")}).catch(()=>{p.error(this.$t("chatdoc.message.createDocumentError"))}).finally(()=>{this.fileList=[],this.learning=!1})}}}),X={key:1,class:"el-upload__text"},G={key:2};function J(e,t,_,$,C,I){const v=l("upload-filled"),y=l("el-icon"),r=l("el-upload"),f=l("el-dialog"),g=l("el-button");return n(),b(K,null,[s(f,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[1]||(t[1]=u=>e.dialogVisible=u)},{default:o(()=>[s(r,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=u=>e.fileList=u),accept:".docx,.doc,.pdf,.txt,.csv,.enex,.epub,.eml,.html,.htm,.shtml,.md,.odt,.ppt,.pptx,.txt",drag:"",class:R({upload:!0}),name:"file","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:o(()=>[e.learning?h("v-if",!0):(n(),m(y,{key:0,class:"el-icon--upload"},{default:o(()=>[s(v)]),_:1})),e.learning?h("v-if",!0):(n(),b("div",X,[c("p",null,a(e.$t("chatdoc.message.dragOrClickToUpload")),1),c("p",null,a(e.$t("chatdoc.message.supportedFiles")),1)])),e.learning?(n(),b("div",G,a(e.$t("chatdoc.message.learningDocument")),1)):h("v-if",!0)]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),_:1},8,["modelValue"]),s(g,{type:"primary",round:"",onClick:t[2]||(t[2]=u=>e.dialogVisible=!0)},{default:o(()=>[d(a(e.$t("chatdoc.button.uploadDocuments")),1)]),_:1})],64)}var Q=k(H,[["render",J],["__scopeId","data-v-4a88fdfb"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/UploadDocument.vue"]]);const W=E({name:"ChatdocKnowledge",components:{Layout:S,ElButton:D,ElTable:T,ElTag:F,ApplicationStatus:q,ElTableColumn:M,UploadDocument:Q},data(){return{loading:!1,repositoryId:this.$route.params.repositoryId.toString()}},computed:{repository(){var e,t,_;return(_=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:_.find($=>$.id===this.repositoryId)},documents(){var e;return(e=this.repository)==null?void 0:e.documents},needApply(){return this.$store.state.chatdoc.status.getApplications===w.Success&&!this.application},service(){return this.$store.state.chatdoc.service},application(){return this.$store.state.chatdoc.application},initializing(){return this.$store.state.chatdoc.status.getApplications===w.Request}},async mounted(){console.log("start get documents"),this.loading=!0,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId}).then(()=>{this.loading=!1}).catch(()=>{this.loading=!1})},methods:{onDelete(e){this.$store.dispatch("chatdoc/deleteDocument",{id:e}).then(()=>{p.success(this.$t("chatdoc.message.deleteDocumentSuccess")),this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId})})},onPreview(e){window.open(e,"_blank")}}}),Y={class:"wrapper"},Z={class:"title"},x={class:"introduction"},ee={class:"status"},te={class:"operations"},oe={class:"documents"};function se(e,t,_,$,C,I){const v=l("application-status"),y=l("upload-document"),r=l("el-table-column"),f=l("el-tag"),g=l("el-button"),u=l("el-table"),U=l("layout"),V=O("loading");return n(),m(U,null,{chatdoc:o(()=>[c("div",Y,[c("div",Z,a(e.$t("chatdoc.title.manage")),1),c("div",x,a(e.$t("chatdoc.message.introductionForKnowledge")),1),c("div",ee,[s(v,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=i=>e.$store.dispatch("chatdoc/getApplications"))},null,8,["initializing","application","need-apply","service"])]),c("div",te,[s(y)]),c("div",oe,[j((n(),m(u,{data:e.documents,border:""},{default:o(()=>[s(r,{prop:"id",label:"ID"}),s(r,{prop:"file_name",label:e.$t("chatdoc.field.fileName")},null,8,["label"]),s(r,{label:e.$t("chatdoc.field.fileExtension"),width:"100px"},{default:o(i=>[d(a(i.row.file_name.split(".").pop()),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.createdAt"),width:"200px"},{default:o(i=>[d(a(i.row.created_at?e.$dayjs.format(i.row.created_at):""),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.state"),width:"180px"},{default:o(i=>[i.row.state==="processing"?(n(),m(f,{key:0,type:"info"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateProcessing")),1)]),_:1})):h("v-if",!0),i.row.state==="failed"?(n(),m(f,{key:1,type:"danger"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateFailed")),1)]),_:1})):h("v-if",!0),i.row.state==="completed"?(n(),m(f,{key:2,type:"success"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateCompleted")),1)]),_:1})):h("v-if",!0)]),_:1},8,["label"]),s(r,null,{default:o(i=>[s(g,{type:"primary",round:"",size:"small",onClick:A=>e.onPreview(i.row.file_url)},{default:o(()=>[d(a(e.$t("common.button.preview")),1)]),_:2},1032,["onClick"]),s(g,{type:"danger",round:"",size:"small",onClick:A=>e.onDelete(i.row.id)},{default:o(()=>[d(a(e.$t("common.button.delete")),1)]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[V,e.loading]])])])]),_:1})}var me=k(W,[["render",se],["__scopeId","data-v-69ae9518"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Manage.vue"]]);export{me as default};
@@ -1 +1 @@
1
- import{ad as _}from"./vendor-others.e28a6fa7.js";import{m as p}from"./vendor-markdown.4f590479.js";import{a8 as u,a9 as l,_ as c}from"./index.59517cde.js";import{H as i,m,ah as v,al as h,av as f,O as g,o as w,L as k}from"./vendor-@vue.8cef8b94.js";import"./vendor-highlight.js.6ee9ffbc.js";const y=async o=>{const t=(await u(()=>import("./vendor-highlight.js.6ee9ffbc.js"),["assets/vendor-highlight.js.6ee9ffbc.js","assets/vendor-highlight.js.4e8df926.css"])).default;console.debug("highlight.js loaded"),o.querySelectorAll("pre code").forEach(e=>{var s,a;const r=document.createElement("button");r.innerHTML=l.global.t("common.button.copy").toString(),r.addEventListener("click",()=>{_(e.innerText)}),(s=e.parentElement)!=null&&s.querySelector("button")||(a=e.parentElement)==null||a.prepend(r),t.highlightBlock(e)})},M=i({name:"VueMarkdown",props:{source:{type:String,required:!0},options:{type:Object,default:()=>({}),required:!1}},setup(o,{attrs:t}){const n=new p(o.options),e=m(()=>{const r=o.source;return n==null?void 0:n.render(r)});return()=>v("div",{...t,innerHTML:e.value})}});var x=c(M,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/VueMarkdown.vue"]]);const b=i({name:"ApiCode",directives:{highlight:y},components:{VueMarkdown:x},props:{content:{type:String,required:!1,default:""}},data(){},watch:{}});function E(o,t,n,e,r,s){const a=h("vue-markdown"),d=f("highlight");return g((w(),k(a,{source:o.content,class:"markdown-body"},null,8,["source"])),[[d]])}var $=c(b,[["render",E],["__scopeId","data-v-8173dc94"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/MarkdownRenderer.vue"]]);export{$ as M};
1
+ import{ad as _}from"./vendor-others.e28a6fa7.js";import{m as p}from"./vendor-markdown.4f590479.js";import{a6 as u,a7 as l,_ as c}from"./index.d28a66ae.js";import{H as i,m,ah as v,al as h,av as f,O as g,o as w,L as k}from"./vendor-@vue.8cef8b94.js";import"./vendor-highlight.js.6ee9ffbc.js";const y=async o=>{const t=(await u(()=>import("./vendor-highlight.js.6ee9ffbc.js"),["assets/vendor-highlight.js.6ee9ffbc.js","assets/vendor-highlight.js.4e8df926.css"])).default;console.debug("highlight.js loaded"),o.querySelectorAll("pre code").forEach(e=>{var s,a;const r=document.createElement("button");r.innerHTML=l.global.t("common.button.copy").toString(),r.addEventListener("click",()=>{_(e.innerText)}),(s=e.parentElement)!=null&&s.querySelector("button")||(a=e.parentElement)==null||a.prepend(r),t.highlightBlock(e)})},M=i({name:"VueMarkdown",props:{source:{type:String,required:!0},options:{type:Object,default:()=>({}),required:!1}},setup(o,{attrs:t}){const n=new p(o.options),e=m(()=>{const r=o.source;return n==null?void 0:n.render(r)});return()=>v("div",{...t,innerHTML:e.value})}});var x=c(M,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/VueMarkdown.vue"]]);const b=i({name:"ApiCode",directives:{highlight:y},components:{VueMarkdown:x},props:{content:{type:String,required:!1,default:""}},data(){},watch:{}});function E(o,t,n,e,r,s){const a=h("vue-markdown"),d=f("highlight");return g((w(),k(a,{source:o.content,class:"markdown-body"},null,8,["source"])),[[d]])}var $=c(b,[["render",E],["__scopeId","data-v-8173dc94"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/MarkdownRenderer.vue"]]);export{$ as M};
@@ -0,0 +1 @@
1
+ import{a3 as Ie,a9 as Te}from"./vendor-others.e28a6fa7.js";import{_ as N,g as Ne,S as Ve,s as Fe,d as M,e as Ge,f as Me,h as fe,j as He,k as ve,l as Xe,m as ge,n as Je,o as $e,p as be,q as we,r as Be,t as ke,u as Ke,v as ye,w as Qe,x as Se,y as Ye,z as Ee,c as qe}from"./index.d28a66ae.js";import{H as O,o as c,e as g,al as o,L as T,M as n,V as t,S as b,T as d,f as l,ai as H,U as V,O as K,W as Q,R as L,P as Oe}from"./vendor-@vue.8cef8b94.js";import{ar as Ce,as as ze,at as Pe,au as je,av as Ze,ac as We}from"./vendor-fortawesome.0d8f27df.js";import{f as Ue,h as Y,i as q,j as z,k as Ae,l as Le,m as P,n as X,o as J,p as xe,E as et,q as tt,r as ot,s as st}from"./vendor-element-plus.7eade167.js";import{E as B,a as Re,b as De}from"./EditArray.d15327ac.js";const it=O({emits:["click"],computed:{dark(){return Ie("THEME")==="dark"},url(){var e;return(e=this.$store.state.site)==null?void 0:e.favicon}}}),nt=["src"];function at(e,s,m,u,$,k){return c(),g("img",{src:e.url,class:"logo tiny",onClick:s[0]||(s[0]=a=>e.$emit("click"))},null,8,nt)}var lt=N(it,[["render",at],["__file","/home/runner/work/Nexior/Nexior/src/components/common/LogoTiny.vue"]]),rt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAAAMFBMVEX///+3t7f4+Pi8vLzAwMDExMTS0tLIyMjk5OTz8/PY2NjOzs7u7u7d3d3p6enh4eFVKkJDAAAIfUlEQVR4nNVd15akOAylyRRQ9f9/O02BZJtgBQszfR/2zPahsJCvguVUFJYop35ux66pq6r6+fn9T910bTv3U2najBXK9zw2PxE07fz+n0Qf+raOyetL3g9PS7vgzRUYULfvZyXuR5nAgLF/SuK3UuJN7gf0PbyErDiieuU1zKmLyFJ3Y9u+vmh//V9dXT/b5VN3f+HbFq82nGivHH6999Vv8rC7P+NFzfBlF56xvl/sEy1Xbc8mZ9m3R7bcrO0jl+vXJH7J0YY78UvYKNuDjpWNTQd9tzd5ks9ePUm92u877WMlp4dhR+Y2OYkYdh3XmKclc9iATVwoXyFLZouXIobuBpEXlK+QcYbK7gOF2NpMaN2Vmfdr71LGirAbW5N3lr4F1rckC0GQbQw6cqrM1XACvzOr5EjT+2q+L24Vk6/sRGL7no6t5un9eQE+7JG4r+wk3+e9iGfXwzyeZHLjzDGFt0fEBB564ymOeRwzCg8dHaZ9kx8NZGZ8+UyOv0bSW3o9q5Tac5+0luajjGfqpsT2krIuTeaKZGQf4UUIKpx6xFbo2nGD9HSlpJZAGfSQILVjV02Z4CQsJhD2UdbcJ/dwyRfpNvozwaLo4q/0nMhLIrMThJSZZ4EhiJd6Ugti43SvzCTlPKnZmUNZMV+u4cYKwp85XlfcTBi/s6Z+MZ2LxADhGZzUDU9m5zjIr0woQhLxasAHWS7E9TgZU/Z1EBEIjbzxQYYxOudOxu73qTBcUGEaIzqD1hi96W6JTgzRoDSI/UhmITP7yUPFSYqaagD1R4wJkP8VnT8nTwVQqnauN06QjvtCvYt2IL3Zm/Uk9jjDz0RmMLggwx3SOuIUSniGpJv3bAJo1SAFr9mKH8aI+LqkI0RFtoIh9/L76Cc8GLCDoxxSjyAHgxxFYSEzJ18Ggly4YHQHnCQ2LRoCGINXQirim0JYUJpDatf/p24PP4mVwSblSg6MEhDGuzNVg6J5o8nEvAPAGZiAfk5MDRXNqxcmx/AVHPMprx8G1TEHwOzqTByseTgoDRxYDT6akSh9YSMzr6aLidOeTGCj3EqDkdC8GU9Q9c6voYlyJzxy0sOxOnRs8C3sQpSR92DOO4EDCXkAzoA935bPTy8AIgTBCIIyvyZsExF/uM2Byfk9A7VafuksfdyygFmJcc35NZ7tT5xUYMNwJYcI/FouGP7xOyT1YBOh+aVcsCHHBWCHZHLTxOfxF6ZA8HP82P7ASv4BJj5PMNMO/g3+H9ghqrtnGm4hIJLAd7byVxg5asGCA+AH2N2meYHvKPxZmQRIGtyMaOMweC/ZXJJJdJE0CF27Bm0oK8kWLKSWHxeILB8s7xN8gmxFi0VIFAkNqd5KiI3S7JBqJ7Ssycb70vAL2LAofMiE9hkBrQvX4OTXNLS4eGpwA8KlaxaGKHOy4OWWcSVoXSZz9ohYYLaxpB8bv4V2aFGeFiYOvqTb74V2mHkQ8IXjBKhMuKrMJIoLOQlmVGIiIlyPmXdguwJ6d8J/CZ1H0m4iB1Gr4D569HjCZalPaNoxeWtd5jKf4TRkpy30syh3KbLXPVZsWdIIQUK6dO8Jl+dkbUB6GfRranwIWx3hUzeVi5fRmggtDA6b/dWO3ELkLiF4QldqoXOPxhe8QOjt57LUpXhguGUhtEUFUtq9EBzUQluQWrphIV1oA1JLm0R6VFqh0z21eH30XmjFdofbF14dgC5PG1zS0w9pjuYFF2UYL9KHiXJGYhhXJkwLEk1RvrEMZVWmpgvSVC1XtEtNlYOAL1JYrdESOg3lcGtFQsVGs+Nu++msHdiu0BNEQQ5vYKssIWxQx3JNc1AqnbTFmg3qSoKmYz0mb//S7QDU1k5Vdu+VSnUFyA3aBES1ca9zkqb4PPVQUUVG74OVRfUNSqencXh+UR1sUnfqgy6+qLrVn75QThRt0I26VG0FU4dbRNfE1ULpqVVBIZBTN/kJ0PBDxY6QEbpp5v27JFCxI5xm1k3oIxT+Q+Wowgl93dIJhHzqVrW5erd0QrdIxUE8wFXxcL9IBXSlSRcLuSnq3NR+OZBq4ZWD1FXr8sn9wivVEjcPwtVuKtd6XOKmWUzoQeY/dCczHBcTKpZtnr2QB104gN70ukm+QNaHzBJV7DhbIAt/040ERMMXnbUDAwOtgvZVsUo0KaCi9Omib/SCqleKhE7KSsNIIt7IkFXoi40MSBrNO28X+ooHOKxWqPpuoVHRh7FDo3+pyHsorOZyG5R0w5kPUZmJffYFIrLhTLi1DzFJT0X+aWaZ3JGtfcJNlCvesTOuIpAcLBrdRIms5g4s+jFlM0PFPYY6ul1VtDG4PJzwqQHnGGpKKlA1fVKN0VqxX31Tx1DjOTBXaRFvs3vaWdkniPIEF3hdGgEmxpev0VpeHNf8ZuiROMBhet0hMch9qkogR2wXbeSojHI22jd5ifp1cLbY9dHB8NWhJCbOgkYzBxpFzxH3wu74F++ro8ckWsM7a5l7/IuzVnAxJX1MojGQ3shHslKCPPimY+b+jYfmU0qONPIOj5rzK9lDi33OyQttVpEaglXXMFoabQVmqny3QxaBW4opM3o4CtwDJazWGZtAUMi12ONkAtGMrNGS/1QI5yb+CxciLmc8EwoDKEokefK6CBKPRf47Mj/MEIujvv+MzA/6kKQLCR7y18q5Y8AjiWryrR1T9uwp/RqJ3YUdGWBxYUeR2RzN7gThn6ifCrtLaA7X/dwG4xtusvg+24uVihzKtr/Cqrh7OFPdcVlYcXItmyHS7x67ROwyxxTceAHegqsLHVOQ4WLH00sdE5DhUsev2IbaznR95gKrCnDGi0oXDOmTRrmvhP3i712+u+LvXXO84u9dKL2Cf3V33X7+i6u7N/y5S9IdvOvoF0G/19GP9tfR/wPQ21eEI8clLwAAAABJRU5ErkJggg==";const dt=O({name:"UserAvatar",data(){return{defaultAvatar:rt}},computed:{user(){var e;return(e=this.$store.getters)==null?void 0:e.user}}}),ct=["src"];function mt(e,s,m,u,$,k){var a;return c(),g("img",{src:((a=e.user)==null?void 0:a.avatar)||e.defaultAvatar,class:"avatar"},null,8,ct)}var ut=N(dt,[["render",mt],["__scopeId","data-v-1dac1046"],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Avatar.vue"]]);const pt=O({name:"ThemeSelector",components:{ArrowDown:Ue,ElDropdown:Y,ElDropdownMenu:q,ElDropdownItem:z,ElIcon:Ae},data(){return{theme:"light"}},computed:{currentLabel(){return this.theme==="dark"?this.$t("common.theme.dark"):this.$t("common.theme.light")}},mounted(){this.theme=this.loadFromCookie(),this.applyTheme()},methods:{onSelect(e){this.theme=e,this.applyTheme()},applyTheme(){Te("THEME",this.theme,{path:"/",domain:Ne()}),this.theme==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},loadFromCookie(){return Ie("THEME")==="dark"?"dark":"light"}}}),_t={class:"el-dropdown-link"};function ht(e,s,m,u,$,k){const a=o("arrow-down"),p=o("el-icon"),h=o("el-dropdown-item"),_=o("el-dropdown-menu"),r=o("el-dropdown");return c(),T(r,{trigger:"click",onCommand:e.onSelect},{dropdown:n(()=>[t(_,null,{default:n(()=>[t(h,{command:"light"},{default:n(()=>[b(d(e.$t("common.theme.light")),1)]),_:1}),t(h,{command:"dark"},{default:n(()=>[b(d(e.$t("common.theme.dark")),1)]),_:1})]),_:1})]),default:n(()=>[l("span",_t,[b(d(e.currentLabel)+" ",1),t(p,{class:"el-icon--right"},{default:n(()=>[t(a)]),_:1})])]),_:1},8,["onCommand"])}var ft=N(pt,[["render",ht],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Theme.vue"]]);const vt=O({name:"LocaleSelector",components:{ElDropdown:Y,ElDropdownMenu:q,ElDropdownItem:z,ElIcon:Ae,ArrowDown:Ue},data(){return{locales:Ve}},computed:{value(){return this.$i18n.locale},currentLabel(){const e=this.locales.find(s=>s.value===this.value);return e?e.label:this.value}},methods:{async onSelectLocale(e){this.$router.push({query:{...this.$route.query,locale:void 0}}),await Fe(e),Te("LOCALE",e,{path:"/",domain:Ne()})}}}),gt={class:"el-dropdown-link"};function $t(e,s,m,u,$,k){const a=o("arrow-down"),p=o("el-icon"),h=o("el-dropdown-item"),_=o("el-dropdown-menu"),r=o("el-dropdown");return c(),T(r,{trigger:"click",onCommand:e.onSelectLocale},{dropdown:n(()=>[t(_,null,{default:n(()=>[(c(!0),g(V,null,H(e.locales,(f,i)=>(c(),T(h,{key:i,command:f.value},{default:n(()=>[b(d(f.label),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:n(()=>[l("span",gt,[b(d(e.currentLabel)+" ",1),t(p,{class:"el-icon--right"},{default:n(()=>[t(a)]),_:1})])]),_:1},8,["onCommand"])}var bt=N(vt,[["render",$t],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Locale.vue"]]);const wt=O({name:"GeneralSettings",components:{ThemeSwitcher:ft,LocaleSwitcher:bt}}),kt={class:"flex justify-between items-center mb-4"},yt={class:"block mb-2 text-sm"},St={class:"flex justify-between items-center mb-4"},Et={class:"block mb-2 text-sm"};function It(e,s,m,u,$,k){const a=o("theme-switcher"),p=o("locale-switcher");return c(),g(V,null,[l("div",kt,[l("label",yt,d(e.$t("common.settings.theme")),1),t(a)]),l("div",St,[l("label",Et,d(e.$t("common.settings.language")),1),t(p)])],64)}var Tt=N(wt,[["render",It],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/General.vue"]]);const Nt=O({name:"SiteIndex",components:{EditText:B,EditImage:Re,EditArray:De,ElDivider:Le,ElImage:P,ElForm:X,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var m;const s={...this.site,...e};M.update((m=this.site)==null?void 0:m.id,s).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),Ot={class:"block w-full"},Ct={class:"block tip"},Ut={class:"block w-full"},At={class:"block tip"},Lt={class:"block w-full"},Rt={class:"block tip"},Dt={class:"block w-full"},Vt={class:"block tip"},Ft={class:"block w-full"},Gt={class:"block tip"};function Mt(e,s,m,u,$,k){const a=o("el-form-item"),p=o("edit-text"),h=o("el-image"),_=o("edit-image"),r=o("el-divider"),f=o("edit-array"),i=o("el-form");return c(),T(i,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:n(()=>[t(a,{label:e.$t("site.field.origin")},{default:n(()=>[l("span",Ot,d(e.site.origin),1),l("span",Ct,d(e.$t("site.message.originTip")),1)]),_:1},8,["label"]),t(a,{label:e.$t("site.field.title")},{default:n(()=>[l("span",Ut,[b(d(e.site.title)+" ",1),t(p,{"model-value":e.site.title,title:e.$t("site.title.editTitle"),placeholder:e.$t("site.placeholder.title"),onConfirm:s[0]||(s[0]=v=>e.onSave({title:v}))},null,8,["model-value","title","placeholder"])]),l("span",At,d(e.$t("site.message.titleTip")),1)]),_:1},8,["label"]),t(a,{label:e.$t("site.field.logo")},{default:n(()=>[l("span",Lt,[t(h,{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:s[1]||(s[1]=v=>e.onSave({logo:v}))},null,8,["model-value","title","tip"])]),l("span",Rt,d(e.$t("site.message.logoTip")),1)]),_:1},8,["label"]),t(a,{label:e.$t("site.field.favicon")},{default:n(()=>[l("span",Dt,[t(h,{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:s[2]||(s[2]=v=>e.onSave({favicon:v}))},null,8,["model-value","title","tip"])]),l("span",Vt,d(e.$t("site.message.faviconTip")),1)]),_:1},8,["label"]),t(r,{"border-style":"dashed"}),t(a,{label:e.$t("site.field.admins")},{default:n(()=>{var v,C;return[l("span",Ft,[b(d((v=e.site.admins)==null?void 0:v.join(", "))+" ",1),t(f,{"model-value":((C=e.site)==null?void 0:C.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:s[3]||(s[3]=E=>e.onSave({admins:E}))},null,8,["model-value","title","placeholder","tip","min-error-message"])]),l("span",Gt,d(e.$t("site.message.adminsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])}var Ht=N(Nt,[["render",Mt],["__scopeId","data-v-e38df654"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Site.vue"]]);const Xt=O({name:"SettingSeo",components:{EditText:B,EditArray:De,ElForm:X,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var m;const s={...this.site,...e};M.update((m=this.site)==null?void 0:m.id,s).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),Jt={class:"block w-full"},Bt={class:"block tip"},Kt={class:"block w-full"},Qt={class:"block tip"};function Yt(e,s,m,u,$,k){const a=o("edit-text"),p=o("el-form-item"),h=o("edit-array"),_=o("el-form");return c(),T(_,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:n(()=>[t(p,{label:e.$t("site.field.description")},{default:n(()=>[l("span",Jt,[b(d(e.site.description)+" ",1),t(a,{"model-value":e.site.description,title:e.$t("site.title.editDescription"),placeholder:e.$t("site.placeholder.description"),onConfirm:s[0]||(s[0]=r=>e.onSave({description:r}))},null,8,["model-value","title","placeholder"])]),l("span",Bt,d(e.$t("site.message.descriptionTip")),1)]),_:1},8,["label"]),t(p,{label:e.$t("site.field.keywords")},{default:n(()=>{var r,f;return[l("span",Kt,[b(d((r=e.site.keywords)==null?void 0:r.join(", "))+" ",1),t(h,{"model-value":((f=e.site)==null?void 0:f.keywords)||[],title:e.$t("site.title.editKeywords"),placeholder:e.$t("site.placeholder.keywords"),tip:e.$t("site.message.keywordsTip2"),onConfirm:s[1]||(s[1]=i=>e.onSave({keywords:i}))},null,8,["model-value","title","placeholder","tip"])]),l("span",Qt,d(e.$t("site.message.keywordsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])}var qt=N(Xt,[["render",Yt],["__scopeId","data-v-57cb41c4"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Seo.vue"]]);const zt=O({name:"SiteIndex",components:{EditText:B,ElForm:X,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var m;const s={...this.site,...e};M.update((m=this.site)==null?void 0:m.id,s).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),Pt={class:"block tip"},jt={class:"block tip"};function Zt(e,s,m,u,$,k){const a=o("edit-text"),p=o("el-form-item"),h=o("el-form");return c(),T(h,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:n(()=>[t(p,{label:e.$t("site.field.distributionDefaultInviterId")},{default:n(()=>{var _,r;return[b(d((_=e.site.distribution)==null?void 0:_.default_inviter_id)+" ",1),t(a,{"model-value":(r=e.site.distribution)==null?void 0:r.default_inviter_id,title:e.$t("site.title.editDistributionDefaultInviterId"),placeholder:e.$t("site.placeholder.editDistributionDefaultInviterId"),onConfirm:s[0]||(s[0]=f=>e.onSave({distribution:{...e.site.distribution,default_inviter_id:f}}))},null,8,["model-value","title","placeholder"]),l("span",Pt,d(e.$t("site.message.distributionDefaultInviterIdTip")),1)]}),_:1},8,["label"]),t(p,{label:e.$t("site.field.distributionForceInviterId")},{default:n(()=>{var _,r;return[b(d((_=e.site.distribution)==null?void 0:_.force_inviter_id)+" ",1),t(a,{"model-value":(r=e.site.distribution)==null?void 0:r.force_inviter_id,title:e.$t("site.title.editDistributionForceInviterId"),placeholder:e.$t("site.placeholder.editDistributionForceInviterId"),onConfirm:s[1]||(s[1]=f=>e.onSave({distribution:{...e.site.distribution,force_inviter_id:f}}))},null,8,["model-value","title","placeholder"]),l("span",jt,d(e.$t("site.message.distributionForceInviterIdTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])}var Wt=N(zt,[["render",Zt],["__scopeId","data-v-4ed92693"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Distribution.vue"]]);const xt=O({name:"SiteIndex",components:{EditText:B,EditImage:Re,ElImage:P,ElForm:X,ElSwitch:xe,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var m;const s={...this.site,...e};M.update((m=this.site)==null?void 0:m.id,s).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),eo={class:"w-full"},to={class:"block tip w-full"},oo={key:0},so={class:"block w-full"},io={class:"block w-full"};function no(e,s,m,u,$,k){const a=o("el-switch"),p=o("el-form-item"),h=o("el-image"),_=o("edit-image"),r=o("edit-text"),f=o("el-form");return c(),T(f,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:n(()=>[(c(),g(V,null,H(["chatgpt","grok","deepseek","midjourney","qrart","suno","luma","pika","kling","flux","hailuo","headshots"],(i,v)=>t(p,{key:v,label:e.$t("site.field.features"+i.charAt(0).toUpperCase()+i.slice(1))},{default:n(()=>{var C,E,A,R,F,G;return[l("div",eo,[t(a,{"model-value":((C=e.site.features[i])==null?void 0:C.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":w=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],enabled:w}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),l("span",to,d(e.$t("site.message.features"+i.charAt(0).toUpperCase()+i.slice(1))),1),i==="support"?K((c(),g("div",oo,[t(p,{label:"WeChat"},{default:n(()=>{var w,y;return[t(a,{"model-value":((y=(w=e.site.features[i])==null?void 0:w.wechat)==null?void 0:y.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":I=>{var S;return e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...(S=e.site.features[i])==null?void 0:S.wechat,enabled:I}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),K(t(p,{label:e.$t("site.field.qr")},{default:n(()=>{var w,y,I,S;return[l("span",so,[t(h,{src:(y=(w=e.site.features[i])==null?void 0:w.wechat)==null?void 0:y.qr},null,8,["src"]),t(_,{"model-value":(S=(I=e.site.features[i])==null?void 0:I.wechat)==null?void 0:S.qr,title:e.$t("site.title.editQR"),tip:e.$t("site.message.editQRTip"),onConfirm:D=>{var U;return e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...(U=e.site.features[i])==null?void 0:U.wechat,qr:D}}}})}},null,8,["model-value","title","tip","onConfirm"])])]}),_:2},1032,["label"]),[[Q,(A=(E=e.site.features[i])==null?void 0:E.wechat)==null?void 0:A.enabled]]),t(p,{label:"Discord"},{default:n(()=>{var w,y;return[t(a,{"model-value":((y=(w=e.site.features[i])==null?void 0:w.discord)==null?void 0:y.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":I=>{var S;return e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...(S=e.site.features[i])==null?void 0:S.discord,enabled:I}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),K(t(p,{label:e.$t("site.field.url")},{default:n(()=>{var w,y,I,S;return[l("span",io,[b(d((y=(w=e.site.features[i])==null?void 0:w.discord)==null?void 0:y.url)+" ",1),t(r,{"model-value":(S=(I=e.site.features[i])==null?void 0:I.discord)==null?void 0:S.url,title:e.$t("site.title.editUrl"),placeholder:e.$t("site.placeholder.editUrl"),onConfirm:D=>{var U;return e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...(U=e.site.features[i])==null?void 0:U.discord,url:D}}}})}},null,8,["model-value","title","placeholder","onConfirm"])])]}),_:2},1032,["label"]),[[Q,(F=(R=e.site.features[i])==null?void 0:R.discord)==null?void 0:F.enabled]])],512)),[[Q,(G=e.site.features[i])==null?void 0:G.enabled]]):L("v-if",!0)]}),_:2},1032,["label"])),64))]),_:1},8,["model"])}var ao=N(xt,[["render",no],["__scopeId","data-v-7089d567"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Function.vue"]]);const lo=O({name:"UserSetting",components:{ElDialog:et,ElMenu:tt,ElMenuItem:ot,FontAwesomeIcon:Ce,GeneralSetting:Tt,SiteSetting:Ht,SeoSetting:qt,DistributionSetting:Wt,FunctionSetting:ao},props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],data(){return{activeTab:"general",showSuggestions:!0,navItems:[{key:"general",label:this.$t("common.settings.general"),icon:ze},{key:"site",label:this.$t("common.settings.site"),icon:Pe},{key:"seo",label:this.$t("common.settings.seo"),icon:je},{key:"distribution",label:this.$t("common.settings.distribution"),icon:Ze},{key:"function",label:this.$t("common.settings.function"),icon:We}]}},computed:{currentTabTitle(){const e=this.navItems.find(s=>s.key===this.activeTab);return e?e.label:""},isSiteAdmin(){var e,s,m,u,$;return!!(($=(m=(s=(e=this.$store)==null?void 0:e.state)==null?void 0:s.site)==null?void 0:m.admins)!=null&&$.includes((u=this.$store.getters.user)==null?void 0:u.id))}},methods:{onClose(){this.$emit("update:visible",!1)}}}),ro={class:"flex settings"},co={class:"w-40 h-full border-r"},mo={class:"flex-1 p-6 overflow-y-auto"},uo={key:0},po={key:1},_o={key:2},ho={key:3},fo={key:4};function vo(e,s,m,u,$,k){const a=o("font-awesome-icon"),p=o("el-menu-item"),h=o("el-menu"),_=o("general-setting"),r=o("site-setting"),f=o("seo-setting"),i=o("distribution-setting"),v=o("function-setting"),C=o("el-dialog");return c(),T(C,{"model-value":e.visible,onClose:e.onClose},{default:n(()=>[l("div",ro,[l("aside",co,[t(h,{class:"border-r-0"},{default:n(()=>[(c(!0),g(V,null,H(e.navItems,(E,A)=>(c(),T(p,{key:A,index:E.key,class:Oe(["flex items-center px-2 cursor-pointer py-2",e.activeTab===E.key?"active":""]),onClick:R=>e.activeTab=E.key},{default:n(()=>[t(a,{icon:E.icon,class:"mr-2"},null,8,["icon"]),b(" "+d(E.label),1)]),_:2},1032,["index","class","onClick"]))),128))]),_:1})]),l("main",mo,[e.activeTab==="general"?(c(),g("div",uo,[t(_)])):e.activeTab==="site"&&e.isSiteAdmin?(c(),g("div",po,[t(r)])):e.activeTab==="seo"&&e.isSiteAdmin?(c(),g("div",_o,[t(f)])):e.activeTab==="distribution"&&e.isSiteAdmin?(c(),g("div",ho,[t(i)])):e.activeTab==="function"&&e.isSiteAdmin?(c(),g("div",fo,[t(v)])):L("v-if",!0)])])]),_:1},8,["model-value","onClose"])}var go=N(lo,[["render",vo],["__scopeId","data-v-17be4dfc"],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Setting.vue"]]);const $o=O({name:"UserCenter",components:{UserAvatar:ut,UserSetting:go,FontAwesomeIcon:Ce,ElDivider:Le,ElDropdownMenu:q,ElDropdownItem:z,ElDropdown:Y},data(){return{showMenu:!1,showSetting:!1}},computed:{user(){var e;return(e=this.$store.getters)==null?void 0:e.user}},mounted(){document.addEventListener("click",this.closeMenu)},unmounted(){document.removeEventListener("click",this.closeMenu)},methods:{toggleMenu(){this.showMenu=!this.showMenu},closeMenu(e){const s=e.target;this.$el.contains(s)||(this.showMenu=!1)},async onLogout(){await this.$store.dispatch("logout")},onConsole(){this.$router.push({name:Ge})},onDistribution(){this.$router.push({name:Me})},onSettings(){this.showSetting=!0}}}),bo={class:"center"},wo={key:0,class:"px-4 py-4 text-sm font-medium"};function ko(e,s,m,u,$,k){const a=o("user-avatar"),p=o("el-divider"),h=o("font-awesome-icon"),_=o("el-dropdown-item"),r=o("el-dropdown-menu"),f=o("el-dropdown"),i=o("user-setting");return c(),g(V,null,[l("div",bo,[t(f,{trigger:"click"},{dropdown:n(()=>{var v;return[e.user.email?(c(),g("div",wo,d((v=e.user)==null?void 0:v.email),1)):L("v-if",!0),e.user.email?(c(),T(p,{key:1,class:"mb-1 mt-1"})):L("v-if",!0),t(r,null,{default:n(()=>[t(_,{class:"py-2",onClick:e.onSettings},{default:n(()=>[t(h,{icon:"fa-solid fa-cog",class:"mr-1"}),b(" "+d(e.$t("common.nav.setting")),1)]),_:1},8,["onClick"]),t(_,{class:"py-2",onClick:e.onDistribution},{default:n(()=>[t(h,{icon:"fa-solid fa-coins",class:"mr-1"}),b(" "+d(e.$t("common.nav.distribution")),1)]),_:1},8,["onClick"]),t(_,{class:"py-2",onClick:e.onConsole},{default:n(()=>[t(h,{icon:"fa-solid fa-compass",class:"mr-1"}),b(" "+d(e.$t("common.nav.console")),1)]),_:1},8,["onClick"]),t(_,{class:"py-2",onClick:e.onLogout},{default:n(()=>[t(h,{icon:"fa-solid fa-arrow-right-from-bracket",class:"mr-1"}),b(" "+d(e.$t("common.nav.logOut")),1)]),_:1},8,["onClick"])]),_:1})]}),default:n(()=>[t(a,{class:"cursor-pointer"})]),_:1})]),t(i,{visible:e.showSetting,"onUpdate:visible":s[0]||(s[0]=v=>e.showSetting=v)},null,8,["visible"])],64)}var yo=N($o,[["render",ko],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Center.vue"]]);const So=O({name:"Navigator",components:{ElImage:P,LogoTiny:lt,ElTooltip:st,UserCenter:yo},props:{direction:{type:String,default:"column"}},data(){return{operating:{dark:!1,locale:!1},activeIndex:this.$route.name}},computed:{links(){var s,m,u,$,k,a,p,h,_,r,f,i,v,C,E,A,R,F,G,w,y,I,S,D,U,j,Z,W,x,ee,te,oe,se,ie,ne,ae,le,re,de,ce,me,ue,pe,_e,he;const e=[];return(k=($=(u=(m=(s=this.$store)==null?void 0:s.state)==null?void 0:m.site)==null?void 0:u.features)==null?void 0:$.chatgpt)!=null&&k.enabled&&e.push({route:{name:fe},displayName:this.$t("common.nav.chatgpt"),logo:"https://cdn.acedata.cloud/7dljuv.png",routes:[He,fe]}),(r=(_=(h=(p=(a=this.$store)==null?void 0:a.state)==null?void 0:p.site)==null?void 0:h.features)==null?void 0:_.deepseek)!=null&&r.enabled&&e.push({route:{name:ve},displayName:this.$t("common.nav.deepseek"),logo:"https://cdn.acedata.cloud/bc71ae.png",routes:[Xe,ve]}),(E=(C=(v=(i=(f=this.$store)==null?void 0:f.state)==null?void 0:i.site)==null?void 0:v.features)==null?void 0:C.grok)!=null&&E.enabled&&e.push({route:{name:ge},displayName:this.$t("common.nav.grok"),logo:"https://cdn.acedata.cloud/p1ge98.png",routes:[Je,ge]}),(w=(G=(F=(R=(A=this.$store)==null?void 0:A.state)==null?void 0:R.site)==null?void 0:F.features)==null?void 0:G.midjourney)!=null&&w.enabled&&e.push({route:{name:$e},displayName:this.$t("common.nav.midjourney"),logo:"https://cdn.acedata.cloud/wto43b.png",routes:[$e]}),(U=(D=(S=(I=(y=this.$store)==null?void 0:y.state)==null?void 0:I.site)==null?void 0:S.features)==null?void 0:D.flux)!=null&&U.enabled&&e.push({route:{name:be},displayName:this.$t("common.nav.flux"),logo:"https://cdn.acedata.cloud/ogm2oa.png",routes:[be]}),(ee=(x=(W=(Z=(j=this.$store)==null?void 0:j.state)==null?void 0:Z.site)==null?void 0:W.features)==null?void 0:x.suno)!=null&&ee.enabled&&e.push({route:{name:we},displayName:this.$t("common.nav.suno"),logo:"https://cdn.acedata.cloud/l3ffw7.jpg",routes:[we,Be]}),(ne=(ie=(se=(oe=(te=this.$store)==null?void 0:te.state)==null?void 0:oe.site)==null?void 0:se.features)==null?void 0:ie.luma)!=null&&ne.enabled&&e.push({route:{name:ke},displayName:this.$t("common.nav.luma"),logo:"https://cdn.acedata.cloud/ahjfwi.png",routes:[ke,Ke]}),(ce=(de=(re=(le=(ae=this.$store)==null?void 0:ae.state)==null?void 0:le.site)==null?void 0:re.features)==null?void 0:de.hailuo)!=null&&ce.enabled&&e.push({route:{name:ye},displayName:this.$t("common.nav.hailuo"),logo:"https://cdn.acedata.cloud/0qg4gp.png",routes:[ye,Qe]}),(he=(_e=(pe=(ue=(me=this.$store)==null?void 0:me.state)==null?void 0:ue.site)==null?void 0:pe.features)==null?void 0:_e.kling)!=null&&he.enabled&&e.push({route:{name:Se},displayName:this.$t("common.nav.kling"),logo:"https://cdn.acedata.cloud/qpbbbb.jpg",routes:[Se,Ye]}),this.direction==="row"&&e.push({route:{name:Ee},displayName:this.$t("common.nav.profile"),icon:"fa-solid fa-user",routes:[Ee]}),e},authenticated(){return!!this.$store.state.token.access}},methods:{onHome(){this.$router.push({name:qe})}}}),Eo=["direction"],Io={class:"top"},To={key:0},No={class:"bottom"};function Oo(e,s,m,u,$,k){const a=o("logo-tiny"),p=o("el-image"),h=o("el-tooltip"),_=o("user-center");return c(),g("div",{direction:e.direction,class:"navigator"},[l("div",Io,[e.direction==="column"?(c(),g("div",To,[t(a,{onClick:e.onHome},null,8,["onClick"])])):L("v-if",!0),(c(!0),g(V,null,H(e.links,(r,f)=>(c(),g("div",{key:f,class:Oe({link:!0,active:r.routes.includes(e.$route.name)})},[e.direction==="column"?(c(),T(h,{key:0,effect:"dark",content:r.displayName,placement:"right"},{default:n(()=>[r.logo?(c(),T(p,{key:0,src:r.logo,class:"avatar",onClick:i=>e.$router.push(r.route)},null,8,["src","onClick"])):L("v-if",!0)]),_:2},1032,["content"])):L("v-if",!0)],2))),128))]),l("div",No,[t(_)])],8,Eo)}var Vo=N(So,[["render",Oo],["__scopeId","data-v-a43dbcba"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/Navigator.vue"]]);export{Vo as N};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{_ as n}from"./index.59517cde.js";import{G as o}from"./vendor-element-plus.7eade167.js";import{H as t,al as r,o as i,L as s}from"./vendor-@vue.8cef8b94.js";const p=t({name:"Pagination",components:{ElPagination:o},props:{total:{type:Number,required:!1,default:void 0},currentPage:{type:Number,required:!0},pageSize:{type:Number,required:!0}},emits:["change"],data(){return{loaded:!1}},mounted(){setTimeout(()=>{this.loaded=!0},1e3)},methods:{onPageChange(e){!this.loaded||this.$emit("change",e)}}});function u(e,g,m,l,c,d){const a=r("el-pagination");return i(),s(a,{class:"mt-3 mb-3",background:"","hide-on-single-page":!1,layout:"prev, pager, next","current-page":e.currentPage,total:e.total,"page-size":e.pageSize,onCurrentChange:e.onPageChange},null,8,["current-page","total","page-size","onCurrentChange"])}var v=n(p,[["render",u],["__file","/home/runner/work/Nexior/Nexior/src/components/common/Pagination.vue"]]);export{v as P};
1
+ import"./vendor-others.e28a6fa7.js";import{_ as n}from"./index.d28a66ae.js";import{G as o}from"./vendor-element-plus.7eade167.js";import{H as t,al as r,o as i,L as s}from"./vendor-@vue.8cef8b94.js";const p=t({name:"Pagination",components:{ElPagination:o},props:{total:{type:Number,required:!1,default:void 0},currentPage:{type:Number,required:!0},pageSize:{type:Number,required:!0}},emits:["change"],data(){return{loaded:!1}},mounted(){setTimeout(()=>{this.loaded=!0},1e3)},methods:{onPageChange(e){!this.loaded||this.$emit("change",e)}}});function u(e,g,m,l,c,d){const a=r("el-pagination");return i(),s(a,{class:"mt-3 mb-3",background:"","hide-on-single-page":!1,layout:"prev, pager, next","current-page":e.currentPage,total:e.total,"page-size":e.pageSize,onCurrentChange:e.onPageChange},null,8,["current-page","total","page-size","onCurrentChange"])}var v=n(p,[["render",u],["__file","/home/runner/work/Nexior/Nexior/src/components/common/Pagination.vue"]]);export{v as P};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{L as e}from"./Chatdoc.e863aecb.js";import{_ as r}from"./index.59517cde.js";import{H as n,al as a,L as s,M as i,o as m,S as p}from"./vendor-@vue.8cef8b94.js";import"./vendor-element-plus.7eade167.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const c=n({name:"ChatdocSetting",components:{Layout:e},data(){return{}},async mounted(){},methods:{}});function d(u,t,_,f,l,x){const o=a("layout");return m(),s(o,null,{chatdoc:i(()=>t[0]||(t[0]=[p(" Setting ")])),_:1})}var L=r(c,[["render",d],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Setting.vue"]]);export{L as default};
1
+ import"./vendor-others.e28a6fa7.js";import{L as e}from"./Chatdoc.2bb8cda8.js";import{_ as r}from"./index.d28a66ae.js";import{H as n,al as a,L as s,M as i,o as m,S as p}from"./vendor-@vue.8cef8b94.js";import"./vendor-element-plus.7eade167.js";import"./vendor-fortawesome.0d8f27df.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const c=n({name:"ChatdocSetting",components:{Layout:e},data(){return{}},async mounted(){},methods:{}});function d(u,t,_,f,l,x){const o=a("layout");return m(),s(o,null,{chatdoc:i(()=>t[0]||(t[0]=[p(" Setting ")])),_:1})}var L=r(c,[["render",d],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Setting.vue"]]);export{L as default};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{C as H,_ as A,I as G,G as J,an as K,H as W,af as Q}from"./index.59517cde.js";import{E as q,J as X,K as Y,l as Z,W as x,u as B,y as E,C as ee,D as te,b as oe,H as ne,V as ie,h as ae,i as se,j as le,f as pe,k as re}from"./vendor-element-plus.7eade167.js";import{H as C,al as o,o as n,L as _,M as a,f as d,V as s,S as f,T as i,e as r,U as S,ai as z,R as p}from"./vendor-@vue.8cef8b94.js";const ce=C({name:"ApplicationConfirm",components:{ElDialog:q,ElDescriptions:X,ElDescriptionsItem:Y,ElDivider:Z,ElCheckbox:x,ElButton:B},props:{service:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:["update:visible","apply"],data(){return{checked:!0}},watch:{},methods:{getBaseUrlPlatform:H,onApply(){if(!this.checked){E.error(this.$t("application.message.notAgreePolicy"));return}this.$emit("apply")}}}),de={class:"content"},ue={class:"policy"},me={class:"policy-title"},_e=["href"];function fe(e,t,y,h,v,I){const u=o("el-descriptions-item"),$=o("el-descriptions"),m=o("el-divider"),b=o("el-checkbox"),l=o("el-button"),k=o("el-dialog");return n(),_(k,{"model-value":e.visible,width:"500px",title:e.$t("application.message.confirmApplying"),center:"",onClose:t[1]||(t[1]=c=>e.$emit("update:visible",!1))},{default:a(()=>[d("div",de,[s($,{column:1},{default:a(()=>[s(u,{label:e.$t("application.field.name")},{default:a(()=>{var c;return[f(i((c=e.service)==null?void 0:c.title),1)]}),_:1},8,["label"]),s(u,{label:e.$t("application.field.freeAmount")},{default:a(()=>{var c,w;return[d("span",null,i((c=e.service)==null?void 0:c.free_amount)+" "+i(e.$t(`service.unit.${(w=e.service)==null?void 0:w.unit}`)),1)]}),_:1},8,["label"])]),_:1}),s(m,{class:"my-2"}),d("div",ue,[s(b,{modelValue:e.checked,"onUpdate:modelValue":t[0]||(t[0]=c=>e.checked=c),size:"large",class:"policy-checkbox"},null,8,["modelValue"]),d("span",me,i(e.$t("application.message.readPolicy")),1),d("a",{class:"policy-title highlight",target:"_blank",href:e.getBaseUrlPlatform()+"/terms"}," \xA0"+i(e.$t("application.message.policy")),9,_e)]),s(l,{round:"",type:"primary",onClick:e.onApply},{default:a(()=>[f(i(e.$t("common.button.apply")),1)]),_:1},8,["onClick"])])]),_:1},8,["model-value","title"])}var ye=A(ce,[["render",fe],["__scopeId","data-v-666cd2fe"],["__file","/home/runner/work/Nexior/Nexior/src/components/application/Confirm.vue"]]);const he=C({name:"ApiPrice",components:{ElTable:ee,ElTableColumn:te,ElDialog:q,ElButton:B},props:{price:{type:Object,required:!0}},data(){return{visible:!1}},computed:{data(){var e;return((e=this.price)==null?void 0:e.data)||[]},columns(){var e;return(e=this.price)==null?void 0:e.columns},spans(){var e;return(e=this.price)==null?void 0:e.spans}},methods:{cellStyle(){return{"font-weight":"bold","text-align":"center"}},spanMethod({row:e,column:t,rowIndex:y,columnIndex:h}){if(this.spans){for(const v of this.spans)if(y===v[0]&&h===v[1])return[v[2],v[3]]}return[1,1]}}});function ve(e,t,y,h,v,I){const u=o("el-table-column"),$=o("el-table"),m=o("el-dialog"),b=o("el-button");return n(),r("div",null,[s(m,{modelValue:e.visible,"onUpdate:modelValue":t[0]||(t[0]=l=>e.visible=l),center:"",width:"80%"},{default:a(()=>[s($,{data:e.data,stripe:"","span-method":e.spanMethod,"header-cell-style":e.cellStyle,"cell-style":e.cellStyle},{default:a(()=>[(n(!0),r(S,null,z(e.columns,(l,k)=>(n(),_(u,{key:k,prop:l.key,label:l.label},null,8,["prop","label"]))),128))]),_:1},8,["data","span-method","header-cell-style","cell-style"])]),_:1},8,["modelValue"]),s(b,{round:"",size:"small",onClick:t[1]||(t[1]=l=>e.visible=!0)},{default:a(()=>[f(i(e.$t("service.button.pricing")),1)]),_:1})])}var $e=A(he,[["render",ve],["__scopeId","data-v-4600b314"],["__file","/home/runner/work/Nexior/Nexior/src/components/api/Price.vue"]]);const be=C({name:"ApplicationInfo",components:{ElTag:oe},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}}}),ge={key:0,class:"info"},ke={key:1,class:"subtitle"},we={key:1,type:"success",class:"info",effect:"dark"},Ae={key:1,class:"subtitle"};function Ce(e,t,y,h,v,I){var $,m,b,l;const u=o("el-tag");return n(),r(S,null,[e.application.type==="Period"?(n(),r("span",ge,[e.showType?(n(),_(u,{key:0,type:"primary",class:"mr-1",effect:"dark"},{default:a(()=>[f(i(e.$t("application.type.period")),1)]),_:1})):p("v-if",!0),f(" "+i(e.$t("common.message.expiredAt"))+": "+i(e.$dayjs.format(e.application.expired_at))+" ",1),e.showId?(n(),r("p",ke,"ID: "+i(e.application.id),1)):p("v-if",!0)])):p("v-if",!0),e.application.type==="Usage"?(n(),r("span",we,[e.showType?(n(),_(u,{key:0,class:"mr-1"},{default:a(()=>[f(i(e.$t("application.type.usage")),1)]),_:1})):p("v-if",!0),f(" "+i(e.$t("common.message.remainingAmount"))+": "+i((m=($=e.application)==null?void 0:$.remaining_amount)==null?void 0:m.toFixed(6))+" "+i(e.$t("service.unit."+((l=(b=e.application)==null?void 0:b.service)==null?void 0:l.unit)+"s"))+" ",1),e.showId?(n(),r("p",Ae,"ID: "+i(e.application.id),1)):p("v-if",!0)])):p("v-if",!0)],64)}var Ie=A(be,[["render",Ce],["__scopeId","data-v-7ffaebbd"],["__file","/home/runner/work/Nexior/Nexior/src/components/application/Info.vue"]]);const Ee=C({name:"ApplicationStatus",components:{ElButton:B,ApplicationInfo:Ie,ApplicationConfirm:ye,ElSkeleton:ne,ElSkeletonItem:ie,ApiPrice:$e,ElDropdown:ae,ElDropdownMenu:se,ElDropdownItem:le,ArrowDown:pe,ElIcon:re},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},initializing:{type:Boolean,default:!1},showPrice:{type:Boolean,default:!0},service:{type:Object,required:!0},needApply:{type:Boolean,default:!1}},emits:["apply","refresh","applied","update:application","select"],data(){return{confirming:this.needApply,applicationType:G}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user}},watch:{needApply(e){e&&(this.confirming=e)}},methods:{onBuyMore(e){this.$router.push({name:J,params:{id:e.id}})},onCreateCredential(e){K.create({application_id:e==null?void 0:e.id,host:window.location.origin}).then(()=>{setTimeout(()=>{this.$emit("refresh")},2e3),this.confirming=!1}).finally(()=>{this.$emit("applied")})},onSelectApplication(e){this.$emit("select",e)},onApply(){var e;W.create({service_id:(e=this.service)==null?void 0:e.id}).then(({data:t})=>{E.success(this.$t("application.message.applySuccessfully")),this.onCreateCredential(t)}).catch(t=>{var y,h;((h=(y=t==null?void 0:t.response)==null?void 0:y.data)==null?void 0:h.code)===Q&&E.error(this.$t("application.message.alreadyApplied")),this.confirming=!1})}}}),Be={class:"element"},Se={key:0},Ne={key:1,class:"status"},Ve={class:"el-dropdown-link"},De={class:"actions"},Oe={key:2,class:"text-center info"},Pe={class:"mr-2"},Te={class:"ml-1"};function Ue(e,t,y,h,v,I){var V,D,O,P,T,U,M,j;const u=o("el-skeleton-item"),$=o("el-skeleton"),m=o("application-info"),b=o("arrow-down"),l=o("el-icon"),k=o("el-dropdown-item"),c=o("el-dropdown-menu"),w=o("el-dropdown"),N=o("el-button"),R=o("api-price"),L=o("application-confirm");return n(),r("div",Be,[e.initializing&&e.application===void 0?(n(),r("div",Se,[s($,{rows:1,class:"text-center"},{template:a(()=>[s(u,{variant:"p",class:"shimmer"})]),_:1})])):e.application?(n(),r("div",Ne,[s(w,{onCommand:e.onSelectApplication},{dropdown:a(()=>[e.applications&&e.applications.length>0?(n(),_(c,{key:0},{default:a(()=>[(n(!0),r(S,null,z(e.applications,(g,F)=>(n(),_(k,{key:F,command:g},{default:a(()=>[s(m,{application:g,"show-type":!0,"show-id":!0},null,8,["application"])]),_:2},1032,["command"]))),128))]),_:1})):p("v-if",!0)]),default:a(()=>[d("span",Ve,[s(m,{application:e.application},null,8,["application"]),e.applications&&e.applications.length>0?(n(),_(l,{key:0,class:"el-icon--right ml-0"},{default:a(()=>[s(b)]),_:1})):p("v-if",!0)])]),_:1},8,["onCommand"]),d("span",De,[s(N,{round:"",size:"small",type:"primary",class:"mr-1",onClick:t[0]||(t[0]=g=>e.onBuyMore(e.application))},{default:a(()=>[f(i(e.$t("common.button.buyMore")),1)]),_:1}),e.showPrice&&((P=(O=(D=(V=e.application)==null?void 0:V.service)==null?void 0:D.apis)==null?void 0:O[0])==null?void 0:P.price)?(n(),_(R,{key:0,class:"price inline-block",price:(j=(M=(U=(T=e.application)==null?void 0:T.service)==null?void 0:U.apis)==null?void 0:M[0])==null?void 0:j.price},null,8,["price"])):p("v-if",!0)])])):p("v-if",!0),e.needApply&&e.service?(n(),r("div",Oe,[d("span",Pe,i(e.$t("chat.message.notApplied")),1),d("span",null,[s(N,{round:"",type:"primary",class:"btn btn-apply",size:"small",onClick:t[1]||(t[1]=g=>e.confirming=!0)},{default:a(()=>[f(i(e.$t("common.button.apply")),1)]),_:1})]),d("span",Te,i(e.$t("chat.message.tryForFree")),1),e.service&&e.authenticated?(n(),_(L,{key:0,modelValue:e.confirming,"onUpdate:modelValue":t[2]||(t[2]=g=>e.confirming=g),modelModifiers:{visible:!0},service:e.service,onApply:e.onApply},null,8,["modelValue","service","onApply"])):p("v-if",!0)])):p("v-if",!0)])}var Re=A(Ee,[["render",Ue],["__scopeId","data-v-2941d97e"],["__file","/home/runner/work/Nexior/Nexior/src/components/application/Status.vue"]]);export{Re as A};
1
+ import"./vendor-others.e28a6fa7.js";import{A as H,_ as A,I as J,E as K,al as W,F as G,ad as Q}from"./index.d28a66ae.js";import{E as q,J as X,K as Y,l as Z,W as x,u as B,y as I,C as ee,D as te,b as oe,H as ne,V as ie,h as ae,i as se,j as le,f as pe,k as re}from"./vendor-element-plus.7eade167.js";import{H as C,al as o,o as n,L as _,M as a,f as d,V as s,S as f,T as i,e as r,U as S,ai as z,R as p}from"./vendor-@vue.8cef8b94.js";const ce=C({name:"ApplicationConfirm",components:{ElDialog:q,ElDescriptions:X,ElDescriptionsItem:Y,ElDivider:Z,ElCheckbox:x,ElButton:B},props:{service:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:["update:visible","apply"],data(){return{checked:!0}},watch:{},methods:{getBaseUrlPlatform:H,onApply(){if(!this.checked){I.error(this.$t("application.message.notAgreePolicy"));return}this.$emit("apply")}}}),de={class:"content"},ue={class:"policy"},me={class:"policy-title"},_e=["href"];function fe(e,t,y,h,v,E){const u=o("el-descriptions-item"),$=o("el-descriptions"),m=o("el-divider"),b=o("el-checkbox"),l=o("el-button"),k=o("el-dialog");return n(),_(k,{"model-value":e.visible,width:"500px",title:e.$t("application.message.confirmApplying"),center:"",onClose:t[1]||(t[1]=c=>e.$emit("update:visible",!1))},{default:a(()=>[d("div",de,[s($,{column:1},{default:a(()=>[s(u,{label:e.$t("application.field.name")},{default:a(()=>{var c;return[f(i((c=e.service)==null?void 0:c.title),1)]}),_:1},8,["label"]),s(u,{label:e.$t("application.field.freeAmount")},{default:a(()=>{var c,w;return[d("span",null,i((c=e.service)==null?void 0:c.free_amount)+" "+i(e.$t(`service.unit.${(w=e.service)==null?void 0:w.unit}`)),1)]}),_:1},8,["label"])]),_:1}),s(m,{class:"my-2"}),d("div",ue,[s(b,{modelValue:e.checked,"onUpdate:modelValue":t[0]||(t[0]=c=>e.checked=c),size:"large",class:"policy-checkbox"},null,8,["modelValue"]),d("span",me,i(e.$t("application.message.readPolicy")),1),d("a",{class:"policy-title highlight",target:"_blank",href:e.getBaseUrlPlatform()+"/terms"}," \xA0"+i(e.$t("application.message.policy")),9,_e)]),s(l,{round:"",type:"primary",onClick:e.onApply},{default:a(()=>[f(i(e.$t("common.button.apply")),1)]),_:1},8,["onClick"])])]),_:1},8,["model-value","title"])}var ye=A(ce,[["render",fe],["__scopeId","data-v-666cd2fe"],["__file","/home/runner/work/Nexior/Nexior/src/components/application/Confirm.vue"]]);const he=C({name:"ApiPrice",components:{ElTable:ee,ElTableColumn:te,ElDialog:q,ElButton:B},props:{price:{type:Object,required:!0}},data(){return{visible:!1}},computed:{data(){var e;return((e=this.price)==null?void 0:e.data)||[]},columns(){var e;return(e=this.price)==null?void 0:e.columns},spans(){var e;return(e=this.price)==null?void 0:e.spans}},methods:{cellStyle(){return{"font-weight":"bold","text-align":"center"}},spanMethod({row:e,column:t,rowIndex:y,columnIndex:h}){if(this.spans){for(const v of this.spans)if(y===v[0]&&h===v[1])return[v[2],v[3]]}return[1,1]}}});function ve(e,t,y,h,v,E){const u=o("el-table-column"),$=o("el-table"),m=o("el-dialog"),b=o("el-button");return n(),r("div",null,[s(m,{modelValue:e.visible,"onUpdate:modelValue":t[0]||(t[0]=l=>e.visible=l),center:"",width:"80%"},{default:a(()=>[s($,{data:e.data,stripe:"","span-method":e.spanMethod,"header-cell-style":e.cellStyle,"cell-style":e.cellStyle},{default:a(()=>[(n(!0),r(S,null,z(e.columns,(l,k)=>(n(),_(u,{key:k,prop:l.key,label:l.label},null,8,["prop","label"]))),128))]),_:1},8,["data","span-method","header-cell-style","cell-style"])]),_:1},8,["modelValue"]),s(b,{round:"",size:"small",onClick:t[1]||(t[1]=l=>e.visible=!0)},{default:a(()=>[f(i(e.$t("service.button.pricing")),1)]),_:1})])}var $e=A(he,[["render",ve],["__scopeId","data-v-4600b314"],["__file","/home/runner/work/Nexior/Nexior/src/components/api/Price.vue"]]);const be=C({name:"ApplicationInfo",components:{ElTag:oe},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}}}),ge={key:0,class:"info"},ke={key:1,class:"subtitle"},we={key:1,type:"success",class:"info",effect:"dark"},Ae={key:1,class:"subtitle"};function Ce(e,t,y,h,v,E){var $,m,b,l;const u=o("el-tag");return n(),r(S,null,[e.application.type==="Period"?(n(),r("span",ge,[e.showType?(n(),_(u,{key:0,type:"primary",class:"mr-1",effect:"dark"},{default:a(()=>[f(i(e.$t("application.type.period")),1)]),_:1})):p("v-if",!0),f(" "+i(e.$t("common.message.expiredAt"))+": "+i(e.$dayjs.format(e.application.expired_at))+" ",1),e.showId?(n(),r("p",ke,"ID: "+i(e.application.id),1)):p("v-if",!0)])):p("v-if",!0),e.application.type==="Usage"?(n(),r("span",we,[e.showType?(n(),_(u,{key:0,class:"mr-1"},{default:a(()=>[f(i(e.$t("application.type.usage")),1)]),_:1})):p("v-if",!0),f(" "+i(e.$t("common.message.remainingAmount"))+": "+i((m=($=e.application)==null?void 0:$.remaining_amount)==null?void 0:m.toFixed(6))+" "+i(e.$t("service.unit."+((l=(b=e.application)==null?void 0:b.service)==null?void 0:l.unit)+"s"))+" ",1),e.showId?(n(),r("p",Ae,"ID: "+i(e.application.id),1)):p("v-if",!0)])):p("v-if",!0)],64)}var Ee=A(be,[["render",Ce],["__scopeId","data-v-7ffaebbd"],["__file","/home/runner/work/Nexior/Nexior/src/components/application/Info.vue"]]);const Ie=C({name:"ApplicationStatus",components:{ElButton:B,ApplicationInfo:Ee,ApplicationConfirm:ye,ElSkeleton:ne,ElSkeletonItem:ie,ApiPrice:$e,ElDropdown:ae,ElDropdownMenu:se,ElDropdownItem:le,ArrowDown:pe,ElIcon:re},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},initializing:{type:Boolean,default:!1},showPrice:{type:Boolean,default:!0},service:{type:Object,required:!0},needApply:{type:Boolean,default:!1}},emits:["apply","refresh","applied","update:application","select"],data(){return{confirming:this.needApply,applicationType:J}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user}},watch:{needApply(e){e&&(this.confirming=e)}},methods:{onBuyMore(e){this.$router.push({name:K,params:{id:e.id}})},onCreateCredential(e){W.create({application_id:e==null?void 0:e.id,host:window.location.origin}).then(()=>{setTimeout(()=>{this.$emit("refresh")},2e3),this.confirming=!1}).finally(()=>{this.$emit("applied")})},onSelectApplication(e){this.$emit("select",e)},onApply(){var e;G.create({service_id:(e=this.service)==null?void 0:e.id}).then(({data:t})=>{I.success(this.$t("application.message.applySuccessfully")),this.onCreateCredential(t)}).catch(t=>{var y,h;((h=(y=t==null?void 0:t.response)==null?void 0:y.data)==null?void 0:h.code)===Q&&I.error(this.$t("application.message.alreadyApplied")),this.confirming=!1})}}}),Be={class:"element"},Se={key:0},Ne={key:1,class:"status"},Ve={class:"el-dropdown-link"},De={class:"actions"},Oe={key:2,class:"text-center info"},Pe={class:"mr-2"},Te={class:"ml-1"};function Ue(e,t,y,h,v,E){var V,D,O,P,T,U,M,j;const u=o("el-skeleton-item"),$=o("el-skeleton"),m=o("application-info"),b=o("arrow-down"),l=o("el-icon"),k=o("el-dropdown-item"),c=o("el-dropdown-menu"),w=o("el-dropdown"),N=o("el-button"),R=o("api-price"),F=o("application-confirm");return n(),r("div",Be,[e.initializing&&e.application===void 0?(n(),r("div",Se,[s($,{rows:1,class:"text-center"},{template:a(()=>[s(u,{variant:"p",class:"shimmer"})]),_:1})])):e.application?(n(),r("div",Ne,[s(w,{onCommand:e.onSelectApplication},{dropdown:a(()=>[e.applications&&e.applications.length>0?(n(),_(c,{key:0},{default:a(()=>[(n(!0),r(S,null,z(e.applications,(g,L)=>(n(),_(k,{key:L,command:g},{default:a(()=>[s(m,{application:g,"show-type":!0,"show-id":!0},null,8,["application"])]),_:2},1032,["command"]))),128))]),_:1})):p("v-if",!0)]),default:a(()=>[d("span",Ve,[s(m,{application:e.application},null,8,["application"]),e.applications&&e.applications.length>0?(n(),_(l,{key:0,class:"el-icon--right ml-0"},{default:a(()=>[s(b)]),_:1})):p("v-if",!0)])]),_:1},8,["onCommand"]),d("span",De,[s(N,{round:"",size:"small",type:"primary",class:"mr-1",onClick:t[0]||(t[0]=g=>e.onBuyMore(e.application))},{default:a(()=>[f(i(e.$t("common.button.buyMore")),1)]),_:1}),e.showPrice&&((P=(O=(D=(V=e.application)==null?void 0:V.service)==null?void 0:D.apis)==null?void 0:O[0])==null?void 0:P.price)?(n(),_(R,{key:0,class:"price inline-block",price:(j=(M=(U=(T=e.application)==null?void 0:T.service)==null?void 0:U.apis)==null?void 0:M[0])==null?void 0:j.price},null,8,["price"])):p("v-if",!0)])])):p("v-if",!0),e.needApply&&e.service?(n(),r("div",Oe,[d("span",Pe,i(e.$t("chat.message.notApplied")),1),d("span",null,[s(N,{round:"",type:"primary",class:"btn btn-apply",size:"small",onClick:t[1]||(t[1]=g=>e.confirming=!0)},{default:a(()=>[f(i(e.$t("common.button.apply")),1)]),_:1})]),d("span",Te,i(e.$t("chat.message.tryForFree")),1),e.service&&e.authenticated?(n(),_(F,{key:0,modelValue:e.confirming,"onUpdate:modelValue":t[2]||(t[2]=g=>e.confirming=g),modelModifiers:{visible:!0},service:e.service,onApply:e.onApply},null,8,["modelValue","service","onApply"])):p("v-if",!0)])):p("v-if",!0)])}var Re=A(Ie,[["render",Ue],["__scopeId","data-v-2941d97e"],["__file","/home/runner/work/Nexior/Nexior/src/components/application/Status.vue"]]);export{Re as A};
@@ -1 +1 @@
1
- import"./vendor-others.e28a6fa7.js";import{I as D}from"./api.f60246f3.js";import{_ as L,I as $,K as A,H as k,L as V,J as H}from"./index.59517cde.js";import{o as K}from"./order.33583a13.js";import{g as M}from"./price.b9f5653c.js";import{ar as W}from"./vendor-fortawesome.0d8f27df.js";import{H as x,A as U,b as z,B as J,F as X,u as Y,y as S}from"./vendor-element-plus.7eade167.js";import{H as j,al as f,L as m,M as o,o as c,V as l,f as d,T as p,e as _,ai as P,P as q,S as b,R as T,U as N}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const G=j({name:"ConsoleSubscriptionBuy",components:{ElSkeleton:x,ElRow:U,ElTag:z,ElCol:J,ElCard:X,FontAwesomeIcon:W,ElButton:Y},data(){return{application:void 0,application2:void 0,type:$.PERIOD,services:[],loading:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()},subscriptions(){var t,r,h,u;const e=[{name:"WEEK",label:this.$t("console.subscription.weekly"),description:this.$t("console.subscription.weekly.description"),duration:604800},{name:"MONTH",label:this.$t("console.subscription.monthly"),description:this.$t("console.subscription.monthly.description"),duration:2592e3},{name:"YEAR",tag:this.$t("console.button.suggested"),label:this.$t("console.subscription.yearly"),description:this.$t("console.subscription.yearly.description"),duration:31536e3}];for(const i of e){console.log("item",i);const a=this.getPackages(i.duration);console.log("pkgs",a),a&&(i.price=a.reduce((s,g)=>s+g.price,0));for(const s of a)i.benefits||(i.benefits=[]),i.benefits.push({enabled:!0,content:`${(t=s==null?void 0:s.service)==null?void 0:t.title} - ${s.amount} `+this.$t("service.unit."+((r=s==null?void 0:s.service)==null?void 0:r.unit)+"s")});(h=i.benefits)==null||h.push({enabled:i.name!=="WEEK",content:this.$t("console.message.benefit1")}),(u=i.benefits)==null||u.push({enabled:i.name!=="WEEK",content:this.$t("console.message.benefit2")})}return e},service(){var e;return(e=this.application)==null?void 0:e.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){this.loading=!0,await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.loading=!1,this.subscription=this.subscriptions[2]},methods:{getPriceString:M,onBuyExtra(){this.$router.push({name:A,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];const h=[this.service].sort((u,i)=>this.serviceIds.indexOf(u.id)-this.serviceIds.indexOf(i.id));for(const u of h){const i=u.packages,a=i==null?void 0:i.find(s=>s.type===D.PERIOD&&s.duration===e);a&&t.push({...a,service:u})}return t},async onCreateApplications(){var t,r;const e=[];if(this.application2||e.push((r=(t=this.application)==null?void 0:t.service)==null?void 0:r.id),e.length>0){for(const h of e)await k.create({service_id:h,type:$.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log("onChangeType",this.type),this.$router.push({name:A,params:this.$route.params})},async onFetchServices(){const{data:e}=await V.getAll({id:this.serviceIds});this.services=e.items,console.debug("services",this.services)},async onFetchApplication(){const{data:e}=await k.get(this.applicationId);this.application=e,console.debug("application",this.application)},async onFetchApplication2(){var t;const{data:e}=await k.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at",service_id:this.serviceIds,type:$.PERIOD});this.application2=(t=e.items)==null?void 0:t[0],console.debug("application2",this.application2)},onCreateOrder(e){var t;if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){S.error(this.$t("console.message.applicationNotFound")),this.creating=!1;return}K.create({application_ids:[this.application2.id],package_ids:this.getPackages(e.duration).map(r=>r.id),description:((t=this.service)==null?void 0:t.title)+" - "+e.label}).then(({data:r})=>{this.creating=!1,this.$router.push({name:H,params:{id:r.id}})}).catch(()=>{S.error(this.$t("order.message.createFailed")),this.creating=!1})}}}),Q={class:"title"},Z={class:"introduction"},ee={class:"name"},te={class:"price"},se={class:"description"},ie={class:"benefits"},oe={class:"operations"},ae={key:2,class:"extra"};function ne(e,t,r,h,u,i){const a=f("el-col"),s=f("el-row"),g=f("el-skeleton"),R=f("el-tag"),E=f("font-awesome-icon"),C=f("el-button"),I=f("el-card");return c(),m(s,{class:"panel"},{default:o(()=>[l(a,{span:24},{default:o(()=>[l(s,null,{default:o(()=>[l(a,{span:24},{default:o(()=>[d("h2",Q,p(e.$t("common.title.buyMore")),1)]),_:1})]),_:1}),l(s,null,{default:o(()=>[l(a,{span:24},{default:o(()=>[l(I,{shadow:"hover",class:"card"},{default:o(()=>[l(s,null,{default:o(()=>[l(a,{span:16,offset:4},{default:o(()=>[d("p",Z,p(e.$t("console.subscription.title")),1),e.loading?(c(),m(g,{key:0})):(c(),m(s,{key:1,gutter:15,class:"subscriptions"},{default:o(()=>[(c(!0),_(N,null,P(e.subscriptions,(n,F)=>{var w;return c(),m(a,{key:F,xs:24,md:24/(((w=e.subscriptions)==null?void 0:w.length)||4)},{default:o(()=>{var O;return[l(I,{shadow:"hover",class:q({subscription:!0,active:((O=e.subscription)==null?void 0:O.name)===n.name}),onClick:v=>e.subscription=n},{default:o(()=>{var v;return[d("h4",ee,[b(p(n.label)+" ",1),n.tag?(c(),m(R,{key:0,type:"warning"},{default:o(()=>[b(p(n.tag),1)]),_:2},1024)):T("v-if",!0)]),d("h2",te,p(e.getPriceString({value:n.price})),1),d("p",se,p(n.description),1),d("div",ie,[(c(!0),_(N,null,P(n.benefits,(y,B)=>(c(),_("div",{key:B,class:"benefit"},[y.enabled?(c(),m(E,{key:0,icon:"fa-solid fa-check",class:"icon icon-check"})):(c(),m(E,{key:1,icon:"fa-solid fa-xmark",class:"icon icon-xmark"})),d("span",null,p(y.content),1)]))),128))]),d("div",oe,[l(C,{class:"btn btn-subscribe",type:((v=e.subscription)==null?void 0:v.name)===(n==null?void 0:n.name)?"primary":"",round:"",onClick:y=>e.onCreateOrder(n)},{default:o(()=>[b(p(e.$t("common.button.buy")),1)]),_:2},1032,["type","onClick"])])]}),_:2},1032,["class","onClick"])]}),_:2},1032,["md"])}),128))]),_:1})),e.loading?T("v-if",!0):(c(),_("div",ae,[d("span",null,p(e.$t("console.message.doNotWantSubscribe")),1),l(C,{type:"primary",class:"btn btn-extra",round:"",size:"small",onClick:e.onBuyExtra},{default:o(()=>[b(p(e.$t("console.message.buyExtra")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var be=L(G,[["render",ne],["__scopeId","data-v-56303b1f"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/Subscribe.vue"]]);export{be as default};
1
+ import"./vendor-others.e28a6fa7.js";import{I as D}from"./api.f60246f3.js";import{_ as L,I as $,H as A,F as k,J as V,G as H}from"./index.d28a66ae.js";import{o as M}from"./order.6d451728.js";import{g as W}from"./price.e1faf3aa.js";import{ar as x}from"./vendor-fortawesome.0d8f27df.js";import{H as K,A as U,b as z,B as G,F as J,u as X,y as S}from"./vendor-element-plus.7eade167.js";import{H as Y,al as f,L as m,M as o,o as c,V as l,f as d,T as p,e as _,ai as P,P as j,S as b,R as T,U as F}from"./vendor-@vue.8cef8b94.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.ef88fffc.js";const q=Y({name:"ConsoleSubscriptionBuy",components:{ElSkeleton:K,ElRow:U,ElTag:z,ElCol:G,ElCard:J,FontAwesomeIcon:x,ElButton:X},data(){return{application:void 0,application2:void 0,type:$.PERIOD,services:[],loading:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()},subscriptions(){var t,r,h,u;const e=[{name:"WEEK",label:this.$t("console.subscription.weekly"),description:this.$t("console.subscription.weekly.description"),duration:604800},{name:"MONTH",label:this.$t("console.subscription.monthly"),description:this.$t("console.subscription.monthly.description"),duration:2592e3},{name:"YEAR",tag:this.$t("console.button.suggested"),label:this.$t("console.subscription.yearly"),description:this.$t("console.subscription.yearly.description"),duration:31536e3}];for(const i of e){console.log("item",i);const a=this.getPackages(i.duration);console.log("pkgs",a),a&&(i.price=a.reduce((s,g)=>s+g.price,0));for(const s of a)i.benefits||(i.benefits=[]),i.benefits.push({enabled:!0,content:`${(t=s==null?void 0:s.service)==null?void 0:t.title} - ${s.amount} `+this.$t("service.unit."+((r=s==null?void 0:s.service)==null?void 0:r.unit)+"s")});(h=i.benefits)==null||h.push({enabled:i.name!=="WEEK",content:this.$t("console.message.benefit1")}),(u=i.benefits)==null||u.push({enabled:i.name!=="WEEK",content:this.$t("console.message.benefit2")})}return e},service(){var e;return(e=this.application)==null?void 0:e.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){this.loading=!0,await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.loading=!1,this.subscription=this.subscriptions[2]},methods:{getPriceString:W,onBuyExtra(){this.$router.push({name:A,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];const h=[this.service].sort((u,i)=>this.serviceIds.indexOf(u.id)-this.serviceIds.indexOf(i.id));for(const u of h){const i=u.packages,a=i==null?void 0:i.find(s=>s.type===D.PERIOD&&s.duration===e);a&&t.push({...a,service:u})}return t},async onCreateApplications(){var t,r;const e=[];if(this.application2||e.push((r=(t=this.application)==null?void 0:t.service)==null?void 0:r.id),e.length>0){for(const h of e)await k.create({service_id:h,type:$.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log("onChangeType",this.type),this.$router.push({name:A,params:this.$route.params})},async onFetchServices(){const{data:e}=await V.getAll({id:this.serviceIds});this.services=e.items,console.debug("services",this.services)},async onFetchApplication(){const{data:e}=await k.get(this.applicationId);this.application=e,console.debug("application",this.application)},async onFetchApplication2(){var t;const{data:e}=await k.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at",service_id:this.serviceIds,type:$.PERIOD});this.application2=(t=e.items)==null?void 0:t[0],console.debug("application2",this.application2)},onCreateOrder(e){var t;if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){S.error(this.$t("console.message.applicationNotFound")),this.creating=!1;return}M.create({application_ids:[this.application2.id],package_ids:this.getPackages(e.duration).map(r=>r.id),description:((t=this.service)==null?void 0:t.title)+" - "+e.label}).then(({data:r})=>{this.creating=!1,this.$router.push({name:H,params:{id:r.id}})}).catch(()=>{S.error(this.$t("order.message.createFailed")),this.creating=!1})}}}),Q={class:"title"},Z={class:"introduction"},ee={class:"name"},te={class:"price"},se={class:"description"},ie={class:"benefits"},oe={class:"operations"},ae={key:2,class:"extra"};function ne(e,t,r,h,u,i){const a=f("el-col"),s=f("el-row"),g=f("el-skeleton"),N=f("el-tag"),E=f("font-awesome-icon"),C=f("el-button"),I=f("el-card");return c(),m(s,{class:"panel"},{default:o(()=>[l(a,{span:24},{default:o(()=>[l(s,null,{default:o(()=>[l(a,{span:24},{default:o(()=>[d("h2",Q,p(e.$t("common.title.buyMore")),1)]),_:1})]),_:1}),l(s,null,{default:o(()=>[l(a,{span:24},{default:o(()=>[l(I,{shadow:"hover",class:"card"},{default:o(()=>[l(s,null,{default:o(()=>[l(a,{span:16,offset:4},{default:o(()=>[d("p",Z,p(e.$t("console.subscription.title")),1),e.loading?(c(),m(g,{key:0})):(c(),m(s,{key:1,gutter:15,class:"subscriptions"},{default:o(()=>[(c(!0),_(F,null,P(e.subscriptions,(n,R)=>{var w;return c(),m(a,{key:R,xs:24,md:24/(((w=e.subscriptions)==null?void 0:w.length)||4)},{default:o(()=>{var O;return[l(I,{shadow:"hover",class:j({subscription:!0,active:((O=e.subscription)==null?void 0:O.name)===n.name}),onClick:v=>e.subscription=n},{default:o(()=>{var v;return[d("h4",ee,[b(p(n.label)+" ",1),n.tag?(c(),m(N,{key:0,type:"warning"},{default:o(()=>[b(p(n.tag),1)]),_:2},1024)):T("v-if",!0)]),d("h2",te,p(e.getPriceString({value:n.price})),1),d("p",se,p(n.description),1),d("div",ie,[(c(!0),_(F,null,P(n.benefits,(y,B)=>(c(),_("div",{key:B,class:"benefit"},[y.enabled?(c(),m(E,{key:0,icon:"fa-solid fa-check",class:"icon icon-check"})):(c(),m(E,{key:1,icon:"fa-solid fa-xmark",class:"icon icon-xmark"})),d("span",null,p(y.content),1)]))),128))]),d("div",oe,[l(C,{class:"btn btn-subscribe",type:((v=e.subscription)==null?void 0:v.name)===(n==null?void 0:n.name)?"primary":"",round:"",onClick:y=>e.onCreateOrder(n)},{default:o(()=>[b(p(e.$t("common.button.buy")),1)]),_:2},1032,["type","onClick"])])]}),_:2},1032,["class","onClick"])]}),_:2},1032,["md"])}),128))]),_:1})),e.loading?T("v-if",!0):(c(),_("div",ae,[d("span",null,p(e.$t("console.message.doNotWantSubscribe")),1),l(C,{type:"primary",class:"btn btn-extra",round:"",size:"small",onClick:e.onBuyExtra},{default:o(()=>[b(p(e.$t("console.message.buyExtra")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var be=L(q,[["render",ne],["__scopeId","data-v-56303b1f"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/Subscribe.vue"]]);export{be as default};
@@ -1 +1 @@
1
- var a=Object.defineProperty;var n=(i,t,s)=>t in i?a(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var e=(i,t,s)=>(n(i,typeof t!="symbol"?t+"":t,s),s);import{D as r}from"./index.59517cde.js";class o{constructor(){e(this,"key","distribution-histories")}async getAll(t){return await r.get(`/${this.key}/`,{params:t})}}const b=new o;class l{constructor(){e(this,"key","distribution-statuses")}async getAll(t){return await r.get(`/${this.key}/`,{params:t})}async initialize(){return await r.post(`/${this.key}/initialize/`)}}const h=new l;class c{constructor(){e(this,"key","distribution-levels")}async getAll(t){return await r.get(`/${this.key}/`,{params:t})}}const k=new c;class u{constructor(){e(this,"key","shorturl")}async create(t){return await r.post(`/${this.key}`,{content:t})}}const w=new u;export{k as a,b,h as d,w as s};
1
+ var a=Object.defineProperty;var n=(i,t,s)=>t in i?a(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var e=(i,t,s)=>(n(i,typeof t!="symbol"?t+"":t,s),s);import{B as r}from"./index.d28a66ae.js";class o{constructor(){e(this,"key","distribution-histories")}async getAll(t){return await r.get(`/${this.key}/`,{params:t})}}const b=new o;class l{constructor(){e(this,"key","distribution-statuses")}async getAll(t){return await r.get(`/${this.key}/`,{params:t})}async initialize(){return await r.post(`/${this.key}/initialize/`)}}const h=new l;class c{constructor(){e(this,"key","distribution-levels")}async getAll(t){return await r.get(`/${this.key}/`,{params:t})}}const k=new c;class u{constructor(){e(this,"key","shorturl")}async create(t){return await r.post(`/${this.key}`,{content:t})}}const w=new u;export{k as a,b,h as d,w as s};