import{k as J,aj as Q,L as $,ar as Z,as as ee,M as P,N as A,d as q,Q as te,q as O,a3 as re,V as oe,T as se,b as x,n as W,m as L,U as D,bH as ne,X as ae,Y as ie,bI as le,l as de,ai as ce,g as ue,w as fe,bk as ve,bJ as he,bK as R,c as V,bm as T,bn as S,bo as p,af as ge,br as be,o as M,bs as me,a as K,bv as G,bw as B,bA as pe}from"./index-Ci_yf8On.js";import{t as ye,a as _e,b as ze,N as Oe}from"./ListItem-BCfs0sdK.js";import"./Close-BZdulABt.js";const xe=J&&"loading"in document.createElement("img");function Le(e={}){var n;const{root:d=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(n=e.threshold)!==null&&n!==void 0?n:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof d=="string"?document.querySelector(d):d)||document.documentElement})}}const C=new WeakMap,H=new WeakMap,N=new WeakMap,we=(e,n,d)=>{if(!e)return()=>{};const a=Le(n),{root:u}=a.options;let s;const i=C.get(u);i?s=i:(s=new Map,C.set(u,s));let f,o;s.has(a.hash)?(o=s.get(a.hash),o[1].has(e)||(f=o[0],o[1].add(e),f.observe(e))):(f=new IntersectionObserver(y=>{y.forEach(v=>{if(v.isIntersecting){const b=H.get(v.target),z=N.get(v.target);b&&b(),z&&(z.value=!0)}})},a.options),f.observe(e),o=[f,new Set([e])],s.set(a.hash,o));let l=!1;const g=()=>{l||(H.delete(e),N.delete(e),l=!0,o[1].has(e)&&(o[0].unobserve(e),o[1].delete(e)),o[1].size<=0&&s.delete(a.hash),s.size||C.delete(u))};return H.set(e,g),N.set(e,d),g},Re=Q("n-avatar-group"),Se=$("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);
`,[Z(P("&","--n-merged-color: var(--n-color-modal);")),ee(P("&","--n-merged-color: var(--n-color-popover);")),P("img",`
 width: 100%;
 height: 100%;
 `),A("text",`
 white-space: nowrap;
 display: inline-block;
 position: absolute;
 left: 50%;
 top: 50%;
 `),$("icon",`
 vertical-align: bottom;
 font-size: calc(var(--n-merged-size) - 6px);
 `),A("text","line-height: 1.25")]),je=Object.assign(Object.assign({},D.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}),Ee=q({name:"Avatar",props:je,slots:Object,setup(e){const{mergedClsPrefixRef:n,inlineThemeDisabled:d}=se(e),a=x(!1);let u=null;const s=x(null),i=x(null),f=()=>{const{value:t}=s;if(t&&(u===null||u!==t.innerHTML)){u=t.innerHTML;const{value:r}=i;if(r){const{offsetWidth:c,offsetHeight:m}=r,{offsetWidth:h,offsetHeight:E}=t,w=.9,k=Math.min(c/h*w,m/E*w,1);t.style.transform=`translateX(-50%) translateY(-50%) scale(${k})`}}},o=W(Re,null),l=L(()=>{const{size:t}=e;if(t)return t;const{size:r}=o||{};return r||"medium"}),g=D("Avatar","-avatar",Se,ne,e,n),y=W(ye,null),v=L(()=>{if(o)return!0;const{round:t,circle:r}=e;return t!==void 0||r!==void 0?t||r:y?y.roundRef.value:!1}),b=L(()=>o?!0:e.bordered||!1),z=L(()=>{const t=l.value,r=v.value,c=b.value,{color:m}=e,{self:{borderRadius:h,fontSize:E,color:w,border:k,colorModal:U,colorPopover:X},common:{cubicBezierEaseInOut:Y}}=g.value;let F;return typeof t=="number"?F=`${t}px`:F=g.value.self[ae("height",t)],{"--n-font-size":E,"--n-border":c?k:"none","--n-border-radius":r?"50%":h,"--n-color":m||w,"--n-color-modal":m||U,"--n-color-popover":m||X,"--n-bezier":Y,"--n-merged-size":`var(--n-avatar-size-override, ${F})`}}),_=d?ie("avatar",L(()=>{const t=l.value,r=v.value,c=b.value,{color:m}=e;let h="";return t&&(typeof t=="number"?h+=`a${t}`:h+=t[0]),r&&(h+="b"),c&&(h+="c"),m&&(h+=le(m)),h}),z,e):void 0,j=x(!e.lazy);de(()=>{if(e.lazy&&e.intersectionObserverOptions){let t;const r=ce(()=>{t?.(),t=void 0,e.lazy&&(t=we(i.value,e.intersectionObserverOptions,j))});ue(()=>{r(),t?.()})}}),fe(()=>{var t;return e.src||((t=e.imgProps)===null||t===void 0?void 0:t.src)},()=>{a.value=!1});const I=x(!e.lazy);return{textRef:s,selfRef:i,mergedRoundRef:v,mergedClsPrefix:n,fitTextTransform:f,cssVars:d?void 0:z,themeClass:_?.themeClass,onRender:_?.onRender,hasLoadError:a,shouldStartLoading:j,loaded:I,mergedOnError:t=>{if(!j.value)return;a.value=!0;const{onError:r,imgProps:{onError:c}={}}=e;r?.(t),c?.(t)},mergedOnLoad:t=>{const{onLoad:r,imgProps:{onLoad:c}={}}=e;r?.(t),c?.(t),I.value=!0}}},render(){var e,n;const{$slots:d,src:a,mergedClsPrefix:u,lazy:s,onRender:i,loaded:f,hasLoadError:o,imgProps:l={}}=this;i?.();let g;const y=!f&&!o&&(this.renderPlaceholder?this.renderPlaceholder():(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e));return this.hasLoadError?g=this.renderFallback?this.renderFallback():te(d.fallback,()=>[O("img",{src:this.fallbackSrc,style:{objectFit:this.objectFit}})]):g=re(d.default,v=>{if(v)return O(oe,{onResize:this.fitTextTransform},{default:()=>O("span",{ref:"textRef",class:`${u}-avatar__text`},v)});if(a||l.src){const b=this.src||l.src;return O("img",Object.assign(Object.assign({},l),{loading:xe&&!this.intersectionObserverOptions&&s?"lazy":"eager",src:s&&this.intersectionObserverOptions?this.shouldStartLoading?b:void 0:b,"data-image-src":b,onLoad:this.mergedOnLoad,onError:this.mergedOnError,style:[l.style||"",{objectFit:this.objectFit},y?{height:"0",width:"0",visibility:"hidden",position:"absolute"}:""]}))}}),O("span",{ref:"selfRef",class:[`${u}-avatar`,this.themeClass],style:this.cssVars},g,s&&y)}}),ke={style:{position:"relative","overflow-y":"auto",padding:"1rem",height:"calc(100% - 2rem)",width:"calc(100% - 2rem)"}},Fe={class:"log-list-item"},Pe=q({__name:"Log",setup(e){const{log_list:n}=ve(he()),d=new Map([[R.debug,"success"],[R.info,"info"],[R.warn,"warning"],[R.error,"error"]]),a=new Set(["string","number"]);return(u,s)=>(M(),V("div",ke,[T(p(_e),null,{default:S(()=>[(M(!0),V(ge,null,be([...p(n)].reverse(),(i,f)=>(M(),me(p(ze),null,{default:S(()=>[K("div",Fe,[T(p(Ee),{round:"",size:"small"},{default:S(()=>[G(B(p(n).length-f),1)]),_:2},1024),T(p(Oe),{type:p(d).get(i.type)||"default",style:{width:"5em",display:"flex","justify-content":"center"}},{default:S(()=>[G(B(i.type),1)]),_:2},1032,["type"]),K("span",null,B(i.data.reduce((o,l)=>o+" "+(p(a).has(typeof l)?l:`[${typeof l}]`),"")),1)])]),_:2},1024))),256))]),_:1})]))}}),Ce=pe(Pe,[["__scopeId","data-v-7d327e16"]]);export{Ce as default};
