import{a as $,b as J}from"./chunk-YF4VEJIA.js";import{a as B,b as D,c as N}from"./chunk-RCEV3GYM.js";import{a as w,b as F,c as O}from"./chunk-J75YHVMQ.js";import{A as H,z as M}from"./chunk-ANSWGJBN.js";import{a as b,b as q}from"./chunk-TS62PHQY.js";import{C as R,j as P,p as S}from"./chunk-Z5RJRCWC.js";import{Ac as s,Dc as A,Eb as x,Gd as G,Ia as f,J as h,Ob as _,Sb as C,Tb as g,cd as T,dd as u,ec as a,ed as c,fc as m,hc as y,ia as v,jc as d,lc as n,na as E,qc as I,rc as z,sc as l,ub as p,zb as o}from"./chunk-JSJB5BKT.js";import{e as k}from"./chunk-SZAW6ZBW.js";function W(i,e){if(i&1&&l(0,"ngx-avatars",1),i&2){let t=s(2);a("size",t.settings==null?null:t.settings.size)("name",t.settings==null?null:t.settings.name)}}function X(i,e){if(i&1&&l(0,"i"),i&2){let t=s(2);d("di ",t.settings==null?null:t.settings.icon," avatar"),m("font-size",t.settings==null?null:t.settings.size,"px")}}function Y(i,e){if(i&1&&l(0,"img",7),i&2){let t=s(2);m("width",t.settings==null?null:t.settings.size,"px")("height",t.settings==null?null:t.settings.size,"px"),a("src",t.settings==null?null:t.settings.gravatar,p)}}function Z(i,e){if(i&1&&l(0,"img",8),i&2){let t=s(2);y(c(4,U,t.settings.size?t.settings.size+"px":"",t.settings.size?t.settings.size&&"px":"")),A("src",t.settings.imageSrc,p),a("ngClass",u(7,K,!t.settings.size))}}function tt(i,e){if(i&1&&l(0,"i",9),i&2){let t=s(2);d("dvl-icon dvl-icon-",t.settings.imageIcon.icon,""),a("ngStyle",c(4,L,t.settings.imageIcon.color,t.settings.size?t.settings.size+"px":"32px"))}}function it(i,e){if(i&1&&l(0,"dvls-connection-icon-and-custom-image-component",6),i&2){let t=s(2);a("item",T(5,Q))("globalImageId",t.settings.globalImageId)("customImageBytes",t.settings.imageSrc)("iconStyle",u(6,V,t.settings.size?t.settings.size+"px":"32px"))("imageStyle",c(8,U,t.settings.size?t.settings.size+"px":"32px",t.settings.size?t.settings.size+"px":"32px"))}}function et(i,e){if(i&1&&(I(0,"div",0),g(1,W,1,2,"ngx-avatars",1)(2,X,1,5,"i",2)(3,Y,1,5,"img",3)(4,Z,1,9,"img",4)(5,tt,1,7,"i",5)(6,it,1,11,"dvls-connection-icon-and-custom-image-component",6),z()),i&2){let t=s();a("pTooltip",t.tooltip)("tooltipPosition",t.tooltipPosition),o(),n(t.type==="default"?1:-1),o(),n(t.type==="icon"?2:-1),o(),n(t.type==="gravatar"?3:-1),o(),n(t.type==="image"?4:-1),o(),n(t.type==="imageIcon"?5:-1),o(),n(t.type==="globalImage"?6:-1)}}var U,K,L,Q,V,ut,nt=k(()=>{E();q();O();N();J();R();G();H();O();N();U=(i,e)=>({height:i,width:e}),K=i=>({"img-small":i}),L=(i,e)=>({color:i,"font-size":e}),Q=()=>({connectionType:0}),V=i=>({"font-size":i});ut=(()=>{class i extends b{constructor(t){super(),this.internetAccessService=t,this.tooltipPosition="right",this.tooltipPrefix="",this.type="default"}ngOnInit(){this.internetAccessService.internetSettings.pipe(v(this.destroyed$),h(t=>!!t)).subscribe(t=>{this.access=t,this.evaluateAvatarType(),this.setTooltip()})}ngOnChanges(t){t.settings&&this.access&&(this.evaluateAvatarType(),this.setTooltip())}setTooltip(){this.settings?.username&&this.settings?.username!==this.settings?.name?this.tooltip=`${this.tooltipPrefix} ${this.settings?.name} (${this.settings?.username})`:this.tooltip=`${this.tooltipPrefix} ${this.settings?.name}`}evaluateAvatarType(){if(this.settings){if(this.settings.globalImageId){this.type="globalImage";return}if(this.settings.imageSrc){this.type="image";return}if(this.settings.imageIcon?.icon){this.type="imageIcon";return}if(this.settings.icon){this.type="icon";return}if(this.access.enableInternetAccess&&this.access.enableGravatar&&this.settings.gravatar&&!this.settings.gravatar.includes("ui-avatars")){this.type="gravatar";return}this.type="default"}}static{this.\u0275fac=function(r){return new(r||i)(x(M))}}static{this.\u0275cmp=_({type:i,selectors:[["sd-avatar"]],inputs:{settings:"settings",tooltipPosition:"tooltipPosition",tooltipPrefix:"tooltipPrefix"},features:[C,f],decls:1,vars:1,consts:[[3,"pTooltip","tooltipPosition"],["textSizeRatio","2.25",3,"size","name"],[3,"class","font-size"],[1,"avatar",3,"src","width","height"],[1,"image","avatar",3,"ngClass","style","src"],[3,"class","ngStyle"],[3,"item","globalImageId","customImageBytes","iconStyle","imageStyle"],[1,"avatar",3,"src"],[1,"image","avatar",3,"ngClass","src"],[3,"ngStyle"]],template:function(r,j){r&1&&g(0,et,7,8,"div",0),r&2&&n(j.settings?0:-1)},dependencies:[F,w,D,B,$,P,S],styles:[".avatar[_ngcontent-%COMP%]{border-radius:50%;vertical-align:middle}.img-small[_ngcontent-%COMP%]{max-width:32px;max-height:32px}[_nghost-%COMP%]     .avatar-container{white-space:nowrap;overflow:hidden}[_nghost-%COMP%]     .avatar-content{width:100%}"]})}}return i})()});export{ut as a,nt as b};
