import{a as d}from"./chunk-F6KLNSUK.js";import{ra as O}from"./chunk-NVJ2ZZFT.js";import{Aa as r,Cb as w,Pd as z,Yg as v,_a as x,ab as f,bb as b,cb as u,db as g,dc as y,dd as k,fb as h,g as C,td as l,ya as p}from"./chunk-SKPDQO4E.js";var T=`<div [className]="'captionline-container ' + className" [attr.border]="showBorder">
    <ng-container *ngIf="avatarSource">
        <div class="avatar-container">
            <img [src]="avatarSource">
            <div class="visitor-badge d-flex justify-content-center align-items-center" *ngIf="isVisitor" nz-tooltip
                nzTooltipTitle="{{'AUTHENTICATORTYPE.VISITOR' | translate}}">
                <span class="text-uppercase text-bold">{{'AUTHENTICATORTYPE.VISITOR'|translate}}</span>
            </div>
        </div>
    </ng-container>
    <div class="lines-container">
        <ng-container *ngFor="let item of items; let itemFirst = first">
            <div class="line-container">
                <ng-container *ngIf="isVisitor && itemFirst && !avatarSource">
                    <div class="visitor-icon d-flex justify-content-center align-items-end me-1" nz-tooltip
                        nzTooltipTitle="{{'AUTHENTICATORTYPE.VISITOR' | translate}}">
                        <span
                            class="text-uppercase text-bold text-sm">{{'AUTHENTICATORTYPE.VISITOR_CHAR'|translate}}</span>
                    </div>
                </ng-container>
                <ng-container *ngFor="let text of item.texts; let textIndex = index;">
                    <ng-container *ngIf="text && textIndex < 5">
                        <div class="item-container">
                            <div class="item-text" [attr.hascolor]="item.colors[textIndex]!=null"
                                [attr.first]="itemFirst" [attr.compact]="compact"
                                [ngStyle]="item.colors[textIndex] && {'background-color': '#' + item.colors[textIndex]}"
                                [ngClass]="item.colors[textIndex] && {'color-white': item.isDark[textIndex], 'color-black': !item.isDark[textIndex]}">
                                <ng-container [ngSwitch]="item.field.type">
                                    <cds-icon shape="users" size="sm" *ngSwitchCase="2" solid></cds-icon>
                                    <cds-icon shape="no-access" size="sm" *ngSwitchCase="5" solid></cds-icon>
                                </ng-container>
                                <ng-container *ngIf="item.translate; then translatedText else noTranslatedText">
                                </ng-container>
                                <ng-template #translatedText>{{text|translate}}</ng-template>
                                <ng-template #noTranslatedText>{{text}}</ng-template>
                            </div>
                        </div>
                    </ng-container>
                </ng-container>
                <ng-container *ngIf="item.texts.length > 5"><span class="text-sm text-italic ms-1">(+{{item.texts.length
                        - 5}})</span></ng-container>
            </div>
        </ng-container>
    </div>
</div>`;var S=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}:host{width:100%}.captionline-container{margin:0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.captionline-container[border=true]{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;border:1px solid #eee;padding:.2rem;width:100%}.captionline-container .avatar-container{position:relative;margin:2px 3px}.captionline-container .avatar-container img{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;border:1px solid #eee;height:48px;width:48px}.captionline-container .avatar-container .visitor-badge{-webkit-border-v-left-radius:50%;-moz-border-radius-bottomleft:50%;border-bottom-left-radius:50%;-webkit-border-v-right-radius:50%;-moz-border-radius-bottomright:50%;border-bottom-right-radius:50%;background-color:#fc0;position:absolute;bottom:0;left:0;right:0;margin:auto}.captionline-container .avatar-container .visitor-badge span{font-size:.4704rem}.captionline-container .lines-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.captionline-container .lines-container .line-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;flex-wrap:wrap}.captionline-container .lines-container .line-container .visitor-icon{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;width:1.092rem;height:1.092rem;box-shadow:0 0 4px #aaa;background-color:#fc0}.captionline-container .lines-container .line-container .item-container{padding:0;margin:1px 0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.captionline-container .lines-container .line-container .item-text{margin:.02rem .05rem;font-size:.672rem;padding:0 .21rem;-webkit-border-radius:.2rem;-moz-border-radius:.2rem;border-radius:.2rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}.captionline-container .lines-container .line-container .item-text[compact=true]{font-size:.504rem}.captionline-container .lines-container .line-container .item-text[hascolor=true]{padding:.1rem .15rem;margin:.02rem .1rem}.captionline-container .lines-container .line-container .item-text[first=true]{font-size:.84rem;font-weight:500;color:#666}.captionline-container .lines-container .line-container .item-text[first=true][compact=true]{font-size:.672rem}
`;var m=C(O());var N=function(a,n,t,o){var e=arguments.length,i=e<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,n,t,o);else for(var c=a.length-1;c>=0;c--)(s=a[c])&&(i=(e<3?s(i):e>3?s(n,t,i):s(n,t))||i);return e>3&&i&&Object.defineProperty(n,t,i),i},I=class{sessionService;sanitizer;captionlines;showBorder=!0;compact=!1;isVisitor=!1;className=void 0;avatarSource;items;constructor(n,t){this.sessionService=n,this.sanitizer=t}ngOnInit(){if(this.captionlines&&this.captionlines.length>0&&this.sessionService.currentOrganization.userOrganizationProfileSettings&&this.sessionService.currentOrganization.userOrganizationProfileSettings.captionLineFields&&this.captionlines){let n=[];this.captionlines.forEach((t,o)=>{if(t){let e={field:null,texts:[],colors:[],isDark:[],translate:!1};switch(e.field=y(this.sessionService.currentOrganization.userOrganizationProfileSettings.captionLineFields[o]),e.field.type){case l.ProfilePhoto:t.avatar?this.avatarSource=this.sanitizer.bypassSecurityTrustResourceUrl(t.avatar):this.avatarSource=this.sanitizer.bypassSecurityTrustResourceUrl(d.DATA);break;default:e.texts=t.text,t.colorCode?(e.colors=t.colorCode,e.isDark=t.colorCode.map(i=>i?(0,m.default)("#"+i).isDark():!1)):e.field.colorCode&&(e.colors=[],e.isDark=[],e.texts.forEach(i=>{e.colors.push(e.field.colorCode),e.isDark.push((0,m.default)("#"+e.field.colorCode).isDark())})),e.translate=t.translate,n.push(e);break}}}),this.items=n,this.sessionService.currentOrganization.userOrganizationProfileSettings.captionLineFields.findIndex(t=>t.type==l.ProfilePhoto)>-1&&(this.avatarSource||(this.avatarSource=this.sanitizer.bypassSecurityTrustResourceUrl(d.DATA)))}}static ctorParameters=()=>[{type:z},{type:w}];static propDecorators={captionlines:[{type:r}],showBorder:[{type:r}],compact:[{type:r}],isVisitor:[{type:r}],className:[{type:r}]}};I=N([p({selector:"armon-captionlines",template:T,standalone:!0,imports:[b,v,f,h,x,u,g,k],styles:[S]})],I);export{I as a};
