@veltdev/sdk-dev 6.0.8-beta.2 → 6.0.8-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/models/data/comment-action.data.model.d.ts +55 -0
- package/app/models/data/comment-annotation.data.model.d.ts +11 -0
- package/app/models/data/comment-events.data.model.d.ts +52 -0
- package/app/models/data/comment-progress.data.model.d.ts +127 -0
- package/app/models/data/comment.data.model.d.ts +29 -0
- package/app/models/element/comment-element.model.d.ts +9 -0
- package/app/utils/enums.d.ts +1 -0
- package/{chunk-NCVN3JXT.js → chunk-2VSCJ7FP.js} +6 -6
- package/chunk-3W7PWPIA.js +193 -0
- package/{chunk-3XNLR5I6.js → chunk-44QKIIUD.js} +1 -1
- package/{chunk-ANVOXADQ.js → chunk-4NY6TY72.js} +1 -1
- package/{chunk-33F6VZ2D.js → chunk-4Z6JEK4C.js} +1 -1
- package/{chunk-IOANBPOF.js → chunk-54WPSIBC.js} +1 -1
- package/{chunk-T4CM6UKZ.js → chunk-5AD56Z43.js} +1 -1
- package/{chunk-HNZ452CD.js → chunk-5AXDQN2Z.js} +1 -1
- package/{chunk-5YU74OX2.js → chunk-67WASIND.js} +1 -1
- package/{chunk-JOD7T5HO.js → chunk-6ARAZSKF.js} +1 -1
- package/chunk-6GPW7ZK5.js +1 -0
- package/{chunk-MRNSRINQ.js → chunk-6VS6CXUM.js} +1 -1
- package/chunk-C45R3XT6.js +1 -0
- package/{chunk-MIANWP6R.js → chunk-C6NXU52W.js} +1 -1
- package/{chunk-D2BOLY5Q.js → chunk-F4COO6HD.js} +1 -1
- package/{chunk-Y6KJEASI.js → chunk-F5F6L463.js} +1 -1
- package/{chunk-N4APL3ZG.js → chunk-K47CMSNK.js} +1 -1
- package/{chunk-24U4LEAT.js → chunk-KGSCJNID.js} +1 -1
- package/chunk-LC33EWB5.js +1 -0
- package/{chunk-KES24H7E.js → chunk-MIVF7JMQ.js} +1 -1
- package/{chunk-7DVALKQ7.js → chunk-PPIN2ZDO.js} +1 -1
- package/{chunk-OTEHXO3L.js → chunk-PSDDJB4F.js} +1 -1
- package/{chunk-RTIZJ4JW.js → chunk-RD4WD7HR.js} +1 -1
- package/{chunk-WNW7AS77.js → chunk-T4Z2W6NR.js} +1 -1
- package/{chunk-H2PBKB34.js → chunk-TYOTWEG4.js} +1 -1
- package/{chunk-KMCCIFJ3.js → chunk-UGQYGMGF.js} +1 -1
- package/{chunk-QC3HLRNI.js → chunk-UZW6GB3Q.js} +1 -1
- package/{chunk-I3U6YUMT.js → chunk-WNQGJ6NQ.js} +1 -1
- package/{chunk-LFEKCFWQ.js → chunk-WUADE2PV.js} +1 -1
- package/{chunk-WNOKX7ML.js → chunk-YMLBHLGQ.js} +1 -1
- package/{chunk-CRZGZZVQ.js → chunk-YTAAOIBL.js} +9 -9
- package/{chunk-LS3GLCPX.js → chunk-Z4PTG3MC.js} +1 -1
- package/{chunk-23NZV3J5.js → chunk-ZDDZXCPC.js} +1 -1
- package/models.d.ts +2 -0
- package/package.json +1 -1
- package/velt-activity-log.js +1 -1
- package/velt-area.js +1 -1
- package/velt-arrow.js +1 -1
- package/velt-comment.js +7 -7
- package/velt-crdt.js +1 -1
- package/velt-cursor.js +1 -1
- package/velt-huddle.js +1 -1
- package/velt-live-state-sync.js +1 -1
- package/velt-notification.js +1 -1
- package/velt-presence.js +1 -1
- package/velt-reaction.js +1 -1
- package/velt-recorder.js +1 -1
- package/velt-rewriter.js +1 -1
- package/velt-selection.js +1 -1
- package/velt-tag.js +1 -1
- package/velt-user-invite.js +1 -1
- package/velt-user-request.js +1 -1
- package/velt-video-player.js +1 -1
- package/velt-views.js +1 -1
- package/velt.js +3 -3
- package/chunk-7LUSUNI3.js +0 -1
- package/chunk-BARZUD2Z.js +0 -1
- package/chunk-G4MWCI3H.js +0 -193
- package/chunk-QVPRXGEH.js +0 -1
package/velt-presence.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-T4CM6UKZ.js";import"./chunk-I3U6YUMT.js";import{D as Jt,F as A,G as N}from"./chunk-7LUSUNI3.js";import{a as Be}from"./chunk-D2BOLY5Q.js";import{b as ve,c as Je,d as re}from"./chunk-5YU74OX2.js";import{a as Vt}from"./chunk-24U4LEAT.js";import{a as Gt}from"./chunk-OTEHXO3L.js";import{a as It}from"./chunk-BARZUD2Z.js";import{Ba as f,Ca as We,D as _t,Da as $,Ea as ze,F as yt,s as Ct}from"./chunk-NCVN3JXT.js";import{$ as ae,Ai as jt,Ch as E,Db as vt,Df as xt,E as Y,Eb as pt,Ed as bt,Ee as p,Ef as Ut,Fa as l,Fb as dt,Fc as ft,Fi as $t,G as ot,Ga as he,Gc as D,Gi as Bt,I as He,Ib as te,J as ke,Jb as ut,Kb as Re,Kh as Nt,L as Ke,Lc as Le,Le as rt,Lh as wt,M as Qe,Md as Et,Mh as Ft,Nb as se,Nd as Pt,Ob as Me,Oi as Wt,Pa as m,Pb as ht,Pc as St,Pi as zt,Q as at,Ra as ct,T as W,Ta as lt,Ua as x,Uf as Tt,Va as mt,W as H,Wf as me,X as Ze,Ya as U,_a as g,_b as j,a as C,aa as st,b as w,bc as _,ca as P,cc as b,db as gt,dc as tt,de as nt,dg as Ot,fc as k,ff as it,g as oe,ha as De,ia as Ae,ii as Rt,ji as ge,k as Xe,kc as ce,ki as v,l as ue,lb as c,lc as le,li as Mt,mb as T,mh as Dt,nb as O,ob as R,oe as X,pc as ne,pg as kt,pi as Lt,qa as Ne,qh as At,r as F,sb as d,si as je,tb as u,ti as $e,ua as we,ub as Fe,v as L,vb as qe,wa as I,xb as et,zb as s}from"./chunk-CRZGZZVQ.js";var z=(()=>{let r=class r{constructor(e,t,i,a,h,y,M,Ve,Ye,Ue,Te,Oe,de){this.analyticsService=e,this.docService=t,this.domService=i,this.authService=a,this.afAuth=h,this.iamService=y,this.databaseService=M,this.configService=Ve,this.avatarService=Ye,this.loggingService=Ue,this.flockService=Te,this.commonDbService=Oe,this.realtimeAdapter=de,this.db=null,this.presenceUser$=new ue(new it),this.documentPaths=null,this.inactivityTime=300*1e3,this.offlineInactivityTime=600*1e3,this.presenceUsers$=new ue([]),this.presenceUsersSubscription=null,this.includeSelf$=new ue(!0),this.customPresenceUsers$=new ue([]),this.userIdleStateDetectionSubscription=null,this.userOfflineStateDetectionSubscription=null;try{this.loggingService.log("%c[WB] Creating CLASS: PresenceService","color: blue;"),this.databaseService.getDb().pipe(Y(S=>!!S),ke(1)).subscribe(S=>{S&&(this.db=S,this.getUser(),this.getDocumentPaths(),this.getLocation(),this.updateOnUserDbConnectionStateChange().subscribe(()=>{},B=>{this.loggingService.catch("Error in PresenceService constructor updateOnUserDbConnectionStateChange: ",B)}),this.updateOnDatabaseDisconnect().subscribe(()=>{},B=>{this.loggingService.catch("Error in PresenceService constructor updateOnDatabaseDisconnect: ",B)}),this.updateOnDocumentFocusChange(),this.updateOnAllowedFeatureListChange())},S=>{this.loggingService.catch("Error in PresenceService constructor: ",S)}),this.authService.addPreSignOutFuction("presence-signout",this.signOutUser.bind(this)),this.presenceUsers$.pipe(Qe()).subscribe(([S,B])=>{try{B?.length>=0&&this.analyticsService.updateDefaultProperties({presenceUsersCount:B?.length}),sessionStorage.getItem(p.SESSION_STORAGE.VELT_PRESENCE_MULTIPLE_USERS_ONLINE)||B?.length>1&&S.length!==B.length&&(sessionStorage.setItem(p.SESSION_STORAGE.VELT_PRESENCE_MULTIPLE_USERS_ONLINE,"true"),this.presenceActionsService?.onMultipleUsersOnline({users:B}))}catch(gn){this.loggingService.catch("Error in presenceUsers$ pairwise subscription: ",gn)}}),this.authService.getUser$().pipe(Y(S=>!!S),ke(1)).subscribe(S=>{S?(this.detectUserIdleState(),this.detectUserOfflineState()):(this.unsubscribeUserIdleStateDetectionSubscription(),this.unsubscribeUserOfflineStateDetectionSubscription())}),this.presenceUser$.subscribe(S=>{try{S?.onlineStatus&&this.presenceActionsService?.onUserStateChange({user:JSON.parse(JSON.stringify(S)),state:S?.onlineStatus})}catch(B){this.loggingService.catch("Error in presenceUser$ subscription: ",B)}},S=>{this.loggingService.catch("Error in presenceUser$ subscribe: ",S)}),this.customPresenceUsers$.subscribe(()=>{try{let S=this.presenceUsers$.value.filter(B=>!B.localOnly);this.presenceUsers$.next(this.mergeWithCustomUsers(S))}catch(S){this.loggingService.catch("Error in customPresenceUsers$ subscription: ",S)}}),this.domService.onNetworkStatusChange$().subscribe(S=>{try{!S&&this.presenceUser$?.value?.onlineStatus&&this.presenceActionsService?.onUserStateChange({user:w(C({},JSON.parse(JSON.stringify(this.presenceUser$.value))),{onlineStatus:p.PRESENCE_STATUS_OFFLINE}),state:p.PRESENCE_STATUS_OFFLINE})}catch(B){this.loggingService.catch("Error in domService.onNetworkStatusChange$ subscription: ",B)}},S=>{this.loggingService.catch("Error in domService.onNetworkStatusChange$ subscribe: ",S)})}catch(S){this.loggingService.catch("Error in PresenceService constructor: ",S)}}setPresenceActionsService(e){try{this.presenceActionsService=e}catch(t){this.loggingService.catch("Error in setPresenceActionsService: ",t)}}detectUserIdleState(){try{this.unsubscribeUserIdleStateDetectionSubscription();let e=!1;this.userIdleStateDetectionSubscription=this.domService.onWindowPointerMove$().pipe(Ze(2e3),H(()=>{this.presenceUser$.value&&e&&(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_ONLINE),e=!1)}),He(this.inactivityTime),H(()=>{this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_AWAY,{isUserIdle:!0}),e=!0})).subscribe()}catch(e){this.loggingService.catch("Error in detectUserIdleState: ",e)}}detectUserOfflineState(){try{this.unsubscribeUserOfflineStateDetectionSubscription();let e=!1;this.userOfflineStateDetectionSubscription=this.domService.onWindowPointerMove$().pipe(Ze(2e3),He(this.offlineInactivityTime),H(()=>{this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_OFFLINE,{isUserIdle:!0}),e=!0})).subscribe()}catch(e){this.loggingService.catch("Error in detectUserOfflineState: ",e)}}unsubscribeUserIdleStateDetectionSubscription(){try{this.userIdleStateDetectionSubscription&&(this.userIdleStateDetectionSubscription.unsubscribe(),this.userIdleStateDetectionSubscription=null)}catch(e){this.loggingService.catch("Error in unsubscribeUserIdleStateDetectionSubscription: ",e)}}unsubscribeUserOfflineStateDetectionSubscription(){try{this.userOfflineStateDetectionSubscription&&(this.userOfflineStateDetectionSubscription.unsubscribe(),this.userOfflineStateDetectionSubscription=null)}catch(e){this.loggingService.catch("Error in unsubscribeUserOfflineStateDetectionSubscription: ",e)}}getUser(){this.loggingService.log("%c[WB] Calling FUNCTION: getUser","color: green;"),this.authService.getUser$().pipe(Y(e=>!!e)).subscribe(e=>{e&&this.setPresenceUser(e)},e=>{this.loggingService.catch("Error in getUser: ",e)})}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$().pipe(H(e=>{this.documentPaths=e}),Qe(),H(([e,t])=>{e&&this.updateUserStatusOnDocumentChange(p.PRESENCE_STATUS_OFFLINE,e),t&&this.updateUserStatusOnDocumentChange(p.PRESENCE_STATUS_ONLINE,t)})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getDocumentPaths: ",e)})}getLocation(){this.docService.getLocation$().pipe(H(e=>{this.updateUserOnLocationChange(e)})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getLocation: ",e)})}getPresenceUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getPresenceUser","color: green;"),this.presenceUser$.asObservable()}getPresenceUserValue(){return this.presenceUser$.value}getOnlineUsersOnCurrentDocument(e){return this.loggingService.log("%c[WB] Calling FUNCTION: getOnlineUsersOnCurrentDocument","color: green;"),this.authService.getAuthState$().pipe(Y(t=>!!t),W(t=>this.isFeatureAllowed({firebaseUser:t,users:[],filteredUsers:[]})),W(t=>t.featureAllowed?this.iamService.isUserAllowed$().pipe(L(i=>(t.featureAllowed=i,t))):F(t)),W(t=>t.featureAllowed?this.authService.isPlanExpired$().pipe(L(i=>(t.featureAllowed=!i,t))):F(t)),W(t=>t.featureAllowed?F(t).pipe(W(i=>this.docService.getDocumentPaths$().pipe(L(a=>(this.documentPaths=a,i.documentPaths=a,i)))),W(i=>this.getDataFromDocumentId(e).pipe(L(a=>(i.users=a||[],C({},i))))),L(i=>(e?e?.statuses?.length?i.filteredUsers=i?.users?.filter(a=>e?.statuses?.includes(a?.onlineStatus)):i.filteredUsers=i?.users?.slice():i.filteredUsers=this.filterOnlineUsers(i.users,i.firebaseUser),i)),W(i=>this.getIncludeSelf$().pipe(L(a=>(a||(i.filteredUsers=i?.filteredUsers?.filter(h=>h?.userSnippylyId!==i.user?.userSnippylyId)),i)))),W(i=>{let a=i?.filteredUsers||[];return this.customPresenceUsers$.pipe(L(()=>this.mergeWithCustomUsers(a)))})):F([])),Ke(At))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Y(t=>!!t),L(t=>w(C({},e),{config:t})),W(t=>this.authService.getUser$().pipe(L(i=>w(C({},t),{user:i})))),W(t=>Tt(t.config,t.user,X.PRESENCE)?F(w(C({},t),{featureAllowed:!0})):(this.loggingService.warn("Presence feature is not allowed."),F(w(C({},t),{featureAllowed:!1})))),Ke((t,i)=>t?.featureAllowed===i?.featureAllowed))}getDataFromDocumentId(e){return this.databaseService.getDb().pipe(Y(t=>!!t),W(t=>{if(this.db=t,this.loggingService.log(this.db),this.configService?.getApiKey()&&this.documentPaths?.presence){let i=new Date(Date.now()-864e5).getTime();return this.commonDbService.dbListener({feature:"allPresence",properties:{documentId:e?.documentId??this.documentPaths?.documentId,organizationId:e?.organizationId??this.documentPaths?.organizationId,skipFirestore:!0,useQuery:!0,rtdbQuery:[Et("timestamp"),Pt(i)]}}).pipe(ot(a=>(this.loggingService.catch("Error in PresenceService getDataFromDocumentId: ",a),F(null))),L(a=>a?.data),L(a=>{let h=[];if(a){let y=Object.values(a).filter(M=>typeof M=="object");for(let M of y)h.push(M)}return h}))}else return F([])}))}filterOnlineUsers(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: filterOnlineUsers","color: green;");try{let a=e.slice().filter(h=>{let y=me(h.timestamp);return h.userSnippylyId&&(h.onlineStatus===p.PRESENCE_STATUS_ONLINE||h.onlineStatus===p.PRESENCE_STATUS_AWAY)&&y<this.offlineInactivityTime});return this.presenceUsers$.next(this.mergeWithCustomUsers(a)),a}catch(i){return this.loggingService.catch("Error in filterOnlineUsers:",i),[]}}enableIncludeSelf(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableIncludeSelf","color: green;"),this.includeSelf$.value===!0)return;this.includeSelf$.next(!0)}catch(e){this.loggingService.catch("Error in PresenceService enableIncludeSelf: ",e)}}disableIncludeSelf(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableIncludeSelf","color: green;"),this.includeSelf$.value===!1)return;this.includeSelf$.next(!1)}catch(e){this.loggingService.catch("Error in PresenceService disableIncludeSelf: ",e)}}getIncludeSelf$(){return this.includeSelf$.asObservable()}getIncludeSelf(){return this.includeSelf$.value}getPresenceUserFromExternalId(e){try{if(this.presenceUsers$.value&&this.presenceUsers$.value.length>0){let t=this.presenceUsers$.value.find(i=>i.userId===e);if(t)return t}return null}catch(t){return this.loggingService.catch("Error in getNameFromSnippylyId:",t),null}}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}updateCurrentPresenceUser(e){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateCurrentPresenceUser","color: green;");try{if(this.documentPaths?.presence&&e&&e.userId&&this.authService.isFeatureAllowed(X.PRESENCE)){if(!e.isAnonymous){e.pageInfo=new rt,e?.onlineStatus===p.PRESENCE_STATUS_ONLINE&&(e.isTabAway=!1,e.isUserIdle=!1);let t=JSON.parse(JSON.stringify(e));this.authService.getUser()&&this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(w(C({},t),{timestamp:this.timestamp})))})}this.presenceUser$.next(e)}}catch(t){this.loggingService.catch("Error in updateCurrentPresenceUser:",t)}})}setCurrentPresenceUserStatus(e,t){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: setCurrentPresenceUserStatus","color: green;");try{this.loggingService.log(e);let i=this.presenceUser$.value;if(i.onlineStatus!==e){this.presenceUsersSubscription&&this.presenceUsersSubscription?.unsubscribe();let a=i.onlineStatus,h=e;this.presenceUsersSubscription=this.getPresenceUsers$().pipe(Y(y=>!!y?.length),ke(1)).subscribe(y=>{y?.length>1&&this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_USER_STATUS_CHANGED,{oldStatus:a,newStatus:h,totalUsers:y?.length,presenceSnippylyUserIds:y?.map(M=>M.userSnippylyId),presenceClientUserIds:y?.map(M=>M.userId)})})}i.onlineStatus=e,t&&(i.isTabAway=t?.isTabAway,i.isUserIdle=t?.isUserIdle),e===p.PRESENCE_STATUS_ONLINE&&(i.isTabAway=!1,i.isUserIdle=!1),e===p.PRESENCE_STATUS_OFFLINE&&this.flockService.isInSession()&&this.flockService.removeCurrentUserFromSession(),this.updateCurrentPresenceUser(i)}catch(i){this.loggingService.catch("Error in setCurrentPresenceUserStatus:",i)}})}updateUserStatusOnDocumentChange(e,t){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserStatusOnDocumentChange","color: green;");try{let i=this.presenceUser$.value;if(i.onlineStatus=e,t?.presence&&i&&i.userId&&!i.isAnonymous&&this.authService.isFeatureAllowed(X.PRESENCE)){let a=JSON.parse(JSON.stringify(i));this.commonDbService.updateData({feature:"presence",properties:{documentId:t?.documentId,organizationId:t?.organizationId,userId:i.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(a))})}}catch(i){this.loggingService.catch("Error in updateUserStatusOnDocumentChange:",i)}})}updateUserOnLocationChange(e){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserOnLocationChange","color: green;");try{let t=this.presenceUser$.value;if(t.location=e?e.location:null,t.locationId=e?e?.locationId:null,this.documentPaths?.presence&&t&&t.userId&&!t.isAnonymous&&this.authService.isFeatureAllowed(X.PRESENCE)){let i=JSON.parse(JSON.stringify(t));this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:t.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(i))})}}catch(t){this.loggingService.catch("Error in updateUserOnLocationChange:",t)}})}updateOnUserDbConnectionStateChange(){this.loggingService.log("%c[WB] Calling FUNCTION: updateOnUserDbConnectionStateChange","color: green;");let e=this.realtimeAdapter.rtdbRef(this.db,".info/connected"),t=this.realtimeAdapter.rtdbObjectVal$("presence",e).pipe(L(i=>i?p.PRESENCE_STATUS_ONLINE:p.PRESENCE_STATUS_OFFLINE));return this.authService.getAuthState$().pipe(at(1),W(i=>i?t:F(p.PRESENCE_STATUS_OFFLINE)),H(i=>this.setCurrentPresenceUserStatus(i)))}updateOnDocumentFocusChange(){this.loggingService.log("%c[WB] Calling FUNCTION: updateOnDocumentFocusChange","color: green;");try{document&&document.addEventListener("visibilitychange",e=>{this.authService.getUser()&&(document.visibilityState==="hidden"?(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_AWAY,{isTabAway:!0}),this.flockService.getFlockMode()&&this.flockService.setTabFocused(!1)):(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_ONLINE),this.flockService.getFlockMode()&&this.flockService.setTabFocused(!0)))}),window&&(window.addEventListener("focus",()=>{this.authService.getUser()&&(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_ONLINE),this.flockService.getFlockMode()&&this.flockService.setWindowFocused(!0))}),window.addEventListener("blur",()=>{this.authService.getUser()&&(document.visibilityState!=="hidden"&&this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_AWAY,{isTabAway:!0}),this.flockService.getFlockMode()&&this.flockService.setWindowFocused(!1))}))}catch(e){this.loggingService.catch("Error in updateOnDocumentFocusChange:",e)}}updateOnAllowedFeatureListChange(){try{this.configService.getConfig$().subscribe(e=>{if(e&&e.featureAllowList?.length){let t=this.presenceUser$.value,i=!1;if(e.featureAllowList.includes(X.PRESENCE)?t?.onlineStatus!==p.PRESENCE_STATUS_ONLINE&&(t.onlineStatus=p.PRESENCE_STATUS_ONLINE,i=!0):t?.onlineStatus!==p.PRESENCE_STATUS_OFFLINE&&(t.onlineStatus=p.PRESENCE_STATUS_OFFLINE,i=!0),i&&this.authService.getUser()&&this.documentPaths?.presence&&t&&t.userId&&!t.isAnonymous){let a=JSON.parse(JSON.stringify(t));this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:t.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(a))})}}})}catch(e){this.loggingService.catch("Error in updateOnAllowedFeatureListChange:",e)}}updateOnDatabaseDisconnect(){return this.loggingService.log("%c[WB] Calling FUNCTION: updateOnDatabaseDisconnect","color: green;"),this.authService.getAuthState$().pipe(Y(e=>!!e),W(e=>this.docService.getDocumentPaths$().pipe(L(t=>e))),H(e=>oe(this,null,function*(){try{if(this.documentPaths?.presence&&e){let t=yield this.authService.getIdTokenResultForUser(e,!0).catch(a=>null);if(!t)return;let{user:i}=t.claims;if(!i?.isAnonymous&&this.documentPaths?.presence){this.flockService.isInSession()&&this.flockService.removeCurrentUserFromSession();let a=`${this.documentPaths.presence}/${e.uid}`;this.commonDbService.setupOnDisconnect(a,{onlineStatus:p.PRESENCE_STATUS_OFFLINE,timestamp:this.timestamp}).catch(h=>{this.loggingService.catch("Error in updateOnDatabaseDisconnect:",h)})}}}catch(t){this.loggingService.catch("Error in updateOnDatabaseDisconnect:",t)}})))}setPresenceUser(e){this.loggingService.log("%c[WB] Calling FUNCTION: setPresenceUser","color: green;");try{let t=this.presenceUser$.value;t.userId=e?.userId,t.name=e?.name,t.email=e?.email,t.photoUrl=e?.photoUrl,t.userSnippylyId=e?.userSnippylyId,t.color=e?.color,t.textColor=e?.textColor,t.initial=e?.initial,t.timestamp=this.timestamp,t.type=e?.type,t.isReadOnly=e?.isReadOnly,t.isAnonymous=e?.isAnonymous;let i=e?.name?.split(" ");if(i&&i.length>0){let a=i[0],h=i.length>1?i[i.length-1]:null,y=h?h[0]:null;a&&(t.name=`${a} ${y?y+".":""}`)}this.updateCurrentPresenceUser(t)}catch(t){this.loggingService.catch("Error in setPresenceUser:",t)}}signOutUser(e){return new Promise((t,i)=>{try{this.documentPaths?.presence&&e?this.commonDbService.getData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.uid,skipFirestore:!0}}).then(a=>{a&&(this.flockService.isInSession()&&this.flockService.removeCurrentUserFromSession(),this.commonDbService.updateData({feature:"presence",errorCallback:h=>{i(h)},callback:()=>{t(null)},properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.uid,skipFirestore:!0},data:JSON.parse(JSON.stringify(w(C({},a?.data??{}),{timestamp:this.timestamp,onlineStatus:p.PRESENCE_STATUS_OFFLINE})))})),t(null)}).catch(a=>{this.loggingService.catch("Error in signOutUser subscription: ",a),i(a)}):t(null)}catch(a){this.loggingService.catch("Error in signOutUser:",a),i(a)}})}setInactivityTime(e){try{this.inactivityTime=e,this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_SET_CUSTOM_INACTIVITY_TIMER,{inactivityTime:this.inactivityTime}),this.detectUserIdleState()}catch(t){this.loggingService.catch("Error in setInactivityTime: ",t)}}getInactivityTime(){return this.inactivityTime}setOfflineInactivityTime(e){try{e>=this.inactivityTime?(this.offlineInactivityTime=e,this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_SET_CUSTOM_OFFLINE_INACTIVITY_TIMER,{offlineInactivityTime:this.offlineInactivityTime}),this.detectUserOfflineState()):this.loggingService.catch("Error in setOfflineInactivityTime: ","offline-inactivity-time value is less than inactivity-time.")}catch(t){this.loggingService.catch("Error in setOfflineInactivityTime: ",t)}}getOfflineInactivityTime(){return this.offlineInactivityTime}getPresenceUsers$(){return this.presenceUsers$.asObservable()}getPresenceUsers(){return this.presenceUsers$.value}get timestamp(){return this.commonDbService.getServerTimestamp()}addCustomUser(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: addCustomUser","color: green;");let t=e?.user,i=e?.localOnly??!1;if(!t?.userId){this.loggingService.catch("Error in addCustomUser: ","userId is required");return}let a=this.buildCustomPresenceUser(t,i);if(!a)return;if(i){let h=this.customPresenceUsers$.value,y=h.findIndex(M=>M.userId===t.userId);if(y>=0){let M=[...h];M[y]=a,this.customPresenceUsers$.next(M)}else this.customPresenceUsers$.next([...h,a])}else this.persistCustomUserToDb(a)}catch(t){this.loggingService.catch("Error in addCustomUser: ",t)}}removeCustomUser(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: removeCustomUser","color: green;");let t=e?.user?.userId,i=e?.localOnly??!1;if(!t){this.loggingService.catch("Error in removeCustomUser: ","userId is required");return}if(i){let a=this.customPresenceUsers$.value,h=a.filter(y=>y.userId!==t);h.length!==a.length&&this.customPresenceUsers$.next(h)}else{let a=this.buildCustomPresenceUser(e.user,!1);a&&this.removeCustomUserFromDb(a)}}catch(t){this.loggingService.catch("Error in removeCustomUser: ",t)}}mergeWithCustomUsers(e){try{let t=this.customPresenceUsers$.value;if(t.length===0)return e;let i=new Set(e.map(h=>h.userId)),a=t.filter(h=>!i.has(h.userId));return[...e,...a]}catch(t){return this.loggingService.catch("Error in mergeWithCustomUsers: ",t),e}}buildCustomPresenceUser(e,t=!1){try{let i=this.configService.getApiKey(),a=new it;return a.userId=e.userId,a.name=e.name||e.userId,a.email=e.email||"",a.photoUrl=e.photoUrl||"",a.onlineStatus=e.onlineStatus||p.PRESENCE_STATUS_ONLINE,a.color=e.color||this.avatarService.generateUserColor(),a.textColor=e.textColor||"",a.type="custom",a.initial=e.initial||(a.name?a.name.charAt(0).toUpperCase():"U"),a.timestamp=Date.now(),a.isReadOnly=e.isReadOnly??!1,a.isAnonymous=e.isAnonymous??!1,a.location=e.location||null,a.locationId=e.locationId??null,a.pageInfo=e.pageInfo||new rt,a.isTabAway=!1,a.isUserIdle=!1,a.userSnippylyId=e.userSnippylyId||(i?kt(i,e.userId):`custom_${e.userId}`),a.localOnly=t,a}catch(i){return this.loggingService.catch("Error in buildCustomPresenceUser: ",i),null}}persistCustomUserToDb(e){try{if(this.documentPaths?.presence&&e?.userId&&this.authService.isFeatureAllowed(X.PRESENCE)){let t=JSON.parse(JSON.stringify(e));delete t.localOnly,this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(w(C({},t),{timestamp:this.timestamp})))})}}catch(t){this.loggingService.catch("Error in persistCustomUserToDb: ",t)}}removeCustomUserFromDb(e){try{this.documentPaths?.presence&&e?.userId&&this.authService.isFeatureAllowed(X.PRESENCE)&&this.commonDbService.deleteData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.userSnippylyId,skipFirestore:!0}})}catch(t){this.loggingService.catch("Error in removeCustomUserFromDb: ",t)}}};r.\u0275fac=function(t){return new(t||r)(P(ge),P($t),P(je),P($e),P(bt),P(Gt),P(jt),P(Mt),P(Lt),P(v),P(K),P(zt),P(Wt))},r.\u0275prov=ae({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var ie=class{constructor(){this.filteredPresenceUsers=[],this.shadowDom=!0,this.maxUsers=5,this.showTooltip=()=>{},this.closeTooltip=()=>{},this.onPresenceUserClick=()=>{}}};var V=class{constructor(){this.shadowDom=!0,this.calculateUserAwayTime=()=>{}}};var Kt=n=>({componentConfigSignal:n}),un=(n,r)=>({condition:n,data:r}),hn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-avatar-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function fn(n,r){if(n&1&&(d(0),R(1,"snippyly-user-avatar",3),u()),n&2){let o=s(2).ngIf,e=s();l(),Re("away",o.presenceUser.onlineStatus===e.constants.PRESENCE_STATUS_AWAY)("velt-presence-avatar--away",o.presenceUser.onlineStatus===e.constants.PRESENCE_STATUS_AWAY),c("user",o.presenceUser)}}function Sn(n,r){if(n&1&&(d(0),g(1,fn,2,5,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,hn,e.template,_(1,Kt,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Cn(n,r){if(n&1&&(d(0),g(1,Sn,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,un,o.conditionSignal(),_(1,Kt,o.componentConfigSignal)))}}var fe=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-avatar",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipAvatarComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipAvatarComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipAvatarComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipAvatarComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-avatar-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-avatar","s-presence-avatar",3,"user"]],template:function(t,i){t&1&&g(0,Cn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,re],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-presence-avatar[_ngcontent-%COMP%]{position:relative;border-radius:var(--velt-border-radius-full);z-index:2;width:calc((1.5 + 0px) * var(--velt-base-rem-unit));height:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;align-items:center;justify-content:center}.velt-presence-avatar--away[_ngcontent-%COMP%]{filter:grayscale(.7)}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem}"],changeDetection:0});let n=r;return n})();var Zt=n=>({componentConfigSignal:n}),yn=(n,r)=>({condition:n,data:r}),In=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-active-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function bn(n,r){n&1&&(d(0),T(1,"p"),se(2),ce(3,"translate"),O(),u()),n&2&&(l(2),Me(le(3,1,"User online")))}function En(n,r){if(n&1&&(d(0),g(1,bn,4,3,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,In,e.template,_(1,Zt,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Pn(n,r){if(n&1&&(d(0),g(1,En,2,9,"ng-container",0),u()),n&2){let o=s().ngIf,e=s();l(),c("ngIf",(o.presenceUser==null?null:o.presenceUser.onlineStatus)===e.constants.PRESENCE_STATUS_ONLINE)}}function xn(n,r){if(n&1&&(d(0),g(1,Pn,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,yn,o.conditionSignal(),_(1,Zt,o.componentConfigSignal)))}}var Se=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-user-active",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-user-active-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,i){t&1&&g(0,xn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,ve],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}p[_ngcontent-%COMP%]{margin:0;color:var(--velt-green);font-weight:400;font-size:var(--velt-font-size-xs);line-height:1}"],changeDetection:0});let n=r;return n})();var qt=n=>({componentConfigSignal:n}),Tn=(n,r)=>({condition:n,data:r}),On=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-inactive-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function kn(n,r){if(n&1&&(d(0),T(1,"p",3),se(2),ce(3,"translate"),O(),u()),n&2){let o=s(3).ngIf;l(2),ht(" ",o.calculateUserAwayTime(o.presenceUser).toString()+" "+le(3,1,"mins ago.")," ")}}function Dn(n,r){if(n&1&&(d(0),g(1,kn,4,3,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,On,e.template,_(1,qt,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function An(n,r){if(n&1&&(d(0),g(1,Dn,2,9,"ng-container",0),u()),n&2){let o=s().ngIf,e=s();l(),c("ngIf",(o.presenceUser==null?null:o.presenceUser.onlineStatus)===e.constants.PRESENCE_STATUS_AWAY)}}function Nn(n,r){if(n&1&&(d(0),g(1,An,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,Tn,o.conditionSignal(),_(1,qt,o.componentConfigSignal)))}}var Ce=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-user-inactive",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-user-inactive-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-tooltip-user-inactive-text","inactive-text"]],template:function(t,i){t&1&&g(0,Nn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,ve],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}p[_ngcontent-%COMP%]{margin:0;color:var(--velt-green);font-weight:400;font-size:var(--velt-font-size-xs);line-height:1}.velt-presence-tooltip-user-inactive-text[_ngcontent-%COMP%]{color:var(--velt-text-4)}"],changeDetection:0});let n=r;return n})();var en=n=>({componentConfigSignal:n}),Fn=(n,r)=>({condition:n,data:r}),Rn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-name-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Mn(n,r){if(n&1&&(d(0),T(1,"h1"),se(2),ce(3,"translate"),O(),u()),n&2){let o=s(3).ngIf;l(2),Me(o.presenceUser!=null&&o.presenceUser.name?o.presenceUser==null?null:o.presenceUser.name:le(3,1,o.presenceUser==null?null:o.presenceUser.email))}}function Ln(n,r){n&1&&R(0,"velt-skeleton-loader-internal",5)}function jn(n,r){if(n&1&&(d(0),g(1,Mn,4,3,"ng-container",4)(2,Ln,1,0,"ng-template",null,0,ne),u()),n&2){let o=te(3),e=s(2).ngIf;l(),c("ngIf",(e.presenceUser==null?null:e.presenceUser.name)||(e.presenceUser==null?null:e.presenceUser.email))("ngIfElse",o)}}function $n(n,r){if(n&1&&(d(0),g(1,jn,4,2,"ng-container",3),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Rn,e.template,_(1,en,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Bn(n,r){if(n&1&&(d(0),g(1,$n,2,9,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(3,Fn,o.conditionSignal(),_(1,en,o.componentConfigSignal)))}}var _e=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-user-name";try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipUserNameComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserNameComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserNameComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipUserNameComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-user-name-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[["loadingTemplateRef",""],[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngIf","ngIfElse"],["height","16px","width","80px","borderRadius","20px"]],template:function(t,i){t&1&&g(0,Bn,2,6,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,Je,ve],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}h1[_ngcontent-%COMP%]{margin:0;color:var(--velt-text-0);font-size:var(--velt-font-size-sm);line-height:calc((1rem + 0px) * var(--velt-base-rem-unit));font-weight:400}"],changeDetection:0});let n=r;return n})();var tn=n=>({componentConfigSignal:n}),zn=(n,r)=>({condition:n,data:r}),Jn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-status-container-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Gn(n,r){if(n&1&&(d(0),T(1,"div",3),R(2,"velt-presence-tooltip-user-name-internal",4)(3,"velt-presence-tooltip-user-active-internal",4)(4,"velt-presence-tooltip-user-inactive-internal",4),O(),u()),n&2){let o=s(3);l(2),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal)}}function Vn(n,r){if(n&1&&(d(0),g(1,Gn,5,3,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Jn,e.template,_(1,tn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Yn(n,r){if(n&1&&(d(0),g(1,Vn,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,zn,o.conditionSignal(),_(1,tn,o.componentConfigSignal)))}}var ye=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-status-container",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-status-container-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-tooltip-status-container","user-status-container"],[3,"componentConfigSignal"]],template:function(t,i){t&1&&g(0,Yn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,Se,Ce,_e],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-presence-tooltip-status-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;z-index:2;gap:var(--velt-spacing-xs)}"],changeDetection:0});let n=r;return n})();var nn=(n,r)=>({componentConfigSignal:n,presenceUser:r}),Qn=(n,r)=>({condition:n,data:r}),Zn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function qn(n,r){n&1&&Fe(0)}function er(n,r){if(n&1&&(T(0,"velt-shadow-dom-internal"),g(1,qn,1,0,"ng-container",4),O()),n&2){s();let o=te(3);l(),c("ngTemplateOutlet",o)}}function tr(n,r){if(n&1&&(d(0),T(1,"div",8),R(2,"velt-presence-tooltip-avatar-internal",9)(3,"velt-presence-tooltip-status-container-internal",9),O(),u()),n&2){let o=s(5);l(2),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal)}}function nr(n,r){if(n&1&&(T(0,"div",6),g(1,tr,4,2,"ng-container",7),O()),n&2){let o=s(3).ngIf,e=s();l(),c("veltDynamicTemplate",k(4,Zn,e.template,b(1,nn,e.componentConfigSignal,e.presenceUser),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function rr(n,r){if(n&1&&g(0,nr,2,10,"div",5),n&2){let o=s(2).ngIf;c("ngIf",o==null?null:o.presenceUser)}}function ir(n,r){if(n&1&&(d(0),g(1,er,2,1,"velt-shadow-dom-internal",3)(2,rr,1,1,"ng-template",null,0,ne),u()),n&2){let o=te(3),e=s().ngIf,t=s();l(),c("ngIf",e.shadowDom&&!t.template||t.template&&t.isExplicitShadowDom)("ngIfElse",o)}}function or(n,r){if(n&1&&(d(0),g(1,ir,4,2,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(4,Qn,o.conditionSignal(),b(1,nn,o.componentConfigSignal,o.presenceUser)))}}var Ie=(()=>{let r=class r extends ze{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,t,i,a,h){super(e,t,void 0,void 0,void 0,i,a),this.elementRef=e,this.themeService=t,this.dynamicDataService=i,this.loggingService=a,this.wireframeService=h,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.constants=p,this.subscriptions=[],this.componentId="velt-presence-tooltip",this.componentConfigSignal=Ne({presenceUser:null,shadowDom:!0,calculateUserAwayTime:this.calculateUserAwayTime.bind(this)}),this.loggingService.log("%c[WB] Creating CLASS: PresenceTooltipComponent","color: blue;")}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");try{let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes(),this.dynamicDataService.applyConditionalClasses(this.elementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,presenceUser:this.presenceUser}),this.subscriptions.push(this.wireframeService.getWireframe$("velt-presence-tooltip-wireframe").subscribe(a=>{if(a){let h=document.createElement(a.tagName);h.innerHTML=a.innerHTML,this.template=h}}))}catch(e){this.loggingService.catch("Error in PresenceComponent oninit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(i=>(i=w(C({},i),{[t]:e[t].currentValue}),i))})}catch(t){this.loggingService.catch("Error in PresenceTooltipComponent ngOnChanges: ",t)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in PresenceTooltipComponent unsubscribe: ",e)}}calculateUserAwayTime(e){try{if(e.onlineStatus===p.PRESENCE_STATUS_ONLINE)return 0;let t=me(e.timestamp);return Math.floor(t/1e3/60)}catch(t){this.loggingService.catch("Error in PresenceTooltipComponent calculateUserAwayTime: ",t)}return 0}};r.\u0275fac=function(t){return new(t||r)(m(I),m(We),m(f),m(v),m(Be))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip"]],inputs:{presenceUser:"presenceUser",shadowDom:"shadowDom",variant:"variant"},standalone:!1,features:[U,we],decls:1,vars:1,consts:[["presenceTooltipRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-presence-tooltip-container",4,"ngIf"],[1,"velt-presence-tooltip-container"],[4,"veltDynamicTemplate"],[1,"velt-presence-tooltip","s-tooltiptext","s-presence-tooltip"],[3,"componentConfigSignal"]],template:function(t,i){t&1&&g(0,or,2,7,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,Le,N,A,fe,ye],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);margin:calc((.5rem + 0px) * var(--velt-base-rem-unit))}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-presence-tooltip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:calc((.5rem + 0px) * var(--velt-base-rem-unit));block-size:auto;width:max-content;background-color:var(--velt-background-0);border:1px solid var(--velt-border-5);color:var(--velt-text-0);text-align:left;padding:var(--velt-spacing-xs) var(--velt-spacing-sm);border-radius:var(--velt-border-radius-xs);font-style:normal;font-weight:400;font-size:var(--velt-font-size-xs);line-height:2em;z-index:1;transition:opacity .5s}.velt-presence-tooltip[_ngcontent-%COMP%]:after{background-color:var(--velt-background-0);border-color:var(--velt-border-5)}"],changeDetection:0});let n=r;return n})();var sr=["tooltipContent"],rn=(n,r,o)=>({componentConfigSignal:n,presenceUser:r,index:o}),cr=(n,r)=>({condition:n,data:r}),lr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-list-item-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function mr(n,r){if(n&1){let o=qe();d(0),T(1,"snippyly-user-avatar",6),et("click",function(){De(o);let t=s(3).ngIf,i=s();return Ae(t.onPresenceUserClick(i.presenceUser))}),R(2,"div",7),O(),u()}if(n&2){let o=s(4);l(),Re("away",o.presenceUser.onlineStatus===o.constants.PRESENCE_STATUS_AWAY)("velt-presence-avatar--away",o.presenceUser.onlineStatus===o.constants.PRESENCE_STATUS_AWAY),c("user",o.presenceUser),l(),ut("border-color",o.presenceUser.color)}}function gr(n,r){if(n&1){let o=qe();T(0,"div",4),et("pointerenter",function(t){De(o);let i=s(2).ngIf,a=s();return i.showTooltip(t,a.presenceUser),Ae(t.stopPropagation())})("pointerleave",function(t){return De(o),s(2).ngIf.closeTooltip(),Ae(t.stopPropagation())}),g(1,mr,3,7,"ng-container",5),O()}if(n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(5,lr,e.template,tt(1,rn,e.componentConfigSignal,e.presenceUser,e.index),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function vr(n,r){if(n&1&&R(0,"velt-presence-tooltip",8),n&2){let o=r.$implicit,e=s(2).ngIf;c("presenceUser",o)("shadowDom",e.shadowDom)}}function pr(n,r){if(n&1&&(d(0),g(1,gr,2,11,"div",3)(2,vr,1,2,"ng-template",null,0,ne),u()),n&2){let o=s().ngIf,e=s();l(),c("ngIf",e.index<o.maxUsers)}}function dr(n,r){if(n&1&&(d(0),g(1,pr,4,1,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(5,cr,o.conditionSignal(),tt(1,rn,o.componentConfigSignal,o.presenceUser,o.index)))}}var be=(()=>{let r=class r extends ${get itemTemplate(){return this._itemTemplate}set itemTemplate(e){try{this._itemTemplate=e,this.itemTemplate?this.template=this.domService.deepCloneElement(this.itemTemplate):this.template=null}catch{}}constructor(e,t,i,a){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.domService=a,this.componentId="velt-presence-avatar-list-item",this.constants=p;try{super.initializeComponentConfigSignal(new ie)}catch(h){this.loggingService.catch("Error in PresenceAvatarListItemComponent constructor: ",h)}}ngOnInit(){try{this.dynamicDataService.applyConditionalClasses(this.elementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,presenceUser:this.presenceUser,index:this.index}),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent ngOnInit: ",e)}}ngAfterViewInit(){try{setTimeout(()=>{this.componentConfigSignal.set(w(C({},this.componentConfigSignal()),{tooltipContent:this.tooltipContent}))},1e3)}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent ngAfterViewInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v),m(je))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-avatar-list-item-internal"]],viewQuery:function(t,i){if(t&1&&vt(sr,5),t&2){let a;pt(a=dt())&&(i.tooltipContent=a.first)}},inputs:{presenceUser:"presenceUser",index:"index",itemTemplate:"itemTemplate"},standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[["tooltipContent",""],[4,"ngIf"],[4,"veltIf"],["class","velt-presence-avatar-list-item velt-tooltip s-presence-avatar-container s-tooltip",3,"pointerenter","pointerleave",4,"ngIf"],[1,"velt-presence-avatar-list-item","velt-tooltip","s-presence-avatar-container","s-tooltip",3,"pointerenter","pointerleave"],[4,"veltDynamicTemplate"],[1,"velt-presence-avatar","s-presence-avatar",3,"click","user"],[1,"velt-presence-avatar-outline","avatar-outline"],[3,"presenceUser","shadowDom"]],template:function(t,i){t&1&&g(0,dr,2,8,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,re,Ie],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-presence-avatar-list-item[_ngcontent-%COMP%]{height:calc((1.5 + 0px) * var(--velt-base-rem-unit));width:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;justify-content:center;align-items:center;cursor:pointer}.velt-presence-avatar-list-item[_ngcontent-%COMP%] .velt-presence-avatar[_ngcontent-%COMP%]{position:relative;border-radius:var(--velt-border-radius-full);z-index:2;width:calc((1.5 + 0px) * var(--velt-base-rem-unit));height:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;align-items:center;justify-content:center}.velt-presence-avatar--away[_ngcontent-%COMP%]{filter:grayscale(.7)}.velt-presence-avatar-outline[_ngcontent-%COMP%]{position:absolute;inset:-1px;border:1px solid transparent;border-radius:var(--velt-border-radius-full)}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem}"],changeDetection:0});let n=r;return n})();var on=n=>({componentConfigSignal:n}),hr=(n,r)=>({condition:n,data:r}),fr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-list-wireframe",variant:o,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function Sr(n,r){if(n&1&&(d(0),R(1,"velt-presence-avatar-list-item-internal",4),u()),n&2){let o=r.$implicit,e=r.index,t=s(4);l(),c("presenceUser",o)("index",e)("componentConfigSignal",t.componentConfigSignal)("itemTemplate",t.itemTemplate)}}function Cr(n,r){if(n&1&&(d(0),g(1,Sr,2,4,"ng-container",3),u()),n&2){let o=s(2).ngIf;l(),c("ngForOf",o.filteredPresenceUsers)("ngForTrackBy",o.trackById)}}function _r(n,r){if(n&1&&(d(0),g(1,Cr,2,2,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,fr,e.template,_(1,on,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function yr(n,r){if(n&1&&(d(0),g(1,_r,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,hr,o.conditionSignal(),_(1,on,o.componentConfigSignal)))}}var Ee=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-avatar-list",this.constants=p;try{super.initializeComponentConfigSignal(new ie)}catch(a){this.loggingService.catch("Error in PresenceAvatarListComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes();let e=this.template?.querySelector("velt-presence-avatar-list-item-wireframe");Dt(e)||(this.itemTemplate=e)}catch(e){this.loggingService.catch("Error in PresenceAvatarListComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceAvatarListComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceAvatarListComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-avatar-list-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"presenceUser","index","componentConfigSignal","itemTemplate"]],template:function(t,i){t&1&&g(0,yr,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[ft,D,N,A,be],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:calc((1.5 + 0px) * var(--velt-base-rem-unit));min-width:calc((1.5 + 0px) * var(--velt-base-rem-unit))}[_nghost-%COMP%]:empty{display:none}velt-presence-avatar-list-item-internal[_ngcontent-%COMP%]:not(:first-child){margin-left:calc(var(--velt-spacing-xs) * -1)}"],changeDetection:0});let n=r;return n})();var an=n=>({componentConfigSignal:n}),br=(n,r)=>({condition:n,data:r}),Er=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-remaining-count-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Pr(n,r){if(n&1&&(d(0),T(1,"snippyly-user-avatar",3),R(2,"div",4),O(),u()),n&2){let o=s(3).ngIf;l(),c("initial","+"+(o.filteredPresenceUsers.length-o.maxUsers).toString())}}function xr(n,r){if(n&1&&(d(0),g(1,Pr,3,1,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Er,e.template,_(1,an,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ur(n,r){if(n&1&&(d(0),g(1,xr,2,9,"ng-container",0),u()),n&2){let o=s().ngIf;l(),c("ngIf",o.filteredPresenceUsers.length>o.maxUsers)}}function Tr(n,r){if(n&1&&(d(0),g(1,Ur,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,br,o.conditionSignal(),_(1,an,o.componentConfigSignal)))}}var Pe=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-avatar-remaining-count";try{super.initializeComponentConfigSignal(new ie)}catch(a){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-avatar-remaining-count-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-avatar","velt-presence-avatar-remaining-count","s-presence-avatar","more-users",3,"initial"],[1,"velt-presence-avatar-remaining-count-outline","avatar-outline"]],template:function(t,i){t&1&&g(0,Tr,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,re],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-presence-avatar[_ngcontent-%COMP%]{position:relative;border-radius:var(--velt-border-radius-full);z-index:2;width:calc((1.5 + 0px) * var(--velt-base-rem-unit));height:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;align-items:center;justify-content:center}.velt-presence-avatar.velt-presence-avatar-remaining-count[_ngcontent-%COMP%]{box-shadow:none;color:var(--velt-text-0);margin-left:calc(var(--velt-spacing-xs) * -1);background-color:var(--legacy-velt-presence-more-users-color)}.velt-presence-avatar.velt-presence-avatar-remaining-count[_ngcontent-%COMP%] .velt-presence-avatar-remaining-count-outline[_ngcontent-%COMP%]{border-color:var(--legacy-velt-presence-more-users-color)}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem}"],changeDetection:0});let n=r;return n})();var sn=n=>({componentConfigSignal:n}),kr=(n,r)=>({condition:n,data:r}),Dr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Ar(n,r){n&1&&Fe(0)}function Nr(n,r){if(n&1&&(T(0,"velt-shadow-dom-internal"),g(1,Ar,1,0,"ng-container",4),O()),n&2){s();let o=te(3);l(),c("ngTemplateOutlet",o)}}function wr(n,r){if(n&1&&(d(0),R(1,"velt-presence-avatar-list-internal",8)(2,"velt-presence-avatar-remaining-count-internal",8),u()),n&2){let o=s(5);l(),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal)}}function Fr(n,r){if(n&1&&(T(0,"div",6),g(1,wr,3,2,"ng-container",7),O()),n&2){let o=s(3).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Dr,e.template,_(1,sn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Rr(n,r){if(n&1&&g(0,Fr,2,9,"div",5),n&2){let o=s(2).ngIf;c("ngIf",o.filteredPresenceUsers&&o.filteredPresenceUsers.length>0&&!(o.user!=null&&o.user.isAnonymous))}}function Mr(n,r){if(n&1&&(d(0),g(1,Nr,2,1,"velt-shadow-dom-internal",3)(2,Rr,1,1,"ng-template",null,0,ne),u()),n&2){let o=te(3),e=s().ngIf,t=s();l(),c("ngIf",e.shadowDom&&!t.template||t.template&&t.isExplicitShadowDom)("ngIfElse",o)}}function Lr(n,r){if(n&1&&(d(0),g(1,Mr,4,2,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(3,kr,o.conditionSignal(),_(1,sn,o.componentConfigSignal)))}}var pe=(()=>{let r=class r extends ze{get maxUsers(){return this._maxUsers}set maxUsers(e){try{isNaN(e)?this.loggingService.catch("Error in Presence set maxUsers: ","max-user value is not a number."):this._maxUsers=e}catch(t){this.loggingService.catch("Error in Presence set maxUsers: ",t)}}get inactivityTime(){return this._inactivityTime}set inactivityTime(e){try{isNaN(e)?this.loggingService.catch("Error in Presence set inactivityTime: ","inactivity-time value is not a number."):(this._inactivityTime=e,this.presenceService.setInactivityTime(this._inactivityTime))}catch(t){this.loggingService.catch("Error in Presence set inactivityTime: ",t)}}get offlineInactivityTime(){return this._offlineInactivityTime}set offlineInactivityTime(e){try{isNaN(e)?this.loggingService.catch("Error in Presence set offlineInactivityTime: ","offline-inactivity-time value is not a number."):(this._offlineInactivityTime=e,this.presenceService.setOfflineInactivityTime(this._offlineInactivityTime))}catch(t){this.loggingService.catch("Error in Presence set offlineInactivityTime: ",t)}}get flockMode(){return this._flockMode}set flockMode(e){try{let t=typeof e=="string"?JSON.parse(e):e;t?(this._flockMode=t,this.flockService.enableFlockMode(),this.flockService.setNavigateEmitter(this.onNavigate)):(this._flockMode=t,this.flockService.disableFlockMode())}catch(t){this.loggingService.catch("Error in Presence set flockMode: ",t)}}set disableFlockNavigation(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.flockService.setDisableFlockNavigation(t)}catch(t){this.loggingService.catch("Error in Presence set disableFlockNavigation: ",t)}}set defaultFlockNavigation(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.flockService.setDisableFlockNavigation(!t)}catch(t){this.loggingService.catch("Error in Presence set defaultFlockNavigation: ",t)}}get location(){return this._location}set location(e){try{if(e&&typeof e=="string"){let t=JSON.parse(e);this._location=t,this.serverLocationId=Ot(this.location)}}catch(t){this.loggingService.catch("Error in Presence set location: ",t)}}set self(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.presenceService.enableIncludeSelf():this.presenceService.disableIncludeSelf()}catch{}}set _shadowDom(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.isExplicitShadowDom=!!t,this.componentConfigSignal.update(i=>(i=w(C({},i),{shadowDom:t}),i))}catch{}}constructor(e,t,i,a,h,y,M,Ve,Ye,Ue,Te,Oe){super(Ue,Te,void 0,void 0,void 0,Oe,h),this.analyticsService=e,this.authService=t,this.flockService=i,this.presenceService=a,this.loggingService=h,this.wireframeService=y,this.overlay=M,this.overlayPositionBuilder=Ve,this.viewContainerRef=Ye,this.elementRef=Ue,this.themeService=Te,this.dynamicDataService=Oe,this.DEFAULT_MAX_USERS=5,this._maxUsers=this.DEFAULT_MAX_USERS,this._inactivityTime=5,this._offlineInactivityTime=10,this._flockMode=!1,this.onNavigate=new he,this.isExplicitShadowDom=!1,this.onPresenceUserClickEmitter=new he,this.presenceUsers=[],this.subscriptions=[],this.constants=p,this.onUsersChanged=new he,this.onPresenceUserChange=new he,this.componentConfigSignal=Ne({filteredPresenceUsers:[],user:null,shadowDom:!0,maxUsers:5,tooltipContent:null,trackById:this.trackById.bind(this),showTooltip:this.showTooltip.bind(this),closeTooltip:this.closeTooltip.bind(this),onPresenceUserClick:this.onPresenceUserClick.bind(this)}),this.veltElement=!0,this.componentId="velt-presence",this.loggingService.log("%c[WB] Creating CLASS: PresenceComponent","color: blue;"),this.subscriptions.push(this.authService.getUser$().subscribe(de=>{this.componentConfigSignal.update(S=>(S=w(C({},S),{user:de}),S)),this.componentConfigSignal().user&&(this.setPresenceInstalledInAnalytics(),this.presenceSetCustomMaxUsersInAnalytics())},de=>{this.loggingService.catch("Error in PresenceComponent getUser$ subscription: ",de)}))}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");try{this.getOnlineUsersOnCurrentDocument(),this.setupA11yAttributes(),super.ngOnInit(),this.subscriptions.push(this.wireframeService.getWireframe$("velt-presence-wireframe").subscribe(t=>{if(t){let i=document.createElement(t.tagName);i.innerHTML=t.innerHTML,this.template=i}}))}catch(e){this.loggingService.catch("Error in PresenceComponent oninit: ",e)}}ngOnChanges(e){try{this.loggingService.log("%c[WB] Calling PresenceComponent FUNCTION: ngOnChanges","color: green;"),e&&(super.ngOnChanges(e),Object.keys(e).forEach(t=>{this.componentConfigSignal.update(i=>(i=w(C({},i),{[t]:e[t].currentValue}),i))}))}catch(t){this.loggingService.catch("Error in PresenceComponent ngOnChanges: ",t)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceComponent setupA11yAttributes:",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),super.ngOnDestroy(),this.closeTooltip()}catch(e){this.loggingService.catch("Error in PresenceComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in PresenceComponent unsubscribe: ",e)}}showTooltip(e,t){try{this.closeTooltip();let i=new I(e.currentTarget),a=this.overlayPositionBuilder.flexibleConnectedTo(i).withPositions([{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}]);this.overlayRef=this.overlay.create({positionStrategy:a}),this.overlayRef.attach(new Ct(this.componentConfigSignal().tooltipContent,this.viewContainerRef,{$implicit:t}))}catch(i){this.loggingService.catch("Error in PresenceComponent showTooltip: ",i)}}closeTooltip(){try{this.overlayRef&&this.overlayRef.dispose()}catch(e){this.loggingService.catch("Error in PresenceComponent closeTooltip: ",e)}}getOnlineUsersOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getOnlineUsersOnCurrentDocument","color: green;");try{this.subscriptions.push(this.presenceService.getOnlineUsersOnCurrentDocument().pipe(Y(e=>!!e)).subscribe(e=>{this.loggingService.log(e),e&&(this.presenceUsers=e),this.filterPresenceUsers()},e=>{this.loggingService.catch("Error in PresenceComponent getOnlineUsersOnCurrentDocument subscription: ",e)}))}catch(e){this.loggingService.catch("Error in PresenceComponent getOnlineUsersOnCurrentDocument: ",e)}}filterPresenceUsers(){try{let e=[];this.presenceUsers?this.locationId?e=this.presenceUsers.filter(t=>t?.location?.id===this.locationId):this.location?e=this.presenceUsers.filter(t=>t.locationId===this.serverLocationId):e=this.presenceUsers:e=[],this.componentConfigSignal.update(t=>(t=w(C({},t),{filteredPresenceUsers:e}),t)),this.onUsersChanged.emit(this.componentConfigSignal().filteredPresenceUsers),this.onPresenceUserChange.emit(this.componentConfigSignal().filteredPresenceUsers)}catch(e){this.loggingService.catch("Error in PresenceComponent filterPresenceUsers: ",e)}}calculateUserAwayTime(e){try{if(e.onlineStatus===p.PRESENCE_STATUS_ONLINE)return 0;let t=me(e.timestamp);return Math.floor(t/1e3/60)}catch(t){this.loggingService.catch("Error in PresenceComponent calculateUserAwayTime: ",t)}return 0}setPresenceInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(X.PRESENCE)}catch(e){this.loggingService.catch("Error in PresenceComponent setPresenceInstalledInAnalytics: ",e)}}presenceSetCustomMaxUsersInAnalytics(){try{this.maxUsers!=this.DEFAULT_MAX_USERS&&this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_SET_CUSTOM_MAX_USERS,{maxUsers:+this.maxUsers})}catch(e){this.loggingService.catch("Error in PresenceComponent presenceSetCustomMaxUsersInAnalytics: ",e)}}onPresenceUserClick(e){try{this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_USER_CLICKED,{totalUsers:this.presenceService?.getPresenceUsers()?.length,presenceSnippylyUserIds:this.presenceService?.getPresenceUsers()?.map(t=>t.userSnippylyId),presenceClientUserIds:this.presenceService?.getPresenceUsers()?.map(t=>t.userId)}),this.onPresenceUserClickEmitter.emit(e),this.componentConfigSignal().user?.userSnippylyId!==e?.userSnippylyId&&this.flockService.getFlockMode()&&this.setFlockLeader(e.userSnippylyId,e.name)}catch(t){this.loggingService.catch("Error in PresenceComponent onPresenceUserClick: ",t)}}setFlockLeader(e,t){try{this.flockService.setFlockLeader(e,t)}catch(i){this.loggingService.catch("Error in PresenceComponent setFlockLeader: ",i)}}trackById(e,t){return t?.userId}};r.\u0275fac=function(t){return new(t||r)(m(ge),m($e),m(K),m(z),m(v),m(Be),m(yt),m(_t),m(ct),m(I),m(We),m(f))},r.\u0275cmp=x({type:r,selectors:[["app-presence"]],hostVars:1,hostBindings:function(t,i){t&2&>("data-velt-element",i.veltElement)},inputs:{maxUsers:"maxUsers",inactivityTime:"inactivityTime",offlineInactivityTime:"offlineInactivityTime",flockMode:"flockMode",disableFlockNavigation:"disableFlockNavigation",defaultFlockNavigation:"defaultFlockNavigation",location:"location",locationId:"locationId",self:"self",_shadowDom:[0,"shadowDom","_shadowDom"],variant:"variant"},outputs:{onNavigate:"onNavigate",onPresenceUserClickEmitter:"onPresenceUserClick",onUsersChanged:"usersChanged",onPresenceUserChange:"onPresenceUserChange"},standalone:!1,features:[U,we],decls:1,vars:1,consts:[["presenceRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-presence-container s-presence-container",4,"ngIf"],[1,"velt-presence-container","s-presence-container"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"]],template:function(t,i){t&1&&g(0,Lr,2,6,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,Le,N,A,Ee,Pe],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{position:relative;display:inline-flex;justify-content:center;align-items:center;margin:0;padding:0;-webkit-tap-highlight-color:rgba(255,255,255,0);box-sizing:border-box;width:auto;height:calc((1.5 + 0px) * var(--velt-base-rem-unit));font-size:var(--velt-font-size-xs);line-height:1.5;background:transparent}.velt-presence-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:calc((1.5 + 0px) * var(--velt-base-rem-unit));min-width:calc((1.5 + 0px) * var(--velt-base-rem-unit))}"],changeDetection:0});let n=r;return n})();var xe=(()=>{let r=class r{constructor(e,t,i){this.analyticsService=e,this.loggingService=t,this.presenceService=i,this.actionSubjects=new Map,this.subscriptions=[];try{this.presenceService.setPresenceActionsService(this)}catch(a){this.loggingService.catch("Error in PresenceActionsService constructor: ",a)}}onMultipleUsersOnline(e){try{this.loggingService.log("%c[WB] Calling PresenceActionsService FUNCTION: onMultipleUsersOnline","color: green;"),this.triggerAction(nt.MULTIPLE_USERS_ONLINE,e),this.analyticsService.trackEvent(E.Events.Presence.MULTIPLE_USERS_ONLINE,{totalUsers:e?.users?.length,presenceSnippylyUserIds:e?.users?.map(t=>t.userSnippylyId),presenceClientUserIds:e?.users?.map(t=>t.userId)})}catch(t){this.loggingService.catch("Error in PresenceActionsService onMultipleUsersOnline: ",t)}}onUserStateChange(e){try{this.loggingService.log("%c[WB] Calling PresenceActionsService FUNCTION: onUserStateChange","color: green;"),this.triggerAction(nt.USER_STATE_CHANGE,e),this.analyticsService.trackEvent(E.Events.Presence.ON_USER_STATE_CHANGE,{userSnippylyId:e?.user?.userSnippylyId,userId:e?.user?.userId,state:e?.state})}catch(t){this.loggingService.catch("Error in PresenceActionsService onUserStateChange: ",t)}}getData(e){try{return this.loggingService.log("%c[WB] Calling PresenceActionsService FUNCTION: getData","color: green;"),this.presenceService.getOnlineUsersOnCurrentDocument(e).pipe(L(t=>({data:t})))}catch(t){return this.loggingService.catch("Error in PresenceActionsService getData: ",t),F({data:null})}}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new Xe),this.actionSubjects.get(e)?.next(t)}catch(i){this.loggingService.catch("Error in PresenceActionsService triggerAction: ",i)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new Xe),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in PresenceActionsService onAction: ",t),F(null)}}};r.\u0275fac=function(t){return new(t||r)(P(ge),P(v),P(z))},r.\u0275prov=ae({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var Ge=class extends Vt{constructor(r){super(r),this.getService(v).log("%c[WB] Creating CLASS: PresenceElement","color: blue;"),this.getOnlineUsersOnCurrentDocument=this._getOnlineUsersOnCurrentDocument,this.setInactivityTime=this._setInactivityTime,this.enableFlockMode=this._enableFlockMode,this.disableFlockMode=this._disableFlockMode,this.startFollowingUser=this._startFollowingUser,this.stopFollowingUser=this._stopFollowingUser,this.enableSelf=this._enableSelf,this.disableSelf=this._disableSelf,this.getData=this._getData,this.on=this._on,this.addUser=this._addUser,this.removeUser=this._removeUser}_getOnlineUsersOnCurrentDocument(){this.getService(v).log("%c[WB] Calling FUNCTION: getOnlineUsers","color: green;");try{return this.trackEvent(E.Events.Presence.GET_ONLINE_USERS_ON_CURRENT_DOCUMENT_TRIGGERED),this.getService(z).getOnlineUsersOnCurrentDocument()}catch(r){return this.getService(v).catch("Error in _getOnlineUsersOnCurrentDocument: ",r),F(null)}}_setInactivityTime(r){this.getService(v).log("%c[WB] Calling FUNCTION: _setInactivityTime","color: green;");try{this.trackEvent(E.Events.Presence.SET_INACTIVITY_TIME_TRIGGERED,{payload:{time:r}}),isNaN(r)?this.getService(v).catch("Error in setInactivityTime: ","Provided value is not a number."):this.getService(z).setInactivityTime(r)}catch(o){this.getService(v).catch("Error in setInactivityTime: ",o)}}_disableFlockMode(){try{this.trackEvent(E.Events.Presence.DISABLE_FLOCK_MODE_TRIGGERED),this.getService(K).disableFlockMode()}catch(r){this.getService(v).catch("Error in _disableFlockMode: ",r)}}_enableFlockMode(r){try{this.trackEvent(E.Events.Presence.ENABLE_FLOCK_MODE_TRIGGERED,{payload:{options:r}}),this.getService(K).enableFlockMode(r)}catch(o){this.getService(v).catch("Error in _enableFlockMode: ",o)}}_stopFollowingUser(){try{this.trackEvent(E.Events.Presence.STOP_FOLLOWING_USER_TRIGGERED),this.getService(K).stopFollowingUser()}catch(r){this.getService(v).catch("Error in _stopFollowingUser: ",r)}}_startFollowingUser(r){try{this.trackEvent(E.Events.Presence.START_FOLLOWING_USER_TRIGGERED,{payload:{externalId:r}});let o=this.getService(z).getPresenceUserFromExternalId(r);return o&&o.userSnippylyId&&o.name!==void 0?(this.getService(K).startFollowingUser(o.userSnippylyId,o.name),{success:!0,msg:"Joined flock session."}):{success:!1,msg:"User could not be found."}}catch(o){return this.getService(v).catch("Error in _startFollowingUser: ",o),{success:!1,msg:"Unknown error.",raw:o}}}_enableSelf(){try{this.trackEvent(E.Events.Presence.ENABLE_SELF_TRIGGERED),this.getService(z).enableIncludeSelf()}catch(r){this.getService(v).catch("Error in _enableSelf: ",r)}}_disableSelf(){try{this.trackEvent(E.Events.Presence.DISABLE_SELF_TRIGGERED),this.getService(z).disableIncludeSelf()}catch(r){this.getService(v).catch("Error in _disableSelf: ",r)}}_getData(r){this.getService(v).log("%c[WB] Calling FUNCTION: getData","color: green;");try{return this.trackEvent(E.Events.Presence.GET_PRESENCE_DATA_TRIGGERED,{payload:{query:r}}),r&&typeof r=="object"&&(r=C({},r),r?.documentId&&(r.documentId=xt(r.documentId)),r?.organizationId&&(r.organizationId=Ut(r.organizationId))),this.getService(xe).getData(r)}catch(o){return this.getService(v).catch("Error in _getData: ",o),F({data:null})}}_on(r){this.getService(v).log("%c[WB] Calling FUNCTION: on","color: green;");try{return this.getService(xe).onAction(r)}catch(o){return this.getService(v).catch("Error in _on: ",o),F(null)}}_addUser(r){this.getService(v).log("%c[WB] Calling FUNCTION: addUser","color: green;");try{if(this.trackEvent(E.Events.Presence.ADD_USER_TRIGGERED,{payload:{userId:r?.user?.userId,localOnly:r?.localOnly}}),!r?.user?.userId){this.getService(v).catch("Error in addUser: ","userId is required");return}this.getService(z).addCustomUser(r)}catch(o){this.getService(v).catch("Error in addUser: ",o)}}_removeUser(r){this.getService(v).log("%c[WB] Calling FUNCTION: removeUser","color: green;");try{if(this.trackEvent(E.Events.Presence.REMOVE_USER_TRIGGERED,{payload:{userId:r?.user?.userId,localOnly:r?.localOnly}}),!r?.user?.userId){this.getService(v).catch("Error in removeUser: ","userId is required");return}this.getService(z).removeCustomUser(r)}catch(o){this.getService(v).catch("Error in removeUser: ",o)}}};var cn=(()=>{let r=class r{};r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=mt({type:r}),r.\u0275inj=st({imports:[St,re,Je]});let n=r;return n})();var ln=(()=>{let r=class r{constructor(e,t){this.loggingService=e,this.usersService=t}getUserIdsToResolveFromPresenceUsers(e){try{let t=new Set;for(let i of e)i?.userId&&t.add(i?.userId);return Array.from(t)}catch(t){return this.loggingService.catch("Error in PresenceUtilsService getUserIdsToResolveFromPresenceUsers:",t),[]}}mergePresenceUserWithUser(e){try{if(this.usersService.userDataProviderAvailable()&&e?.userId){let t=this.usersService.getUserById(e?.userId);t&&(e=C(C({},e),t))}return e}catch(t){return this.loggingService.catch("Error in PresenceUtilsService mergePresenceUserWithUser:",t),e}}formatPresenceUserData(e){try{if(this.usersService.userDataProviderAvailable()){let t=["userId","onlineStatus","userSnippylyId","color","textColor","timestamp","type","selections","documentParamsId","documentParams","locationId","location","isReadOnly","isAnonymous","pageInfo"];Object.keys(e).forEach(i=>{t.includes(i)||(e[i]=null)})}return e}catch(t){return this.loggingService.catch("Error in PresenceUtilsService formatPresenceUserData:",t),e}}};r.\u0275fac=function(t){return new(t||r)(P(v),P(Bt))},r.\u0275prov=ae({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var jr={"velt-presence-wireframe":pe,"velt-presence-avatar-list-wireframe":Ee,"velt-presence-avatar-list-item-wireframe":be,"velt-presence-avatar-remaining-count-wireframe":Pe,"velt-presence-tooltip-wireframe":Ie,"velt-presence-tooltip-avatar-wireframe":fe,"velt-presence-tooltip-user-active-wireframe":Se,"velt-presence-tooltip-user-inactive-wireframe":Ce,"velt-presence-tooltip-user-name-wireframe":_e,"velt-presence-tooltip-status-container-wireframe":ye};Object.assign(Jt,jr);function $r(n){n.get(v).log("%c[WB] Loading presence feature chunk","color: blue;");let o=n.get(Rt);o.set(Nt,n.get(z)),o.set(wt,n.get(xe)),o.set(Ft,n.get(ln));let t=lt(cn,n).injector;return mn(t,p.TAGS.VELT_PRESENCE,pe),mn(t,p.TAGS.SNIPPYLY_PRESENCE,pe),new Ge(n)}function mn(n,r,o){if(customElements.get(r))return;let e=It(o,n);customElements.define(r,e)}export{$r as default};
|
|
1
|
+
import{a as K}from"./chunk-5AD56Z43.js";import"./chunk-WNQGJ6NQ.js";import{D as Jt,F as A,G as N}from"./chunk-C45R3XT6.js";import{a as Be}from"./chunk-F4COO6HD.js";import{b as ve,c as Je,d as re}from"./chunk-67WASIND.js";import{a as Vt}from"./chunk-KGSCJNID.js";import{a as Gt}from"./chunk-PSDDJB4F.js";import{a as It}from"./chunk-LC33EWB5.js";import{D as _t,F as yt,Fa as f,Ga as We,Ha as $,Ia as ze,s as Ct}from"./chunk-2VSCJ7FP.js";import{$ as ae,Ai as jt,Ch as E,Db as vt,Df as xt,E as Y,Eb as pt,Ed as bt,Ee as p,Ef as Ut,Fa as l,Fb as dt,Fc as ft,Fi as $t,G as ot,Ga as he,Gc as D,Gi as Bt,I as He,Ib as te,J as ke,Jb as ut,Kb as Re,Kh as Nt,L as Ke,Lc as Le,Le as rt,Lh as wt,M as Qe,Md as Et,Mh as Ft,Nb as se,Nd as Pt,Ob as Me,Oi as Wt,Pa as m,Pb as ht,Pc as St,Pi as zt,Q as at,Ra as ct,T as W,Ta as lt,Ua as x,Uf as Tt,Va as mt,W as H,Wf as me,X as Ze,Ya as U,_a as g,_b as j,a as C,aa as st,b as w,bc as _,ca as P,cc as b,db as gt,dc as tt,de as nt,dg as Ot,fc as k,ff as it,g as oe,ha as De,ia as Ae,ii as Rt,ji as ge,k as Xe,kc as ce,ki as v,l as ue,lb as c,lc as le,li as Mt,mb as T,mh as Dt,nb as O,ob as R,oe as X,pc as ne,pg as kt,pi as Lt,qa as Ne,qh as At,r as F,sb as d,si as je,tb as u,ti as $e,ua as we,ub as Fe,v as L,vb as qe,wa as I,xb as et,zb as s}from"./chunk-YTAAOIBL.js";var z=(()=>{let r=class r{constructor(e,t,i,a,h,y,M,Ve,Ye,Ue,Te,Oe,de){this.analyticsService=e,this.docService=t,this.domService=i,this.authService=a,this.afAuth=h,this.iamService=y,this.databaseService=M,this.configService=Ve,this.avatarService=Ye,this.loggingService=Ue,this.flockService=Te,this.commonDbService=Oe,this.realtimeAdapter=de,this.db=null,this.presenceUser$=new ue(new it),this.documentPaths=null,this.inactivityTime=300*1e3,this.offlineInactivityTime=600*1e3,this.presenceUsers$=new ue([]),this.presenceUsersSubscription=null,this.includeSelf$=new ue(!0),this.customPresenceUsers$=new ue([]),this.userIdleStateDetectionSubscription=null,this.userOfflineStateDetectionSubscription=null;try{this.loggingService.log("%c[WB] Creating CLASS: PresenceService","color: blue;"),this.databaseService.getDb().pipe(Y(S=>!!S),ke(1)).subscribe(S=>{S&&(this.db=S,this.getUser(),this.getDocumentPaths(),this.getLocation(),this.updateOnUserDbConnectionStateChange().subscribe(()=>{},B=>{this.loggingService.catch("Error in PresenceService constructor updateOnUserDbConnectionStateChange: ",B)}),this.updateOnDatabaseDisconnect().subscribe(()=>{},B=>{this.loggingService.catch("Error in PresenceService constructor updateOnDatabaseDisconnect: ",B)}),this.updateOnDocumentFocusChange(),this.updateOnAllowedFeatureListChange())},S=>{this.loggingService.catch("Error in PresenceService constructor: ",S)}),this.authService.addPreSignOutFuction("presence-signout",this.signOutUser.bind(this)),this.presenceUsers$.pipe(Qe()).subscribe(([S,B])=>{try{B?.length>=0&&this.analyticsService.updateDefaultProperties({presenceUsersCount:B?.length}),sessionStorage.getItem(p.SESSION_STORAGE.VELT_PRESENCE_MULTIPLE_USERS_ONLINE)||B?.length>1&&S.length!==B.length&&(sessionStorage.setItem(p.SESSION_STORAGE.VELT_PRESENCE_MULTIPLE_USERS_ONLINE,"true"),this.presenceActionsService?.onMultipleUsersOnline({users:B}))}catch(gn){this.loggingService.catch("Error in presenceUsers$ pairwise subscription: ",gn)}}),this.authService.getUser$().pipe(Y(S=>!!S),ke(1)).subscribe(S=>{S?(this.detectUserIdleState(),this.detectUserOfflineState()):(this.unsubscribeUserIdleStateDetectionSubscription(),this.unsubscribeUserOfflineStateDetectionSubscription())}),this.presenceUser$.subscribe(S=>{try{S?.onlineStatus&&this.presenceActionsService?.onUserStateChange({user:JSON.parse(JSON.stringify(S)),state:S?.onlineStatus})}catch(B){this.loggingService.catch("Error in presenceUser$ subscription: ",B)}},S=>{this.loggingService.catch("Error in presenceUser$ subscribe: ",S)}),this.customPresenceUsers$.subscribe(()=>{try{let S=this.presenceUsers$.value.filter(B=>!B.localOnly);this.presenceUsers$.next(this.mergeWithCustomUsers(S))}catch(S){this.loggingService.catch("Error in customPresenceUsers$ subscription: ",S)}}),this.domService.onNetworkStatusChange$().subscribe(S=>{try{!S&&this.presenceUser$?.value?.onlineStatus&&this.presenceActionsService?.onUserStateChange({user:w(C({},JSON.parse(JSON.stringify(this.presenceUser$.value))),{onlineStatus:p.PRESENCE_STATUS_OFFLINE}),state:p.PRESENCE_STATUS_OFFLINE})}catch(B){this.loggingService.catch("Error in domService.onNetworkStatusChange$ subscription: ",B)}},S=>{this.loggingService.catch("Error in domService.onNetworkStatusChange$ subscribe: ",S)})}catch(S){this.loggingService.catch("Error in PresenceService constructor: ",S)}}setPresenceActionsService(e){try{this.presenceActionsService=e}catch(t){this.loggingService.catch("Error in setPresenceActionsService: ",t)}}detectUserIdleState(){try{this.unsubscribeUserIdleStateDetectionSubscription();let e=!1;this.userIdleStateDetectionSubscription=this.domService.onWindowPointerMove$().pipe(Ze(2e3),H(()=>{this.presenceUser$.value&&e&&(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_ONLINE),e=!1)}),He(this.inactivityTime),H(()=>{this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_AWAY,{isUserIdle:!0}),e=!0})).subscribe()}catch(e){this.loggingService.catch("Error in detectUserIdleState: ",e)}}detectUserOfflineState(){try{this.unsubscribeUserOfflineStateDetectionSubscription();let e=!1;this.userOfflineStateDetectionSubscription=this.domService.onWindowPointerMove$().pipe(Ze(2e3),He(this.offlineInactivityTime),H(()=>{this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_OFFLINE,{isUserIdle:!0}),e=!0})).subscribe()}catch(e){this.loggingService.catch("Error in detectUserOfflineState: ",e)}}unsubscribeUserIdleStateDetectionSubscription(){try{this.userIdleStateDetectionSubscription&&(this.userIdleStateDetectionSubscription.unsubscribe(),this.userIdleStateDetectionSubscription=null)}catch(e){this.loggingService.catch("Error in unsubscribeUserIdleStateDetectionSubscription: ",e)}}unsubscribeUserOfflineStateDetectionSubscription(){try{this.userOfflineStateDetectionSubscription&&(this.userOfflineStateDetectionSubscription.unsubscribe(),this.userOfflineStateDetectionSubscription=null)}catch(e){this.loggingService.catch("Error in unsubscribeUserOfflineStateDetectionSubscription: ",e)}}getUser(){this.loggingService.log("%c[WB] Calling FUNCTION: getUser","color: green;"),this.authService.getUser$().pipe(Y(e=>!!e)).subscribe(e=>{e&&this.setPresenceUser(e)},e=>{this.loggingService.catch("Error in getUser: ",e)})}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$().pipe(H(e=>{this.documentPaths=e}),Qe(),H(([e,t])=>{e&&this.updateUserStatusOnDocumentChange(p.PRESENCE_STATUS_OFFLINE,e),t&&this.updateUserStatusOnDocumentChange(p.PRESENCE_STATUS_ONLINE,t)})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getDocumentPaths: ",e)})}getLocation(){this.docService.getLocation$().pipe(H(e=>{this.updateUserOnLocationChange(e)})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getLocation: ",e)})}getPresenceUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getPresenceUser","color: green;"),this.presenceUser$.asObservable()}getPresenceUserValue(){return this.presenceUser$.value}getOnlineUsersOnCurrentDocument(e){return this.loggingService.log("%c[WB] Calling FUNCTION: getOnlineUsersOnCurrentDocument","color: green;"),this.authService.getAuthState$().pipe(Y(t=>!!t),W(t=>this.isFeatureAllowed({firebaseUser:t,users:[],filteredUsers:[]})),W(t=>t.featureAllowed?this.iamService.isUserAllowed$().pipe(L(i=>(t.featureAllowed=i,t))):F(t)),W(t=>t.featureAllowed?this.authService.isPlanExpired$().pipe(L(i=>(t.featureAllowed=!i,t))):F(t)),W(t=>t.featureAllowed?F(t).pipe(W(i=>this.docService.getDocumentPaths$().pipe(L(a=>(this.documentPaths=a,i.documentPaths=a,i)))),W(i=>this.getDataFromDocumentId(e).pipe(L(a=>(i.users=a||[],C({},i))))),L(i=>(e?e?.statuses?.length?i.filteredUsers=i?.users?.filter(a=>e?.statuses?.includes(a?.onlineStatus)):i.filteredUsers=i?.users?.slice():i.filteredUsers=this.filterOnlineUsers(i.users,i.firebaseUser),i)),W(i=>this.getIncludeSelf$().pipe(L(a=>(a||(i.filteredUsers=i?.filteredUsers?.filter(h=>h?.userSnippylyId!==i.user?.userSnippylyId)),i)))),W(i=>{let a=i?.filteredUsers||[];return this.customPresenceUsers$.pipe(L(()=>this.mergeWithCustomUsers(a)))})):F([])),Ke(At))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Y(t=>!!t),L(t=>w(C({},e),{config:t})),W(t=>this.authService.getUser$().pipe(L(i=>w(C({},t),{user:i})))),W(t=>Tt(t.config,t.user,X.PRESENCE)?F(w(C({},t),{featureAllowed:!0})):(this.loggingService.warn("Presence feature is not allowed."),F(w(C({},t),{featureAllowed:!1})))),Ke((t,i)=>t?.featureAllowed===i?.featureAllowed))}getDataFromDocumentId(e){return this.databaseService.getDb().pipe(Y(t=>!!t),W(t=>{if(this.db=t,this.loggingService.log(this.db),this.configService?.getApiKey()&&this.documentPaths?.presence){let i=new Date(Date.now()-864e5).getTime();return this.commonDbService.dbListener({feature:"allPresence",properties:{documentId:e?.documentId??this.documentPaths?.documentId,organizationId:e?.organizationId??this.documentPaths?.organizationId,skipFirestore:!0,useQuery:!0,rtdbQuery:[Et("timestamp"),Pt(i)]}}).pipe(ot(a=>(this.loggingService.catch("Error in PresenceService getDataFromDocumentId: ",a),F(null))),L(a=>a?.data),L(a=>{let h=[];if(a){let y=Object.values(a).filter(M=>typeof M=="object");for(let M of y)h.push(M)}return h}))}else return F([])}))}filterOnlineUsers(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: filterOnlineUsers","color: green;");try{let a=e.slice().filter(h=>{let y=me(h.timestamp);return h.userSnippylyId&&(h.onlineStatus===p.PRESENCE_STATUS_ONLINE||h.onlineStatus===p.PRESENCE_STATUS_AWAY)&&y<this.offlineInactivityTime});return this.presenceUsers$.next(this.mergeWithCustomUsers(a)),a}catch(i){return this.loggingService.catch("Error in filterOnlineUsers:",i),[]}}enableIncludeSelf(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableIncludeSelf","color: green;"),this.includeSelf$.value===!0)return;this.includeSelf$.next(!0)}catch(e){this.loggingService.catch("Error in PresenceService enableIncludeSelf: ",e)}}disableIncludeSelf(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableIncludeSelf","color: green;"),this.includeSelf$.value===!1)return;this.includeSelf$.next(!1)}catch(e){this.loggingService.catch("Error in PresenceService disableIncludeSelf: ",e)}}getIncludeSelf$(){return this.includeSelf$.asObservable()}getIncludeSelf(){return this.includeSelf$.value}getPresenceUserFromExternalId(e){try{if(this.presenceUsers$.value&&this.presenceUsers$.value.length>0){let t=this.presenceUsers$.value.find(i=>i.userId===e);if(t)return t}return null}catch(t){return this.loggingService.catch("Error in getNameFromSnippylyId:",t),null}}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}updateCurrentPresenceUser(e){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateCurrentPresenceUser","color: green;");try{if(this.documentPaths?.presence&&e&&e.userId&&this.authService.isFeatureAllowed(X.PRESENCE)){if(!e.isAnonymous){e.pageInfo=new rt,e?.onlineStatus===p.PRESENCE_STATUS_ONLINE&&(e.isTabAway=!1,e.isUserIdle=!1);let t=JSON.parse(JSON.stringify(e));this.authService.getUser()&&this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(w(C({},t),{timestamp:this.timestamp})))})}this.presenceUser$.next(e)}}catch(t){this.loggingService.catch("Error in updateCurrentPresenceUser:",t)}})}setCurrentPresenceUserStatus(e,t){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: setCurrentPresenceUserStatus","color: green;");try{this.loggingService.log(e);let i=this.presenceUser$.value;if(i.onlineStatus!==e){this.presenceUsersSubscription&&this.presenceUsersSubscription?.unsubscribe();let a=i.onlineStatus,h=e;this.presenceUsersSubscription=this.getPresenceUsers$().pipe(Y(y=>!!y?.length),ke(1)).subscribe(y=>{y?.length>1&&this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_USER_STATUS_CHANGED,{oldStatus:a,newStatus:h,totalUsers:y?.length,presenceSnippylyUserIds:y?.map(M=>M.userSnippylyId),presenceClientUserIds:y?.map(M=>M.userId)})})}i.onlineStatus=e,t&&(i.isTabAway=t?.isTabAway,i.isUserIdle=t?.isUserIdle),e===p.PRESENCE_STATUS_ONLINE&&(i.isTabAway=!1,i.isUserIdle=!1),e===p.PRESENCE_STATUS_OFFLINE&&this.flockService.isInSession()&&this.flockService.removeCurrentUserFromSession(),this.updateCurrentPresenceUser(i)}catch(i){this.loggingService.catch("Error in setCurrentPresenceUserStatus:",i)}})}updateUserStatusOnDocumentChange(e,t){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserStatusOnDocumentChange","color: green;");try{let i=this.presenceUser$.value;if(i.onlineStatus=e,t?.presence&&i&&i.userId&&!i.isAnonymous&&this.authService.isFeatureAllowed(X.PRESENCE)){let a=JSON.parse(JSON.stringify(i));this.commonDbService.updateData({feature:"presence",properties:{documentId:t?.documentId,organizationId:t?.organizationId,userId:i.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(a))})}}catch(i){this.loggingService.catch("Error in updateUserStatusOnDocumentChange:",i)}})}updateUserOnLocationChange(e){return oe(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserOnLocationChange","color: green;");try{let t=this.presenceUser$.value;if(t.location=e?e.location:null,t.locationId=e?e?.locationId:null,this.documentPaths?.presence&&t&&t.userId&&!t.isAnonymous&&this.authService.isFeatureAllowed(X.PRESENCE)){let i=JSON.parse(JSON.stringify(t));this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:t.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(i))})}}catch(t){this.loggingService.catch("Error in updateUserOnLocationChange:",t)}})}updateOnUserDbConnectionStateChange(){this.loggingService.log("%c[WB] Calling FUNCTION: updateOnUserDbConnectionStateChange","color: green;");let e=this.realtimeAdapter.rtdbRef(this.db,".info/connected"),t=this.realtimeAdapter.rtdbObjectVal$("presence",e).pipe(L(i=>i?p.PRESENCE_STATUS_ONLINE:p.PRESENCE_STATUS_OFFLINE));return this.authService.getAuthState$().pipe(at(1),W(i=>i?t:F(p.PRESENCE_STATUS_OFFLINE)),H(i=>this.setCurrentPresenceUserStatus(i)))}updateOnDocumentFocusChange(){this.loggingService.log("%c[WB] Calling FUNCTION: updateOnDocumentFocusChange","color: green;");try{document&&document.addEventListener("visibilitychange",e=>{this.authService.getUser()&&(document.visibilityState==="hidden"?(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_AWAY,{isTabAway:!0}),this.flockService.getFlockMode()&&this.flockService.setTabFocused(!1)):(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_ONLINE),this.flockService.getFlockMode()&&this.flockService.setTabFocused(!0)))}),window&&(window.addEventListener("focus",()=>{this.authService.getUser()&&(this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_ONLINE),this.flockService.getFlockMode()&&this.flockService.setWindowFocused(!0))}),window.addEventListener("blur",()=>{this.authService.getUser()&&(document.visibilityState!=="hidden"&&this.setCurrentPresenceUserStatus(p.PRESENCE_STATUS_AWAY,{isTabAway:!0}),this.flockService.getFlockMode()&&this.flockService.setWindowFocused(!1))}))}catch(e){this.loggingService.catch("Error in updateOnDocumentFocusChange:",e)}}updateOnAllowedFeatureListChange(){try{this.configService.getConfig$().subscribe(e=>{if(e&&e.featureAllowList?.length){let t=this.presenceUser$.value,i=!1;if(e.featureAllowList.includes(X.PRESENCE)?t?.onlineStatus!==p.PRESENCE_STATUS_ONLINE&&(t.onlineStatus=p.PRESENCE_STATUS_ONLINE,i=!0):t?.onlineStatus!==p.PRESENCE_STATUS_OFFLINE&&(t.onlineStatus=p.PRESENCE_STATUS_OFFLINE,i=!0),i&&this.authService.getUser()&&this.documentPaths?.presence&&t&&t.userId&&!t.isAnonymous){let a=JSON.parse(JSON.stringify(t));this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:t.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(a))})}}})}catch(e){this.loggingService.catch("Error in updateOnAllowedFeatureListChange:",e)}}updateOnDatabaseDisconnect(){return this.loggingService.log("%c[WB] Calling FUNCTION: updateOnDatabaseDisconnect","color: green;"),this.authService.getAuthState$().pipe(Y(e=>!!e),W(e=>this.docService.getDocumentPaths$().pipe(L(t=>e))),H(e=>oe(this,null,function*(){try{if(this.documentPaths?.presence&&e){let t=yield this.authService.getIdTokenResultForUser(e,!0).catch(a=>null);if(!t)return;let{user:i}=t.claims;if(!i?.isAnonymous&&this.documentPaths?.presence){this.flockService.isInSession()&&this.flockService.removeCurrentUserFromSession();let a=`${this.documentPaths.presence}/${e.uid}`;this.commonDbService.setupOnDisconnect(a,{onlineStatus:p.PRESENCE_STATUS_OFFLINE,timestamp:this.timestamp}).catch(h=>{this.loggingService.catch("Error in updateOnDatabaseDisconnect:",h)})}}}catch(t){this.loggingService.catch("Error in updateOnDatabaseDisconnect:",t)}})))}setPresenceUser(e){this.loggingService.log("%c[WB] Calling FUNCTION: setPresenceUser","color: green;");try{let t=this.presenceUser$.value;t.userId=e?.userId,t.name=e?.name,t.email=e?.email,t.photoUrl=e?.photoUrl,t.userSnippylyId=e?.userSnippylyId,t.color=e?.color,t.textColor=e?.textColor,t.initial=e?.initial,t.timestamp=this.timestamp,t.type=e?.type,t.isReadOnly=e?.isReadOnly,t.isAnonymous=e?.isAnonymous;let i=e?.name?.split(" ");if(i&&i.length>0){let a=i[0],h=i.length>1?i[i.length-1]:null,y=h?h[0]:null;a&&(t.name=`${a} ${y?y+".":""}`)}this.updateCurrentPresenceUser(t)}catch(t){this.loggingService.catch("Error in setPresenceUser:",t)}}signOutUser(e){return new Promise((t,i)=>{try{this.documentPaths?.presence&&e?this.commonDbService.getData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.uid,skipFirestore:!0}}).then(a=>{a&&(this.flockService.isInSession()&&this.flockService.removeCurrentUserFromSession(),this.commonDbService.updateData({feature:"presence",errorCallback:h=>{i(h)},callback:()=>{t(null)},properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.uid,skipFirestore:!0},data:JSON.parse(JSON.stringify(w(C({},a?.data??{}),{timestamp:this.timestamp,onlineStatus:p.PRESENCE_STATUS_OFFLINE})))})),t(null)}).catch(a=>{this.loggingService.catch("Error in signOutUser subscription: ",a),i(a)}):t(null)}catch(a){this.loggingService.catch("Error in signOutUser:",a),i(a)}})}setInactivityTime(e){try{this.inactivityTime=e,this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_SET_CUSTOM_INACTIVITY_TIMER,{inactivityTime:this.inactivityTime}),this.detectUserIdleState()}catch(t){this.loggingService.catch("Error in setInactivityTime: ",t)}}getInactivityTime(){return this.inactivityTime}setOfflineInactivityTime(e){try{e>=this.inactivityTime?(this.offlineInactivityTime=e,this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_SET_CUSTOM_OFFLINE_INACTIVITY_TIMER,{offlineInactivityTime:this.offlineInactivityTime}),this.detectUserOfflineState()):this.loggingService.catch("Error in setOfflineInactivityTime: ","offline-inactivity-time value is less than inactivity-time.")}catch(t){this.loggingService.catch("Error in setOfflineInactivityTime: ",t)}}getOfflineInactivityTime(){return this.offlineInactivityTime}getPresenceUsers$(){return this.presenceUsers$.asObservable()}getPresenceUsers(){return this.presenceUsers$.value}get timestamp(){return this.commonDbService.getServerTimestamp()}addCustomUser(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: addCustomUser","color: green;");let t=e?.user,i=e?.localOnly??!1;if(!t?.userId){this.loggingService.catch("Error in addCustomUser: ","userId is required");return}let a=this.buildCustomPresenceUser(t,i);if(!a)return;if(i){let h=this.customPresenceUsers$.value,y=h.findIndex(M=>M.userId===t.userId);if(y>=0){let M=[...h];M[y]=a,this.customPresenceUsers$.next(M)}else this.customPresenceUsers$.next([...h,a])}else this.persistCustomUserToDb(a)}catch(t){this.loggingService.catch("Error in addCustomUser: ",t)}}removeCustomUser(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: removeCustomUser","color: green;");let t=e?.user?.userId,i=e?.localOnly??!1;if(!t){this.loggingService.catch("Error in removeCustomUser: ","userId is required");return}if(i){let a=this.customPresenceUsers$.value,h=a.filter(y=>y.userId!==t);h.length!==a.length&&this.customPresenceUsers$.next(h)}else{let a=this.buildCustomPresenceUser(e.user,!1);a&&this.removeCustomUserFromDb(a)}}catch(t){this.loggingService.catch("Error in removeCustomUser: ",t)}}mergeWithCustomUsers(e){try{let t=this.customPresenceUsers$.value;if(t.length===0)return e;let i=new Set(e.map(h=>h.userId)),a=t.filter(h=>!i.has(h.userId));return[...e,...a]}catch(t){return this.loggingService.catch("Error in mergeWithCustomUsers: ",t),e}}buildCustomPresenceUser(e,t=!1){try{let i=this.configService.getApiKey(),a=new it;return a.userId=e.userId,a.name=e.name||e.userId,a.email=e.email||"",a.photoUrl=e.photoUrl||"",a.onlineStatus=e.onlineStatus||p.PRESENCE_STATUS_ONLINE,a.color=e.color||this.avatarService.generateUserColor(),a.textColor=e.textColor||"",a.type="custom",a.initial=e.initial||(a.name?a.name.charAt(0).toUpperCase():"U"),a.timestamp=Date.now(),a.isReadOnly=e.isReadOnly??!1,a.isAnonymous=e.isAnonymous??!1,a.location=e.location||null,a.locationId=e.locationId??null,a.pageInfo=e.pageInfo||new rt,a.isTabAway=!1,a.isUserIdle=!1,a.userSnippylyId=e.userSnippylyId||(i?kt(i,e.userId):`custom_${e.userId}`),a.localOnly=t,a}catch(i){return this.loggingService.catch("Error in buildCustomPresenceUser: ",i),null}}persistCustomUserToDb(e){try{if(this.documentPaths?.presence&&e?.userId&&this.authService.isFeatureAllowed(X.PRESENCE)){let t=JSON.parse(JSON.stringify(e));delete t.localOnly,this.commonDbService.updateData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(w(C({},t),{timestamp:this.timestamp})))})}}catch(t){this.loggingService.catch("Error in persistCustomUserToDb: ",t)}}removeCustomUserFromDb(e){try{this.documentPaths?.presence&&e?.userId&&this.authService.isFeatureAllowed(X.PRESENCE)&&this.commonDbService.deleteData({feature:"presence",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,userId:e.userSnippylyId,skipFirestore:!0}})}catch(t){this.loggingService.catch("Error in removeCustomUserFromDb: ",t)}}};r.\u0275fac=function(t){return new(t||r)(P(ge),P($t),P(je),P($e),P(bt),P(Gt),P(jt),P(Mt),P(Lt),P(v),P(K),P(zt),P(Wt))},r.\u0275prov=ae({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var ie=class{constructor(){this.filteredPresenceUsers=[],this.shadowDom=!0,this.maxUsers=5,this.showTooltip=()=>{},this.closeTooltip=()=>{},this.onPresenceUserClick=()=>{}}};var V=class{constructor(){this.shadowDom=!0,this.calculateUserAwayTime=()=>{}}};var Kt=n=>({componentConfigSignal:n}),un=(n,r)=>({condition:n,data:r}),hn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-avatar-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function fn(n,r){if(n&1&&(d(0),R(1,"snippyly-user-avatar",3),u()),n&2){let o=s(2).ngIf,e=s();l(),Re("away",o.presenceUser.onlineStatus===e.constants.PRESENCE_STATUS_AWAY)("velt-presence-avatar--away",o.presenceUser.onlineStatus===e.constants.PRESENCE_STATUS_AWAY),c("user",o.presenceUser)}}function Sn(n,r){if(n&1&&(d(0),g(1,fn,2,5,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,hn,e.template,_(1,Kt,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Cn(n,r){if(n&1&&(d(0),g(1,Sn,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,un,o.conditionSignal(),_(1,Kt,o.componentConfigSignal)))}}var fe=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-avatar",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipAvatarComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipAvatarComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipAvatarComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipAvatarComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-avatar-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-avatar","s-presence-avatar",3,"user"]],template:function(t,i){t&1&&g(0,Cn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,re],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-presence-avatar[_ngcontent-%COMP%]{position:relative;border-radius:var(--velt-border-radius-full);z-index:2;width:calc((1.5 + 0px) * var(--velt-base-rem-unit));height:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;align-items:center;justify-content:center}.velt-presence-avatar--away[_ngcontent-%COMP%]{filter:grayscale(.7)}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem}"],changeDetection:0});let n=r;return n})();var Zt=n=>({componentConfigSignal:n}),yn=(n,r)=>({condition:n,data:r}),In=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-active-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function bn(n,r){n&1&&(d(0),T(1,"p"),se(2),ce(3,"translate"),O(),u()),n&2&&(l(2),Me(le(3,1,"User online")))}function En(n,r){if(n&1&&(d(0),g(1,bn,4,3,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,In,e.template,_(1,Zt,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Pn(n,r){if(n&1&&(d(0),g(1,En,2,9,"ng-container",0),u()),n&2){let o=s().ngIf,e=s();l(),c("ngIf",(o.presenceUser==null?null:o.presenceUser.onlineStatus)===e.constants.PRESENCE_STATUS_ONLINE)}}function xn(n,r){if(n&1&&(d(0),g(1,Pn,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,yn,o.conditionSignal(),_(1,Zt,o.componentConfigSignal)))}}var Se=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-user-active",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipUserActiveComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-user-active-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,i){t&1&&g(0,xn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,ve],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}p[_ngcontent-%COMP%]{margin:0;color:var(--velt-green);font-weight:400;font-size:var(--velt-font-size-xs);line-height:1}"],changeDetection:0});let n=r;return n})();var qt=n=>({componentConfigSignal:n}),Tn=(n,r)=>({condition:n,data:r}),On=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-inactive-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function kn(n,r){if(n&1&&(d(0),T(1,"p",3),se(2),ce(3,"translate"),O(),u()),n&2){let o=s(3).ngIf;l(2),ht(" ",o.calculateUserAwayTime(o.presenceUser).toString()+" "+le(3,1,"mins ago.")," ")}}function Dn(n,r){if(n&1&&(d(0),g(1,kn,4,3,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,On,e.template,_(1,qt,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function An(n,r){if(n&1&&(d(0),g(1,Dn,2,9,"ng-container",0),u()),n&2){let o=s().ngIf,e=s();l(),c("ngIf",(o.presenceUser==null?null:o.presenceUser.onlineStatus)===e.constants.PRESENCE_STATUS_AWAY)}}function Nn(n,r){if(n&1&&(d(0),g(1,An,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,Tn,o.conditionSignal(),_(1,qt,o.componentConfigSignal)))}}var Ce=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-user-inactive",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipUserInactiveComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-user-inactive-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-tooltip-user-inactive-text","inactive-text"]],template:function(t,i){t&1&&g(0,Nn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,ve],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}p[_ngcontent-%COMP%]{margin:0;color:var(--velt-green);font-weight:400;font-size:var(--velt-font-size-xs);line-height:1}.velt-presence-tooltip-user-inactive-text[_ngcontent-%COMP%]{color:var(--velt-text-4)}"],changeDetection:0});let n=r;return n})();var en=n=>({componentConfigSignal:n}),Fn=(n,r)=>({condition:n,data:r}),Rn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-name-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Mn(n,r){if(n&1&&(d(0),T(1,"h1"),se(2),ce(3,"translate"),O(),u()),n&2){let o=s(3).ngIf;l(2),Me(o.presenceUser!=null&&o.presenceUser.name?o.presenceUser==null?null:o.presenceUser.name:le(3,1,o.presenceUser==null?null:o.presenceUser.email))}}function Ln(n,r){n&1&&R(0,"velt-skeleton-loader-internal",5)}function jn(n,r){if(n&1&&(d(0),g(1,Mn,4,3,"ng-container",4)(2,Ln,1,0,"ng-template",null,0,ne),u()),n&2){let o=te(3),e=s(2).ngIf;l(),c("ngIf",(e.presenceUser==null?null:e.presenceUser.name)||(e.presenceUser==null?null:e.presenceUser.email))("ngIfElse",o)}}function $n(n,r){if(n&1&&(d(0),g(1,jn,4,2,"ng-container",3),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Rn,e.template,_(1,en,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Bn(n,r){if(n&1&&(d(0),g(1,$n,2,9,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(3,Fn,o.conditionSignal(),_(1,en,o.componentConfigSignal)))}}var _e=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-user-name";try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipUserNameComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserNameComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipUserNameComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipUserNameComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-user-name-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[["loadingTemplateRef",""],[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngIf","ngIfElse"],["height","16px","width","80px","borderRadius","20px"]],template:function(t,i){t&1&&g(0,Bn,2,6,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,Je,ve],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}h1[_ngcontent-%COMP%]{margin:0;color:var(--velt-text-0);font-size:var(--velt-font-size-sm);line-height:calc((1rem + 0px) * var(--velt-base-rem-unit));font-weight:400}"],changeDetection:0});let n=r;return n})();var tn=n=>({componentConfigSignal:n}),zn=(n,r)=>({condition:n,data:r}),Jn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-status-container-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Gn(n,r){if(n&1&&(d(0),T(1,"div",3),R(2,"velt-presence-tooltip-user-name-internal",4)(3,"velt-presence-tooltip-user-active-internal",4)(4,"velt-presence-tooltip-user-inactive-internal",4),O(),u()),n&2){let o=s(3);l(2),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal)}}function Vn(n,r){if(n&1&&(d(0),g(1,Gn,5,3,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Jn,e.template,_(1,tn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Yn(n,r){if(n&1&&(d(0),g(1,Vn,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,zn,o.conditionSignal(),_(1,tn,o.componentConfigSignal)))}}var ye=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-tooltip-status-container",this.constants=p;try{super.initializeComponentConfigSignal(new V)}catch(a){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceTooltipStatusContainerComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip-status-container-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-tooltip-status-container","user-status-container"],[3,"componentConfigSignal"]],template:function(t,i){t&1&&g(0,Yn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,Se,Ce,_e],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-presence-tooltip-status-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;z-index:2;gap:var(--velt-spacing-xs)}"],changeDetection:0});let n=r;return n})();var nn=(n,r)=>({componentConfigSignal:n,presenceUser:r}),Qn=(n,r)=>({condition:n,data:r}),Zn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function qn(n,r){n&1&&Fe(0)}function er(n,r){if(n&1&&(T(0,"velt-shadow-dom-internal"),g(1,qn,1,0,"ng-container",4),O()),n&2){s();let o=te(3);l(),c("ngTemplateOutlet",o)}}function tr(n,r){if(n&1&&(d(0),T(1,"div",8),R(2,"velt-presence-tooltip-avatar-internal",9)(3,"velt-presence-tooltip-status-container-internal",9),O(),u()),n&2){let o=s(5);l(2),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal)}}function nr(n,r){if(n&1&&(T(0,"div",6),g(1,tr,4,2,"ng-container",7),O()),n&2){let o=s(3).ngIf,e=s();l(),c("veltDynamicTemplate",k(4,Zn,e.template,b(1,nn,e.componentConfigSignal,e.presenceUser),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function rr(n,r){if(n&1&&g(0,nr,2,10,"div",5),n&2){let o=s(2).ngIf;c("ngIf",o==null?null:o.presenceUser)}}function ir(n,r){if(n&1&&(d(0),g(1,er,2,1,"velt-shadow-dom-internal",3)(2,rr,1,1,"ng-template",null,0,ne),u()),n&2){let o=te(3),e=s().ngIf,t=s();l(),c("ngIf",e.shadowDom&&!t.template||t.template&&t.isExplicitShadowDom)("ngIfElse",o)}}function or(n,r){if(n&1&&(d(0),g(1,ir,4,2,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(4,Qn,o.conditionSignal(),b(1,nn,o.componentConfigSignal,o.presenceUser)))}}var Ie=(()=>{let r=class r extends ze{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,t,i,a,h){super(e,t,void 0,void 0,void 0,i,a),this.elementRef=e,this.themeService=t,this.dynamicDataService=i,this.loggingService=a,this.wireframeService=h,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.constants=p,this.subscriptions=[],this.componentId="velt-presence-tooltip",this.componentConfigSignal=Ne({presenceUser:null,shadowDom:!0,calculateUserAwayTime:this.calculateUserAwayTime.bind(this)}),this.loggingService.log("%c[WB] Creating CLASS: PresenceTooltipComponent","color: blue;")}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");try{let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes(),this.dynamicDataService.applyConditionalClasses(this.elementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,presenceUser:this.presenceUser}),this.subscriptions.push(this.wireframeService.getWireframe$("velt-presence-tooltip-wireframe").subscribe(a=>{if(a){let h=document.createElement(a.tagName);h.innerHTML=a.innerHTML,this.template=h}}))}catch(e){this.loggingService.catch("Error in PresenceComponent oninit: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(i=>(i=w(C({},i),{[t]:e[t].currentValue}),i))})}catch(t){this.loggingService.catch("Error in PresenceTooltipComponent ngOnChanges: ",t)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in PresenceTooltipComponent unsubscribe: ",e)}}calculateUserAwayTime(e){try{if(e.onlineStatus===p.PRESENCE_STATUS_ONLINE)return 0;let t=me(e.timestamp);return Math.floor(t/1e3/60)}catch(t){this.loggingService.catch("Error in PresenceTooltipComponent calculateUserAwayTime: ",t)}return 0}};r.\u0275fac=function(t){return new(t||r)(m(I),m(We),m(f),m(v),m(Be))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-tooltip"]],inputs:{presenceUser:"presenceUser",shadowDom:"shadowDom",variant:"variant"},standalone:!1,features:[U,we],decls:1,vars:1,consts:[["presenceTooltipRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-presence-tooltip-container",4,"ngIf"],[1,"velt-presence-tooltip-container"],[4,"veltDynamicTemplate"],[1,"velt-presence-tooltip","s-tooltiptext","s-presence-tooltip"],[3,"componentConfigSignal"]],template:function(t,i){t&1&&g(0,or,2,7,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,Le,N,A,fe,ye],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);margin:calc((.5rem + 0px) * var(--velt-base-rem-unit))}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-presence-tooltip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:calc((.5rem + 0px) * var(--velt-base-rem-unit));block-size:auto;width:max-content;background-color:var(--velt-background-0);border:1px solid var(--velt-border-5);color:var(--velt-text-0);text-align:left;padding:var(--velt-spacing-xs) var(--velt-spacing-sm);border-radius:var(--velt-border-radius-xs);font-style:normal;font-weight:400;font-size:var(--velt-font-size-xs);line-height:2em;z-index:1;transition:opacity .5s}.velt-presence-tooltip[_ngcontent-%COMP%]:after{background-color:var(--velt-background-0);border-color:var(--velt-border-5)}"],changeDetection:0});let n=r;return n})();var sr=["tooltipContent"],rn=(n,r,o)=>({componentConfigSignal:n,presenceUser:r,index:o}),cr=(n,r)=>({condition:n,data:r}),lr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-list-item-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function mr(n,r){if(n&1){let o=qe();d(0),T(1,"snippyly-user-avatar",6),et("click",function(){De(o);let t=s(3).ngIf,i=s();return Ae(t.onPresenceUserClick(i.presenceUser))}),R(2,"div",7),O(),u()}if(n&2){let o=s(4);l(),Re("away",o.presenceUser.onlineStatus===o.constants.PRESENCE_STATUS_AWAY)("velt-presence-avatar--away",o.presenceUser.onlineStatus===o.constants.PRESENCE_STATUS_AWAY),c("user",o.presenceUser),l(),ut("border-color",o.presenceUser.color)}}function gr(n,r){if(n&1){let o=qe();T(0,"div",4),et("pointerenter",function(t){De(o);let i=s(2).ngIf,a=s();return i.showTooltip(t,a.presenceUser),Ae(t.stopPropagation())})("pointerleave",function(t){return De(o),s(2).ngIf.closeTooltip(),Ae(t.stopPropagation())}),g(1,mr,3,7,"ng-container",5),O()}if(n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(5,lr,e.template,tt(1,rn,e.componentConfigSignal,e.presenceUser,e.index),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function vr(n,r){if(n&1&&R(0,"velt-presence-tooltip",8),n&2){let o=r.$implicit,e=s(2).ngIf;c("presenceUser",o)("shadowDom",e.shadowDom)}}function pr(n,r){if(n&1&&(d(0),g(1,gr,2,11,"div",3)(2,vr,1,2,"ng-template",null,0,ne),u()),n&2){let o=s().ngIf,e=s();l(),c("ngIf",e.index<o.maxUsers)}}function dr(n,r){if(n&1&&(d(0),g(1,pr,4,1,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(5,cr,o.conditionSignal(),tt(1,rn,o.componentConfigSignal,o.presenceUser,o.index)))}}var be=(()=>{let r=class r extends ${get itemTemplate(){return this._itemTemplate}set itemTemplate(e){try{this._itemTemplate=e,this.itemTemplate?this.template=this.domService.deepCloneElement(this.itemTemplate):this.template=null}catch{}}constructor(e,t,i,a){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.domService=a,this.componentId="velt-presence-avatar-list-item",this.constants=p;try{super.initializeComponentConfigSignal(new ie)}catch(h){this.loggingService.catch("Error in PresenceAvatarListItemComponent constructor: ",h)}}ngOnInit(){try{this.dynamicDataService.applyConditionalClasses(this.elementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,presenceUser:this.presenceUser,index:this.index}),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent ngOnInit: ",e)}}ngAfterViewInit(){try{setTimeout(()=>{this.componentConfigSignal.set(w(C({},this.componentConfigSignal()),{tooltipContent:this.tooltipContent}))},1e3)}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent ngAfterViewInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceAvatarListItemComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v),m(je))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-avatar-list-item-internal"]],viewQuery:function(t,i){if(t&1&&vt(sr,5),t&2){let a;pt(a=dt())&&(i.tooltipContent=a.first)}},inputs:{presenceUser:"presenceUser",index:"index",itemTemplate:"itemTemplate"},standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[["tooltipContent",""],[4,"ngIf"],[4,"veltIf"],["class","velt-presence-avatar-list-item velt-tooltip s-presence-avatar-container s-tooltip",3,"pointerenter","pointerleave",4,"ngIf"],[1,"velt-presence-avatar-list-item","velt-tooltip","s-presence-avatar-container","s-tooltip",3,"pointerenter","pointerleave"],[4,"veltDynamicTemplate"],[1,"velt-presence-avatar","s-presence-avatar",3,"click","user"],[1,"velt-presence-avatar-outline","avatar-outline"],[3,"presenceUser","shadowDom"]],template:function(t,i){t&1&&g(0,dr,2,8,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,re,Ie],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-presence-avatar-list-item[_ngcontent-%COMP%]{height:calc((1.5 + 0px) * var(--velt-base-rem-unit));width:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;justify-content:center;align-items:center;cursor:pointer}.velt-presence-avatar-list-item[_ngcontent-%COMP%] .velt-presence-avatar[_ngcontent-%COMP%]{position:relative;border-radius:var(--velt-border-radius-full);z-index:2;width:calc((1.5 + 0px) * var(--velt-base-rem-unit));height:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;align-items:center;justify-content:center}.velt-presence-avatar--away[_ngcontent-%COMP%]{filter:grayscale(.7)}.velt-presence-avatar-outline[_ngcontent-%COMP%]{position:absolute;inset:-1px;border:1px solid transparent;border-radius:var(--velt-border-radius-full)}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem}"],changeDetection:0});let n=r;return n})();var on=n=>({componentConfigSignal:n}),hr=(n,r)=>({condition:n,data:r}),fr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-list-wireframe",variant:o,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function Sr(n,r){if(n&1&&(d(0),R(1,"velt-presence-avatar-list-item-internal",4),u()),n&2){let o=r.$implicit,e=r.index,t=s(4);l(),c("presenceUser",o)("index",e)("componentConfigSignal",t.componentConfigSignal)("itemTemplate",t.itemTemplate)}}function Cr(n,r){if(n&1&&(d(0),g(1,Sr,2,4,"ng-container",3),u()),n&2){let o=s(2).ngIf;l(),c("ngForOf",o.filteredPresenceUsers)("ngForTrackBy",o.trackById)}}function _r(n,r){if(n&1&&(d(0),g(1,Cr,2,2,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,fr,e.template,_(1,on,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function yr(n,r){if(n&1&&(d(0),g(1,_r,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,hr,o.conditionSignal(),_(1,on,o.componentConfigSignal)))}}var Ee=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-avatar-list",this.constants=p;try{super.initializeComponentConfigSignal(new ie)}catch(a){this.loggingService.catch("Error in PresenceAvatarListComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes();let e=this.template?.querySelector("velt-presence-avatar-list-item-wireframe");Dt(e)||(this.itemTemplate=e)}catch(e){this.loggingService.catch("Error in PresenceAvatarListComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceAvatarListComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceAvatarListComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-avatar-list-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"presenceUser","index","componentConfigSignal","itemTemplate"]],template:function(t,i){t&1&&g(0,yr,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[ft,D,N,A,be],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:calc((1.5 + 0px) * var(--velt-base-rem-unit));min-width:calc((1.5 + 0px) * var(--velt-base-rem-unit))}[_nghost-%COMP%]:empty{display:none}velt-presence-avatar-list-item-internal[_ngcontent-%COMP%]:not(:first-child){margin-left:calc(var(--velt-spacing-xs) * -1)}"],changeDetection:0});let n=r;return n})();var an=n=>({componentConfigSignal:n}),br=(n,r)=>({condition:n,data:r}),Er=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-remaining-count-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Pr(n,r){if(n&1&&(d(0),T(1,"snippyly-user-avatar",3),R(2,"div",4),O(),u()),n&2){let o=s(3).ngIf;l(),c("initial","+"+(o.filteredPresenceUsers.length-o.maxUsers).toString())}}function xr(n,r){if(n&1&&(d(0),g(1,Pr,3,1,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Er,e.template,_(1,an,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ur(n,r){if(n&1&&(d(0),g(1,xr,2,9,"ng-container",0),u()),n&2){let o=s().ngIf;l(),c("ngIf",o.filteredPresenceUsers.length>o.maxUsers)}}function Tr(n,r){if(n&1&&(d(0),g(1,Ur,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,br,o.conditionSignal(),_(1,an,o.componentConfigSignal)))}}var Pe=(()=>{let r=class r extends ${constructor(e,t,i){super(e,t,i),this.elementRef=e,this.dynamicDataService=t,this.loggingService=i,this.componentId="velt-presence-avatar-remaining-count";try{super.initializeComponentConfigSignal(new ie)}catch(a){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent constructor: ",a)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent ngOnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceAvatarRemainingCountComponent setupA11yAttributes:",e)}}};r.\u0275fac=function(t){return new(t||r)(m(I),m(f),m(v))},r.\u0275cmp=x({type:r,selectors:[["velt-presence-avatar-remaining-count-internal"]],standalone:!1,features:[j([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-presence-avatar","velt-presence-avatar-remaining-count","s-presence-avatar","more-users",3,"initial"],[1,"velt-presence-avatar-remaining-count-outline","avatar-outline"]],template:function(t,i){t&1&&g(0,Tr,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,re],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]:empty{display:none}.velt-presence-avatar[_ngcontent-%COMP%]{position:relative;border-radius:var(--velt-border-radius-full);z-index:2;width:calc((1.5 + 0px) * var(--velt-base-rem-unit));height:calc((1.5 + 0px) * var(--velt-base-rem-unit));display:flex;align-items:center;justify-content:center}.velt-presence-avatar.velt-presence-avatar-remaining-count[_ngcontent-%COMP%]{box-shadow:none;color:var(--velt-text-0);margin-left:calc(var(--velt-spacing-xs) * -1);background-color:var(--legacy-velt-presence-more-users-color)}.velt-presence-avatar.velt-presence-avatar-remaining-count[_ngcontent-%COMP%] .velt-presence-avatar-remaining-count-outline[_ngcontent-%COMP%]{border-color:var(--legacy-velt-presence-more-users-color)}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.5rem}"],changeDetection:0});let n=r;return n})();var sn=n=>({componentConfigSignal:n}),kr=(n,r)=>({condition:n,data:r}),Dr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Ar(n,r){n&1&&Fe(0)}function Nr(n,r){if(n&1&&(T(0,"velt-shadow-dom-internal"),g(1,Ar,1,0,"ng-container",4),O()),n&2){s();let o=te(3);l(),c("ngTemplateOutlet",o)}}function wr(n,r){if(n&1&&(d(0),R(1,"velt-presence-avatar-list-internal",8)(2,"velt-presence-avatar-remaining-count-internal",8),u()),n&2){let o=s(5);l(),c("componentConfigSignal",o.componentConfigSignal),l(),c("componentConfigSignal",o.componentConfigSignal)}}function Fr(n,r){if(n&1&&(T(0,"div",6),g(1,wr,3,2,"ng-container",7),O()),n&2){let o=s(3).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Dr,e.template,_(1,sn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Rr(n,r){if(n&1&&g(0,Fr,2,9,"div",5),n&2){let o=s(2).ngIf;c("ngIf",o.filteredPresenceUsers&&o.filteredPresenceUsers.length>0&&!(o.user!=null&&o.user.isAnonymous))}}function Mr(n,r){if(n&1&&(d(0),g(1,Nr,2,1,"velt-shadow-dom-internal",3)(2,Rr,1,1,"ng-template",null,0,ne),u()),n&2){let o=te(3),e=s().ngIf,t=s();l(),c("ngIf",e.shadowDom&&!t.template||t.template&&t.isExplicitShadowDom)("ngIfElse",o)}}function Lr(n,r){if(n&1&&(d(0),g(1,Mr,4,2,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(3,kr,o.conditionSignal(),_(1,sn,o.componentConfigSignal)))}}var pe=(()=>{let r=class r extends ze{get maxUsers(){return this._maxUsers}set maxUsers(e){try{isNaN(e)?this.loggingService.catch("Error in Presence set maxUsers: ","max-user value is not a number."):this._maxUsers=e}catch(t){this.loggingService.catch("Error in Presence set maxUsers: ",t)}}get inactivityTime(){return this._inactivityTime}set inactivityTime(e){try{isNaN(e)?this.loggingService.catch("Error in Presence set inactivityTime: ","inactivity-time value is not a number."):(this._inactivityTime=e,this.presenceService.setInactivityTime(this._inactivityTime))}catch(t){this.loggingService.catch("Error in Presence set inactivityTime: ",t)}}get offlineInactivityTime(){return this._offlineInactivityTime}set offlineInactivityTime(e){try{isNaN(e)?this.loggingService.catch("Error in Presence set offlineInactivityTime: ","offline-inactivity-time value is not a number."):(this._offlineInactivityTime=e,this.presenceService.setOfflineInactivityTime(this._offlineInactivityTime))}catch(t){this.loggingService.catch("Error in Presence set offlineInactivityTime: ",t)}}get flockMode(){return this._flockMode}set flockMode(e){try{let t=typeof e=="string"?JSON.parse(e):e;t?(this._flockMode=t,this.flockService.enableFlockMode(),this.flockService.setNavigateEmitter(this.onNavigate)):(this._flockMode=t,this.flockService.disableFlockMode())}catch(t){this.loggingService.catch("Error in Presence set flockMode: ",t)}}set disableFlockNavigation(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.flockService.setDisableFlockNavigation(t)}catch(t){this.loggingService.catch("Error in Presence set disableFlockNavigation: ",t)}}set defaultFlockNavigation(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.flockService.setDisableFlockNavigation(!t)}catch(t){this.loggingService.catch("Error in Presence set defaultFlockNavigation: ",t)}}get location(){return this._location}set location(e){try{if(e&&typeof e=="string"){let t=JSON.parse(e);this._location=t,this.serverLocationId=Ot(this.location)}}catch(t){this.loggingService.catch("Error in Presence set location: ",t)}}set self(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),t?this.presenceService.enableIncludeSelf():this.presenceService.disableIncludeSelf()}catch{}}set _shadowDom(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.isExplicitShadowDom=!!t,this.componentConfigSignal.update(i=>(i=w(C({},i),{shadowDom:t}),i))}catch{}}constructor(e,t,i,a,h,y,M,Ve,Ye,Ue,Te,Oe){super(Ue,Te,void 0,void 0,void 0,Oe,h),this.analyticsService=e,this.authService=t,this.flockService=i,this.presenceService=a,this.loggingService=h,this.wireframeService=y,this.overlay=M,this.overlayPositionBuilder=Ve,this.viewContainerRef=Ye,this.elementRef=Ue,this.themeService=Te,this.dynamicDataService=Oe,this.DEFAULT_MAX_USERS=5,this._maxUsers=this.DEFAULT_MAX_USERS,this._inactivityTime=5,this._offlineInactivityTime=10,this._flockMode=!1,this.onNavigate=new he,this.isExplicitShadowDom=!1,this.onPresenceUserClickEmitter=new he,this.presenceUsers=[],this.subscriptions=[],this.constants=p,this.onUsersChanged=new he,this.onPresenceUserChange=new he,this.componentConfigSignal=Ne({filteredPresenceUsers:[],user:null,shadowDom:!0,maxUsers:5,tooltipContent:null,trackById:this.trackById.bind(this),showTooltip:this.showTooltip.bind(this),closeTooltip:this.closeTooltip.bind(this),onPresenceUserClick:this.onPresenceUserClick.bind(this)}),this.veltElement=!0,this.componentId="velt-presence",this.loggingService.log("%c[WB] Creating CLASS: PresenceComponent","color: blue;"),this.subscriptions.push(this.authService.getUser$().subscribe(de=>{this.componentConfigSignal.update(S=>(S=w(C({},S),{user:de}),S)),this.componentConfigSignal().user&&(this.setPresenceInstalledInAnalytics(),this.presenceSetCustomMaxUsersInAnalytics())},de=>{this.loggingService.catch("Error in PresenceComponent getUser$ subscription: ",de)}))}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");try{this.getOnlineUsersOnCurrentDocument(),this.setupA11yAttributes(),super.ngOnInit(),this.subscriptions.push(this.wireframeService.getWireframe$("velt-presence-wireframe").subscribe(t=>{if(t){let i=document.createElement(t.tagName);i.innerHTML=t.innerHTML,this.template=i}}))}catch(e){this.loggingService.catch("Error in PresenceComponent oninit: ",e)}}ngOnChanges(e){try{this.loggingService.log("%c[WB] Calling PresenceComponent FUNCTION: ngOnChanges","color: green;"),e&&(super.ngOnChanges(e),Object.keys(e).forEach(t=>{this.componentConfigSignal.update(i=>(i=w(C({},i),{[t]:e[t].currentValue}),i))}))}catch(t){this.loggingService.catch("Error in PresenceComponent ngOnChanges: ",t)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in PresenceComponent setupA11yAttributes:",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),super.ngOnDestroy(),this.closeTooltip()}catch(e){this.loggingService.catch("Error in PresenceComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.loggingService.catch("Error in PresenceComponent unsubscribe: ",e)}}showTooltip(e,t){try{this.closeTooltip();let i=new I(e.currentTarget),a=this.overlayPositionBuilder.flexibleConnectedTo(i).withPositions([{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}]);this.overlayRef=this.overlay.create({positionStrategy:a}),this.overlayRef.attach(new Ct(this.componentConfigSignal().tooltipContent,this.viewContainerRef,{$implicit:t}))}catch(i){this.loggingService.catch("Error in PresenceComponent showTooltip: ",i)}}closeTooltip(){try{this.overlayRef&&this.overlayRef.dispose()}catch(e){this.loggingService.catch("Error in PresenceComponent closeTooltip: ",e)}}getOnlineUsersOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getOnlineUsersOnCurrentDocument","color: green;");try{this.subscriptions.push(this.presenceService.getOnlineUsersOnCurrentDocument().pipe(Y(e=>!!e)).subscribe(e=>{this.loggingService.log(e),e&&(this.presenceUsers=e),this.filterPresenceUsers()},e=>{this.loggingService.catch("Error in PresenceComponent getOnlineUsersOnCurrentDocument subscription: ",e)}))}catch(e){this.loggingService.catch("Error in PresenceComponent getOnlineUsersOnCurrentDocument: ",e)}}filterPresenceUsers(){try{let e=[];this.presenceUsers?this.locationId?e=this.presenceUsers.filter(t=>t?.location?.id===this.locationId):this.location?e=this.presenceUsers.filter(t=>t.locationId===this.serverLocationId):e=this.presenceUsers:e=[],this.componentConfigSignal.update(t=>(t=w(C({},t),{filteredPresenceUsers:e}),t)),this.onUsersChanged.emit(this.componentConfigSignal().filteredPresenceUsers),this.onPresenceUserChange.emit(this.componentConfigSignal().filteredPresenceUsers)}catch(e){this.loggingService.catch("Error in PresenceComponent filterPresenceUsers: ",e)}}calculateUserAwayTime(e){try{if(e.onlineStatus===p.PRESENCE_STATUS_ONLINE)return 0;let t=me(e.timestamp);return Math.floor(t/1e3/60)}catch(t){this.loggingService.catch("Error in PresenceComponent calculateUserAwayTime: ",t)}return 0}setPresenceInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(X.PRESENCE)}catch(e){this.loggingService.catch("Error in PresenceComponent setPresenceInstalledInAnalytics: ",e)}}presenceSetCustomMaxUsersInAnalytics(){try{this.maxUsers!=this.DEFAULT_MAX_USERS&&this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_SET_CUSTOM_MAX_USERS,{maxUsers:+this.maxUsers})}catch(e){this.loggingService.catch("Error in PresenceComponent presenceSetCustomMaxUsersInAnalytics: ",e)}}onPresenceUserClick(e){try{this.analyticsService.trackEvent(E.Events.Presence.PRESENCE_USER_CLICKED,{totalUsers:this.presenceService?.getPresenceUsers()?.length,presenceSnippylyUserIds:this.presenceService?.getPresenceUsers()?.map(t=>t.userSnippylyId),presenceClientUserIds:this.presenceService?.getPresenceUsers()?.map(t=>t.userId)}),this.onPresenceUserClickEmitter.emit(e),this.componentConfigSignal().user?.userSnippylyId!==e?.userSnippylyId&&this.flockService.getFlockMode()&&this.setFlockLeader(e.userSnippylyId,e.name)}catch(t){this.loggingService.catch("Error in PresenceComponent onPresenceUserClick: ",t)}}setFlockLeader(e,t){try{this.flockService.setFlockLeader(e,t)}catch(i){this.loggingService.catch("Error in PresenceComponent setFlockLeader: ",i)}}trackById(e,t){return t?.userId}};r.\u0275fac=function(t){return new(t||r)(m(ge),m($e),m(K),m(z),m(v),m(Be),m(yt),m(_t),m(ct),m(I),m(We),m(f))},r.\u0275cmp=x({type:r,selectors:[["app-presence"]],hostVars:1,hostBindings:function(t,i){t&2&>("data-velt-element",i.veltElement)},inputs:{maxUsers:"maxUsers",inactivityTime:"inactivityTime",offlineInactivityTime:"offlineInactivityTime",flockMode:"flockMode",disableFlockNavigation:"disableFlockNavigation",defaultFlockNavigation:"defaultFlockNavigation",location:"location",locationId:"locationId",self:"self",_shadowDom:[0,"shadowDom","_shadowDom"],variant:"variant"},outputs:{onNavigate:"onNavigate",onPresenceUserClickEmitter:"onPresenceUserClick",onUsersChanged:"usersChanged",onPresenceUserChange:"onPresenceUserChange"},standalone:!1,features:[U,we],decls:1,vars:1,consts:[["presenceRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-presence-container s-presence-container",4,"ngIf"],[1,"velt-presence-container","s-presence-container"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"]],template:function(t,i){t&1&&g(0,Lr,2,6,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,Le,N,A,Ee,Pe],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{position:relative;display:inline-flex;justify-content:center;align-items:center;margin:0;padding:0;-webkit-tap-highlight-color:rgba(255,255,255,0);box-sizing:border-box;width:auto;height:calc((1.5 + 0px) * var(--velt-base-rem-unit));font-size:var(--velt-font-size-xs);line-height:1.5;background:transparent}.velt-presence-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:calc((1.5 + 0px) * var(--velt-base-rem-unit));min-width:calc((1.5 + 0px) * var(--velt-base-rem-unit))}"],changeDetection:0});let n=r;return n})();var xe=(()=>{let r=class r{constructor(e,t,i){this.analyticsService=e,this.loggingService=t,this.presenceService=i,this.actionSubjects=new Map,this.subscriptions=[];try{this.presenceService.setPresenceActionsService(this)}catch(a){this.loggingService.catch("Error in PresenceActionsService constructor: ",a)}}onMultipleUsersOnline(e){try{this.loggingService.log("%c[WB] Calling PresenceActionsService FUNCTION: onMultipleUsersOnline","color: green;"),this.triggerAction(nt.MULTIPLE_USERS_ONLINE,e),this.analyticsService.trackEvent(E.Events.Presence.MULTIPLE_USERS_ONLINE,{totalUsers:e?.users?.length,presenceSnippylyUserIds:e?.users?.map(t=>t.userSnippylyId),presenceClientUserIds:e?.users?.map(t=>t.userId)})}catch(t){this.loggingService.catch("Error in PresenceActionsService onMultipleUsersOnline: ",t)}}onUserStateChange(e){try{this.loggingService.log("%c[WB] Calling PresenceActionsService FUNCTION: onUserStateChange","color: green;"),this.triggerAction(nt.USER_STATE_CHANGE,e),this.analyticsService.trackEvent(E.Events.Presence.ON_USER_STATE_CHANGE,{userSnippylyId:e?.user?.userSnippylyId,userId:e?.user?.userId,state:e?.state})}catch(t){this.loggingService.catch("Error in PresenceActionsService onUserStateChange: ",t)}}getData(e){try{return this.loggingService.log("%c[WB] Calling PresenceActionsService FUNCTION: getData","color: green;"),this.presenceService.getOnlineUsersOnCurrentDocument(e).pipe(L(t=>({data:t})))}catch(t){return this.loggingService.catch("Error in PresenceActionsService getData: ",t),F({data:null})}}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new Xe),this.actionSubjects.get(e)?.next(t)}catch(i){this.loggingService.catch("Error in PresenceActionsService triggerAction: ",i)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new Xe),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in PresenceActionsService onAction: ",t),F(null)}}};r.\u0275fac=function(t){return new(t||r)(P(ge),P(v),P(z))},r.\u0275prov=ae({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var Ge=class extends Vt{constructor(r){super(r),this.getService(v).log("%c[WB] Creating CLASS: PresenceElement","color: blue;"),this.getOnlineUsersOnCurrentDocument=this._getOnlineUsersOnCurrentDocument,this.setInactivityTime=this._setInactivityTime,this.enableFlockMode=this._enableFlockMode,this.disableFlockMode=this._disableFlockMode,this.startFollowingUser=this._startFollowingUser,this.stopFollowingUser=this._stopFollowingUser,this.enableSelf=this._enableSelf,this.disableSelf=this._disableSelf,this.getData=this._getData,this.on=this._on,this.addUser=this._addUser,this.removeUser=this._removeUser}_getOnlineUsersOnCurrentDocument(){this.getService(v).log("%c[WB] Calling FUNCTION: getOnlineUsers","color: green;");try{return this.trackEvent(E.Events.Presence.GET_ONLINE_USERS_ON_CURRENT_DOCUMENT_TRIGGERED),this.getService(z).getOnlineUsersOnCurrentDocument()}catch(r){return this.getService(v).catch("Error in _getOnlineUsersOnCurrentDocument: ",r),F(null)}}_setInactivityTime(r){this.getService(v).log("%c[WB] Calling FUNCTION: _setInactivityTime","color: green;");try{this.trackEvent(E.Events.Presence.SET_INACTIVITY_TIME_TRIGGERED,{payload:{time:r}}),isNaN(r)?this.getService(v).catch("Error in setInactivityTime: ","Provided value is not a number."):this.getService(z).setInactivityTime(r)}catch(o){this.getService(v).catch("Error in setInactivityTime: ",o)}}_disableFlockMode(){try{this.trackEvent(E.Events.Presence.DISABLE_FLOCK_MODE_TRIGGERED),this.getService(K).disableFlockMode()}catch(r){this.getService(v).catch("Error in _disableFlockMode: ",r)}}_enableFlockMode(r){try{this.trackEvent(E.Events.Presence.ENABLE_FLOCK_MODE_TRIGGERED,{payload:{options:r}}),this.getService(K).enableFlockMode(r)}catch(o){this.getService(v).catch("Error in _enableFlockMode: ",o)}}_stopFollowingUser(){try{this.trackEvent(E.Events.Presence.STOP_FOLLOWING_USER_TRIGGERED),this.getService(K).stopFollowingUser()}catch(r){this.getService(v).catch("Error in _stopFollowingUser: ",r)}}_startFollowingUser(r){try{this.trackEvent(E.Events.Presence.START_FOLLOWING_USER_TRIGGERED,{payload:{externalId:r}});let o=this.getService(z).getPresenceUserFromExternalId(r);return o&&o.userSnippylyId&&o.name!==void 0?(this.getService(K).startFollowingUser(o.userSnippylyId,o.name),{success:!0,msg:"Joined flock session."}):{success:!1,msg:"User could not be found."}}catch(o){return this.getService(v).catch("Error in _startFollowingUser: ",o),{success:!1,msg:"Unknown error.",raw:o}}}_enableSelf(){try{this.trackEvent(E.Events.Presence.ENABLE_SELF_TRIGGERED),this.getService(z).enableIncludeSelf()}catch(r){this.getService(v).catch("Error in _enableSelf: ",r)}}_disableSelf(){try{this.trackEvent(E.Events.Presence.DISABLE_SELF_TRIGGERED),this.getService(z).disableIncludeSelf()}catch(r){this.getService(v).catch("Error in _disableSelf: ",r)}}_getData(r){this.getService(v).log("%c[WB] Calling FUNCTION: getData","color: green;");try{return this.trackEvent(E.Events.Presence.GET_PRESENCE_DATA_TRIGGERED,{payload:{query:r}}),r&&typeof r=="object"&&(r=C({},r),r?.documentId&&(r.documentId=xt(r.documentId)),r?.organizationId&&(r.organizationId=Ut(r.organizationId))),this.getService(xe).getData(r)}catch(o){return this.getService(v).catch("Error in _getData: ",o),F({data:null})}}_on(r){this.getService(v).log("%c[WB] Calling FUNCTION: on","color: green;");try{return this.getService(xe).onAction(r)}catch(o){return this.getService(v).catch("Error in _on: ",o),F(null)}}_addUser(r){this.getService(v).log("%c[WB] Calling FUNCTION: addUser","color: green;");try{if(this.trackEvent(E.Events.Presence.ADD_USER_TRIGGERED,{payload:{userId:r?.user?.userId,localOnly:r?.localOnly}}),!r?.user?.userId){this.getService(v).catch("Error in addUser: ","userId is required");return}this.getService(z).addCustomUser(r)}catch(o){this.getService(v).catch("Error in addUser: ",o)}}_removeUser(r){this.getService(v).log("%c[WB] Calling FUNCTION: removeUser","color: green;");try{if(this.trackEvent(E.Events.Presence.REMOVE_USER_TRIGGERED,{payload:{userId:r?.user?.userId,localOnly:r?.localOnly}}),!r?.user?.userId){this.getService(v).catch("Error in removeUser: ","userId is required");return}this.getService(z).removeCustomUser(r)}catch(o){this.getService(v).catch("Error in removeUser: ",o)}}};var cn=(()=>{let r=class r{};r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=mt({type:r}),r.\u0275inj=st({imports:[St,re,Je]});let n=r;return n})();var ln=(()=>{let r=class r{constructor(e,t){this.loggingService=e,this.usersService=t}getUserIdsToResolveFromPresenceUsers(e){try{let t=new Set;for(let i of e)i?.userId&&t.add(i?.userId);return Array.from(t)}catch(t){return this.loggingService.catch("Error in PresenceUtilsService getUserIdsToResolveFromPresenceUsers:",t),[]}}mergePresenceUserWithUser(e){try{if(this.usersService.userDataProviderAvailable()&&e?.userId){let t=this.usersService.getUserById(e?.userId);t&&(e=C(C({},e),t))}return e}catch(t){return this.loggingService.catch("Error in PresenceUtilsService mergePresenceUserWithUser:",t),e}}formatPresenceUserData(e){try{if(this.usersService.userDataProviderAvailable()){let t=["userId","onlineStatus","userSnippylyId","color","textColor","timestamp","type","selections","documentParamsId","documentParams","locationId","location","isReadOnly","isAnonymous","pageInfo"];Object.keys(e).forEach(i=>{t.includes(i)||(e[i]=null)})}return e}catch(t){return this.loggingService.catch("Error in PresenceUtilsService formatPresenceUserData:",t),e}}};r.\u0275fac=function(t){return new(t||r)(P(v),P(Bt))},r.\u0275prov=ae({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var jr={"velt-presence-wireframe":pe,"velt-presence-avatar-list-wireframe":Ee,"velt-presence-avatar-list-item-wireframe":be,"velt-presence-avatar-remaining-count-wireframe":Pe,"velt-presence-tooltip-wireframe":Ie,"velt-presence-tooltip-avatar-wireframe":fe,"velt-presence-tooltip-user-active-wireframe":Se,"velt-presence-tooltip-user-inactive-wireframe":Ce,"velt-presence-tooltip-user-name-wireframe":_e,"velt-presence-tooltip-status-container-wireframe":ye};Object.assign(Jt,jr);function $r(n){n.get(v).log("%c[WB] Loading presence feature chunk","color: blue;");let o=n.get(Rt);o.set(Nt,n.get(z)),o.set(wt,n.get(xe)),o.set(Ft,n.get(ln));let t=lt(cn,n).injector;return mn(t,p.TAGS.VELT_PRESENCE,pe),mn(t,p.TAGS.SNIPPYLY_PRESENCE,pe),new Ge(n)}function mn(n,r,o){if(customElements.get(r))return;let e=It(o,n);customElements.define(r,e)}export{$r as default};
|