import{bA as q,q as T,ca as D,cb as G,p as I,bn as $,d as V,bU as J,bq as X,v as S,F as Y,r as b,aB as N,a as z,J as A,dO as Q,bf as Z,L as ee,dP as te,i as H,by as oe,aW as ne,at as se,c6 as re,dQ as ae,an as le,S as ie,W as ce,a1 as de,u as ue,b as fe,o as ve,f as R,w as C,e as a,h as O,t as k,aq as U,z as me,B as ge,g as he,k as be}from"./index-DGnN4tUo.js";import{o as _e,i as pe}from"./utils-7uY2dC5n.js";const xe=q("n-avatar-group"),ze=T("avatar",`
 width: var(--n-merged-size);
 height: var(--n-merged-size);
 color: #FFF;
 font-size: var(--n-font-size);
 display: inline-flex;
 position: relative;
 overflow: hidden;
 text-align: center;
 border: var(--n-border);
 border-radius: var(--n-border-radius);
 --n-merged-color: var(--n-color);
 background-color: var(--n-merged-color);
 transition:
 border-color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
`,[D(I("&","--n-merged-color: var(--n-color-modal);")),G(I("&","--n-merged-color: var(--n-color-popover);")),I("img",`
 width: 100%;
 height: 100%;
 `),$("text",`
 white-space: nowrap;
 display: inline-block;
 position: absolute;
 left: 50%;
 top: 50%;
 `),T("icon",`
 vertical-align: bottom;
 font-size: calc(var(--n-merged-size) - 6px);
 `),$("text","line-height: 1.25")]),ye=Object.assign(Object.assign({},A.props),{size:[String,Number],src:String,circle:{type:Boolean,default:void 0},objectFit:String,round:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},onError:Function,fallbackSrc:String,intersectionObserverOptions:Object,lazy:Boolean,onLoad:Function,renderPlaceholder:Function,renderFallback:Function,imgProps:Object,color:String}),Re=V({name:"Avatar",props:ye,slots:Object,setup(t){const{mergedClsPrefixRef:u,inlineThemeDisabled:_}=Y(t),i=b(!1);let f=null;const v=b(null),c=b(null),E=()=>{const{value:e}=v;if(e&&(f===null||f!==e.innerHTML)){f=e.innerHTML;const{value:o}=c;if(o){const{offsetWidth:r,offsetHeight:h}=o,{offsetWidth:l,offsetHeight:P}=e,L=.9,B=Math.min(r/l*L,h/P*L,1);e.style.transform=`translateX(-50%) translateY(-50%) scale(${B})`}}},p=N(xe,null),n=z(()=>{const{size:e}=t;if(e)return e;const{size:o}=p||{};return o||"medium"}),s=A("Avatar","-avatar",ze,ae,t,u),x=N(Q,null),d=z(()=>{if(p)return!0;const{round:e,circle:o}=t;return e!==void 0||o!==void 0?e||o:x?x.roundRef.value:!1}),m=z(()=>p?!0:t.bordered||!1),j=z(()=>{const e=n.value,o=d.value,r=m.value,{color:h}=t,{self:{borderRadius:l,fontSize:P,color:L,border:B,colorModal:W,colorPopover:M},common:{cubicBezierEaseInOut:K}}=s.value;let F;return typeof e=="number"?F=`${e}px`:F=s.value.self[Z("height",e)],{"--n-font-size":P,"--n-border":r?B:"none","--n-border-radius":o?"50%":l,"--n-color":h||L,"--n-color-modal":h||W,"--n-color-popover":h||M,"--n-bezier":K,"--n-merged-size":`var(--n-avatar-size-override, ${F})`}}),g=_?ee("avatar",z(()=>{const e=n.value,o=d.value,r=m.value,{color:h}=t;let l="";return e&&(typeof e=="number"?l+=`a${e}`:l+=e[0]),o&&(l+="b"),r&&(l+="c"),h&&(l+=te(h)),l}),j,t):void 0,y=b(!t.lazy);H(()=>{if(t.lazy&&t.intersectionObserverOptions){let e;const o=oe(()=>{e==null||e(),e=void 0,t.lazy&&(e=_e(c.value,t.intersectionObserverOptions,y))});ne(()=>{o(),e==null||e()})}}),se(()=>{var e;return t.src||((e=t.imgProps)===null||e===void 0?void 0:e.src)},()=>{i.value=!1});const w=b(!t.lazy);return{textRef:v,selfRef:c,mergedRoundRef:d,mergedClsPrefix:u,fitTextTransform:E,cssVars:_?void 0:j,themeClass:g==null?void 0:g.themeClass,onRender:g==null?void 0:g.onRender,hasLoadError:i,shouldStartLoading:y,loaded:w,mergedOnError:e=>{if(!y.value)return;i.value=!0;const{onError:o,imgProps:{onError:r}={}}=t;o==null||o(e),r==null||r(e)},mergedOnLoad:e=>{const{onLoad:o,imgProps:{onLoad:r}={}}=t;o==null||o(e),r==null||r(e),w.value=!0}}},render(){var t,u;const{$slots:_,src:i,mergedClsPrefix:f,lazy:v,onRender:c,loaded:E,hasLoadError:p,imgProps:n={}}=this;c==null||c();let s;const x=!E&&!p&&(this.renderPlaceholder?this.renderPlaceholder():(u=(t=this.$slots).placeholder)===null||u===void 0?void 0:u.call(t));return this.hasLoadError?s=this.renderFallback?this.renderFallback():J(_.fallback,()=>[S("img",{src:this.fallbackSrc,style:{objectFit:this.objectFit}})]):s=X(_.default,d=>{if(d)return S(re,{onResize:this.fitTextTransform},{default:()=>S("span",{ref:"textRef",class:`${f}-avatar__text`},d)});if(i||n.src){const m=this.src||n.src;return S("img",Object.assign(Object.assign({},n),{loading:pe&&!this.intersectionObserverOptions&&v?"lazy":"eager",src:v&&this.intersectionObserverOptions?this.shouldStartLoading?m:void 0:m,"data-image-src":m,onLoad:this.mergedOnLoad,onError:this.mergedOnError,style:[n.style||"",{objectFit:this.objectFit},x?{height:"0",width:"0",visibility:"hidden",position:"absolute"}:""]}))}}),S("span",{ref:"selfRef",class:[`${f}-avatar`,this.themeClass],style:this.cssVars},s,v&&x)}});function Ee(){return le({url:"/settings/profile"})}const we="/assets/user_center-wnI4e-Jx.png",Se="/assets/card_bg_1-CENuX2YZ.png",Oe={VITE_OTHER_SERVICE_BASE_URL:`{
  "demo": "/"
}`,VITE_SERVICE_BASE_URL:""},je={class:"min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto"},Le={class:"flex flex-col lg:flex-row gap-4 p-4"},Ce={class:"w-full lg:w-70 flex flex-col items-center p-8 shrink-0 relative overflow-hidden rounded-[16px]"},Pe=["src"],Be=["src"],Fe={class:"relative w-full z-20 text-2xl flex-col items-center space-y-sm"},Ie={class:"text-xl"},ke={class:"flex items-center justify-between"},Te={class:"text-text-color4 font-semibold text-[18px]"},$e={class:"flex-1 flex flex-col gap-4"},Ne={class:"flex flex-col md:flex-row md:justify-between md:items-center gap-3 w-full md:w-96"},Ue=V({name:"settings_profile",__name:"index",setup(t){const{baseURL:u}=ie(Oe);b(!1);const _=b(!0);ce();const i=de(),{routerPushByKey:f}=ue(),v=b({user:{email:"",fullname:"",isRejected:!1,isVerified:!1,lang:"",mobile:"",rejectReason:"",verifiedEmail:"",verifiedMobile:""}}),c=async()=>{const{data:n,error:s}=await Ee();s||(v.value=n)};z(()=>[{label:"跟随系统",value:""},{label:"简体中文",value:"zh_CN"},{label:"English",value:"en_US"}]);const E=n=>n.toFixed(2),p=z(()=>{var s;const n=(s=i.userInfo)==null?void 0:s.teaFaviconFileId;return n?`${u}/ui/image/${n}`:null});return H(()=>{c().finally(()=>_.value=!1)}),(n,s)=>{const x=Re,d=U,m=me,j=ge,g=U;return ve(),fe("div",je,[R(d,{bordered:!1,size:"small",class:"sm:flex-1-hidden card-wrapper"},{default:C(()=>[a("div",Le,[a("div",Ce,[a("img",{src:O(we),alt:"User Center",class:"w-full absolute top-0 left-0 dark:invert"},null,8,Pe),a("img",{src:O(Se),alt:"User Center",class:"absolute right-0 top-0 z-10 object-contain dark:invert"},null,8,Be),a("div",Fe,[R(x,{round:"",size:90,src:p.value??"/logo.svg",alt:"logo",class:"bg-transparent"},null,8,["src"]),a("div",Ie,k(O(i).userInfo.userName),1),R(d,{size:"small",title:"余额"},{default:C(()=>{var y,w;return[a("div",ke,[a("div",null,[a("span",Te,"$"+k(E(((w=(y=O(i).userInfo)==null?void 0:y.account)==null?void 0:w.total)??0)),1)]),a("div",{class:"h-6 min-w-12 flex cursor-pointer items-center justify-center rounded from-orange-400 to-amber-300 bg-gradient-to-l px-2 text-sm text-white",onClick:s[0]||(s[0]=()=>O(f)("finance_charge"))},k(n.$t("common.recharge")),1)])]}),_:1})])]),a("div",$e,[R(g,{title:"邮箱绑定"},{default:C(()=>[a("div",Ne,[R(m,{placeholder:"邮箱地址",value:"jason@cdn.cn"}),R(j,null,{default:C(()=>s[1]||(s[1]=[he("已绑定")])),_:1})])]),_:1})])])]),_:1})])}}}),He=be(Ue,[["__scopeId","data-v-ba06a4d8"]]);export{He as default};
