import{Ha as F,na as T,oa as k}from"./chunk-OJKN3TNK.js";import{b as E,f as S}from"./chunk-QF5VF47J.js";import{f as z,i as D,m as A,q as m}from"./chunk-OIJW4GMG.js";import{$b as s,$c as I,Cb as a,Da as g,Hc as d,Jc as M,Qb as i,Wc as P,ac as p,bc as f,ec as x,jb as r,jc as C,kc as v,lc as _,mc as y,ob as h,uc as O,vc as b,wc as w,xb as l}from"./chunk-3FIHWXA5.js";function N(t,c){if(t&1&&(s(0,"div"),b(1),p()),t&2){let e=v();r(),w(e.initials)}}function R(t,c){if(t&1&&f(0,"tis-svg",3),t&2){let e=v();i("icon",e.avatarIcon)("size",e.svgSize)}}var L=(()=>{class t{constructor(){this.name="",this.size="medium",this.variant="default",this.avatarIcon=E.Avatar,this.initials=""}get svgSize(){return this.size==="medium"?"default":"large"}get avatarClasses(){return{avatar:!0,[this.size]:!0,[this.variant]:!0}}ngOnInit(){this.initials=this._getInitials()}_getInitials(){let e=this.name.split(" ");return e.length===0?"":e.length===1?e[0].charAt(0):e[0].charAt(0)+e[1].charAt(0)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=l({type:t,selectors:[["tis-avatar"]],inputs:{name:"name",size:"size",variant:"variant"},decls:4,vars:3,consts:[["avatar",""],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"icon",3,"icon","size"]],template:function(n,o){if(n&1&&(s(0,"div",1),a(1,N,2,1,"div",2),p(),a(2,R,1,2,"ng-template",null,0,P)),n&2){let u=O(3);i("ngClass",o.avatarClasses),r(),i("ngIf",o.initials)("ngIfElse",u)}},dependencies:[m,z,D,S],styles:["[_nghost-%COMP%]{display:block;width:fit-content}.avatar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;overflow:hidden;text-transform:uppercase;-webkit-user-select:none;user-select:none;border-radius:var(--radius-circular)}.avatar.medium[_ngcontent-%COMP%]{width:36px;height:36px;font:var(--font-body-1-strong)}.avatar.large[_ngcontent-%COMP%]{width:64px;height:64px;font:var(--font-subtitle-1)}.avatar.default[_ngcontent-%COMP%]{color:var(--avatar-color-primary);background:var(--avatar-bg-primary)}.avatar.default[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%]{fill:var(--avatar-color-primary)}.avatar.secondary[_ngcontent-%COMP%]{color:var(--avatar-color-secondary);background:var(--avatar-bg-secondary)}.avatar.secondary[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%]{fill:var(--avatar-color-secondary)}.avatar.alternative[_ngcontent-%COMP%]{color:var(--avatar-color-alternative);background:var(--avatar-bg-alternative)}.avatar.alternative[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%]{fill:var(--avatar-color-alternative)}"],changeDetection:0})}}return t})();var V=["*"],W=()=>({duration:0}),$=(t,c)=>({show:t,hide:c}),q=()=>({class:"dx-custom-popover"});function B(t,c){t&1&&x(0)}var at=(()=>{class t{get target(){return typeof this.for=="string"||typeof this.for=="number"?`#${this.for}`:this.for}get position(){return F(this.alignment)}constructor(e){this._cdr=e,this.alignment="left bottom",this.isOpen=!1,this.closed=new g}toggle(){this.isOpen=!this.isOpen,this._cdr.detectChanges()}close(){this.isOpen=!1,this._cdr.detectChanges(),this.closed.emit()}static{this.\u0275fac=function(n){return new(n||t)(h(I))}}static{this.\u0275cmp=l({type:t,selectors:[["tis-popover"]],inputs:{for:"for",template:"template",alignment:"alignment",minWidth:"minWidth",isOpen:"isOpen"},outputs:{closed:"closed"},ngContentSelectors:V,decls:3,vars:14,consts:[[3,"onHiding","target","visible","position","minWidth","hideOnOutsideClick","animation","wrapperAttr"],[4,"ngTemplateOutlet"]],template:function(n,o){n&1&&(_(),s(0,"dx-popover",0),C("onHiding",function(){return o.close()}),a(1,B,1,0,"ng-container",1),y(2),p()),n&2&&(i("target",o.target)("visible",o.isOpen)("position",o.position)("minWidth",o.minWidth)("hideOnOutsideClick",!0)("animation",M(10,$,d(8,W),d(9,W)))("wrapperAttr",d(13,q)),r(),i("ngTemplateOutlet",o.template))},dependencies:[m,A,k,T],styles:[`.dx-custom-popover{color:inherit}.dx-custom-popover .dx-popup-content{padding:var(--space-vertical-snudge) var(--space-horizontal-snudge)}.dx-custom-popover .dx-popover-arrow{display:none}.dx-custom-popover .dx-overlay-content.dx-popup-normal.dx-resizable.dx-popup-fullscreen-width.dx-popup-inherit-height,.dx-custom-popover .dx-overlay-content.dx-popup-normal.dx-resizable.dx-popup-inherit-height{width:fit-content;max-width:400px;color:inherit;background:var(--popover-bg);border:none;border-radius:var(--radius-medium);box-shadow:var(--shadow-16)}.dx-custom-popover .dx-popup-content.dx-popup-content-scrollable[role=tooltip]{padding:var(--space-vertical-snudge) var(--space-horizontal-snudge)}.dx-custom-popover .dx-overlay-wrapper.dx-popup-wrapper.dx-popover-wrapper.dx-popover-without-title{font:inherit;color:inherit}
`],encapsulation:2,changeDetection:0})}}return t})();export{L as a,at as b};
