Files
cloud-mail/mail-worker/dist/assets/index-CSPwOLmJ.js
2025-08-28 22:28:00 +08:00

19 lines
53 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{b as xe,d as ge,_ as me,a as Y,u as ie,c as T,o as d,e as ce,f as r,n as x,g as o,r as oe,h as Q,t as k,i as Ie,w as st,j as Kt,k as A,l as Ce,E as le,m as O,p as g,q as Gt,T as wt,s as ze,v as Zt,x as He,y as Pe,z,A as Jt,B as Xt,C as ot,D as ke,F as pe,G as Ge,H as at,I as ye,J as Te,K as J,L as Be,M as fe,N as se,O as je,P as ve,Q as Ze,R as be,S as kt,U as Qt,V as en,W as tn,X as ht,Y as nn,Z as sn,$ as Ee,a0 as on,a1 as an,a2 as ln,a3 as rn,a4 as gt,a5 as cn,a6 as Je,a7 as we,a8 as un,a9 as Xe,aa as yt,ab as u,ac as dn,ad as _t,ae as mn,af as Me,ag as lt,ah as it,ai as de,aj as Fe,ak as rt,al as We,am as ae,an as ee,ao as Ct,ap as Oe,aq as pn,ar as fn,as as vn,at as hn,au as Ae}from"./index-BtzXKQwE.js";import{E as $t}from"./el-scrollbar-CKPMF6AL.js";import"./el-tooltip-l0sNRNKZ.js";import{E as Et,a as gn}from"./el-tag-Crsyy918.js";import{I as D}from"./iconify-py6I6n_h.js";import{_ as he}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{t as Le,f as yn,E as It}from"./vnode-D7e7dmSq.js";import{E as _n}from"./index-f0vcIZ2X.js";import{T as bn,E as ct}from"./index-_2NpElih.js";import{t as De,d as wn}from"./index-DeJUs09x.js";import{C as kn,E as Cn,a as $n}from"./el-select--GMHwZW2.js";/* empty css */import{E as St,a as Mt,b as xt}from"./el-dropdown-item-BA-mcYwt.js";import{l as En}from"./login-BGZJtiJs.js";import{c as Tt}from"./clipboard-utils-CzPXxZBC.js";import{s as In,f as Sn}from"./day-PdIoF79x.js";import{s as Mn,E as xn,a as Tn,b as Nn}from"./time-utils-B0dkmGNr.js";import{E as zn}from"./el-dialog-CXB77qUH.js";/* empty css *//* empty css */import{E as An}from"./el-empty-B50ZRwXV.js";import{a as On,b as Ln,c as Pn,d as Bn}from"./account-U66inDzc.js";import{i as Nt}from"./verify-utils-D6Av2NDy.js";import{E as Qe}from"./index-CTUonbyI.js";import{E as jn}from"./el-input-tag-DCGL0bB7.js";import{l as Dn}from"./index-EFTyCj7O.js";import{c as Vn,f as Rn,a as Fn}from"./file-utils-BfzHgCq1.js";import{e as Wn}from"./email-CubjfII-.js";import{u as Un}from"./email-CLpV48-R.js";import{g as qn}from"./icon-utils-DTcb3PuW.js";import{u as Hn,d as bt}from"./db-BaXP6xNr.js";import{d as Yn}from"./dayjs.min--KgWQ631.js";import"./index-Cu3SrEOD.js";import"./index-CBgbCWze.js";import"./event-BB_Ol6Sd.js";import"./position-VaOS-z7A.js";import"./throttle-SLW7VV_y.js";const Kn=xe({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:ge([String,Object,Array]),default:""},headerClass:String,bodyClass:String,footerClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),Gn=Y({name:"ElCard"}),Zn=Y({...Gn,props:Kn,setup(n){const t=ie("card");return(e,s)=>(d(),T("div",{class:x([o(t).b(),o(t).is(`${e.shadow}-shadow`)])},[e.$slots.header||e.header?(d(),T("div",{key:0,class:x([o(t).e("header"),e.headerClass])},[oe(e.$slots,"header",{},()=>[Q(k(e.header),1)])],2)):ce("v-if",!0),r("div",{class:x([o(t).e("body"),e.bodyClass]),style:Ie(e.bodyStyle)},[oe(e.$slots,"default")],6),e.$slots.footer||e.footer?(d(),T("div",{key:1,class:x([o(t).e("footer"),e.footerClass])},[oe(e.$slots,"footer",{},()=>[Q(k(e.footer),1)])],2)):ce("v-if",!0)],2))}});var Jn=me(Zn,[["__file","card.vue"]]);const Xn=st(Jn),Qn=Y({name:"ElContainer"}),es=Y({...Qn,props:{direction:{type:String}},setup(n){const t=n,e=Kt(),s=ie("container"),a=A(()=>t.direction==="vertical"?!0:t.direction==="horizontal"?!1:e&&e.default?e.default().some(f=>{const _=f.type.name;return _==="ElHeader"||_==="ElFooter"}):!1);return(p,f)=>(d(),T("section",{class:x([o(s).b(),o(s).is("vertical",o(a))])},[oe(p.$slots,"default")],2))}});var ts=me(es,[["__file","container.vue"]]);const ns=Y({name:"ElAside"}),ss=Y({...ns,props:{width:{type:String,default:null}},setup(n){const t=n,e=ie("aside"),s=A(()=>t.width?e.cssVarBlock({width:t.width}):{});return(a,p)=>(d(),T("aside",{class:x(o(e).b()),style:Ie(o(s))},[oe(a.$slots,"default")],6))}});var zt=me(ss,[["__file","aside.vue"]]);const os=Y({name:"ElFooter"}),as=Y({...os,props:{height:{type:String,default:null}},setup(n){const t=n,e=ie("footer"),s=A(()=>t.height?e.cssVarBlock({height:t.height}):{});return(a,p)=>(d(),T("footer",{class:x(o(e).b()),style:Ie(o(s))},[oe(a.$slots,"default")],6))}});var At=me(as,[["__file","footer.vue"]]);const ls=Y({name:"ElHeader"}),is=Y({...ls,props:{height:{type:String,default:null}},setup(n){const t=n,e=ie("header"),s=A(()=>t.height?e.cssVarBlock({height:t.height}):{});return(a,p)=>(d(),T("header",{class:x(o(e).b()),style:Ie(o(s))},[oe(a.$slots,"default")],6))}});var Ot=me(is,[["__file","header.vue"]]);const rs=Y({name:"ElMain"}),cs=Y({...rs,setup(n){const t=ie("main");return(e,s)=>(d(),T("main",{class:x(o(t).b())},[oe(e.$slots,"default")],2))}});var Lt=me(cs,[["__file","main.vue"]]);const us=st(ts,{Aside:zt,Footer:At,Header:Ot,Main:Lt}),ds=Ce(zt);Ce(At);const ms=Ce(Ot),ps=Ce(Lt);let fs=class{constructor(t,e){this.parent=t,this.domNode=e,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(t){t===this.subMenuItems.length?t=0:t<0&&(t=this.subMenuItems.length-1),this.subMenuItems[t].focus(),this.subIndex=t}addListeners(){const t=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,e=>{e.addEventListener("keydown",s=>{let a=!1;switch(s.code){case le.down:{this.gotoSubIndex(this.subIndex+1),a=!0;break}case le.up:{this.gotoSubIndex(this.subIndex-1),a=!0;break}case le.tab:{Le(t,"mouseleave");break}case le.enter:case le.numpadEnter:case le.space:{a=!0,s.currentTarget.click();break}}return a&&(s.preventDefault(),s.stopPropagation()),!1})})}},vs=class{constructor(t,e){this.domNode=t,this.submenu=null,this.submenu=null,this.init(e)}init(t){this.domNode.setAttribute("tabindex","0");const e=this.domNode.querySelector(`.${t}-menu`);e&&(this.submenu=new fs(this,e)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",t=>{let e=!1;switch(t.code){case le.down:{Le(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),e=!0;break}case le.up:{Le(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),e=!0;break}case le.tab:{Le(t.currentTarget,"mouseleave");break}case le.enter:case le.numpadEnter:case le.space:{e=!0,t.currentTarget.click();break}}e&&t.preventDefault()})}},hs=class{constructor(t,e){this.domNode=t,this.init(e)}init(t){const e=this.domNode.childNodes;Array.from(e).forEach(s=>{s.nodeType===1&&new vs(s,t)})}};const gs=Y({name:"ElMenuCollapseTransition"}),ys=Y({...gs,setup(n){const t=ie("menu"),e={onBeforeEnter:s=>s.style.opacity="0.2",onEnter(s,a){ze(s,`${t.namespace.value}-opacity-transition`),s.style.opacity="1",a()},onAfterEnter(s){He(s,`${t.namespace.value}-opacity-transition`),s.style.opacity=""},onBeforeLeave(s){s.dataset||(s.dataset={}),Zt(s,t.m("collapse"))?(He(s,t.m("collapse")),s.dataset.oldOverflow=s.style.overflow,s.dataset.scrollWidth=s.clientWidth.toString(),ze(s,t.m("collapse"))):(ze(s,t.m("collapse")),s.dataset.oldOverflow=s.style.overflow,s.dataset.scrollWidth=s.clientWidth.toString(),He(s,t.m("collapse"))),s.style.width=`${s.scrollWidth}px`,s.style.overflow="hidden"},onLeave(s){ze(s,"horizontal-collapse-transition"),s.style.width=`${s.dataset.scrollWidth}px`}};return(s,a)=>(d(),O(wt,Gt({mode:"out-in"},o(e)),{default:g(()=>[oe(s.$slots,"default")]),_:3},16))}});var _s=me(ys,[["__file","menu-collapse-transition.vue"]]);function Pt(n,t){const e=A(()=>{let a=n.parent;const p=[t.value];for(;a.type.name!=="ElMenu";)a.props.index&&p.unshift(a.props.index),a=a.parent;return p});return{parentMenu:A(()=>{let a=n.parent;for(;a&&!["ElMenu","ElSubMenu"].includes(a.type.name);)a=a.parent;return a}),indexPath:e}}function bs(n){return A(()=>{const e=n.backgroundColor;return e?new bn(e).shade(20).toString():""})}const Bt=(n,t)=>{const e=ie("menu");return A(()=>e.cssVarBlock({"text-color":n.textColor||"","hover-text-color":n.textColor||"","bg-color":n.backgroundColor||"","hover-bg-color":bs(n).value||"","active-color":n.activeTextColor||"",level:`${t}`}))},ut="rootMenu",Ve="subMenu:",ws=xe({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:be},expandOpenIcon:{type:be},collapseCloseIcon:{type:be},collapseOpenIcon:{type:be}}),Ye="ElSubMenu";var dt=Y({name:Ye,props:ws,setup(n,{slots:t,expose:e}){const s=at(),{indexPath:a,parentMenu:p}=Pt(s,A(()=>n.index)),f=ie("menu"),_=ie("sub-menu"),i=Pe(ut);i||De(Ye,"can not inject root menu");const l=Pe(`${Ve}${p.value.uid}`);l||De(Ye,"can not inject sub menu");const y=z({}),E=z({});let I;const L=z(!1),N=z(),c=z(),K=A(()=>R.value==="horizontal"&&C.value?"bottom-start":"right-start"),te=A(()=>R.value==="horizontal"&&C.value||R.value==="vertical"&&!i.props.collapse?n.expandCloseIcon&&n.expandOpenIcon?P.value?n.expandOpenIcon:n.expandCloseIcon:Jt:n.collapseCloseIcon&&n.collapseOpenIcon?P.value?n.collapseOpenIcon:n.collapseCloseIcon:Xt),C=A(()=>l.level===0),b=A(()=>{const $=n.teleported;return ot($)?C.value:$}),S=A(()=>i.props.collapse?`${f.namespace.value}-zoom-in-left`:`${f.namespace.value}-zoom-in-top`),F=A(()=>R.value==="horizontal"&&C.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),P=A(()=>i.openedMenus.includes(n.index)),V=A(()=>[...Object.values(y.value),...Object.values(E.value)].some(({active:$})=>$)),R=A(()=>i.props.mode),Z=A(()=>i.props.persistent),X=ke({index:n.index,indexPath:a,active:V}),G=Bt(i.props,l.level+1),ue=A(()=>{var $;return($=n.popperOffset)!=null?$:i.props.popperOffset}),re=A(()=>{var $;return($=n.popperClass)!=null?$:i.props.popperClass}),v=A(()=>{var $;return($=n.showTimeout)!=null?$:i.props.showTimeout}),m=A(()=>{var $;return($=n.hideTimeout)!=null?$:i.props.hideTimeout}),h=()=>{var $,q,H;return(H=(q=($=c.value)==null?void 0:$.popperRef)==null?void 0:q.popperInstanceRef)==null?void 0:H.destroy()},M=$=>{$||h()},W=()=>{i.props.menuTrigger==="hover"&&i.props.mode==="horizontal"||i.props.collapse&&i.props.mode==="vertical"||n.disabled||i.handleSubMenuClick({index:n.index,indexPath:a.value,active:V.value})},B=($,q=v.value)=>{var H;if($.type!=="focus"){if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"||n.disabled){l.mouseInChild.value=!0;return}l.mouseInChild.value=!0,I?.(),{stop:I}=Ze(()=>{i.openMenu(n.index,a.value)},q),b.value&&((H=p.value.vnode.el)==null||H.dispatchEvent(new MouseEvent("mouseenter")))}},ne=($=!1)=>{var q;if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"){l.mouseInChild.value=!1;return}I?.(),l.mouseInChild.value=!1,{stop:I}=Ze(()=>!L.value&&i.closeMenu(n.index,a.value),m.value),b.value&&$&&((q=l.handleMouseleave)==null||q.call(l,!0))};pe(()=>i.props.collapse,$=>M(!!$));{const $=H=>{E.value[H.index]=H},q=H=>{delete E.value[H.index]};Ge(`${Ve}${s.uid}`,{addSubMenu:$,removeSubMenu:q,handleMouseleave:ne,mouseInChild:L,level:l.level+1})}return e({opened:P}),ye(()=>{i.addSubMenu(X),l.addSubMenu(X)}),Te(()=>{l.removeSubMenu(X),i.removeSubMenu(X)}),()=>{var $;const q=[($=t.title)==null?void 0:$.call(t),J(Be,{class:_.e("icon-arrow"),style:{transform:P.value?n.expandCloseIcon&&n.expandOpenIcon||n.collapseCloseIcon&&n.collapseOpenIcon&&i.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>fe(te.value)?J(s.appContext.components[te.value]):J(te.value)})],H=i.isMenuPopup?J(Et,{ref:c,visible:P.value,effect:"light",pure:!0,offset:ue.value,showArrow:!1,persistent:Z.value,popperClass:re.value,placement:K.value,teleported:b.value,fallbackPlacements:F.value,transition:S.value,gpuAcceleration:!1},{content:()=>{var w;return J("div",{class:[f.m(R.value),f.m("popup-container"),re.value],onMouseenter:j=>B(j,100),onMouseleave:()=>ne(!0),onFocus:j=>B(j,100)},[J("ul",{class:[f.b(),f.m("popup"),f.m(`popup-${K.value}`)],style:G.value},[(w=t.default)==null?void 0:w.call(t)])])},default:()=>J("div",{class:_.e("title"),onClick:W},q)}):J(ve,{},[J("div",{class:_.e("title"),ref:N,onClick:W},q),J(_n,{},{default:()=>{var w;return se(J("ul",{role:"menu",class:[f.b(),f.m("inline")],style:G.value},[(w=t.default)==null?void 0:w.call(t)]),[[je,P.value]])}})]);return J("li",{class:[_.b(),_.is("active",V.value),_.is("opened",P.value),_.is("disabled",n.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:P.value,onMouseenter:B,onMouseleave:()=>ne(),onFocus:B},[H])}}});const ks=xe({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:ge(Array),default:()=>sn([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:be,default:()=>nn},popperEffect:{type:ge(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),Ke=n=>kt(n)&&n.every(t=>fe(t)),Cs={close:(n,t)=>fe(n)&&Ke(t),open:(n,t)=>fe(n)&&Ke(t),select:(n,t,e,s)=>fe(n)&&Ke(t)&&Qt(e)&&(ot(s)||s instanceof Promise)};var $s=Y({name:"ElMenu",props:ks,emits:Cs,setup(n,{emit:t,slots:e,expose:s}){const a=at(),p=a.appContext.config.globalProperties.$router,f=z(),_=ie("menu"),i=ie("sub-menu"),l=z(-1),y=z(n.defaultOpeneds&&!n.collapse?n.defaultOpeneds.slice(0):[]),E=z(n.defaultActive),I=z({}),L=z({}),N=A(()=>n.mode==="horizontal"||n.mode==="vertical"&&n.collapse),c=()=>{const m=E.value&&I.value[E.value];if(!m||n.mode==="horizontal"||n.collapse)return;m.indexPath.forEach(M=>{const W=L.value[M];W&&K(M,W.indexPath)})},K=(m,h)=>{y.value.includes(m)||(n.uniqueOpened&&(y.value=y.value.filter(M=>h.includes(M))),y.value.push(m),t("open",m,h))},te=m=>{const h=y.value.indexOf(m);h!==-1&&y.value.splice(h,1)},C=(m,h)=>{te(m),t("close",m,h)},b=({index:m,indexPath:h})=>{y.value.includes(m)?C(m,h):K(m,h)},S=m=>{(n.mode==="horizontal"||n.collapse)&&(y.value=[]);const{index:h,indexPath:M}=m;if(!(ht(h)||ht(M)))if(n.router&&p){const W=m.route||h,B=p.push(W).then(ne=>(ne||(E.value=h),ne));t("select",h,M,{index:h,indexPath:M,route:W},B)}else E.value=h,t("select",h,M,{index:h,indexPath:M})},F=m=>{var h;const M=I.value,W=M[m]||E.value&&M[E.value]||M[n.defaultActive];E.value=(h=W?.index)!=null?h:m},P=m=>{const h=getComputedStyle(m),M=Number.parseInt(h.marginLeft,10),W=Number.parseInt(h.marginRight,10);return m.offsetWidth+M+W||0},V=()=>{var m,h;if(!f.value)return-1;const M=Array.from((h=(m=f.value)==null?void 0:m.childNodes)!=null?h:[]).filter(j=>j.nodeName!=="#text"||j.nodeValue),W=64,B=getComputedStyle(f.value),ne=Number.parseInt(B.paddingLeft,10),$=Number.parseInt(B.paddingRight,10),q=f.value.clientWidth-ne-$;let H=0,w=0;return M.forEach((j,_e)=>{j.nodeName!=="#comment"&&(H+=P(j),H<=q-W&&(w=_e+1))}),w===M.length?-1:w},R=m=>L.value[m].indexPath,Z=(m,h=33.34)=>{let M;return()=>{M&&clearTimeout(M),M=setTimeout(()=>{m()},h)}};let X=!0;const G=()=>{if(l.value===V())return;const m=()=>{l.value=-1,Ee(()=>{l.value=V()})};X?m():Z(m)(),X=!1};pe(()=>n.defaultActive,m=>{I.value[m]||(E.value=""),F(m)}),pe(()=>n.collapse,m=>{m&&(y.value=[])}),pe(I.value,c);let ue;en(()=>{n.mode==="horizontal"&&n.ellipsis?ue=tn(f,G).stop:ue?.()});const re=z(!1);{const m=B=>{L.value[B.index]=B},h=B=>{delete L.value[B.index]};Ge(ut,ke({props:n,openedMenus:y,items:I,subMenus:L,activeIndex:E,isMenuPopup:N,addMenuItem:B=>{I.value[B.index]=B},removeMenuItem:B=>{delete I.value[B.index]},addSubMenu:m,removeSubMenu:h,openMenu:K,closeMenu:C,handleMenuItemClick:S,handleSubMenuClick:b})),Ge(`${Ve}${a.uid}`,{addSubMenu:m,removeSubMenu:h,mouseInChild:re,level:0})}ye(()=>{n.mode==="horizontal"&&new hs(a.vnode.el,_.namespace.value)}),s({open:h=>{const{indexPath:M}=L.value[h];M.forEach(W=>K(W,M))},close:te,updateActiveIndex:F,handleResize:G});const v=Bt(n,0);return()=>{var m,h;let M=(h=(m=e.default)==null?void 0:m.call(e))!=null?h:[];const W=[];if(n.mode==="horizontal"&&f.value){const $=yn(M),q=l.value===-1?$:$.slice(0,l.value),H=l.value===-1?[]:$.slice(l.value);H?.length&&n.ellipsis&&(M=q,W.push(J(dt,{index:"sub-menu-more",class:i.e("hide-arrow"),popperOffset:n.popperOffset},{title:()=>J(Be,{class:i.e("icon-more")},{default:()=>J(n.ellipsisIcon)}),default:()=>H})))}const B=n.closeOnClickOutside?[[kn,()=>{y.value.length&&(re.value||(y.value.forEach($=>t("close",$,R($))),y.value=[]))}]]:[],ne=se(J("ul",{key:String(n.collapse),role:"menubar",ref:f,style:v.value,class:{[_.b()]:!0,[_.m(n.mode)]:!0,[_.m("collapse")]:n.collapse}},[...M,...W]),B);return n.collapseTransition&&n.mode==="vertical"?J(_s,()=>ne):ne}}});const Es=xe({index:{type:ge([String,null]),default:null},route:{type:ge([String,Object])},disabled:Boolean}),Is={click:n=>fe(n.index)&&kt(n.indexPath)},et="ElMenuItem",Ss=Y({name:et}),Ms=Y({...Ss,props:Es,emits:Is,setup(n,{expose:t,emit:e}){const s=n;on(s.index)&&wn();const a=at(),p=Pe(ut),f=ie("menu"),_=ie("menu-item");p||De(et,"can not inject root menu");const{parentMenu:i,indexPath:l}=Pt(a,an(s,"index")),y=Pe(`${Ve}${i.value.uid}`);y||De(et,"can not inject sub menu");const E=A(()=>s.index===p.activeIndex),I=ke({index:s.index,indexPath:l,active:E}),L=()=>{s.disabled||(p.handleMenuItemClick({index:s.index,indexPath:l.value,route:s.route}),e("click",I))};return ye(()=>{y.addSubMenu(I),p.addMenuItem(I)}),Te(()=>{y.removeSubMenu(I),p.removeMenuItem(I)}),t({parentMenu:i,rootMenu:p,active:E,nsMenu:f,nsMenuItem:_,handleClick:L}),(N,c)=>(d(),T("li",{class:x([o(_).b(),o(_).is("active",o(E)),o(_).is("disabled",N.disabled)]),role:"menuitem",tabindex:"-1",onClick:L},[o(i).type.name==="ElMenu"&&o(p).props.collapse&&N.$slots.title?(d(),O(o(Et),{key:0,effect:o(p).props.popperEffect,placement:"right","fallback-placements":["left"],persistent:o(p).props.persistent},{content:g(()=>[oe(N.$slots,"title")]),default:g(()=>[r("div",{class:x(o(f).be("tooltip","trigger"))},[oe(N.$slots,"default")],2)]),_:3},8,["effect","persistent"])):(d(),T(ve,{key:1},[oe(N.$slots,"default"),oe(N.$slots,"title")],64))],2))}});var jt=me(Ms,[["__file","menu-item.vue"]]);const xs={title:String},Ts=Y({name:"ElMenuItemGroup"}),Ns=Y({...Ts,props:xs,setup(n){const t=ie("menu-item-group");return(e,s)=>(d(),T("li",{class:x(o(t).b())},[r("div",{class:x(o(t).e("title"))},[e.$slots.title?oe(e.$slots,"title",{key:1}):(d(),T(ve,{key:0},[Q(k(e.title),1)],64))],2),r("ul",null,[oe(e.$slots,"default")])],2))}});var Dt=me(Ns,[["__file","menu-item-group.vue"]]);const zs=st($s,{MenuItem:jt,MenuItemGroup:Dt,SubMenu:dt}),As=Ce(jt);Ce(Dt);Ce(dt);const Vt=["primary","success","info","warning","error"],Os=xe({customClass:{type:String,default:""},dangerouslyUseHTMLString:Boolean,duration:{type:Number,default:4500},icon:{type:be},id:{type:String,default:""},message:{type:ge([String,Object,Function]),default:""},offset:{type:Number,default:0},onClick:{type:ge(Function),default:()=>{}},onClose:{type:ge(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...Vt,""],default:""},zIndex:Number,closeIcon:{type:be,default:ln}}),Ls={destroy:()=>!0},Ps=Y({name:"ElNotification"}),Bs=Y({...Ps,props:Os,emits:Ls,setup(n,{expose:t}){const e=n,{ns:s,zIndex:a}=rn("notification"),{nextZIndex:p,currentZIndex:f}=a,_=z(!1);let i;const l=A(()=>{const C=e.type;return C&&gt[e.type]?s.m(C):""}),y=A(()=>e.type&&gt[e.type]||e.icon),E=A(()=>e.position.endsWith("right")?"right":"left"),I=A(()=>e.position.startsWith("top")?"top":"bottom"),L=A(()=>{var C;return{[I.value]:`${e.offset}px`,zIndex:(C=e.zIndex)!=null?C:f.value}});function N(){e.duration>0&&({stop:i}=Ze(()=>{_.value&&K()},e.duration))}function c(){i?.()}function K(){_.value=!1}function te({code:C}){C===le.delete||C===le.backspace?c():C===le.esc?_.value&&K():N()}return ye(()=>{N(),p(),_.value=!0}),cn(document,"keydown",te),t({visible:_,close:K}),(C,b)=>(d(),O(wt,{name:o(s).b("fade"),onBeforeLeave:C.onClose,onAfterLeave:S=>C.$emit("destroy"),persisted:""},{default:g(()=>[se(r("div",{id:C.id,class:x([o(s).b(),C.customClass,o(E)]),style:Ie(o(L)),role:"alert",onMouseenter:c,onMouseleave:N,onClick:C.onClick},[o(y)?(d(),O(o(Be),{key:0,class:x([o(s).e("icon"),o(l)])},{default:g(()=>[(d(),O(Je(o(y))))]),_:1},8,["class"])):ce("v-if",!0),r("div",{class:x(o(s).e("group"))},[r("h2",{class:x(o(s).e("title")),textContent:k(C.title)},null,10,["textContent"]),se(r("div",{class:x(o(s).e("content")),style:Ie(C.title?void 0:{margin:0})},[oe(C.$slots,"default",{},()=>[C.dangerouslyUseHTMLString?(d(),T(ve,{key:1},[ce(" Caution here, message could've been compromised, never use user's input as message "),r("p",{innerHTML:C.message},null,8,["innerHTML"])],2112)):(d(),T("p",{key:0},k(C.message),1))])],6),[[je,C.message]]),C.showClose?(d(),O(o(Be),{key:0,class:x(o(s).e("closeBtn")),onClick:we(K,["stop"])},{default:g(()=>[(d(),O(Je(C.closeIcon)))]),_:1},8,["class","onClick"])):ce("v-if",!0)],2)],46,["id","onClick"]),[[je,_.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var js=me(Bs,[["__file","notification.vue"]]);const Re={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},tt=16;let Ds=1;const Se=function(n={},t){if(!un)return{close:()=>{}};(fe(n)||Xe(n))&&(n={message:n});const e=n.position||"top-right";let s=n.offset||0;Re[e].forEach(({vm:y})=>{var E;s+=(((E=y.el)==null?void 0:E.offsetHeight)||0)+tt}),s+=tt;const a=`notification_${Ds++}`,p=n.onClose,f={...n,offset:s,id:a,onClose:()=>{Vs(a,e,p)}};let _=document.body;yt(n.appendTo)?_=n.appendTo:fe(n.appendTo)&&(_=document.querySelector(n.appendTo)),yt(_)||(_=document.body);const i=document.createElement("div"),l=u(js,f,dn(f.message)?f.message:Xe(f.message)?()=>f.message:null);return l.appContext=ot(t)?Se._context:t,l.props.onDestroy=()=>{_t(null,i)},_t(l,i),Re[e].push({vm:l}),_.appendChild(i.firstElementChild),{close:()=>{l.component.exposed.visible.value=!1}}};Vt.forEach(n=>{Se[n]=(t={},e)=>((fe(t)||Xe(t))&&(t={message:t}),Se({...t,type:n},e))});function Vs(n,t,e){const s=Re[t],a=s.findIndex(({vm:l})=>{var y;return((y=l.component)==null?void 0:y.props.id)===n});if(a===-1)return;const{vm:p}=s[a];if(!p)return;e?.(p);const f=p.el.offsetHeight,_=t.split("-")[0];s.splice(a,1);const i=s.length;if(!(i<1))for(let l=a;l<i;l++){const{el:y,component:E}=s[l].vm,I=Number.parseInt(y.style[_],10)-f-tt;E.props.offset=I}}function Rs(){for(const n of Object.values(Re))n.forEach(({vm:t})=>{t.component.exposed.visible.value=!1})}Se.closeAll=Rs;Se._context=null;const nt=mn(Se,"$notify"),Fs={class:"title"},Ws={class:"menu-name",style:{"margin-left":"21px"}},Us={class:"menu-name",style:{"margin-left":"21px"}},qs={class:"menu-name",style:{"margin-left":"22px"}},Hs={class:"menu-name",style:{"margin-left":"21px"}},Ys={class:"menu-name",style:{"margin-left":"21px"}},Ks={class:"manage-title"},Gs={class:"menu-name",style:{"margin-left":"18px"}},Zs={class:"menu-name",style:{"margin-left":"21px"}},Js={class:"menu-name",style:{"margin-left":"20px"}},Xs={class:"menu-name",style:{"margin-left":"20px"}},Qs={class:"menu-name",style:{"margin-left":"20px"}},eo={class:"menu-name",style:{"margin-left":"22px"}},to={__name:"index",setup(n){const t=Me(),e=lt();return(s,a)=>{const p=As,f=zs,_=$t,i=it("perm");return d(),O(_,{class:"scroll"},{default:g(()=>[r("div",null,[r("div",Fs,[u(o(D),{icon:"mdi:email-outline",width:"24",height:"24"}),r("div",null,k(o(t).settings.title),1)]),u(f,{collapse:!1,"text-color":"#fff","active-text-color":"#fff",style:{"margin-top":"10px"}},{default:g(()=>[u(p,{onClick:a[0]||(a[0]=l=>o(de).push({name:"email"})),index:"email",class:x(o(e).meta.name==="email"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"hugeicons:mailbox-01",width:"20",height:"20"}),r("span",Ws,k(s.$t("inbox")),1)]),_:1},8,["class"]),se((d(),O(p,{onClick:a[1]||(a[1]=l=>o(de).push({name:"send"})),index:"send",class:x(o(e).meta.name==="send"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"cil:send",width:"20",height:"20"}),r("span",Us,k(s.$t("sent")),1)]),_:1},8,["class"])),[[i,"email:send"]]),se((d(),O(p,{onClick:a[2]||(a[2]=l=>o(de).push({name:"draft"})),index:"draft",class:x(o(e).meta.name==="draft"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"ep:document",width:"19",height:"19"}),r("span",qs,k(s.$t("drafts")),1)]),_:1},8,["class"])),[[i,"email:send"]]),u(p,{onClick:a[3]||(a[3]=l=>o(de).push({name:"star"})),index:"star",class:x(o(e).meta.name==="star"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"solar:star-line-duotone",width:"20",height:"20"}),r("span",Hs,k(s.$t("starred")),1)]),_:1},8,["class"]),u(p,{onClick:a[4]||(a[4]=l=>o(de).push({name:"setting"})),index:"setting",class:x(o(e).meta.name==="setting"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"fluent:settings-48-regular",width:"20",height:"20"}),r("span",Ys,k(s.$t("settings")),1)]),_:1},8,["class"]),se((d(),T("div",Ks,[r("div",null,k(s.$t("manage")),1)])),[[i,["all-email:query","user:query","role:query","setting:query","analysis:query","reg-key:query"]]]),se((d(),O(p,{onClick:a[5]||(a[5]=l=>o(de).push({name:"analysis"})),index:"analysis",class:x(o(e).meta.name==="analysis"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"fluent:data-pie-20-regular",width:"24",height:"24"}),r("span",Gs,k(s.$t("analytics")),1)]),_:1},8,["class"])),[[i,"analysis:query"]]),se((d(),O(p,{onClick:a[6]||(a[6]=l=>o(de).push({name:"user"})),index:"setting",class:x(o(e).meta.name==="user"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"si:user-alt-2-line",width:"20",height:"20"}),r("span",Zs,k(s.$t("allUsers")),1)]),_:1},8,["class"])),[[i,"user:query"]]),se((d(),O(p,{onClick:a[7]||(a[7]=l=>o(de).push({name:"all-email"})),index:"all-email",class:x(o(e).meta.name==="all-email"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"fluent:mail-list-28-regular",width:"22",height:"22"}),r("span",Js,k(s.$t("allMail")),1)]),_:1},8,["class"])),[[i,"all-email:query"]]),se((d(),O(p,{onClick:a[8]||(a[8]=l=>o(de).push({name:"role"})),index:"setting",class:x(o(e).meta.name==="role"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"fluent:lock-closed-16-regular",width:"22",height:"22"}),r("span",Xs,k(s.$t("permissions")),1)]),_:1},8,["class"])),[[i,"role:query"]]),se((d(),O(p,{onClick:a[9]||(a[9]=l=>o(de).push({name:"reg-key"})),index:"reg-key",class:x(o(e).meta.name==="reg-key"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"fluent:fingerprint-20-filled",width:"22",height:"22"}),r("span",Qs,k(s.$t("inviteCode")),1)]),_:1},8,["class"])),[[i,"reg-key:query"]]),se((d(),O(p,{onClick:a[10]||(a[10]=l=>o(de).push({name:"sys-setting"})),index:"sys-setting",class:x(o(e).meta.name==="sys-setting"?"choose-item":"")},{default:g(()=>[u(o(D),{icon:"eos-icons:system-ok-outlined",width:"18",height:"18",style:{"margin-left":"2px"}}),r("span",eo,k(s.$t("SystemSettings")),1)]),_:1},8,["class"])),[[i,"setting:query"]])]),_:1})])]),_:1})}}},no=he(to,[["__scopeId","data-v-156a69d0"]]),so={__name:"index",props:{isActive:{type:Boolean,default:!1}},setup(n,{emit:t}){const e=t,s=()=>{e("toggleClick")};return(a,p)=>(d(),T("div",{style:{padding:"0 15px",cursor:"pointer"},onClick:s},[(d(),T("svg",{class:x([{"is-active":n.isActive},"hamburger"]),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"currentColor"},p[0]||(p[0]=[r("path",{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"},null,-1)]),2))]))}},oo=he(so,[["__scopeId","data-v-b2fb0d8c"]]),ao={class:"header-btn"},lo={class:"breadcrumb-item"},io={class:"writer"},ro={class:"toolbar"},co={class:"translate icon-item"},uo={class:"avatar"},mo={class:"avatar-text"},po={class:"user-details"},fo={class:"details-avatar"},vo={class:"user-name"},ho={class:"detail-user-type"},go={class:"action-info"},yo={style:{"margin-right":"10px"}},_o={style:{"margin-right":"10px"}},bo={key:0,style:{"margin-right":"5px"}},wo={key:1,style:{"margin-right":"5px"}},ko={class:"logout"},Co={__name:"index",setup(n){const{t}=Fe(),e=lt(),s=Me(),a=rt(),p=We(),f=z(!1),_=A(()=>a.user.role.accountCount),i=A(()=>{if(s.settings.send===1)return t("disabled");if(!ae("email:send"))return t("unauthorized");if(a.user.role.sendType==="ban")return t("sendBanned");if(!a.user.role.sendCount)return t("unlimited");if(a.user.role.sendType==="day")return t("daily");if(a.user.role.sendType==="count")return t("total")}),l=A(()=>!ae("email:send")||a.user.role.sendType==="ban"||!a.user.role.sendCount||s.settings.send===1?null:a.user.sendCount+"/"+a.user.role.sendCount);async function y(b){try{await Tt(b),ee({message:t("copySuccessMsg"),type:"success",plain:!0})}catch(S){console.error(`${t("copyFailMsg")}:`,S),ee({message:t("copyFailMsg"),type:"error",plain:!0})}}function E(b){In(b==="en"?"en":"zh-cn"),s.lang=b}function I(){p.showNotice()}function L(b){const S=!p.dark,F=document.documentElement;if(!document.startViewTransition){N(S,F);return}const P=b.clientX,V=b.clientY,R=Math.max(P,window.innerWidth-P),Z=Math.max(V,window.innerHeight-V),X=Math.hypot(R,Z);F.setAttribute("data-theme-to",S?"dark":"light"),F.style.setProperty("--vt-x",`${P}px`),F.style.setProperty("--vt-y",`${V}px`),F.style.setProperty("--vt-end-radius",`${X+10}px`),document.startViewTransition(()=>{N(S,F)}).finished.finally(()=>{F.removeAttribute("data-theme-to")})}function N(b,S){S.setAttribute("class",b?"dark":""),p.dark=b}function c(){p.writerRef.open()}function K(){p.asideShow=!p.asideShow}function te(){f.value=!0,En().then(()=>{localStorage.removeItem("token"),de.replace("/login")}).finally(()=>{f.value=!1})}function C(b){return b[0]?.toUpperCase()||""}return(b,S)=>{const F=Mt,P=St,V=xt,R=gn,Z=ct,X=it("perm");return d(),T("div",{class:x(["header",o(ae)("email:send")?"":"not-send"])},[r("div",ao,[u(oo,{onClick:K}),r("span",lo,k(b.$t(o(e).meta.title)),1)]),se((d(),T("div",{class:"writer-box",onClick:c},[r("div",io,[u(o(D),{icon:"material-symbols:edit-outline-sharp",width:"22",height:"22"})])])),[[X,"email:send"]]),r("div",ro,[u(V,null,{dropdown:g(()=>[u(P,null,{default:g(()=>[u(F,{onClick:S[0]||(S[0]=G=>E("zh"))},{default:g(()=>S[6]||(S[6]=[Q("简体中文")])),_:1}),u(F,{onClick:S[1]||(S[1]=G=>E("zhTW"))},{default:g(()=>S[7]||(S[7]=[Q("繁體中文")])),_:1}),u(F,{onClick:S[2]||(S[2]=G=>E("en"))},{default:g(()=>S[8]||(S[8]=[Q("English")])),_:1})]),_:1})]),default:g(()=>[r("div",co,[u(o(D),{icon:"carbon:ibm-watson-language-translator"})])]),_:1}),o(p).dark?(d(),T("div",{key:0,class:"sun-icon icon-item",onClick:S[3]||(S[3]=G=>L(G))},[u(o(D),{icon:"mingcute:sun-fill"})])):(d(),T("div",{key:1,class:"dark-icon icon-item",onClick:S[4]||(S[4]=G=>L(G))},[u(o(D),{icon:"solar:moon-linear"})])),r("div",{class:"notice icon-item",onClick:I},[u(o(D),{icon:"streamline-plump:announcement-megaphone"})]),u(V,{teleported:!1,"popper-class":"detail-dropdown"},{dropdown:g(()=>[r("div",po,[r("div",fo,k(C(o(a).user.email)),1),r("div",vo,k(o(a).user.name),1),r("div",{class:"detail-email",onClick:S[5]||(S[5]=G=>y(o(a).user.email))},k(o(a).user.email),1),r("div",ho,[u(R,null,{default:g(()=>[Q(k(b.$t(o(a).user.role.name)),1)]),_:1})]),r("div",go,[r("div",null,[r("span",yo,k(b.$t("sendCount")),1),r("span",_o,k(b.$t("accountCount")),1)]),r("div",null,[r("div",null,[l.value?(d(),T("span",bo,k(l.value),1)):ce("",!0),o(ae)("email:send")?(d(),O(R,{key:2},{default:g(()=>[Q(k(i.value),1)]),_:1})):(d(),O(R,{key:1},{default:g(()=>[Q(k(i.value),1)]),_:1}))]),r("div",null,[o(s).settings.manyEmail||o(s).settings.addEmail?(d(),O(R,{key:0},{default:g(()=>[Q(k(b.$t("disabled")),1)]),_:1})):_.value&&o(ae)("account:add")?(d(),T("span",wo,k(b.$t("totalUserAccount",{msg:_.value})),1)):!_.value&&o(ae)("account:add")?(d(),O(R,{key:2},{default:g(()=>[Q(k(b.$t("unlimited")),1)]),_:1})):o(ae)("account:add")?ce("",!0):(d(),O(R,{key:3},{default:g(()=>[Q(k(b.$t("unauthorized")),1)]),_:1}))])])]),r("div",ko,[u(Z,{type:"primary",loading:f.value,onClick:te},{default:g(()=>[Q(k(b.$t("logOut")),1)]),_:1},8,["loading"])])])]),default:g(()=>[r("div",uo,[r("div",mo,[r("div",null,k(C(o(a).user.email)),1)]),u(o(D),{class:"setting-icon",icon:"mingcute:down-small-fill",width:"24",height:"24"})])]),_:1})])],2)}}},$o=he(Co,[["__scopeId","data-v-8842ad2b"]]),Eo={class:"account-box"},Io={class:"head-opt"},So={"infinite-scroll-distance":600,"infinite-scroll-immediate":!1},Mo={class:"account"},xo={class:"opt"},To={style:{display:"flex","justify-content":"space-between"}},No={style:{display:"flex","justify-content":"space-between"}},zo={key:2,class:"noLoading"},Ao={key:3,class:"empty"},Oo={class:"container"},Lo=["data-sitekey"],Po={key:0,style:{"font-size":"12px",color:"#F56C6C"}},Bo={class:"container"},jo={__name:"index",setup(n){const{t}=Fe(),e=rt(),s=Ct(),a=Me(),p=z(!1),f=z(!1),_=a.domainList,i=ke([]),l=z(!1),y=z(!1),E=z(!1),I=z(!1),L=z(!1),N=z(!1),c=z(null),K=z({}),te=z({});let C=null,b=null;const S=z(!1);let F="",P=0;const V=ke({email:"",suffix:a.domainList[0]});let R=10;const Z={accountId:0,size:20},X=z();ae("account:query")&&q(),pe(()=>s.changeUserAccountName,()=>{i[0].name=s.changeUserAccountName});const G=()=>{X.value.toggleMenu()};window.onTurnstileError=w=>{P>=4||(P++,console.warn("人机验加载失败",w),setTimeout(()=>{Ee(()=>{b?window.turnstile.reset(b):b=window.turnstile.render(".add-email-turnstile")})},1500))},window.onTurnstileSuccess=w=>{F=w};function ue(){if(i.length>20)return R=20;if(i.length===0)return R=1;R=i.length}function re(){let w=c.value;if(w===C.name){L.value=!1;return}if(!w){ee({message:t("emptyUserNameMsg"),type:"error",plain:!0});return}N.value=!0,Bn(C.accountId,w).then(()=>{C.name=w,L.value=!1,C.accountId===e.user.accountId&&(e.user.name=w),ee({message:t("saveSuccessMsg"),type:"success",plain:!0})}).finally(()=>{N.value=!1})}function v(w){c.value=w.name,C=w,L.value=!0}function m(w){return!ae("email:send")&&!(w.accountId!==e.user.accountId&&ae("account:delete"))}function h(w){return s.currentAccountId===w?"item-choose":""}function M(w){Qe.confirm(t("delConfirm",{msg:w.email}),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{Ln(w.accountId).then(()=>{const j=i.findIndex(_e=>_e.accountId===w.accountId);i.splice(j,1),i.length<Z.size&&q(),ee({message:t("delSuccessMsg"),type:"success",plain:!0})})})}function W(){y.value||(y.value=!1,E.value=!1,l.value=!1,Z.accountId=0,ue(),te.value.setScrollTop(0),i.splice(0,i.length),q())}function B(w){s.currentAccountId=w.accountId,s.currentAccount=w}function ne(){p.value=!0,setTimeout(()=>{K.value.focus()},100)}async function $(w){try{await Tt(w),ee({message:t("copySuccessMsg"),type:"success",plain:!0})}catch(j){console.error(`${t("copyFailMsg")}:`,j),ee({message:t("copyFailMsg"),type:"error",plain:!0})}}function q(){if(y.value||E.value||l.value)return;i.length===0?y.value=!0:E.value=!0;let w=Date.now();On(Z.accountId,Z.size).then(async j=>{let Ne=Date.now()-w;Ne<500&&await Mn(500-Ne),j.length<Z.size&&(l.value=!0),i.length===0&&(s.currentAccount=j[0].accountId),Z.accountId=j.at(-1).accountId,i.push(...j),y.value=!1,E.value=!1}).catch(()=>{y.value=!1,E.value=!1})}function H(){if(!V.email){ee({message:t("emptyEmailMsg"),type:"error",plain:!0});return}if(!Nt(V.email+V.suffix)){ee({message:t("notEmailMsg"),type:"error",plain:!0});return}if(!F&&(a.settings.addEmailVerify===0||a.settings.addEmailVerify===2&&a.settings.addVerifyOpen)){I.value?S.value||ee({message:t("botVerifyMsg"),type:"error",plain:!0}):(I.value=!0,Ee(()=>{if(b)window.turnstile.reset(".add-email-turnstile");else try{b=window.turnstile.render(".add-email-turnstile")}catch{S.value=!0,console.log("人机验证js加载失败")}}));return}f.value=!0,Pn(V.email+V.suffix,F).then(w=>{f.value=!1,p.value=!1,V.email="",i.push(w),F="",a.settings.addVerifyOpen=w.addVerifyOpen,ee({message:t("addSuccessMsg"),type:"success",plain:!0}),I.value=!1,e.refreshUserInfo()}).catch(w=>{w.code===400&&(F="",b?window.turnstile.reset(b):Ee(()=>{b=window.turnstile.render(".add-email-turnstile")}),I.value=!0),f.value=!1})}return(w,j)=>{const _e=Mt,Ne=St,Rt=xt,Ue=Xn,$e=Tn,mt=xn,Ft=An,Wt=$t,Ut=$n,qt=Cn,pt=It,ft=ct,vt=zn,Ht=it("perm"),Yt=Nn;return d(),T("div",Eo,[r("div",Io,[se(u(o(D),{class:"icon add",icon:"ion:add-outline",width:"23",height:"23",onClick:ne},null,512),[[Ht,"account:add"]]),u(o(D),{class:"icon refresh",icon:"ion:reload",width:"18",height:"18",onClick:W})]),u(Wt,{class:"scrollbar",ref_key:"scrollbarRef",ref:te},{default:g(()=>[se((d(),T("div",So,[(d(!0),T(ve,null,Oe(i,U=>(d(),O(Ue,{class:x(["item",h(U.accountId)]),key:U.accountId,onClick:qe=>B(U)},{default:g(()=>[r("div",Mo,k(U.email),1),r("div",xo,[r("div",{class:"send-email",onClick:j[0]||(j[0]=we(()=>{},["stop"]))},[u(o(D),{icon:"eva:email-fill",width:"22",height:"22",color:"#fccb1a"})]),r("div",{class:"settings",onClick:j[1]||(j[1]=we(()=>{},["stop"]))},[u(o(D),{icon:"fluent-color:clipboard-24",width:"22",height:"22",onClick:we(qe=>$(U.email),["stop"])},null,8,["onClick"]),m(U)?(d(),O(o(D),{key:0,icon:"fluent:settings-24-filled",width:"21",height:"21",color:"#909399"})):(d(),O(Rt,{key:1},{dropdown:g(()=>[u(Ne,null,{default:g(()=>[o(ae)("email:send")?(d(),O(_e,{key:0,onClick:qe=>v(U)},{default:g(()=>[Q(k(w.$t("rename")),1)]),_:2},1032,["onClick"])):ce("",!0),U.accountId!==o(e).user.accountId&&o(ae)("account:delete")?(d(),O(_e,{key:1,onClick:qe=>M(U)},{default:g(()=>[Q(k(w.$t("delete")),1)]),_:2},1032,["onClick"])):ce("",!0)]),_:2},1024)]),default:g(()=>[u(o(D),{icon:"fluent:settings-24-filled",width:"21",height:"21",color:"#909399"})]),_:2},1024))])])]),_:2},1032,["class","onClick"]))),128)),y.value?(d(!0),T(ve,{key:0},Oe(o(R),U=>(d(),O(mt,{key:U,animated:""},{template:g(()=>[u(Ue,{class:"item"},{default:g(()=>[u($e,{variant:"p",style:{width:"70%",height:"20px","margin-bottom":"25px"}}),r("div",To,[u($e,{variant:"text",style:{width:"20px"}}),u($e,{variant:"text",style:{width:"20px"}})])]),_:1})]),_:2},1024))),128)):ce("",!0),i.length>0&&!l.value?(d(),O(mt,{key:1,animated:""},{template:g(()=>[u(Ue,{class:"item"},{default:g(()=>[u($e,{variant:"p",style:{width:"70%",height:"20px","margin-bottom":"20px"}}),r("div",No,[u($e,{variant:"text",style:{width:"20px"}}),u($e,{variant:"text",style:{width:"20px"}})])]),_:1})]),_:1})):ce("",!0),l.value&&i.length>0?(d(),T("div",zo,[r("div",null,k(w.$t("noMoreData")),1)])):ce("",!0),l.value&&i.length===0?(d(),T("div",Ao,[u(Ft,{description:w.$t("noMessagesFound")},null,8,["description"])])):ce("",!0)])),[[Yt,q]])]),_:1},512),u(vt,{modelValue:p.value,"onUpdate:modelValue":j[4]||(j[4]=U=>p.value=U),title:w.$t("addAccount")},{default:g(()=>[r("div",Oo,[u(pt,{modelValue:V.email,"onUpdate:modelValue":j[3]||(j[3]=U=>V.email=U),ref_key:"addRef",ref:K,type:"text",placeholder:w.$t("emailAccount"),autocomplete:"off"},{append:g(()=>[r("div",{onClick:we(G,["stop"])},[u(qt,{ref_key:"mySelect",ref:X,modelValue:V.suffix,"onUpdate:modelValue":j[2]||(j[2]=U=>V.suffix=U),placeholder:w.$t("select"),class:"select"},{default:g(()=>[(d(!0),T(ve,null,Oe(o(_),U=>(d(),O(Ut,{key:U,label:U,value:U},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"]),r("div",null,[r("span",null,k(V.suffix),1),u(o(D),{class:"setting-icon",icon:"mingcute:down-small-fill",width:"20",height:"20"})])])]),_:1},8,["modelValue","placeholder"]),u(ft,{class:"btn",type:"primary",onClick:H,loading:f.value},{default:g(()=>[Q(k(w.$t("add")),1)]),_:1},8,["loading"])]),r("div",{class:x(["add-email-turnstile",I.value?"turnstile-show":"turnstile-hide"]),"data-sitekey":o(a).settings.siteKey,"data-callback":"onTurnstileSuccess","data-error-callback":"onTurnstileError"},[S.value?(d(),T("span",Po,k(w.$t("verifyModuleFailed")),1)):ce("",!0)],10,Lo)]),_:1},8,["modelValue","title"]),u(vt,{modelValue:L.value,"onUpdate:modelValue":j[6]||(j[6]=U=>L.value=U),title:w.$t("changeUserName")},{default:g(()=>[r("div",Bo,[u(pt,{modelValue:c.value,"onUpdate:modelValue":j[5]||(j[5]=U=>c.value=U),type:"text",placeholder:w.$t("username"),autocomplete:"off"},null,8,["modelValue","placeholder"]),u(ft,{class:"btn",type:"primary",onClick:re,loading:N.value},{default:g(()=>[Q(k(w.$t("save")),1)]),_:1},8,["loading"])])]),_:1},8,["modelValue","title"])])}}},Do=he(jo,[["__scopeId","data-v-8a0cf873"]]),Vo={__name:"index",setup(n){const t=Me(),e=We(),s=lt();let a=window.innerWidth,p=null;const f=A(()=>e.accountShow&&t.settings.manyEmail===0);pe(()=>e.changeNotice,()=>{const l=t.settings;let y={notice:l.notice,noticeWidth:l.noticeWidth,noticeTitle:l.noticeTitle,noticeContent:l.noticeContent,noticeType:l.noticeType,noticeDuration:l.noticeDuration,noticePosition:l.noticePosition,noticeOffset:l.noticeOffset};_(y)}),pe(()=>e.changePreview,()=>{_(e.previewData)});function _(l){if(l.notice===1)return;p&&p.close();const y=document.createElement("style");y.innerHTML=`
.custom-notice.el-notification {
--el-notification-width: min(${l.noticeWidth}px,calc(100% - 30px)) !important;
}
`,document.head.appendChild(y),p=nt({title:l.noticeTitle,message:`<div style="width: 100%;height: 100%;">${l.noticeContent}</div>`,type:l.noticeType==="none"?"":l.noticeType,duration:l.noticeDuration,position:l.noticePosition,offset:l.noticeOffset,dangerouslyUseHTMLString:!0,customClass:"custom-notice"})}ye(()=>{window.addEventListener("resize",i),i()}),Te(()=>{window.removeEventListener("resize",i)});const i=()=>{["content","email","send"].includes(s.meta.name)&&a!==window.innerWidth&&(a=window.innerWidth,e.accountShow=window.innerWidth>=767)};return(l,y)=>{const E=pn("router-view");return d(),T("div",{class:x(f.value&&o(ae)("account:query")?"main-box-show":"main-box-hide")},[r("div",{class:x(f.value&&o(ae)("account:query")?"block-show":"block-hide"),onClick:y[0]||(y[0]=I=>o(e).accountShow=!1)},null,2),u(Do,{class:x(f.value&&o(ae)("account:query")?"show":"hide")},null,8,["class"]),u(E,{class:"main-view"},{default:g(({Component:I,route:L})=>[(d(),O(fn,{include:["email","all-email","send","sys-setting","star","user","role","analysis","reg-key","draft"]},[(d(),O(Je(I),{key:L.name}))],1024))]),_:1})],2)}}},Ro=he(Vo,[["__scopeId","data-v-f2eb3e85"]]),Fo=["id"],Wo={__name:"index",props:{defValue:{type:String,default:""},editorId:{type:String,default:()=>`editor-${Date.now()}`}},emits:["change"],setup(n,{expose:t,emit:e}){t({clearEditor:L,focus:K,getContent:te});const s=n,{locale:a}=Fe(),p=e,f=vn(null),_=z(!1),i=z(null),l=z(!1),y=We(),E=Me();ye(()=>{N()}),Te(()=>{C()}),pe(()=>s.defValue,b=>{f.value&&f.value.getContent()!==b&&f.value.setContent(b)}),pe(()=>[y.dark,E.lang],()=>{C(),c()});const I=A(()=>a.value==="zh"?"zh_CN":a.value==="zhTW"?"zh_TW":"en");function L(){f.value&&f.value.setContent("")}function N(){if(window.tinymce)c();else{l.value=!0;const b=document.createElement("script");b.src="/tinymce/tinymce.min.js",b.onload=()=>c(),document.head.appendChild(b),l.value=!1}}function c(){window.tinymce.init({selector:`#${s.editorId}`,statusbar:!1,height:"100%",auto_focus:!0,forced_root_block:"div",skin:`${y.dark?"oxide-dark":"oxide"}`,content_css:`/tinymce/css/index.css,${y.dark?"dark":"default"}`,content_style:`:root {
--scrollbar-track-color: ${y.dark?"#141414":"#FFFFFF"};
--scrollbar-thumb-color: ${y.dark?"#8D9095":"#A8ABB2"};
}`,plugins:"link image advlist lists emoticons fullscreen table preview code",toolbar:"bold emoticons forecolor backcolor italic fontsize | alignleft aligncenter alignright alignjustify | outdent indent | bullist numlist | link image | table code preview fullscreen",toolbar_mode:"scrolling",mobile:{toolbar:"fullscreen bold emoticons forecolor backcolor italic fontsize | alignleft aligncenter alignright alignjustify | outdent indent | bullist numlist | link image | table code preview "},font_size_formats:"8px 10px 12px 14px 16px 18px 24px 36px",emoticons_search:!1,language:I.value,language_load:!0,menubar:!1,license_key:"gpl",noneditable_class:"mceNonEditable",setup:b=>{f.value=b,b.on("init",()=>{b.setContent(s.defValue),_.value=!0}),b.on("input change",()=>{const S=b.getContent(),F=b.getContent({format:"text"});p("change",S,F)})},autofocus:!0,branding:!1,file_picker_types:"image",image_dimensions:!1,image_description:!1,link_title:!1,dialog_type:"none",file_picker_callback:(b,S,F)=>{const P=document.createElement("input");P.setAttribute("type","file"),P.setAttribute("accept","image/*"),P.addEventListener("change",async V=>{let R=V.target.files[0];R=await Vn(R);const Z=new FileReader;Z.onload=()=>{const X="blobid"+new Date().getTime(),G=tinymce.activeEditor.editorUpload.blobCache,ue=Z.result.split(",")[1],re=G.create(X,R,ue);G.add(re),b(re.blobUri(),{title:R.name})},Z.readAsDataURL(R)}),P.click()}})}function K(){Ee(()=>{f.value.focus()})}function te(){return f.value.getContent()}function C(){f.value&&(f.value.destroy(),f.value=null)}return(b,S)=>(d(),T("div",{class:x(["editor-box",l.value?"editor-box-loading":""])},[l.value?(d(),O(Dn,{key:0,class:"loading"})):(d(),T("textarea",{key:1,style:{outline:"none"},id:n.editorId,ref_key:"editorRef",ref:i},null,8,Fo))],2))}},Uo=he(Wo,[["__scopeId","data-v-33324f14"]]),qo={class:"percent"},Ho={style:{"margin-left":"5px"}},Yo={__name:"index",props:{value:[Number,String],desc:[String]},setup(n){return(t,e)=>(d(),T("div",qo,[u(o(D),{icon:"line-md:loading-loop",width:"18",height:"18"}),r("div",null,[r("span",null,k(n.value)+"%",1),r("span",Ho,k(n.desc),1)])]))}},Ko=he(Yo,[["__scopeId","data-v-63e3a566"]]),Go={class:"send"},Zo={class:"title"},Jo={class:"title-left"},Xo={class:"title-text"},Qo={class:"sender"},ea={class:"sender-name"},ta={class:"send-email"},na={class:"container"},sa={class:"item-title"},oa={class:"item-title"},aa={class:"button-item"},la={class:"att-list"},ia={class:"att-filename"},ra={class:"att-size"},ca={__name:"index",setup(n,{expose:t}){t({open:X,openReply:R,openDraft:G});const{t:e}=Fe(),s=Hn(),a=Me(),p=Un(),f=Ct(),_=z({}),i=rt(),l=z(!1),y=z(0);let E=null,I=!1;const L=z(""),N=ke({receiveEmail:[],subject:"",content:"",sendType:""}),c=ke({sendEmail:"",receiveEmail:[],accountId:-1,manyType:null,name:"",subject:"",content:"",sendType:"",text:"",emailId:0,attachments:[],draftId:null});function K(v){const m=Array.from(new Set(v.split(/[,]/).map(h=>h.trim()).filter(h=>h)));c.receiveEmail.splice(c.receiveEmail.length-1,1),m.forEach(h=>{Nt(h)&&!c.receiveEmail.includes(h)&&c.receiveEmail.push(h)})}function te(){c.manyType=c.manyType?null:"divide"}function C(){Qe.confirm(e("clearContentConfirm"),{confirmButtonText:e("confirm"),cancelButtonText:e("cancel"),type:"warning"}).then(()=>{P()})}function b(v){c.attachments.splice(v,1)}function S(){const v=document.createElement("input");v.setAttribute("type","file"),v.click(),v.onchange=async m=>{const h=m.target.files[0],M=h.size,W=h.name,B=h.type;if(c.attachments.reduce((q,H)=>q+H.size,0)+M>29360128){ee({message:e("attLimitMsg"),type:"error",plain:!0});return}const $=await Rn(h);c.attachments.push({content:$,filename:W,size:M,contentType:B})}}async function F(){if(c.receiveEmail.length===0){ee({message:e("emptyRecipientMsg"),type:"error",plain:!0});return}if(!c.subject){ee({message:e("emptySubjectMsg"),type:"error",plain:!0});return}if(!c.content){ee({message:e("emptyContentMsg"),type:"error",plain:!0});return}if(c.manyType==="divide"&&c.attachments.length>0){ee({message:e("noSeparateSendMsg"),type:"error",plain:!0});return}if(I){ee({message:e("sendingErrorMsg"),type:"error",plain:!0});return}E=ee({message:()=>J(Ko,{value:y.value,desc:e("sending")}),dangerouslyUseHTMLString:!0,plain:!0,duration:0,customClass:"message-bottom"}),I=!0,l.value=!1,Wn(c,v=>{y.value=Math.round(v.loaded*98/v.total)}).then(v=>{const m=v[0];v.forEach(h=>{p.sendScroll?.addItem(h)}),nt({title:e("sendSuccessMsg"),type:"success",message:J("span",{style:"color: teal"},m.subject),position:"bottom-right"}),i.refreshUserInfo(),c.draftId&&(c.subject="",c.content="",c.receiveEmail=[],s.setDraft={...Ae(c)}),P(),l.value=!1}).catch(v=>{nt({title:e("sendFailMsg"),type:v.code===403?"warning":"error",message:J("span",{style:"color: teal"},v.message),position:"bottom-right"}),l.value=!0}).finally(()=>{E.close(),y.value=0,I=!1})}function P(){c.receiveEmail=[],c.subject="",c.content="",c.manyType=null,c.attachments=[],c.sendType="",c.emailId=0,c.draftId=null,N.content="",N.subject="",N.receiveEmail=[],N.sendType="",_.value.clearEditor()}function V(v,m){c.content=v,c.text=m}function R(v){P(),v.subject=v.subject||"",c.receiveEmail.push(v.sendEmail),c.subject=v.subject.startsWith("Re:")||v.subject.startsWith("回复:")?v.subject:"Re: "+v.subject,c.sendType="reply",c.emailId=v.emailId,L.value="",setTimeout(()=>{L.value=`
<div></div>
<div>
<br>
${Sn(v.createTime)} ${v.name} &lt${v.sendEmail}&gt ${e("wrote")}:
</div>
<blockquote class="mceNonEditable" style="margin: 0 0 0 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;">
<articl>
${Z(v.content)||`<pre style="font-family: inherit;word-break: break-word;white-space: pre-wrap;margin: 0">${v.text}</pre>`}
</article>
</blockquote>`,X(),Ee(()=>{N.content=_.value.getContent(),N.subject=c.subject,N.receiveEmail=c.receiveEmail,N.sendType=c.sendType})})}function Z(v){v=v||"";const m=a.settings.r2Domain;return v.replace(/{{domain}}/g,m+"/")}function X(){f.currentAccount.email?(c.sendEmail=f.currentAccount.email,c.accountId=f.currentAccount.accountId,c.name=f.currentAccount.name):(c.sendEmail=i.user.email,c.accountId=i.user.accountId,c.name=i.user.name),l.value=!0,_.value.focus()}function G(v){Object.assign(c,{...v}),L.value="",setTimeout(()=>L.value=c.content),l.value=!0,_.value.focus()}const ue=v=>{v.key==="Escape"&&re()};ye(()=>{window.addEventListener("keydown",ue)}),hn(()=>{window.removeEventListener("keydown",ue)});function re(){if(c.draftId){s.setDraft={...Ae(c)},l.value=!1,P();return}if(!(c.content||c.subject||c.receiveEmail.length>0)){l.value=!1,P();return}if(N.sendType==="reply"){let v=c.subject===N.subject,m=_.value.getContent()===N.content,h=c.receiveEmail.length===1&&c.receiveEmail[0]===N.receiveEmail[0];if(v&&m&&h){P(),re();return}}Qe.confirm(e("saveDraftConfirm"),{confirmButtonText:e("confirm"),cancelButtonText:e("cancel"),type:"warning",distinguishCancelAndClose:!0}).then(async()=>{const v={...Ae(c)};delete v.draftId,delete v.attachments,v.createTime=Yn().utc().format("YYYY-MM-DD HH:mm:ss");const m=await bt.value.draft.add({...v});bt.value.att.add({draftId:m,attachments:Ae(c.attachments)}),s.refreshList++,l.value=!1,P()}).catch(v=>{v==="cancel"&&(l.value=!1,P())})}return(v,m)=>{const h=jn,M=It,W=ct;return se((d(),T("div",Go,[r("div",{class:"write-box",onClick:m[2]||(m[2]=we(()=>{},["stop"]))},[r("div",Zo,[r("div",Jo,[r("span",Xo,[u(o(D),{icon:"hugeicons:quill-write-01",width:"28",height:"28"})]),r("span",Qo,k(v.$t("sender"))+":",1),r("span",ea,k(c.name),1),r("span",ta,"<"+k(c.sendEmail)+">",1)]),r("div",{onClick:re,style:{cursor:"pointer"}},[u(o(D),{icon:"material-symbols-light:close-rounded",width:"22",height:"22"})])]),r("div",na,[u(h,{onAddTag:K,"tag-type":"primary",size:"default",modelValue:c.receiveEmail,"onUpdate:modelValue":m[0]||(m[0]=B=>c.receiveEmail=B),placeholder:v.$t("ruleEmailsInputDesc")},{prefix:g(()=>[r("div",sa,k(v.$t("recipient")),1)]),suffix:g(()=>[r("span",{class:x(["distribute",c.manyType?"checked":""]),onClick:we(te,["stop"])},k(v.$t("sendSeparately")),3)]),_:1},8,["modelValue","placeholder"]),u(M,{modelValue:c.subject,"onUpdate:modelValue":m[1]||(m[1]=B=>c.subject=B),placeholder:v.$t("subjectInputDesc")},{prefix:g(()=>[r("div",oa,k(v.$t("subject")),1)]),_:1},8,["modelValue","placeholder"]),u(Uo,{"def-value":L.value,ref_key:"editor",ref:_,onChange:V},null,8,["def-value"]),r("div",aa,[r("div",{class:"att-add",onClick:S},[u(o(D),{icon:"iconamoon:attachment-fill",width:"24",height:"24"})]),r("div",{class:"att-clear",onClick:C},[u(o(D),{icon:"icon-park-outline:clear-format",width:"24",height:"24 "})]),r("div",la,[(d(!0),T(ve,null,Oe(c.attachments,(B,ne)=>(d(),T("div",{class:"att-item",key:ne},[u(o(D),{icon:o(qn)(B.filename),width:"20",height:"20"},null,8,["icon"]),r("span",ia,k(B.filename),1),r("span",ra,k(o(Fn)(B.size)),1),u(o(D),{style:{cursor:"pointer"},icon:"material-symbols-light:close-rounded",onClick:$=>b(ne),width:"22",height:"22"},null,8,["onClick"])]))),128))]),r("div",null,[c.sendType==="reply"?(d(),O(W,{key:0,type:"primary",onClick:F},{default:g(()=>[Q(k(v.$t("reply")),1)]),_:1})):(d(),O(W,{key:1,type:"primary",onClick:F},{default:g(()=>[Q(k(v.$t("send")),1)]),_:1}))])])])])],512)),[[je,l.value]])}}},ua=he(ca,[["__scopeId","data-v-c4335238"]]),da={__name:"index",setup(n){const t=We(),e=z({}),s=z(window.innerWidth<1025),a=()=>{s.value=window.innerWidth<1025,t.asideShow=window.innerWidth>1024};return ye(()=>{t.writerRef=e,window.addEventListener("resize",a),a()}),Te(()=>{window.removeEventListener("resize",a)}),(p,f)=>{const _=ds,i=ms,l=ps,y=us;return d(),T(ve,null,[u(y,{class:"layout"},{default:g(()=>[u(_,{class:x(["aside",o(t).asideShow?"aside-show":"el-aside-hide"])},{default:g(()=>[u(no)]),_:1},8,["class"]),r("div",{class:x(o(t).asideShow&&s.value?"overlay-show":"overlay-hide"),onClick:f[0]||(f[0]=E=>o(t).asideShow=!1)},null,2),u(y,{class:"main-container"},{default:g(()=>[u(l,null,{default:g(()=>[u(i,null,{default:g(()=>[u($o)]),_:1}),u(Ro)]),_:1})]),_:1})]),_:1}),u(ua,{ref_key:"writerRef",ref:e},null,512)],64)}}},Xa=he(da,[["__scopeId","data-v-3d52550c"]]);export{Xa as default};