@veltdev/sdk-staging 5.0.3 → 6.0.0-beta.1

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.
Files changed (69) hide show
  1. package/app/client/snippyly.model.d.ts +0 -18
  2. package/app/{models/data/arrow-annotation.data.model.d.ts → features/arrow/models/arrow-annotation.model.d.ts} +6 -6
  3. package/app/features/user-request/models/user-request.data.model.d.ts +37 -0
  4. package/app/models/data/comment-annotation.data.model.d.ts +7 -0
  5. package/app/models/data/comment-resolver.data.model.d.ts +15 -3
  6. package/app/models/data/resolver.data.model.d.ts +26 -1
  7. package/app/models/data/user-contact-us.data.model.d.ts +1 -1
  8. package/app/models/data/user-feedback.data.model.d.ts +1 -1
  9. package/app/models/data/user-report-bug.data.model.d.ts +1 -1
  10. package/app/models/element/comment-element.model.d.ts +0 -4
  11. package/app/models/element/notification-element.model.d.ts +1 -15
  12. package/app/utils/constants.d.ts +10 -1
  13. package/app/utils/enums.d.ts +32 -2
  14. package/chunk-25GEE4UD.js +1 -0
  15. package/chunk-2HGBJS2C.js +1 -0
  16. package/chunk-2KJNXU43.js +1 -0
  17. package/chunk-447SWJD2.js +1 -0
  18. package/chunk-5B5CQEDX.js +1 -0
  19. package/chunk-5FKOPJVO.js +93 -0
  20. package/chunk-6SOP2T3L.js +1 -0
  21. package/chunk-7W553TUZ.js +7 -0
  22. package/chunk-7ZOGXD6Z.js +2 -0
  23. package/chunk-AOHSD4YE.js +6 -0
  24. package/chunk-APIRNTKO.js +1 -0
  25. package/chunk-AVMLJMVU.js +1 -0
  26. package/chunk-BG6MNCDK.js +1 -0
  27. package/chunk-BLIJMW4Z.js +13 -0
  28. package/chunk-BY627CV6.js +1 -0
  29. package/chunk-DX4SZFHQ.js +1 -0
  30. package/chunk-IXZIBE27.js +1 -0
  31. package/chunk-J6J7I3SW.js +1 -0
  32. package/chunk-JFRM6MNS.js +2 -0
  33. package/chunk-JWLHBAMV.js +167 -0
  34. package/chunk-N4SGYLNB.js +1 -0
  35. package/chunk-Q7BPHHBS.js +2 -0
  36. package/chunk-QE2MK6NF.js +1 -0
  37. package/chunk-SALUJBOS.js +1 -0
  38. package/chunk-TXOYHDVN.js +2 -0
  39. package/chunk-UJMFCXYS.js +2 -0
  40. package/chunk-USRSVPHC.js +1 -0
  41. package/chunk-VFAO7EZK.js +1 -0
  42. package/chunk-WANCOUQO.js +193 -0
  43. package/chunk-XMYVEF74.js +1 -0
  44. package/chunk-Y6QKEGWK.js +1 -0
  45. package/chunk-YBQBSGLX.js +10 -0
  46. package/chunk-ZVY2YW2G.js +1 -0
  47. package/models.d.ts +1 -1
  48. package/package.json +1 -1
  49. package/types.d.ts +0 -1
  50. package/velt-activity-log.js +1 -0
  51. package/velt-area.js +1 -0
  52. package/velt-arrow.js +2 -0
  53. package/velt-comment.js +14 -0
  54. package/velt-crdt.js +1 -0
  55. package/velt-cursor.js +2 -0
  56. package/velt-huddle.js +3 -0
  57. package/velt-live-state-sync.js +2 -0
  58. package/velt-notification.js +1 -0
  59. package/velt-presence.js +1 -0
  60. package/velt-reaction.js +1 -0
  61. package/velt-recorder.js +1 -0
  62. package/velt-rewriter.js +8 -0
  63. package/velt-selection.js +1 -0
  64. package/velt-tag.js +1 -0
  65. package/velt-user-invite.js +2 -0
  66. package/velt-user-request.js +1 -0
  67. package/velt-video-player.js +1 -0
  68. package/velt-views.js +3 -0
  69. package/velt.js +33 -550
@@ -0,0 +1 @@
1
+ import{a as K}from"./chunk-APIRNTKO.js";import"./chunk-JFRM6MNS.js";import{A,B as N,y as Vt}from"./chunk-447SWJD2.js";import{a as Be}from"./chunk-ZVY2YW2G.js";import{b as ve,c as Je,d as re}from"./chunk-UJMFCXYS.js";import{a as Xt}from"./chunk-6SOP2T3L.js";import{a as Yt}from"./chunk-N4SGYLNB.js";import{a as It}from"./chunk-J6J7I3SW.js";import{D as _t,F as yt,da as f,ea as We,fa as B,ga as ze,s as Ct}from"./chunk-AOHSD4YE.js";import{$ as ae,$e as rt,$f as Dt,Ci as Wt,Db as vt,Dd as bt,De as X,E as Y,Eb as pt,Fa as l,Fb as dt,Fc as ft,G as ot,Ga as ue,Gc as D,Gd as Le,Hd as Et,Hi as zt,I as He,Ib as te,Ii as Jt,J as Oe,Jb as ut,Kb as Fe,L as Ke,Lc as Me,M as Qe,Nb as se,Nd as Pt,Ob as Re,Pa as m,Pb as ht,Pc as St,Ph as Rt,Q as at,Qh as Mt,Qi as Gt,Ra as ct,Rf as Ot,Rh as Lt,Sf as kt,T as W,Ta as lt,Te as p,Ua as x,Ud as xt,Va as mt,W as H,Wd as Ut,X as Ze,Ya as U,_a as g,_b as $,_d as Tt,a as C,aa as st,b as F,bc as _,bg as me,ca as P,cc as b,db as gt,dc as tt,fc as k,g as oe,ha as ke,ia as De,je as E,k as Xe,kc as ce,kg as At,l as de,lb as c,lc as le,mb as T,nb as O,ni as jt,ob as M,oi as ge,pc as ne,pi as v,qa as Ae,qi as $t,r as R,ri as Bt,sb as d,se as nt,tb as u,th as wt,ua as Ne,ub as we,ui as je,v as j,vb as qe,vf as it,vi as $e,wa as I,wg as Nt,xb as et,xh as Ft,zb as s}from"./chunk-JWLHBAMV.js";var z=(()=>{let r=class r{constructor(e,t,i,a,h,y,L,Ve,Ye,xe,Ue,Te){this.analyticsService=e,this.docService=t,this.domService=i,this.authService=a,this.afAuth=h,this.iamService=y,this.databaseService=L,this.configService=Ve,this.avatarService=Ye,this.loggingService=xe,this.flockService=Ue,this.commonDbService=Te,this.db=null,this.presenceUser$=new de(new it),this.documentPaths=null,this.inactivityTime=300*1e3,this.offlineInactivityTime=600*1e3,this.presenceUsers$=new de([]),this.presenceUsersSubscription=null,this.includeSelf$=new de(!0),this.customPresenceUsers$=new de([]),this.userIdleStateDetectionSubscription=null,this.userOfflineStateDetectionSubscription=null;try{this.loggingService.log("%c[WB] Creating CLASS: PresenceService","color: blue;"),this.databaseService.getDb().pipe(Y(S=>!!S),Oe(1)).subscribe(S=>{S&&(this.db=S,this.getUser(),this.getDocumentPaths(),this.getLocation(),this.updateOnUserDbConnectionStateChange().subscribe(()=>{},w=>{this.loggingService.catch("Error in PresenceService constructor updateOnUserDbConnectionStateChange: ",w)}),this.updateOnDatabaseDisconnect().subscribe(()=>{},w=>{this.loggingService.catch("Error in PresenceService constructor updateOnDatabaseDisconnect: ",w)}),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,w])=>{try{w?.length>=0&&this.analyticsService.updateDefaultProperties({presenceUsersCount:w?.length}),sessionStorage.getItem(p.SESSION_STORAGE.VELT_PRESENCE_MULTIPLE_USERS_ONLINE)||w?.length>1&&S.length!==w.length&&(sessionStorage.setItem(p.SESSION_STORAGE.VELT_PRESENCE_MULTIPLE_USERS_ONLINE,"true"),this.presenceActionsService?.onMultipleUsersOnline({users:w}))}catch(pn){this.loggingService.catch("Error in presenceUsers$ pairwise subscription: ",pn)}}),this.authService.getUser$().pipe(Y(S=>!!S),Oe(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(w){this.loggingService.catch("Error in presenceUser$ subscription: ",w)}},S=>{this.loggingService.catch("Error in presenceUser$ subscribe: ",S)}),this.customPresenceUsers$.subscribe(()=>{try{let S=this.presenceUsers$.value.filter(w=>!w.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:F(C({},JSON.parse(JSON.stringify(this.presenceUser$.value))),{onlineStatus:p.PRESENCE_STATUS_OFFLINE}),state:p.PRESENCE_STATUS_OFFLINE})}catch(w){this.loggingService.catch("Error in domService.onNetworkStatusChange$ subscription: ",w)}},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;"),Le(this.afAuth).pipe(Y(t=>!!t),W(t=>this.isFeatureAllowed({firebaseUser:t,users:[],filteredUsers:[]})),W(t=>t.featureAllowed?this.iamService.isUserAllowed$().pipe(j(i=>(t.featureAllowed=i,t))):R(t)),W(t=>t.featureAllowed?this.authService.isPlanExpired$().pipe(j(i=>(t.featureAllowed=!i,t))):R(t)),W(t=>t.featureAllowed?R(t).pipe(W(i=>this.docService.getDocumentPaths$().pipe(j(a=>(this.documentPaths=a,i.documentPaths=a,i)))),W(i=>this.getDataFromDocumentId(e).pipe(j(a=>(i.users=a||[],C({},i))))),j(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(j(a=>(a||(i.filteredUsers=i?.filteredUsers?.filter(h=>h?.userSnippylyId!==i.user?.userSnippylyId)),i)))),W(i=>{let a=i?.filteredUsers||[];return this.customPresenceUsers$.pipe(j(()=>this.mergeWithCustomUsers(a)))})):R([])),Ke(Ft))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Y(t=>!!t),j(t=>F(C({},e),{config:t})),W(t=>this.authService.getUser$().pipe(j(i=>F(C({},t),{user:i})))),W(t=>Dt(t.config,t.user,X.PRESENCE)?R(F(C({},t),{featureAllowed:!0})):(this.loggingService.warn("Presence feature is not allowed."),R(F(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:[xt("timestamp"),Tt(i)]}}).pipe(ot(a=>(this.loggingService.catch("Error in PresenceService getDataFromDocumentId: ",a),R(null))),j(a=>a?.data),j(a=>{let h=[];if(a){let y=Object.values(a).filter(L=>typeof L=="object");for(let L of y)h.push(L)}return h}))}else return R([])}))}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(F(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),Oe(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(L=>L.userSnippylyId),presenceClientUserIds:y?.map(L=>L.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=Ut(this.db,".info/connected"),t=Pt(e).pipe(j(i=>i?p.PRESENCE_STATUS_ONLINE:p.PRESENCE_STATUS_OFFLINE));return Le(this.afAuth).pipe(at(1),W(i=>i?t:R(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;"),Le(this.afAuth).pipe(Y(e=>!!e),W(e=>this.docService.getDocumentPaths$().pipe(j(t=>e))),H(e=>oe(this,null,function*(){try{if(this.documentPaths?.presence&&e){let t=yield Et(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(F(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(L=>L.userId===t.userId);if(y>=0){let L=[...h];L[y]=a,this.customPresenceUsers$.next(L)}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?Nt(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(F(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(zt),P(je),P($e),P(bt),P(Yt),P(Wt),P($t),P(Bt),P(v),P(K),P(Gt))},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 Zt=n=>({componentConfigSignal:n}),fn=(n,r)=>({condition:n,data:r}),Sn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-avatar-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Cn(n,r){if(n&1&&(d(0),M(1,"snippyly-user-avatar",3),u()),n&2){let o=s(2).ngIf,e=s();l(),Fe("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 _n(n,r){if(n&1&&(d(0),g(1,Cn,2,5,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Sn,e.template,_(1,Zt,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function yn(n,r){if(n&1&&(d(0),g(1,_n,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,fn,o.conditionSignal(),_(1,Zt,o.componentConfigSignal)))}}var he=(()=>{let r=class r extends B{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:[$([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,yn,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 en=n=>({componentConfigSignal:n}),bn=(n,r)=>({condition:n,data:r}),En=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-active-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Pn(n,r){n&1&&(d(0),T(1,"p"),se(2),ce(3,"translate"),O(),u()),n&2&&(l(2),Re(le(3,1,"User online")))}function xn(n,r){if(n&1&&(d(0),g(1,Pn,4,3,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,En,e.template,_(1,en,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Un(n,r){if(n&1&&(d(0),g(1,xn,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 Tn(n,r){if(n&1&&(d(0),g(1,Un,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,bn,o.conditionSignal(),_(1,en,o.componentConfigSignal)))}}var fe=(()=>{let r=class r extends B{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:[$([f]),U],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,i){t&1&&g(0,Tn,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 tn=n=>({componentConfigSignal:n}),kn=(n,r)=>({condition:n,data:r}),Dn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-inactive-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function An(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 Nn(n,r){if(n&1&&(d(0),g(1,An,4,3,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Dn,e.template,_(1,tn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function wn(n,r){if(n&1&&(d(0),g(1,Nn,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 Fn(n,r){if(n&1&&(d(0),g(1,wn,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,kn,o.conditionSignal(),_(1,tn,o.componentConfigSignal)))}}var Se=(()=>{let r=class r extends B{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:[$([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,Fn,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 nn=n=>({componentConfigSignal:n}),Mn=(n,r)=>({condition:n,data:r}),Ln=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-user-name-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function jn(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),Re(o.presenceUser!=null&&o.presenceUser.name?o.presenceUser==null?null:o.presenceUser.name:le(3,1,o.presenceUser==null?null:o.presenceUser.email))}}function $n(n,r){n&1&&M(0,"velt-skeleton-loader-internal",5)}function Bn(n,r){if(n&1&&(d(0),g(1,jn,4,3,"ng-container",4)(2,$n,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 Wn(n,r){if(n&1&&(d(0),g(1,Bn,4,2,"ng-container",3),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Ln,e.template,_(1,nn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function zn(n,r){if(n&1&&(d(0),g(1,Wn,2,9,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(3,Mn,o.conditionSignal(),_(1,nn,o.componentConfigSignal)))}}var Ce=(()=>{let r=class r extends B{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:[$([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,zn,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 rn=n=>({componentConfigSignal:n}),Gn=(n,r)=>({condition:n,data:r}),Vn=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-status-container-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Yn(n,r){if(n&1&&(d(0),T(1,"div",3),M(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 Xn(n,r){if(n&1&&(d(0),g(1,Yn,5,3,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Vn,e.template,_(1,rn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Hn(n,r){if(n&1&&(d(0),g(1,Xn,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,Gn,o.conditionSignal(),_(1,rn,o.componentConfigSignal)))}}var _e=(()=>{let r=class r extends B{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:[$([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,Hn,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,fe,Se,Ce],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 on=(n,r)=>({componentConfigSignal:n,presenceUser:r}),qn=(n,r)=>({condition:n,data:r}),er=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-tooltip-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function tr(n,r){n&1&&we(0)}function nr(n,r){if(n&1&&(T(0,"velt-shadow-dom-internal"),g(1,tr,1,0,"ng-container",4),O()),n&2){s();let o=te(3);l(),c("ngTemplateOutlet",o)}}function rr(n,r){if(n&1&&(d(0),T(1,"div",8),M(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 ir(n,r){if(n&1&&(T(0,"div",6),g(1,rr,4,2,"ng-container",7),O()),n&2){let o=s(3).ngIf,e=s();l(),c("veltDynamicTemplate",k(4,er,e.template,b(1,on,e.componentConfigSignal,e.presenceUser),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function or(n,r){if(n&1&&g(0,ir,2,10,"div",5),n&2){let o=s(2).ngIf;c("ngIf",o==null?null:o.presenceUser)}}function ar(n,r){if(n&1&&(d(0),g(1,nr,2,1,"velt-shadow-dom-internal",3)(2,or,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 sr(n,r){if(n&1&&(d(0),g(1,ar,4,2,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(4,qn,o.conditionSignal(),b(1,on,o.componentConfigSignal,o.presenceUser)))}}var ye=(()=>{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=Ae({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=F(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,Ne],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,sr,2,7,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,Me,N,A,he,_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%]{--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 lr=["tooltipContent"],an=(n,r,o)=>({componentConfigSignal:n,presenceUser:r,index:o}),mr=(n,r)=>({condition:n,data:r}),gr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-list-item-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function vr(n,r){if(n&1){let o=qe();d(0),T(1,"snippyly-user-avatar",6),et("click",function(){ke(o);let t=s(3).ngIf,i=s();return De(t.onPresenceUserClick(i.presenceUser))}),M(2,"div",7),O(),u()}if(n&2){let o=s(4);l(),Fe("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 pr(n,r){if(n&1){let o=qe();T(0,"div",4),et("pointerenter",function(t){ke(o);let i=s(2).ngIf,a=s();return i.showTooltip(t,a.presenceUser),De(t.stopPropagation())})("pointerleave",function(t){return ke(o),s(2).ngIf.closeTooltip(),De(t.stopPropagation())}),g(1,vr,3,7,"ng-container",5),O()}if(n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(5,gr,e.template,tt(1,an,e.componentConfigSignal,e.presenceUser,e.index),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function dr(n,r){if(n&1&&M(0,"velt-presence-tooltip",8),n&2){let o=r.$implicit,e=s(2).ngIf;c("presenceUser",o)("shadowDom",e.shadowDom)}}function ur(n,r){if(n&1&&(d(0),g(1,pr,2,11,"div",3)(2,dr,1,2,"ng-template",null,0,ne),u()),n&2){let o=s().ngIf,e=s();l(),c("ngIf",e.index<o.maxUsers)}}function hr(n,r){if(n&1&&(d(0),g(1,ur,4,1,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(5,mr,o.conditionSignal(),tt(1,an,o.componentConfigSignal,o.presenceUser,o.index)))}}var Ie=(()=>{let r=class r extends B{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(F(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(lr,5),t&2){let a;pt(a=dt())&&(i.tooltipContent=a.first)}},inputs:{presenceUser:"presenceUser",index:"index",itemTemplate:"itemTemplate"},standalone:!1,features:[$([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,hr,2,8,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,N,A,re,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%]: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 sn=n=>({componentConfigSignal:n}),Sr=(n,r)=>({condition:n,data:r}),Cr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-list-wireframe",variant:o,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function _r(n,r){if(n&1&&(d(0),M(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 yr(n,r){if(n&1&&(d(0),g(1,_r,2,4,"ng-container",3),u()),n&2){let o=s(2).ngIf;l(),c("ngForOf",o.filteredPresenceUsers)("ngForTrackBy",o.trackById)}}function Ir(n,r){if(n&1&&(d(0),g(1,yr,2,2,"ng-container",2),u()),n&2){let o=s().ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Cr,e.template,_(1,sn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function br(n,r){if(n&1&&(d(0),g(1,Ir,2,9,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,Sr,o.conditionSignal(),_(1,sn,o.componentConfigSignal)))}}var be=(()=>{let r=class r extends B{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");wt(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:[$([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,br,2,6,"ng-container",0),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[ft,D,N,A,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%]{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 cn=n=>({componentConfigSignal:n}),Pr=(n,r)=>({condition:n,data:r}),xr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-avatar-remaining-count-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function Ur(n,r){if(n&1&&(d(0),T(1,"snippyly-user-avatar",3),M(2,"div",4),O(),u()),n&2){let o=s(3).ngIf;l(),c("initial","+"+(o.filteredPresenceUsers.length-o.maxUsers).toString())}}function Tr(n,r){if(n&1&&(d(0),g(1,Ur,3,1,"ng-container",2),u()),n&2){let o=s(2).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,xr,e.template,_(1,cn,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Or(n,r){if(n&1&&(d(0),g(1,Tr,2,9,"ng-container",0),u()),n&2){let o=s().ngIf;l(),c("ngIf",o.filteredPresenceUsers.length>o.maxUsers)}}function kr(n,r){if(n&1&&(d(0),g(1,Or,2,1,"ng-container",1),u()),n&2){let o=s();l(),c("veltIf",b(3,Pr,o.conditionSignal(),_(1,cn,o.componentConfigSignal)))}}var Ee=(()=>{let r=class r extends B{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:[$([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,kr,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 ln=n=>({componentConfigSignal:n}),Ar=(n,r)=>({condition:n,data:r}),Nr=(n,r,o,e,t)=>({template:n,context:r,componentName:"velt-presence-wireframe",variant:o,setIfCondition:e,componentElementRef:t});function wr(n,r){n&1&&we(0)}function Fr(n,r){if(n&1&&(T(0,"velt-shadow-dom-internal"),g(1,wr,1,0,"ng-container",4),O()),n&2){s();let o=te(3);l(),c("ngTemplateOutlet",o)}}function Rr(n,r){if(n&1&&(d(0),M(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 Mr(n,r){if(n&1&&(T(0,"div",6),g(1,Rr,3,2,"ng-container",7),O()),n&2){let o=s(3).ngIf,e=s();l(),c("veltDynamicTemplate",k(3,Nr,e.template,_(1,ln,e.componentConfigSignal),o==null?null:o.variant,e.setIfCondition.bind(e),e.elementRef))}}function Lr(n,r){if(n&1&&g(0,Mr,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 jr(n,r){if(n&1&&(d(0),g(1,Fr,2,1,"velt-shadow-dom-internal",3)(2,Lr,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 $r(n,r){if(n&1&&(d(0),g(1,jr,4,2,"ng-container",2),u()),n&2){let o=s();l(),c("veltIf",b(3,Ar,o.conditionSignal(),_(1,ln,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=At(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=F(C({},i),{shadowDom:t}),i))}catch{}}constructor(e,t,i,a,h,y,L,Ve,Ye,xe,Ue,Te){super(xe,Ue,void 0,void 0,void 0,Te,h),this.analyticsService=e,this.authService=t,this.flockService=i,this.presenceService=a,this.loggingService=h,this.wireframeService=y,this.overlay=L,this.overlayPositionBuilder=Ve,this.viewContainerRef=Ye,this.elementRef=xe,this.themeService=Ue,this.dynamicDataService=Te,this.DEFAULT_MAX_USERS=5,this._maxUsers=this.DEFAULT_MAX_USERS,this._inactivityTime=5,this._offlineInactivityTime=10,this._flockMode=!1,this.onNavigate=new ue,this.isExplicitShadowDom=!1,this.onPresenceUserClickEmitter=new ue,this.presenceUsers=[],this.subscriptions=[],this.constants=p,this.onUsersChanged=new ue,this.onPresenceUserChange=new ue,this.componentConfigSignal=Ae({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(S=>{this.componentConfigSignal.update(w=>(w=F(C({},w),{user:S}),w)),this.componentConfigSignal().user&&(this.setPresenceInstalledInAnalytics(),this.presenceSetCustomMaxUsersInAnalytics())},S=>{this.loggingService.catch("Error in PresenceComponent getUser$ subscription: ",S)}))}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=F(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=F(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&&gt("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,Ne],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,$r,2,6,"ng-container",1),t&2&&c("ngIf",i.componentConfigSignal())},dependencies:[D,Me,N,A,be,Ee],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 Pe=(()=>{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(j(t=>({data:t})))}catch(t){return this.loggingService.catch("Error in PresenceActionsService getData: ",t),R({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),R(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 Xt{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),R(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=Ot(r.documentId)),r?.organizationId&&(r.organizationId=kt(r.organizationId))),this.getService(Pe).getData(r)}catch(o){return this.getService(v).catch("Error in _getData: ",o),R({data:null})}}_on(r){this.getService(v).log("%c[WB] Calling FUNCTION: on","color: green;");try{return this.getService(Pe).onAction(r)}catch(o){return this.getService(v).catch("Error in _on: ",o),R(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 mn=(()=>{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 gn=(()=>{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(Jt))},r.\u0275prov=ae({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var Br={"velt-presence-wireframe":pe,"velt-presence-avatar-list-wireframe":be,"velt-presence-avatar-list-item-wireframe":Ie,"velt-presence-avatar-remaining-count-wireframe":Ee,"velt-presence-tooltip-wireframe":ye,"velt-presence-tooltip-avatar-wireframe":he,"velt-presence-tooltip-user-active-wireframe":fe,"velt-presence-tooltip-user-inactive-wireframe":Se,"velt-presence-tooltip-user-name-wireframe":Ce,"velt-presence-tooltip-status-container-wireframe":_e};Object.assign(Vt,Br);function Wr(n){n.get(v).log("%c[WB] Loading presence feature chunk","color: blue;");let o=n.get(jt);o.set(Rt,n.get(z)),o.set(Mt,n.get(Pe)),o.set(Lt,n.get(gn));let t=lt(mn,n).injector;return vn(t,p.TAGS.VELT_PRESENCE,pe),vn(t,p.TAGS.SNIPPYLY_PRESENCE,pe),new Ge(n)}function vn(n,r,o){if(customElements.get(r))return;let e=It(o,{injector:n});customElements.define(r,e)}export{Wr as default};
@@ -0,0 +1 @@
1
+ import{j as cn,l as Se,m as rt,t as sn}from"./chunk-WANCOUQO.js";import"./chunk-XMYVEF74.js";import{x as rn}from"./chunk-7W553TUZ.js";import{a as vn}from"./chunk-AVMLJMVU.js";import{a as Ie}from"./chunk-7ZOGXD6Z.js";import{a as an}from"./chunk-2HGBJS2C.js";import{A,B as U,y as on}from"./chunk-447SWJD2.js";import{a as ce}from"./chunk-ZVY2YW2G.js";import{b as W,c as at,d as ln}from"./chunk-UJMFCXYS.js";import{a as dn}from"./chunk-6SOP2T3L.js";import{a as mn}from"./chunk-N4SGYLNB.js";import{a as zt}from"./chunk-J6J7I3SW.js";import{A as Nt,G as Bt,H as Ut,I as Lt,da as _,ea as ge,fa as z,ga as ue}from"./chunk-AOHSD4YE.js";import{$ as kt,$f as Yt,Aa as Te,Bi as pe,Ci as tn,Db as vt,Dd as Wt,De as $t,E as _e,Eb as pt,Fa as s,Fb as gt,Fc as we,G as yt,Ga as he,Gc as j,Gd as Vt,Hc as Mt,Hi as Me,Ib as X,Ic as jt,If as Ht,J as De,Jc as At,Kb as fe,L as mt,Lc as ve,Nb as Ue,Ob as Ot,Pa as v,Pb as tt,Pc as Ft,Pf as ut,Qg as it,Qi as nn,T as Y,Ta as Tt,Te as re,Ua as w,Va as Dt,Y as dt,Ya as P,Zh as Qt,_a as d,_b as M,a as R,aa as Rt,ac as wt,b as N,bc as y,ca as ae,cc as T,db as k,dg as Xt,fc as B,fi as Zt,g as Ee,ha as J,ia as K,ja as Et,je as nt,kc as E,l as et,lb as l,lc as D,mb as b,mc as Le,nb as x,ng as Gt,ni as ot,ob as F,oi as qt,pc as oe,pi as I,qa as Oe,qi as en,r as V,sb as p,sc as Pt,tb as g,th as be,ua as Ce,ub as de,ui as xe,v as L,vb as Z,vh as ht,vi as Pe,w as st,wa as O,wi as _t,xb as q,xg as Jt,xh as Kt,zb as a,zh as ft}from"./chunk-JWLHBAMV.js";var le=(()=>{let o=class o{constructor(e,n,r,c,u,S,h,f,m,C,$,H,On){this.afAuth=e,this.analyticsService=n,this.authService=r,this.configService=c,this.databaseService=u,this.commonDbService=S,this.docService=h,this.domService=f,this.emojiService=m,this.iamService=C,this.loggingService=$,this.userPermissionService=H,this.serviceBook=On,this.documentPaths=null,this.reactionAnnotationById$=new et({}),this.customReactions$=new et({}),this.commentService=null,this.darkMode$=new et(null),this.loggingService.log("%c[WB] Creating CLASS: ReactionService","color: blue;"),this.serviceBook.observe(Qt).subscribe(Re=>{this.commentService=Re}),this.databaseService.getDb().pipe(_e(Re=>!!Re),De(1)).subscribe(Re=>{Re&&this.getAllReactionAnnotations(void 0,void 0,!0).subscribe()},Re=>{this.loggingService.catch("Error in ReactionService getDb subscription: ",Re)})}setCommentService(e){this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;");try{this.commentService=e}catch(n){this.loggingService.catch("Error in ReactionService setCommentService: ",n)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ReactionService","color: green;");try{this.reactionAnnotationById$.next({}),this.customReactions$.next({}),this.documentPaths=null}catch(e){this.loggingService.catch("Error in ReactionService clearCache: ",e)}}getAllReactionAnnotations(e,n,r,c,u){this.loggingService.log("%c[WB] Calling FUNCTION: getAllReactionAnnotations","color: green;");let S,h;try{if(e&&(h=`${ut(e)}`),n&&typeof n=="object"){let f=Xt(n);S=ut(JSON.stringify(f))}}catch(f){this.loggingService.catch("Error in ReactionService getAllReactionAnnotations: ",f)}return Vt(this.afAuth).pipe(_e(f=>!!f),Y(f=>this.isFeatureAllowed({firebaseUser:f,annotations:[],filteredAnnotations:[]})),Y(f=>f.featureAllowed?this.iamService.isUserAllowed$().pipe(L(m=>(f.featureAllowed=m,f))):V(f)),Y(f=>f.featureAllowed?V(f).pipe(Y(m=>this.docService.getDocumentPaths$().pipe(L(C=>(this.documentPaths=C,m.documentPaths=C,m)))),Y(m=>h?this.getDataFromDocumentIds([h]).pipe(L(C=>(m.annotations=C||[],R({},m)))):this.docService.getDocumentIds$().pipe(Y(C=>{let $=C?.length>0?C.map(H=>H.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds($).pipe(L(H=>(m.annotations=H||[],R({},m))))}))),Y(m=>this.docService.getLocation$().pipe(L(C=>(m.location=C,m)))),Y(m=>this.docService.getLocations$().pipe(L(C=>(m.customLocations=C,m)))),L(m=>{if(m.filteredAnnotations=[],h&&!S)return m.filteredAnnotations=m.annotations?.slice(),m;{let C=[];return S?C.push(S):(C.push(m?.location?.locationId),C.push(...Object.values(m?.customLocations||[]).map($=>$.locationId))),m.filteredAnnotations=this.filterAnnotationsByLocationIds(m?.annotations,C),m}}),Y(m=>r?V(m):m?.annotations?.length?this.domService.onWindowResize$().pipe(L(()=>m)):V(m)),Y(m=>r?V(m):V(m)),L(m=>m),Y(m=>m?.filteredAnnotations?V(m?.filteredAnnotations||[]):V([]))):V([])),mt(Kt))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(_e(n=>!!n),L(n=>N(R({},e),{config:n})),Y(n=>this.authService.getUser$().pipe(L(r=>N(R({},n),{user:r})))),Y(n=>Yt(n.config,n.user,$t.REACTION)?V(N(R({},n),{featureAllowed:!0})):(this.loggingService.warn("Reaction feature is not allowed."),V(N(R({},n),{featureAllowed:!1})))),mt((n,r)=>n?.featureAllowed===r?.featureAllowed))}getDataFromDocumentIds(e,n){return this.getDataFromDocuments({documentIds:e,filters:n})}getDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:n,filters:r}=e;if(n?.some(h=>!h)||!this.documentPaths)return V([]);let c=this.docService.getDocumentPaths()?.veltFolderId,u=V([]),S={useCollectionGroup:!0,isCollection:!0,useQuery:!0};if(this.commonDbService.shouldUseFirestore()||(S.documentId=n?.length?n[0]:void 0,S.organizationId=this.documentPaths?.organizationId),this.userPermissionService?.getIsContextEnabled()){let h=[re.DEFAULT_VELT_CONTEXT,...this.docService.getProcessedDocContext()],f=[];for(let m=0;m<(h?.length??0);m+=re.LISTENER_CONTEXT_BATCH_SIZE)f.push(h?.slice(m,m+re.LISTENER_CONTEXT_BATCH_SIZE)??[]);u=st(f.map(m=>this.commonDbService.dbListener({feature:"allReactions",properties:N(R({},S),{firestoreQuery:[_t(pe("metadata.apiKey","==",this.configService?.getApiKey()),pe("metadata.documentId","in",n),pe("metadata.organizationId","==",this.documentPaths?.organizationId),...c?[pe("metadata.veltFolderId","==",c)]:[],...m?.length?[pe("context.accessFields","array-contains-any",m)]:[])]})}).pipe(dt()))).pipe(L(m=>ft(m)))}else{let h=[];for(let f=0;f<(n?.length??0);f+=re.LISTENER_BATCH_SIZE)h.push(n?.slice(f,f+re.LISTENER_BATCH_SIZE)??[]);u=st(h.map(f=>this.commonDbService.dbListener({feature:"allReactions",properties:N(R({},S),{firestoreQuery:[_t(pe("metadata.apiKey","==",this.configService?.getApiKey()),pe("metadata.documentId","in",f),pe("metadata.organizationId","==",this.documentPaths?.organizationId),...c?[pe("metadata.veltFolderId","==",c)]:[])]})}).pipe(dt()))).pipe(L(f=>ft(f)))}return u.pipe(L(h=>({data:h?.data,operation:h?.operation})),L(({data:h,operation:f})=>{let m=[];return h&&(m=Object.values(h??{}).filter(C=>typeof C=="object")),m?.forEach(C=>{this.sanitizeReactionAnnotation(C)}),{data:m,operation:f}}),L(({data:h,operation:f})=>{if(!n)return{data:h,documentMap:{},operation:f};let m=h.reduce((C,$)=>{let H=$.metadata?.documentId;return H&&(C[H]||(C[H]=[]),C[H].push($)),C},{});return{data:h,documentMap:m,operation:f}}),L(({data:h,documentMap:f,operation:m})=>{if(!r)if(m?.type==="removed"){if(m?.ids?.length){let C=this.reactionAnnotationById$.value;m?.ids?.forEach($=>{delete C?.[$]}),this.reactionAnnotationById$.next(C)}}else Object.entries(f??{}).forEach(([C,$])=>{this.setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:C,annotations:$})});return h}),yt(h=>(this.loggingService.catch("Error in ReactionService getDataFromDocumentId: ",h),V([]))))}else return V([])}setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:n,annotations:r,queryHash:c}){try{if(n){e||(e=re.NO_ORGANIZATION_ID),c||(c=re.DEFAULT_QUERY_HASH);let u={};r?.forEach(h=>{h?.annotationId&&(u[h?.annotationId]=h)});let S=R(R({},this.reactionAnnotationById$.value),u);this.reactionAnnotationById$.next(S)}}catch(u){this.loggingService.catch("Error in ReactionService setReactionAnnotationsByOrganizationIdAndDocumentId:",u)}}getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:n}){try{let r={};return Object.values(this.reactionAnnotationById$.value??{}).forEach(c=>{c?.metadata?.documentId==n&&c?.metadata?.organizationId==e&&(r[c?.annotationId]=c)}),Object.values(r)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentId:",r),[]}}getLocations$(){return this.docService.getLocation$().pipe(Y(e=>this.docService.getLocations$().pipe(L(n=>({location:e,locations:n})))),L(e=>{let n=[];return n.push(e?.location?.locationId),n.push(...Object.values(e.locations||[]).map(r=>r.locationId)),n||[]}))}filterAnnotationsByLocationIds(e,n){try{return e.filter(r=>n.includes(r.locationId))}catch(r){return this.loggingService.catch("Error in ReactionService filterAnnotationsByLocations:",r),[]}}getAnnotationById(e,n){try{let r=this.reactionAnnotationById$.value?.[e];if(r){let{documentId:c,organizationId:u}=n||{};if(c&&r.metadata?.documentId!==c||u&&r.metadata?.organizationId!==u)return}return r}catch(r){this.loggingService.catch("Error in ReactionService getAnnotationById: ",r);return}}getBaseMetadataFromReactionAnnotationId(e){try{let n=this.reactionAnnotationById$.value?.[e];return n?n.metadata:void 0}catch(n){this.loggingService.catch("Error in ReactionService getBaseMetadataFromReactionAnnotationId: ",n);return}}getReactionAnnotationByAnnotationId(e,n){try{return this.reactionAnnotationById$.pipe(L(()=>this.getAnnotationById(e,n)),Y(r=>r?V(r):V(r)))}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationByAnnotationId: ",r),V(void 0)}}getReactionAnnotationsBySectionId(e){try{return this.reactionAnnotationById$.pipe(Y(n=>this.docService.getDocumentPaths$().pipe(L(r=>({documentPaths:r,sectionId:e,reactionAnnotationsMap:n})))),Y(n=>{let r=it(e,["id","data-id"]);if(r){let c=this.docService.getAdditionLocationFromElement(r);if(c){let u=this.docService.genarateLocationId(c);return this.docService.getLocations$().pipe(L(S=>{let f=Object.values(S||{}).find(m=>m.locationId===u||c?.id&&m.location.id===c.id);return N(R({},n),{additionalLocation:f,locationOnElement:!!c})}))}}return V(N(R({},n),{additionalLocation:null,element:r}))}),Y(n=>n?.locationOnElement?V(n):this.docService.getLocation$().pipe(L(r=>N(R({},n),{location:r})))),L(({documentPaths:n,location:r,additionalLocation:c,locationOnElement:u,element:S})=>{let h=null,f=this.docService.getAdditionalDocumentIdFromElement(S),m=f?this.docService.generateDocumentId(f):n?.documentId,C=n?.organizationId;if(m){let $=this.getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:C,documentId:m});if($){h=[];for(let H of $)H?.targetElementId===e&&(u?c&&ht({location:c?.location,locationId:c?.locationId},{location:H.location,locationId:H.locationId})&&h.push(H):r?ht({location:r?.location,locationId:r?.locationId},{location:H.location,locationId:H.locationId})&&h.push(H):H?.locationId||h.push(H))}}return h}))}catch(n){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsBySectionId: ",n),V(null)}}addOrUpdateReaction(e,n,r,c,u,S,h,f){return Ee(this,null,function*(){try{let m=n?.map(C=>this.getAnnotationById(C)).find(C=>C?.icon===e);if(m){if(!h||h==="delete")return yield this.updateUserInReaction(m)}else if(!h||h==="add")return yield this.addReaction(void 0,e,r,c,u,S,f)}catch(m){this.loggingService.catch("Error in ReactionService addOrUpdateReaction: ",m)}})}addReaction(e,n,r,c,u,S,h){return Ee(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{let f=this.authService.getUser();if(f)if(f.isReadOnly||f.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add reactions.");else{let m=new Ht;if(m.from=f,m.lastUpdated=this.timestamp,m.reactions=[],m.reactions.push({from:f,lastUpdated:this.timestamp}),c&&(m.targetElementId=c),u){m.commentAnnotationId=u;let C=this.commentService?.getAnnotationById(u);if(C?.context?.access&&C?.context?.accessFields){if(!this.userPermissionService?.hasUserContextAccess({userId:f.userId,accessFields:C.context.accessFields})){this.loggingService.catch("User does not have context access to add reaction annotation.",void 0,void 0,!0);return}m.context={access:C.context.access,accessFields:C.context.accessFields}}}if(this.setLocationToReactionAnnotation(m),m.pageInfo=Jt(),m.pageInfo&&(m.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),n)if(m.icon=n,S)m.iconUrl=S?.url,m.iconEmoji=S?.emoji;else{let C=this.customReactions$.value;if(C){let $=C[n];$?.url&&(m.iconUrl=$?.url),$?.emoji&&(m.iconEmoji=$?.emoji)}}return r&&(m.location={},m.location=R({},r),m.locationId=this.docService.genarateLocationId(m.location)),yield this.saveReactionToDb(m)}}catch(f){this.loggingService.catch("Error in ReactionService addReaction: ",f)}})}setLocationToReactionAnnotation(e){try{let n=this.docService.getLocation();n?(e.locationId=n.locationId,e.location=n.location):(delete e.locationId,delete e.location);try{let r;e.targetElement?.xpath?r=this.domService.getElementFromXPath(e.targetElement.xpath):e.targetElementId&&(r=it(e.targetElementId,["id","data-id"]));let c=this.docService.getAdditionLocationFromElement(r);if(c){let u=this.docService.addLocation({location:c,source:"internal"});u?.[0]&&(e.locationId=u[0].locationId,e.location=u[0].location)}}catch{}}catch(n){this.loggingService.catch("Error in ReactionService setLocationToReactionAnnotation:",n)}}getElementForReactionAnnotation(e){try{let n;return e.targetElementId&&(n=it(e.targetElementId,["id","data-id"])),n}catch(n){return this.loggingService.catch("Error in ReactionService getElementForReactionAnnotation: ",n),null}}saveReactionToDb(e){return Ee(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: saveReactionToDb","color: green;");try{if(this.authService.getUser()){let n=yield this.docService.getDocumentPaths$().pipe(_e(c=>!!c),De(1)).toPromise();if(!n)throw new Error("Document paths not found.");if(this.documentPaths=n,this.loggingService.log(this.documentPaths),!(yield this.databaseService.getDb().pipe(_e(c=>!!c),De(1)).toPromise()))throw new Error("Database not found.");if(this.documentPaths?.reaction){if(e.annotationId=this.commonDbService.generateDocumentId(),e.pageInfo,!e?.metadata?.documentId){e?.metadata||(e.metadata={});let f=this.getElementForReactionAnnotation(e),m=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId,element:f});e.metadata=R(R({},e?.metadata),m)}let c=JSON.parse(JSON.stringify(e));c.position=null;let{documentId:u,organizationId:S}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(e),h=e.commentAnnotationId?void 0:{annotationData:c,actionType:"add",notificationSource:"reaction"};return yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:u,organizationId:S},data:c,extraData:h}),c}else return}}catch(n){this.loggingService.catch("Error in ReactionService saveReactionToDb: ",n)}})}getDocumentIdAndOrganizationIdFromReactionAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(n){return this.loggingService.catch("Error in ReactionService getDocumentIdAndOrganizationIdFromReactionAnnotation: ",n),{}}}updateUserInReaction(e){return Ee(this,null,function*(){try{let n=this.authService.getUser();if(n)return e?.reactions||(e.reactions=[]),e?.reactions?.find(c=>c?.from?.userId===n?.userId)?e.reactions=e?.reactions?.filter(c=>c?.from?.userId!==n?.userId):e.reactions.push({from:n,lastUpdated:this.timestamp}),e.reactions.length?yield this.updateReaction(e):yield this.deleteReactionPinAnnotation(e?.annotationId),e}catch(n){this.loggingService.catch("Error in ReactionService updateUserInReaction: ",n)}})}removeUserFromReaction(e){this.loggingService.log("%c[WB] Calling FUNCTION: removeUserFromReaction","color: green;");try{let n=this.authService.getUser();n&&(e?.reactions||(e.reactions=[]),e.reactions=e?.reactions?.filter(r=>r?.from?.userId!==n?.userId),this.updateReaction(e))}catch(n){this.loggingService.catch("Error in ReactionService removeUserFromReaction: ",n)}}updateReaction(e,n,r){return Ee(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateReaction","color: green;");try{if(this.authService.getUser()){if(e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let f=h.iterateNext();f&&(Gt(f)||(e.targetElement=null))}}let c=JSON.parse(JSON.stringify(e));if(c.position=null,c.lastUpdated=this.timestamp,!c?.metadata?.documentId){c?.metadata||(c.metadata={});let h=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId});c.metadata=R(R({},c?.metadata),h)}let{documentId:u,organizationId:S}=c?.metadata||{};return r?yield this.commonDbService.updateData({feature:"reaction",properties:{id:e.annotationId,documentId:u,organizationId:S},data:JSON.parse(JSON.stringify(c))}):yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:u,organizationId:S},data:JSON.parse(JSON.stringify(c))}),c}}catch(c){this.loggingService.catch("Error in ReactionService updateReaction: ",c)}})}deleteReactionPinAnnotation(e,n){return Ee(this,null,function*(){try{let r=this.getAnnotationById(e),{documentId:c,organizationId:u}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(r),S=r&&!r.commentAnnotationId?{annotationData:r,actionType:"delete",notificationSource:"reaction"}:void 0;yield this.commonDbService.deleteData({feature:"reaction",properties:{id:e,documentId:c,organizationId:u},extraData:S})}catch(r){this.loggingService.catch("Error in ReactionService deleteReactionPinAnnotation: ",r)}})}setCustomReactions(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;"),this.customReactions$.next(e),this.emojiService.setEmojiList(e)}catch(n){this.loggingService.catch("Error in ReactionService setCustomReactions: ",n)}}enableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;"),this.darkMode$.value===!0)return;this.darkMode$.next(!0)}catch(e){this.loggingService.catch("Error in ReactionService enableDarkMode: ",e)}}disableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;"),this.darkMode$.value===!1)return;this.darkMode$.next(!1)}catch(e){this.loggingService.catch("Error in ReactionService disableDarkMode: ",e)}}getDarkMode(){return this.darkMode$.value}getDarkMode$(){return this.darkMode$.asObservable()}sanitizeReactionAnnotation(e){try{e&&(e.iconUrl&&(e.iconUrl=this.domService.sanitizeHtml(e.iconUrl)),e.iconEmoji&&(e.iconEmoji=this.domService.sanitizeHtml(e.iconEmoji)),e.icon&&(e.icon=this.domService.sanitizeHtml(e.icon)))}catch(n){this.loggingService.catch("Error in ReactionService sanitizeReactionAnnotation: ",n)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getReactionAnnotationForClient(e){try{let n=["isReactionResolverUsed","pageInfo","from","involvedUserIds","position"],r=JSON.parse(JSON.stringify(e)),c={};return Object.keys(r).forEach(u=>{n.includes(u)||(u==="reactions"?c.fromUsers=r[u]:c[u]=r[u])}),c}catch(n){return this.loggingService.catch("Error in ReactionService getReactionAnnotationForClient: ",n),e}}};o.\u0275fac=function(n){return new(n||o)(ae(Wt),ae(qt),ae(Pe),ae(en),ae(tn),ae(nn),ae(Me),ae(xe),ae(Se),ae(mn),ae(I),ae(vn),ae(ot))},o.\u0275prov=kt({token:o,factory:o.\u0275fac,providedIn:"root"});let t=o;return t})();var ye=class{constructor(){this.annotations=[],this.skeletonLoading=!0,this.darkMode=!1}};var ee=class{constructor(){this.type="comment",this.disableTooltip=!1,this.isReactionSelectedByCurrentUser=!1,this.tooltipVisible=!1,this.shadowDom=!1}};var un=t=>({componentConfigSignal:t}),Pn=(t,o)=>({condition:t,data:o}),Mn=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-emoji-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function jn(t,o){if(t&1&&(p(0),F(1,"div",3),E(2,"emoji"),E(3,"translate"),g()),t&2){let i=a(3).ngIf,e=a();s(),l("innerHTML",Le(2,3,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Te),k("data-testid",e.componentId)("aria-label",D(3,6,"Reaction with")+" "+((i==null||i.annotation==null?null:i.annotation.icon)||"emoji"))}}function An(t,o){if(t&1&&(p(0),d(1,jn,4,8,"ng-container",0),g()),t&2){let i=a(2).ngIf;s(),l("ngIf",i==null?null:i.annotation)}}function Fn(t,o){if(t&1&&(p(0),d(1,An,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,Mn,e.template,y(1,un,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Nn(t,o){if(t&1&&(p(0),d(1,Fn,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,Pn,i.conditionSignal(),y(1,un,i.componentConfigSignal)))}}var ze=(()=>{let o=class o extends z{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-emoji",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-emoji-internal"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","img",1,"velt-reaction-pin--emoji",3,"innerHTML"]],template:function(n,r){n&1&&d(0,Nn,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,rt,W],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var hn=t=>({componentConfigSignal:t}),Un=(t,o)=>({condition:t,data:o}),Ln=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-count-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function zn(t,o){if(t&1&&(b(0,"div",4),E(1,"translate"),Ue(2),x()),t&2){let i=a(3).ngIf,e=a();k("data-testid",e.componentId)("aria-label",D(1,3,"Reaction count")+" "+((i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)||0)),s(2),tt(" ",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length," ")}}function Wn(t,o){if(t&1&&(p(0),d(1,zn,3,5,"div",3),g()),t&2){let i=a(2).ngIf;s(),l("ngIf",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)}}function Vn(t,o){if(t&1&&(p(0),d(1,Wn,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,Ln,e.template,y(1,hn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function $n(t,o){if(t&1&&(p(0),d(1,Vn,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,Un,i.conditionSignal(),y(1,hn,i.componentConfigSignal)))}}var We=(()=>{let o=class o extends z{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-count",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-count-internal"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-reaction-pin--count","role","status",4,"ngIf"],["role","status",1,"velt-reaction-pin--count"]],template:function(n,r){n&1&&d(0,$n,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,W],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var fn=t=>({componentConfigSignal:t}),Yn=(t,o)=>({condition:t,data:o}),Xn=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-user-avatar-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function Gn(t,o){if(t&1&&(p(0),F(1,"snippyly-user-avatar",3),E(2,"translate"),E(3,"translate"),g()),t&2){let i=a(4);s(),l("size",24)("user",i.reaction==null?null:i.reaction.from),k("data-testid",i.componentId+"-avatar")("aria-label",D(2,4,"Avatar for")+" "+D(3,6,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user"))}}function Jn(t,o){if(t&1&&(p(0),d(1,Gn,4,8,"ng-container",0),g()),t&2){let i=a(3);s(),l("ngIf",i.reaction)}}function Kn(t,o){if(t&1&&(p(0),d(1,Jn,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,Xn,e.template,y(1,fn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Qn(t,o){if(t&1&&(p(0),d(1,Kn,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,Yn,i.conditionSignal(),y(1,fn,i.componentConfigSignal)))}}var Ve=(()=>{let o=class o extends z{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-avatar",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-user-avatar-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-reaction-pin-tooltip-user-avatar",3,"size","user"]],template:function(n,r){n&1&&d(0,Qn,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,ln,W],styles:["[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let t=o;return t})();var _n=t=>({componentConfigSignal:t}),ei=(t,o)=>({condition:t,data:o}),ti=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-user-name-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function ni(t,o){if(t&1&&(b(0,"span",7),Ue(1),E(2,"translate"),x()),t&2){let i=a(6);k("data-testid",i.componentId+"-suffix"),s(),tt("(",D(2,2,"You"),")")}}function ii(t,o){if(t&1&&(p(0),b(1,"span",5),Ue(2),E(3,"translate"),x(),d(4,ni,3,4,"span",6),g()),t&2){let i=a(4).ngIf,e=a();s(),k("data-testid",e.componentId+"-name"),s(),Ot(D(3,3,(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))),s(2),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.userId)===(i==null||i.user==null?null:i.user.userId))}}function oi(t,o){if(t&1&&(p(0),d(1,ii,5,5,"ng-container",4),g()),t&2){a(2);let i=X(3),e=a(2);s(),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))("ngIfElse",i)}}function ri(t,o){if(t&1&&(p(0),d(1,oi,2,2,"ng-container",1),g()),t&2){let i=a(3);s(),l("ngIf",i.reaction)}}function ai(t,o){t&1&&F(0,"velt-skeleton-loader-internal",8)}function ci(t,o){if(t&1&&(p(0),d(1,ri,2,1,"ng-container",3)(2,ai,1,0,"ng-template",null,0,oe),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,ti,e.template,y(1,_n,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function li(t,o){if(t&1&&(p(0),d(1,ci,4,9,"ng-container",2),g()),t&2){let i=a();s(),l("veltIf",T(3,ei,i.conditionSignal(),y(1,_n,i.componentConfigSignal)))}}var $e=(()=>{let o=class o extends z{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-name",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-user-name-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[["loadingTemplateRef",""],[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngIf","ngIfElse"],[1,"velt-reaction-pin-tooltip-user-name"],["class","velt-reaction-pin-tooltip-user-name-suffix",4,"ngIf"],[1,"velt-reaction-pin-tooltip-user-name-suffix"],["height","20px","width","64px","borderRadius","20px"]],template:function(n,r){n&1&&d(0,li,2,6,"ng-container",1),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,at,W],styles:["[_nghost-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var Cn=(t,o)=>({componentConfigSignal:t,reaction:o}),mi=(t,o)=>({condition:t,data:o}),di=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-user-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function vi(t,o){if(t&1&&(b(0,"div",3),E(1,"translate"),E(2,"translate"),F(3,"velt-reaction-pin-tooltip-user-avatar-internal",4)(4,"velt-reaction-pin-tooltip-user-name-internal",5),x()),t&2){let i=a(3);k("data-testid",i.componentId)("aria-label",D(1,5,"Reaction by")+" "+D(2,7,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user")),s(3),l("reaction",i.reaction),s(),l("reaction",i.reaction)("componentConfigSignal",i.componentConfigSignal)}}function pi(t,o){if(t&1&&(p(0),d(1,vi,5,9,"div",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(4,di,e.template,T(1,Cn,e.componentConfigSignal,e.reaction),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function gi(t,o){if(t&1&&(p(0),d(1,pi,2,10,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(4,mi,i.conditionSignal(),T(1,Cn,i.componentConfigSignal,i.reaction)))}}var He=(()=>{let o=class o extends z{set _userWireframe(e){try{this.userWireframe=e,this.userWireframe?this.template=this.domService.deepCloneElement(this.userWireframe):this.template=null}catch{}}constructor(e,n,r,c){super(n,c,r),this.domService=e,this.elementRef=n,this.loggingService=r,this.dynamicDataService=c,this.componentId="velt-reaction-pin-tooltip-user",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(xe),v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-user-internal"]],inputs:{reaction:"reaction",_userWireframe:[0,"userWireframe","_userWireframe"]},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","v-tooltip-reaction-user velt-reaction-pin-tooltip-user","role","listitem",4,"veltDynamicTemplate"],["role","listitem",1,"v-tooltip-reaction-user","velt-reaction-pin-tooltip-user"],[3,"reaction"],[3,"reaction","componentConfigSignal"]],template:function(n,r){n&1&&d(0,gi,2,7,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,Ve,$e,W],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-user[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-sm)}"],changeDetection:0});let t=o;return t})();var bn=t=>({componentConfigSignal:t}),hi=(t,o)=>({condition:t,data:o}),fi=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-users-wireframe",variant:i,setIfCondition:e,componentElementRef:n,replaceTemplate:!1});function _i(t,o){if(t&1&&(b(0,"div",5),F(1,"velt-reaction-pin-tooltip-user-internal",6),x()),t&2){let i=o.$implicit,e=o.index,n=a(4);k("data-testid",n.componentId+"-item-"+e),s(),l("userWireframe",n.userTemplate)("reaction",i)("componentConfigSignal",n.componentConfigSignal)}}function Ci(t,o){if(t&1&&(p(0),b(1,"div",3),E(2,"translate"),d(3,_i,2,4,"div",4),x(),g()),t&2){let i=a(2).ngIf,e=a();s(),k("data-testid",e.componentId)("aria-label",D(2,3,"Users who reacted")),s(2),l("ngForOf",i==null||i.annotation==null?null:i.annotation.reactions)}}function bi(t,o){if(t&1&&(p(0),d(1,Ci,4,5,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,fi,e.template,y(1,bn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function xi(t,o){if(t&1&&(p(0),d(1,bi,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,hi,i.conditionSignal(),y(1,bn,i.componentConfigSignal)))}}var Ye=(()=>{let o=class o extends z{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-users",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{if(super.ngOnInit(),this.setupA11yAttributes(),!this.userTemplate){let e=this.template?.querySelector("velt-reaction-pin-tooltip-user-wireframe");be(e)||(this.userTemplate=e)}}catch{}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-users-internal"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-reaction-pin-tooltip-users"],["role","presentation",4,"ngFor","ngForOf"],["role","presentation"],[3,"userWireframe","reaction","componentConfigSignal"]],template:function(n,r){n&1&&d(0,xi,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[we,j,A,U,He,W],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-users[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs)}"],changeDetection:0});let t=o;return t})();var Si=t=>({componentConfigSignal:t}),yi=(t,o)=>({template:t,context:o});function ki(t,o){t&1&&de(0)}function Ri(t,o){if(t&1&&(b(0,"velt-shadow-dom-internal"),d(1,ki,1,0,"ng-container",3),x()),t&2){a();let i=X(3);s(),l("ngTemplateOutlet",i)}}function Ei(t,o){if(t&1&&(b(0,"div",5),E(1,"translate"),F(2,"velt-reaction-pin-tooltip-users-internal",6),x()),t&2){let i=a(3);k("data-testid",i.componentId)("aria-label",D(1,4,"Reaction details")),s(2),l("componentConfigSignal",i.componentConfigSignal),k("data-testid",i.componentId+"-users")}}function Ti(t,o){if(t&1&&d(0,Ei,3,6,"div",4),t&2){let i=a(2);l("veltDynamicTemplate",T(3,yi,i.template,y(1,Si,i.componentConfigSignal)))}}function Di(t,o){if(t&1&&(p(0),d(1,Ri,2,1,"velt-shadow-dom-internal",2)(2,Ti,1,6,"ng-template",null,0,oe),g()),t&2){let i=X(3),e=a();s(),l("ngIf",e.shadowDom&&!e.template||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}var Xe=(()=>{let o=class o extends ue{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,n,r,c,u){super(r,c,void 0,void 0,void 0,u,e),this.loggingService=e,this.wireframeService=n,this.elementRef=r,this.themeService=c,this.dynamicDataService=u,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.componentId="velt-reaction-pin-tooltip",this.subscriptions=[]}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,n=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=n!==null&&n!=="false",this.setupA11yAttributes();let r="velt-reaction-pin-tooltip-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(c=>{if(c){let u=document.createElement(c.tagName);u.innerHTML=c.innerHTML,this.template=u}}))}catch(e){this.catchError("Error in ReactionPinTooltipComponent OnInit: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in ReactionPinTooltipComponent ondestroy: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","tooltip"),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipComponent setupA11yAttributes:",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in ReactionPinTooltipComponent unsubscribe: ",e)}}catchError(e,n,r){try{this.loggingService.catch(e,n,N(R({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(n){return new(n||o)(v(I),v(ce),v(O),v(ge),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[["reactionPinTooltipRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-reaction-pin-tooltip","role","tooltip",4,"veltDynamicTemplate"],["role","tooltip",1,"velt-reaction-pin-tooltip"],[3,"componentConfigSignal"]],template:function(n,r){n&1&&d(0,Di,4,2,"ng-container",1),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ve,Ie,A,Ye,W],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)}.velt-reaction-pin-tooltip[_ngcontent-%COMP%]{margin-block:8px;opacity:1;padding:4px;border-radius:var(--velt-border-radius-md);background:var(--velt-background-0);box-shadow:0 4px 21px #00000014;display:flex;flex-direction:column;gap:var(--velt-spacing-xs);color:var(--velt-text-0);font-size:var(--velt-font-size-xs);font-style:normal;font-weight:500;line-height:normal}.velt-reaction-pin-tooltip[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var wi=["trigger"],Pi=["overlay"],xn=t=>({componentConfigSignal:t}),In=(t,o)=>({template:t,context:o}),Mi=(t,o)=>({reactionAnnotation:t,user:o});function ji(t,o){if(t&1){let i=Z();b(0,"div",8)(1,"div",9),E(2,"translate"),E(3,"translate"),q("click",function(n){return J(i),a(4).onReactionClick(),K(n.stopPropagation())}),F(4,"div",10),E(5,"emoji"),x()()}if(t&2){let i=a(3).ngIf,e=a();k("data-testid",e.componentId+"-timeline"),s(),k("data-testid",e.componentId+"-timeline-item")("aria-label",D(2,4,"React with")+" "+D(3,6,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",Le(5,8,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Te)}}function Ai(t,o){if(t&1&&(p(0),F(1,"velt-reaction-pin-emoji-internal",13)(2,"velt-reaction-pin-count-internal",13),g()),t&2){let i=a(5);s(),l("componentConfigSignal",i.componentConfigSignal),s(),l("componentConfigSignal",i.componentConfigSignal)}}function Fi(t,o){if(t&1){let i=Z();b(0,"div")(1,"div",11),E(2,"translate"),E(3,"translate"),q("click",function(n){return J(i),a(4).onReactionClick(),K(n.stopPropagation())}),d(4,Ai,3,2,"ng-container",12),x()()}if(t&2){let i=a(3).ngIf,e=a();s(),fe("velt-reaction-pin--default",!e.template)("velt-reaction-pin--no-reactions",!(!(i==null||i.annotation==null||i.annotation.reactions==null)&&i.annotation.reactions.length)),k("data-testid",e.componentId+"-default")("aria-label",D(2,7,"React with")+" "+D(3,9,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("veltDynamicTemplate",T(13,In,e.template,y(11,xn,e.componentConfigSignal)))}}function Ni(t,o){if(t&1&&(p(0),b(1,"div",5),d(2,ji,6,11,"div",6)(3,Fi,5,16,"div",7),x(),g()),t&2){let i=a(3);s(),l("ngSwitch",i.type),s(),l("ngSwitchCase","timeline")}}function Bi(t,o){if(t&1){let i=Z();b(0,"div",9),E(1,"translate"),E(2,"translate"),q("click",function(n){return J(i),a(6).onReactionClick(),K(n.stopPropagation())}),F(3,"div",10),E(4,"emoji"),x()}if(t&2){let i=a(5).ngIf,e=a();fe("active",i==null?null:i.isReactionSelectedByCurrentUser),k("data-testid",e.componentId+"-timeline-item")("aria-pressed",i==null?null:i.isReactionSelectedByCurrentUser)("aria-label",D(1,6,"React with")+" "+D(2,8,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",Le(4,10,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Te)}}function Ui(t,o){if(t&1&&(b(0,"div",8),d(1,Bi,5,13,"div",15),x()),t&2){let i=a(4).ngIf,e=a();k("data-testid",e.componentId+"-timeline"),s(),l("ngIf",i==null||i.annotation==null?null:i.annotation.icon)}}function Li(t,o){t&1&&F(0,"velt-skeleton-loader-internal",18)}function zi(t,o){if(t&1&&(p(0),F(1,"velt-reaction-pin-emoji-internal",13)(2,"velt-reaction-pin-count-internal",13),g()),t&2){let i=a(7);s(),l("componentConfigSignal",i.componentConfigSignal),s(),l("componentConfigSignal",i.componentConfigSignal)}}function Wi(t,o){if(t&1){let i=Z();b(0,"div",11),E(1,"translate"),E(2,"translate"),q("click",function(n){return J(i),a(6).onReactionClick(),K(n.stopPropagation())}),d(3,zi,3,2,"ng-container",12),x()}if(t&2){let i=a(5).ngIf,e=a();fe("velt-reaction-pin--default",!e.template)("active",i==null?null:i.isReactionSelectedByCurrentUser)("velt-reaction-pin--no-reactions",!(!(i==null||i.annotation==null||i.annotation.reactions==null)&&i.annotation.reactions.length)),k("data-testid",e.componentId+"-default")("aria-pressed",i==null?null:i.isReactionSelectedByCurrentUser)("aria-label",D(1,10,"React with")+" "+D(2,12,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("veltDynamicTemplate",T(16,In,e.template,y(14,xn,e.componentConfigSignal)))}}function Vi(t,o){if(t&1&&(b(0,"div"),d(1,Li,1,0,"velt-skeleton-loader-internal",16)(2,Wi,4,19,"div",17),x()),t&2){let i=a(4).ngIf,e=a();s(),l("ngIf",e.showLoadingTemplate),s(),l("ngIf",i==null||i.annotation==null?null:i.annotation.icon)}}function $i(t,o){if(t&1&&(b(0,"div",5),d(1,Ui,2,2,"div",6)(2,Vi,3,2,"div",7),x()),t&2){let i=a(4);l("ngSwitch",i.type),s(),l("ngSwitchCase","timeline")}}function Hi(t,o){t&1&&de(0)}function Yi(t,o){if(t&1&&(p(0),d(1,Hi,1,0,"ng-container",20),g()),t&2){let i=a(4).ngIf,e=a();s(),l("ngTemplateOutlet",e.customTooltipTemplate)("ngTemplateOutletContext",T(2,Mi,i==null?null:i.annotation,i==null?null:i.user))}}function Xi(t,o){if(t&1&&F(0,"velt-reaction-pin-tooltip-internal",21),t&2){let i=a(5);l("shadowDom",!!i.shadowDom)("variant",i.variant)("componentConfigSignal",i.componentConfigSignal)("darkMode",i.darkMode)}}function Gi(t,o){if(t&1&&d(0,Yi,2,5,"ng-container",19)(1,Xi,1,4,"ng-template",null,2,oe),t&2){let i=X(2),e=a(4);l("ngIf",e.customTooltipTemplate)("ngIfElse",i)}}function Ji(t,o){if(t&1&&(b(0,"app-overlay-tooltip",14),d(1,$i,3,2,"ng-template",null,0,oe)(3,Gi,3,2,"ng-template",null,1,oe),x()),t&2){let i=a(3);l("positions",i.positions)("disabled",i.disableTooltip),k("data-testid",i.componentId+"-tooltip")}}function Ki(t,o){if(t&1&&(p(0),d(1,Ni,4,2,"ng-container",3)(2,Ji,5,3,"app-overlay-tooltip",4),g()),t&2){let i=a().ngIf,e=a();s(),l("ngIf",e.reactionId&&!e.annotationId&&(i==null||i.annotation==null?null:i.annotation.icon)&&e.type!=="standalone"),s(),l("ngIf",(i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)||e.type==="standalone")}}function Qi(t,o){if(t&1&&(p(0),d(1,Ki,3,2,"ng-container",3),g()),t&2){let i=a();s(),l("ngIf",!i.isExcludedValue)}}var Ae=(()=>{let o=class o extends ue{set reactionId(e){this._reactionId=e}get reactionId(){return this._reactionId}set"reaction-id"(e){this._reactionId=e}get isExcludedValue(){try{let e=this.componentConfigSignal(),n=e?.annotation?.icon,r=this.excludeReactionIds||e?.excludeReactionIds||[];return!n||!r?.length?!1:r.includes(n)}catch{return!1}}constructor(e,n,r,c,u,S,h){super(u,S,void 0,void 0,void 0,h,n),this.authService=e,this.loggingService=n,this.reactionService=r,this.wireframeService=c,this.elementRef=u,this.themeService=S,this.dynamicDataService=h,this.type="comment",this.disableTooltip=!1,this.shadowDom=!1,this.excludeReactionIds=[],this.commentReactionAnnotationIds=[],this.positions=[{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}],this.componentConfigSignal=Oe(new ee),this.click=new he,this.showLoadingTemplate=!1,this.subscriptions=[],this.commentReactionSubscriptions=[],this.componentId="velt-reaction-pin",this.loggingService.log("%c[WB] Creating CLASS: ReactionPinComponent","color: blue;")}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit(),this.setupA11yAttributes(),this.setShowLoadingTemplate(),this.reactionId&&!this.annotationId&&(this.setDefaultReaction(this.reactionId),this.commentReactionAnnotationIds?.length&&this.findMatchingAnnotationFromCommentReactions());let e="velt-reaction-pin-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(n=>{if(n){let r=document.createElement(n.tagName);r.innerHTML=n.innerHTML,this.template=r}}))}catch(e){this.catchError("Error in ReactionPinComponent OnInit: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Reaction section")}catch(e){this.loggingService.catch("Error in ReactionPinComponent setupA11yAttributes:",e)}}ngAfterViewInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngAfterViewInit","color: green;");try{this.subscriptions.push(this.authService.getUser$().pipe(_e(e=>!!e),De(1)).subscribe(e=>{this.componentConfigSignal.update(n=>(n=N(R({},n),{user:e}),n)),this.checkIfReactionSelectedByCurrentUser()}))}catch(e){this.catchError("Error in ReactionPinComponent ngAfterViewInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(n=>{this.componentConfigSignal.update(r=>(r=N(R({},r),{[n]:e[n].currentValue}),r))}),e.annotationId&&(this.annotationSubscription?.unsubscribe(),this.annotationSubscription=void 0,this.annotationId&&this.getReactionByAnnotationId(this.annotationId)),e.reactionId&&this.reactionId&&!this.annotationId&&this.setDefaultReaction(this.reactionId),(e.commentReactionAnnotationIds||e.reactionId)&&this.reactionId&&!this.annotationId&&this.commentReactionAnnotationIds?.length&&this.findMatchingAnnotationFromCommentReactions()}catch(n){this.catchError("Error in ReactionPinComponent ngOnChanges: ",n)}}setDefaultReaction(e){try{let n={icon:e,reactions:[]};this.componentConfigSignal.update(r=>(r=N(R({},r),{annotation:n}),r))}catch(n){this.catchError("Error in ReactionPinComponent setDefaultReaction: ",n)}}findMatchingAnnotationFromCommentReactions(){try{if(this.commentReactionSubscriptions.forEach(e=>e.unsubscribe()),this.commentReactionSubscriptions=[],!this.commentReactionAnnotationIds?.length||!this.reactionId)return;for(let e of this.commentReactionAnnotationIds){let n=this.reactionService.getReactionAnnotationByAnnotationId(e,this.parentMetadata).subscribe(r=>{r?.icon===this.reactionId&&(this.componentConfigSignal.update(c=>(c=N(R({},c),{annotation:r}),c)),this.checkIfReactionSelectedByCurrentUser())});this.commentReactionSubscriptions.push(n)}}catch(e){this.catchError("Error in ReactionPinComponent findMatchingAnnotationFromCommentReactions: ",e)}}getReactionByAnnotationId(e){this.loggingService.log("%c[WB] Calling FUNCTION: getReactionByAnnotationId","color: green;");try{this.annotationSubscription=this.reactionService.getReactionAnnotationByAnnotationId(e,this.parentMetadata).subscribe(n=>{this.componentConfigSignal.update(r=>(r=N(R({},r),{annotation:n}),r)),this.checkIfReactionSelectedByCurrentUser(),this.setShowLoadingTemplate(),this.componentConfigSignal().tooltipVisible&&!this.componentConfigSignal().annotation?.reactions?.length&&this.hideTooltip(),this.overlay?.overlayRef?.updatePosition()})}catch(n){this.catchError("Error in ReactionPinComponent getReactionByAnnotationId: ",n)}}checkIfReactionSelectedByCurrentUser(){this.loggingService.log("%c[WB] Calling FUNCTION: checkIfReactionSelectedByCurrentUser","color: green;");try{this.componentConfigSignal.update(e=>(e=N(R({},e),{isReactionSelectedByCurrentUser:!!e.annotation?.reactions?.find(n=>n?.from?.userId===e.user?.userId)}),e))}catch(e){this.catchError("Error in ReactionPinComponent checkIfReactionSelectedByCurrentUser: ",e)}}setShowLoadingTemplate(){try{!this.componentConfigSignal()?.annotation?.icon&&this.componentConfigSignal()?.annotation?.isReactionResolverUsed?this.showLoadingTemplate=!0:this.showLoadingTemplate=!1}catch(e){this.catchError("Error in ReactionPinComponent setShowLoadingTemplate: ",e)}}onReactionClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onReactionClick","color: green;");try{this.click.emit(this.componentConfigSignal().annotation)}catch(e){this.catchError("Error in ReactionPinComponent onReactionClick: ",e)}}showTooltip(){try{this.componentConfigSignal.update(e=>(e=N(R({},e),{tooltipVisible:!0}),e))}catch(e){this.catchError("Error in ReactionPinComponent showTooltip: ",e)}}hideTooltip(){try{this.componentConfigSignal.update(e=>(e=N(R({},e),{tooltipVisible:!1}),e))}catch(e){this.catchError("Error in ReactionPinComponent hideTooltip: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in ReactionPinComponent ngOnDestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.forEach(e=>{e.unsubscribe()}),this.subscriptions=[],this.commentReactionSubscriptions.forEach(e=>{e.unsubscribe()}),this.commentReactionSubscriptions=[],this.annotationSubscription?.unsubscribe(),this.annotationSubscription=void 0}catch(e){this.catchError("Error in ReactionPinComponent unsubscribe: ",e)}}catchError(e,n,r){try{this.loggingService.catch(e,n,N(R({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(n){return new(n||o)(v(Pe),v(I),v(le),v(ce),v(O),v(ge),v(_))},o.\u0275cmp=w({type:o,selectors:[["app-reaction-pin"]],viewQuery:function(n,r){if(n&1&&(vt(wi,5),vt(Pi,5)),n&2){let c;pt(c=gt())&&(r.trigger=c.first),pt(c=gt())&&(r.overlay=c.first)}},inputs:{type:"type",annotationId:"annotationId",disableTooltip:"disableTooltip",customTooltipTemplate:[0,"tooltipTemplate","customTooltipTemplate"],variant:"variant",shadowDom:"shadowDom",parentMetadata:"parentMetadata",excludeReactionIds:"excludeReactionIds",commentReactionAnnotationIds:"commentReactionAnnotationIds",reactionId:[0,"reaction-id","reactionId"]},outputs:{click:"click"},standalone:!1,features:[M([_]),P,Ce],decls:1,vars:1,consts:[["triggerTemplate",""],["tooltipTemplate",""],["defaultTooltipTemplate",""],[4,"ngIf"],[3,"positions","disabled",4,"ngIf"],[3,"ngSwitch"],["class","s-emoji-block_timeline",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"s-emoji-block_timeline"],["role","button",1,"s-emoji-block__item",3,"click"],["role","img","aria-hidden","true",1,"s-emoji-block__item__emoji",3,"innerHTML"],["role","button",1,"velt-reaction-pin",3,"click"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"],[3,"positions","disabled"],["class","s-emoji-block__item","role","button",3,"active","click",4,"ngIf"],["height","34px","width","51px","borderRadius","8px",4,"ngIf"],["class","velt-reaction-pin","role","button",3,"velt-reaction-pin--default","active","velt-reaction-pin--no-reactions","click",4,"ngIf"],["height","34px","width","51px","borderRadius","8px"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"shadowDom","variant","componentConfigSignal","darkMode"]],template:function(n,r){n&1&&d(0,Qi,2,1,"ng-container",3),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ve,Mt,jt,At,cn,A,at,ze,We,Xe,rt,W],styles:["[_nghost-%COMP%]:empty{display:none}.s-emoji-block_timeline[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--velt-spacing-sm);width:18px;height:18px}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item[_ngcontent-%COMP%]{display:flex;align-items:center}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__count[_ngcontent-%COMP%]{display:none}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji{display:flex;align-items:center;justify-content:center}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji svg, .s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji img{width:16px!important;height:16px!important} .snippyly-reaction-dialog-overlay-panel{z-index:2147483577}"],changeDetection:0});let t=o;return t})();var Sn=t=>({componentConfigSignal:t}),qi=(t,o)=>({condition:t,data:o}),eo=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-inline-reactions-section-list-wireframe",variant:i,setIfCondition:e,componentElementRef:n,replaceTemplate:!1});function to(t,o){if(t&1){let i=Z();p(0),b(1,"div",6)(2,"app-reaction-pin",7),q("click",function(n){J(i);let r=a(4).ngIf;return K(r==null?null:r.onReactionClick(n))}),x()(),g()}if(t&2){let i=o.$implicit,e=a(4).ngIf,n=a();s(2),l("annotationId",i==null?null:i.annotationId)("shadowDom",!!(e!=null&&e.shadowDom))("variant",e==null?null:e.variant)("darkMode",!!(e!=null&&e.darkMode))("template",n.pinTemplate)}}function no(t,o){if(t&1&&(b(0,"div",4),d(1,to,3,5,"ng-container",5),x()),t&2){let i=a(3).ngIf;s(),l("ngForOf",i==null?null:i.annotations)("ngForTrackBy",i.reactionAnnotationsTrackByFn)}}function io(t,o){if(t&1&&(p(0),d(1,no,2,2,"div",3),g()),t&2){let i=a(2).ngIf;s(),l("ngIf",(i==null||i.annotations==null?null:i.annotations.length)>0)}}function oo(t,o){if(t&1&&(p(0),d(1,io,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,eo,e.template,y(1,Sn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function ro(t,o){if(t&1&&(p(0),d(1,oo,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,qi,i.conditionSignal(),y(1,Sn,i.componentConfigSignal)))}}var Ge=(()=>{let o=class o extends z{constructor(e,n,r,c){super(e,r,c),this.elementRef=e,this.wireframeService=n,this.dynamicDataService=r,this.loggingService=c,this.subscriptions=[],super.initializeComponentConfigSignal(new ye)}ngOnInit(){try{if(super.ngOnInit(),!this.template){let e="velt-inline-reactions-section-list-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(n=>{if(n){let r=document.createElement(n.tagName);r.innerHTML=n.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent ngOnDestroy:",e)}}getChildTemplate(){try{if(!this.pinTemplate&&this.template){let e=this.template.querySelector("velt-reaction-pin-wireframe");be(e)||(this.pinTemplate=e)}}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent getChildTemplate:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(ce),v(_),v(I))},o.\u0275cmp=w({type:o,selectors:[["app-inline-reactions-section-list"]],inputs:{variant:"variant"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-inline-reactions-section--reactions",4,"ngIf"],[1,"velt-inline-reactions-section--reactions"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"velt-inline-reactions-section--reaction"],[3,"click","annotationId","shadowDom","variant","darkMode","template"]],template:function(n,r){n&1&&d(0,ro,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[we,j,A,U,Ae],styles:[".velt-inline-reactions-section--reactions[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--velt-spacing-xs)}[_nghost-%COMP%] .velt-reaction-pin--default{display:inline-flex;height:28px;padding:var(--velt-spacing-2xs) var(--velt-spacing-sm);align-items:center;gap:var(--velt-spacing-xs);flex-shrink:0;border-radius:var(--velt-border-radius-2xl);border:1px solid var(--velt-border-0);background:var(--velt-background-0);color:var(--velt-text-0);box-sizing:border-box;cursor:pointer}[_nghost-%COMP%] .velt-reaction-pin--default.active{border-radius:var(--velt-border-radius-2xl);border:1px solid var(--velt-accent);background:var(--velt-accent-transparent);color:var(--velt-accent)}[_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji{line-height:1;display:flex}[_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji svg, [_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji img, [_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji span{width:14px;height:14px;margin:0;font-size:14px;line-height:1}[_nghost-%COMP%] .velt-reaction-pin--default .s-emoji-block__item__count{font-size:var(--velt-font-size-sm);color:var(--velt-text-3)}"],changeDetection:0});let t=o;return t})();var ke=class{};var yn=t=>({componentConfigSignal:t}),co=(t,o)=>({condition:t,data:o}),lo=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reactions-panel-item-emoji-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function so(t,o){if(t&1&&(p(0),F(1,"div",3),g()),t&2){let i=a(4);s(),l("innerHTML",i.emoji.value,Te),k("data-testid",i.componentId+"-emoji")}}function mo(t,o){if(t&1&&(p(0),d(1,so,2,2,"ng-container",0),g()),t&2){let i=a(3);s(),l("ngIf",i.emoji)}}function vo(t,o){if(t&1&&(p(0),d(1,mo,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,lo,e.template,y(1,yn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function po(t,o){if(t&1&&(p(0),d(1,vo,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,co,i.conditionSignal(),y(1,yn,i.componentConfigSignal)))}}var Je=(()=>{let o=class o extends z{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reactions-panel-item-emoji",super.initializeComponentConfigSignal(new ke)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;this.emoji?.key&&e.setAttribute("aria-label",this.emoji.key),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reactions-panel-item-emoji-internal"]],inputs:{emoji:"emoji"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-reactions-panel-item-emoji",3,"innerHTML"]],template:function(n,r){n&1&&d(0,po,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U],styles:["[_nghost-%COMP%] .velt-reactions-panel-item-emoji{display:flex;height:24px;width:24px;max-width:unset;margin:0;font-size:var(--velt-font-size-lg);line-height:1}[_nghost-%COMP%] .velt-reactions-panel-item-emoji svg, [_nghost-%COMP%] .velt-reactions-panel-item-emoji img, [_nghost-%COMP%] .velt-reactions-panel-item-emoji span{height:100%;width:100%;max-width:unset;margin:0;font-size:var(--velt-font-size-lg);line-height:1}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var uo=t=>({componentConfigSignal:t}),ho=(t,o)=>({condition:t,data:o}),fo=(t,o)=>({emoji:t,componentConfigSignal:o}),_o=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reactions-panel-item-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function Co(t,o){if(t&1&&(p(0),F(1,"velt-reactions-panel-item-emoji-internal",4),g()),t&2){let i=a(4);s(),l("emoji",i.emoji),k("data-testid",i.componentId+"-emoji")}}function bo(t,o){if(t&1){let i=Z();p(0),b(1,"div",2),E(2,"translate"),q("click",function(){J(i);let n=a(2).ngIf,r=a();return K(n==null?null:n.handleEmojiSelected(r.emoji.key))}),d(3,Co,2,2,"ng-container",3),x(),g()}if(t&2){let i=a(2).ngIf,e=a();s(),k("aria-label",D(2,3,e.ariaLabel))("data-testid",e.componentId+"-item"),s(2),l("veltDynamicTemplate",B(8,_o,e.template,T(5,fo,e.emoji,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function xo(t,o){if(t&1&&(p(0),d(1,bo,4,14,"ng-container",0),g()),t&2){let i=a().ngIf,e=a();s(),l("ngIf",i&&e.emoji)}}function Io(t,o){if(t&1&&(p(0),d(1,xo,2,1,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,ho,i.conditionSignal(),y(1,uo,i.componentConfigSignal)))}}var Ke=(()=>{let o=class o extends z{set _itemWireframe(e){this.itemWireframe=e,this.itemWireframe?this.template=this.domService.deepCloneElement(this.itemWireframe):this.template=null}constructor(e,n,r,c){super(n,c,r),this.domService=e,this.elementRef=n,this.loggingService=r,this.dynamicDataService=c,this.componentId="velt-reactions-panel-item",super.initializeComponentConfigSignal(new ke)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent ngOnDestroy:",e)}}get ariaLabel(){return this.emoji?.key||"Emoji"}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(xe),v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reactions-panel-item-internal"]],inputs:{emoji:"emoji",_itemWireframe:[0,"itemWireframe","_itemWireframe"]},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[1,"velt-reactions-panel-item",3,"click"],[4,"veltDynamicTemplate"],[3,"emoji"]],template:function(n,r){n&1&&d(0,Io,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,Je,W],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reactions-panel-item[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-2xs) var(--velt-spacing-xs);border-radius:var(--velt-border-radius-sm);background:transparent;cursor:pointer}.velt-reactions-panel-item[_ngcontent-%COMP%]:hover{background:var(--legacy-velt-border-color)}"],changeDetection:0});let t=o;return t})();var kn=t=>({componentConfigSignal:t}),yo=(t,o)=>({condition:t,data:o}),ko=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reactions-panel-items-wireframe",variant:i,setIfCondition:e,componentElementRef:n,replaceTemplate:!1});function Ro(t,o){if(t&1&&(p(0),F(1,"velt-reactions-panel-item-internal",5),g()),t&2){let i=o.$implicit,e=a(4);s(),l("itemWireframe",e.itemTemplate)("componentConfigSignal",e.componentConfigSignal)("emoji",i),k("data-testid",e.componentId+"-item-"+i.key)}}function Eo(t,o){if(t&1&&(p(0),b(1,"div",3),E(2,"translate"),d(3,Ro,2,4,"ng-container",4),x(),g()),t&2){let i=a(3);s(),k("aria-label",D(2,4,"Choose a reaction"))("data-testid",i.componentId+"-list"),s(2),l("ngForOf",i.filteredEmojis())("ngForTrackBy",i.trackByEmojiKey)}}function To(t,o){if(t&1&&(p(0),d(1,Eo,4,6,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,ko,e.template,y(1,kn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Do(t,o){if(t&1&&(p(0),d(1,To,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,yo,i.conditionSignal(),y(1,kn,i.componentConfigSignal)))}}var Qe=(()=>{let o=class o extends z{constructor(e,n,r,c){super(r,c,n),this.emojiService=e,this.loggingService=n,this.elementRef=r,this.dynamicDataService=c,this.componentId="velt-reactions-panel-items",this.filteredEmojis=Pt(()=>{try{let u=this.componentConfigSignal()?.excludeReactionIds||[],S=this.emojiService.emojisSignal();return u.length?Object.entries(S).filter(([h])=>!u.includes(h)).map(([h,f])=>({key:h,value:f})):Object.entries(S).map(([h,f])=>({key:h,value:f}))}catch(u){return this.loggingService.catch("Error in ReactionsPanelItemsComponent filteredEmojis:",u),[]}}),super.initializeComponentConfigSignal(new ke)}ngOnInit(){try{if(super.ngOnInit(),this.setupA11yAttributes(),!this.itemTemplate){let e=this.template?.querySelector("velt-reactions-panel-item-wireframe");be(e)||(this.itemTemplate=e)}}catch{}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemsComponent ngOnDestroy:",e)}}trackByEmojiKey(e,n){return n?.key||e}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemsComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(Se),v(I),v(O),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reactions-panel-items-internal"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-reactions-panel-items"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"itemWireframe","componentConfigSignal","emoji"]],template:function(n,r){n&1&&d(0,Do,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[we,j,A,U,Ke,W],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reactions-panel-items[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-xs);flex-wrap:wrap}"],changeDetection:0});let t=o;return t})();var wo=t=>({componentConfigSignal:t}),Po=(t,o)=>({template:t,context:o});function Mo(t,o){t&1&&de(0)}function jo(t,o){if(t&1&&(b(0,"velt-shadow-dom-internal"),d(1,Mo,1,0,"ng-container",3),x()),t&2){a();let i=X(3),e=a();k("data-testid",e.componentId+"-shadow-dom"),s(),l("ngTemplateOutlet",i)}}function Ao(t,o){if(t&1&&(p(0),F(1,"velt-reactions-panel-items-internal",6),g()),t&2){let i=a(3);s(),l("componentConfigSignal",i.componentConfigSignal),k("data-testid",i.componentId+"-items")}}function Fo(t,o){if(t&1){let i=Z();b(0,"div",4),E(1,"translate"),q("clickOutside",function(){J(i);let n=a(2);return K(n.onClickOutside())}),d(2,Ao,2,2,"ng-container",5),x()}if(t&2){let i=a(2);fe("velt-reactions-panel--inline-section-mode",i.isInlineSectionMode)("velt-reactions-panel--default",!i.template)("dark",i.darkMode),k("aria-label",D(1,9,"Available reactions"))("data-testid",i.componentId+"-panel"),s(2),l("veltDynamicTemplate",T(13,Po,i.template,y(11,wo,i.componentConfigSignal)))}}function No(t,o){if(t&1&&(p(0),d(1,jo,2,2,"velt-shadow-dom-internal",2)(2,Fo,3,16,"ng-template",null,0,oe),g()),t&2){let i=X(3),e=a();s(),l("ngIf",e.shadowDom&&!e.template||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}var St=(()=>{let o=class o extends ue{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,n,r,c,u,S){super(r,c,void 0,void 0,void 0,S,n),this.emojiService=e,this.loggingService=n,this.elementRef=r,this.themeService=c,this.wireframeService=u,this.dynamicDataService=S,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.isInlineSectionMode=!1,this.excludeReactionIds=[],this.emojiSelected=new he,this.hideTooltip=new he,this.componentConfigSignal=Oe({variant:this.variant,onClickOutside:this.onClickOutside.bind(this),handleEmojiSelected:this.handleEmojiSelected.bind(this),excludeReactionIds:this.excludeReactionIds}),this.subscriptions=[],this.componentId="velt-reactions-panel"}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,n=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=n!==null&&n!=="false",this.setupA11yAttributes();let r="velt-reactions-panel-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(c=>{if(c){let u=document.createElement(c.tagName);u.innerHTML=c.innerHTML,this.template=u}}))}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent OnInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(n=>{this.componentConfigSignal.update(r=>(r=N(R({},r),{[n]:e[n].currentValue}),r))})}catch(n){this.loggingService.catch("Error in ReactionsPanelComponent ngOnChanges: ",n)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent setupA11yAttributes:",e)}}trackByEmojiKey(e,n){return n?.key||e}onClickOutside(){try{this.hideTooltip.emit()}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent onClickOutside: ",e)}}handleEmojiSelected(e){try{this.emojiSelected.emit(e),this.hideTooltip.emit()}catch(n){this.loggingService.catch("Error in ReactionsPanelComponent handleEmojiSelected: ",n)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent 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 ReactionsPanelComponent unsubscribe: ",e)}}};o.\u0275fac=function(n){return new(n||o)(v(Se),v(I),v(O),v(ge),v(ce),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reactions-panel-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant",isInlineSectionMode:"isInlineSectionMode",excludeReactionIds:"excludeReactionIds"},outputs:{emojiSelected:"emojiSelected",hideTooltip:"hideTooltip"},standalone:!1,features:[M([_]),P,Ce],decls:1,vars:1,consts:[["reactionsPanelRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["snippylyClickOutside","","role","list",1,"velt-reactions-panel",3,"clickOutside"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"]],template:function(n,r){n&1&&d(0,No,4,2,"ng-container",1),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ve,Ie,A,an,Qe,W],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)}[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-reactions-panel[_ngcontent-%COMP%]{max-width:100%;overflow:visible;border:1px solid var(--velt-border-5);border-radius:var(--velt-border-radius-md);transition:opacity .5s;padding:var(--velt-spacing-sm) var(--velt-spacing-md);background-color:var(--velt-background-0);font-style:normal;font-weight:400;font-size:var(--velt-font-size-xs);line-height:calc((2rem + 0px) * var(--velt-base-rem-unit));box-shadow:0 8px 16px -8px #0f0f0f1a}.velt-reactions-panel--inline-section-mode[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-2xl)}"],changeDetection:0});let t=o;return t})();var Uo=t=>({template:t}),Lo=()=>["snippyly-overlay-panel","snippyly-reaction-dialog-overlay-panel","velt-overlay-panel"];function zo(t,o){t&1&&de(0)}function Wo(t,o){if(t&1&&(b(0,"velt-shadow-dom-internal"),d(1,zo,1,0,"ng-container",4),x()),t&2){a();let i=X(2);s(),l("ngTemplateOutlet",i)}}function Vo(t,o){if(t&1&&(p(0),b(1,"div",8),Et(),b(2,"svg",9),F(3,"path",10)(4,"path",11)(5,"path",12),x()(),g()),t&2){let i=a(2);s(),fe("active",i.tooltipVisible)("no-padding",i.noPadding),k("data-testid",i.componentId+"-button"),s(),k("data-testid",i.componentId+"-icon")}}function $o(t,o){if(t&1){let i=Z();b(0,"velt-reactions-panel-internal",13),E(1,"translate"),q("emojiSelected",function(n){J(i);let r=a(2);return K(r.handleEmojiSelected(n))})("hideTooltip",function(){J(i);let n=a(2);return K(n.hideTooltip())}),x()}if(t&2){let i=a(2);l("darkMode",i.darkMode)("shadowDom",i.shadowDom)("variant",i.variant)("isInlineSectionMode",i.isInlineSectionMode)("excludeReactionIds",i.excludeReactionIds),k("data-testid",i.componentId+"-panel")("aria-label",D(1,7,"Reaction selector"))}}function Ho(t,o){if(t&1){let i=Z();b(0,"div",5,1),E(2,"translate"),q("pointerdown",function(){J(i);let n=a();return K(n.showTooltip())}),d(3,Vo,6,6,"ng-container",6),x(),d(4,$o,2,9,"ng-template",7,2,oe)}if(t&2){let i=X(1),e=X(5),n=a();fe("velt-reaction-btn-container--inline-section-mode",n.isInlineSectionMode),k("data-testid",n.componentId)("aria-expanded",n.tooltipVisible)("aria-haspopup",!0)("aria-label",D(2,14,"Add reaction")),s(3),l("veltDynamicTemplate",y(16,Uo,n.template)),s(),l("cdkConnectedOverlayOrigin",i)("cdkConnectedOverlayOpen",n.tooltipVisible)("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",wt(18,Lo))("cdkConnectedOverlayPositions",n.positions)("snippylyOverlay",e)("snippylyOverlayZIndex",2147483627)}}var Fe=(()=>{let o=class o extends ue{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,n,r,c,u,S,h,f,m){super(u,h,void 0,void 0,void 0,m,c),this.docService=e,this.domService=n,this.emojiService=r,this.loggingService=c,this.elementRef=u,this.reactionService=S,this.themeService=h,this.wireframeService=f,this.dynamicDataService=m,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.isInlineSectionMode=!1,this.noPadding=!1,this.excludeReactionIds=[],this.onReactionToolClick=new he,this.emojiSelected=new he,this.reactionToolOpen=new he,this.tooltipVisible=!1,this.customButtonAdded=!1,this.positions=[{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}].map(C=>new Nt({originX:C.originX,originY:C.originY},{overlayX:C.overlayX,overlayY:C.overlayY})),this.subscriptions=[],this.veltElement=!0,this.componentId="velt-reaction-tool"}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,n=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=n!==null&&n!=="false",this.setupA11yAttributes();let r="velt-reaction-tool-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(c=>{if(c){let u=document.createElement(c.tagName);u.innerHTML=c.innerHTML,this.template=u}}))}catch(e){this.loggingService.catch("Error in ReactionToolComponent OnInit: ",e)}}ngOnChanges(e){super.ngOnChanges(e)}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","button"),e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false")}catch(e){this.loggingService.catch("Error in ReactionToolComponent setupA11yAttributes:",e)}}trackByEmojiKey(e,n){return n?.key||e}onButtonSlotChange(){this.customButtonAdded=!0}showTooltip(){try{this.tooltipVisible=!0,this.toggleHostClass(),this.onReactionToolClick.emit()}catch(e){this.loggingService.catch("Error in ReactionToolComponent showTooltip: ",e)}}hideTooltip(){try{this.tooltipVisible=!1,this.toggleHostClass()}catch(e){this.loggingService.catch("Error in ReactionToolComponent hideTooltip: ",e)}}toggleHostClass(){try{this.tooltipVisible?(this.reactionToolOpen.emit(!0),this.domService.addClassToElement(this.elementRef.nativeElement,"reaction-tool-active"),this.domService.addClassToElement(this.elementRef.nativeElement,"velt-reaction-tool-open")):(this.reactionToolOpen.emit(!1),this.domService.removeClassFromElement(this.elementRef.nativeElement,"reaction-tool-active"),this.domService.removeClassFromElement(this.elementRef.nativeElement,"velt-reaction-tool-open"))}catch(e){this.loggingService.catch("Error in ReactionToolComponent toggleHostClass: ",e)}}handleEmojiSelected(e){try{this.emojiSelected.emit(e),this.hideTooltip(),this.videoPlayerId&&this.addReaction(e)}catch(n){this.loggingService.catch("Error in ReactionToolComponent handleEmojiSelected: ",n)}}addReaction(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;"),this.videoPlayerId){let n=this.docService.getLocation()?.locationId,r=this.docService.getLocation()?.location;if(n){let c=document.getElementById(this.videoPlayerId);c&&c instanceof HTMLVideoElement&&(c.paused||c.pause());let u=this.docService.getDocumentPaths(),h=this.reactionService.getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:u?.organizationId,documentId:u?.documentId??""}).find(f=>f.locationId===n);this.reactionService.addOrUpdateReaction(e,h?[h.annotationId]:[],r)}}}catch(n){this.loggingService.catch("Error in VeltVideoPlayerComponent addReaction: ",n)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.loggingService.catch("Error in ReactionToolComponent 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 ReactionToolComponent unsubscribe: ",e)}}};o.\u0275fac=function(n){return new(n||o)(v(Me),v(xe),v(Se),v(I),v(O),v(le),v(ge),v(ce),v(_))},o.\u0275cmp=w({type:o,selectors:[["app-reaction-tool"]],hostVars:1,hostBindings:function(n,r){n&2&&k("data-velt-element",r.veltElement)},inputs:{shadowDom:"shadowDom",variant:"variant",isInlineSectionMode:"isInlineSectionMode",videoPlayerId:"videoPlayerId",noPadding:"noPadding",excludeReactionIds:"excludeReactionIds"},outputs:{onReactionToolClick:"onReactionToolClick",emojiSelected:"emojiSelected",reactionToolOpen:"reactionToolOpen"},standalone:!1,features:[M([_]),P,Ce],decls:3,vars:2,consts:[["reactionToolRefRef",""],["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["part","container","cdkOverlayOrigin","","role","button",1,"v-reaction-btn-container",3,"pointerdown"],[4,"veltDynamicTemplate"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayPositions","snippylyOverlay","snippylyOverlayZIndex"],["part","button-container",1,"action-btn"],["part","button-icon","width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false",1,"action-btn-icon"],["d","M18.699 12.0222C18.7836 10.5835 18.4287 9.15318 17.6815 7.92091C16.9342 6.68864 15.83 5.71271 14.5152 5.1226C13.2004 4.5325 11.7373 4.35612 10.32 4.61687C8.90263 4.87762 7.59808 5.56317 6.57941 6.58257C5.56074 7.60196 4.87612 8.907 4.61637 10.3245C4.35663 11.742 4.53404 13.205 5.12508 14.5194C5.71612 15.8337 6.69284 16.9373 7.92564 17.6837C9.15844 18.43 10.589 18.7839 12.0276 18.6983M14.7629 17.1318H19.5M17.1315 14.7633V19.5004M9.23631 10.0262H9.24421M13.9734 10.0262H13.9813M9.63107 13.9738C10.1506 14.479 10.8627 14.7633 11.6049 14.7633C12.347 14.7633 13.0591 14.479 13.5786 13.9738","stroke","currentColor","stroke-width","1.33929","stroke-linecap","round","stroke-linejoin","round"],["d","M15.3496 10.6504C15.3496 11.2027 14.9019 11.6504 14.3496 11.6504C13.7973 11.6504 13.3496 11.2027 13.3496 10.6504C13.3496 10.0981 13.7973 9.65039 14.3496 9.65039C14.9019 9.65039 15.3496 10.0981 15.3496 10.6504Z","fill","currentColor"],["d","M10.9004 10.6504C10.9004 11.2027 10.4527 11.6504 9.90039 11.6504C9.34811 11.6504 8.90039 11.2027 8.90039 10.6504C8.90039 10.0981 9.34811 9.65039 9.90039 9.65039C10.4527 9.65039 10.9004 10.0981 10.9004 10.6504Z","fill","currentColor"],[3,"emojiSelected","hideTooltip","darkMode","shadowDom","variant","isInlineSectionMode","excludeReactionIds"]],template:function(n,r){if(n&1&&d(0,Wo,2,1,"velt-shadow-dom-internal",3)(1,Ho,6,19,"ng-template",null,0,oe),n&2){let c=X(2);l("ngIf",!r.template&&r.shadowDom||r.template&&r.isExplicitShadowDom)("ngIfElse",c)}},dependencies:[j,ve,Ut,Bt,Ie,A,rn,St,W],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;--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)}[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)}.v-reaction-btn-container[_ngcontent-%COMP%]{display:flex}.action-btn[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;padding:calc(var(--velt-spacing-md) / 2);border-radius:var(--velt-border-radius-full);border:2px solid transparent;background-color:transparent;color:var(--velt-text-4);cursor:pointer}.action-btn.no-padding[_ngcontent-%COMP%]{padding:0}.action-btn[_ngcontent-%COMP%] .action-btn-label[_ngcontent-%COMP%]{font-size:var(--velt-font-size-sm);padding-right:var(--velt-spacing-xs);font-weight:700;color:currentColor}.action-btn[_ngcontent-%COMP%] .action-btn-icon[_ngcontent-%COMP%]{width:calc((1.5rem + 0px) * var(--velt-base-rem-unit));height:calc((1.5rem + 0px) * var(--velt-base-rem-unit));color:currentColor}.action-btn[_ngcontent-%COMP%] .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{width:16px;height:16px;color:currentColor}.action-btn[_ngcontent-%COMP%]:focus{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-border-2);background-color:transparent;color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:focus .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:hover{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-border-2);background-color:var(--velt-background-2);color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:hover .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:active, .action-btn.active[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-accent);background-color:var(--velt-accent);color:var(--velt-accent-foreground)}.action-btn[_ngcontent-%COMP%]:active .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%], .action-btn.active[_ngcontent-%COMP%] .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn-icon[_ngcontent-%COMP%]{height:18px;width:18px}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{padding:calc(var(--velt-spacing-xs) - 1px)}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]:active, .velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn.active[_ngcontent-%COMP%]{border:1px solid var(--velt-accent-text);background:linear-gradient(0deg,#0006 0% 100%),var(--velt-accent)}"],changeDetection:0});let t=o;return t})();var Rn=t=>({componentConfigSignal:t}),Xo=(t,o)=>({condition:t,data:o}),Go=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-inline-reactions-section-tool-container-wireframe",variant:i,setIfCondition:e,componentElementRef:n,replaceTemplate:!1});function Jo(t,o){if(t&1){let i=Z();p(0),b(1,"div",3)(2,"app-reaction-tool",4),q("emojiSelected",function(n){J(i);let r=a(2).ngIf;return K(r.onEmojiSelected(n))}),x()(),g()}if(t&2){let i=a(2).ngIf,e=a();s(2),l("shadowDom",!1)("template",e.toolTemplate)("variant",i==null?null:i.variant)("darkMode",i.darkMode)}}function Ko(t,o){if(t&1&&(p(0),d(1,Jo,3,4,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,Go,e.template,y(1,Rn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Qo(t,o){if(t&1&&(p(0),d(1,Ko,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,Xo,i.conditionSignal(),y(1,Rn,i.componentConfigSignal)))}}var Ze=(()=>{let o=class o extends z{constructor(e,n,r,c){super(e,n,r),this.elementRef=e,this.dynamicDataService=n,this.loggingService=r,this.wireframeService=c,this.subscriptions=[],super.initializeComponentConfigSignal(new ye)}ngOnInit(){try{if(super.ngOnInit(),!this.template){let e="velt-inline-reactions-section-tool-container-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(n=>{if(n){let r=document.createElement(n.tagName);r.innerHTML=n.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent ngOnDestroy:",e)}}getChildTemplate(){try{if(!this.toolTemplate&&this.template){let e=this.template.querySelector("velt-reaction-tool-wireframe");be(e)||(this.toolTemplate=e)}}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent getChildTemplate:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(_),v(I),v(ce))},o.\u0275cmp=w({type:o,selectors:[["app-inline-reactions-section-tool-container"]],inputs:{variant:"variant"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section--tool-container"],[3,"emojiSelected","shadowDom","template","variant","darkMode"]],template:function(n,r){n&1&&d(0,Qo,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,Fe],styles:["[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn{border-radius:var(--velt-border-radius-2xl);background:var(--velt-background-0);padding:var(--velt-spacing-xs);border:none}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn .action-btn-icon{width:20px;height:20px}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn:hover{border-radius:var(--velt-border-radius-2xl);background:var(--velt-background-1)}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn:hover .action-btn-icon{color:var(--velt-accent)}"],changeDetection:0});let t=o;return t})();var En=t=>({componentConfigSignal:t}),qo=(t,o)=>({condition:t,data:o}),er=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-inline-reactions-section-panel-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function tr(t,o){if(t&1&&(p(0),b(1,"div",3),F(2,"app-inline-reactions-section-tool-container",4)(3,"app-inline-reactions-section-list",4),x(),g()),t&2){let i=a(3).ngIf,e=a();s(2),l("componentConfigSignal",e.componentConfigSignal)("variant",i==null?null:i.variant),s(),l("componentConfigSignal",e.componentConfigSignal)("variant",i==null?null:i.variant)}}function nr(t,o){if(t&1&&(b(0,"div"),d(1,tr,4,4,"ng-container",2),x()),t&2){let i=a(2).ngIf,e=a();s(),l("veltDynamicTemplate",B(3,er,e.template,y(1,En,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function ir(t,o){if(t&1&&(p(0),d(1,nr,2,9,"div",0),g()),t&2){let i=a().ngIf;s(),l("ngIf",!i.skeletonLoading)}}function or(t,o){if(t&1&&(p(0),d(1,ir,2,1,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",T(3,qo,i.conditionSignal(),y(1,En,i.componentConfigSignal)))}}var qe=(()=>{let o=class o extends z{constructor(e,n,r){super(e,n,r),this.elementRef=e,this.dynamicDataService=n,this.loggingService=r,super.initializeComponentConfigSignal(new ye)}ngOnInit(){try{super.ngOnInit()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionPanelComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionPanelComponent ngOnDestroy:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(_),v(I))},o.\u0275cmp=w({type:o,selectors:[["app-inline-reactions-section-panel"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section--panel"],[3,"componentConfigSignal","variant"]],template:function(n,r){n&1&&d(0,or,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,Ge,Ze],styles:[".velt-inline-reactions-section--panel[_ngcontent-%COMP%]{display:flex;gap:var(--velt-spacing-xs)}"],changeDetection:0});let t=o;return t})();var Tn=t=>({componentConfigSignal:t}),ar=(t,o)=>({condition:t,data:o}),cr=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-inline-reactions-section-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function lr(t,o){t&1&&de(0)}function sr(t,o){if(t&1&&(b(0,"velt-shadow-dom-internal"),d(1,lr,1,0,"ng-container",4),x()),t&2){a();let i=X(3);s(),l("ngTemplateOutlet",i)}}function mr(t,o){if(t&1&&(p(0),b(1,"div",6),F(2,"app-inline-reactions-section-panel",7),x(),g()),t&2){let i=a(5);s(2),l("componentConfigSignal",i.componentConfigSignal)}}function dr(t,o){if(t&1&&d(0,mr,3,1,"ng-container",5),t&2){let i=a(3).ngIf,e=a();l("veltDynamicTemplate",B(3,cr,e.template,y(1,Tn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function vr(t,o){if(t&1&&(p(0),d(1,sr,2,1,"velt-shadow-dom-internal",3)(2,dr,1,9,"ng-template",null,0,oe),g()),t&2){let i=X(3),e=a(3);s(),l("ngIf",!e.template&&e.shadowDom||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}function pr(t,o){if(t&1&&(p(0),d(1,vr,4,2,"ng-container",1),g()),t&2){let i=a().ngIf;s(),l("ngIf",(i==null?null:i.targetReactionElementId)&&i.user)}}function gr(t,o){if(t&1&&(p(0),d(1,pr,2,1,"ng-container",2),g()),t&2){let i=a();s(),l("veltIf",T(3,ar,i.conditionSignal(),y(1,Tn,i.componentConfigSignal)))}}var Ne=(()=>{let o=class o extends ue{set _targetReactionElementId(e){try{this.componentConfigSignal.update(n=>(n=N(R({},n),{targetReactionElementId:e}),n)),this.getReactionAnnotationsBySectionId(e)}catch{}}set _shadowDom(e){try{let n=e;typeof e=="string"&&(n=JSON.parse(e)),this.shadowDom=n,this.isExplicitShadowDom=!!n,this.componentConfigSignal.update(r=>(r=N(R({},r),{shadowDom:n}),r))}catch{}}set _customReactions(e){try{let n=e;typeof e=="string"&&(n=JSON.parse(e)),this.reactionService.setCustomReactions(n)}catch{}}constructor(e,n,r,c,u,S,h,f){super(h,S,void 0,c,void 0,f,r),this.authService=e,this.docService=n,this.loggingService=r,this.reactionService=c,this.wireframeService=u,this.themeService=S,this.elementRef=h,this.dynamicDataService=f,this.shadowDom=!0,this.isExplicitShadowDom=!1,this.componentConfigSignal=Oe({annotations:[],skeletonLoading:!0,darkMode:!1,variant:"inline",shadowDom:!0,onEmojiSelected:this.onEmojiSelected.bind(this),onReactionClick:this.onReactionClick.bind(this),reactionAnnotationsTrackByFn:this.reactionAnnotationsTrackByFn.bind(this)}),this.subscriptions=[];try{this.subscriptions.push(super.onDarkModeChange().subscribe(m=>{this.componentConfigSignal.update(C=>(C=N(R({},C),{darkMode:m}),C))})),this.subscriptions.push(this.authService.getUser$().subscribe(m=>{this.componentConfigSignal.update(C=>(C=N(R({},C),{user:m}),C))}))}catch(m){this.catchError("Error in InlineReactionsSectionComponent constructor: ",m)}}ngOnInit(){try{super.ngOnInit(),this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");let e="velt-inline-reactions-section-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(n=>{if(n){let r=document.createElement(n.tagName);r.innerHTML=n.innerHTML,this.template=r}}))}catch(e){this.catchError("Error in InlineReactionsSectionComponent OnInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(n=>{this.componentConfigSignal.update(r=>(r=N(R({},r),{[n]:e[n].currentValue}),r))})}catch(n){this.catchError("Error in InlineReactionsSectionComponent ngOnChanges: ",n)}}reactionAnnotationsTrackByFn(e,n){return n?.annotationId}getReactionAnnotationsBySectionId(e){try{this.reactionService.getReactionAnnotationsBySectionId(e).subscribe(n=>{this.componentConfigSignal.update(r=>(r=N(R({},r),{annotations:n||[],skeletonLoading:!1}),r))})}catch(n){this.catchError("Error in InlineReactionsSectionComponent getReactionsBySectionId: ",n)}}onEmojiSelected(e){try{let n=this.componentConfigSignal().targetReactionElementId,r=this.componentConfigSignal().annotations?.map(c=>c?.annotationId)||[];this.reactionService.addOrUpdateReaction(e,r,void 0,n)}catch(n){this.catchError("Error in InlineReactionsSectionComponent onEmojiSelected: ",n)}}onReactionClick(e){try{if(e?.icon){let n=this.componentConfigSignal().annotations?.map(r=>r?.annotationId)||[];this.reactionService.addOrUpdateReaction(e.icon,n,void 0,this.componentConfigSignal().targetReactionElementId)}}catch(n){this.catchError("Error in InlineReactionsSectionComponent onReactionClick: ",n)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.catchError("Error in InlineReactionsSectionComponent ngOnDestroy: ",e)}}catchError(e,n,r){try{let c;this.componentConfigSignal()?.annotations?.length&&(c=this.componentConfigSignal()?.annotations[0]?.annotationId),this.loggingService.catch(e,n,N(R({},r||{}),{annotationId:c}))}catch{}}};o.\u0275fac=function(n){return new(n||o)(v(Pe),v(Me),v(I),v(le),v(ce),v(ge),v(O),v(_))},o.\u0275cmp=w({type:o,selectors:[["app-inline-reactions-section"]],inputs:{_targetReactionElementId:[0,"targetReactionElementId","_targetReactionElementId"],_shadowDom:[0,"shadowDom","_shadowDom"],variant:"variant",_customReactions:[0,"customReactions","_customReactions"]},standalone:!1,features:[M([_]),P,Ce],decls:1,vars:1,consts:[["commentToolRefRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section"],[3,"componentConfigSignal"]],template:function(n,r){n&1&&d(0,gr,2,6,"ng-container",1),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ve,Ie,A,U,qe],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)}[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)}"],changeDetection:0});let t=o;return t})();var lt=class extends dn{constructor(o){super(o),this.getService(I).log("%c[WB] Creating CLASS: ReactionElement","color: blue;"),this.enableDarkMode=this._enableDarkMode,this.disableDarkMode=this._disableDarkMode,this.setCustomReactions=this._setCustomReactions}_enableDarkMode(){this.getService(I).log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;");try{this.trackEvent(nt.Events.Reactions.ENABLE_DARK_MODE_TRIGGERED),this.getService(le).enableDarkMode()}catch(o){this.getService(I).catch("Error in _enableDarkMode: ",o)}}_disableDarkMode(){this.getService(I).log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;");try{this.trackEvent(nt.Events.Reactions.DISABLE_DARK_MODE_TRIGGERED),this.getService(le).disableDarkMode()}catch(o){this.getService(I).catch("Error in _disableDarkMode: ",o)}}_setCustomReactions(o){this.getService(I).log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;");try{this.trackEvent(nt.Events.Reactions.SET_CUSTOM_REACTIONS_TRIGGERED,{payload:{reactions:o}}),this.getService(le).setCustomReactions(o)}catch(i){this.getService(I).catch("Error in _setCustomReactions: ",i)}}};var Dn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=Dt({type:o}),o.\u0275inj=Rt({imports:[Ft,Lt,sn]});let t=o;return t})();var ur={"velt-reaction-pin-emoji-wireframe":ze,"velt-reaction-pin-count-wireframe":We,"velt-reaction-pin-tooltip-wireframe":Xe,"velt-reaction-pin-tooltip-users-wireframe":Ye,"velt-reaction-pin-tooltip-user-wireframe":He,"velt-reaction-pin-tooltip-user-avatar-wireframe":Ve,"velt-reaction-pin-tooltip-user-name-wireframe":$e,"velt-reactions-panel-items-wireframe":Qe,"velt-reactions-panel-item-wireframe":Ke,"velt-reactions-panel-item-emoji-wireframe":Je,"velt-inline-reactions-section-wireframe":Ne,"velt-inline-reactions-section-tool-container-wireframe":Ze,"velt-inline-reactions-section-list-wireframe":Ge,"velt-inline-reactions-section-panel-wireframe":qe};Object.assign(on,ur);function hr(t){t.get(I).log("%c[WB] Loading reaction feature chunk","color: blue;");let i=t.get(ot),e=t.get(le);i.set(Zt,e);let r=Tt(Dn,t).injector;return Be(r,re.TAGS.VELT_REACTION_TOOL,Fe),Be(r,re.TAGS.SNIPPYLY_REACTION_TOOL,Fe),Be(r,re.TAGS.VELT_REACTION_PIN,Ae),Be(r,re.TAGS.SNIPPYLY_REACTION_PIN,Ae),Be(r,re.TAGS.VELT_INLINE_REACTIONS_SECTION,Ne),Be(r,re.TAGS.SNIPPYLY_INLINE_REACTIONS_SECTION,Ne),new lt(t)}function Be(t,o,i){if(customElements.get(o))return;let e=zt(i,{injector:t});customElements.define(o,e)}export{hr as default};